Application Layer in Computer Networks
Application Layer in Computer Networks
Instructors:
Anas Abudaqa
Leen Alharbi
Application Layer COMPSCI 453 Computer Networks
Professor Jim Kurose
College of Information and Computer Sciences
▪
Computer Networking: A
The Domain Name System: DNS Top-Down Approach (8th ed.)
J.F. Kurose, K.W. Ross
Pearson, 2020
[Link]
Application layer: overview
Our goals: ▪ learn about protocols by
examining popular
▪ conceptual and application-layer protocols
implementation aspects of and infrastructure
application-layer protocols • HTTP
•transport-layer service • SMTP, IMAP
models • DNS
• video streaming systems, CDNs
•client-server paradigm
▪ programming network
•peer-to-peer paradigm applications
• socket API
Some network apps
▪ social networking ▪ voice over IP (e.g., Skype)
▪ Web ▪ real-time video conferencing
▪ text messaging (e.g., Zoom)
▪ e-mail ▪ Internet search
▪ multi-user network games ▪ remote login
▪ streaming stored video ▪…
(YouTube)
Q: your favorites?
▪ P2P file sharing
Creating a network app
application
transport
▪ permanent IP address
▪ often in data centers, for scaling
clients: local or
application application
proce socket proce controlled by
ss ss app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
Addressing processes
▪ to receive messages, process ▪ identifier includes both IP address
must have identifier and port numbers associated with
▪ host device has unique 32-bit process on host.
IP address ▪ example port numbers:
▪ Q: does IP address of host on • HTTP server: 80
which process runs suffice for • mail server: 25
identifying the process? ▪ to send HTTP message to
▪ A: no, many processes [Link] web server:
can be running on • IP address: [Link]
same host • port number: 80
▪ more shortly…
:An application-layer protocol defines
▪ types of messages exchanged, open protocols:
• e.g., request, response ▪ defined in RFCs, everyone
▪ message syntax: has access to protocol
• what fields in messages & definition
how fields are delineated ▪ allows for interoperability
▪ message semantics ▪ e.g., HTTP, SMTP
• meaning of information in proprietary protocols:
fields
▪ e.g., Skype, Zoom
▪ rules for when and how
processes send & respond to
messages
Transport
service requirements: common
apps
application data loss throughput time sensitive?
▪
Computer Networking: A
The Domain Name System: DNS Top-Down Approach (8th ed.)
J.F. Kurose, K.W. Ross
Pearson, 2020
[Link]
Web and HTTP
First, a quick review…
▪ web page consists of objects, each of which can be stored on
different Web servers
▪ object can be HTML file, JPEG image, Java applet, audio
file,…
▪ web page consists of base HTML-file which includes several
referenced objects, each addressable by a URL, e.g.,
[Link]/someDept/[Link]
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Persistent HTTP (HTTP 1.1)
Non-persistent HTTP issues: Persistent HTTP (HTTP1.1):
▪ requires 2 RTTs per object ▪ server leaves connection open after
▪ OS overhead for each TCP sending response
connection ▪ subsequent HTTP messages between
▪ browsers often open multiple same client/server sent over open
parallel TCP connections to fetch connection
referenced objects in parallel ▪ client sends requests as soon as it
encounters a referenced object
▪ as little as one RTT for all the
referenced objects (cutting response
time in half)
HTTP Versions ( HTTP/1.0)
TCP SYN
• Non-persistent connectivity.
• A separate TCP connection for each http TCP SYN-ACK
TCP SYN-ACK
TCP ACK+ HT
TP request
e
HTTP respons
HTTP Versions ( HTTP/1.1)
TCP SYN
e
HTTP respons
HTTP request message
▪ two types of HTTP messages: request, response
▪ HTTP request message:
• ASCII (human-readable format)
• Steps (Phases)
• Handshake (Entity Authentication)
• Key derivation and exchange
• Data transmission
Maintaining user/server state: cookies
Recall: HTTP , by default, is stateless protocol.
▪
Computer Networking: A
The Domain Name System: DNS Top-Down Approach (8th ed.)
J.F. Kurose, K.W. Ross
▪ P2P applications Pearson, 2020
[Link]
1.54 Mbps
access link
institutional
network
1 Gbps LAN
Option 1: buy a faster access link
Scenario: 154 Mbps
▪ access link rate: 1.54 Mbps origin
servers
public
Cost: faster access link (expensive!) Internet
154 Mbps
1.54 Mbps
access link
institutional
network
1 Gbps LAN
Option 2: install a web cache
Scenario:
▪ access link rate: 1.54 Mbps origin
▪ Setup web cache servers
public
Internet
1.54 Mbps
access link
Cost: web cache (cheap!)
institutional
network
1 Gbps LAN
in HTTP request
If-modified-since: <date>
▪ server: response contains no object HTTP request msg
If-modified-since: <date> object
if cached copy is up-to-date: modified
HTTP/1.0 304 Not Modified HTTP response after
HTTP/1.0 200 OK <date>
<data>
Application Layer COMPSCI 453 Computer Networks
Professor Jim Kurose
College of Information and Computer Sciences
▪
Computer Networking: A
The Domain Name System: DNS Top-Down Approach (8th ed.)
J.F. Kurose, K.W. Ross
▪ P2P applications Pearson, 2020
[Link]
• SMTP closure
▪ command/response interaction (like HTTP) SMTP
transfers
• commands: ASCII text
time
• response: status code and phrase
Scenario: Alice sends e-mail to Bob
1) Alice uses UA to compose e-mail 4) SMTP client sends Alice’s message
message “to” bob@[Link] over the TCP connection
2) Alice’s UA sends message to her 5) Bob’s mail server places
mail server using SMTP; message the message in Bob’s
placed in message queue mailbox
3) client side of SMTP at mail server 6) Bob invokes his user
opens TCP connection with Bob’s mail agent to read message
server
▪
Computer Networking: A
The Domain Name System: DNS Top-Down Approach (8th ed.)
J.F. Kurose, K.W. Ross
Pearson, 2020
[Link]
DNS: Domain Name System
people: many identifiers: Domain Name System (DNS):
• SSN, name, passport # ▪ distributed database implemented in
Internet hosts, routers: hierarchy of many name servers
• IP address (32 bit) - used for ▪ application-layer protocol: hosts, DNS
addressing datagrams
servers communicate to resolve
• “name”, e.g., [Link] - names (address/name translation)
used by humans
Q: how to map between IP
address and name, and vice
versa ?
DNS: services, structure
DNS services: Q: Why not centralize DNS?
▪ hostname-to-IP-address translation ▪ single point of failure
▪ traffic volume
▪ mail server aliasing
▪ distant centralized database
▪ load distribution ▪ maintenance
• replicated Web servers: many IP
addresses correspond to one A: doesn‘t scale!
name ▪ Comcast DNS servers alone:
600B DNS queries/day
▪ Akamai DNS servers alone:
2.2T DNS queries/day
Thinking about the DNS
humongous distributed database:
▪ ~ billion records, each simple
handles many trillions of queries/day:
▪ many more reads than writes
▪ performance matters: almost every
Internet transaction interacts with
DNS - msecs count!
organizationally, physically decentralized:
▪ millions of different organizations
responsible for their records
“bulletproof”: reliability, security
DNS: a distributed, hierarchical database
Root DNS Servers Root
… …
.com DNS servers .org DNS servers .edu DNS servers Top Level Domain
… … … …
[Link] [Link] [Link] [Link] [Link]
DNS servers DNS servers DNS servers DNS servers DNS servers Authoritative