The operation of devices is related to different layers as illustrated below:
Bridge:
- A bridge connects two or more LANs. It operates at data link layer.
- Like a hub, a modern bridge has multiple ports, usually enough for 4 to 48 input lines of a certain type. Unlike in a hub, each port is isolated to be its own collision domain.
- When a frame arrives, the bridge extracts the destination address (for Ethernet, it is 48 bit) from the frame header and looks it up in a table to see where to send the frame.
- The bridge only outputs the frame on the port where it is needed and can forward multiple frames at the same time.
Filtering, forwarding and blocking of frames are functions of bridges.
- Bridges offer much better performance than hubs and the isolation between bridge ports also means that the input lines may run at different speeds, possibly even with different network types. A common example is a bridge with ports that connect to 10-, 100-, and 1000-Mbps Ethernet.
- Buffering within the bridge is needed to accept a frame on one port and transmit the frame out on a different port.
- Bridges were originally intended to be able to join different kinds of LANs, for example, an Ethernet and a Token Ring LAN. However, this never worked well because of differences between the LANs such as frame formats, maximum frame lengths, security and Quality of service.
Router:
- Routers are devices that connect two or more networks. It operates at network layer.
- They consist of a combination of hardware and software.
- The hardware can be a network server, a separate computer or a special device. The hardware includes the physical interfaces to the various networks in the internetwork.
- These interfaces can be Token Ring, Ethernet, T1, Frame Relay, ATM or any other technology.
- The software in a router are the operating system and the routing protocol. Management software can also be used.
- Routers use logical and physical addressing to connect two or more logically separate networks.
- The network address allows routers to calculate the optimal path to a workstation or computer.
- The two methods of route discovery are Distance vector routing and Link state routing.
Switch:
- Switches are modern bridges by another name. It acts as multiport bridge to connect devices or segments in a LAN. It operates at data link layer.
- It is point to point device.
- It is an intelligent device. It uses switching table to find the correct destination.
Switches are of two types:
i. Store-and-forward switch: It stores the frame in the input buffer until the whole packet has arrived.
ii. Cut-through switch: It forwards the packet to the output buffer as soon as the destination address is received.
Also there are layer 2 (bridge) and layer 3 switches (kind of router). It is sophisticated and expensive device.