Monday, February 3, 2014

Determine the path between two hosts across a network

 Once you create an internetwork by connecting your WANs and LANs to a router, you'll need to configure logical network addresses, such as IP addresses, to all hosts on the internetwork so that they can communicate across that internetwork.

The term routing is used for taking a packet from one device and sending it through the network to another device on a different network. Routers don't really care about hosts—they only care about networks and the best path to each network. The logical network address of the destination host is used to get packets to a network through a routed network, and then the hardware address of the host is used to deliver the packet from a router to the correct destination host.
Eventually the packet reaches a router that is part of a network that matches the destination IP address of the packet. In this example, router R2 receives the packet from R1. R2 forwards the packet out its Ethernet interface, which belongs to the same network as the destination device, PC2.

Routers Operate at Layers 1, 2, and 3

A router makes its primary forwarding decision at Layer 3, but as we saw earlier, it participates in Layer 1 and Layer 2 processes as well. After a router has examined the destination IP address of a packet and consulted its routing table to make its forwarding decision, it can forward that packet out the appropriate interface toward its destination. The router encapsulates the Layer 3 IP packet into the data portion of a Layer 2 data link frame appropriate for the exit interface. The type of frame can be an Ethernet, HDLC, or some other Layer 2 encapsulation – whatever encapsulation is used on that particular interface. The Layer 2 frame is encoded into the Layer 1 physical signals that are used to represent bits over the physical link.

To understand this process better, refer to the figure. Notice that PC1 operates at all seven layers, encapsulating the data and sending the frame out as a stream of encoded bits to R1, its default gateway.

R1 receives the stream of encoded bits on its interface. The bits are decoded and passed up to Layer 2, where R1 de-capsulate the frame. The router examines the destination address of the data link frame to determine if it matches the receiving interface, including a broadcast or multicast address. If there is a match with the data portion of the frame, the IP packet is passed up to Layer 3, where R1 makes its routing decision. R1 then re-encapsulates the packet into a new Layer 2 data link frame and forwards it out the outbound interface as a stream of encoded bits.

R2 receives the stream of bits, and the process repeats itself. R2 de-capsulate the frame and passes the data portion of the frame, the IP packet, to Layer 3 where R2 makes its routing decision. R2 then re-encapsulates the packet into a new Layer 2 data link frame and forwards it out the outbound interface as a stream of encoded bits.

This process is repeated once again by router R3, which forwards the IP packet, encapsulated inside a data link frame and encoded as bits, to PC2.

Each router in the path from source to destination performs this same process of de-capsulation, searching the routing table, and then re-encapsulation. This process is important to your understanding of how routers participate in networks. Therefore, we will revisit this discussion in more depth in a later section.

Routing Table Principles



At times in this course we will refer to three principles regarding routing tables that will help you understand, configure, and troubleshoot routing issues. These principles are from Alex Zinin’s book, Cisco IP Routing.

1. Every router makes its decision alone, based on the information it has in its own routing table.

2. The fact that one router has certain information in its routing table does not mean that other routers have the same information.

3. Routing information about a path from one network to another does not provide routing information about the reverse, or return, path.

What is the effect of these principles? Let’s look at the example in the figure.

1. After making its routing decision, router R1 forwards the packet destined for PC2 to router R2. R1 only knows about the information in its own routing table, which indicates that router R2 is the next-hop router. R1 does not know whether or not R2 actually has a route to the destination network.

2. It is the responsibility of the network administrator to make sure that all routers within their control have complete and accurate routing information so that packets can be forwarded between any two networks. This can be done using static routes, a dynamic routing protocol, or a combination of both.

3. Router R2 was able to forward the packet toward PC2’s destination network. However, the packet from PC2 to PC1 was dropped by R2. Although R2 has information in its routing table about the destination network of PC2, we do not know if it has the information for the return path back to PC1’s network.

No comments:

Post a Comment