TCP/UDP for queries in BIND

Brad Knowles brad.knowles at skynet.be
Thu Aug 9 16:19:06 UTC 2001


At 9:32 AM +0530 8/9/01, Vaishali Paithankar Sadaphal wrote:

>  But either in Name Server or in Resolver, there is no option to set it in
>  TCP from beginning.

	Actually, there is.  However, the application has to specifically 
request that the connection be made via a "virtual circuit" (i.e., 
TCP).  Since virtually no applications in existence make this request 
(and you'd have to rewrite the source code for virtually every 
program on the planet), this is a non-feasible subject to pursue.

>  Is their any other reason for using UDP and not using TCP ?

	Speed.  UDP is much, much faster and has much less latency.

	With TCP, there is a three-way connection set up negotiation that 
has to happen, before the first data packet is transmitted.

	With UDP, you just send the data packet and wait for the response.


	In most cases, the response to a UDP query will come back to you 
about as fast as the second phase in setting up a TCP connection 
could begin, so you're several round-trips ahead of the game.  The 
rest of the time, you may suffer packet loss and may have to 
retransmit the UDP query, but overall UDP is much, much faster for 
this application than TCP.

>  Doesn't it need reliability of TCP?

	Nope.

>  Someone was telling me that the TCP packets are given a higher priority on
>  the network.

	Not so far as I know.

-- 
Brad Knowles, <brad.knowles at skynet.be>

H4sICIFgXzsCA2RtYS1zaWcAPVHLbsMwDDvXX0H0kkvbfxiwVw8FCmzAzqqj1F4dy7CdBfn7
Kc6wmyGRFEnvvxiWQoCvqI7RSWTcfGXQNqCUAnfIU+AT8OZ/GCNjRVlH0bKpguJkxiITZqes
MxwpSucyDJzXxQEUe/ihgXqJXUXwD9ajB6NHonLmNrUSK9nacHQnH097szO74xFXqtlbT3il
wMsBz5cnfCR5cEmci0Rj9u/jqBbPeES1I4PeFBXPUIT1XDSOuutFXylzrQvGyboWstCoQZyP
dxX4dLx0eauFe1x9puhoi0Ao1omEJo+BZ6XLVNaVpWiKekxN0VK2VMpmAy+Bk7ZV4SO+p1L/
uErNRS/qH2iFU+iNOtbcmVt9N16lfF7tLv9FXNj8AiyNcOi1AQAA


More information about the bind-users mailing list