When you look at a bathroom plumbing diagram, you will notice a U-shaped piece called the P-trap. This piece of pipe collects water after each sink or bathtub use. This water acts as a barrier, preventing sewer gases from passing through the drainpipe.