public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: J?rgen Lambrecht <J.Lambrecht@televic.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
		Juergen Lambrecht <Jurgen.Lambrecht@scarlet.be>,
		ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] max IP packet size = 9216 B. Why?
Date: Wed, 13 Jun 2007 15:44:00 -0000	[thread overview]
Message-ID: <20070613133618.GA1044@lunn.ch> (raw)
In-Reply-To: <466FEF53.1060909@televic.com>

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

  reply	other threads:[~2007-06-13 13:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 21:58 Jürgen Lambrecht
2007-06-12 22:12 ` Andrew Lunn
2007-06-12 22:46   ` Jürgen Lambrecht
2007-06-12 23:03     ` Andrew Lunn
2007-06-13 14:24       ` Jürgen Lambrecht
2007-06-13 15:44         ` Andrew Lunn [this message]
     [not found] ` <058cebc1-1c19-438d-b5de-2c8015835c36@googlegroups.com>
2017-06-20 10:29   ` Jürgen Lambrecht
2017-06-23 10:32     ` Jürgen Lambrecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070613133618.GA1044@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=J.Lambrecht@televic.com \
    --cc=Jurgen.Lambrecht@scarlet.be \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).