0% found this document useful (0 votes)
13 views

05 sp24 ApplicationLayer

The document discusses the application layer of computer networking, including network applications, the client-server and peer-to-peer paradigms, processes communicating, common protocols like HTTP and TCP, sockets, addressing processes, and application layer protocols.

Uploaded by

n yoga venky
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

05 sp24 ApplicationLayer

The document discusses the application layer of computer networking, including network applications, the client-server and peer-to-peer paradigms, processes communicating, common protocols like HTTP and TCP, sockets, addressing processes, and application layer protocols.

Uploaded by

n yoga venky
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

CS 3251

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

Application Layer: 2-2


Some network apps

Application Layer: 2-3


Creating a network app
application

write programs that:


transport
network
mobile network
data link
physical
 run on (different) end systems national or global ISP

 communicate over network


 e.g., web server software
communicates with browser software
local or
no need to write software for regional ISP

network-core devices home network content


application
provider
 network-core devices do not run user transport
network network datacenter
applications
application
data link network
transport
physical network

 applications on end systems allows data link


physical

for rapid app development, enterprise


propagation network

Application Layer: 2-4


Client-server paradigm
server: mobile network
 always-on host national or global ISP

 permanent IP address
 often in data centers, for scaling
clients: local or
 contact, communicate with server regional ISP

 may be intermittently connected home network content


provider
 may have dynamic IP addresses network datacenter
network

 do not communicate directly with


each other
enterprise
 examples: HTTP, IMAP, FTP network

Application Layer: 2-5


Peer-peer architecture
 no always-on server mobile network
 arbitrary end systems directly national or global 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

and change IP addresses


• complex management enterprise
network
 example: P2P file sharing
Application Layer: 2-6
Processes communicating
process: program running clients, servers
within a host client process: process that
initiates communication
 within same host, two server process: process
processes communicate that waits to be contacted
using inter-process
communication (defined by
OS)  note: applications with
P2P architectures have
 processes in different hosts client processes &
communicate by exchanging server processes
messages
Application Layer: 2-7
Layer by Layer: Common Protocols

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

Urls: Uniform resource locators


application
HTTP: Hyper Text Transfer Protocol

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 Layer: 2-10


Sockets

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

Application Layer: 2-15


Web and HTTP
 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.,

www.someschool.edu/someDept/pic.gif

host name path name


HTTP overview
HTTP: hypertext transfer protocol
 Web’s application-layer protocol HT
 client/server model: PC running
TP
req
ues
HT t
• client: browser that requests, Firefox browser TP
res
pon
receives, (using HTTP protocol) and se

“displays” Web objects ues


t
req
• server: Web server sends (using HTTP
p o ns
e server running
es Apache Web
HTTP protocol) objects in response HTTP
r
server
to requests
iPhone running
Safari browser

Transport Layer: 3-17


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

Transport Layer: 3-18


HTTP connections: two types
Non-persistent HTTP Persistent HTTP
1. TCP connection opened  TCP connection opened to
2. at most one object sent a server
over TCP connection  multiple objects can be
3. TCP connection closed sent over single TCP
connection between client,
downloading multiple and that server
objects required multiple  TCP connection closed
connections

Transport Layer: 3-19


Non-persistent HTTP: example
User enters URL: www.someSchool.edu/someDepartment/home.index
(containing text, references to 10 jpeg images)

1a. HTTP client initiates TCP


connection to HTTP server 1b. HTTP server at host
(process) at www.someSchool.edu on www.someSchool.edu waiting for TCP
port 80 connection at port 80 “accepts”
connection, notifying client
2. HTTP client sends HTTP
request message (containing
URL) into TCP connection 3. HTTP server receives request message,
socket. Message indicates forms response message containing
time that client wants object requested object, and sends message
someDepartment/home.index into its socket
Transport Layer: 3-20
Non-persistent HTTP: example (cont.)
User enters URL: www.someSchool.edu/someDepartment/home.index
(containing text, references to 10 jpeg images)

4. HTTP server closes TCP


5. HTTP client receives response connection.
message containing html file,
displays html. Parsing html file,
finds 10 referenced jpeg objects

6. Steps 1-5 repeated for


each of 10 jpeg objects
time

Transport Layer: 3-21


Non-persistent HTTP: response time

RTT (definition): time for a small


packet to travel from client to initiate TCP
server and back connection
RTT
HTTP response time (per object):
 one RTT to initiate TCP connection request file
 one RTT for HTTP request and first few RTT time to
transmit
bytes of HTTP response to return file
file received
 object/file transmission time

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

header field name value cr lf


cr lf

~
~ entity body ~
~ body

Transport Layer: 3-25


Other HTTP request messages
POST method: HEAD method:
 web page often includes form  requests headers (only) that
input would be returned if specified URL
 user input sent from client to were requested with an HTTP
server in entity body of HTTP GET method.
POST request message
PUT method:
 uploads new file (object) to server
GET method (for sending data to server):  completely replaces file that exists
 include user data in URL field of HTTP at specified URL with content in
GET request message (following a ‘?’): entity body of POST HTTP request
www.somesite.com/animalsearch?monkeys&banana
message

Transport Layer: 3-26


Stopped Here on Jan 23

You might also like