Tarishi Jain
Tarishi Jain

Reputation: 264

How is DNS reliable when it uses UDP protocol at transport layer?

I have searched the same and got something like this:

"An application can use UDP and can be reliable by using timeout and resend at application layer."

Does reliability only means sending acknowledgments and what about identifying corrupted/duplicate packets? Can anybody explain me the depth of this.

Upvotes: 1

Views: 645

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123380

UDP not being reliable means that UDP does not care itself that the packet is received by the peer, ordering of packets, duplicates etc.

But, an application layer protocol can itself care about this and does not need to rely on the reliability of the lower layer. In case of DNS each request should lead to exactly one response and receiving the response is implicitly the acknowledgment that the request was received. Also a DNS request and response each fit into a single UDP packet - so reordering does not matter. Each UDP request has a unique combination of ID and source port and the response packet contains the same ID and port - so it is clear which response belongs to which query. And if a response is not received within some time it will assume that it either the request or the response are lost and simply retry with a new query.

Upvotes: 4

Related Questions