Investment is the military process of surrounding an enemy fort (or town) with armed forces to prevent entry or escape. It serves both to cut communications with the outside world, and to prevent supplies and reinforcements from being introduced.
A circumvallation is a line of fortifications, built by the attackers around the besieged fortification facing towards an enemy fort (to protect the besiegers from sorties by its defenders and to enhance the blockade). The resulting fortifications are known as 'lines of circumvallation'. Lines of circumvallation generally consist of earthen ramparts and entrenchments that encircle the besieged city. The line of circumvallation can be used as a base for launching assaults against the besieged city or for constructing further earthworks nearer to the city.
A contravallation may be constructed in cases where the besieging army is threatened by a field army allied to an enemy fort. This is a second line of fortifications outside the circumvallation, facing away from an enemy fort. The contravallation protects the besiegers from attacks by allies of the city's defenders and enhances the blockade of an enemy fort by making it more difficult to smuggle in supplies.
Thucydides notes the role circumvallation played in the Spartan siege of Plataea during the initial stages of the Peloponnesian War in 429 BC.
Julius Caesar in his Commentaries on the Gallic War describes his textbook use of the circumvallation and contravallation to defeat the Gauls under their chieftain Vercingetorix at the Siege of Alesia in September 52 BC.
Another example from the pre-modern period is the siege of Constantinople in 717-718 AD. At that time, the Isaurian dynasty of emperors ruled in Constantinople. The Isaurian dynasty's founder, Leo the Isaurian, originally named Konon, was commander of the theme (i.e. province) of Anatolia, appointed by the Emperor Anastasius II Artemius. During Konon's term as general of the Anatolics, the Emperor Anastasius II had been deposed by the troops of the elite Opsician regiment, and replaced by an unwilling tax collector named Theodosius. He (Theodosius) finally accepted the offer of the purple, and was made Emperor Theodosius III. Theodosius, however, alienated the support of the Opsicians, and Konon, changing his name to Leo, took advantage of this and decided to use them to take the purple for himself. He allied with Artabasdus, the commander of the theme of Armenia, and was able to depose Theodosius III, becoming Leo III upon his accession to the Byzantine throne. Meanwhile, the leaders of the Islamic Empire took advantage of the violent anarchy within the Byzantine state to prepare a huge host, comprising more than 100,000 troops and 1,800 ships, to take them to the capital Constantinople. Upon arriving outside the Theodosian walls, the Arab host had some knowledge that the Emperor Leo had allied with Bulgaria under their khan Tervel, and so in preparation for the Bulgarian army, built such military investments, but they failed to work, and so the Arab army was defeated by a number of factors; the failure of their circumvallations and contravallations, the lack of supplies near the end of the siege, the (mostly) sudden and shocking arrival of Tervel's Bulgarian army, and most importantly, the use of a dangerously flammable substance invented by the Byzantines, an unknown mix of various ingredients that may have included naphtha, saltpetre, petroleum, pine resin, calcium phosphide, quicklime, sulphur and niter, that was called ″sea fire″ (Ancient Greek: πῦρ θαλάσσιον pyr thalássion) or ″Roman fire″ (πῦρ ῥωμαϊκόν pyr rhomaïkón), but is called Greek fire in modern historiography due to the Crusaders′ thinking that the Byzantine state was an Empire of the Greeks.