Inspirational Quotes and Speeches

Monday, February 28, 2011

Minimum Ethernet Frame or Packet Size

Minimum Ethernet Frame or Packet Size

Here is my understanding about the reason behind the Minimum Ethernet Frame Size (64 Bytes).

The old Ethernet (10BASE5) LAN spread across the campus area of the university and the normal distance is around 2500meters. Due the physical characteristic of cables, the network is segmented with 500meter cables(see fig). The speed of this LAN is 10Mbps and the cables are coaxial (not CAT5).

Ethernet is a broadcast medium and at a time only one node should sent its frame on the medium. If more then one node are trying to send the frames, then collision will happen. To avoid the collision the Ethernet is using the CSMA/CD technique. In Wire-line network, the device Transmit and Receive on a same medium and easy to detect the collision just by sensing the media. So it uses the CSMA/CD. But in Wireless network, Transmit and Receive is happening on different frequency and it can't detect the collision. So it uses the CSMA/CA, the collision avoidance technique.

What is collision? Before the packet transmission, the Ethernet adapter will check the Ethernet medium for some signal. If it finds the medium is idle, then starts the transmission. Otherwise, it waits until channel become idle and then transmits. During the packet transmission, if the adapter detects another transmission, then it aborts the transmission and sends jam signal - make sure all other transmitters are aware of collision, and it will backoff - Do not send any frame/packet and wait for some amount of time, as specified in the exponential backoff algorithm.

Some more details, refer the image. Now machine A see no signal in the medium and start sending the 100 bytes packet. When it is sending the 50th byte, it detect some collision on the medium and immediately abort its transmission. Is it right? May be No! Why?

The Ethernet adapter will send the frame bits for some X uSec and pause the transmission to check for a collision on the medium and then continue. When it is checking like this, the 1st bit signal of current packet hit the other end of network and echoed back in the opposite direction. Our device is still busy in sending the remaining bytes and checking for collision. If it detect the own frame's echo as a collision then, it will wrongly stop the transmission. And if it does like this, it will never be able to successfully transmit a complete packet. So it should ignore this echo and continue its transmission.

But there is no special technique to differentiate the echo and collisions, then how to ignore the echo collision? The trick is timing, by the time the own frame echo is reaching back, all the other systems in the network detected a collision and stop their transmission. So that the device can safely ignore this echo. Now the next question is, After how much time, it should start ignoring the collisions?

We will find this value using a simple calculation:

LAN Length (L) = 500 x 5 = 2500 Meters

Signal propagation delay on the Cable (S) = 200 Meters/uSec

Delay added by repeater (D) = ~3uSec x 2 (Bi-Direction) x 4 Repeaters = 24uSec

Round Trip Delay (RTD) = (Total Distance/S) + Other Delays = (2L/S) + D = (5000/200) + 24 = 49uSec

So we should start ignoring the collision after the RTD Time, 49uSec. For everyone to notice the collision, we should keep transmitting the bits for the RTD Time or more. So our minimum frame size must be greater then the number of bits that can be transmitted with-in the RTD time.

LAN Capacity (C) = 10Mbps

Bits transmitted with-in RTD = RTD x LAN Capacity = 49 x (10^-6) x 10 x (10^6) = 490 Bits.

Minimum Ethernet Frame/Packet size > 490 Bits

We will take the nearest big number, with power of 8, is 512 Bits.

The minimum Ethernet Frame Size is 512/8 = 64 Bytes. The recent advancement in the Ethernet speed leads to the increase in the minimum frame size. But to maintain the backward compatibility the same minimum frame size retained. And instead of increasing the frame size, the length of the high speed Ethernet network is reduced. The Maximum frame size (1514) was decided to prevent a particular node from hogging the network for long time, efficient buffer handling, retransmission, error recovery, QoS, etc