Ethernet Frame Structure Explained
1. Preamble and Start Frame Delimiter (SFD)
The Preamble is a sequence of 7 bytes (56 bits) of alternating 1s and 0s. It serves as a signal to synchronize the timing of the receiving device. The Start Frame Delimiter (SFD) is a single byte (8 bits) that immediately follows the Preamble. The SFD signals the start of the actual Ethernet frame.
Example: The Preamble might look like "10101010" repeated 7 times, and the SFD would be "10101011". Together, they prepare the receiving device to interpret the incoming data correctly.
2. Destination and Source MAC Addresses
The Destination MAC Address is a 6-byte (48-bit) field that specifies the physical address of the intended recipient of the frame. The Source MAC Address is also a 6-byte (48-bit) field that identifies the sender of the frame. These addresses ensure that the frame reaches the correct device on the network.
Example: If a frame is sent from a device with MAC address "00:1A:2B:3C:4D:5E" to a device with MAC address "00:23:45:67:89:AB", the frame will include "00:23:45:67:89:AB" as the Destination MAC and "00:1A:2B:3C:4D:5E" as the Source MAC.
3. EtherType/Length Field
The EtherType/Length field is a 2-byte (16-bit) field that indicates the type of protocol encapsulated in the frame's payload or the length of the payload. For example, an EtherType of 0x0800 indicates that the payload contains an IPv4 packet, while an EtherType of 0x86DD indicates an IPv6 packet.
Example: If the EtherType field is "0x0800", the receiving device knows to interpret the payload as an IPv4 packet. If it is "0x86DD", the payload is interpreted as an IPv6 packet.
4. Payload (Data)
The Payload, also known as the Data field, is the actual information being transmitted. It can range from 46 to 1500 bytes. The payload contains the data from higher-layer protocols, such as IP packets, which are then further processed by the receiving device.
Example: If you are sending an email, the payload might contain the text of the email, which is encapsulated in an IP packet. This IP packet is then placed in the Ethernet frame's payload field.
5. Frame Check Sequence (FCS)
The Frame Check Sequence (FCS) is a 4-byte (32-bit) field that contains a cyclic redundancy check (CRC) value. The FCS is used to detect errors in the transmitted frame. The receiving device calculates its own CRC and compares it with the FCS to ensure data integrity.
Example: If the FCS calculated by the receiving device does not match the FCS in the frame, the frame is discarded, and the sender may retransmit the data.