[erlang-questions] gen_tcp:send(Sock, SmallPacket) issue
Thu Jun 21 12:24:24 CEST 2007
Matthias Lang wrote:
> Fredrik Thulin writes:
> > The complexity comes from having to implement retransmissions
> > yourself, and even though SIP has done just that, it hasn't solved
> > all issues with flow control and messages larger than your typical
> > MTU.
> I'm aware of two MTU issues. One is that a fragmented UDP packet
> stands an uncomfortably high chance of being dropped (if any one of
> the fragments gets dropped, you lose the whole UDP packet). The other
> is that some networks discard fragmented packets. I never really
> understood why that is (paranoid firewalls?). Is there more?
Those are the ones I was thinking of.
In SIP, it is basically solved by mandating that you use TCP when a
request approaches the MTU in size. Since requests grow in size for
every node they pass, this might happen somewhere in the middle of the
requests path from client to server.
This adds more complexity than one might think, because the responses
are symmetrically routed back from server to client, so the node
switching from TCP to UDP will have to do the reverse for responses
coming back from the server. Might seem simple, but then there are
different timeout values for TCP and UDP, since a single timeout
wouldn't work well for both reliable and unreliable transports.
This part of SIP is way into the land of dragons and madness.
More information about the erlang-questions