Head gasket
In an internal combustion engine, a head gasket provides the seal between the engine block and cylinder head(s). Its purpose is to seal the combustion gases within the cylinders and to avoid coolant or engine oil leaking into the cylinders. Leaks in the head gasket can cause poor engine running and/or overheating. Purpose. Within a water-cooled internal combustion engine, there are three fluids which travel between the engine block and the cylinder head: Correct operation of the engine requires that each of these circuits do not leak or lose pressure at the junction of the engine block  and the cylinder head. The head gasket is the seal that prevents these leaks and pressure losses. Gasket failure. A leak in the head gasket - often called a "blown head gasket" - can result in a leak of coolant, the combustion gasses, or both. Blue smoke from the exhaust suggests that excess oil is entering the combustion chambers (although there are other possible causes than a head gasket leak). White smoke from the exhaust suggests that coolant is entering the combustion chamber. Head gasket leaks are classified as either external or internal. External leaks are visible as oil or coolant on  the outside of the engine (typically underneath). Internal leaks are when the fluids enter another circuit and may result in changes to the coolant or oil. The former may be the presence of foam (caused by hydrocarbons) in the coolant expansion tank. Coolant leaking into the oil system may result in a mayonnaise, or milkshake-like, substance in the oil, often to be seen on the dipstick, or oil filler cap. However, the presence of this substance is not conclusive proof of head gasket failure, since oil could mix with the coolant via other routes. Likewise, it is entirely possible  for a head gasket to fail in such a way that oil never comes in contact with coolant. Therefore it is not possible to conclusively determine the head gasket condition by inspecting the oil. If coolant enters a cylinder, the burning of the air/fuel mixture is compromised, reducing the engine's performance and often causing steam (white smoke) to be visible from the exhaust. This steam can damage the catalytic converter. If a very large amount of coolant leaks into the cylinders, then the engine can suffer from hydrolock, which can cause extensive engine damage. When the combustion gasses  leak out of a cylinder, this causes a loss of compression, leading to power reduction or rough running. If the combustion gases are leaking into the cooling system, this reduces the effectiveness of the cooling system and can cause the engine to overheat. In other occurrences the gases can leak into small spaces between the gasket and either the cylinder head or engine block traps those gases, and then released when the engine is turned off. These gases then escape into the coolant and create air pockets. Sometimes these air pockets can get trapped in the engine's coolant thermostat , causing it to stay closed and cause further overheating, thereby creating more voids between the gasket and the engine. Other times these air pockets can also cause the engine to expel coolant into the overflow or expansion tank, thereby reducing the amount of coolant available for cooling. Diagnosis and repair. Common test methods for head gasket leaks are a compression test (using a pressure gauge), a leak-down test or a chemical test that identifies hydrocarbons in the coolant fluid. The cost of the replacement component (i.e. the head gasket itself) is usually relatively low, however there are significant labor  costs involved in the replacement process. This is because the process of removing and replacing the cylinder head is a time-consuming task. Effect of engine knocking. Engine knocking (detonation) can be caused by poor quality fuel, an engine fault or if inappropriate fuel and/or ignition settings are trialled chosen while engine tuning is taking place. If the detonation is severe, the cylinder pressure can be increase to 8 times above normal pressures, which can cause the cylinder head to lift away from the engine block, disrupting the seal between the two. Most gaskets used in standard production engines can  be critically damaged by severe detonation.