Ch2 Part2
Ch2 Part2
Application
Layer
Computer Networking: A
Top-Down Approach
8th edition n
Jim Kurose, Keith Ross
Pearson, 2020
Application Layer: 2-1
Application layer: overview
P2P applications
Principles of network video streaming and content
applications distribution networks
Web and HTTP socket programming with
E-mail, SMTP, IMAP UDP and TCP
The Domain Name System
DNS
7 6
Recursive query: 1 TLD DNS server
puts burden of name 8
resolution on requesting host at local DNS server
5 4
engineering.nyu.edu dns.nyu.edu
contacted name gaia.cs.umass.edu
server
heavy load at upper authoritative DNS server
levels of hierarchy? dns.cs.umass.edu
type=A type=CNAME
name is hostname name is alias name for some “canonical” (the
value is IP address real) name
www.ibm.com is really servereast.backup2.ibm.com
type=NS value is canonical name
name is domain (e.g., foo.com)
value is hostname of
type=MX
authoritative name server for value is name of SMTP mail server
this domain associated with name
Application Layer: 2-23
DNS protocol messages
DNS query and reply messages, both have same format:
2 bytes 2 bytes
identification flags
communicate
peers request service from other
peers, provide service in return to
other peers local or
regional ISP
• self scalability – new peers bring new
service capacity, and new service demands home network content
provider
peers are intermittently connected network datacenter
network
and change IP addresses
• complex management
examples: P2P file sharing (BitTorrent), enterprise
network
streaming (KanKan), VoIP (Skype)
Application Layer: 2-28
File distribution: client-server vs P2P
Q: how much time to distribute file (size F) from one server to N
peers?
• peer upload/download capacity is limited resource
us: server upload
capacity
di: peer i download
file, size F u1 d1 u2 capacity
us d2
server
di
uN network (with abundant
bandwidth) ui
dN
ui: peer i upload
capacity
Introduction: 1-29
File distribution time: client-server
server transmission: must sequentially
send (upload) N file copies:
F
• time to send one copy: F/us us
time to distribute F
to N clients using
P2P approach
DP2P > max{F/us,,F/dmin,,NF/(us + Sui)}
increases linearly in N …
… but so does this, as each peer brings service capacity Application Layer: 2-31
Client-server vs. P2P: example
client upload rate = u, F/u = 1 hour, us = 10u, dmin ≥ us
3.5
P2P
1.5
0.5
0
0 5 10 15 20 25 30 35
N
Application Layer: 2-32
Application Layer: Overview
P2P applications
Principles of network video streaming and content
applications distribution networks
Web and HTTP socket programming with
E-mail, SMTP, IMAP UDP and TCP
The Domain Name System
DNS
transport transport
network network controlled
link
by OS
link Internet
physical physical
write reply to
serverSocket read datagram from
specifying clientSocket
client address,
port number close
clientSocket
Application Layer: 2-37
Socket programming with TCP
Client must contact server when contacted by client, server
server process must first be running TCP creates new socket for server
server must have created socket
process to communicate with that
(door) that welcomes client’s particular client
contact • allows server to talk with multiple
clients
Client contacts server by: • source port numbers used to
Creating TCP socket, specifying IP distinguish clients (more in Chap 3)
address, port number of server
process Application viewpoint
when client creates socket: client TCP provides reliable, in-order
TCP establishes connection to byte-stream transfer (“pipe”)
server TCP between client and server
processes
Application Layer: 2-38
Client/server socket interaction: TCP
server (running on hostid) client
create socket,
port=x, for incoming
request:
serverSocket = socket()
write reply to
connectionSocket read reply from
clientSocket
close
connectionSocket close
clientSocket
Application Layer: 2-39
Chapter 2: Summary
our study of network application layer is now complete!
application architectures specific protocols:
• client-server • HTTP
• P2P • SMTP, IMAP
• DNS
application service requirements:
• P2P: BitTorrent
• reliability, bandwidth, delay
video streaming, CDNs
Internet transport service model socket programming:
• connection-oriented, reliable: TCP
TCP, UDP sockets
• unreliable, datagrams: UDP
Introduction: 1-42