Anti-aircraft warfare
Terminology: It may also be called counter-air, anti-air, AA, flak, layered air defence or air defence forces.
The term air defence was probably first used by the UK when Air Defence of Great Britain (ADGB) was created as a Royal Air Force command in 1925. However, arrangements in the UK were also called "anti-aircraft", abbreviated as AA, a term that remained in general use into the 1950s. After the First World War it was sometimes prefixed by "light" or "heavy" (LAA or HAA) to classify a type of gun or unit. Nicknames for anti-aircraft guns include "AA", "AAA" or "triple-A" (abbreviations of "anti-aircraft artillery"),  "flak" (from the German Flugzeugabwehrkanone), "ack-ack" (from the spelling alphabet used by the British for voice transmission of "AA"); and "archie" (a World War I British term probably coined by Amyas Borton, and believed to derive via the Royal Flying Corps, from the music-hall comedian George Robey's line "Archibald, certainly not!").
NATO defines anti-aircraft warfare (AAW) as "measures taken to defend a maritime force against attacks by airborne weapons launched from aircraft, ships, submarines and land-based sites". In some armies the term all-arms air defence (AAAD) is used for air defence by nonspecialist troops. Other terms from the late 20th century include "ground based air defence" (GBAD) with related terms "short range air defense" (SHORAD) and man-portable air-defense system (MANPADS). Anti-aircraft missiles are variously called surface-to-air missiles, ("SAMs") and surface-to-air guided weapons (SAGWs). Examples are the RIM-66 Standard, Raytheon Standard Missile 6, or the MBDA Aster missile.
Non-English terms for air defence include the German Flak or FlaK (Fliegerabwehrkanone, 'aircraft defence cannon', also cited as Flugabwehrkanone), whence English flak, and the Russian term Protivovozdushnaya oborona (Cyrillic: Противовозду́шная оборо́на), a literal translation of 'anti-air defence', abbreviated as PVO. In Russian, the AA systems are called zenitnye (i.e., 'pointing to zenith') systems. In French, air defence is called Défense contre les aéronefs (DCA) , aéronef  meaning 'aircraft'.
The maximum distance at which a gun or missile can engage an aircraft is an important figure. However, many different definitions are used and unless the same definition is used, performance of different guns or missiles cannot be compared. For AA guns only the ascending part of the trajectory can be usefully used. One term is "ceiling", the maximum ceiling being the height a projectile would reach if fired vertically, not practically useful in itself as few AA guns are able to fire vertically, and the maximum fuse duration may be too short, but potentially useful as a standard to compare different weapons.
The British adopted "effective ceiling", meaning the altitude at which a gun could deliver a series of shells against a moving target; this could be constrained by maximum fuse running time as well as the gun's capability. By the late 1930s the British definition was "that height at which a directly approaching target at 400 mph [640 km/h] can be engaged for 20 seconds before the gun reaches 70 degrees elevation".

General description: The essence of air defence is to detect hostile aircraft and destroy them. The critical issue is to hit a target moving in three-dimensional space; an attack must not only match these three coordinates, but must do so at the time the target is at that position. This means that projectiles either have to be guided to hit the target, or aimed at the predicted position of the target at the time the projectile reaches it, taking into account the speed and direction of both the target and the projectile.
Throughout the 20th century, air defence was one of the fastest-evolving areas of military technology, responding to the evolution of aircraft and exploiting technology such as radar, guided missiles and computing (initially electromechanical analogue computing from the 1930s on, as with equipment described below). Improvements were made to sensors, technical fire control, weapons, and command and control. At the start of the 20th century these were either very primitive or non-existent.
Initially sensors were optical and acoustic devices developed during World War I and continued into the 1930s, but were quickly superseded by radar, which in turn was supplemented by optoelectronics in the 1980s.
Command and control remained primitive until the late 1930s, when Britain created an integrated system for ADGB that linked the ground-based air defence of the British Army's Anti-Aircraft Command, although field-deployed air defence relied on less sophisticated arrangements. NATO later called these arrangements an "air defence ground environment", defined as "the network of ground radar sites and command and control centres within a specific theatre of operations which are used for the tactical control of air defence operations".
Rules of engagement are critical to prevent air defences engaging friendly or neutral aircraft. Their use is assisted but not governed by identification friend or foe (IFF) electronic devices originally introduced during the Second World War. While these rules originate at the highest authority, different rules can apply to different types of air defence covering the same area at the same time. AAAD usually operates under the tightest rules.
NATO calls these rules "weapon control orders" (WCO), they are:

Weapons free: weapons may be fired at any target not positively recognised as friendly.
Weapons tight: weapons may be fired only at targets recognised as hostile.
Weapons hold: weapons may only be fired in self-defence or in response to a formal order.
Until the 1950s, guns firing ballistic munitions were the standard weapon; guided missiles then became dominant, except at the very shortest ranges. However, the type of shell or warhead and its fuzing and, with missiles, the guidance arrangement were and are varied. Targets are not always easy to destroy; nonetheless, damaged aircraft may be forced to abort their mission and, even if they manage to return and land in friendly territory, may be out of action for days or permanently. Ignoring small arms and smaller machine-guns, ground-based air defence guns have varied in calibre from 20 mm to at least 152 mm.
Ground-based air defence is deployed in several ways:

Self-defence by ground forces using their organic weapons, AAAD.
Accompanying defence, specialist air defence elements accompanying armoured or infantry units.
Point defence around a key target, such as a bridge, critical government building or ship.
Area air defence, typically "belts" of air defence to provide a barrier, but sometimes an umbrella covering an area. Areas can vary widely in size. They may extend along a nation's border, e.g. the Cold War MIM-23 Hawk and Nike belts that ran north–south across Germany, across a military formation's manoeuvre area, or above a city or port. In ground operations air defence areas may be used offensively by rapid redeployment across current aircraft transit routes.
Air defence has included other elements, although after the Second World War most fell into disuse:

Tethered barrage balloons to deter and threaten aircraft flying below the height of the balloons, where they are susceptible to damaging collisions with steel tethers.
Cables strung across valleys, sometimes forming a "curtain" with vertical cables hanging from them.
Searchlights to illuminate aircraft at night for both gun-layers and optical instrument operators. During World War II searchlights became radar controlled.
Large smoke screens created by large smoke canisters on the ground to screen targets and prevent accurate weapon aiming by aircraft.
Passive air defence is defined by NATO as "Passive measures taken for the physical defence and protection of personnel, essential installations and equipment in order to minimise the effectiveness of air and/or missile attack". It remains a vital activity by ground forces and includes camouflage and concealment to avoid detection by reconnaissance and attacking aircraft. Measures such as camouflaging important buildings were common in the Second World War. During the Cold War the runways and taxiways of some airfields were painted green.

Organization: While navies are usually responsible for their own air defence—at least for ships at sea—organisational arrangements for land-based air defence vary between nations and over time.
The most extreme case was the Soviet Union and this model may still be followed in some countries: it was a separate service, on a par with the army, navy, or air force. In the Soviet Union, this was called Voyska PVO, and had both fighter aircraft, separate from the air force, and ground-based systems. This was divided into two arms, PVO Strany, the Strategic Air defence Service responsible for Air Defence of the Homeland, created in 1941 and becoming an independent service in 1954, and PVO SV, Air Defence of the Ground Forces. Subsequently, these became part of the air force and ground forces respectively.
At the other extreme, the United States Army has an Air Defense Artillery Branch that provides ground-based air defence for both homeland and the army in the field; however, it is operationally under the Joint Force Air Component Commander. Many other nations also deploy an air-defence branch in the army.