Ethernet Protocol¶
Ethernet protocol is used for message exchanges between ethernet-capable network
interfaces. The protocol defines (1) a network interface address called a MAC
address, (2) the format of a L1
frame and a L2
packet, (3) along
with forwarding processes of packets.
The Ethernet protocol defines a physical layer transmission scheme as shown in the figure above.
Note
The L1 format specification of the transmission unit is referred to as an Ethernet frame throughout this documentation. The data portion is where Ethernet packet fields such as addresses and protocol types reside.
The portions of the frame other than data
are handling the digital signal
transmission and reception mechanisms: preamble
is a sequence of alternating
1
and 0
bits mimicking the clock signal so that the receiving device can
synchronize with the packet bit stream. By the time the FSD
(Frame Sequence
Delimiter) portion is received, the circuit of the device should be ticking its
clock synchronous with the packet’s bit stream. FSD
at that stage is signaling
the receiving device the start of the packet data. Finally, after all data portion
is received, FCS
(Frame Check Sequence) verifies the frame’s integrity.
Analogy: Packet Clock
Devices in a network all have clocks that enable digital signals to be
detected as 1
and 0
bits. Namely, decisions are made in circuits on a
received bit during one bit time period (the period of the clock of the particular
signal) on whether this is a 1
or a 0
bit. The period of the clock
is less than or equal to the rate of the data transmissions. For example, an
Ethernet link at 1 Gbps is able to process bits of value 1
or 0
within
a time duration of 1 nsec.
That is, the digital circuit makes a decision on reception of a value of
1
or a 0
within that time period. However, every device’s circuit
clock would tick at its own time. These device clocks may not tick synchronously
with all others in the network. This is similar to kitchen clocks set up
manually - for two clocks to be synchronous, two people would have to press
the set button at exactly the same time.
The frame carries the layer 2 (also called logical link layer) data. The data
portion to the frame has L2
Ethernet protocol fields: MAC addresses for source and
destination end devices, data type, and the payload. This time the payload
data field is referring to the higher layer protocol (L3
) that is carried
by the Ethernet protocol packet’s payload portion.
Analogy: Envelope and Letter vs Packet Header and Payload
Ethernet packet format includes addresses for from
and to
in the form of
source and destination MAC addresses. This is similar to how we address a
mailing envelope. The envelops is analogous to the header portion of the packet.
Sometimes the shape and size of the envelope or a particular stamped identifier
on the envelope can indicate the type
of the mail:
a regular letter, a postcard, or a larger package. In this respect, the
payload
or data
is what is being mailed; the letter, card, or whatever is
in a package.
Protocol Components¶
Ethernet Frame
The Ethernet frame includes a preamble and FSD (frame sequence delimiter) so that the receiving network interfaces can detect the starting bit of the data part of the frame, i.e., the packet of one and zero bits. The trailing FCS (frame check sequence) verifies frame’s integrity. Ethernet protocol defines the frame format.
Ethernet Packet
The Ethernet packet is composed of source and destination MAC addresses, the type
of protocol data in the payload, the EtherType, or usually referred to as
just the type, and finally the payload portion that carries the message data. The
message data could be the message itself such as Hello World
or a packet of a
layer 3 (L3) protocol, specified in the type field of the packet.
The critical components of the Ethernet protocol are:
MAC addresses
Payload data type
Payload
1. MAC Address¶
Network interfaces are addressed by a unique 48-bit-long integer called the MAC address. It is usually represented as a sequence of six hexadecimal number pairs separated by a colon or a period.
There are reserved MAC addresses for various usage scenarios of the Ethernet
protocol. The address space of 6 bytes is organized into two sections of 3 bytes
each: OUI (Organizationally Unique Identifier) and the NIC (Network Interface
Controller) specific. OUI section’s first octet last bit may be 0 for a
unicast address and 1 for multicast addresses. When the bit before last
one of the first octet is 1
,
OUI is globally unique and when it is 0
, the address is locally administered.
Some portion of the MAC address may indicate the manufacturer’s identifier for a specific hardware network interface card or the hypervisor that instantiates the virtual machines or containers.
Note
Example MAC addresses and representations:
1. aa:aa:bb:bb:13:9f
or cc-89-37-15-ee-ff
, both unicast addresses,
as the bit sequence in the first octet is 1010 1010
and 1100 1100
respectively, and ending with a 0
bit for unicast.
2. 01:80:c2:00:00:00
a multicast address, as the bit sequence in the
first octet is 0000 0001
ending with a 1
bit for multicast
addresses.
All sending and receiving end devices are identified by their MAC addresses in Ethernet protocol. Forwarding devices rely on MAC addresses as the unique identifiers inside each layer 2 network in order to make forwarding decisions for packets.
A unique MAC address is a unicast address that identifies an end device among all other devices in an Ethernet network. On the other hand, multicast MAC addresses are used among a specific set of devices that are programmed to receive on and send to those addresses. Multicast addresses are assigned to be used by specific protocol messages using the Ethernet packet format.
Analogy: Multicast vs Unicast
In a large party, when addressing a specific group of people such as the designated drivers of all attending people, the communication is analogous to multicast. When addressing all people in the party, the communication is a broadcast. When only a pair are talking to each other, the communication is analogous to unicast.
The MAC address that is composed of all 1
bits has a special name, broadcast
MAC address: FF:FF:FF:FF:FF:FF
. The broadcast address is used to reach all
end devices within a particular Ethernet network which will be covered in depth
during the learning module on Ethernet bridge MAC learning.
Analogy: Multicast vs Broadcast
Your subscription to a cable channel is a special form of multicast where
all subscribers are able to view the same programming from the content
provider. However, there is still the option to utilize an antenna with your
TV to access the local broadcast
channels in your region, which are
meant to reach everybody with a receiving TV device.
2. Payload Data Type: EtherType¶
The type of protocol that is carried in the payload portion of the packet is indicated by a type code which is called the EtherType, a 16-bit integer that is usually represented in hexadecimal form. Example Ethernet type codes are listed in the following table:
EtherType |
Protocol |
---|---|
0x0800 |
Internet Protocol v4 (IPv4) |
0x0806 |
Address Resolution Protocol (ARP) |
0x86DD |
Internet Protocol v6 (IPv6) |
0x8100 |
VLAN-tagged frame (IEEE 802.1Q) |
0x88CC |
Link Layer Discovery Protocol (LLDP) |
Analogy: Letter, Package, Box, or Postcard
The type of payload data being carried is indicated in the EtherType field so that the receiving end device can decode the expected data structure correctly when reading the payload portion of this packet.
3. Payload Data¶
The payload field of the Ethernet packet carries the data. Data can be the message itself or a packet of a higher layer protocol that the Ethernet packet is carrying. The Ethernet protocol treats the payload data field as a meaningless stream of bits which does not influence the protocol behavior.
Only in the case of EtherType being a VLAN-tagged packet, namely
0x8100
, the devices that run IEEE 802.1q will continue on to identifying the next
two bytes for the VLAN tag.
Each lower layer protocol encapsulates the data of a higher layer protocol within its payload field while indicating the type of data (or the identifier of the higher layer protocol) in the header portion of the packet.
Ethernet Device Behavior¶
End devices send and receive packets on their network interfaces. The network interface card is the hardware component that handles Ethernet protocol packets.
An Ethernet network interface on an end device is programmed to receive all packets on the link that they are connected to. However, only the packets that are destined to the end device, that is, with a destination MAC address that is equal to the receiving end device’s interface MAC address, are further processed.
Analogy: TV sets receiving broadcast channels
TV broadcast programs are sent as electromagnetic waves over the air. All TV sets are receiving these signals over the air through a connected antenna. However, only the selected channel is tuned to by the receiving TV while all other broadcast channels are filtered out.
Bridges forward packets on their ports. Bridges have a similar behavior to the end devices in the sense that they receive on all of their ports at all times. In addition, bridges (1) read the header of every packet, (2) make a forwarding decision, and then (3) forward the packet.
Analogy: Hot Potato
Network devices regard all packets as if each packet is a hot potato and needs to be forwarded to the next device as soon as possible: specifically, within a packet time frame for a given bit rate. In this respect, they make a forwarding decision and forward the packet to the corresponding port(s) within a packet time during a regular forwarding operation.
The packet forwarding on a simple link is illustrated in the figure.