[erlang-questions] UDP questions

Pagayon, Ruel ruel@REDACTED
Wed Jan 27 16:58:09 CET 2016


>> 1) Can I find out the max binary size that can be sent/received?

I believe you're getting that error because you exceeded the default value
of the receive buffer, which is 8192 bytes. It's on the gen_udp doc.

>> 2) Can I increase the max size?

You can set the option {recbuf, ...} to change the max size.

>> 3) Is there a guaranteed minimum packet length that will not be
fragemented?
>> 3) Can received packets be fragmented - TCP has a  {packet,N}
>>        option and some built-in defragmentation, what's the story for
>>        UDP?

In the network layer in general, both TCP and UDP can be sent through an
interface, disassembled, and re-assembled at its destination. This can
happen if the packet size exceeds the interface's MTU (e.g. 1500).

In the application layer, with the {packet, N} option is viable in TCP
because it's reliable and it has flow control. UDP can drop packets along
the way and can be received out of order.

Cheers,
Ruel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160127/664ac725/attachment.htm>


More information about the erlang-questions mailing list