Plumbing seems mysterious, mostly because so much of it is hidden inside walls. Household plumbing consists of a supply system, which brings water to the house and distributes it to various faucets and fixtures; a drain-waste system, which carries waste water away from the house; and a vent system, which carries away noxious gases and enables waste water to flow freely through drain pipes. In addition, you likely have gas lines, and you may have a septic system. Plumbing fundamentals are explained by supply system, drain system and vent system.
Supply system pipes are pretty straightforward. In most cases, a single supply pipe, usually an inch or larger in diameter (though sometimes 3/4 inch in older homes) runs through a main shutoff valve or two and a water meter to the water heater, where it branches into cold and hot water pipes.
Hot and cold water pipes travel in pairs towards the various plumbing fixtures in the house. Vertical pipes are called "risers." Supply pipes in an older home are likely made of galvanized steel, which corrodes and gets blocked up with deposits in time. Most newer homes use copper pipe, which reliably supplies good water pressure. Some newer homes use rigid plastic pipe such as CPVC, or flexible or cross-linked polyethylene (PE or Pa) pipe, but these materials are approved only in some locales.
After entering the house, supply pipes usually narrow. The larger the pipe diameter, the better the water pressure. Ideally, pipes that run to various rooms will be 3/4 inch, and only the pipes inside a room will be 1/2 inch. However, in many homes nearly all the pipes are 1/2 inch. This can be a problem, especially if the pipes are made of galvanized steel, which when it gets clogged with mineral deposits can limit water pressure.
At each fixture, there should be a stop valve, also called a fixture shutoff valve, for the hot and cold lines. From the stop valve, flexible supply tubes (sometimes called risers) usually lead to the faucet or toilet. A shower has a particular configuration of supply pipes.
Drain system pipes are more complicated, especially when you include the vent pipes. Drain pipes must be installed according to exacting specifications. Never install drain pipes without consulting your local building department and getting a permit. Older homes often use cast-iron drain pipes. These typically last for many decades, but they sometimes rust or corrode in places. Newer homes use plastic pipe, either white PVC or black ABS. Plastic pipe is more reliable, and easier to install as well. In some cases, copper pipe is also used for some drains. In an older home, some of the smaller drain pipes—typically, the horizontal runs from a faucet to the main drain, are made of galvanized steel.
The main stack is usually a pipe 3 or 4 inches in diameter that runs straight down to the sewer line and up through the roof, where it serves as a vent. Many homes also have one or two secondary stacks, typically 2 or 3 inches in diameter; these usually provide drainage for a specific room—most often, the kitchen.
Branch drain pipes usually travel horizontally from a fixture to a stack. These pipes are often 1 1/4 to 2 inches in diameter, 1 1/2 inches in the case of a bathroom sink. Horizontal branch drain pipes must slope at a rate of at least 1/4 inch per foot at all points. Plumbing codes specify the use of certain types of fittings to ensure smooth flow of drain water. In general, a fitting that makes a slow, sweeping turn is preferable to one that makes a sharp turn.
A good drain system has cleanouts located in places that are easy to access. These cleanouts allow access to the pipes so you can auger the pipes to clear away clogs.
Leading from a sink to a drain pipe in the wall, you will usually find a trap made of special materials that can be easily disassembled for cleaning and augering. Traps are usually P-shaped, so that a slug of water forms a seal at the bottom; this seal prevents gases from entering the room.
For drain water to flow freely, there must be air behind or above the water. If water completely fills the diameter of a drain pipe and there is no source of air behind it, the water will gurgle and flow sluggishly. In some cases, water that fills a pipe can actually siphon, causing waste water to back up into a toilet or sink. In a home plumbing system, vent system pipes supply the air that makes for smooth-flowing waste water.
Vent pipes also allow methane and other nasty gases to escape out the roof, rather than into a bathroom. Such gases are both unpleasant and dangerous, so it's important that the vent system works well. The portion of a main or secondary stack that extends out the roof is called a main or secondary vent. Branch vents lead to these stacks. Plumbing codes are very specific about how and where these pipes should run and what size they should be.
One important venting consideration is the diameter of the drain pipes. If a drain pipe is large enough, it will virtually never get filled with water at any point, and so virtually acts as its own vent.
Every plumbing fixture must be connected to a vent of some sort, and it must be connected in a way that meets local plumbing codes. In some cases, a special fitting called an air admittance valve (MV) is allowed to augment or even take the place of a vent that runs through the roof.