05 sp24 ApplicationLayer
05 sp24 ApplicationLayer
Computer Networking
Section A
Ashutosh Dhekne ([email protected])
School of Computer Science
Spring 2024
Application layer: overview
Principles of network P2P applications
applications video streaming and
Web and HTTP content distribution
The Domain Name System networks
DNS socket programming with
UDP and TCP
permanent IP address
often in data centers, for scaling
clients: local or
contact, communicate with server regional ISP
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, as well as new service home network content
demands provider
network datacenter
peers are intermittently connected network
application
HTTP: Hyper Text Transfer Protocol
transport
TCP: Transmission Control Protocol
network UDP: User Datagram Protocol
link IP: Internet Protocol
physical
Ethernet
Layer by Layer: Common Protocols
transport
TCP: Transmission Control Protocol
Port Numbers (16 bits)
network UDP: User Datagram Protocol
link IP: Internet Protocol IP Address (32 bits)
physical
Ethernet MAC Address (48 bits)
Sockets
process sends/receives messages to/from its socket
socket analogous to a mailbox
• sending process shoves message into the mailbox for delivery
• sending process relies on transport infrastructure on other side of
mailbox to deliver message to socket (mailboxes) at receiving process
• two sockets involved: one on each side
application application
socket controlled by
process process app developer
transport transport
network network controlled
link
by OS
link Internet
physical physical
application
process
transport
network
Operating System
link
physical
Sockets
application
process process process process process
transport
network
Operating System
link
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 gaia.cs.umass.edu web server:
can be running on • IP address: 128.119.245.12
same host • port number: 80
more shortly…
Application Layer: 2-13
An application-layer
Hey, Can you please protocol defines:
send me your new
products catalog?
types of messages exchanged, open protocols:
• e.g., request, response defined in RFCs, everyone
Sure! Here ithas
is: access to protocol
message syntax:
• 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
Application Layer: 2-14
Application layer: overview
P2P applications
Principles of network video streaming and
applications content distribution
Web and HTTP networks
The Domain Name System socket programming with
DNS UDP and TCP
www.someschool.edu/someDept/pic.gif
time time
Non-persistent HTTP response time = 2RTT+ file transmission time
Application Layer: 3-22
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
browsers often open multiple between same client/server sent
parallel TCP connections to over open connection
fetch referenced objects in client sends requests as soon as it
parallel encounters a referenced object
as little as one RTT for all the
referenced objects (cutting
response time in half)
Application Layer: 2-23
HTTP request message
two types of HTTP messages: request, response
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: Mozilla/5.0 (Macintosh; Intel Mac OS X
10.15; rv:80.0) Gecko/20100101 Firefox/80.0 \r\n
header Accept: text/html,application/xhtml+xml\r\n
lines Accept-Language: en-us,en;q=0.5\r\n
Accept-Encoding: gzip,deflate\r\n
Connection: keep-alive\r\n
\r\n
carriage return, line feed
at start of line indicates
end of header lines * Check out the online interactive exercises for more
examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Transport Layer: 3-24
HTTP request message: general format
method sp URL sp version cr lf request
line
header field name value cr lf
header
~
~ ~
~ lines
~
~ entity body ~
~ body