Routing:-
- Routers are a network layer of the OSI model or is a operating networking device.
- In a network, for destination there are many routes available from source.
- The physical network through which the packets travel consists of LANs, WANs and routers.
- It is the responsibility of the network layer to find the best route out of all the possible routes. In order to achieve this goal, the network layer must have some concrete strategy for defining the best route.
- There are a number of routing protocols used in this process as they should be able to run and help the routers coordinate with each other and help in establishing communication throughout the network.
- This is based on which interface layer 3 device should send it to and where the destination is
- In the modern days this is done by running an appropriate routing protocol, which help the routers to coordinate their knowledge about the neighbouring routers and prepare routing tables which can be used on the arrivial of a packet.
- The packets taken from the source to destination also refers to the network wider process that determines the end to end path.
- Forwarding tables are always been updating in the routing process.
- An interface will strip the frame from the pocket as the router receives a frame on. router then will try to look up the destination IP address in its routing table. If it doesn’t find a match or a default route it will drop the packet. It will switch the packet to the interface of the longest match in the routing table If it finds one or more matches then. Only then the router will prepare a new frame for the packet on the new interface (the link on new interface may or may not use MAC addresses) and the router will forward the new frame having the original packet over to next hop interface toward it destination.
Forwarding:-
- The process of forwarding is the action taken by a router when it receives a packet at one of its interfaces. A router takes such an action with the help of the decision making tables called as forwarding table or routing table.
- Router needs to forward the packet to another attached network( unicast routing) or to some attached networks( in case of multi cast routing) only when a router receives a packet from one of its attached networks.
- The router has to make this decision with the help of a piece of information present in the packet header. This piece of information can be the destination address or a table.
- The router can use this information to find the corresponding output interface number in the forwarding number.
- It refers to the router local action of transferring packet from an input link interface.

