CS 355
Computer Networking
Chapter 2: Application Layer
Overview:
• Principles of network applications?
• Introduction to Wireshark
• Web and HTTP
• FTP
• Electronic Mail: SMTP, POP3, IMAP
• DNS: Domain Name System (or Service)
• P2P applications
DNS:
• Introduction to DNS
• DNS naming structure
• DNS components: some concepts
• How DNS works: a rough idea
An Introduction to DNS:
• Why DNS?
• What is DNS?
• What is DNS services?
Why DNS: naming issues on the Internet
• An address is how you get to an endpoint – Typically, hierarchical (for scaling): e.g.
• 950 Charter Street, Redwood City CA, 94063 • A name is how an endpoint is referenced
– Typically, no structurally significant hierarchy • “David”, “Tokyo”, “itu.int”
• Computers work with numbers; Humans work with names ==> IP addresses are NUMBERS
?
1011011011101110110110
Q: map between IP addresses and name?
What is DNS
Domain Name System:
• distributed database implemented in hierarchy of many name servers • application-layer protocol in host, routers, name servers to
communicate to resolve names (address/name translation)
– note: core Internet function, implemented as application-layer protocol
– complexity at network’s “edge”
Why not centralize DNS?
• single point of failure • traffic volume
• distant centralized database • maintenance
What is DNS service
DNS services
• hostname to IP address translation • host aliasing
– Canonical, alias names • mail server aliasing
• load distribution
What is domain (sub-domain) name?
• A domain name is the sequence of labels from a node
to the root, separated by dots (“.”s), read left to right
• For example domain names:
– cs.keene.edu – yahoo.com
• one domain is a
sub-Domain
of another if its domain
name ends in the other’s domain name
– So cs.keene.edu is a subdomain of • keene.edu
• edu
Naming Structure of DNS
• Top-level domain
• Second-level domain
DNS Naming Structure
• Top Level Domains (TLDs) defined by global authority
– com, org,
– edu
• ccTLD: country code TLDs .
– ca
• 2nd Level Domains.
– google.ca
– microsoft.com
Country code domains: an example
• Top level domains are US-centric
• Geographic TLDs used for organizations in other countries:
TLD Country
.uk United Kingdom
.ru Russia
.cn China
• Countries define their own internal hierarchy:
gov.cn, org.cn ,net.cn , edu.cn and com.cn are used for organizations in China
Second/Third-level domains
• Within every top-level domain there is a huge list of 2
nd/3
rdlevel domains
• For example, in the COM second-level domain, we have:
– yahoo
– msn
– microsoft
DNS naming structure: an example
TLD ccTLD 3rd LD 2ndLD• Examples:
Google.com
hust.edu.cn
2nd LDDistributed, hierarchical naming structure
Root DNS Servers
com DNS servers org DNS servers edu DNS servers keene.edu DNS servers unh.edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers
Client wants IP for www.amazon.com:
• 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.com
Naming a Domain Naming a Directory
yahoo.com.au. C:\windows\system32\d
rivers\ Start Here Start Here A “.” is used as separator A “\” is used as separator
DNS Components:
• DNS Servers
• Resource Record in DNS Database
• DNS Name Resolution Approach
• 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 worldwide
b USC-ISI Marina del Rey, CA l ICANN Los Angeles, CA e NASA Mt View, CA
f Internet Software C. PaloAlto, 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, VA
c Cogent, Herndon, VA (also LA) d U Maryland College Park, MD g US DoD Vienna, VA
h ARL Aberdeen, MD
j Verisign, ( 21 locations)
• 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 provider
• 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 at first
– acts as proxy, forwards query into hierarchy
DNS:
distributed database storing resource records
(RR)
RR format: (name, ttl, class, type, value)
DNS Resource Record
• TTL is a timing parameter
• IN class is widest used, means Internet
• There are multiple types (4 typical types) of RR records • Everything after the type identifier is called value
name ttl
class
type value
• Type=NS
– name is domain (e.g. foo.com)
– value is hostname of authoritative name server for this domain r Type=A
name is hostname
value is IP address
r Type=CNAME
name is alias name for some
“canonical” (the real) name www.ibm.com is really
servereast.backup2.ibm.com
value is canonical name
r Type=MX
value is name of mailserver
associated with name
DNS Record: Type A Record
• means the “Address” record
• Contains an IPv4 Address (the address computers use to uniquely identify each other on the internet)
the record here defines the host uniquely identifiable as “cs.keene.edu” to be reachable at the IPv4 Address
158.65.110.24
cs.keene.edu IN A 158.65.110.24
DNS Record: Type CNAME Record
• A CNAME (canonical name) defines an alias
• The alias will then be resolved, if another CNAME is encountered then the process continues until an A record is found
• defines the name uniquely identifiable as “www.keene.edu” to be and alias to “suncook.keene.edu”, i.e. both of them have the same IP
suncook.keene.edu IN A 158.65.2.147
suncook.keene.edu IN A 158.65.2.147
www.keene.edu IN CNAME suncook.keene.edu
• An MX record defines the mail servers for a particular domain
• Mail eXchange records hold the name of hosts, and their priorities, able to deliver mail for the domain.
In the ksc.mailcruiser.com domain, defines the mail server
mail.campuscruiser.com to be the priority 5 mail server for the “ksc.mailcruiser.com” domain.
DNS Record: Type MX Record
Type MX Record: an example
• An NS record defines the authoritative Name servers for the domain
• defines the host “nic.keene.edu” to be a name sever for the domain “keene.edu”
DNS Record: Type NS Record
Type NS Record: an example
requesting host cs.keene.edu gaia.cs.umass.edu root DNS server local DNS server nic.keene.edu 1 2 3 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server
• Host at cs.keene.edu
wants IP address for
gaia.cs.umass.edu
iterated query: r contacted server
replies with name of server to contact r “I don’t know this
name, but ask this server”
requesting host cs.keene.edu gaia.cs.umass.edu root DNS server local DNS server nic.keene.edu 1 2 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server 3 recursive query:
r puts burden of name resolution on
contacted name server