15-441 Computer NetworkingOutlineNamingObvious Solutions (1)Obvious Solutions (2)Domain Name System GoalsProgrammer’s View of DNSDNS Message FormatDNS Header FieldsDNS RecordsProperties of DNS Host EntriesDNS Design: Hierarchy DefinitionsDNS Design: Zone DefinitionsDNS Design: Cont.DNS: Root Name ServersServers/ResolversTypical ResolutionSlide 18Lookup MethodsWorkload and CachingSlide 21Subsequent Lookup ExampleReliabilityReverse DNS.arpa Name Server HierarchyPrefetchingMail AddressesSlide 28Root ZonegTLDsNew RegistrarsMeasurements of DNSTracing Hierarchy (1)Tracing Hierarchy (2)Tracing Hierarchy (3 & 4)DNS (Summary)15-441 Computer NetworkingLecture 13 – DNSLecture 13: 10-10-2006 2Outline•DNS Design•DNS TodayLecture 13: 10-10-2006 3Naming•How do we efficiently locate resources?•DNS: name IP address•Challenge•How do we scale these to the wide area?Lecture 13: 10-10-2006 4Obvious Solutions (1)Why not centralize DNS?•Single point of failure•Traffic volume•Distant centralized database•Single point of update•Doesn’t scale!Lecture 13: 10-10-2006 5Obvious Solutions (2)Why not use /etc/hosts?•Original Name to Address Mapping•Flat namespace•/etc/hosts •SRI kept main copy•Downloaded regularly•Count of hosts was increasing: machine per domain machine per user•Many more downloads•Many more updatesLecture 13: 10-10-2006 6Domain Name System Goals•Basically a wide-area distributed database•Scalability•Decentralized maintenance•Robustness•Global scope •Names mean the same thing everywhere•Don’t need•Atomicity•Strong consistencyLecture 13: 10-10-2006 7Programmer’s View of DNS•Conceptually, programmers can view the DNS database as a collection of millions of host entry structures:•in_addr is a struct consisting of 4-byte IP address•Functions for retrieving host entries from DNS:•gethostbyname: query key is a DNS host name.•gethostbyaddr: query key is an IP address./* DNS host entry structure */ struct hostent { char *h_name; /* official domain name of host */ char **h_aliases; /* null-terminated array of domain names */ int h_addrtype; /* host address type (AF_INET) */ int h_length; /* length of an address, in bytes */ char **h_addr_list; /* null-terminated array of in_addr structs */ };Lecture 13: 10-10-2006 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 bytesLecture 13: 10-10-2006 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 13: 10-10-2006 10DNS RecordsRR format: (class, name, value, type, ttl)•DB contains tuples called resource records (RRs)•Classes = Internet (IN), Chaosnet (CH), etc.•Each class defines value associated with typeFOR IN class:•Type=A•name is hostname•value is IP address•Type=NS•name is domain (e.g. foo.com)•value is name of authoritative name server for this domain•Type=CNAME•name is an alias name for some “canonical” (the real) name•value is canonical name•Type=MX•value is hostname of mailserver associated with nameLecture 13: 10-10-2006 11Properties of DNS Host Entries•Different kinds of mappings are possible:•Simple case: 1-1 mapping between domain name and IP addr:•kittyhawk.cmcl.cs.cmu.edu maps to 128.2.194.242•Multiple domain names maps to the same IP address:•eecs.mit.edu and cs.mit.edu both map to 18.62.1.6•Single domain name maps to multiple IP addresses:•aol.com and www.aol.com map to multiple IP addrs.•Some valid domain names don’t map to any IP address:•for example: cmcl.cs.cmu.eduLecture 13: 10-10-2006 12DNS 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 13: 10-10-2006 13DNS 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 linksLecture 13: 10-10-2006 14DNS 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 DNS server – uses TCP to ensure reliability•Example:•CS.CMU.EDU created by CMU.EDU administrators•Who creates CMU.EDU or .EDU?Lecture 13: 10-10-2006 15DNS: Root Name Servers•Responsible for “root” zone•Approx. 13 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 servers•Newer picture www.root-servers.orgLecture 13: 10-10-2006 16Servers/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 13: 10-10-2006 17Typical ResolutionClientLocal DNS serverroot & edu DNS serverns1.cmu.edu DNS serverwww.cs.cmu.eduNS ns1.cmu.eduwww.cs.cmu.eduNS ns1.cs.cmu.eduA www=IPaddrns1.cs.cmu.eduDNSserverLecture 13: 10-10-2006 18Typical Resolution•Steps for resolving www.cmu.edu•Application calls gethostbyname() (RESOLVER)•Resolver contacts local name server (S1)•S1 queries root server (S2) for (www.cmu.edu)•S2 returns NS record for cmu.edu (S3)•What about A record for S3?•This is what the additional information section is for (PREFETCHING)•S1 queries S3
View Full Document