Chapter 2 Application Layer PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

Chapter 2

Application Layer

Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012

Application Layer 2-1


Chapter 2: outline
2.1 principles of network applications
2.2 Web and HTTP
2.3 electronic mail
§ SMTP, POP3, IMAP
2.4 DNS

Application Layer 2-2


Chapter 2: application layer
our goals: v learn about protocols by
v conceptual, examining popular
implementation aspects application-level
of network application protocols
protocols § HTTP
§ transport-layer § FTP
service models § SMTP / POP3 / IMAP
§ client-server § DNS
paradigm v creating network
§ peer-to-peer applications
paradigm § socket API

Application Layer 2-3


Some network apps
v e-mail v voice over IP (e.g., Skype)
v web v real-time video
v text messaging conferencing
v remote login v social networking
v P2P file sharing v search
v multi-user network games v …
v streaming stored video v …
(YouTube, Hulu, Netflix)

Application Layer 2-4


Creating a network app application
transport
network
data link

write programs that: physical

v run on (different) end systems


v communicate over network
v e.g., web server software
communicates with browser
software
no need to write software for application

network-core devices transport


network
data link application
v network-core devices do not physical transport
network
run user applications data link
physical

v applications on end systems


allows for rapid app
development, propagation

Application Layer 2-5


Application architectures
possible structure of applications:
v client-server
v peer-to-peer (P2P)

Application Layer 2-6


Client-server architecture
server:
v always-on host
v permanent IP address
v data centers for scaling

clients:
v communicate with server
client/server v may be intermittently
connected
v may have dynamic IP
addresses
v do not communicate directly
with each other
Application Layer 2-7
P2P architecture
v no always-on server peer-peer
v arbitrary end systems
directly communicate
v peers request service from
other peers, provide service
in return to other peers
§ self scalability – new
peers bring new service
capacity, as well as new
service demands
v peers are intermittently
connected and change IP
addresses
§ complex management

Application Layer 2-8


Processes communicating
process: program running clients, servers
within a host client process: process that
v within same host, two initiates communication
processes communicate server process: process that
using inter-process waits to be contacted
communication (defined by
OS)
v processes in different hosts
communicate by exchanging v aside: applications with P2P
messages architectures have client
processes & server
processes

Application Layer 2-9


Sockets
v process sends/receives messages to/from its socket
v socket analogous to door
§ sending process shoves message out door
§ sending process relies on transport infrastructure on
other side of door to deliver message to socket at
receiving process

application application
socket controlled by
process process app developer

transport transport
network network controlled
link by OS
link Internet
physical physical

Application Layer 2-10


Addressing processes
v to receive messages, v identifier includes both IP
process must have identifier address and port numbers
v host device has unique 32- associated with process on
bit IP address host.
v Q: does IP address of host v example port numbers:
on which process runs § HTTP server: 80
suffice for identifying the § mail server: 25
process? v to send HTTP message to
§ A: no, many processes gaia.cs.umass.edu web
can be running on same server:
host § IP address: 128.119.245.12
§ port number: 80
v more shortly…

Application Layer 2-11


App-layer protocol defines
v types of messages open protocols:
exchanged, v defined in RFCs
§ e.g., request, response v allows for interoperability
v message syntax: v e.g., HTTP, SMTP
§ what fields in messages proprietary protocols:
& how fields are
v e.g., Skype
delineated
v message semantics
§ meaning of information
in fields
v rules for when and how
processes send & respond
to messages

Application Layer 2-12


What transport service does an app need?
data integrity throughput
v some apps (e.g., file transfer, v some apps (e.g.,
web transactions) require multimedia) require
100% reliable data transfer minimum amount of
v other apps (e.g., audio) can
throughput to be
tolerate some loss effective
v other apps ( elastic apps )

timing make use of whatever


throughput they get
v some apps (e.g., Internet
telephony, interactive security
games) require low delay
to be effective v encryption, data integrity,

Application Layer 2-13


Transport service requirements: 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
video:10kbps-5Mbps msec
stored audio/video loss-tolerant same as above
interactive games loss-tolerant few kbps up yes, few secs
text messaging no loss elastic yes, 100 s
msec
yes and no

Application Layer 2-14


Internet transport protocols services

TCP service: UDP service:


v reliable transport between v unreliable data transfer
sending and receiving between sending and
process receiving process
v flow control: sender won t v does not provide:
overwhelm receiver
reliability, flow control,
v congestion control: throttle congestion control,
sender when network
overloaded timing, throughput
v does not provide: timing, guarantee, security,
minimum throughput orconnection setup,
guarantee, security
v connection-oriented: setup Q: why bother? Why is
required between client and there a UDP?
server processes

Application Layer 2-15


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 (e.g., YouTube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) TCP or UDP

Application Layer 2-16


Chapter 2: outline
2.1 principles of network applications
2.2 Web and HTTP
2.3 electronic mail
§ SMTP, POP3, IMAP
2.4 DNS

Application Layer 2-17


Web and HTTP
First, a review…
v web page consists of objects
v object can be HTML file, JPEG image, Java applet,
audio file,…
v web page consists of base HTML-file which
includes several referenced objects
v each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif

host name path name

Application Layer 2-18


HTTP overview
HTTP: hypertext
transfer protocol
HT
v Web s application layer TP
r equ
protocol PC running HT
est
Firefox browser TP
v client/server model r esp
ons
e
§ client: browser that
requests, receives, t
(using HTTP protocol) u es
r eq server
and displays Web HT
T P
po
nse
running
objects P r es
Apache Web
T
§ server: Web server HT server
sends (using HTTP
protocol) objects in iphone running
response to requests Safari browser

Application Layer 2-19


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

Application Layer 2-20


HTTP connections
non-persistent HTTP persistent HTTP
v at most one object v multiple objects can
sent over TCP be sent over single
connection TCP connection
§ connection then between client, server
closed
v downloading multiple
objects required
multiple connections

Application Layer 2-21


Non-persistent HTTP
suppose user enters URL: (contains text,
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 on port www.someSchool.edu waiting
80 for TCP connection at port 80.
accepts connection, notifying
2. HTTP client sends HTTP request client
message (containing URL) into
TCP connection socket. 3. HTTP server receives request
Message indicates that client message, forms response
wants object message containing requested
someDepartment/home.index object, and sends message into
its socket
time
Application Layer 2-22
Non-persistent 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

Application Layer 2-23


Non-persistent HTTP: response time
RTT (definition): time for a
small packet to travel from
client to server and back
HTTP response time: initiate TCP
connection
v one RTT to initiate TCP
connection RTT
request
v one RTT for HTTP request file
and first few bytes of HTTP time to
RTT
response to return transmit
file
v file transmission time file
received
v non-persistent HTTP
response time =
time time
2RTT+ file transmission
time

Application Layer 2-24


Persistent HTTP

non-persistent HTTP issues: persistent HTTP:


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

Application Layer 2-25


HTTP request message

v two types of HTTP messages: request, response


v HTTP request message:
§ ASCII (human-readable format)
carriage return character
line-feed character
request line
(GET, POST, GET /index.html HTTP/1.1\r\n
HEAD commands) Host: www-net.cs.umass.edu\r\n
User-Agent: Firefox/3.6.10\r\n
Accept: text/html,application/xhtml+xml\r\n
header Accept-Language: en-us,en;q=0.5\r\n
lines Accept-Encoding: gzip,deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
carriage return, Keep-Alive: 115\r\n
line feed at start Connection: keep-alive\r\n
\r\n
of line indicates
end of header lines
Application Layer 2-26
HTTP request message: general format

method sp URL sp version cr lf request


line
header field name value cr lf
header
~
~ ~
~ lines

header field name value cr lf


cr lf

~
~ entity body ~
~ body

Application Layer 2-27


Uploading form input
POST method:
v web page often includes
form input
v input is uploaded to
server in entity body

URL method:
v uses GET method
v input is uploaded in URL
field of request line:
www.somesite.com/animalsearch?monkeys&banana

Application Layer 2-28


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

Application Layer 2-29


HTTP response message
status line
(protocol
status code HTTP/1.1 200 OK\r\n
status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n
Server: Apache/2.0.52 (CentOS)\r\n
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMT\r\n
header ETag: "17dc6-a5c-bf716880"\r\n
Accept-Ranges: bytes\r\n
lines Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-
1\r\n
\r\n
data, e.g., data data data data data ...
requested
HTML file
Application Layer 2-30
HTTP response status codes
v status code appears in 1st line in server-to-
client response message.
v some sample codes:
200 OK
§ request succeeded, requested object later in this msg
301 Moved Permanently
§ requested object moved, new location specified later in this msg
(Location:)
400 Bad Request
§ request msg not understood by server
404 Not Found
§ requested document not found on this server
505 HTTP Version Not Supported
Application Layer 2-31
Trying out HTTP (client side) for yourself
1. Telnet to your favorite Web server:

telnet cis.poly.edu 80 opens TCP connection to port 80


(default HTTP server port) at cis.poly.edu.
anything typed in sent
to port 80 at cis.poly.edu

2. type in a GET HTTP request:


GET /~ross/ HTTP/1.1 by typing this in (hit carriage
Host: cis.poly.edu return twice), you send
this minimal (but complete)
GET request to HTTP server

3. look at response message sent by HTTP server!


(or use Wireshark to look at captured HTTP request/response)
Application Layer 2-32
User-server state: cookies
example:
many Web sites use cookies v Susan always access Internet
four components: from PC
1) cookie header line of v visits specific e-commerce
HTTP response site for first time
message v when initial HTTP requests
2) cookie header line in arrives at site, site creates:
next HTTP request § unique ID
message § entry in backend
3) cookie file kept on database for ID
user s host, managed
by user s browser
4) back-end database at
Web site
Application Layer 2-33
Cookies: keeping state (cont.)
client server

ebay 8734
usual http request msg Amazon server
cookie file creates ID
usual http response
1678 for user create backend
ebay 8734
set-cookie: 1678 entry database
amazon 1678
usual http request msg
cookie: 1678 cookie- access
specific
usual http response msg action

one week later:


access
ebay 8734 usual http request msg
amazon 1678 cookie: 1678 cookie-
specific
usual http response msg action
Application Layer 2-34
Cookies (continued)
aside
what cookies can be used cookies and privacy:
for: v cookies permit sites to
v authorization learn a lot about you
v shopping carts
v you may supply name and
v recommendations
e-mail to sites
v user session state (Web
e-mail)

how to keep state :


v protocol endpoints: maintain state at
sender/receiver over multiple
transactions
v cookies: http messages carry state

Application Layer 2-35


Web caches (proxy server)
goal: satisfy client request without involving origin server
v user sets browser: Web
accesses via cache
v browser sends all HTTP proxy
requests to cache HT
TP
server u est
H
requ
P req
§ object in cache: cache client TTP
r
est
HT
T
po nse
origin
esp res
returns object ons
e HT
TP server
s t
§ else cache requests r eq
ue
e
object from origin TTP o ns
p
H r es
server, then returns TTP
H
object to client
client origin
server

Application Layer 2-36


More about Web caching
v cache acts as both why Web caching?
client and server v reduce response time
§ server for original for client request
requesting client
§ client to origin server v reduce traffic on an

v typically cache is institution s access link


installed by ISP v Internet dense with
(university, company, caches: enables poor
residential ISP) content providers to
effectively deliver
content (so too does
P2P file sharing)

Application Layer 2-37


Conditional GET
client server
v Goal: don t send object if
cache has up-to-date
cached version HTTP request msg
object
If-modified-since: <date>
§ no object transmission not
delay modified
§ lower link utilization HTTP response before
HTTP/1.0
v cache: specify date of 304 Not Modified <date>
cached copy in HTTP
request
If-modified-since:
<date> HTTP request msg
v server: response contains If-modified-since: <date> object
modified
no object if cached copy after
HTTP response
is up-to-date: HTTP/1.0 200 OK <date>
HTTP/1.0 304 Not <data>
Modified
Application Layer 2-38
Chapter 2: outline
2.1 principles of network applications
2.2 Web and HTTP
2.3 electronic mail
§ SMTP, POP3, IMAP
2.4 DNS

Application Layer 2-39


Electronic mail outgoing
message queue
user mailbox
Three major components: user
agent
v user agents
v mail servers mail user
server agent
v simple mail transfer
protocol: SMTP SMTP mail user
server agent

User Agent SMTP


v a.k.a. mail reader SMTP user
agent
v composing, editing, reading mail
server
mail messages user
v e.g., Outlook, Thunderbird, agent
iPhone mail client, Webmail user
agent
v outgoing, incoming messages
stored on server
Application Layer 2-40
Electronic mail: mail servers
mail servers: user
agent
v mailbox contains incoming
messages for user mail user
server agent
v message queue of outgoing
(to be sent) mail messages SMTP mail user
v SMTP protocol between server agent
mail servers to send email SMTP
messages
SMTP user
§ client: sending mail mail
agent
server server
user
§ server : receiving mail agent
server
user
agent

Application Layer 2-41


Electronic Mail: SMTP [RFC 2821]
v uses TCP to reliably transfer email message from
client to server, port 25
v direct transfer: sending server to receiving
server
v three phases of transfer
§ handshaking (greeting)
§ transfer of messages
§ closure
v command/response interaction (like HTTP, FTP)
§ commands: ASCII text
§ response: status code and phrase
v messages must be in 7-bit ASCI
Application Layer 2-42
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice s
message to message over the TCP
bob@someschool.edu 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 user mail user


mail agent
agent server server
2 3 6
4
5
Alice s mail server Bob s mail server
Application Layer 2-43
Sample SMTP interaction
S: 220 hamburger.edu
C: HELO crepes.fr
S: 250 Hello crepes.fr, pleased to meet you
C: MAIL FROM: <alice@crepes.fr>
S: 250 alice@crepes.fr... Sender ok
C: RCPT TO: <bob@hamburger.edu>
S: 250 bob@hamburger.edu ... Recipient ok
C: DATA
S: 354 Enter mail, end with "." on a line by itself
C: Do you like ketchup?
C: How about pickles?
C: .
S: 250 Message accepted for delivery
C: QUIT
S: 221 hamburger.edu closing connection

Application Layer 2-44


Try SMTP interaction for yourself:
v telnet servername 25
v see 220 reply from server
v enter HELO, MAIL FROM, RCPT TO, DATA, QUIT
commands

above lets you send email without using email client (reader)

Application Layer 2-45


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

Application Layer 2-46


Mail message format

SMTP: protocol for


exchanging email msgs header
blank
RFC 822: standard for text line
message format:
v header lines, e.g.,
§ To: body
§ From:
§ Subject:
different from SMTP MAIL
FROM, RCPT TO:
commands!
v Body: the message
§ ASCII characters only

Application Layer 2-47


Mail access protocols
user
mail access user
SMTP SMTP protocol
agent agent
(e.g., POP,
IMAP)

sender s mail receiver s mail


server server

v SMTP: delivery/storage to receiver s server


v mail access protocol: retrieval from server
§ POP: Post Office Protocol [RFC 1939]: authorization,
download
§ IMAP: Internet Mail Access Protocol [RFC 1730]: more
features, including manipulation of stored msgs on
server
§ HTTP: gmail, Hotmail, Yahoo! Mail, etc.

Application Layer 2-48


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

Application Layer 2-50


Chapter 2: outline
2.1 principles of network applications
2.2 Web and HTTP
2.3 electronic mail
§ SMTP, POP3, IMAP
2.4 DNS

Application Layer 2-51


DNS: domain name system
people: many identifiers: Domain Name System:
§ SSN, name, passport # v distributed database
Internet hosts, routers: implemented in hierarchy of
§ IP address (32 bit) - many name servers
used for addressing v application-layer protocol: hosts,
datagrams name servers communicate to
§ name , e.g., resolve names (address/name
www.yahoo.com - translation)
used by humans § note: core Internet function,
Q: how to map between IP implemented as application-
address and name, and layer protocol
vice versa ? § complexity at network s
edge

Application Layer 2-52


DNS: services, structure
DNS services why not centralize DNS?
v hostname to IP address v single point of failure
translation v traffic volume
v host aliasing v distant centralized database
§ canonical, alias names v maintenance
v mail server aliasing
v load distribution A: doesn t scale!
§ replicated Web
servers: many IP
addresses correspond
to one name

Application Layer 2-53


DNS Name hierarchy
. (root)
v DNS hierarchy can be
represented by a tree
v Root and top-level Top-level
domains are org edu gov com Domains
administered by an
Internet central name
registration authority
(ICANN) uci.edu toronto.edu
§ The Internet
Corporation for Managed
Assigned Names and by UofT
Numbers math.toronto.edu ece.toronto.edu
v Below top-level domain, Managed by
administration of name ECE Dept.
space is delegated to
neon.ece.toronto.edu
organizations
v Each organization can
delegate further
2: Application Layer 54
DNS: a 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:


v client queries root server to find com DNS server
v client queries .com DNS server to get amazon.com DNS server
v client queries amazon.com DNS server to get IP address for
www.amazon.com

Application Layer 2-55


DNS: root name servers
v contacted by local name server that can not resolve name
v root name server:
§ contacts authoritative name server if name mapping not known
§ gets mapping
§ returns mapping to local name server

c. Cogent, Herndon, VA (5 other sites)


d. U Maryland College Park, MD k. RIPE London (17 other sites)
h. ARL Aberdeen, MD
j. Verisign, Dulles VA (69 other sites ) i. Netnod, Stockholm (37 other sites)

e. NASA Mt View, CA m. WIDE Tokyo


f. Internet Software C. (5 other sites)
Palo Alto, CA (and 48 other
sites)

a. Verisign, Los Angeles CA 13 root name


(5 other sites)
b. USC-ISI Marina del Rey, CA
servers
l. ICANN Los Angeles, CA worldwide
(41 other sites)
g. US DoD Columbus,
OH (5 other sites)

Application Layer 2-56


TLD, authoritative servers
top-level domain (TLD) servers:
§ responsible for com, org, net, edu, aero, jobs, museums,
and all top-level country domains, e.g.: uk, fr, ca, jp
§ Network Solutions maintains servers for .com TLD
§ Educause for .edu TLD
authoritative DNS servers:
§ organization s own DNS server(s), providing
authoritative hostname to IP mappings for organization s
named hosts
§ can be maintained by organization or service provider

Application Layer 2-57


Local DNS name server
v does not strictly belong to hierarchy
v each ISP (residential ISP, company, university) has
one
§ also called default name server
v when host makes DNS query, query is sent to its
local DNS server
§ has local cache of recent name-to-address translation
pairs (but may be out of date!)
§ acts as proxy, forwards query into hierarchy

Application Layer 2-58


DNS name root DNS server
resolution example
2
v host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu
5

local DNS server


iterated query: dns.poly.edu
v contacted server 7 6
1 8
replies with name of
server to contact
authoritative DNS server
v I don t know this dns.cs.umass.edu
name, but ask this requesting host
cis.poly.edu
server
gaia.cs.umass.edu

Application Layer 2-59


DNS name root DNS server
resolution example
2 3
recursive query: 7
6
v puts burden of name TLD DNS
server
resolution on
contacted name local DNS server
server dns.poly.edu 5 4

v heavy load at upper 1 8


levels of hierarchy?
authoritative DNS server
dns.cs.umass.edu
requesting host
cis.poly.edu

gaia.cs.umass.edu

Application Layer 2-60


DNS: caching, updating records
v once (any) name server learns mapping, it caches
mapping
§ cache entries timeout (disappear) after some time (TTL)
§ TLD servers typically cached in local name servers
• thus root name servers not often visited
v cached entries may be out-of-date (best effort
name-to-address translation!)
§ if name host changes IP address, may not be known
Internet-wide until all TTLs expire
v update/notify mechanisms proposed IETF standard
§ RFC 2136

Application Layer 2-61


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., servereast.backup2.ibm.com
foo.com) § value is canonical name
§ value is hostname of
authoritative name type=MX
server for this domain § value is name of mailserver
associated with name

Application Layer 2-62


DNS protocol, messages
v query and reply messages, both with same message
format 2 bytes 2 bytes

msg header identification flags

v identification: 16 bit # for # questions # answer RRs


query, reply to query uses
# authority RRs # additional RRs
same #
v flags: questions (variable # of questions)
§ query or reply
§ recursion desired answers (variable # of RRs)
§ recursion available
§ reply is authoritative authority (variable # of RRs)

additional info (variable # of RRs)

Application Layer 2-63


DNS protocol, messages

2 bytes 2 bytes

identification flags

# questions # answer RRs

# authority RRs # additional RRs

name, type fields


questions (variable # of questions)
for a query
RRs in response answers (variable # of RRs)
to query
records for
authority (variable # of RRs)
authoritative servers
additional helpful additional info (variable # of RRs)
info that may be used
Application Layer 2-64
Inserting records into DNS
v example: new startup Network Utopia
v 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)
v create authoritative server type A record for
www.networkuptopia.com; type MX record for
networkutopia.com

Application Layer 2-65


Chapter 2: outline
2.1 principles of network 2.6 P2P applications
applications 2.7 socket programming
§ app architectures with UDP and TCP
§ app requirements
2.2 Web and HTTP
2.3 FTP
2.4 electronic mail
§ SMTP, POP3, IMAP
2.5 DNS

Application Layer 2-66


Chapter 2: summary
our study of network apps now complete!
v application architectures v specific protocols:
§ client-server § HTTP
§ P2P § SMTP, POP, IMAP
v application service
requirements: § DNS
§ reliability, bandwidth, delay
v Internet transport service
model
§ connection-oriented,
reliable: TCP
§ unreliable, datagrams: UDP

Application Layer 2-67

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy