This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: max IP packet size = 9216 B. Why?


On Wed, Jun 13, 2007 at 03:21:23PM +0200, J?rgen Lambrecht wrote:
> Thanks Andrew! This solves it.
> So the maximum supported IP packet size for an UDP socket is a 
> configuration option. But you must be a TCP/IP networking expert to know 
> about the option..

Not really, see man 7 socket. It is also in Steven's book.

> >SO_SNDBUF & SO_RCVBUF. However, there might be a system check to
> >ensure they are not too large.

> How can you know wat the allowed maximum is? I guess that is the value of 
> so->so_snd.sb_mbmax that was set default to 73728 (as I saw with the 
> debugger).

The check is:

 if ((u_quad_t)cc > (u_quad_t)sb_max * MCLBYTES / (MSIZE + MCLBYTES))
                return (0);

sb_max has the value SB_MAX, which is (256*1024)
MCLBYTES is (1 << MCLSHIFT)
MCLSHIFT is 11
MSIZE is 128

So that boils down to

(256*1024) * (1 << 11) / (128 + (1<<11)
262144 * 2048 / (2176)
246723

However, there might be another check somewhere else....

As you said, setsockopt should return an error, so you could binary
chop.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]