|
Q & A on Queuing arriving UDP datagrams Q: In section 5.7.7 of Internetworking with TCP/IP, volume 3, it is stated that one reason listen() is needed is because a new connection request could arrive during the time the connection-oriented server is busy handling an existing request. However, doesn't the same problem apply to UDP requests that arrive while a connectionless server is busy processing the UDP request (either iteratively or concurrently)? Even though it is connectionless, I can't imagine that the UDP requests are just dropped because the server process is momentarily (even microseconds) busy dispatching the previous request. A: A UDP port does indeed have a short queue that holds incoming datagrams until the local application using the port has a chance to read and process them. However, the _listen_ function that allows an application to determine the size of the request queue only applies to a socket that uses TCP; the size of the UDP queue is determined by the protocol software or the OS configuration. The reasoning behind such a decision is: (1) Accepting a new TCP connection usually requires significantly more processing than does UDP message processing, (2) UDP does not guarantee reliable delivery, so applications using it must be prepared to retransmit. |