How is the MTU is 65535 in UDP but ethernet does not allow frame size more than 1500 bytes
Posted
by
nikku
on Server Fault
See other posts from Server Fault
or by nikku
Published on 2011-03-12T05:27:03Z
Indexed on
2012/10/16
5:10 UTC
Read the original article
Hit count: 508
I am using a fast ethernet of 100 Mbps, whose frame size is less than 1500 bytes (1472 bytes for payload as per my textbook). In that, I was able to send and receive a UDP packet of message size 65507 bytes, which means the packet size was 65507 + 20 (IP Header) + 8 (UDP Header) = 65535.
If the frame's payload size itself is maximum of 1472 bytes (as per my textbook), how can the packet size of IP be greater than that which here is 65535?
I used sender code as
char buffer[100000];
for (int i = 1; i < 100000; i++)
{
int len = send (socket_id, buffer, i);
printf("%d\n", len);
}
Receiver code as
while (len = recv (socket_id, buffer, 100000))
{
printf("%d\n". len);
}
I observed that send
returns -1
on i > 65507
and recv
prints or receives a packet of maximum of length 65507
.
© Server Fault or respective owner