Routing and Switching

Feb 18
09:43

2011

chaudhary fahim

chaudhary fahim

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

Routing and switching are two basic activities in any network and 80% of network management and troubleshooting involves these two.

mediaimage

Routing and switching are two basic activities in any network and 80% of network management and troubleshooting involves these two. Routing is related to communication between two different networks while switching is responsible for communication within a network. The two are explained below:

Switching: Switches are basic part of any LAN. All the computers and other devices on the LAN need to be connected to the switch in order to communicate with each other. Switches operate at Layer 2 of OSI model i.e. the Data Link Layer. That is why switches understand MAC addresses (48 bit burned-in address of the network interface card) and forward data on the basis of destination MAC address. Switch work in the following manner:

In the beginning,Routing and Switching Articles the MAC table of the switch is empty. This is the “learning” state of the switch in which it listens to the network to build its MAC table. Let us assume that the switch receives a frame from computer A meant for Computer B connected to ports 1 and 2 of the switch respectively. Switch can read source and destination MAC addresses in the frame. It first stores the MAC address of the sender A against its port 1. Now as the switch does not know on which port destination B is connected, it will forward the frame on all its ports except for port 1 (the port connected to computer A). This is called “flooding”. All computers except B will reject the frame. When B will reply, the switch will store its MAC address against port 2 and forward frame to A (its MAC already known). This way switch keeps building its MAC table and it is a dynamic process.

Routing: Router operates at Network Layer (Layer 3) of the OSI model and is responsible for routing data to other networks on the basis of IP addresses. Like all the other computers and devices, the router is also connected to the switch. Normally it acts as the default gateway and the data meant for other networks is automatically sent to the router. The router will use static or dynamic routing to forward the packet to its destination network. In static routing, it has a static route defined in its routing table which clearly specifies that a certain network is attached to which port of the router. Whereas in dynamic routing, a routing protocol running on the router decides how to reach a certain network. Common routing protocols are RIP, IGRP, EIGRP, BGP and OSPF. The routing protocols decides the best path (in case multiple paths exists) to reach the destination. The mechanism for deciding the best path is different for different protocols. But in the end, all these build a routing table in the router in which destination networks are mapped against router ports. Routing protocols take care of network changes itself while static routes need to be manually changed. In addition to routing, the router can restrict access of certain users and certain destination on the basis of IP addresses and the protocols being used. This is done through access lists.