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:
-
destination network IP address
-
network mask (netmask)
-
next hop (gateway), which is the next machine which knows how to reach the
ultimate destination machine
-
identity of network interface through which the packet is sent to
reach the next hop
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.
-
The IP layer of the machine thames receives a
packet addressed to the machine
seine at the IP address 10.0.118.4.
-
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
-
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.)
-
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.
-
The IP layer of the machine thames receives a
packet addressed to
the machine paris at the IP address 10.0.246.3.
-
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
-
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.
-
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.
-
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.
-
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:
-
automatically when running the Network Configuration Manager
to configure or remove a network interface.
When configuring a network interface you are prompted for
an IP address and netmask.
This information is used to create a routing table entry with the
network attached to the interface as the destination field in the
routing table.
Through this process, the machine always knows about the networks
to which it is directly connected.
-
manually through use of the
route(ADMN)
command.
Through this command, the kernel routing table can contain
entries for networks to which the machine is not directly connected.
On small, static networks, manual maintenance of the kernel routing
table with the route command is reasonable, requiring less
computer overhead than using routing daemons.
-
dynamically by routing daemons running on the machine.
A routing daemon communicates via routing protocols with the routing
daemons on other
machines to learn about the existence of routes other than those
to which the machine is directly connected.
The routing daemon adds entries for these networks to the kernel routing
table automatically.
On large or changing networks, the use of routing daemons reduces
administrative overhead.
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
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003