DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Configuring Internet Protocol (IP) routing

Routing table description

Every computer running SCO TCP/IP has an Internet routing table. It is stored in the operating system kernel and is referred to as the ``kernel routing table'' or sometimes as the ``kernel forwarding table''. This table consists of a series of entries. Each entry consists of multiple fields. The fields pertinent to this discussion are:

The following sections show examples of how the routing table is used for direct and indirect routing.

Direct routing example

The following procedure shows how packets are routed to a system connected directly to the local network. See ``Example internetwork'', for an illustration of the networks described in this example.

  1. The IP layer of the machine thames receives a packet addressed to the machine seine at the IP address 10.0.118.4.

  2. thames consults its kernel routing table which may look like the following:
       destination     netmask          gateway         interface
       10.0.246.0      255.255.255.0    volga           le0
       10.0.118.0      255.255.255.0    local           le0
       default         N/A              volga           le0
    

  3. thames applies each netmask to the destination IP address 10.0.118.4 until it finds a match with the destination address. That is, the four places of the IP address are aligned over the four places of the netmask and the IP address is pushed through the netmask as through a filter. The number strings 255 allow the IP address number to pass through unchanged. The zeros in the mask convert the IP address string to zero as shown below.

    10.0.118.4
    255.255.255.0
    results in
    10.0.118.0

    As you can see, the result matches the second destination in the routing table. (If no match is found, thames uses the default entry.)

  4. Having found a destination match, thames uses the gateway and interface fields of the entry. thames addresses the packet for the gateway. In this case the gateway is local, meaning the local network, so the ultimate destination address is used. thames transmits the packet through the specified interface. In this case, the interface is to an Ethernet, so thames does a lookup in the ARP table to translate the IP address for seine to an Ethernet address for seine. thames transmits the packet on the Ethernet, and it is received by seine.

Indirect routing example

The following procedure shows how packets are routed to a system not connected directly to the local network. See ``Example internetwork'', for an illustration of the networks described in this example.

  1. The IP layer of the machine thames receives a packet addressed to the machine paris at the IP address 10.0.246.3.

  2. thames consults its kernel routing table, which may look like the following:
       destination     netmask          gateway         interface
       10.0.246.0      255.255.255.0    volga           le0
       10.0.118.0      255.255.255.0    local           le0
       default         N/A              volga           le0
    

  3. As described in the previous example, thames applies each netmask to the IP address 10.0.246.3 until it finds a match with the destination address. Having found a destination match, thames uses the gateway and interface fields of the entry. thames addresses the packet for the gateway. In this case, the gateway is the machine volga.

  4. thames transmits the packet through the specified interface. In this case, the interface is to an Ethernet, so thames does a lookup in the ARP table to translate the IP address for volga to an Ethernet address for volga. thames transmits the packet on the Ethernet, and it is received by volga.

  5. When volga receives the packet, it reads the ultimate destination IP address. Finding that the address is not its own, and because volga is configured as a router, it consults its kernel routing table as thames did above. volga finds that the ultimate destination address can be reached via the local gateway and sends the packet out the local Ethernet interface addressed to the ultimate destination IP address.

  6. paris receives the packet.

Routing table updates

As illustrated by ``Direct routing example'', and ``Indirect routing example'', the successful routing of IP packets depends on the contents of the kernel routing table. Entries in the kernel routing table are created, removed, and changed:

A special STREAMS driver handles all updates to and lookups in the kernel routing table. This driver and the messages used to communicate with the driver are described in route(ADMP). All SCO TCP/IP commands and routing daemons that need to update or access data in the kernel routing table use this driver. More information is provided in the discussion of the routing daemons (see ``Routing daemons'').
Next topic: Routing daemons
Previous topic: Example internetwork

© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007