0% found this document useful (0 votes)
48 views67 pages

Chapter 2

The document summarizes Chapter 2 of the textbook, which covers the application layer. It discusses key topics like application architectures (client-server and peer-to-peer), popular application layer protocols like HTTP, FTP, and email, and how applications map to underlying transport protocols. The goals are to learn about application protocols by examining HTTP, FTP, SMTP and others, and to understand transport service models and client-server versus peer-to-peer paradigms.

Uploaded by

Azad Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views67 pages

Chapter 2

The document summarizes Chapter 2 of the textbook, which covers the application layer. It discusses key topics like application architectures (client-server and peer-to-peer), popular application layer protocols like HTTP, FTP, and email, and how applications map to underlying transport protocols. The goals are to learn about application protocols by examining HTTP, FTP, SMTP and others, and to understand transport service models and client-server versus peer-to-peer paradigms.

Uploaded by

Azad Hossain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

Chapter 2

Application Layer

Computer Networking:
A Top Down Approach,
5th edition.
Jim Kurose, Keith Ross
Addison-Wesley, April
2009.

2: Application Layer 1
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 2.2 Web and HTTP
 2.3 FTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 2
Chapter 2: Application Layer
Our goals:  learn about protocols
 conceptual, by examining popular
implementation application-level
aspects of network protocols
application protocols  HTTP
 transport-layer  FTP
service models  SMTP / POP3 / IMAP
 client-server
 DNS
paradigm
 peer-to-peer
paradigm

2: Application Layer 3
Some network apps
 e-mail  voice over IP
 web  real-time video
 instant messaging conferencing
 remote login  grid computing
 P2P file sharing
 multi-user network
games
 streaming stored video
clips

2: Application Layer 4
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 2.2 Web and HTTP
 2.3 FTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 5
Application architectures
 Client-server
 Peer-to-peer (P2P)
 Hybrid of client-server and P2P

2: Application Layer 6
Client-server architecture
server:
 always-on host
 permanent IP address
 server farms for scaling

clients:
 communicate with server
 may be intermittently
client/server connected
 may have dynamic IP
addresses
 do not communicate directly
with each other

2: Application Layer 7
Pure P2P architecture
 no always-on server
 arbitrary end systems
directly communicate peer-peer
 peers are intermittently
connected and change IP
addresses

Highly scalable but


difficult to manage

2: Application Layer 8
Hybrid of client-server and P2P
Skype
 voice-over-IP P2P application
 centralized server: finding address of remote
party:
 client-client connection: direct (not through
server)
Instant messaging
 chatting between two users is P2P
 centralized service: client presence
detection/location
• user registers its IP address with central
server when it comes online
• user contacts central server to find IP
addresses of buddies
2: Application Layer 9
Processes communicating
Process: program running Client process: process
within a host. that initiates
 within same host, two communication
processes communicate Server process: process
using inter-process that waits to be
communication (defined contacted
by OS).
 processes in different  Note: applications with
hosts communicate by P2P architectures have
exchanging messages client processes &
server processes

2: Application Layer 10
App-layer protocol defines
 Types of messages
exchanged,
 e.g., request, response
 Message syntax:
 what fields in messages &
how fields are delineated
 Message semantics
 meaning of information in
fields
 Rules for when and how
processes send &
respond to messages
2: Application Layer 11
What transport service does an app need?
Data loss Throughput
 some apps (e.g., audio) can  some apps (e.g.,
tolerate some loss multimedia) require
 other apps (e.g., file minimum amount of
transfer, telnet) require throughput to be
100% reliable data “effective”
transfer  other apps (“elastic apps”)
Timing make use of whatever
 some apps (e.g.,
throughput they get
Internet telephony,
interactive games) Security
require low delay to be  Encryption, data integrity,
“effective” …

2: Application Layer 12
Transport service requirements of common apps

Application Data loss Throughput Time Sensitive

file transfer no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100’s msec
video:10kbps-5Mbps
stored audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant few kbps up yes, 100’s msec
instant messaging no loss elastic yes and no

2: Application Layer 13
Internet transport protocols services

TCP service: UDP service:


 connection-oriented: setup  unreliable data transfer
required between client and between sending and
server processes receiving process
 reliable transport between  does not provide:
sending and receiving process connection setup,
 flow control: sender won’t reliability, flow control,
overwhelm receiver congestion control, timing,
 congestion control: throttle throughput guarantee, or
sender when network security
overloaded
 does not provide: timing, Q: why bother? Why is
minimum throughput there a UDP?
guarantees, security
2: Application Layer 14
Internet apps: application, transport protocols

Application Underlying
Application layer protocol transport protocol

e-mail SMTP [RFC 2821] TCP


remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia HTTP (eg Youtube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) typically UDP

2: Application Layer 15
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 app architectures
 app requirements
 2.2 Web and HTTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 16
Web and HTTP
First some jargon
 Web page consists of objects
 Object can be HTML file, JPEG image, Java
applet, audio file,…
 Web page consists of base HTML-file which
includes several referenced objects
 Each object is addressable by a URL
 Example URL:

www.someschool.edu/someDept/pic.gif

host name path name

2: Application Layer 17
HTTP overview

HTTP: hypertext
transfer protocol HT
TP
r
equ
 Web’s application layer PC running HT est
TP
protocol Explorer res
pon
se
 client/server model
 client: browser that
e st
u
requests, receives, P r eq se Server
T o n
“displays” Web objects HT r es
p running
T P Apache Web
 server: Web server HT
server
sends objects in
response to requests
Mac running
Navigator

2: Application Layer 18
HTTP overview (continued)
Uses TCP: HTTP is “stateless”
 client initiates TCP  server maintains no
connection (creates socket) information about
to server, port 80 past client requests
 server accepts TCP
connection from client aside
Protocols that maintain
 HTTP messages (application- “state” are complex!
layer protocol messages)  past history (state) must
exchanged between browser be maintained
(HTTP client) and Web  if server/client crashes,
server (HTTP server)
their views of “state” may
 TCP connection closed
be inconsistent, must be
reconciled

2: Application Layer 19
HTTP connections
Nonpersistent HTTP Persistent HTTP
 At most one object is  Multiple objects can
sent over a TCP be sent over single
connection. TCP connection
between client and
server.

2: Application Layer 20
Nonpersistent HTTP
(contains text,
Suppose user enters URL www.someSchool.edu/someDepartment/home.index
references to 10
jpeg images)

1a. HTTP client initiates TCP


connection to HTTP server
(process) at
1b. HTTP server at host
www.someSchool.edu waiting
www.someSchool.edu on port 80
for TCP connection at port 80.
“accepts” connection,
notifying client
2. HTTP client sends HTTP
request message (containing
URL) into TCP connection 3. HTTP server receives request
socket. Message indicates message, forms response
that client wants object message containing requested
someDepartment/home.index object, and sends message
into its socket

time
2: Application Layer 21
Nonpersistent HTTP (cont.)

4. HTTP server closes TCP


connection.
5. HTTP client receives response
message containing html file,
displays html. Parsing html
file, finds 10 referenced jpeg
objects
time 6. Steps 1-5 repeated for each
of 10 jpeg objects

2: Application Layer 22
Non-Persistent HTTP: Response time
Definition of RTT: time for a
small packet to travel from
client to server and back.
Response time: initiate TCP
connection
 one RTT to initiate TCP
RTT
connection
request
 one RTT for HTTP request file
time to
and first few bytes of RTT
transmit
HTTP response to return file
file
 file transmission time received
total = 2RTT+transmit time
time time

2: Application Layer 23
Persistent HTTP

Nonpersistent HTTP issues: Persistent HTTP


 requires 2 RTTs per object  server leaves connection
 OS overhead for each TCP open after sending
connection response
 browsers often open parallel  subsequent HTTP messages
TCP connections to fetch between same
referenced objects client/server sent over
open connection
 client sends requests as
soon as it encounters a
referenced object
 as little as one RTT for all
the referenced objects

2: Application Layer 24
HTTP request message
 two types of HTTP messages: request, response
 HTTP request message:
 ASCII (human-readable format)

request line
(GET, POST, GET /somedir/page.html HTTP/1.1
HEAD, PUT. DELETE Host: www.someschool.edu
User-agent: Mozilla/4.0
header Connection: close
lines Accept-language:fr

Carriage return,
line feed (extra carriage return, line feed)
indicates end
of message
2: Application Layer 25
HTTP request message: general format

2: Application Layer 26
Uploading form input
Post method:
 Web page often
includes form input URL method:
 Input is uploaded to  Uses GET method
server in entity body  Input is uploaded in
URL field of request
line:

www.somesite.com/animalsearch?monkeys&banana

2: Application Layer 27
Method types
HTTP/1.0 HTTP/1.1
 GET  GET, POST, HEAD
 POST  PUT
 HEAD  uploads file in entity
body to path specified
 asks server to leave
in URL field
requested object out of
response  DELETE
 deletes file specified in
the URL field

2: Application Layer 28
HTTP response message
status line
(protocol
status code HTTP/1.1 200 OK
status phrase) Connection close
Date: Thu, 06 Aug 1998 12:00:15 GMT
header Server: Apache/1.3.0 (Unix)
lines Last-Modified: Mon, 22 Jun 1998 …...
Content-Length: 6821
Content-Type: text/html

data, e.g., data data data data data ...


requested
HTML file

2: Application Layer 29
HTTP response status codes
In first line in server->client response message.
A few sample codes:
200 OK
 request succeeded, requested object later in this message
301 Moved Permanently
 requested object moved, new location specified later in
this message (Location:)
400 Bad Request
 request message not understood by server
404 Not Found
 requested document not found on this server
505 HTTP Version Not Supported
2: Application Layer 30
User-server state: cookies
Example:
Many major Web sites
 Susan always access
use cookies
Internet always from PC
Four components:
 visits specific e-
1) cookie header line of
HTTP response message commerce site for first
2) cookie header line in time
HTTP request message  when initial HTTP
3) cookie file kept on
user’s host, managed by requests arrives at site,
user’s browser site creates:
4) back-end database at  unique ID
Web site
 entry in backend
database for ID

2: Application Layer 31
Cookies: keeping “state” (cont.)

2: Application Layer 32
Cookies (continued)
aside
What cookies can bring: Cookies and privacy:
 authorization  cookies permit sites to
 shopping carts learn a lot about you
 you may supply name
 recommendations
and e-mail to sites
 user session state
(Web e-mail)
How to keep “state”:
 protocol endpoints: maintain state
at sender/receiver over multiple
transactions
 cookies: http messages carry state

2: Application Layer 33
Web caches (proxy server)
Goal: satisfy client request without involving origin server

 user sets browser: Web origin


server
accesses via cache
 browser sends all HTTP Proxy
HT
requests to cache TP
req server q uest
H u P re
T
client TP e st T T o n se
 object in cache: cache res H
r es
p
pon P
returns object se H TT
e st
 else cache requests r eq
u
object from origin server, T P o nse
HT p
r es
then returns object to T TP
client H

client
origin
server

2: Application Layer 34
More about Web caching
 cache acts as both Why Web caching?
client and server  reduce response time
 typically cache is for client request
installed by ISP  reduce traffic on an
(university, company, institution’s access
residential ISP) link.
 Internet dense with
caches: enables “poor”
content providers to
effectively deliver
content.

2: Application Layer 35
Caching example
origin
Assumptions servers
 average object size = 100,000
bits public
Internet
 avg. request rate from
institution’s browsers to origin
servers = 15/sec
 delay from institutional router to 15 Mbps
any origin server and back to access link
router = 2 sec
institutional
Consequences network
100 Mbps LAN
 utilization on LAN = 15%
 utilization on access link = 100%
 total delay = Internet delay + access
delay + LAN delay institutional
= 2 sec + minutes + milliseconds cache

2: Application Layer 36
Caching example (cont)
origin
possible solution servers
 increase bandwidth of access
public
link to, say, 10 Mbps Internet
consequence
 utilization on LAN = 15%
 utilization on access link = 15% 100 Mbps
 Total delay = Internet delay + access link
access delay + LAN delay institutional
= 2 sec + msecs + msecs network
100 Mbps LAN
 often a costly upgrade

institutional
cache

2: Application Layer 37
Caching example (cont)
origin
possible solution: install servers
cache public
 suppose hit rate is 0.4 Internet
consequence
 40% requests will be
satisfied almost immediately
 60% requests satisfied by 1.5 Mbps
access link
origin server
 utilization of access link institutional
reduced to 60%, resulting in network
10 Mbps LAN
negligible delays (say 10
msec)
 total avg delay = Internet
delay + access delay + LAN institutional
delay = .6*(2.01) secs + . cache
4*milliseconds < 1.4 secs

2: Application Layer 38
Conditional GET

 Goal: don’t send object if cache server


cache has up-to-date cached HTTP request msg
version If-modified-since:
object
 cache: specify date of <date>
not
cached copy in HTTP request modified
HTTP response
If-modified-since: HTTP/1.0
<date> 304 Not Modified
 server: response contains no
object if cached copy is up-
HTTP request msg
to-date: If-modified-since:
HTTP/1.0 304 Not <date> object
Modified modified
HTTP response
HTTP/1.0 200 OK
<data>
2: Application Layer 39
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 2.2 Web and HTTP
 2.3 FTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 40
FTP: the file transfer protocol

FTP file transfer


FTP FTP
user client server
interface
user
at host remote file
local file system
system

 transfer file to/from remote host


 client/server model
 client: side that initiates transfer (either to/from
remote)
 server: remote host
 ftp server: port 21

2: Application Layer 41
FTP: separate control, data connections
TCP control connection
 FTP client contacts FTP server port 21
at port 21, TCP is transport
protocol TCP data connection
 client authorized over control FTP port 20 FTP
connection client server
 client browses remote  server opens another TCP
directory by sending commands
data connection to transfer
over control connection.
another file.
 when server receives file  FTP server maintains “state”:
transfer command, server
current directory, earlier
opens 2nd TCP connection (for
authentication
file) to client
 after transferring one file,
server closes data connection.
2: Application Layer 42
FTP commands, responses

Sample commands: Sample return codes


 sent as ASCII text over  status code and phrase (as
control channel in HTTP)
 USER username  331 Username OK,
 PASS password password required
 LIST: return list of file in  125 data connection
current directory already open;
transfer starting
 RETR filename:
 425 Can’t open data
retrieves (gets) file connection
 STOR filename: stores  452 Error writing
(puts) file onto remote file
host

2: Application Layer 43
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 2.2 Web and HTTP
 2.3 FTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 44
Electronic Mail outgoing
message queue
user mailbox
user
Three major components: agent
 user agents mail
user
 mail servers server
agent
 simple mail transfer protocol:
SMTP mail
SMTP
server user

User Agent SMTP agent

 a.k.a. “mail reader”


SMTP
 composing, editing, reading mail user
agent
mail messages server
 e.g., Eudora, Outlook, elm,
user
Mozilla Thunderbird
agent
 outgoing, incoming messages user
stored on server agent

2: Application Layer 45
Electronic Mail: mail servers
user
Mail Servers agent
 mailbox contains incoming
mail
user
messages for user server
agent
 message queue of outgoing
SMTP
(to be sent) mail messages mail
server user
 SMTP protocol between mail
servers to send email
SMTP agent

messages SMTP
 SMTP client: sending mail user
agent
mail server server
 “SMTP server”: receiving
user
mail server agent
user
agent

2: Application Layer 46
Electronic Mail: SMTP [RFC 2821]
 uses TCP to reliably transfer email message from client
to server, port 25
 direct transfer: sending server to receiving server
 three phases of transfer
 handshaking (greeting)
 transfer of messages
 closure
 command/response interaction
 commands: ASCII text
 response: status code and phrase

 messages must be in 7-bit ASCII

2: Application Layer 47
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice’s
message and “to” message over the TCP
[email protected] connection
2) Alice’s UA sends message 5) Bob’s mail server places the
to her mail server; message message in Bob’s mailbox
placed in message queue 6) Bob invokes his user agent
3) Client side of SMTP opens to read message
TCP connection with Bob’s
mail server

1 mail
mail
server user
user server
2 agent
agent 3 6
4 5

2: Application Layer 48
SMTP: final words
 SMTP uses persistent Comparison with HTTP:
connections
 HTTP: pull
 SMTP requires message
 SMTP: push
(header & body) to be in 7-
bit ASCII  both have ASCII
 SMTP server uses
command/response
CRLF.CRLF to determine interaction, status codes
end of message
 HTTP: each object
encapsulated in its own
response msg
 SMTP: multiple objects
sent in multipart msg

2: Application Layer 49
Mail message format

SMTP: protocol for


exchanging email msgs header
blank
RFC 822: standard for text
line
message format:
 header lines, e.g.,
 To: body
 From:
 Subject:

different from SMTP


commands!
 body
 the “message”, ASCII
characters only

2: Application Layer 50
Mail access protocols
SMTP SMTP access user
user
agent protocol agent

sender’s mail receiver’s mail


server server
 SMTP: delivery/storage to receiver’s server
 Mail access protocol: retrieval from server
 POP: Post Office Protocol [RFC 1939]
• authorization (agent <-->server) and download
 IMAP: Internet Mail Access Protocol [RFC 1730]
• more features (more complex)
• manipulation of stored msgs on server
 HTTP: gmail, Hotmail, Yahoo! Mail, etc.

2: Application Layer 51
POP3 protocol S: +OK POP3 server ready
C: user bob
authorization phase S: +OK
C: pass hungry
 client commands:
S: +OK user successfully logged on
 user: declare username
C: list
 pass: password
S: 1 498
 server responses S: 2 912
 +OK S: .
 -ERR C: retr 1
S: <message 1 contents>
transaction phase, client: S: .
 list: list message numbers C: dele 1
 retr: retrieve message by C: retr 2
S: <message 1 contents>
number
S: .
 dele: delete
C: dele 2
 quit C: quit
S: +OK POP3 server signing off
2: Application Layer 52
POP3 (more) and IMAP
More about POP3 IMAP
 Previous example uses  Keep all messages in
“download and delete” one place: the server
mode.  Allows user to
 Bob cannot re-read e-
organize messages in
mail if he changes folders
client  IMAP keeps user state
 “Download-and-keep”:
across sessions:
copies of messages on  names of folders and
different clients mappings between
 POP3 is stateless message IDs and folder
across sessions name

2: Application Layer 53
Chapter 2: Application layer
 2.1 Principles of  2.6 P2P applications
network applications
 2.2 Web and HTTP
 2.3 FTP
 2.4 Electronic Mail
 SMTP, POP3, IMAP
 2.5 DNS

2: Application Layer 54
DNS: Domain Name System

People: many identifiers: Domain Name System:


 SSN, name, passport #  distributed database
Internet hosts, routers: implemented in hierarchy of
many name servers
 IP address (32 bit) -  application-layer protocol
used for addressing
host, routers, name servers to
datagrams
communicate to resolve names
 “name”, e.g., (address/name translation)
ww.yahoo.com - used by
 note: core Internet
humans
function, implemented as
Q: map between IP application-layer protocol
addresses and name ?  complexity at network’s
“edge”

2: Application Layer 55
DNS
DNS services Why not centralize DNS?
 hostname to IP  single point of failure
address translation  traffic volume
 host aliasing  distant centralized
 Canonical, alias names database
 mail server aliasing  maintenance
 load distribution
 replicated Web servers: doesn’t scale!
set of IP addresses for
one canonical name

2: Application Layer 56
Distributed, Hierarchical Database
Root DNS Servers

com DNS servers org DNS servers edu DNS servers

pbs.org poly.edu umass.edu


yahoo.com amazon.com
DNS servers DNS serversDNS servers
DNS servers DNS servers

Client 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.com
2: Application Layer 57
DNS: 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
a Verisign, Dulles, VA
c Cogent, Herndon, VA (also LA)
d U Maryland College Park, MD k RIPE London (also 16 other locations)
g US DoD Vienna, VA
h ARL Aberdeen, MD i Autonomica, Stockholm (plus
j Verisign, ( 21 locations) 28 other locations)
e NASA Mt View, CA m WIDE Tokyo (also Seoul,
f Internet Software C. Palo Alto, Paris, SF)
CA (and 36 other locations)

13 root name
servers worldwide
b USC-ISI Marina del Rey, CA
l ICANN Los Angeles, CA

2: Application Layer 58
TLD 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
provider

2: Application Layer 59
Local 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 hierarchy

2: Application Layer 60
DNS name root DNS server

resolution example
2
 Host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu 5

iterated query: local DNS server


dns.poly.edu
 contacted server
7 6
replies with name of 1 8
server to contact
 “I don’t know this authoritative DNS server
dns.cs.umass.edu
name, but ask this requesting host
server” cis.poly.edu

gaia.cs.umass.edu

2: Application Layer 61
DNS name
resolution example root DNS server

recursive query: 2 3
 puts burden of name
7 6
resolution on
TLD DNS server
contacted name
server
 heavy load? local DNS server
dns.poly.edu 5 4

1 8

authoritative DNS server


dns.cs.umass.edu
requesting host
cis.poly.edu

gaia.cs.umass.edu

2: Application Layer 62
DNS: 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.html

2: Application Layer 63
DNS records
DNS: distributed db storing resource records (RR)
RR format: (name, value, type, ttl)

 Type=A  Type=CNAME
 name is hostname  name is alias name for some
 value is IP address “canonical” (the real) name
 Type=NS www.ibm.com is really
 name is domain (e.g. foo.com)
servereast.backup2.ibm.com
 value is hostname of
 value is canonical name
authoritative name server
 Type=MX
for this domain
 value is name of mailserver
associated with name

2: Application Layer 64
DNS protocol, messages
DNS protocol : query and reply messages, both with same message format

msg header 12 byte


 identification: 16 bit #
for query, reply to query
uses same #
 flags:
 query or reply
 recursion desired
 recursion available
 reply is authoritative

2: Application Layer 65
DNS protocol, messages

Name, type fields


for a query

RRs in response
to query

records for
authoritative servers

additional “helpful”
info that may be used

2: Application Layer 66
Inserting 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 for
networkutopia.com
 How do people get IP address of your Web site?

2: Application Layer 67

You might also like