Ethernet Frame Format
What is Ethernet?
As we know in computer networking, LAN (Local Area Network) is used to connect devices in limited geographical areas like schools or a building.LAN uses different topologies (arrangement of nodes in a network) like BUS, STAR, MESH, etc.
Ethernet is the most popular technology used in LAN. It is based upon IEEE (Institute of Electrical and Electronics Engineers) standards. Ethernet is based on IEEE 802.11 standard.
It uses BUS topology in LAN. The reason Ethernet is most popular is because it is quite easy to implement this, and it is also low costly.
In computer networking, there are 7 layers of communication on a network as defined in OSI (Open System Interconnection) model:
- Physical layer
- Data link layer
- Network layer
- Transport layer
- Session layer
- Presentation layer
- Application layer
Ethernet is used in physical and data link layers. In the physical layer data is transmitted in the form of 0s and 1s (stream of bits).In the data link layer when data is received, then it adds some extra bits to make sure data will reach the correct node and be error-free. For this, it adds the MAC (Media Access Control), often known as the physical address, of the sender and receiver in the data. But data is converted in the frames then it adds these extra bits.
As the data link layer has the work to add extra bits that is why Ethernet is mostly used in DLL.
Ethernet frame format is a predefined format by IEEE to add extra bits in a specific place with original data.
This frame is divided into 7 sections:
- Preamble
- SFD
- Destination address
- Source address
- Length
- Data
- CRC
Ethernet Frame Format
7 bytes | 1 byte | 6 bytes | 6 bytes | 2 bytes | (46-1500 bytes) | 4 bytes |
Preamble | SFD | Destination Address | Source Address | Length | Data | CRC |
1. Preamble
The size of the preamble section is 7 bytes or 56 bits. This is the indication that the frame is starting. Basically 0s and 1s are put in this section at alternative places (0101010….). The reason the preamble is used is that during the transmission of data, if some data is lost then, original data will not be lost as we have a protective section of the preamble.
So it is a protective section attached at the starting of original data to avoid them from loss of a single bit.
It also works as an indication for the receiver that the frame has started and the original message is coming, so hold the bits.
2. SFD
SFD is also known as Start of Frame Delimiter. This section is of 1byte or 8 bits consisting of alternative bits of 0s and 1s starting from 1, but the last bit is altered.
SFD: 10101011
The main objective of the SFD section is to indicate at the receiving end that the frame is just going to start, and the next bits are the address of the destination.
3. Destination address
This section is of size 6 byte or 48 bits long. Here MAC address of receiving node or targeted device is put. It also makes sure that if the MAC address is wrong, then the receiving device will discard the data.
4. Source address
It is also the 6 bytes-long section.MAC address (Media Access Control) of the source node is put in it. With this section, the receiving device can easily identify the source node.
5. Length
It is a 2 bytes or 16-bit long section which contains the length of the whole Ethernet frame. The minimum value is 0, and the maximum value is 65534, although we can have a maximum 1500 size of Ethernet format.
It also describes which IP version is present. If it is 0x800, then IPv4 and if it is 0x86dd, then it is IPv6.
6. Data
This section is the most important section because it contains the actual message bits which we want to transfer over the network. The data in this section is called payload. 46 bytes is the minimum size and the maximum possible size is 1500 bytes of the data.If the data is less than 46 bytes, then 0’s are inserted before the data to make its size 46 bytes.
7. CRC
It is 4 bytes long or 32 bits long section which is also called Cyclic Redundancy Check. It contains a specific hashcode, and if at the receiving end hashcode is changed, it means our data is also changed over the path. So it helps to identify whether data is corrupted or not.
If we calculate the size of Ethernet format, then the Minimum size is 64 bytes for 46 bytes of payload if we exclude the preamble and SFD.
Maximum is 1518 bytes for 1500 bytes of payload.