The waste fitting under the toilet is called the toilet, or closet, flange. It has a short length of pipe that connects to the waste line, usually by gluing, and a metal ring that you screw to the subfloor under the toilet. The ring has slots for the toilet bolts. You must set the ring at the right height relative to the finished floor to make a good seal and prevent the toilet from rocking.
How a Flange Works
The flange is basically a short length of waste pipe connected to a metal or plastic ring. The pipe extends through the subfloor and connects to the waste line while the ring sits flush against the surface of the subfloor. Screws hold the ring to the floor and it, in turn, holds the toilet down. There is a gap between the bottom of the toilet and the flange, and this gap is usually filled by a wax ring that has the same diameter as the flange opening. It compresses between the toilet and the flange to make a waterproof seal.
Setting a Flange to the Right Height
In order for the wax ring to seal properly, the top of the metal ring of the flange should be at the same level as the finished floor. Since it sits on the subfloor, this means that the ring should be approximately the same thickness as the flooring material. It is sometimes necessary to set the flange lower to accommodate a thinner flooring material during a remodel, and this can mean chiseling out a space for it in the subfloor. It is easier to raise a flange that is too low. You do this by adding a flange extender.
Problems When the Flange Is at the Wrong Height
If a flange is set too low, the wax ring may not make a reliable seal, giving rise to two problems: the first is that sewer gases can escape into the bathroom and the second is that water can leak out every time you flush the toilet. The second problem becomes serious in time as the water eventually rots the subfloor and creates other structural problems. When the flange is too high, the base of the toilet doesn't make contact with the floor, and the toilet rocks. If you leave it like this, the repeated impact of the toilet against the bolts can crack the porcelain.
You can raise the top of the ring of a flange that is set too low by adding an extra ring of metal or plastic called a flange extender. Do this by unscrewing the flange screws, setting the ring on top of the flange, aligning the holes, and screwing them both to the floor with longer screws. Lowering a flange that is too high is more difficult. It usually involves removing the old flange and installing a new one after you have chiseled out part of the floor. A simpler solution is to shim the bottom of the toilet so it doesn't rock.