115-441 Computer NetworkingLecture 5 – Applications DNS, WebLecture 5: 09-11-2002 2Outline• How DNS resolves names• How well does DNS work today• HTTP intro and detailsLecture 5: 09-11-2002 3DNS Design: Hierarchy Definitionsrootedunetorgukcomgwu ucb cmu bumitcsececmcl• Each node in hierarchy stores a list of names that end with same suffix• Suffix = path up tree• E.g., given this tree, where would following be stored:• Fred.com• Fred.edu• Fred.cmu.edu• Fred.cmcl.cs.cmu.edu• Fred.cs.mit.eduLecture 5: 09-11-2002 4DNS Design: Zone Definitionsrootedunetorgukcomcagwu ucb cmu bumitcsececmclSingle nodeSubtreeComplete Tree• Zone = contiguous section of name space• E.g., Complete tree, single node or subtree• A zone has an associated set of name servers• Must store list of names and tree links2Lecture 5: 09-11-2002 5DNS Design: Cont.• Zones are created by convincing owner node to create/delegate a subzone• Records within zone stored multiple redundant name servers• Primary/master name server updated manually• Secondary/redundant servers updated by zone transfer of name space• Zone transfer is a bulk transfer of the “configuration” of a DNSserver – uses TCP to ensure reliability• Example:• CS.CMU.EDU created by CMU.EDU administrators• Who creates CMU.EDU?Lecture 5: 09-11-2002 6DNS: Root Name Servers• Responsible for “root” zone• Approx. dozen root name servers worldwide• Currently {a-m}.root-servers.net• Local name servers contact root servers when they cannot resolve a name• Configured with well-known root serversLecture 5: 09-11-2002 7Servers/Resolvers• Each host has a resolver• Typically a library that applications can link to• Local name servers hand-configured (e.g. /etc/resolv.conf)• Name servers• Either responsible for some zone or…• Local servers• Do lookup of distant host names for local hosts• Typically answer queries about local zoneLecture 5: 09-11-2002 8DNS Message FormatIdentificationNo. of QuestionsNo. of Authority RRsQuestions (variable number of answers)Answers (variable number of resource records)Authority (variable number of resource records)Additional Info (variable number of resource records)FlagsNo. of Answer RRsNo. of Additional RRsName, type fields for a queryRRs in response to queryRecords for authoritative serversAdditional “helpful info that may be used12 bytes3Lecture 5: 09-11-2002 9DNS Header Fields• Identification• Used to match up request/response• Flags• 1-bit to mark query or response• 1-bit to mark authoritative or not• 1-bit to request recursive resolution• 1-bit to indicate support for recursive resolutionLecture 5: 09-11-2002 10Typical ResolutionClientLocal DNS serverroot & eduDNS serverns1.cmu.edu DNS serverwww.cs.cmu.eduNS ns1.cmu.eduwww.cs.cmu.eduNS ns1.cs.cmu.eduA www=IPaddrns1.cs.cmu.eduDNSserverLecture 5: 09-11-2002 11Typical Resolution• Steps for resolving www.cmu.edu• Application calls gethostbyname() (RESOLVER)• Resolver contacts local name server (S1)• S1queries root server (S2) for (www.cmu.edu)• S2returns NS record for cmu.edu (S3)• What about A record for S3?• This is what the additional information section is for (PREFETCHING)• S1queries S3for www.cmu.edu• S3returns A record for www.cmu.edu• Can return multiple A records à what does this mean?Lecture 5: 09-11-2002 12Lookup MethodsRecursive query:• Server goes out and searches for more info (recursive)• Only returns final answer or “not found”Iterative query:• Server responds with as much as it knows (iterative)• “I don’t know this name, but ask this server”Workload impact on choice?• Local server typically does recursive• Root/distant server does iterativerequesting hostsurf.eurecom.frgaia.cs.umass.eduroot name serverlocal name serverdns.eurecom.fr123456authoritative name serverdns.cs.umass.eduintermediate name serverdns.umass.edu78iterated query4Lecture 5: 09-11-2002 13Workload and Caching• What workload do you expect for different servers?• Why might this be a problem? How can we solve this problem?• DNS responses are cached • Quick response for repeated translations• Other queries may reuse some parts of lookup• NS records for domains • DNS negative queries are cached• Don’t have to repeat past mistakes• E.g. misspellings, search strings in resolv.conf•Cached data periodically times outLecture 5: 09-11-2002 14Subsequent Lookup ExampleClientLocal DNS serverroot & eduDNS servercmu.eduDNS servercs.cmu.eduDNSserverftp.cs.cmu.eduftp=IPaddrftp.cs.cmu.eduLecture 5: 09-11-2002 15Reliability• DNS servers are replicated• Name service available if = one replica is up• Queries can be load balanced between replicas• UDP used for queries• Need reliability à must implement this on top of UDP!• Why not just use TCP?Lecture 5: 09-11-2002 16Reliability• Try alternate servers on timeout à what’s a timeout?• What’s a good value for a timeout?• Hard to tell à what are the tradeoffs?• Better be conservative!• Exponential backoff when retrying same server• Why do we need this?• Same identifier for all queries• Don’t care which server responds5Lecture 5: 09-11-2002 17Reverse Name Lookup• 128.2.206.138?• Lookup 138.206.2.128.in-addr.arpa• Why is the address reversed?• Happens to be www.intel-iris.net and mammoth.cmcl.cs.cmu.edu à what will reverse lookup return? Both?• Should only return name that reflects address allocation mechanismLecture 5: 09-11-2002 18Prefetching• Name servers can add additional data to any response• Typically used for prefetching• CNAME/MX/NS typically point to another host name• Responses include address of host referred to in “additional section”Lecture 5: 09-11-2002 19Mail Addresses• MX records point to mail exchanger for a name• E.g. mail.acm.org is MX for acm.org• Addition of MX record type proved to be a challenge• How to get mail programs to lookup MX record for mail delivery?• Needed critical mass of such mailersLecture 5: 09-11-2002 20Outline• How DNS resolves names• How well does DNS work today• HTTP intro and details6Lecture 5: 09-11-2002 21DNS Experience• One of the greatest challenges seemed to be getting good name server implementations• Developers were typically happy with “good enough” implementation• Challenging, large scale, wide area distributed system• Like routing, but easier to have broken implementations that
View Full Document