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

Similar documents
Domain Name System (DNS)

Applications & Application-Layer Protocols: (SMTP) and DNS

Application Layer Protocols

Chapter 2 Application Layer. Lecture 5 DNS. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

CC451 Computer Networks

Lecture 05: Application Layer (Part 02) Domain Name System. Dr. Anis Koubaa

Chapter 2: Application layer

Outline Applications. Central Server Hierarchical Peer-to-peer. 31-Jan-02 Ubiquitous Computing 1

The Application Layer: Sockets, DNS

Domain Name Service. DNS Overview. October 2009 Computer Networking 1

CMSC 332 Computer Networks P2P and Sockets

Chapter 2 part B: outline

Application Layer: , DNS

Computer Networking Introduction

2.5 DNS The Internet s Directory Service

Lecture 7: Application Layer Domain Name System

Protocol Classification

CSCE 463/612 Networks and Distributed Processing Spring 2018

Chapter 2: Application layer

CS4/MSc Computer Networking. Lecture 3: The Application Layer

Networking Applications

Web caches (proxy server) Applications (part 3) Applications (part 3) Caching example (1) More about Web caching

CS 640 Introduction to Computer Networks. Today s lecture. What is P2P? Lecture30. Peer to peer applications

Advanced Networking. Domain Name System

Advanced Networking. Domain Name System. Purpose of DNS servers. Purpose of DNS servers. Purpose of DNS servers

Overview General network terminology. Chapter 9.1: DNS

IP ADDRESSES, NAMING, AND DNS

DNS & Iodine. Christian Grothoff.

DNS. DNS is an example of a large scale client-server application.

DNS and HTTP. A High-Level Overview of how the Internet works

Information Network Systems The application layer. Stephan Sigg

Chapter 2 Application Layer

Application Layer. Applications and application-layer protocols. Goals:

CSc 450/550 Computer Networks Domain Name System

FTP. Mail. File Transfer Protocol (FTP) FTP commands, responses. Electronic Mail. TDTS06: Computer Networks

CS 455/555 Spring 2011 Weigle

Domain Name System (DNS) 김현철 ( 화 ) 정보통신융합서울대학교컴퓨터공학부

CS 43: Computer Networks. 10: Naming and DNS September 24, 2018

CSCD 330 Network Programming Winter 2015

CS519: Computer Networks. Lecture 6: Apr 5, 2004 Naming and DNS

DNS Basics BUPT/QMUL

CSC 574 Computer and Network Security. DNS Security

Communications Software. CSE 123b. CSE 123b. Spring Lecture 11: Domain Name System (DNS) Stefan Savage. Some pictures courtesy David Wetherall

CSE 123b Communications Software. Overview for today. Names and Addresses. Goals for a naming system. Internet Hostnames

EECS 122: Introduction to Computer Networks DNS and WWW. Internet Names & Addresses

CSC 401 Data and Computer Communications Networks

The Domain Name System

Peer to Peer Computing

CS 3516: Advanced Computer Networks

Section 2: Application layer

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

CS 3516: Advanced Computer Networks

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

Computer Networks. Domain Name System. Jianping Pan Spring /25/17 CSC361 1

Domain Name System (DNS)

Lecture 6 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

The Domain Name System

Objectives. Upon completion you will be able to:

Information Network I: The Application Layer. Doudou Fall Internet Engineering Laboratory Nara Institute of Science and Technique

CSEN 404 Introduction to Networks. Mervat AbuElkheir Mohamed Abdelrazik. ** Slides are attributed to J. F. Kurose

ECE 435 Network Engineering Lecture 7

Domain Name System.

DNS and SMTP. James Walden CIT 485: Advanced Cybersecurity. James WaldenCIT 485: Advanced Cybersecurity DNS and SMTP 1 / 31

Peer-to-Peer Networks

Chapter P2P file sharing network applications 2.22 Web and HTTP 2.3 FTP DNS

A DNS Tutorial

CS 3640: Introduction to Networks and Their Applications

Chapter 19. Domain Name System (DNS)

More Internet Support Protocols

Internet Technology. 06. Exam 1 Review Paul Krzyzanowski. Rutgers University. Spring 2016

Internet Technology 3/2/2016

ELEC / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Domain Name System (DNS) DNS Fundamentals. Computers use IP addresses. Why do we need names? hosts.txt does not scale. The old solution: HOSTS.

Domain Name System (DNS) Session-1: Fundamentals. Joe Abley AfNOG Workshop, AIS 2017, Nairobi

DNS and CDNs : Fundamentals of Computer Networks Bill Nace

Naming Computer Networking. Overview. DNS: Domain Name System. Obvious Solutions (1) Obvious Solutions (2)

Review for Internet Introduction

Miscellaneous. Name Service. Examples. Outline Domain Name System Peer-to-Peer Networks

ECE 650 Systems Programming & Engineering. Spring 2018

Chapter II: Application Layer

FTP. Client Server Model. Kent State University Dept. of Computer Science. CS 4/55231 Internet Engineering. Server Models

Chapter 10: Application Layer CCENT Routing and Switching Introduction to Networks v6.0

Computer Security CS 426

Introduction to Network. Topics

CS 3640: Introduction to Networks and Their Applications

CSE 3214: Computer Network Protocols and Applications. Midterm Examination

CSEN 503 Introduction to Communication Networks

Network Applications Principles of Network Applications

Applications. Chong-kwon Kim. Running in end systems (hosts) over transport layer protocols Ex: , Web, FTP, instant messaging

page 1 Plain Old DNS WACREN, DNS/DNSSEC Regional Workshop Ouagadougou, October 2016

Application Layer. Goals: Service models. Conceptual aspects of network application protocols Client server paradigm

CSCD 330 Network Programming Spring 2018 Lecture 5 Application Layer. Reading: Chapter 2 Still

Application Layer. Pure P2P architecture. Client-server architecture. Processes communicating. Hybrid of client-server and P2P. Creating a network app

Application layer. Some network apps. Client-server architecture. Hybrid of client-server and P2P. Pure P2P architecture. Creating a network app

CPS 706 Computer Networks (Fall 2011)

Last Lecture SMTP. SUNY at Buffalo; CSE 489/589 Modern Networking Concepts; Fall 2010; Instructor: Hung Q. Ngo 1

Domain Name System (DNS) Session-1: Fundamentals. Computers use IP addresses. Why do we need names? hosts.txt does not scale

Network Application. Topic. Principle of Network Application. Principle of Network Application

2. Introduction to Internet Applications

CSC 4900 Computer Networks: P2P and Sockets

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 application transport network 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» shadow1.cs.clemson.edu» 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 the name 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: 1 peers» IP address» content 2) Alice queries for Hey Jude 3) Alice requests file from Bob 2 1 1 3 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