Routers determine the best path
The primary responsibility of a router is to direct packets destined for local and remote networks by:
Determining the best path to send packets
Forwarding packets toward their destination
The router uses its routing table to determine the best path to forward the packet. When the router receives a packet, it examines its destination IP address and searches for the best match with a network address in the router’s routing table. The routing table also includes the interface to be used to forward the packet. Once a match is found, the router encapsulates the IP packet into the data link frame of the outgoing or exit interface, and the packet is then forwarded toward its destination.
It is very likely that a router will receive a packet that is encapsulated in one type of data link frame, such as an Ethernet frame and when forwarding the packet, the router will encapsulate it in a different type of data link frame, such as Point-to-Point Protocol (PPP). The data link encapsulation depends on the type of interface on the router and the type of medium it connects to. The different data link technologies that a router connects to can include LAN technologies, such as Ethernet, and WAN serial connections, such as T1 connection using PPP, Frame Relay, and Asynchronous Transfer Mode (ATM).
What is a Router?
In the figure, we can follow a packet from the source PC to the destination PC. Notice that it is the responsibility of the router to find the destination network in its routing table and forward the packet on toward its destination. In this example, router R1 receives the packet encapsulated in an Ethernet frame.
After de-capsulation the packet, R1 uses the destination IP address of the packet to search its routing table for a matching network address. After a destination network address is found in the routing table, R1 encapsulates the packet inside a PPP frame and forwards the packet to R2. A similar process is performed by R2.
Static routes and dynamic routing protocols are used by routers to learn about remote networks and build their routing tables. These routes and protocols are the primary focus of the course and will be discussed in detail in later chapters along with the process that routers use in searching their routing tables and forwarding the packets.
Routers and the Network Layer
The main purpose of a router is to connect multiple networks and forward packets destined either for its own networks or other networks. A router is considered a Layer 3 device because its primary forwarding decision is based on the information in the Layer 3 IP packet, specifically the destination IP address. This process is known as routing.
When a router receives a packet, it examines its destination IP address. If the destination IP address does not belong to any of the router’s directly connected networks, the router must forward this packet to another router. In the figure, R1 examines the destination IP address of the packet. After searching the routing table, R1 forwards the packet onto R2. When R2 receives the packet, it also examines the packet’s destination IP address. After searching its routing table, R2 forwards the packet out its directly connected Ethernet network to PC2.
When each router receives a packet, it searches its routing table to find the best match between the destination IP address of the packet and one of the network addresses in the routing table. Once a match is found, the packet is encapsulated in the layer 2 data link frame for that outgoing interface. The type of data link encapsulation depends on the type of interface, such as Ethernet or HDLC.
No comments:
Post a Comment