Page 1 of 1

HEADER_SIZE in source

Posted: Sat Apr 23, 2011 10:44 pm
by kuchiku
Can someone explain to me where did this values came from?

Code: Select all

/*
 * Overhead added to packets by various protocols.
 */
#define IPv4_UDP_HEADER_SIZE              28
#define IPv4_TCP_HEADER_SIZE              40
#define IPv6_UDP_HEADER_SIZE              40

I cant find any reference to 28 and 40 in the packet structure of tcp and udp.

Re: HEADER_SIZE in source

Posted: Sun Apr 24, 2011 9:27 pm
by janjust
28 and 40 bytes for UDP and TCP traffic are "normal" in my view.
read up on the ethernet and tcp/udp protocols, e.g.
http://sd.wareonearth.com/~phil/net/overhead/

Re: HEADER_SIZE in source

Posted: Sun Apr 24, 2011 10:39 pm
by kuchiku
Thanks for the link