[asterisk-dev] Re: [Fwd: [svn-commits]
oej: branch oej/iaxtrunkfix-1.2 r44779
Brian Candler
B.Candler at pobox.com
Wed Oct 11 05:03:04 MST 2006
On Wed, Oct 11, 2006 at 12:28:27PM +0100, Brian Candler wrote:
> You can get DF=0 in Linux by adding the following code after the socket is
> opened:
>
> {
> int val = IP_PMTUDISC_DONT;
> if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val)) < 0)
> {
> fprintf(stderr, "Failed to disable PMTU discovery\n");
> }
> }
>
> [This is Linux-specific code which would need to be autoconf'd out on
> non-Linux systems]
>
> Now, I don't know exactly what the "bad audio" problems are that are
> described, nor do I know any details of the IAX2 protocol (SIP is enough for
> me :-)
>
> But searching the source for Asterisk, it doesn't seem to contain the string
> PMTU anywhere in it, so I can only assume that you'll get the default
> behaviour. This will lead to catastrophic failure if Asterisk tries to send
> large UDP packets.
P.S. This will apply to SIP too - e.g. if you send a 1000-byte INVITE but it
hits a 576-byte MTU IP link, it will be blackholed if DF=1.
With SIP you could have the option of switching to TCP, but you'll still
need to make the decision as to when to do this. Setting DF=0 and letting IP
fragment large datagrams, as it was originally designed to do, takes care of
this transparently (up to a limit of 64KB)
Regards,
Brian.
More information about the asterisk-dev
mailing list