CNDC Lecture 08 Application Layer
CNDC Lecture 08 Application Layer
Communication
Course Instructor:
Ms. Mehr un Nisa
Application Layer: outline
1 principles of network 6 socket programming
applications with UDP and TCP
app architectures
app requirements
2 Web and HTTP
3 FTP
4 electronic mail
SMTP, POP3, IMAP
5 DNS
Application layer
our goals: learn about protocols by
conceptual, examining popular
implementation aspects application-level
of network application protocols
protocols HTTP
transport-layer FTP
service models SMTP / POP3 / IMAP
client-server DNS
paradigm creating network
peer-to-peer applications
paradigm socket API
Some network apps
e-mail voice over IP (e.g., Skype)
web real-time video
text messaging conferencing
remote login social networking
P2P file sharing search
multi-user network games …
streaming stored video …
(YouTube, Hulu, Netflix)
Creating a network app application
transport
network
data link
application application
socket controlled by
process process app developer
transport transport
network network controlled
link
by OS
link Internet
physical physical
Addressing processes
to receive messages, process identifier includes both IP
must have identifier address and port numbers
host device has unique 32- associated with process on
bit IP address host.
Q: does IP address of host example port numbers:
on which process runs HTTP server: 80
suffice for identifying the mail server: 25
process? to send HTTP message to
A: no, many processes gaia.cs.umass.edu web
can be running on same server:
host IP address: 128.119.245.12
port number: 80
more shortly…
App-layer protocol defines
types of messages open protocols:
exchanged, defined in RFCs
e.g., request, response allows for interoperability
message syntax: e.g., HTTP, SMTP
what fields in messages proprietary protocols:
& how fields are e.g., Skype
delineated
message semantics
meaning of information
in fields
rules for when and how
processes send & respond
to messages
What transport service does an app need?
data integrity throughput
some apps (e.g., file transfer, some apps (e.g.,
web transactions) require multimedia) require
100% reliable data transfer minimum amount of
other apps (e.g., audio) can throughput to be “ effective
tolerate some loss ”
other apps (“ elastic apps” )
application underlying
application layer protocol transport protocol
time
6. Steps 1-5 repeated for each of 10
jpeg objects
Non-persistent HTTP: response time
RTT (definition): time for a small
packet to travel from client to
server and back
HTTP response time: initiate TCP
one RTT to initiate TCP connection
connection RTT
one RTT for HTTP request request
and first few bytes of HTTP file
time to
response to return RTT transmit
file transmission time file
file
non-persistent HTTP response received
time =
2RTT+ file transmission time time
time
Persistent HTTP
~
~ entity body ~
~ body
Uploading form input
POST method:
web page often includes
form input
input is uploaded to server
in entity body
URL method:
uses GET method
input is uploaded in URL
field of request line:
www.somesite.com/animalsearch?monkeys&banana
Method types
HTTP/1.0: HTTP/1.1:
GET GET, POST, HEAD
POST PUT
HEAD uploads file in entity
asks server to leave body to path specified
requested object out of in URL field
response DELETE
deletes file specified in
the URL field
HTTP response message
status line
(protocol
status code HTTP/1.1 200 OK\r\n
status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n
Server: Apache/2.0.52 (CentOS)\r\n
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMT\r\n
header ETag: "17dc6-a5c-bf716880"\r\n
Accept-Ranges: bytes\r\n
lines Content-Length: 2652\r\n
Keep-Alive: timeout=10, max=100\r\n
Connection: Keep-Alive\r\n
Content-Type: text/html; charset=ISO-8859-1\
r\n
\r\n
data, e.g., data data data data data ...
requested
HTML file
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 msg
301 Moved Permanently
requested object moved, new location specified later in this msg
(Location:)
400 Bad Request
request msg not understood by server
404 Not Found
requested document not found on this server
505 HTTP Version Not Supported
Q/A