In modern plumbing, a drain-waste-vent (or DWV) is part of a system that removes sewage and greywater from a building, and regulates air pressure in the waste-system pipes to aid free flow. Waste is produced at fixtures such as toilets, sinks, and showers, and exits the fixtures through a trap, a dipped section of pipe that always contains water.
DWV systems maintain neutral air pressure in the drains, allowing free flow of water and sewage down drains and through waste pipes by gravity. It is critical that a sufficient downward slope be maintained throughout, to keep liquids and entrained solids flowing freely towards the main drain from the building. In relatively rare situations, a downward slope out of a building to the sewer cannot be created, and a special collection pit and grinding lift “sewage ejector” pump are needed. By contrast, potable water supply systems operate under pressure to distribute water up through buildings, and do not require a continuous downward slope in their piping.
Every fixture is required to have an internal or external trap; double trapping is prohibited by plumbing codes due to its susceptibility to clogging. Every plumbing fixture must also have an attached vent. The top of stacks must be vented too, via a stack vent, which is sometimes called a stink pipe.
All plumbing waste fixtures use traps to prevent sewer gases from leaking into the house. Through traps, all fixtures are connected to waste lines, which in turn take the waste to a “soil stack”, or “soil vent pipe”. At the building drain system’s lowest point, the drain-waste vent is attached, and rises (usually inside a wall) to and out of the roof. Waste exits from the building through the building’s main drain and flows through a sewage line, which leads to a septic system or a public sewer. Cesspits are generally prohibited in developed areas.
The venting system, or plumbing vents, consists of a number of pipes leading from waste pipes to the outdoors, usually through the roof. Vents provide a means to release sewer gases outside instead of inside the house. Vents also admit oxygen to the waste system to allow aerobic sewage digestion, and to discourage noxious anaerobic decomposition. Vents provide a way to equalize the pressure on both sides of a trap, thereby allowing the trap to hold the water which is needed to maintain effectiveness of the trap, and avoiding “trap suckout” which otherwise might occur.
Read full article at: https://en.wikipedia.org/wiki/Drain-waste-vent_system