Package: inet.node.base
LinkLayerNodeBase
compound moduleAn extension of the basic node infrastructure with link layer functionality. Provides support for various network interfaces and link layer protocols, forming the foundation for network connectivity.
Adds an interface table and multiple types of network interfaces, including Ethernet, PPP, wireless, loopback, tunnel, and virtual interfaces. It also includes support for link layer protocols such as LLC, bridging, and various Ethernet encapsulation methods.
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.
Known subclasses
| Name | Type | Description |
|---|---|---|
| NetworkLayerNodeBase | compound module |
An extension of the link layer node base with network layer functionality. Provides support for multiple network protocols, including IPv4 and IPv6. |
Extends
| Name | Type | Description |
|---|---|---|
| NodeBase | compound module |
The fundamental infrastructure for all network nodes focusing on non-communication aspects of network nodes. |
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" |
Properties
| Name | Value | Description |
|---|---|---|
| class | NodeBase | |
| networkNode | ||
| labels | node | |
| display | bgb=1256,1125 |
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 |
Source code
// // An extension of the basic node infrastructure with link layer // functionality. Provides support for various network interfaces and link layer // protocols, forming the foundation for network connectivity. // // Adds an interface table and multiple types of network interfaces, // including Ethernet, PPP, wireless, loopback, tunnel, and virtual interfaces. // It also includes support for link layer protocols such as LLC, bridging, // and various Ethernet encapsulation methods. // module LinkLayerNodeBase extends NodeBase like IEthernetNetworkNode { parameters: bool recordPcap = default(false); int numPcapRecorders = default(recordPcap ? 1 : 0); int numLoInterfaces = default(1); int numWlanInterfaces = default(0); int numEthInterfaces = default(0); // Minimum number of Ethernet interfaces int numPppInterfaces = default(0); // Minimum number of PPP interfaces int numTunInterfaces = default(0); int numVirtInterfaces = default(0); string fcsMode @enum("declared","computed") = default("declared"); pcapRecorder[*].pcapFile = default("${resultdir}/${configname}-#${runnumber}" + fullPath() + ".pcap"); mobility.typename = default(numWlanInterfaces > 0 ? "StationaryMobility" : ""); *.interfaceTableModule = default(absPath(".interfaceTable")); *.fcsMode = this.fcsMode; wlan[*].radio.antenna.mobilityModule = default("^.^.^.mobility"); ethernet.registerProtocol = default(true); @figure[linkLayer](type=rectangle; pos=250,458; size=1000,434; fillColor=#0000ff; lineColor=#808080; cornerRadius=5; fillOpacity=0.1); @figure[linkLayer.title](type=text; pos=1245,463; anchor=ne; text="link layer"); @figure[interfaceLayer](type=rectangle; pos=250,908; size=1000,210; fillColor=#00ffff; lineColor=#808080; cornerRadius=5; fillOpacity=0.1); @figure[interfaceLayer.title](type=text; pos=1245,913; anchor=ne; text="interface layer"); gates: input radioIn[numWlanInterfaces] @directIn; inout pppg[numPppInterfaces] @labels(PppFrame-conn) @allowUnconnected; inout ethg[numEthInterfaces] @labels(EtherFrame-conn) @allowUnconnected; submodules: pcapRecorder[numPcapRecorders]: PcapRecorder { @display("p=125,720;is=s"); } interfaceTable: InterfaceTable { @display("p=125,240;is=s"); } llc: <default("")> like IIeee8022Llc if typename != "" { @display("p=375,525"); } cb: MessageDispatcher { @display("p=750,600;b=1000,5"); } bridging: <default("")> like IProtocolLayer if typename != "" { @display("p=750,675"); } bl: MessageDispatcher { @display("p=750,750;b=1000,5"); } ethernet: <default(sizeof(ethg) > 0 ? "EthernetEncapsulation" : "")> like IEthernetLayer if typename != "" { @display("p=375,825"); } ieee8021q: <default("")> like IIeee8021qLayer if typename != "" { @display("p=525,825"); } ieee8021r: <default("")> like IIeee8021rLayer if typename != "" { @display("p=675,825"); } li: MessageDispatcher { @display("p=750,900;b=1000,5,,,,1"); } lo[numLoInterfaces]: <default("LoopbackInterface")> like ILoopbackInterface { @display("p=750,975,row,150"); } // TODO move WLAN interfaces after Ethernet interfaces, but it changes IP address assignment and breaks examples/inet/configurator/complex.ini wlan[numWlanInterfaces]: <default("Ieee80211Interface")> like IWirelessInterface { @display("p=375,1000,row,150;q=queue"); } ppp[sizeof(pppg)]: <default("PppInterface")> like IPppInterface { @display("p=300,975,row,150;q=txQueue"); } eth[sizeof(ethg)]: <default("EthernetInterface")> like IEthernetInterface { @display("p=900,975,row,150;q=txQueue"); } tun[numTunInterfaces]: <default("TunInterface")> like ITunnelInterface { @display("p=975,1000,row,150;q=txQueue"); } virt[numVirtInterfaces]: <default("VirtualInterface")> like IVirtualInterface { @display("p=975,1000,row,150;q=txQueue"); } connections allowunconnected: llc.lowerLayerOut --> cb.in++ if exists(llc); llc.lowerLayerIn <-- cb.out++ if exists(llc); cb.out++ --> bridging.upperLayerIn if exists(bridging); bridging.upperLayerOut --> cb.in++ if exists(bridging); bridging.lowerLayerOut --> bl.in++ if exists(bridging); bl.out++ --> bridging.lowerLayerIn if exists(bridging); cb.out++ --> bl.in++ if !exists(bridging); bl.out++ --> cb.in++ if !exists(bridging); bl.out++ --> li.in++; li.out++ --> bl.in++; bl.out++ --> ieee8021q.upperLayerIn if exists(ieee8021q); ieee8021q.upperLayerOut --> bl.in++ if exists(ieee8021q); bl.out++ --> ieee8021r.upperLayerIn if exists(ieee8021r); ieee8021r.upperLayerOut --> bl.in++ if exists(ieee8021r); bl.out++ --> ethernet.upperLayerIn if exists(ethernet); ethernet.upperLayerOut --> bl.in++ if exists(ethernet); ieee8021q.lowerLayerOut --> li.in++ if exists(ieee8021q); li.out++ --> ieee8021q.lowerLayerIn if exists(ieee8021q); ieee8021r.lowerLayerOut --> li.in++ if exists(ieee8021r); li.out++ --> ieee8021r.lowerLayerIn if exists(ieee8021r); ethernet.lowerLayerOut --> li.in++ if exists(ethernet); li.out++ --> ethernet.lowerLayerIn if exists(ethernet); for i=0..sizeof(radioIn)-1 { radioIn[i] --> { @display("m=s"); } --> wlan[i].radioIn; } for i=0..sizeof(ethg)-1 { ethg[i] <--> { @display("m=s"); } <--> eth[i].phys; } for i=0..sizeof(pppg)-1 { pppg[i] <--> { @display("m=s"); } <--> ppp[i].phys; } for i=0..numLoInterfaces-1 { li.out++ --> lo[i].upperLayerIn; lo[i].upperLayerOut --> li.in++; } for i=0..sizeof(radioIn)-1 { wlan[i].upperLayerOut --> li.in++; wlan[i].upperLayerIn <-- li.out++; } for i=0..sizeof(ethg)-1 { eth[i].upperLayerOut --> li.in++; eth[i].upperLayerIn <-- li.out++; } for i=0..sizeof(pppg)-1 { ppp[i].upperLayerOut --> li.in++; ppp[i].upperLayerIn <-- li.out++; } for i=0..numTunInterfaces-1 { tun[i].upperLayerOut --> li.in++; tun[i].upperLayerIn <-- li.out++; } for i=0..numVirtInterfaces-1 { virt[i].upperLayerOut --> li.in++; virt[i].upperLayerIn <-- li.out++; } }File: src/inet/node/base/LinkLayerNodeBase.ned