Slide 1Chapter 2: Application layerDNS: Domain Name SystemDNSDistributed, Hierarchical DatabaseDNS: Root name serversTLD and Authoritative ServersLocal Name ServerDNS name resolution exampleDNS name resolution exampleDNS: caching and updating recordsDNS recordsDNS protocol, messagesDNS protocol, messagesInserting records into DNSChapter 2: Application layerP2P file sharingP2P: centralized directoryP2P: problems with centralized directoryQuery flooding: GnutellaGnutella: protocolGnutella: Peer joiningHierarchical OverlayComparing Client-server, P2P architecturesClient-server: file distribution timeP2P: file distribution timeSlide 27P2P Case Study: BitTorrentBitTorrent (1)BitTorrent (2)P2P Case study: SkypeSkype: making a callChapter 2: Application layerSocket programmingChapter 2: SummaryCS118 Spring 2014Lecture 2C2: Application Layer 2Chapter 2: Application layer•2.1 Principles of network applications•2.2 Web and HTTP•2.3 FTP •2.4 Electronic Mail–SMTP, POP3, IMAP•2.5 DNS•2.6 P2P file sharing•2.7 Socket programming with TCP•2.8 Socket programming with UDP•2.9 Building a Web server2: Application Layer 3DNS: Domain Name SystemPeople: –many identifiers: SSN, name, passport #–Many “addresses”: street, phone#’s, GPS coord,etcInternet hosts, routers:–“name”, e.g., ww.yahoo.com - used by humans–IP address (32 bit) - used for addressing datagramsQ: map between name and IP addresses?Domain Name System:•distributed database implemented in hierarchy of many name servers•application-layer protocol host, routers, name servers communicate to resolve names (address/name translation)–note: core Internet function, implemented as application-layer protocol–complexity at network’s “edge”2: Application Layer 4DNS Why not centralize DNS?•single point of failure•traffic volume•distant centralized database•maintenancedoesn’t scale!DNS services•hostname to IP address translation•host aliasing–Canonical, alias names•mail server aliasing•load distribution–replicated Web servers: set of IP addresses for one canonical name2: Application Layer 5Root DNS Serverscom DNS serversorg DNS servers edu DNS serverspoly.eduDNS serversumass.eduDNS serversyahoo.comDNS serversamazon.comDNS serverspbs.orgDNS serversDistributed, Hierarchical DatabaseClient wants IP for www.amazon.com; 1st approx:•client queries a root server to find com DNS server•client queries com DNS server to get amazon.com DNS server•client queries amazon.com DNS server to get IP address for www.amazon.com2: Application Layer 6DNS: Root name servers•contacted by local name server that can not resolve name•root name server:–contacts authoritative name server if name mapping not known–gets mapping–returns mapping to local name server 13 root name servers worldwideb USC-ISI Marina del Rey, CAl ICANN Los Angeles, CAe NASA Mt View, CAf Internet Software C. Palo Alto, CA (and 36 other locations)i Autonomica, Stockholm (plus 28 other locations)k RIPE London (also 16 other locations)m WIDE Tokyo (also Seoul, Paris, SF)a Verisign, Dulles, VAc Cogent, Herndon, VA (also LA)d U Maryland College Park, MDg US DoD Vienna, VAh ARL Aberdeen, MDj Verisign, ( 21 locations)2: Application Layer 7TLD and Authoritative Servers•Top-level domain (TLD) servers:– responsible for com, org, net, edu, etc, and all top-level country domains uk, fr, ca, jp.–Network Solutions maintains servers for com TLD–Educause for edu TLD•Authoritative DNS servers: –organization’s DNS servers, providing authoritative hostname to IP mappings for organization’s servers (e.g., Web, mail).–can be maintained by organization or service provider2: Application Layer 8Local Name Server•does not strictly belong to hierarchy•each ISP (residential ISP, company, university) has one.–also called “default name server”•when host makes DNS query, query is sent to its local DNS server–acts as proxy, forwards query into hierarchy2: Application Layer 9requesting hostcis.poly.edugaia.cs.umass.eduroot DNS serverlocal DNS serverdns.poly.edu123456authoritative DNS serverdns.cs.umass.edu78TLD DNS serverDNS name resolution example•Host at cis.poly.edu wants IP address for gaia.cs.umass.eduiterated query:contacted server replies with name of server to contact“I don’t know this name, but ask this server”2: Application Layer 10requesting hostcis.poly.edugaia.cs.umass.eduroot DNS serverlocal DNS serverdns.poly.edu12456authoritative DNS serverdns.cs.umass.edu78TLD DNS server3recursive query:puts burden of name resolution on contacted name serverheavy load?DNS name resolution example2: Application Layer 11DNS: caching and updating records•once (any) name server learns mapping, it caches mapping–cache entries timeout (disappear) after some time–TLD servers typically cached in local name servers•Thus root name servers not often visited•update/notify mechanisms under design by IETF–RFC 2136–http://www.ietf.org/html.charters/dnsind-charter.html2: Application Layer 12DNS recordsDNS: distributed db storing resource records (RR)•Type=NS–name is domain (e.g. foo.com)–value is hostname of authoritative name server for this domainRR format: (name, value, type, ttl)Type=Aname is hostnamevalue is IP addressType=CNAMEname is alias name for some “canonical” (the real) name www.ibm.com is really servereast.backup2.ibm.comvalue is canonical nameType=MXvalue is name of mailserver associated with name2: Application Layer 13DNS protocol, messagesDNS protocol : query and reply messages, both with same message formatmsg headeridentification: 16 bit # for query, reply to query uses same # (UDP protocol underneath)flags:query or replyrecursion desired recursion availablereply is authoritative2: Application Layer 14DNS protocol, messagesName, type fields for a queryRRs in responseto queryrecords forauthoritative serversadditional “helpful”info that may be used2: Application Layer 15Inserting records into DNS•example: new startup “Network Utopia”•register name networkuptopia.com at DNS registrar (e.g., Network Solutions)–provide names, IP addresses of authoritative name server (primary and secondary)–registrar inserts two RRs into com TLD server:(networkutopia.com, dns1.networkutopia.com, NS)(dns1.networkutopia.com, 212.212.212.1, A)•create authoritative server Type A record for www.networkuptopia.com; Type MX record
View Full Document