An idea as to how routing is done
The process of determining how the packet should reach its destination is known as routing.First of all a route is needed to send data to a remote host. When a packet is send there will be atleast one router in its way before it reaches its destination. Routers and gateways helps these packets to reach its destination. Routers are not just concerned with directing the packets instead they find the 'best' way for the packet to travel. This task of finding the optimum path is done by the use of different metrics (standards of measurement) like reliability, delay, bandwidth, path length. If for some reason the optimum path is not feasible due to say traffic congestion the next best alternative is taken up. Routers also maintain routing tables to help them in determining the optimum path. These tables are updated by the routers by communicating with each other. Now lets get on with the basics of routing. If the ethernet device knows the ethernet address of the device to reach it can send it directly to the device address. If it doesnt know the ethernet address it addresses the packet to Network address of device and sends the packet to the ethernet address of the router. Once the router receives the packet it checks if the packet is addressed to is on its segment of network (by referring the tables) and if it is then the packet is directed to that ethernet device. If its not on routers segment it forwards the packet to the next router and this process continues until the packet arrives at the network containing the device for which the packet was intended.
