06 sp24 ApplicationLayer
06 sp24 ApplicationLayer
Computer Networking
Section A
Ashutosh Dhekne ([email protected])
School of Computer Science
Spring 2024
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-11
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-12
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-13
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
* Check out the online interactive exercises for more examples: h ttp://gaia.cs.umass.edu/kurose_ross/interactive/
Transport Layer: 3-16
HTTP response status codes
status code appears in 1st line in server-to-client response message.
some 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 (in s ed
y u
Location: field) l
a re
r y
400 Bad Request ve
r
r e
• request msg not understood by server e a
o s
th
404 Not Found b u t
r e,
• requested document not found on this server o
r em
505 HTTP Version Not Supported e r e a
Th
Trying out HTTP (client side) for yourself
1. netcat to your favorite Web server:
opens TCP connection to port 80 (default HTTP server
% nc -c -v gaia.cs.umass.edu 80
port) at gaia.cs.umass. edu.
anything typed in will be sent to port 80 at
gaia.cs.umass.edu
2. type in a GET HTTP request:
GET /kurose_ross/interactive/index.php HTTP/1.1
Host: gaia.cs.umass.edu by typing this in (hit carriage return twice), you send
this minimal (but complete) GET request to HTTP
server
O1
O2
O1
O2 O3
O3
O4
O4
objects delivered in order requested: O2, O3, O4 wait behind O1 Transport Layer: 3-21
HTTP/2: mitigating HOL blocking
HTTP/2: objects divided into frames, frame transmission interleaved
server
O2
O3
O1 O4
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
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