Package: inet.linklayer.contract
IEtherMAC
module interfaceInterface for Ethernet MAC implementations. All Ethernet MAC implementations should implement this (i.e. declared as: EtherMAC like IEtherMAC). The existing implementations are these: EtherMAC and EtherMACFullDuplex.
Doesn't do encapsulation/decapsulation; see EtherLLC and EtherEncap for that.
Expected environment:
- phys$i and phys$o should be connected to the "network"
- upperLayerIn and upperLayerOut are usually connected to EtherLLC (in hosts) or IMACRelayUnit (in a switch)
The module does not perform encapsulation or decapsulation of frames -- this is done by higher layers (EtherLLC or EtherEncap).
When a frame is received from the higher layers, it must be an EtherFrame, and with all protocol fields filled out (including the destination MAC address). The source address, if left empty, will be filled in. Then frame is queued and transmitted according to the CSMA/CD protocol.
Data frames received from the network are EtherFrames. They are passed to the higher layers without modification. Also, the module properly responds to PAUSE frames, but never sends them by itself -- however, it transmits PAUSE frames received from upper layers. See PAUSE handling for more info.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Implemented by
Name | Type | Description |
---|---|---|
EtherMAC | simple module |
Ethernet MAC layer. MAC performs transmission and reception of frames. See the IEtherMAC for the Ethernet MAC layer general informations. Doesn't do encapsulation/decapsulation; see EtherLLC and EtherEncap for that. |
EtherMACFullDuplex | simple module |
Ethernet MAC which supports full-duplex operation ONLY. See the IEtherMAC for general informations. |
Used in compound modules
Name | Type | Description |
---|---|---|
EtherHost | compound module |
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). |
EtherHost2 | compound module |
An example host with one Ethernet interface and an Ethernet traffic generator directly connected to it. This host model does not contain higher layer protocols (IP, TCP). By default is configured to use half-duplex MAC (CSMA/CD). |
EthernetInterface | compound module |
Ethernet network interface. Complements EtherMAC and EtherEncap with an output queue for QoS and RED support. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
promiscuous | bool |
if true, all packets are received, otherwise only the ones with matching destination MAC address |
|
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. |
|
duplexMode | bool |
selects full-duplex (true) or half-duplex (false) operation |
|
txQueueLimit | int |
maximum number of frames queued up for transmission; additional frames are dropped. Only used if queueModule=="" |
|
queueModule | string |
name of optional external queue module |
|
mtu | int |
Properties
Name | Value | Description |
---|---|---|
display | i=block/rxtx |
Source code
// // Interface for Ethernet MAC implementations. All Ethernet MAC implementations // should implement this (i.e. declared as: EtherMAC like IEtherMAC). // The existing implementations are these: ~EtherMAC and ~EtherMACFullDuplex. // // Doesn't do encapsulation/decapsulation; see ~EtherLLC and ~EtherEncap for // that. // // Expected environment: // - phys$i and phys$o should be connected to the "network" // - upperLayerIn and upperLayerOut are usually connected to ~EtherLLC (in hosts) // or ~IMACRelayUnit (in a switch) // // The module does not perform encapsulation or decapsulation of frames -- // this is done by higher layers (~EtherLLC or ~EtherEncap). // // When a frame is received from the higher layers, it must be an ~EtherFrame, // and with all protocol fields filled out // (including the destination MAC address). The source address, if left empty, // will be filled in. Then frame is queued and transmitted according // to the CSMA/CD protocol. // // Data frames received from the network are EtherFrames. They are passed to // the higher layers without modification. // Also, the module properly responds to PAUSE frames, but never sends them // by itself -- however, it transmits PAUSE frames received from upper layers. // See <a href="ether-pause.html">PAUSE handling</a> for more info. // moduleinterface IEtherMAC { parameters: bool promiscuous; // if true, all packets are received, otherwise only the // ones with matching destination MAC address string address; // MAC address as hex string (12 hex digits), or // "auto". "auto" values will be replaced by // a generated MAC address in init stage 0. bool duplexMode; // selects full-duplex (true) or half-duplex (false) operation int txQueueLimit; // maximum number of frames queued up for transmission; // additional frames are dropped. Only used if queueModule=="" string queueModule; // name of optional external queue module int mtu @unit("B"); @display("i=block/rxtx"); gates: input upperLayerIn @labels(EtherFrame); // to ~EtherLLC or ~IMACRelayUnit output upperLayerOut @labels(EtherFrame); // to ~EtherLLC or ~IMACRelayUnit inout phys @labels(EtherFrame); // to physical layer or the network }File: src/inet/linklayer/contract/IEtherMAC.ned