A flange allows two pipes to be mechanically connected together, or a pipe to be mechanically connected to a valve, tee, choke or other piece of equipment. The principle of a flange is to use a mechanical force (exerted by the bolts) to pre-load the gasket sufficiently so that when internal pressure (end cap force) is applied, there is enough contact stress between the flanges and gasket to maintain a seal. The flange itself needs to be connected to the pipe. This is usually achieved by welding, though threaded and other weldless connections also exist.