|  | 1.5 | Routing and the Different Classes of Routing Protocols
| 1.5.2 | Two basic operations a router performs
Routers generally relay a packet from one data link to another. To relay a packet, a router uses two basic functions: a path determination function and a switching function. The figure illustrates how routers use addressing for routing and switching functions. The switching function allows a router to accept a packet on one interface and forward it on a second interface. The path determination function enables the router to select the most appropriate interface for forwarding a packet. The node portion of the address refers to a specific port on the router that leads to an adjacent router in that direction. When a host application needs to send a packet to a destination on a different network, a data link frame is received on one of a router's interfaces. The network- layer process examines the header to determine the destination network and then references the routing table that associates networks to outgoing interfaces. The original frame is stripped off and discarded. The packet is again encapsulated in the data link frame for the selected interface and stored in a queue for delivery to the next hop in the path. This process occurs each time the packet switches through another router. At the router connected to the network containing the destination host, the packet is again encapsulated in the destination LAN's data link frame type and delivered to the destination host.
| Web Links
| Routing Basics