Difference Between Bridge and Router

Bridge and router are two different networking devices that have a definite difference between them in the way they work. A bridge is a networking device used to interconnect two or more networks together so that it looks like a single network. A router, on the other hand, is a device that chooses the best path that a packet must be routed through to reach the destination. A bridge is a simple device that works on the layer 2 of the network model bases on MAC addresses. A router is a more complex device that works on the layer 3 of the network model based on IP addresses. A bridge does not block any broadcast traffic, but a router can block them as packets are routed rather than being broadcasted.

What is a Bridge?

A bridge is a networking device used to connect two or more networks together so that they are interconnected into a single broadcasting domain. Theses devices work in the data link layer of the OSI reference model and hence are layer 2 devices. A network bridge does not deal with IP addresses but only works with MAC addresses. When two networks are bridged, it is like they are on one network. There is no network segmentation based on the subnets, and hence, all broadcast traffic would flow through the bridge. A bridge uses a table called a bridge table that keeps track of which packets must be forwarded through the bridge based on the destination MAC address. This table is a simple table that is prepared by self-learning and no complex algorithms are used. Network bridges can be created in Software as well. Say your computer has two Network Interfaces and you want to bridge them so that computers on the both sides can communicate each other. In this type of situation, we can use a software bridge. This software functionality is provided by the operating system where, in Windows, you can easily bridge two interfaces by selecting the bridge option from the menu you get by right-clicking on two selected interfaces. In Linux, bridge- utils package provides the bridging facility.

What is a Router?

A router is a networking device that routes data packets across a network. It works in the network layer of the OSI reference model and hence is a layer 3 device. A router follows a store and forward mechanism. A router maintains a table called a routing table that consists of the gateway IP through which a packet must be routed to reach a certain destination IP. The routing table can be statically set by the network administrator or can be auto-generated using routing algorithms. When a router receives a packet is first stores the packet in the router memory and analyzes the destination IP address of the packet. Then it lookup the routing table to see through which gateway the packet must be routed. Then based on that information it forwards the packet appropriately. As routing algorithms are more complex, it requires considerable processing power making it costly. A router is typically used to connect different subnets rather than connecting networks of a same subnet. Say you have one subnet of the range 192.168.1.0 – 192.168.1.255 and another subnet of the range 192.168.10.1 – 192.168.10.255 and you want to interconnect the two subnets. In this case, a router would be necessary as routing based on destination IP addresses is expected.

What is the difference between Bridge and Router?

• A bridge is a layer 2 device that works in the data link layer while a router is a layer 3 devices that work in the network layer.

• A router selects the best path or the route a packet must be sent in order to reach the destination. A bridge interconnects two or more networks together.

• A router does its routing based on IP addresses. A bridge uses MAC addresses to decide to which interface the packets must be pushed.

• A router is more intelligent than a bridge. A router works based on complex algorithms called routing algorithms. A bridge works based on simple self-learning algorithms.

• A router needs more processing power and resources than a bridge. So the cost of a router would be higher than the cost of a bridge.

• A router should deal with complex data structures such as graphs, but a bridge deals with simple data structures such as tables.

• Bridge does not provide network segmentation. Two networks connected to a bridge are in the same broadcasting domain. But a router enables network segmentation. Networks of different broadcast domains can be interconnected.

• In bridges, a protocol called STP (Spanning Tree Protocol) is used to prevent any loops. In routers, such protocol is not used as any loops are prevented by routing algorithms itself.

• A bridge does not block any broadcast or multicast traffic. But a router can block any broadcast or multicast traffic.

Summary:

Bridge vs Router

A bridge is a layer 2 networking devices that are used to interconnect two or more networks. It works based on MAC addresses and any broadcasting traffic would be replicated without any blocking. A router is a layer 3 networking devices that is used to route packets on the best path based on the destination IP address. A router works based on IP addresses and complex set of algorithms called routing algorithms. So a router will make it possible to connect two subnets having different IP ranges together while a bridge will interconnect two networks just to make one broadcast domain without any consideration of IP addresses. A router is more complex than a bridge and hence more processing power is needed making it costly than a bridge.

 

Images Courtesy:

  1. Network bridging view using ISO/OSI layers and terminology by Crvincenzi (CC BY-SA 3.0)
  2. Router by Clamad (CC BY 3.0)