A network bridge connects multiple network segments at the data link layer (layer 2) of the OSI model, and the term layer 2 switch is very often used interchangeably with bridge. Bridges are similar to repeaters or network hubs, devices that connect network segments at the physical layer; however, with bridging, traffic from one network is managed rather than simply rebroadcast to adjacent network segments. In Ethernet networks, the term "bridge" formally means a device that behaves according to the IEEE 802.1D standard—this is most often referred to as a network switch in marketing literature.
Bridges tend to be more complex than hubs or repeaters. Bridges can analyze incoming data packets to determine if the bridge is able to send the given packet to another segment of the network.Since bridging takes place at the data link layer of the OSI model, a bridge processes the information from each frame of data it receives. In an Ethernet frame, this provides the MAC address of the frame's source and destination. Bridges use two methods to resolve the network segment that a MAC address belongs to.
Transparent bridging:
This method uses a forwarding database to send frames across network segments. The forwarding database is initially empty and entries in the database are built as the bridge receives frames. If an address entry is not found in the forwarding database, the frame is rebroadcast to all ports of the bridge, forwarding the frame to all segments except the source address. By means of these broadcast frames, the destination network will respond and a route will be created. Along with recording the network segment to which a particular frame is to be sent, bridges may also record a bandwidth metric to avoid looping when multiple paths are available. Devices that have this transparent bridging functionality are also known as adaptive bridges. They are primarily found in Ethernet networks. Source route bridging:
With source route bridging two frame types are used in order to find the route to the destination network segment. Single-Route (SR) frames make up most of the network traffic and have set destinations, while All-Route (AR) frames are used to find routes. Bridges send AR frames by broadcasting on all network branches; each step of the followed route is registered by the bridge performing it. Each frame has a maximum hop count, which is determined to be greater than the diameter of the network graph, and is decremented by each bridge. Frames are dropped when this hop count reaches zero, to avoid indefinite looping of AR frames. The first AR frame which reaches its destination is considered to have followed the best route, and the route can be used for subsequent SR frames; the other AR frames are discarded. This method of locating a destination network can allow for indirect load balancing among multiple bridges connecting two networks. The more a bridge is loaded, the less likely it is to take part in the route finding process for a new destination as it will be slow to forward packets. A new AR packet will find a different route over a less busy path if one exists. This method is very different from transparent bridge usage, where redundant bridges will be inactivated; however, more overhead is introduced to find routes, and space is wasted to store them in frames. A switch with a faster backplane can be just as good for performance, if not for fault tolerance. They are primarily found in Token Ring networks. Advantages of network bridges:
Self configuring Primitive bridges are often inexpensive Reduce the size of collision domain by microsegmentation in non switched networks Transparent to protocols above the MAC layer Allows the introduction of management/performance information and access control LANs interconnected are separate, and physical constraints such as number of stations, repeaters and segment length don't apply Helps minimize bandwidth usage Disadvantages of network bridges:
Does not limit the scope of broadcasts Does not scale to extremely large networks Buffering introduces store and forward delays; on average traffic destined for bridge will be related to the number of stations on the rest of the LAN Bridging of different MAC protocols introduces errors Because bridges do more than repeaters by viewing MAC addresses, the extra processing makes them slower than repeaters Bridges are more expensive than repeaters Although infinite bridges (or layer 2 switches) can be connected in theory, often a broadcast storm will result as more and more collisions occur. Collisions delay service advertisements, which causes the hosts to back off and attempt to retransmit after a pseudo-random interval. Because bridges simply repeat any Layer 2 broadcast traffic, this can result in undesirable broadcast traffic consuming the network. An example would be a bridge in between adjacent office buildings. It is unlikely that the advantages of bridging would outweigh the loss of network bandwidth associated with all of the service advertisements.Another major disadvantage is that any standards-compliant implementation of bridging cannot have any closed loops in a network. This limits both performance and reliability.