CSCE 463/612 Networks and Distributed Processing Spring 2018

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

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

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

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

Lecture 7: Application Layer Domain Name System

Application Layer: , DNS

Chapter 2: Application layer

The Application Layer: Sockets, DNS

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

Computer Networking Introduction

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

CS 3516: Advanced Computer Networks

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

CSEN 503 Introduction to Communication Networks

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

Objectives. Upon completion you will be able to:

Application Layer Protocols

Chapter 2 part B: outline

DNS & Iodine. Christian Grothoff.

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

CSc 450/550 Computer Networks Domain Name System

Application Layer. Goals:

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

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

ECE 435 Network Engineering Lecture 7

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

CSCD 330 Network Programming Winter 2015

Chapter II: Application Layer

Chapter 2 Application Layer

2.5 DNS The Internet s Directory Service

Section 2: Application layer

Chapter 2 Application Layer

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

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

ECE 650 Systems Programming & Engineering. Spring 2018

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

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

Introduction to Network. Topics

CSC 401 Data and Computer Communications Networks

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

CC451 Computer Networks

Protocol Classification

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

Chapter 19. Domain Name System (DNS)

CSCE 463/612 Networks and Distributed Processing Spring 2018

Domain Name System (DNS)

DNS Basics BUPT/QMUL

Internet applications. 2: Application Layer 1

IP ADDRESSES, NAMING, AND DNS

Networking Applications

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

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

Internet Engineering. DNS Message Format. Contents. Robert Elz.

Review for Internet Introduction

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

CSCD 330 Network Programming Spring 2017

CS 655 System and Network Architectures and Implementation. Module 4 Naming, Mobility, Messaging

DNS and CDNs : Fundamentals of Computer Networks Bill Nace

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

Networking: UDP & DNS

Chapter 1 Introduction

Q U E S T I O N 3 In the current version of IP (IPv4), the use of TCP and UDP headers differ in which of the following ways?

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

Networking: UDP & DNS

CSCE 463/612 Networks and Distributed Processing Spring 2018

S Computer Networks - Spring What and why? Structure of DNS Management of Domain Names Name Service in Practice

APNIC elearning: DNS Concepts

Computer Network 1 1

CSC358 Week 3. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Web caches (proxy server)

A DNS Tutorial

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

Domain Name System.

Domain Name System - Advanced Computer Networks

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

Advanced Networking. Domain Name System

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

Traditional Internet Applications

The Domain Name System

DNS. Introduction To. everything you never wanted to know about IP directory services

Chapter 2 Application Layer

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

Course on Computer Communication and

DNS. A Massively Distributed Database. Justin Scott December 12, 2018

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 5

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

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

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 6

Introduction to Computer Networking. Guy Leduc. Chapter 2 Application Layer. Chapter 2: outline

internet technologies and standards

DNS Hierarchical Name Space. BIND Terminology and DNS Name Servers. Distributed Hierarchical Database (1st Approx) Domain Name System (DNS)

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

Lesson 9: Configuring DNS Records. MOAC : Administering Windows Server 2012

SOFTWARE ARCHITECTURE 9. NAME RESOLUTION.

CSE 486/586 Distributed Systems

Computer Systems and Networks

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSCE 463/612 Networks and Distributed Processing Spring 2017

CSCE 463/612 Networks and Distributed Processing Spring 2017

Transcription:

CSCE 463/612 Networks and Distributed Processing Spring 2018 Application Layer III Dmitri Loguinov Texas A&M University February 8, 2018 Original slides copyright 1996-2004 J.F Kurose and K.W. Ross 1

Chapter 2: Roadmap 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 server 2

DNS: Domain Name System People: many identifiers Name, SSN, passport # Internet hosts, routers: IP address (32 bit) used for routing datagrams Names (e.g., yahoo.com) used by humans Q: how to map between IP addresses and names? Original technique: local /etc/hosts file Domain Name System: Distributed database Implemented in hierarchy of many name servers Application-layer protocol Hosts communicate with name servers to resolve names/ips UDP port 53 Single-packet query Single-packet response 3

DNS Services Forward lookup Hostname to IP translation Reverse lookup IP to hostname Host aliasing Mail server lookup Load distribution E.g., replicated web servers: set of IP addresses for one DNS name Why not centralize DNS? Single point of failure Traffic volume (bandwidth, request rate) Lack of geographic proximity to user, hence high latency Inflexible (can t run code customized for domain) Doesn t scale! 4

Distributed, Hierarchical Database Root DNS Servers com DNS servers org DNS servers edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers poly.edu umass.edu DNS serversdns servers Client wants IP for www.amazon.com: Queries a root server to find the com DNS server Queries the com server to get the amazon.com server Queries the amazon.com DNS server to get IP address for www.amazon.com Who to ask about the location of root servers? Nobody, their IPs are hardwired into OS 5

Types of DNS Servers There are 13 root servers (called A-M), each with a fixed IP address Some servers (e.g., A, C, F, I) are geographically distributed across multiple sites (254 total in 2011) More info: http://root-servers.org/ 6

Types of DNS Servers Top-level domain (TLD) servers: responsible for generic TLDs (e.g.,.com,.org,.net,.edu) and all country-code TLDs (e.g.,.uk,.fr,.ca,.jp) Around 1500 total gtlds and cc-tlds Verisign runs.com, Educause.edu Authoritative servers: provide authoritative mappings for company servers (e.g., Web and mail) Can be maintained by organization (e.g., amazon.com) or service provider (e.g., ISP or hosting company) Local name server: does not belong to the hierarchy Any computer that accepts requests and then finds out the answer by traversing the DNS tree 7

Local Name Servers Each network (ISP, company, university) has a few Preferred DNS server in network options (alternate used for backup) If you run BIND, set this to 127.0.0.1 Auto-configure via DHCP or set to 8.8.8.8 (Google DNS) When a host makes a DNS query (application calls gethostbyname), query is sent to local DNS server Local server acts as a proxy (cache) and forwards query into hierarchy if it cannot answer it from cache Command-line tool for DNS queries is nslookup Homework #2 implements essentially this 8

Example root DNS server local DNS server dns.poly.edu 2 3 4 5 TLD DNS server 6 cis.poly.edu wants the IP address for www.cs.umass.edu 1 10 8 9 7 dns.umass.edu Next request for joe.cs.umass.edu What happens? requesting host cis.poly.edu authoritative DNS server dns.cs.umass.edu www.cs.umass.edu 9

Recursive queries root DNS server Iterated query (previous page): Contacted server replies with name of server to contact I don t know this name, but ask this server Recursive query (this page): Puts burden of name resolution on contacted name server local DNS server dns.poly.edu 1 2 10 requesting host cis.poly.edu 9 8 6 3 7 5 TLD server 4 dns.umass.edu authoritative DNS server dns.cs.umass.edu www.cs.umass.edu 10

DNS: Caching and Updating Records Once (any) name server learns a mapping, it caches the mapping Cache entries time out (disappear) after some time (TTL) Unexpired entries are served directly from cache, in which case they are called non-authoritative If the original DNS server is contacted, the response is authoritative TLD servers are typically cached in local name servers Thus root name servers not supposed to be visited often Study in 2007 showed load on individual root servers A-M was about 6-16K queries/sec During DDoS attacks in 2001 it was 38K/sec 11

DNS Records Replace A with AAAA for IPv6 DNS: distributed database of resource records (RR) (name, value, type, ttl) Type A name = host value = IPv4 address (4 byte DWORD) Type NS name = domain value = hostname of authoritative name server for this domain Type CNAME name = host value = host it s aliased to Reduces manual effort to change IPs and other records Type MX name = domain value = name of SMTP server associated with domain 12

Inserting Records Into DNS Example: just created startup Network Utopia Register name networkuptopia.com at a registrar (e.g., Network Solutions) Need to provide registrar with names and IP addresses of your authoritative name server (primary and secondary) Registrar inserts four RRs into the com TLD server: (networkutopia.com, dns1.networkutopia.com, NS) (dns1.networkutopia.com, 212.212.212.1, A) (networkutopia.com, dns2.networkutopia.com, NS) (dns2.networkutopia.com, 212.212.212.2, A) In your authoritative server, place a Type A record for www and a Type MX record for entire domain 13

Reverse Queries Reverse DNS lookups are performed using a special construction of a fake DNS name Reason: DNS resolves names from right to left with the semantics of going from the most general to the most specific In IPs, the MSB is most general, LSB is most specific The IP address is reversed and is followed by in-addr.arpa (or ip6.arpa for IPv6) Example: 128.194.135.65 is requested as 65.135.194.128.in-addr.arpa The query type must be set to PTR RFC 1035 (1987) describes DNS headers/commands Also see http://www.networksorcery.com/enp/protocol/dns.htm 14

DNS Protocol, Messages Query and reply messages use same format Packet starts with a fixed DNS header (12 bytes) Followed by a variable-length section Transaction ID (TXID) 16-bit number assigned by client to each query Echoed by server in response packet Flags specify the type of request being made and response status TXID nquestions nauthority 4 bytes flags nanswers nadditional questions (variable size) answers (variable size) authority (variable size) additional (variable size) The other 4 fields provide a count of records in each variable-size section 12 bytes 15

DNS Protocol, Messages Queries contain only the question section Most servers expect one question per packet Response packets always repeat the question TX ID nquestions nauthority flags nanswers nadditional questions (variable size) answers (variable size) authority (variable size) additional (variable size) Safety mechanism if TXID runs into collision at the client Authority section carries NS record(s) Used during iterative lookups to specify the next DNS server to query (similar to HTTP redirects) All numbers are in network byte order Use proper conversion (i.e., htons() in this case) 16

DNS Flags QR (1) opcode (4) AA (1) TC (1) RD (1) RA (1) reserved (3) result (4) 0 = query 1 = response 0 = standard query authoritative answer truncated response recursion desired recursion available 0 = success 1 = format error 2 = server fail 3 = no DNS name For binary fields, 1 = true and 0 = false For query packets, you must: Set RD = 1; all other fields must be zero Specify nquestions = 1 Correctly create the actual question and append it to the header in the packet buffer 17

Nslookup Usage (Windows) nslookup -querytype=mx cs.tamu.edu cached answers and additional records Server: gw.irl.cs.tamu.edu Address: 128.194.135.72 Non-authoritative answer: cs.tamu.edu MX preference = 100, mail exchanger = smtp-relay.tamu.edu cs.tamu.edu MX preference = 10, mail exchanger = pine.cs.tamu.edu smtp-relay.tamu.edu internet address = 165.91.143.199 pine.cs.tamu.edu internet address = 128.194.138.12 nslookup -querytype=hinfo cs.tamu.edu Server: gw.irl.cs.tamu.edu Address: 128.194.135.72 cs.tamu.edu primary name server = dns1.cs.tamu.edu responsible mail addr = root.cs.tamu.edu serial = 2006090513 refresh = 1800 (30 mins) retry = 900 (15 mins) expire = 1209600 (14 days) default TTL = 3600 (1 hour) smaller preference value means higher priority 18

Nslookup Usage (Windows) nslookup -querytype=ptr 12.138.194.128.in-addr.arpa Server: gw.irl.cs.tamu.edu Address: 128.194.135.72 Non-authoritative answer: 12.138.194.128.in-addr.arpa name = mail.cs.tamu.edu 12.138.194.128.in-addr.arpa name = pine.cs.tamu.edu 12.138.194.128.in-addr.arpa name = pophost.cs.tamu.edu 12.138.194.128.in-addr.arpa name = mailhost.cs.tamu.edu 12.138.194.128.in-addr.arpa name = pop.cs.tamu.edu 12.138.194.128.in-addr.arpa name = imap.cs.tamu.edu nslookup -querytype=ptr 12.1.55.186 nslookup performs string reversal transparently, but hw2 will need to do this explicitly Server: s18.irl.cs.tamu.edu Address: 128.194.135.58 Non-authoritative answer: 186.55.1.12.in-addr.arpa canonical name = 186.184/29.55.1.12.in-addr.arpa 186.184/29.55.1.12.in-addr.arpa name = outlook.milestonescientific.com 19

Using UDP DNS runs over UDP that has no connection phase Each request and response is exactly 1 packet Calls to recvfrom() and sendto() correspond to receiving/ sending 1 packet from/to a socket No need to loop on receive General idea: sock = socket (AF_INET, SOCK_DGRAM, 0); // bind sock to port 0 see the handout while (work to be done) { len = createrequest(buf, name); sendto (sock, buf, len, 0, &addressto,...);... if (select (...) > 0) { recvfrom (sock, recvbuf, len, 0, &addressfrom...); parseresponse (recvbuf); } } closesocket (sock); 20