Routing for IPv4 (Windows Embedded CE 6.0)


Routingis a primary function of IP. Datagrams are handed to IPv4 from UDP and TCP above, and from the NIC(s) below. Each datagram is labeled with a source and destination IP address. IP examines the destination address on each datagram, compares it to a locally maintained route table, and decides what action to take. There are three possibilities for each datagram:

  • It can be passed up to a protocol layer above IPv4 on the local host.
  • It can be forwarded using one of the locally attached NICs.
  • It can be discarded.

The route table maintains four different types of routes. The following list shows the routes in the order in which they are searched for a match:

  1. Host (a route to a single, specific destination IP address)
  2. Subnet (a route to a subnet)
  3. Network (a route to an entire network)
  4. Default (used when there is no other match)

The following example shows a typical route table.

 Interface List 
 2       0 40 5 5b 8b 9e    Novell 2000 Adapter.

 Active Routes 
 The no. of entries is ::: 7
      Destination       Netmask       GatewayAddress     Interface    Metric  
       1       1       1       1       1       1       1

The route table above is for a device with the class A IP address of It contains the entries described below:

  1. The first entry, to address, is the default route.
  2. The second entry is for the subnet, which this device resides on.
  3. The third entry, to address, is a host route for the local host. Note that it specifies the loopback address, which makes sense because a datagram bound for the local host should be looped back internally.
  4. The fourth entry is for the network broadcast address.
  5. The fifth entry is for the loopback address,
  6. The sixth entry is for IP multicasting.
  7. The final entry is for the limited broadcast (all-ones) address.
    The default gateway is the currently active default gateway. This is useful to know when multiple default gateways are configured.

On this host, if a packet is sent to, the table is first scanned for a host route (not found), then for a subnet route (that is found). The packet is sent through the local interface If a packet is sent to, the same search is used, and no host, subnet, or network route is found. In this case, the packet is directed to the default gateway, by inserting the MAC address of the default gateway into the destination MAC address field.

The route table is maintained automatically in most cases. When a host initializes, entries for the local network(s), loopback, multicast, and configured default gateway are added. More routes may appear in the table as the IP layer learns of them. For instance, the default gateway for a host may advise it (using ICMP, as explained later) of a better route to a specific network, subnet, or host. Windows Embedded CE allows you to add routes manually with the route utility.

Most Autonomous System (AS) routers use a protocol such as Routing Information Protocol(RIP) or Open Shortest Path First (OSPF) to exchange routing tables with each other. Windows Embedded CE does not directly support RIP and OSPF. However an application developer or OEM could add this support.

By default, Windows Embedded CE-based systems do not behave as routers and do not forward IP datagrams between interfaces. To change this default behavior, set the IPEnableRouter entry under the HKEY_LOCAL_MACHINE\Comm\Tcpip\Parms\IpEnableRouter registry key equal to 1.

Community Additions