Bridge
In short: A network device that connects two network segments at layer 2 and intelligently forwards only the necessary traffic between them.
In more detail: Unlike a hub, which blindly passes data on to all ports, a bridge learns from MAC addresses which devices are on which side and forwards traffic in a targeted way. A switch is basically a bridge with many ports.
In Depth
The learning table as the core mechanism
A bridge keeps an internal learning table (also called a forwarding table or CAM table) that maps MAC addresses to the respective ports. With the first frame from a device, it remembers “this MAC address is on this port” — if a frame for exactly this address arrives later, it’s forwarded specifically only to the matching port, instead of (as with a hub) to all ports at once. If the destination MAC address is still unknown, the bridge temporarily behaves like a hub and floods the frame to all ports except the incoming port until it has learned where the destination actually is. Entries in the learning table aren’t permanent — if a device stays inactive for a certain time (typically several minutes), its entry is discarded, so that the table doesn’t grow without limit and outdated mappings (e.g. after a cable has been replugged) are eventually corrected automatically.
Avoiding loops: Spanning Tree
If several bridges or switches are cabled to each other redundantly (e.g. two connections between two switches for resilience), a physical loop is created in the network — without a countermeasure, broadcast frames would circulate endlessly and bring the network down within seconds (“broadcast storm”). The Spanning Tree Protocol (STP) solves this problem by having bridges/switches coordinate with each other and logically deactivate one of the redundant paths, so that effectively a loop-free tree is created — if the active connection fails, STP automatically activates the previously blocked replacement path. More modern variants such as Rapid Spanning Tree (RSTP) shorten the switchover time required for this from originally up to 50 seconds to a few seconds.
Bridge vs. switch vs. router
Historically, a bridge usually connected only two network segments (hence the name — it “bridges” two networks), while a switch scales the same principle up to many individual ports — basically, a modern switch is nothing other than a multi-port bridge working at layer 2 of the OSI model. A router, on the other hand, works one level higher (layer 3) and forwards between different logical networks based on IP addresses, instead of only learning MAC addresses within the same network — so bridges/switches connect devices within the same network more efficiently, while routers connect different networks with each other in the first place.
Wireless bridges and software bridges
Pure, dedicated bridge hardware in the classic sense has become rare today; but the concept lives on in every switch. A practical modern application is the “wireless bridge”, in which two distant wired network segments are bridged via a Wi-Fi point-to-point connection, for example between two buildings without a direct cabling option. Software bridges are also widespread, especially in virtualisation environments: a hypervisor connects virtual machines to the host system’s physical network card via a virtual bridge, so that VMs behave on the network like standalone physical devices.