The Ethernet Model¶
Ethernet is the most popular wired LAN technology nowadays, and its use is also growing in metropolitan area and wide area networks. Since its introduction in 1980, Ethernet data transfer rates have increased from the original 10Mb/s to the latest 400Gb/s. Originally, The technology has changed from using coaxial cables and repeaters to using unshielded twisted-pair cables with hubs and switches. Today, switched Ethernet is prevalent, and most links operate in full duplex mode. The INET Framework contains support for all major Ethernet technologies and device types.
In Ethernet networks containing multiple switches, broadcast storms are prevented by use of a spanning tree protocol (STP, RSTP) that disables selected links to eliminate cycles from the topology. Ethernet switch models in INET contain support for STP and RSTP.
There are several node models that can be used in an Ethernet network:
EthernetSwitch models an Ethernet switch, i.e. a multiport bridging device
WireJunction can models the coaxial cable (10BASE2 or 10BASE5 network segments) on legacy Ethernet networks, or an Ethernet hub/multiport repeater
EthernetHost is a sample node which can be used to generate “raw” Ethernet traffic
EthernetSwitch models an Ethernet switch. Ethernet switches play an important role in modern Ethernet LANs. Unlike passive hubs and repeaters that work in the physical layer, the switches operate in the data link layer and relay frames between the connected subnets.
In modern Ethernet LANs, each node is connected to the switch directly by full duplex lines, so no collisions are possible. In this case, the CSMA/CD is not needed and the channel utilization can be high.
duplexMode parameters of the MACs must be set according to
the medium connected to the port; if collisions are possible (it’s a bus
or hub) it must be set to false, otherwise it can be set to true. By
default it uses half-duplex MAC with CSMA/CD.
The WireJunction can model an Ethernet hub. Ethernet hubs are a simple broadcast devices. Messages arriving on a port are regenerated and broadcast to every other port.
The connections connected to the hub must have the same data rate. Cable lengths should be reflected in the delays of the connections.
The WireJunction component can also model a connection to a common coaxial cable found in early Ethernet LANs. Network nodes are attached to the WireJunction via a DatarateChannel. The WireJunction modules are connected to each other via DatarateChannel as well. When a node sends a signal, it will propagate along the cable in both directions at the given propagation speed.
The speed of the connection can be set on the datarate channels; all connected channels must have the same speed.
The Physical Layer¶
Stations on an Ethernet networks are connected by coaxial, twisted pair or fibre cables. (Coaxial only has historical importance, but is supported by INET anyway.) There are several cable types specified in the standard.
In the INET framework, the cables are represented by connections. The
connections used in Ethernet LANs must be derived from
DatarateChannel and should have their
datarate parameters set. The delay parameter can be used to model
the distance between the nodes. The datarate parameter can have four
10Mbps (classic Ethernet)
100Mbps (Fast Ethernet)
1Gbps (Gigabit Ethernet, GbE)
10Gbps (10 Gigabit Ethernet, 10GbE)
40Gbps (40 Gigabit Ethernet, 40GbE)
100Gbps (100 Gigabit Ethernet, 100GbE)
There is currently no support for 200Gbps and 400Gbps Ethernet.
The EthernetInterface compound module implements the IWiredInterface interface. Complements EthernetCsmaMac and EthernetEncapsulation with an output queue for QoS and RED support. It also has configurable input/output filters as IHook components similarly to the PppInterface module.
The Ethernet MAC (Media Access Control) layer transmits the Ethernet frames on the physical media. This is a sublayer within the data link layer. Because encapsulation/decapsulation is not always needed (e.g. switches does not do encapsulation/decapsulation), it is implemented in a separate modules (e.g. EthernetEncapsulation) that are part of the LLC layer.
Nowadays almost all Ethernet networks operate using full-duplex point-to-point connections between hosts and switches. This means that there are no collisions, and the behaviour of the MAC component is much simpler than in classic Ethernet that used coaxial cables and hubs. The INET framework contains two MAC modules for Ethernet: the EthernetMac is simpler to understand and easier to extend, because it supports only full-duplex connections. The EthernetCsmaMac module implements the full MAC functionality including CSMA/CD, it can operate both half-duplex and full-duplex mode.
The following components are present in the model:
From the two MAC implementation EthernetMac is the simpler
one, it operates only in full-duplex mode (its
parameter fixed to
true in its NED definition). This module does
not need to implement CSMA/CD, so there is no collision detection,
retransmission with exponential backoff, carrier extension and frame
Ethernet MAC layer implementing CSMA/CD. It supports both half-duplex
and full-duplex operations; in full-duplex mode it behaves as
EthernetMac. In half-duplex mode it detects collisions,
sends jam messages and retransmit frames upon collisions using the
exponential backoff algorithm. In Gigabit Ethernet networks it supports
carrier extension and frame bursting. Carrier extension can be turned
off by setting the
carrierExtension parameter to
The EthernetEncapsulation module performs Ethernet II or Ethernet with SNAP encapsulation/decapsulation.
INET framework ethernet switches are built from IMacRelayUnit components. Each relay unit has N input and output gates for sending/receiving Ethernet frames. They should be connected to EthernetInterface modules.
The relay unit holds a table for the destination address -> output port mapping in a MacForwardingTable module. When the relay unit receives a data frame, it updates the table with the source address->input port.
If the destination address is not found in the table, the frame is broadcast. The frame is not sent to the same port it was received from, because then the target should already have received the original frame.
A simple scheme for sending PAUSE frames is built in (although users will probably change it). When the buffer level goes above a high watermark, PAUSE frames are sent on all ports. The watermark and the pause time is configurable; use zero values to disable the PAUSE feature.
The MacForwardingTable module stores the mapping between ports and MAC addresses. Entries are deleted if their age exceeds a certain limit.
If needed, address tables can be pre-loaded from text files at the
beginning of the simulation; this controlled by the
forwardingTableFile module parameter. In the file, each line
contains a literal 0 (reserved for VLAN id), a hexadecimal MAC address
and a decimal port number, separated by tabs. Comment lines beginning
with ’#’ are also allowed:
0 01 ff ff ff ff 0 0 00-ff-ff-ee-d1 1 0 0A:AA:BC:DE:FF 2
Entries are deleted if their age exceeds the duration given as the
The Stp module type implements Spanning Tree Protocol (STP). STP is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them.
STP creates a spanning tree within a network of connected layer-2 bridges, and disables those links that are not part of the spanning tree, leaving a single active path between any two network nodes.
The Ethernet model operates according to the following standards:
Ethernet: IEEE 802.3-1998
Fast Ethernet: IEEE 802.3u-1995
Full-Duplex Ethernet with Flow Control: IEEE 802.3x-1997
Gigabit Ethernet: IEEE 802.3z-1998