Re: UDP network problem

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 20 Aug 1997 20:31:58 +0100 (BST)


> However I doubt if this is a general solution. One might need to transfer
> arbitrary long messages using UDP. I wonder how TCP is dealing with this
> problem: if I am not mistaken, UDP and TCP wind up using the same driver.

TCP does several important algorithms. Firstly it sends 1 frame at a time
and waits for an ack initially, then tries 2, .. and grows what is called
the "congestion window". When it loses frames it shrinks this value. Thus
TCP adapts so that the outstanding unacked frames total less than the
amount of buffering available on the network for this session.

> Is there a way to get and set the MTU or the number of buffers, from a user
> space program? If so, then one could try adjusting them to suit the size of
> the data he wants to transfer.

Buffers no (this is a weakness someone may care to add an ioctl to fix -
takers send me a diff), MTU yes - SIOCGIFMTU/SIOCSIFMTU

> Unfortunately there is an absolute packet size limit in the kernel (64K
> bytes, I think), and it seems that breaking up the data to smaller sections

64K is an IP limit. The kernel works best with under 4K frames btw if you
want maximum performance.

> How can one send arbitrary long data (even more than 64k) with UDP?

By reinventing TCP. Use TCP