Internet Routing

Consider the following network

 

ipnet.gif (6935 bytes)

Example 1: Node a.ncat.edu wants to send one IP packet to www.acme.com.

To demonstrate the maximum possible number of packets that might be transmitted, assume that none of the nodes have any cached data.  The only information they have is what is shown in the diagram.  The table below shows all of the packets that would be sent.

Source HW addr Source IP addr Dest HW addr Dest IP addr purpose
5 152.8.244.55 Broadcast 152.8.244.1 ARP request for DNS hardware address
3 152.8.244.1 5 152.8.244.55 ARP reply
5 152.8.244.55 3 152.8.244.1 ask DNS for www.acme.com IP address
3 152.8.244.1 5 152.8.244.55 DNS replies with IP address
5 152.8.244.55 Broadcast 152.8.254.254 ARP request for gateway hardware address
4 152.8.254.254 5 152.8.244.55 ARP reply
5 152.8.244.55 4 176.5.6.9 Send message to gateway
2 176.5.4.3 Broadcast 176.5.6.9 ARP request for www.acme.com hardware address
9 176.5.6.9 2 176.5.4.3 ARP reply
2 152.8.244.55 9 176.5.6.9 Send message to www.acme.com

When the source computer, a.ncat.edu, gets the IP address of the destination, www.acme.com, from the DNS, it compares the NetID portion of the addresses.  Because 152.8, the NetID of the source computer does not match 176.5, the NetID of the destination, the source computer knows that the destination is on a remote Internet domain.  Therefore the destination has to send the packet to the gateway.  The gateway router is responsible for forwarding the packet on the final destination network.  If the gateway is not connected to the network of the final destination, it will send the frame to another router that is closer to the destination.

Note that the source and destination addresses in the Internet Protocol (IP) packet are never changed as the packet flows through the system.  The IP data packets always contain the original source address and the final destination address.  The IP packet is sent unchanged through the network, enclosed in various MAC layer "envelopes" or frames.  As the IP packet arrives at a router and is transmitted on another network, the IP packet is removed from the first MAC frame and then inserted in another MAC frame for the out going network.

 

Example 2: Node a.ncat.edu wants to send one IP packet to b.ncat.edu.

Again we assume that none of the nodes have any cached data.  The only information they have is what is shown in the diagram.  This means that this example is independent of the previous example.  The table below shows all of the packets that would be sent.

Source HW addr Source IP addr Dest HW addr Dest IP addr purpose
5 152.8.244.55 Broadcast 152.8.244.1 ARP request for DNS hardware address
3 152.8.244.1 5 152.8.244.55 ARP reply
5 152.8.244.55 3 152.8.244.1 ask DNS for b.ncat.edu IP address
3 152.8.244.1 5 152.8.244.55 DNS replies with IP address
5 152.8.244.55 Broadcast 152.8.247.77 ARP request for b.ncat.edu hardware address
7 152.8.247.77 5 152.8.244.55 ARP reply
5 152.8.244.55 7 152.8.247.77 Send message to b.ncat.edu

Because this example assumes that none of the computers have any information when they start (as might occur after a power failure), the source node, a.ncat.edu, has to ARP to find the DNS hardware address.  Since a computer has to communicate with the DNS every time it gets a new IP name, most computers have the DNS hardware address cached and don't have to look it up a second time.

Example 3: Node a.ncat.edu wants to send another IP packet to b.ncat.edu.

This time we assume that this example occurs immediately after example 2 above.  The computers now have IP and hardware addresses cached.  The table below shows all of the packets that would be sent.

Source HW addr Source IP addr Dest HW addr Dest IP addr purpose
5 152.8.244.55 7 152.8.247.77 Send message to b.ncat.edu

Once a computer has the hardware or MAC address of a local computer, it can send the packets directly.

Note that we are only considering the messages required to route an IP packet.  These are exactly the packets that would be sent if you were using the User Datagram Protocol (UDP) with IP.  If you were using TCP/IP, there would be several additional messages to establish a connections, transmit acknowledgements and close the connection.

last modified on January 02, 2004