Thursday, August 13, 2009

Bridge, Router, Switch, Hub and Gateway

Bridge, Router, Switch, Hub and Gateway


The Internet is an interconnection of hundreds and thousands of networks. At the bottom of this is the LAN (Local Area Network). Some computers are connected with each other to form a LAN. There are several methods to connect computers in a LAN. Ring, bus, start etc. are some of the popular form. In this tutorial I will describe some of the important concept regarding to interconnect networks (possible LAN segments).


Bridge:

A bridge is used to connect LAN segments. It works on physical layer and used to relay MAC address. The purpose of the bridge can be explained by the following example:

Suppose you have 12 computers to connect with each other. You can make a LAN segments using your computers. On a LAN the computers shares the same collection domain and the bandwidth is divided equally to all the computers. So when a computer sends a packet to another computer then if another computer tries to send at the same time collision will occur. To solve this problem, we can use Bridge. We use a bridge in our LAN to partition it into two LAN segments. Now the collision domain is partitioned into two and bandwidth increase by two. So by using multiple bridges we can increase bandwidth as well as decrease collision domain.

Bridge is IP transparent. This means that, when a host wants to send a packet to another host in the LAN segment, it will send the packet (datagram) directly to the destination host.


Another feature of bridge is that- when a host emits a packet with the broadcast address as destination bridge will forward it to the LAN segment. But router will block it (limited broadcast address will be blocked).

Router:

Router is used to connect different networks. It works on the network layer. Every router has two interfaces associated with it, an input interface and an output interface. When a datagram is received by an input interface of a router, it will see its forwarding table to which output interface it will forward.

Router is visible to IP. That is, any host wants to send datagram can't send it directly to the destination host. The datagram first sends to the router and router will responsible to route it to the correct destination host.


Switch:

Switch is also used to connect different LAN segments. Unlike bridge it has solved the problem of collision domain and bandwidth efficiently. A switch with 'N' LAN segments has 'N' different dedicated link with it. So it is possible to connect the entire host separately with the switch. The switch has the property – self learning. It has switching table which is updated automatically without and human initialization. Switch has also the advantages to connect different LAN with different link capacity. That is, if we have three LAN segments with link capacity of 10Mbps, 100Mbps and 1Gbps. We can connect them with a switch.

The self learning property has some problems too. Basically in wireless network where the wireless station (host) moves from one network to another network.


Hub:

Hub is a device which is also used to connect LAN segments. But the purpose of Hub is to re-generate (re-create) each and every bit and broadcast it to the network. The collision domain in Hub is very huge. Hub has no self learning capacity and it can't connect different LAN with different link capacity. Like switch it is auto configured without human initialization.


Gateway:

Gateway works on the upper layer on TCP/IP protocol suite. Such as, mail gateway in SMTP. It supports address mapping from one network to another, and may also provide transformation of the data between the environments to support end-to-end application connectivity.

A gateway can be said to be opaque to IP. That is, a host cannot send an IP datagram through a gateway; it can only send it to a gateway. The higher-level protocol information carried by the datagrams is then passed on by the gateway using whatever networking architecture is used on the other side of the gateway.

*** Will update periodically


0 comments: