An Important fact

This is a discussion on An Important fact within the Networking/Device Communication forums, part of the General Programming Boards category; Hi Folks, All of us knows that we use UDP protocol in DNS Server . BUT, there is a situation ...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    36

    An Important fact

    Hi Folks,

    All of us knows that we use UDP protocol in DNS Server.

    BUT, there is a situation when we use TCP in DNS Server. That situation is something about truncating.

    Can anyone put more lights on this concept and come out with an explaination that WHEN and WHY we use TCP in DNS.

    -- Cavestine

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    A single UDP packet cannot be larger than 512 bytes. If the response doesn't fit into that, the request has to be done via TCP.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    mog
    mog is offline
    Sasquatch mog's Avatar
    Join Date
    Dec 2006
    Location
    Caves of Narshe
    Posts
    16
    TCP must be used in zone-transfers between master and slave -servers.
    If the TC-bit is set in the response to the resolver, it could either query again for the missing information or switch to TCP and do the same query again.

    A good resolver do not switch to TCP if you ask me.
    According to my (not huge, but i have developed some dns-clients) experience this rarely happens because if one host/domain/tld exists more than one time in a package it contains a "pointer" to the first place it occured instead of the whole name again.
    Most of the time the domain and tld are the same for all servers related to the response so 512 bytes is often more than enough.

    UDP use only two packets for a query and TCP use around 13 packets, so ask again for only the missing information is highly recommended.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What Is Important In Making Games?
    By Krak in forum C++ Programming
    Replies: 6
    Last Post: 05-07-2004, 09:12 PM
  2. a simple fact about chess
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 07-01-2002, 09:09 PM
  3. Planned Development Community Idea (important)
    By cozman in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 06-12-2002, 01:13 PM
  4. Most important element of a game?
    By Eber Kain in forum Game Programming
    Replies: 24
    Last Post: 01-11-2002, 03:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21