Ipv4RoutingTable

Package: inet.networklayer.ipv4

Ipv4RoutingTable

simple module

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

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
ExtUpperIpv4NetworkLayer compound module (no description)
Ipv4NetworkLayer compound module

Network layer of an IPv4 node.

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
routeDeleted inet::Ipv4Route
mrouteChanged inet::Ipv4MulticastRoute
mrouteDeleted inet::Ipv4MulticastRoute
routeChanged inet::Ipv4Route
mrouteAdded inet::Ipv4MulticastRoute
routeAdded inet::Ipv4Route

Direct method calls (observed)

call tofunctioninfo
InterfaceTableinet::InterfaceTable::findFirstLoopbackInterfacefindFirstLoopbackInterface
InterfaceTableinet::InterfaceTable::findInterfaceByNamefindInterfaceByName
InterfaceTableinet::InterfaceTable::interfaceChangedinterfaceChanged
Igmpv2inet::Igmpv2::receiveSignalipv4MulticastGroupJoined
Ipv4RoutingTableinet::Ipv4RoutingTable::addRouteaddRoute(...)
Ipv4RoutingTableinet::Ipv4RoutingTable::deleteRoutedeleteRoute(...)
Ipv4RoutingTableinet::Ipv4RoutingTable::findBestMatchingRoutefindBestMatchingRoute(%u.%u.%u.%u)
Ipv4RoutingTableinet::Ipv4RoutingTable::getInterfaceByAddressgetInterfaceByAddress(%u.%u.%u.%u)
Ipv4RoutingTableinet::Ipv4RoutingTable::removeRouteremoveRoute(...)
Ldpinet::Ldp::receiveSignalrouteAdded
Ldpinet::Ldp::receiveSignalrouteDeleted
EigrpIpv4Pdminet::eigrp::EigrpIpv4Pdm::receiveSignalrouteDeleted
EigrpIpv6Pdminet::eigrp::EigrpIpv6Pdm::receiveSignalrouteDeleted
PimDminet::PimDm::receiveSignalrouteAdded
Ripinet::Rip::receiveSignalrouteAdded
Ripinet::Rip::receiveSignalrouteDeleted

Called methods (observed)

functioninfocall from
inet::Ipv4RoutingTable::addMulticastRouteaddMulticastRoute(...)Ipv4NodeConfigurator, PimDm, PimSm
inet::Ipv4RoutingTable::addRouteaddRoute(...)DhcpClient, Ipv4NodeConfigurator, Ipv4RoutingTable, RsvpTe, LinkStateRouting, Ted, Aodv, Bgp, Dsdv, Dymo, EigrpIpv4Pdm, Ospfv2, Ospfv3Process, Rip
inet::Ipv4RoutingTable::deleteRoutedeleteRoute(...)DhcpClient, Ipv4RoutingTable, RsvpTe, LinkStateRouting, Ted, Aodv, Bgp, Dsdv, Ospfv2, Ospfv3Process, Rip
inet::Ipv4RoutingTable::findBestMatchingMulticastRoutegetMulticastRoutesFor(%u.%u.%u.%u, %u.%u.%u.%u)Ipv4
inet::Ipv4RoutingTable::findBestMatchingRoutefindBestMatchingRoute(%u.%u.%u.%u)Ipv4, Ipv4RoutingTable, Aodv, Dsdv, Dymo, PimDm, PimSm
inet::Ipv4RoutingTable::findInterfaceByLocalBroadcastAddressfindInterfaceByLocalBroadcastAddress(%u.%u.%u.%u)Ipv4
inet::Ipv4RoutingTable::getInterfaceByAddressgetInterfaceByAddress(%u.%u.%u.%u)Ipv4, Ipv4RoutingTable, RsvpTe, LinkStateRouting, Ted
inet::Ipv4RoutingTable::getInterfaceForDestAddrgetInterfaceForDestAddr(%u.%u.%u.%u)Arp, Ipv4, RsvpTe, Bgp, PimSm, Rtp, Sctp
inet::Ipv4RoutingTable::handleOperationStagehandleOperationStageScenarioManager, SimpleEpEnergyManagement, SimpleEpEnergyStorage
inet::Ipv4RoutingTable::isLocalAddressisLocalAddress(%u.%u.%u.%u)Arp, Ipv4, Aodv, Dymo, Gpsr, PimSm, Rip
inet::Ipv4RoutingTable::isLocalBroadcastAddressisLocalBroadcastAddress(%u.%u.%u.%u)Icmp, Ipv4
inet::Ipv4RoutingTable::receiveSignalinterfaceConfigChangedInterfaceTable
inet::Ipv4RoutingTable::receiveSignalinterfaceCreatedIeee80211Interface, LoopbackInterface
inet::Ipv4RoutingTable::receiveSignalinterfaceIpv4ConfigChangedInterfaceTable
inet::Ipv4RoutingTable::receiveSignalinterfaceStateChangedInterfaceTable
inet::Ipv4RoutingTable::removeRouteremoveRoute(...)Ipv4RoutingTable, Dymo, EigrpIpv4Pdm

Tagging operations (observed)

tagTypetagAction
inet::Ipv4InterfaceDatafindTag, getTag, getTagForUpdate
inet::NextHopInterfaceDatafindTag

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
//
simple Ipv4RoutingTable like IRoutingTable
{
    parameters:
        string interfaceTableModule;   // The path to the InterfaceTable module
        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
        @display("i=block/table");
        @signal[routeAdded](type=inet::Ipv4Route);
        @signal[routeDeleted](type=inet::Ipv4Route);
        @signal[routeChanged](type=inet::Ipv4Route);
        @signal[mrouteAdded](type=inet::Ipv4MulticastRoute);
        @signal[mrouteDeleted](type=inet::Ipv4MulticastRoute);
        @signal[mrouteChanged](type=inet::Ipv4MulticastRoute);
}

File: src/inet/networklayer/ipv4/Ipv4RoutingTable.ned