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 |
macType | string | csmacdSupport ? "EtherMAC" : "EtherMACFullDuplex" | |
queueType | string | "" |
DropTailQueue, DiffServQueue, or empty to use the internal queue |
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 |
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 | |
cli.remoteSAP | int | 0xf1 | |
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 |
srv.localSAP | int | 0xf1 | |
queue.pauseQueue.frameCapacity | int | 100 | |
mac.promiscuous | bool |
if true, all packets are received, otherwise only the ones with matching destination MAC address |
|
mac.address | string |
MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0. |
|
mac.duplexMode | bool |
selects full-duplex (true) or half-duplex (false) operation |
|
mac.txQueueLimit | int |
maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule=="" |
|
mac.mtu | int |
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 macType = default(csmacdSupport ? "EtherMAC" : "EtherMACFullDuplex"); // ~EtherMAC or ~EtherMACFullDuplex string queueType = default(""); // DropTailQueue, DiffServQueue, or empty to use the internal queue @networkNode(); @labels(node,ethernet-node); @display("i=device/pc2"); *.interfaceTableModule = default(""); gates: inout ethg @labels(EtherFrame-conn); submodules: status: NodeStatus if hasStatus { @display("p=50,50;is=s"); } cli: EtherAppCli { parameters: registerSAP = true; @display("p=120,58,col"); } srv: EtherAppSrv { parameters: registerSAP = true; @display("p=310,58,col"); } llc: EtherLLC { parameters: @display("p=215,118"); gates: upperLayerIn[2]; upperLayerOut[2]; } queue: EtherQoSQueue if queueType != "" { parameters: dataQueueType = parent.queueType; @display("p=159,199;q=l2queue"); } mac: <macType> like IEtherMAC { parameters: queueModule = (parent.queueType == "" ? "" : "^.queue"); @display("p=215,270;q=txQueue"); } connections: cli.out --> llc.upperLayerIn[0]; cli.in <-- llc.upperLayerOut[0]; srv.out --> llc.upperLayerIn[1]; srv.in <-- llc.upperLayerOut[1]; llc.lowerLayerOut --> queue.in if queueType != ""; queue.out --> mac.upperLayerIn if queueType != ""; llc.lowerLayerOut --> mac.upperLayerIn if queueType == ""; mac.upperLayerOut --> llc.lowerLayerIn; mac.phys <--> ethg; }File: src/inet/node/ethernet/EtherHost.ned