Bus contention is an undesirable state incomputer design where more than one device on abus attempts to place values on it at the same time.
Bus contention is the kind oftelecommunication contention that occurs when all communicating devices communicate directly with each other through a single shared channel, and contrasted with "network contention" that occurs when communicating devices communicate indirectly with each other, through point-to-point connections through routers or bridges.[1][failed verification]
Bus contention can lead to erroneous operation, excess power consumption, and, in unusual cases, permanent damage to the hardware—such as burning out aMOSFET.[2]
Most bus architectures requires devices sharing a bus to follow an arbitration protocol carefully designed to make the likelihood of contention negligible.[3] However, when devices on the bus have logic errors, manufacturing defects, or are driven beyond their design speeds, arbitration may break down and contention may result. Contention may also arise on systems which have a programmablememory mapping when illegal values are written to theregisters controlling the mapping.Most small-scale computer systems are carefully designed to avoid bus contention on thesystem bus. They use a single device, calledbus arbiter, that controls which device is allowed to drive the bus at each instant, so bus contention never happens in normal operation. The standard solution to bus contention between memory devices, such asEEPROM andSRAM, is thethree-state bus[2] with a bus arbiter.
Some networks, such asToken Ring, are also designed to avoid bus contention, so bus contention never happens in normal operation.
Most networks are designed with hardware robust enough to tolerate occasional bus contention on the network.CAN bus,ALOHAnet,Ethernet, etc., all experience occasional bus contention in normal operation, but use some protocol (such asMultiple Access with Collision Avoidance,carrier-sense multiple access with collision detection, orautomatic repeat request) to minimize the times that contention occurs, and to re-send data that was corrupted in apacket collision.