Ipv6RoutingTable¶
Package: inet.networklayer.ipv6
simple module Ipv6RoutingTable
IPv6 Routing Table and Neighbor Discovery data structures.
NOTE: This component MUST be named as routingTable6 inside
a StandardHost/Router etc. in order to be accessible by the
Ipv6 and other modules.
XML Configuration (legacy)
NOTE: For new simulations, prefer Ipv6NetworkConfigurator which provides automatic prefix assignment, hierarchical addressing, route computation, and per-interface RA/NDP parameter configuration using pattern-based XML.
The routes XML parameter allows manual configuration of interface
IPv6 settings and IPv6 tunnels. The root element is <routingTable>,
containing <local> elements that target specific nodes. Only <local>
elements whose node attribute matches the host module’s full name
(i.e. getFullName()) are processed.
Each <local> element may contain <interface> and <tunnel> child elements.
Interface configuration
The <interface> element configures an IPv6 interface. Attributes:
name(required): the interface name (e.g. “eth0”, “wlan0”)AdvSendAdvertisements(required): enable/disable Router Advertisementsending (“on”/”true”/”yes” or “off”/”false”/”no”)
The <interface> element may contain the following child elements:
<AdvPrefix>: Defines an advertised prefix. The element text is theprefix in “address/length” notation (e.g. “2001:db8:1::/64”). Attributes:
AdvValidLifetime(required): valid lifetime in secondsAdvPreferredLifetime(required): preferred lifetime in secondsAdvOnLinkFlag(required): whether the prefix is on-link (“true”/”false”)AdvAutonomousFlag(required): whether the prefix can be used for SLAAC (“true”/”false”)
<inetAddr>: Assigns a static IPv6 address to the interface. The elementtext is the IPv6 address. Attributes:
tentative(required): whether the address is tentative (“true”/”false”)
Tunnel configuration
The <tunnel> element contains <tunnelEntry> child elements. Each
<tunnelEntry> defines an IPv6-in-IPv6 tunnel. Attributes:
entryPoint(required): tunnel entry point IPv6 addressexitPoint(required): tunnel exit point IPv6 address
Each <tunnelEntry> must contain exactly one <triggers> child element:
destination(required): the destination prefix that triggers tunneling
Example
<routingTable>
<local node="router1">
<interface name="eth0" AdvSendAdvertisements="on">
<AdvPrefix AdvValidLifetime="2592000" AdvOnLinkFlag="true"
AdvPreferredLifetime="604800" AdvAutonomousFlag="true">
2001:db8:1::/64
</AdvPrefix>
<inetAddr tentative="false">2001:db8:1::1</inetAddr>
</interface>
<tunnel>
<tunnelEntry entryPoint="2001:db8::1" exitPoint="2001:db8::2">
<triggers destination="2001:db8:3::"/>
</tunnelEntry>
</tunnel>
</local>
</routingTable>
See also: Ipv6, Ipv6NeighbourDiscovery, Icmpv6
Usage diagram¶
Inheritance diagram¶
Used in compound modules¶
Name |
Type |
Description |
|---|---|---|
compound module |
Represents a complete IPv6 network layer (L3), to be used within hosts and routers. It connects to higher-layer protocols (TCP, UDP, …) on top and to the network interfaces below, and bundles the modules that together implement IPv6: |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“{numRoutes} routes\n{numDestCache} destcache entries” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
interfaceTableModule |
string |
The path to the InterfaceTable module |
|
routes |
xml |
xml(“<routingTable/>”) |
|
forwarding |
bool |
false |
|
isRouter |
bool |
this.forwarding |
|
multicastForwarding |
bool |
false |
|
useAdminDist |
bool |
false |
Use Cisco-like administrative distances |
advManagedFlag |
bool |
false |
“Managed address configuration” (M) flag in RAs |
advOtherConfigFlag |
bool |
false |
“Other configuration” (O) flag in RAs |
advLinkMtu |
int |
1280 |
MTU option in RAs (1280 = IPv6 minimum MTU, 0 = don’t include) |
advCurHopLimit |
int |
30 |
Cur Hop Limit field in RAs (0 = unspecified) |
advDefaultLifetime |
double |
-1s |
Router Lifetime in RAs (-1 = auto: 3*maxRtrAdvInterval) |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
Ipv6RoutingTable |
|
display |
i=block/table |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
mrouteAdded |
inet::Ipv6MulticastRoute |
||
mrouteChanged |
inet::Ipv6MulticastRoute |
||
mrouteDeleted |
inet::Ipv6MulticastRoute |
||
routeAdded |
inet::Ipv6Route |
||
routeChanged |
inet::Ipv6Route |
||
routeDeleted |
inet::Ipv6Route |
Source code¶
//
// IPv6 Routing Table and Neighbor Discovery data structures.
// NOTE: This component MUST be named as `routingTable6` inside
// a ~StandardHost/~Router etc. in order to be accessible by the
// ~Ipv6 and other modules.
//
// <b>XML Configuration (legacy)</b>
//
// NOTE: For new simulations, prefer ~Ipv6NetworkConfigurator which provides
// automatic prefix assignment, hierarchical addressing, route computation,
// and per-interface RA/NDP parameter configuration using pattern-based XML.
//
// The `routes` XML parameter allows manual configuration of interface
// IPv6 settings and IPv6 tunnels. The root element is `<routingTable>`,
// containing `<local>` elements that target specific nodes. Only `<local>`
// elements whose `node` attribute matches the host module's full name
// (i.e. `getFullName()`) are processed.
//
// Each `<local>` element may contain `<interface>` and `<tunnel>` child elements.
//
// <b>Interface configuration</b>
//
// The `<interface>` element configures an IPv6 interface. Attributes:
// - `name` (required): the interface name (e.g. "eth0", "wlan0")
// - `AdvSendAdvertisements` (required): enable/disable Router Advertisement
// sending ("on"/"true"/"yes" or "off"/"false"/"no")
//
// The `<interface>` element may contain the following child elements:
//
// - `<AdvPrefix>`: Defines an advertised prefix. The element text is the
// prefix in "address/length" notation (e.g. "2001:db8:1::/64"). Attributes:
// - `AdvValidLifetime` (required): valid lifetime in seconds
// - `AdvPreferredLifetime` (required): preferred lifetime in seconds
// - `AdvOnLinkFlag` (required): whether the prefix is on-link ("true"/"false")
// - `AdvAutonomousFlag` (required): whether the prefix can be used for SLAAC ("true"/"false")
//
// - `<inetAddr>`: Assigns a static IPv6 address to the interface. The element
// text is the IPv6 address. Attributes:
// - `tentative` (required): whether the address is tentative ("true"/"false")
//
// <b>Tunnel configuration</b>
//
// The `<tunnel>` element contains `<tunnelEntry>` child elements. Each
// `<tunnelEntry>` defines an IPv6-in-IPv6 tunnel. Attributes:
// - `entryPoint` (required): tunnel entry point IPv6 address
// - `exitPoint` (required): tunnel exit point IPv6 address
//
// Each `<tunnelEntry>` must contain exactly one `<triggers>` child element:
// - `destination` (required): the destination prefix that triggers tunneling
//
// <b>Example</b>
//
// <pre>
// <routingTable>
// <local node="router1">
// <interface name="eth0" AdvSendAdvertisements="on">
// <AdvPrefix AdvValidLifetime="2592000" AdvOnLinkFlag="true"
// AdvPreferredLifetime="604800" AdvAutonomousFlag="true">
// 2001:db8:1::/64
// </AdvPrefix>
// <inetAddr tentative="false">2001:db8:1::1</inetAddr>
// </interface>
// <tunnel>
// <tunnelEntry entryPoint="2001:db8::1" exitPoint="2001:db8::2">
// <triggers destination="2001:db8:3::"/>
// </tunnelEntry>
// </tunnel>
// </local>
// </routingTable>
// </pre>
//
// @see ~Ipv6, ~Ipv6NeighbourDiscovery, ~Icmpv6
//
simple Ipv6RoutingTable extends SimpleModule like IRoutingTable
{
parameters:
@class(Ipv6RoutingTable);
string interfaceTableModule; // The path to the InterfaceTable module
displayStringTextFormat = default("{numRoutes} routes\n{numDestCache} destcache entries");
@display("i=block/table");
xml routes = default(xml("<routingTable/>"));
bool forwarding = default(false);
bool isRouter = default(this.forwarding);
bool multicastForwarding = default(false);
bool useAdminDist = default(false); // Use Cisco-like administrative distances
// Router Advertisement defaults (applied to all router interfaces)
bool advManagedFlag = default(false); // "Managed address configuration" (M) flag in RAs
bool advOtherConfigFlag = default(false); // "Other configuration" (O) flag in RAs
int advLinkMtu = default(1280); // MTU option in RAs (1280 = IPv6 minimum MTU, 0 = don't include)
int advCurHopLimit = default(30); // Cur Hop Limit field in RAs (0 = unspecified)
double advDefaultLifetime @unit(s) = default(-1s); // Router Lifetime in RAs (-1 = auto: 3*maxRtrAdvInterval)
@signal[routeAdded](type=inet::Ipv6Route);
@signal[routeChanged](type=inet::Ipv6Route);
@signal[routeDeleted](type=inet::Ipv6Route);
@signal[mrouteAdded](type=inet::Ipv6MulticastRoute);
@signal[mrouteDeleted](type=inet::Ipv6MulticastRoute);
@signal[mrouteChanged](type=inet::Ipv6MulticastRoute);
}