IP Routing Functions

TCP/IP Protocols Overview  |  IP  |  ARP  |  ICMP  |  

Understanding Routing with IP

To minimize unnecessary traffic load and to provide efficient movement of frames from one location to another, the interconnected hosts are grouped into separate networks. As a result of this grouping (which is determined by the network designer and administrator) it is possible for an interconnect device to determine the best path between two networks.

This interconnect device, by definition, is called a router. A router, operating at Layer 3, the Network Layer, forms the boundary between one network and another network. When a frame crosses a router it is in a different network. A frame that travels from source to destination without crossing a router has remained in the same network. A network is a group of communicating machines bounded by routers.

The router will use some of the bits in the IP address to identify the network location to which the frame is destined. The remaining bits in the address will uniquely identify the host on that network that will ultimately receive the frame.

It is necessary to differentiate between the bits used to identify the network and those used to identify the host. The sender of a frame must make this differentiation because it must decide whether it is on the same network as the destination or on a different network. If the sender is on the same network as the destination, it will determine the data link address of the destination machine. Then it will send the frame directly to the destination machine.

On the other hand, if the destination is on a different then the originator must send the frame to a router and let the router forward the frame on to the ultimate destination network. At the ultimate destination network the last router must determine the data link address of the host and forward the frame directly to that host on that ultimate destination network.

When a router receives an incoming data frame it masks the destination address to create a lookup key that is compared to the entries in its routing table. The routing table indicates how the frame should be processed.

The frame might be delivered directly on a particular port on the router. The frame might have to be sent on to the next router in line for ultimate delivery to some remote network. The routing table contains this information. The routing table is created by the combination of direct configuration by the administrator or dynamically through the periodic broadcasting of router update frames. Protocols like RIP (Routing Information Protocol), OSPF (Open Shortest Path First), and Cisco's IGRP (Internet Gateway Routing Protocol) are sent from all routers at periodic intervals. As a result, all routers become aware of how to reach all other networks.

Consider this example:

A network consists of three routers with four segments:

The routers use the mask value 255.255.0.0. The routing table in the router between 140.6.0.0 and 140.7.0.0 says:


Result of Mask Do this with the frame
140.6.0.0 ARP for destination on Port #1 and deliver directly
140.7.0.0 ARP for destination on Port #2 and deliver directly
140.8.0.0 Forward frame to next router: 140.7.12.2
140.9.0.0 Forward frame to next router: 140.6.2.1

Study this example to understand the relationship between the routing table and the physical network. Assume you are an end-node attached to Network 140.6.0.0. If you want to send a frame to a destination on Network 140.7.0.0 you will send the frame to the router. The router knows to deliver the frame directly on the appropriate port. If the frame were destined to network 140.8.0.0 then the router would know the forward the frame to the next router in line, in this example it is identified as 140.7.12.2. 140.7.12.2 would then deliver the frame directly on its own port to network 140.8.0.0.

Because of the masking process the router knows that some station, perhaps 140.8.192.9, is on the same network as 140.8.2.3. The masking of both these addresses produces 140.8.0.0 which is looked-up in the table. All frames destined to 140.8.0.0 are sent correctly. The router doesn't have to keep track of all end- nodes individually. Because the end-nodes are grouped together into networks the router can process the frames without the need for a massive list of all stations in the known universe.

Additional Information about IP Routing

RFC 1812: The specific behavior that is expected from an IP router is discussed in RFC 1812. This is a somewhat lengthy document but it does provide a complete discussion of routing in the IP Version 4 network environment.

WildPackets is now Savvius

For the latest information on our products and services please go to our new site at www.savvius.com.

We are in the process of migrating some of our legacy content to our new site, so Wildpackets.com is still available. If the content you are looking for has already been migrated we will automatically redirect you.