Ethernet Model Overview

Data packets and Ethernet frames

Ethernet frames carry data packets as encapsulated cMessage objects. Data packets can be of any message type (cMessage or cMessage subclass).

The model encapsulates data packets in Ethernet frames using the encapsulate() method of cMessage. Encapsulate() updates the length of the Ethernet frame too, so the model doesn't have to take care of that.

The models supports various Ethernet frame types: Ethernet II, 803.2 with LLC header, and 803.3 with LLC and SNAP headers. The corresponding classes are: EthernetIIFrame, EtherFrameWithLLC and EtherFrameWithSNAP. They all class from EtherFrame which only represents the basic MAC frame with source and destination addresses. EtherMAC only deals with EtherFrames, and does not care about the specific subclass.

Autoconfiguration

In order to facilitate building large models, EtherMAC and other Ethernet model components provide some degree of auto-configuration. Specifically, transmission rate and half duplex/full duplex mode can be chosen automatically so that connecting Ethernet MACs have matching settings. The purpose is similar to Ethernet Auto-Negotiation; however the mechanism is NOT a model of Auto-Negotiation (e.g. EtherBus and EtherHub also actively participate, which obviously does not happen in a real Ethernet.)

What it does:

How it works:

Auto-configuration occurs at the beginning of the simulation, by Ethernet model components (EtherMAC, EtherHub and EtherBus) exchanging EtherAutoconfig messages with each other. See description of EtherAutoconfig for more info.

MAC and higher layers

MAC and LLC are implemented as separate modules (EtherMAC and EtherLLC/EtherEncap) because encapsulation/decapsulation functionality is not always needed. (Switches don't do encapsulation/decapsulation.) In switches, EtherMAC is used with MACRelayUnit.

EtherLLC and higher layers

The EtherLLC module can serve several applications (higher layer protocols), and dispatch data to them. Higher layers are identified by DSAP. See Application registration for more info.

EtherEncap doesn't have the functionality to dispatch to different higher layers because in practice it'll always be used with IP.