Applications & Application-Layer Protocols: The Domain Name System and Peerto-Peer



Similar documents
DNS and P2P File Sharing

P2P: centralized directory (Napster s Approach)

Domain Name System (DNS) RFC 1034 RFC

Chapter 2 Application Layer

Domain Name System Richard T. B. Ma

Domain Name System (DNS)

DATA COMMUNICATOIN NETWORKING

The Application Layer: DNS

Computer Networks & Security 2014/2015

CS 348: Computer Networks. - DNS; 22 nd Oct Instructor: Sridhar Iyer IIT Bombay

Motivation. Domain Name System (DNS) Flat Namespace. Hierarchical Namespace

Application-layer protocols

2.5 DNS The Internet s Directory Service

Domain Name System (or Service) (DNS) Computer Networks Term B10

How To Map Between Ip Address And Name On A Domain Name System (Dns)

DNS: Domain Name System

Lecture 2 CS An example of a middleware service: DNS Domain Name System

CS 355. Computer Networking. Wei Lu, Ph.D., P.Eng.

1 Introduction: Network Applications

HW2 Grade. CS585: Applications. Traditional Applications SMTP SMTP HTTP 11/10/2009

DNS Domain Name System

NET0183 Networks and Communications

Names vs. Addresses. Flat vs. Hierarchical Space. Domain Name System (DNS) Computer Networks. Lecture 5: Domain Name System

Cours du 22 novembre

Domain Name System. DNS is an example of a large scale client-server application. Copyright 2014 Jim Martin

DNS : Domain Name System

CS 43: Computer Networks Naming and DNS. Kevin Webb Swarthmore College September 17, 2015

internet technologies and standards

FTP: the file transfer protocol

Domain Name System (DNS) Omer F. Rana. Networks and Data Communications 1

DNS: Distributed Name System

The Domain Name System

The Role and uses of Peer-to-Peer in file-sharing. Computer Communication & Distributed Systems EDA 390

Domain Name System DNS

Overlay Networks. Slides adopted from Prof. Böszörményi, Distributed Systems, Summer 2004.

Internet-Praktikum I Lab 3: DNS

Application Layer. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross

DNS Resolving using nslookup

Introduction to Computer Networks

Domain Name System. CS 571 Fall , Kenneth L. Calvert University of Kentucky, USA All rights reserved

CS3600 SYSTEMS AND NETWORKS

DNS: Domain Names. DNS: Domain Name System. DNS: Root name servers. DNS name servers

Domain Name System (DNS) Fundamentals

Computer Networks Prof. S. Ghosh Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 34 DNS & Directory

The Domain Name System

CS3250 Distributed Systems

Domain Name System (DNS) Session-1: Fundamentals. Ayitey Bulley

3. The Domain Name Service

Domain Name System (DNS)

Application Layer. CMPT Application Layer 1. Required Reading: Chapter 2 of the text book. Outline of Chapter 2

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

Distributed Systems. 22. Naming Paul Krzyzanowski. Rutgers University. Fall 2013

CMPE 80N: Introduction to Networking and the Internet

Chapter 9: Name Services. 9.1 Introduction 9.2 Name services and the DNS 9.3 Directory services 9.6 Summary

Distributed Systems. Naming

DNS. Spring 2016 CS 438 Staff 1

Distributed Systems. 09. Naming. Paul Krzyzanowski. Rutgers University. Fall 2015

Computer Networks - CS132/EECS148 - Spring

Application Layer, Client/Server Computing and Socket Programming (II)

Domain Name System WWW. Application Layer. Mahalingam Ramkumar Mississippi State University, MS. September 15, 2014.

DNS: Domain Name System

CMPE 80N: Introduction to Networking and the Internet

Part 5 DNS Security. SAST01 An Introduction to Information Security Martin Hell Department of Electrical and Information Technology

Computer Networks. Instructor: Niklas Carlsson

ECE 4321 Computer Networks. Network Programming

what s in a name? taking a deeper look at the domain name system mike boylan penn state mac admins conference

CSCI-1680 CDN & P2P Chen Avin

The Domain Name System (DNS)

DNS - Domain Name System

Application Protocols in the TCP/IP Reference Model

Forouzan: Chapter 17. Domain Name System (DNS)

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting

Naming and the DNS. Focus. How do we name hosts etc.? Application Presentation Topics. Session Domain Name System (DNS) /URLs

Applications and Services. DNS (Domain Name System)

THE DOMAIN NAME SYSTEM DNS

Application-layer Protocols

Computer Networks: Domain Name System

Chakchai So-In, Ph.D.

Domain Name System (DNS) Reading: Section in Chapter 9

Application Protocols in the TCP/IP Reference Model. Application Protocols in the TCP/IP Reference Model. DNS - Concept. DNS - Domain Name System

How-to: DNS Enumeration

Understanding DNS (the Domain Name System)

Names & Addresses. Names & Addresses. Names vs. Addresses. Identity. Names vs. Addresses. CS 194: Distributed Systems: Naming

More Internet Support Protocols

Internetworking with TCP/IP Unit 10. Domain Name System

Hostnames. HOSTS.TXT was a bottleneck. Once there was HOSTS.TXT. CSCE515 Computer Network Programming. Hierarchical Organization of DNS

THE BCS PROFESSIONAL EXAMINATION Professional Graduate Diploma. April 2001 EXAMINERS REPORT. Network Information Systems 2001

Ch 6: Networking Services: NAT, DHCP, DNS, Multicasting, NTP

Introduction to Network Operating Systems

Overview of Computer Networks

DNS. The Root Name Servers. DNS Hierarchy. Computer System Security and Management SMD139. Root name server. .se name server. .

DNS (Domain Name System) is the system & protocol that translates domain names to IP addresses.

- Domain Name System -

The Domain Name System (DNS)

1 DNS Packet Structure

19 Domain Name System (DNS)

Introduction to DNS CHAPTER 5. In This Chapter

Domain Name System Security

Naming. Name Service. Why Name Services? Mappings. and related concepts

Application Protocols in the TCP/IP Reference Model. Application Protocols in the TCP/IP Reference Model. DNS - Domain Name System

Transcription:

CPSC 360 Network Programming Applications & Application-Layer Protocols: The Domain Name System and Peerto-Peer Systems Michele Weigle Department of Computer Science Clemson University mweigle@cs.clemson.edu http://www.cs.clemson.edu/~mweigle/courses/cpsc360 1 Application-Layer Protocols Outline The architecture of distributed systems» Client/Server computing» P2P and Hybrid computing The programming model used in constructing distributed systems» Socket programming Example client/server systems and their application-layer protocols» The World-Wide Web (HTTP)» Reliable file transfer (FTP)» E-mail (SMTP & POP)» Internet Domain Name System (DNS) Example P2P/Hybrid systems application transport network link link physical local ISP company network regional ISP 2

Application-Layer Protocols The Domain Name System (DNS) Computers (hosts, routers) connected to the Internet have two forms of names:» IP address a 32 bit identifier used for addressing hosts and routing data to them» Hostname an ASCII string used by applications The DNS is an Internet-wide service that provides mappings between IP addresses and hostnames» The DNS is a distributed database implemented in a hierarchy of name servers» The DNS is also an application-layer protocol Hosts and routers use name servers to resolve names (address/name translation)» Name resolution is an essential Internet function implemented as application-layer protocol 3 The Domain Name System Services Host Aliasing» canonical hostname: relay1.west-coast.enterprise.com» aliases: enterprise.com, www.enterprise.com Mail Server Aliasing» email address: bob@hotmail.com» mail server: relay1.west-coast.hotmail.com Load Distribution» set of IP addresses associated with 1 canonical hostname (e.g., cnn.com)» server response with whole set, but rotates ordering 4

The Domain Name System Names are valuable! A New York Times article from August 22, 2000 5 The Domain Name System Growth of DNS registrations Source: Internet Software Consortium (http://www.isc.org/) 6

The Domain Name System Name Hierarchy in DNS com edu net org npr gov yahoo amazon clemson cornell sprint bellsouth srv ads cs ece cs hostname = dot separated concatenation of domain names along path toward the root» clemson.edu» cs.clemson.edu» shadow1.cs.clemson.edu 7 Name Hierarchy in the DNS Top level domains com edu net org gov Generic domains:».com,.org,.net,.edu,.gov,.mil,.int».biz,.info,.name,.pro Special sponsored names».aero,.coop,.museum Country code domains».uk,.de,.jp,.us, etc. 8

DNS Overview Applications need IP address to open connection Use DNS to find the IP address given a hostname Steps: 1. Application invokes DNS (gethostbyname()) 2. DNS application in host sends query into network (UDP port 53) 3. DNS application in host receives reply with IP address (after some delay) 4. IP address passed up to the application DNS is a black box as far as the application is concerned. 9 The Domain Name System Designing a distributed service Why not centralize the DNS» A server process on a big, well connected supercomputer? Centralized systems do not scale!» Poor reliability: centralized = single point of failure» Poor performance: centralized = remote access for most users» Difficult to manage: centralized = all traffic goes to one location, a large staff has to be present to handle registrations A centralized system is not politically feasible in an international network 10

Designing a Distributed Service DNS Name Servers No server has every hostname-to-ip address mapping Authoritative name server:» Every host is registered with at least one authoritative server that stores that host s IP address and name» The authoritative name server can perform name/address translation for that host s name/address Local authoritative name servers:» Each ISP, university, company, has a local (default) name server authoritative for its own hosts» Resolvers always query a name server local to it to resolve any host name Local authoritative server tornado.cs.clemson.edu Name resolution: Query and Reply Local host shadow1.cs.clemson.edu What if if the the name is is not a local host (e.g., www.yahoo.com)? 11 DNS Name Servers Root name servers A root name server is contacted when a local name server that can t resolve a name» The root server either resolves the name or provides pointers to authoritative servers at lower level of name hierarchy There are 13 root name servers worldwide 12

DNS Name Servers Generic TLD servers (Verisign Corp.) 12 independent sites.com, org,.net server locations (separated from root servers) 13 DNS Name Servers Using a server hierarchy for resolving names Host shadow1.cs.clemson.edu wants to know the IP address of www.yahoo.com» shadow1 contacts its local DNS server tornado.cs.clemson.edu To resolve a non-local name, the local name server queries the root server The root server responds with the TLD for.com The local DNS server contacts the TLD server The local DNS server contacts the authoritative server dns.yahoo.com Results feed back to shadow1 shadow1 can now use the IP address of www.yahoo.com to make a connection Root DNS server a.root-servers.net 2 TLD DNS server Authoritative DNS server dns.yahoo.com 3 4 1 8 5 6 Local DNS server tornado.cs.clemson.edu Requesting host shadow1.cs.clemson.edu 7 Target host www.yahoo.com 14

DNS Name Servers Recursive vs. Iterative Queries The DNS supports two paradigms of queries:» Recursive queries» Iterative queries Recursive queries place the burden of name resolution (recursively) on the contacted server In an iterated query the contacted server simply replies with the name of the server to contact» I don t know; trying asking X 2 Root DNS server a.root-servers.net 7 3 6 1 8 Requesting host estore.yahoo.com TLD DNS server 5 4 Authortative DNS server dns.cs.clemson.edu Local DNS server dns.yahoo.com 15 DNS Name Servers Recursive vs. Iterative Queries Any query can be recursive or iterative Iterative and recursive queries can be combined Typically, the query from the requesting host to the local DNS server is recursive and the remaining queries are iterative Root DNS server a.root-servers.net 2 TLD DNS server Authoritative DNS server dns.yahoo.com 3 4 1 8 5 6 7 Target host www.yahoo.com Local DNS server tornado.cs.clemson.edu Requesting host shadow1.cs.clemson.edu 16

DNS Name Servers Caching and updating DNS entries Every server caches all the mappings it learns» Cache entries are soft state» They timeout (are deleted) after some time period Root DNS server a.root-servers.net 2 TLD DNS server Authoritative DNS server dns.yahoo.com 3 4 5 6 DNS cache update/notify mechanisms under design by the IETF» See RFC 2136 1 8 7 Target host www.yahoo.com Local DNS server tornado.cs.clemson.edu Requesting host shadow1.cs.clemson.edu 17 DNS Name Servers DNS resource records RR format: <name, value, type, time_to_live> The DNS is a distributed database storing resource records (RRs) Type = A» name is a hostname» value is hostname s IP address Type = NS» name is a domain» 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 name of mail server host associated with name 18

DNS Name Servers DNS resource records / Examples A record» (relay1.west-coast.yahoo.com, 145.137.93.126, A) NS record» (yahoo.com, dns.yahoo.com, NS) CNAME record» (yahoo.com, relay1.west-coast.yahoo.com, CNAME) MX record» (yahoo.com, mail.yahoo.com, MX) 19 DNS Protocol DNS query and reply messages DNS query and reply messages both have the same message format Messages have a fixed length message header» Identification 16 bit query/reply identifier used to match relies to queries» Flags: Query/Reply bit Reply is authoritative bit Recursion desired bit... Identification Number of questions Number of authority RRs Flags Number of answer RRs Number of additional RRs Questions (variable number) Answers (variable number of records) Authority (variable number of records) Additional Information (variable number of records) 12 bytes variable 20

DNS Protocol DNS query and reply messages Messages have a variable-length question & answer body Questions:» The name and type fields (type A or MX) for a query hotmail.com MX Answers:» One RR for each IP address answering query Authority:» Resource records of other authoritative servers Identification Number of questions Number of authority RRs Flags Number of answer RRs Number of additional RRs Questions (variable number) Answers (variable number of records) Authority (variable number of records) Additional Information (variable number of records) 12 bytes variable 21 DNS Resource Records nslookup query/reply message example shadow1% nslookup Default Server: tornado.cs.clemson.edu Address: 130.127.48.3 > set debug > www.yahoo.com Server: tornado.cs.unc.edu Address: 130.127.48.3 ;; res_nmkquery(query, www.yahoo.com, IN, A) ------------ Got answer: HEADER: opcode = QUERY, id = 16795, rcode = NOERROR header flags: response, want recursion, recursion avail. questions = 1, answers = 9, authority records = 11, additional = 3 QUESTIONS: www.yahoo.com, type = A, class = IN 22

DNS Resource Records nslookup query/reply message example ANSWERS: -> www.yahoo.com canonical name = www.yahoo.akadns.net ttl = 300 (5M) -> www.yahoo.akadns.net internet address = 216.109.118.72 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.117.106 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.117.107 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.117.109 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.118.64 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.118.65 ttl = 60 (1M) -> www.yahoo.akadns.net internet address = 216.109.118.67 ttl = 60 (1M) AUTHORITY RECORDS: -> akadns.net nameserver = z0c.akadns.org ttl = 113598 (113598) -> akadns.net nameserver = zf.akadns.org ttl = 113598 (113598) -> akadns.net nameserver = zh.akadns.org ttl = 113598 (113598) -> akadns.net nameserver = eur3.akam.net ttl = 113598 (113598) -> akadns.net nameserver = use2.akam.net ttl = 113598 (113598) -> akadns.net nameserver = use4.akam.net ttl = 113598 (113598) -> akadns.net nameserver = usw5.akam.net ttl = 113598 (113598) 23 DNS Resource Records nslookup query/reply message example ADDITIONAL RECORDS: -> za.akadns.org internet address = 208.185.132.176 ttl = 19200 (19200) -> use4.akam.net internet address = 80.67.67.182 ttl = 126017 (126017) -> usw5.akam.net internet address = 63.241.73.214 ttl = 126017 (126017) Non-authoritative answer: Name: www.yahoo.akadns.net Addresses: 216.109.118.72, 216.109.117.106, 216.109.117.107, 216.109.117.109, 216.109.118.64, 216.109.118.65, 216.109.118.67, 216.109.118.71 Aliases: www.yahoo.com 24

DNS Example DNS processing for an iterated query Resolve the hostname in http://www.cnn.com QUERY: www.cnn.com REPLY: 207.25.71.28 Local Server QUERY: www.cnn.com QUERY: www.cnn.com QUERY: www.cnn.com REPLY: com (NS) REPLY: cnn.com (NS) REPLY: 207.25.71.28(A) cnn com root edu net com. NS A.GTLD-SERVERS.NET 192.5.6.30 cnn.com NS DNS.CNN.COM 128.2.232.1 www.cnn.com A 207.25.71.28 25 DNS Example DNS processing for an iterated query Resolve the hostname www2.cnn.com with a warm cache root QUERY: www2.cnn.com REPLY: 66.40.26.232 Local Server QUERY: www2.cnn.com REPLY: 66.40.26.232(A) cnn com edu net com. NS A.GTLD-SERVERS.NET 192.5.6.30 cnn.com NS DNS.CNN.COM 128.2.232.1 www.cnn.com A 207.25.71.28 www2.cnn.com A 66.40.26.232 26

The Domain Name System Summary F gets 270,000,000+ hits per day» Other servers have comparable load The Verisign TLD servers answer 5,000,000,000 queries per day Clearly the DNS would collapse without:» Hierarchy» Distributed processing» Caching If DNS fails, Internet services stop working! 27 The Domain Name System For More Info DNS Specification» RFC 1034, RFC 1035» [Mockapetris 1988] DNS Caching» RFC 2136 DNS Attacks» CAIDA, Nameserver DoS Attack October 2 analysis www.caida.org/projects/dns-analysis/oct02dos.xml 28

Application-Layer Protocols Peer-to-Peer (P2P) Architecture No always-on server Arbitrary end systems directly communicate Peers are intermittently connected and change IP addresses local ISP regional ISP company network 29 Application-Layer Protocols P2P File Sharing P2P file sharing accounts for more traffic than any other application on the Internet Types of files shared» MP3s 3-8 MB» videos 10MB - 1GB» software Legality» [vonlohmann 2003] 30

Application-Layer Protocols P2P File Sharing / Example Alice runs P2P client application on her notebook computer Intermittently connects to Internet; gets new IP address Asks for Hey Jude Application displays other peers that have copy of Hey Jude. Alice chooses one of the peers, Bob. File is copied from Bob s PC to Alice s notebook: HTTP While Alice downloads, other users uploading from Alice. Alice s peer is both a Web client and a transient Web server. All peers are servers = highly scalable! 31 P2P File Sharing Content Location Problem How do peers know which other peers have content that they re interested in? Centralized Directory local ISP regional ISP Query Flooding Heterogeneous Approach company network 32

P2P File Sharing Centralized Directory (Napster) 1 inform and update 2 query 3 file transfer centralized directory server 1 Bob 1) When peer connects, it informs central server:» IP address» content 2) Alice queries for Hey Jude 2 1 1 1 3 peers 3) Alice requests file from Bob Alice 33 P2P File Sharing Problems with Centralized Directory Single point of failure Performance bottleneck Copyright infringement File transfer is decentralized, but locating content is highly centralized 34

P2P File Sharing Query Flooding (Gnutella) Fully distributed» no central server Public domain protocol Many Gnutella clients implementing protocol Peers form an overlay network» edge between peer X and Y if there s a TCP connection» group of active peers and edges is overlay network» edge is not a physical link» given peer will typically be connected with < 10 overlay neighbors Protocol specification: [Gnutella 2004] 35 Query Flooding Messages Query message sent over existing TCP connections Peers forward Query message QueryHit message sent over reverse path Query QueryHit Query File transfer: HTTP Query QueryHit Query Bob Alice QueryHit Scalability: limited scope flooding Query 36

P2P File Sharing KaZaA Borrows ideas from Napster and Gnutella» no dedicated server» peers are either normal peers or group leaders» each group leader is a mini-napster-like hub» group leaders create a network that resembles a Gnutella network Contributes more traffic to the Internet than any other application» [Gummadi 2003, Saroiu 2002] Proprietary specification» harder to know exactly how it works» [Liang 2004] - KaZaA traffic measurement Encrypts control traffic 37 P2P File Sharing Exploiting Heterogeneity (KaZaA) Each peer is either a group leader or assigned to a group leader.» TCP connection between peer and its group leader.» TCP connections between some pairs of group leaders. Group leader tracks the content in all its children. ordinary peer group-leader peer neighoring relationships in overlay network 38

KaZaA Querying Each file has a hash and a descriptor Client sends keyword query to its group leader Group leader responds with matches:» For each match: hash, IP address If group leader forwards query to other group leaders, they respond with matches Client then selects files for downloading» HTTP requests using hash as identifier sent to peers holding desired file ordinary peer group-leader peer neighoring relationships in overlay network 39 Kazaa Tricks Limitations on simultaneous uploads» request queuing Incentive priorities» priority in queue given to users who upload more than download Parallel downloading» use byte-range field in HTTP request header 40

Peer-to-Peer Systems For More Info Content Location» [Stoica 2001]» [Rowstron 2001]» [Ratnasamy 2001]» [Zhao 2004]» [Maymounkov 2002]» [Garces-Erce 2003] Gnutella» [Gnutella 2004] - protocol specification KaZaA» [KaZaA 2004]» [Gummadi 2003]» [Saroiu 2002]» [Liang 2004] 41