Simple Module IPv4RoutingTable

Package: inet.networklayer.ipv4
File: src/inet/networklayer/ipv4/IPv4RoutingTable.ned

C++ definition

Stores the routing table. (Per-interface configuration is stored in InterfaceTable.)

For hosts, the routerId module parameter should be empty (""), in which case the loopback IPv4 address will be set to 127.0.0.1/8. For routers which have a routerId set, the loopback address will be set to routerId. (See also RFC 2072 "Router Renumbering Guide".)

RouterId may also be set to the string "auto", in which case the highest interface address will be chosen as routerId; the loopback address will remain 127.0.0.1/8.

The routing table is read from a file (parameter routingFile); the file can also fill in or overwrite interface settings. The file format is documented here.

Note that many protocols don't require routerId to be routable, but some others do -- so it is probably a good idea to set up routable routerIds.

This module has no gates; all functionality can be accessed via member functions of the C++ module class. For detailed info, please see the C++ documentation of the class (Doxygen).

See also: InterfaceTable

Author:: Jochen Reber, Andras Varga

IPv4RoutingTable

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in compound modules:

Name Type Description
BGPRouterEx compound module

Example IP router with BGPv4 and OSPFv4 support.

BGPRouterSimple compound module

Example IPv4 router with BGPv4 support.

InternetCloud compound module

This module is an IPv4 router that can delay or drop packets (while retaining their order) based on which interface card the packet arrived on and on which interface it is leaving the cloud. The delayer module is replacable.

LDP_LSR compound module

An LDP-capable router.

RSVP_LSR compound module

An RSVP-TE capable router.

Parameters:

Name Type Default value Description
interfaceTableModule string

The path to the InterfaceTable module

routerId string "auto"

for routers, the router id using IPv4 address dotted notation; specify "auto" to select the highest interface address; should be left empty ("") for hosts

netmaskRoutes string "*"

maintain netmask routes for interfaces

forwarding bool true

turns IP forwarding on/off

multicastForwarding bool false

turns multicast forwarding on/off

useAdminDist bool false

Use Cisco like administrative distances

routingFile string ""

routing table file name

Properties:

Name Value Description
display i=block/table

Signals:

Name Type Unit
NF_ROUTE_DELETED IPv4Route
NF_MROUTE_ADDED IPv4MulticastRoute
NF_MROUTE_CHANGED IPv4MulticastRoute
NF_ROUTE_ADDED IPv4Route
NF_MROUTE_DELETED IPv4MulticastRoute
NF_ROUTE_CHANGED IPv4Route

Source code:

//
// Stores the routing table. (Per-interface configuration is stored in
// ~InterfaceTable.)
//
// For hosts, the routerId module parameter should be empty (""),
// in which case the loopback IPv4 address will be set to 127.0.0.1/8.
// For routers which have a routerId set, the loopback address will be set to
// routerId. (See also RFC 2072 "Router Renumbering Guide".)
//
// RouterId may also be set to the string <tt>"auto"</tt>, in which case the
// highest interface address will be chosen as routerId; the loopback address
// will remain 127.0.0.1/8.
//
// The routing table is read from a file (parameter routingFile);
// the file can also fill in or overwrite interface settings.
// The file format is documented <a href="irt.html">here</a>.
//
// Note that many protocols don't require routerId to be routable, but some
// others do -- so it is probably a good idea to set up routable routerIds.
//
// This module has no gates; all functionality can be accessed via member
// functions of the C++ module class. For detailed info, please see the C++
// documentation of the class (Doxygen).
//
// @see ~InterfaceTable
// @author: Jochen Reber, Andras Varga
//
simple IPv4RoutingTable like IRoutingTable
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        @display("i=block/table");
        string routerId = default("auto"); // for routers, the router id using IPv4 address dotted
                          // notation; specify "auto" to select the highest
                          // interface address; should be left empty ("") for hosts
        string netmaskRoutes = default("*"); // maintain netmask routes for interfaces
        bool forwarding = default(true);  // turns IP forwarding on/off
        bool multicastForwarding = default(false); // turns multicast forwarding on/off
        bool useAdminDist = default(false);     // Use Cisco like administrative distances
        string routingFile = default("");  // routing table file name
        @signal[NF_ROUTE_ADDED](type=IPv4Route);
        @signal[NF_ROUTE_DELETED](type=IPv4Route);
        @signal[NF_ROUTE_CHANGED](type=IPv4Route);
        @signal[NF_MROUTE_ADDED](type=IPv4MulticastRoute);
        @signal[NF_MROUTE_DELETED](type=IPv4MulticastRoute);
        @signal[NF_MROUTE_CHANGED](type=IPv4MulticastRoute);
}