Package: inet.node.ethernet
EtherHost
compound moduleAn example host with one Ethernet port and a traffic generator that generates request-reply traffic directly over Ethernet. This host model does not contain higher layer protocols (IP, TCP). By default it is configured to use half-duplex MAC (CSMA/CD).
Usage diagram
The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| hasStatus | bool | false | |
| csmacdSupport | bool | true |
by default use CSMA/CD |
| fcsMode | string | "declared" |
Properties
| Name | Value | Description |
|---|---|---|
| networkNode | ||
| labels | node | |
| display | i=device/pc2 |
Gates
| Name | Direction | Size | Description |
|---|---|---|---|
| ethg | inout |
Unassigned submodule parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| status.initialStatus | string | "UP" |
TODO @signal, @statistic |
| interfaceTable.displayAddresses | bool | false |
whether to display IP addresses on links |
| cli.destAddress | string | "" |
destination MAC address, or module path name of destination station; empty means off |
| cli.startTime | double | this.sendInterval |
time of sending the first request |
| cli.stopTime | double | -1s |
time of finishing sending, negative values mean forever |
| cli.localSAP | int | 0xf0 |
local service access point |
| cli.remoteSAP | int | 0xf1 |
remote service access point |
| cli.sendInterval | double | uniform(0s,1s) |
interval between sending requests |
| cli.reqLength | int | 100B |
length of request packets |
| cli.respLength | int | 1KiB |
length of response packets |
| cli.stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
| cli.stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
| srv.localSAP | int | 0xf1 | |
| srv.stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
| srv.stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
| llc.interfaceTableModule | string |
The path to the InterfaceTable module |
|
| llc.useSNAP | bool | false |
create EtherFrameWithSNAP frames instead of EthernetIIFrame |
| llc.fcsMode | string | ||
| llc.stopOperationExtraTime | double | -1s |
extra time after lifecycle stop operation finished |
| llc.stopOperationTimeout | double | 2s |
timeout value for lifecycle stop operation |
Source code
// // An example host with one Ethernet port and a traffic generator that // generates request-reply traffic directly over Ethernet. This host model // does not contain higher layer protocols (IP, TCP). By default it is // configured to use half-duplex MAC (CSMA/CD). // module EtherHost { parameters: bool hasStatus = default(false); bool csmacdSupport = default(true); // by default use CSMA/CD string fcsMode @enum("declared","computed") = default("declared"); @networkNode(); @labels(node,ethernet-node); @display("i=device/pc2"); eth.csmacdSupport = csmacdSupport; *.interfaceTableModule = default(absPath(".interfaceTable")); *.fcsMode = fcsMode; eth.encap.typename = "EtherEncapDummy"; gates: inout ethg @labels(EtherFrame-conn); submodules: status: NodeStatus if hasStatus { @display("p=100,100;is=s"); } interfaceTable: InterfaceTable { parameters: @display("p=100,240;is=s"); } cli: EtherAppClient { parameters: @display("p=250,100"); } srv: EtherAppServer { parameters: @display("p=450,100"); } dp: MessageDispatcher { parameters: @display("p=350,158;b=300,5,,,,1"); } llc: EtherEncap { parameters: registerProtocol = true; @display("p=350,240"); } eth: <default("EthernetInterface")> like IEthernetInterface { parameters: @display("p=350,336,row,150;q=txQueue"); } connections: cli.out --> dp.in++; dp.out++ --> cli.in; srv.out --> dp.in++; dp.out++ --> srv.in; dp.out++ --> llc.upperLayerIn; llc.upperLayerOut --> dp.in++; llc.lowerLayerOut --> eth.upperLayerIn; eth.upperLayerOut --> llc.lowerLayerIn; eth.phys <--> { @display("m=s"); } <--> ethg; }File: src/inet/node/ethernet/EtherHost.ned