Package: inet.node.inet
Router
compound moduleA network router device with support for multiple routing protocols and network interfaces. Provides the foundation for simulating various types of routers in both wired and wireless networks.
The Router(1,2) module extends ApplicationLayerNodeBase with routing protocol support, including OSPF, BGP, RIP, PIM, and EIGRP. It has packet forwarding enabled by default and can be configured with various interface types.
<b>See also:</b> ~StandardHost
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 |
|---|---|---|
| IPv4LargeLAN | compound module |
Several hosts and an Ethernet hub on a switch. One port of the hub connect to a 10Base2 segment. |
| IPv4MediumLAN | compound module |
Several hosts and a router on an Ethernet hub and a switch |
| IPv4SmallLAN | compound module |
Several hosts on a router; part of ~IPv4LargeNet. |
Used in
| Name | Type | Description |
|---|---|---|
| AODVNetworkWithEthernet | network |
Extended AODV network with an additional Ethernet-connected host that can receive traffic from the wireless AODV network. |
| ARPTest | network | (no description) |
| ARPTest | network | (no description) |
| Basic3 | network | (no description) |
| BGP_Basic_Topology | network | (no description) |
| BGP_LOCAL_PREF | network | (no description) |
| BGP_Topology_1 | network | (no description) |
| BGP_Topology_1a | network | (no description) |
| BGP_Topology_2 | network | (no description) |
| BGP_Topology_3 | network | (no description) |
| BGP_Topology_4 | network | (no description) |
| bottleneck | network | (no description) |
| bottleneck | network | (no description) |
| bottleneck | network | (no description) |
| BulkTransfer | network | (no description) |
| Byte_order | network | (no description) |
| CloudAndRouters | network | (no description) |
| ComplexConfiguratorNetwork | network | (no description) |
| ConfiguratorA | network | (no description) |
| ConfiguratorB | network | (no description) |
| ConfiguratorE | network | (no description) |
| DcTcpIncast | network | (no description) |
| DiffservNetwork | network | (no description) |
| DiffservNetwork | network |
This network contains a router with an 10Mbps Ethernet interface, and with a 128kbps dialup connection to a server. |
| DiffservNetwork | network | (no description) |
| Dplpmtud | network | (no description) |
| ExtServerExample | network | (no description) |
| FlatNet | network | (no description) |
| Freshness | network | (no description) |
| Hierarchical | network | (no description) |
| Hierarchical99 | network |
This hierarchical network topology contains 3 levels, 72 hosts and 27 routers. |
| InterfaceNetworkType | network | (no description) |
| InterfaceTableVisualizationAdvancedFeaturesShowcase | network | (no description) |
| IPv4LargeNet | network |
A large Ethernet LAN -- see model description |
| KIDSNw1 | network | (no description) |
| LinearNetwork | network | (no description) |
| MixedNetwork | network |
TODO Auto-generated network |
| multi | network | (no description) |
| MulticastNetwork | network | (no description) |
| multihomed | network | (no description) |
| Multihop_EBGP | network | (no description) |
| MultiRadio | network | (no description) |
| NClients | network | (no description) |
| NClients | network | (no description) |
| NClients | network | (no description) |
| NClients2 | network | (no description) |
| Network | network |
TODO documentation |
| Network | network | (no description) |
| Network2 | network | (no description) |
| NetworkPathComplexShowcase | network | (no description) |
| NetworkPathRIPShowcase | network | (no description) |
| oneclienthost | network | (no description) |
| OSPF_Area_External_Forwarding | network | (no description) |
| OSPF_AreaTest | network | (no description) |
| OSPF_Default_Route_Distribution | network | (no description) |
| OSPF_LoopAvoidance | network | (no description) |
| OSPF_Route_Selection | network | (no description) |
| OSPF_Suboptimal | network | (no description) |
| OSPF_Summary_LSA | network | (no description) |
| OspfNetwork | network | (no description) |
| PacketDropQueueOverflowShowcase | network | (no description) |
| PcapRecordingShowcase | network | (no description) |
| Persistent_congestion | network | (no description) |
| QuicLinkSharingShowcase | network | (no description) |
| RedMarkerNetwork | network | (no description) |
| RegressionTestingTutorialWired | network | (no description) |
| RIPInfinityCountTest | network | (no description) |
| RipNetworkA | network | (no description) |
| RipNetworkB | network | (no description) |
| RipNetworkC | network | (no description) |
| RouterLSA | network | (no description) |
| RouterPerfNetwork | network | (no description) |
| RoutingTableVisualizationDisplayingAllShowcase | network | (no description) |
| RoutingTableVisualizationFilteringShowcase | network | (no description) |
| RTPMulticast1 | network | (no description) |
| RTPUnicast1 | network | (no description) |
| shared_link | network | (no description) |
| SimpleContinentCloud | network | (no description) |
| testNetwork | network | (no description) |
| TopologyChange | network | (no description) |
| Traceroute | network | (no description) |
| Trafficgen | network | (no description) |
| TransportConnectionVisualizationMultipleConnectionsShowcase | network | (no description) |
| TransportPathVisualizerFilteringShowcase | network | (no description) |
| Tunnel | network | (no description) |
| twoclienthosts | network | (no description) |
| UDPBroadcastNetwork | network | (no description) |
| UDPBurst | network | (no description) |
| VideoStreamingShowcase | network | (no description) |
| VirtualLink | network | (no description) |
| VirtualLink_2 | network | (no description) |
| VoIPStreamTest | network | (no description) |
| VoIPStreamTrafficTest | network | (no description) |
| WiredAndWirelessHostsWithAP | network | (no description) |
| WirelessNetWithDHCP | network | (no description) |
| zerortt | network | (no description) |
Known subclasses
| Name | Type | Description |
|---|---|---|
| BgpRouter | compound module |
A router that supports Border Gateway Protocol version 4 (BGPv4) along with Open Shortest Path First version 4 (OSPFv4). It extends the standard Router(1,2) module with BGP and OSPF functionality enabled. |
| EigrpRouter | compound module |
A router that uses the Enhanced Interior Gateway Routing Protocol (EIGRP). It extends the standard Router(1,2) module with EIGRP functionality and dual-stack (IPv4/IPv6) support. |
| GpsrRouter | compound module | (no description) |
| MulticastRouter | compound module |
A router with multicast routing capabilities that can forward multicast traffic between different network segments. |
| MyRouter | compound module | (no description) |
| OspfRouter | compound module |
A router that uses the Open Shortest Path First version 2 (OSPFv2) routing protocol. It extends the standard Router(1,2) module with OSPF functionality enabled. |
| Ospfv3Router | compound module |
A router that uses the Open Shortest Path First version 3 (OSPFv3) routing protocol. It extends the standard Router(1,2) module with OSPFv3 functionality and IPv6 support. |
| RipRouter | compound module |
A router that uses the Routing Information Protocol (RIP) version 2. Extends the standard Router(1,2) module with RIP functionality enabled. |
| Router6 | compound module |
An IPv6 router for next-generation Internet Protocol networks. It extends the standard Router(1,2) module by configuring it to use IPv6 as the network layer protocol while disabling IPv4 by default. |
Extends
| Name | Type | Description |
|---|---|---|
| ApplicationLayerNodeBase | compound module |
An extension of the transport layer node base that adds support for applications. Provides the highest level of abstraction for network nodes, completing the full network stack from physical to application layer. |
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| displayStringTextFormat | string | "" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| hasStatus | bool | false | |
| hasEnvironment | bool | false | |
| osgModel | string | "" |
3D model for OSG visualization, no 3D model by default |
| osgModelColor | string | "" |
Tint color, no colorization by default |
| canvasImage | string | "" |
Image for canvas visualization, no image by default |
| canvasImageColor | string | "" |
Tint color, no colorization by default |
| recordPcap | bool | false | |
| numPcapRecorders | int | recordPcap ? 1 : 0 | |
| numLoInterfaces | int | 1 | |
| numWlanInterfaces | int | 0 | |
| numEthInterfaces | int | 0 |
Minimum number of Ethernet interfaces |
| numPppInterfaces | int | 0 |
Minimum number of PPP interfaces |
| numTunInterfaces | int | 0 | |
| numVirtInterfaces | int | 0 | |
| fcsMode | string | "declared" | |
| hasIpv4 | bool | true | |
| hasIpv6 | bool | false | |
| hasGn | bool | false | |
| forwarding | bool | true | |
| multicastForwarding | bool | false | |
| hasUdp | bool | hasRip || hasDhcp | |
| hasTcp | bool | hasBgp | |
| hasSctp | bool | false | |
| hasQuic | bool | false | |
| numApps | int | 0 | |
| hasEigrp | bool | false | |
| hasOspf | bool | false | |
| hasRip | bool | false | |
| hasBgp | bool | false | |
| hasPim | bool | false | |
| hasDhcp | bool | false |
Properties
| Name | Value | Description |
|---|---|---|
| class | NodeBase | |
| networkNode | ||
| labels | node | |
| display | i=abstract/router |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| radioIn [ ] | input | numWlanInterfaces | |
| pppg [ ] | inout | numPppInterfaces | |
| ethg [ ] | inout | numEthInterfaces |
Unassigned submodule parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| status.displayStringTextFormat | string | "" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| status.initialStatus | string | "UP" |
TODO @signal, @statistic |
| environment.displayStringTextFormat | string | "" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| environment.initStage | int | 0 |
Initialization stage for the setup command |
| environment.globalNamespace | bool | false |
Create new network namespaces under /var/run/netns/ (Linux only) |
| environment.namespace | string | "" |
Name of the host OS network namespace (optional) (Linux only) |
| environment.setupCommand | string | "" |
A host OS system command |
| environment.teardownCommand | string | "" |
A host OS system command |
| pcapRecorder.displayStringTextFormat | string | "rec: %n pks" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| pcapRecorder.verbose | bool | true |
Whether to log packets on the module output |
| pcapRecorder.recordEmptyPackets | bool | true |
Specifies if zero length packets are recorded or not |
| pcapRecorder.enableConvertingPackets | bool | true |
Specifies if converting packets to link type is allowed or not |
| pcapRecorder.pcapFile | string | "" |
The PCAP file to be written, suggested value: pcapFile = "${resultdir}/${configname}-#${runnumber}" + fullpath() + ".pcap" |
| pcapRecorder.fileFormat | string | "pcapng" | |
| pcapRecorder.snaplen | int | 65535 |
Maximum number of bytes to record per packet |
| pcapRecorder.timePrecision | int | 6 |
Time precision in recorded file. pcap supports only 6 (usec) or 9 (nanosec), pcapng supports more values (see 'if_tsresol' option in pcapng file format). |
| pcapRecorder.dumpBadFrames | bool | true |
Enable dump of frames with hasBitError |
| pcapRecorder.moduleNamePatterns | string | "wlan[*] eth[*] ppp[*]" |
Space-separated list of sibling module names to listen on |
| pcapRecorder.sendingSignalNames | string | "transmissionEnded" |
Space-separated list of outbound packet signals to subscribe to |
| pcapRecorder.receivingSignalNames | string | "receptionEnded" |
Space-separated list of inbound packet signals to subscribe to |
| pcapRecorder.dumpProtocols | string | "ethernetmac ppp ieee80211mac" |
Space-separated list of protocol names as defined in the Protocol class |
| pcapRecorder.packetFilter | object | "*" |
Which packets are considered, matches all packets by default |
| pcapRecorder.helpers | string | "" |
Usable PcapRecorder::IHelper helpers for accept packettype and store/convert packet as specified linktype currently available: "inet::AckingMacToEthernetPcapRecorderHelper" |
| pcapRecorder.alwaysFlush | bool | false |
Flush the pcapFile after each write to ensure that all packets are captured in case of a crash |
| interfaceTable.displayStringTextFormat | string | "" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| interfaceTable.displayAddresses | bool | false |
Whether to display IP addresses on links |
| cb.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| cb.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| cb.forwardServiceRegistration | bool | true | |
| cb.forwardProtocolRegistration | bool | true | |
| cb.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| cb.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| cb.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| bl.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| bl.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| bl.forwardServiceRegistration | bool | true | |
| bl.forwardProtocolRegistration | bool | true | |
| bl.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| bl.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| bl.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| li.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| li.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| li.forwardServiceRegistration | bool | true | |
| li.forwardProtocolRegistration | bool | true | |
| li.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| li.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| li.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| eth.bitrate | double | ||
| nl.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| nl.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| nl.forwardServiceRegistration | bool | true | |
| nl.forwardProtocolRegistration | bool | true | |
| nl.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| nl.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| nl.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| tn.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| tn.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| tn.forwardServiceRegistration | bool | true | |
| tn.forwardProtocolRegistration | bool | true | |
| tn.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| tn.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| tn.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| at.displayStringTextFormat | string | "processed %p pk (%l)" |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
| at.interfaceTableModule | string |
Module path to the ~InterfaceTable module |
|
| at.forwardServiceRegistration | bool | true | |
| at.forwardProtocolRegistration | bool | true | |
| at.interfaceMapping | object | {} |
Maps network interface names to connected submodule names (e.g. {"eth0": "bridging"}), overrides automatically learned dispatching; * overrides all learned network interfaces, ? overrides default |
| at.serviceMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ethernetmac": "bridging"}), overrides automatically learned dispatching; * overrides all learned services, ? overrides default |
| at.protocolMapping | object | {} |
Maps protocols to connected submodule names (e.g. {"ipv4": "bridging"}), overrides automatically learned dispatching; * overrides all learned protocols, ? overrides default |
| bgp.interfaceTableModule | string |
The path to the InterfaceTable module |
|
| bgp.routingTableModule | string | ||
| bgp.ospfRoutingModule | string | parent.hasOspf ? "^.ospf" : "" |
Source code
// // A network router device with support for multiple routing protocols // and network interfaces. Provides the foundation for simulating various types of // routers in both wired and wireless networks. // // The Router module extends ApplicationLayerNodeBase with routing protocol support, // including OSPF, BGP, RIP, PIM, and EIGRP. It has packet forwarding enabled by default // and can be configured with various interface types. // // @see ~StandardHost // module Router extends ApplicationLayerNodeBase { parameters: @display("i=abstract/router"); @figure[submodules]; forwarding = true; bool hasEigrp = default(false); bool hasOspf = default(false); bool hasRip = default(false); bool hasBgp = default(false); bool hasPim = default(false); bool hasDhcp = default(false); hasUdp = default(hasRip || hasDhcp); hasTcp = default(hasBgp); *.routingTableModule = default("^.ipv4.routingTable"); submodules: ospf: <default("Ospfv2")> like IOspf if hasOspf { parameters: @display("p=975,226"); } bgp: <"Bgp"> like IBgp if hasBgp { parameters: ospfRoutingModule = default(parent.hasOspf ? "^.ospf" : ""); @display("p=825,76"); } rip: <"Rip"> like IApp if hasRip { parameters: @display("p=975,76"); } pim: <"Pim"> like IPim if hasPim { parameters: @display("p=825,226"); } dhcp: <"DhcpServer"> like IApp if hasDhcp { parameters: @display("p=1125,76"); } eigrp: <"EigrpProcessDS"> like IEigrp if hasEigrp { parameters: enableIPv6 = parent.hasIpv6; enableIPv4 = parent.hasIpv4; @display("p=1113,225"); } connections allowunconnected: ospf.ipOut --> tn.in++ if hasOspf; ospf.ipIn <-- tn.out++ if hasOspf; eigrp.ipOut --> tn.in++ if hasEigrp; eigrp.ipIn <-- tn.out++ if hasEigrp; bgp.socketOut --> at.in++ if hasBgp; bgp.socketIn <-- at.out++ if hasBgp; rip.socketOut --> at.in++ if hasRip; rip.socketIn <-- at.out++ if hasRip; pim.networkLayerOut --> tn.in++ if hasPim; pim.networkLayerIn <-- tn.out++ if hasPim; dhcp.socketOut --> at.in++ if hasDhcp; dhcp.socketIn <-- at.out++ if hasDhcp; }File: src/inet/node/inet/Router.ned