SlideShare a Scribd company logo
Module-V
Application
Layer
Application Layer 2-2
Outline
❑ Principles of Network Applications
❑ The Web and HTTP
❑ Electronic mail in the Internet
o SMTP, POP3, IMAP
❑ DNS-The Internet Directory
• Text book 2: Computer Networking: A Top down Approach-
James F Kurose 7th Edition
Principles of Network Applications
➢Network-applications are the driving forces for
the explosive development of the internet.
➢Examples:
Creating a network app
Write Programs That:
• run on (different) end systems
• communicate over network
• e.g., web server software
communicates with browser
software.
Possible Structure of Applications:
• client-server
• peer-to-peer (P2P)
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
Client-Server Architecture
Server:
➢ always-on host
➢ permanent IP address
➢ data centers for scaling
Clients:
➢ Randomly on
➢ communicate with server
➢ may be intermittently
connected
➢ do not communicate directly
with each other.
➢ Examples: FTP, Web, e-mail
client/server
Data Center
➢ A data-center is used to create a powerful virtual server.
➢ In date center, hundreds of servers must be powered and
maintained.
➢ example: Google has around 50 data-centers distributed around the world.
These 50 data-centers handle : search, YouTube, Gmail etc.
P2P architecture
➢ No dedicated server
➢ Pairs of hosts are called peers.
➢ The peers communicate directly with
each other.
➢ The peers are not owned by the service-
provider, instead these are laptops
controlled by users.
➢ Ex file sharing (BitTorrent), Internet
telephone (Skype)
➢ self-scalability ,Cost effective
➢ Challenges: ISP friendly : P2P traffic
does not conform to traditional ISP
traffic policies.
➢ Security: Openness & distribution
➢ Incentives: convincing users to volunteer
bandwidth & resources to the
applications.
peer-peer
Processes Communicating
Process: program running within
a host.
• within same host, two
processes communicate using
IPC (defined by OS).
• processes in different hosts
communicate by exchanging
messages.
Client process: process that
initiates communication
Server process: process that
waits to be contacted
Application Layer 2-9
App-layer protocol defines
• types of messages exchanged,
– e.g., request, response
• message syntax:
– what fields in messages &
how fields are delineated
• message semantics
– meaning of information in
fields
• rules for when and how
processes send & respond to
messages
open protocols:
• defined in RFCs
• allows for interoperability
• e.g., HTTP, SMTP
proprietary protocols:
• e.g., Skype
Transport Services Available to Applications
1. Reliable Data Transfer
some apps (e.g., file transfer,
web transactions) require
100% reliable data transfer
• other apps (e.g., audio) can
tolerate some loss
3. Timing
• some apps (e.g., Internet
telephony, interactive
games) require low delay to
be “effective”
2.Throughput
❖ BW sensitive app:
Guaranteed throughput
(e.g., multimedia)
❖ Elastic app: May not need
guarantee throughput file
transfer, email
4. Security
❖ encryption, data integrity,
…
Computer networks module 5 content covered in this ppt
2-12
Internet Transport Protocols Services
TCP service:
• reliable transport between
sending and receiving process
• flow control: sender won’t
overwhelm receiver
• congestion control: throttle
sender when network
overloaded
• connection-oriented: setup
required between client and
server processes
UDP service:
• unreliable data transfer
between sending and
receiving process
• does not provide: reliability,
flow control, congestion
control, timing, throughput
guarantee, security, or
connection setup,
Web and HTTP
➢web page consists of objects(HTML)
➢object is a file - HTML file, JPEG image, audio file,…
➢web page consists of HTML-file & several
referenced objects.
➢object is addressable by a URL,
www.someschool.edu/someDept/pic.gif
host name path name
HTTP overview
HTTP: hypertext transfer
protocol( port 80)
• client/server model
– client: browser that
requests, receives, and
“displays” Web objects
– server: Web server sends
objects in response to
requests
PC running
Firefox browser
server
running
Apache Web
server
iphone running
Safari browser
2-15
HTTP overview (continued)
uses TCP:
• client initiates TCP
connection (creates socket)
to server, port 80
• server accepts TCP
connection from client
• HTTP messages exchanged
between browser (HTTP
client) and Web server (HTTP
server)
• TCP connection closed
HTTP is “stateless”
• server maintains no
information about
past client requests
HTTP connections
non-persistent HTTP
• at most one object sent
over TCP connection
– connection then
closed
• downloading multiple
objects required
multiple connections
persistent HTTP(default)
• multiple objects can be
sent over single TCP
connection between
client, server
Non-persistent HTTP: 1Req->1Resp
suppose user enters URL:
1a. HTTP client initiates TCP
connection to HTTP server
(process) at
www.someSchool.edu on port
80
2. HTTP client sends HTTP request
message (containing URL) intoTCP
connection socket. Message
indicates that client wants object
someDepartment/home.index
1b. HTTP server at host
www.someSchool.edu waiting for
TCP connection at port 80.
“accepts” connection, notifying
client
3. HTTP server receives request message,
forms response message containing
requested object, and sends message
into its socket
time
(contains text,
references to 10
jpeg images)
www.someSchool.edu/someDepartment/home.index
Non-persistent HTTP (cont.)
5. HTTP client receives response
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
4. HTTP server closesTCP connection.
time
Non-persistent HTTP: response time
RTT: Time for a small packet to
travel from client to server and
back
HTTP response time:
• one RTT: To initiate TCP
connection
• one RTT: HTTP request and
first few bytes of HTTP
response to return
• file transmission time
• non-persistent HTTP response
time =
2RTT+ file transmission
time
time to
transmit
file
initiate TCP
connection
RTT
request
file
RTT
file
received
time time
2-20
Persistent HTTP
non-persistent HTTP
issues:
• requires 2 RTTs per object
• OS overhead for each TCP
connection
• browsers often open
parallel TCP connections to
fetch referenced objects
persistent HTTP:
• server leaves connection
open after sending response
• subsequent HTTP messages
between same client/server
sent over open connection
• client sends requests as soon
as it encounters a referenced
object
• as little as one RTT for all the
referenced objects
HTTP message: general format
Two types of HTTP messages: request, response
HTTP request message
GET: Browser requests an object from the server.
POST: User fills out a form & sends to the server.
PUT: Upload objects to servers. DELETE: Allows application to delete object on a
server.
request line
(GET, POST,
,PUT,DELETE)
header
lines
carriage return,
line feed at start
of line indicates
end of header lines
GET /index.html HTTP/1.1rn
Host: www-net.cs.umass.edurn→ obj residing
User-Agent: Firefox/3.6.10rn →browser
Accept: text/html,application/xhtml+xmlrn
Accept-Language: en-us,en;q=0.5rn
Accept-Encoding: gzip,deflatern
Accept-Charset: ISO-8859-1,utf-8;q=0.7rn
Keep-Alive: 115rn
Connection: keep-alivern
rn
carriage return character
line-feed character
HTTP Response Message
Application Layer 2-24
HTTP response message
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
HTTP/1.1 200 OKrn
Date: Sun, 26 Sep 2010 20:09:20 GMTrn
Server: Apache/2.0.52 (CentOS)rn
Last-Modified: Tue, 30 Oct 2007 17:00:02 GMTrn
Accept-Ranges: bytesrn
Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-1rn
rn
data data data data data ...
User-server Interaction: cookies
Websites to keep track of user
Small text file created by website,
stored in user
computer(temporarily/perman
ent)
four components:
1) cookie header line of HTTP
response message
2) cookie header line in next
HTTP request message
3) cookie file kept on user’s
host, managed by user’s
browser
4) back-end DB at Web site
example:
• Susan always access Internet
from PC
• visits specific e-commerce
site for first time
• when initial HTTP requests
arrives at site, site creates:
– unique ID
– entry in backend DB for ID
Cookies: keeping “state” (cont.)
Client
Host
Server
Host
usual http response msg
usual http response msg
cookie file
one week later:
usual http request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734
usual http request msg Amazon server
creates ID
1678 for user create
entry
usual http response
Header set-cookie: 1678
ebay 8734
amazon 1678
usual http request msg
cookie: 1678 cookie-
specific
action
access
ebay 8734
amazon 1678
backend
database
Browser
tores ID into
cookie file
Browser put
ID in http
request
Web caching (Proxy Server)
• user sets browser: Web
accesses via cache
• browser sends all HTTP
requests to cache
– object in cache: cache
returns object
– else cache requests object
from origin server, then
returns object to client
– Advantages
1) To reduce response-time
for client-request.
2) To reduce traffic on an
institution’s access-link to
the Internet.
3) To reduce Web-traffic in
the Internet.
Goal: satisfy client request without involving origin server
client
Web Cache/
proxy
server
client origin
server
origin
server
The Conditional GET
• It is a mechanism that allows
a cache to verify that the
objects are up to date.
• cache: specify date of cached
copy in HTTP request
If-modified-since:
<date>
• server: response contains no
object if cached copy is up-
to-date:
HTTP/1.0 304 Not
Modified
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0
304 Not Modified
object
not
modified
before
<date>
HTTP request msg
If-modified-since: <date>
HTTP response
HTTP/1.0 200 OK
<data>
object
modified
after
<date>
client server
The Conditional GET
❖It is a mechanism that allows a cache to verify that the
objects are up to date.
❖An HTTP request-message is called conditional GET if
1) Request-message uses the GET method and
2) Response-message includes an If-Modified-Since:
header-line.
File Transfer: FTP
• Used by local host to transfer files to or from a remote-host over
the network.
• FTP uses client-server architecture
• FTP uses 2 parallel TCP connections
1) Control Connection : User ID, password ,commands to change
directory , put & get files.
2) Data Connection: To transfer files.
FTP commands & replies: USER,PASS,LIST(all files), RETR, STOR
FTP commands, responses
sample commands:
• USER username
• PASS password
• LIST return list of file in
current directory
• RETR filename
retrieves (gets) file
• STOR filename stores
(puts) file onto remote host
sample return codes
• 331 Username OK,
password required
• 125 data connection
already open;
transfer starting
• 425 Can’t open data
connection
• 452 Error writing
file
Electronic mail
Three major components:
• User agents(UA)
• Mail servers(MS)
• Simple mail transfer protocol:
SMTP
User Agent
• Read, reply, forward save
compose messages
• e.g., Outlook, Thunderbird,
iPhone mail client
user mailbox
outgoing
message queue
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
2-33
Electronic mail: mail servers
Mail servers:
• mailbox contains incoming
messages for user
• message queue of outgoing
(to be sent) mail messages
SMTP protocol:
• Between mail servers to send
email messages , TCP , port -
25
mail
server
mail
server
mail
server
SMTP
SMTP
SMTP
user
agent
user
agent
user
agent
user
agent
user
agent
user
agent
user mailbox
outgoing
Message Q
user
agent
Scenario: Alice sends message to Bob
1) Alice uses UA to compose
message “to”
bob@someschool.edu
2) Alice’s UA sends message to her
mail server; message placed in
message queue
3) client side of SMTP opens TCP
connection with Bob’s mail
server
4) SMTP client sends Alice’s
message over the TCP connection
5) Bob’s mail server places the
message in Bob’s mailbox
6) Bob invokes his UA to read
message
mail
server
mail
server
1
2 3 4
5
6
Alice’s mail server Bob’s mail server
user
agent
SMTP
Mail Message Format
SMTP: protocol for exchanging
email msgs
standard for text message
format:
• header lines, e.g.,
– To:
– From:
– Subject:
• Body: the “message”
– ASCII characters only
header
body
blank
line
Mail Access Protocols
• SMTP: delivery/storage to receiver’s server
• Mail access protocol: retrieval from server
– POP: Post Office Protocol : authorization, download
– IMAP: Internet Mail Access Protocol : manipulation of stored msgs
on server, allows user to organize messages in folders
– HTTP: gmail, Hotmail, Yahoo! Mail, etc.
sender’s mail
server
SMTP SMTP
mail access
protocol
receiver’s mail
server
(e.g., POP,
IMAP)
user
agent
user
agent
POP3 protocol-port 110
1. Authorization phase
• client commands:
– user: username
– pass: password
• server responses
– +OK
– -ERR
2. Transaction phase, client:
• list: list message numbers
• retr: retrieve message by
number
• dele: delete
• Quit
3. Update
C: list
S: 1 498
S: 2 912
S: .
C: retr 1
S: <message 1 contents>
S: .
C: dele 1
C: retr 2
S: <message 1 contents>
S: .
C: dele 2
C: quit
S: +OK POP3 server signing off
S: +OK POP3 server ready
C: user bob
S: +OK
C: pass hungry
S: +OK user successfully logged on
DNS -The Internet’s Directory Service(port-53)
➢ Translates domain names → IP addresses.
➢ ex: domain-name(Host name) “www.google.com” →IP address
“198.105.232.4”.
➢ Because domain-names are alphabetic, easier to
remember for human being.
DNS provides following services
1) Host Aliasing : A host with a complicated hostname can
have one or more alias names.
2) Mail Server Aliasing: For obvious reasons, it is highly desirable that
e-mail addresses be mnemonic.
3) Load Distribution : It perform load distribution among replicated
servers.
Overview of How DNS Works
Distributed database design is more preferred over
centralized :
1) A Single Point of Failure : If the DNS server crashes then the
entire Internet will not stop.
2) Traffic Volume : A Single DNS Server cannot handle the huge
global DNS traffic.
3) Distant Centralized DB: A single DNS server cannot be
“close to” all the querying clients.
➢ If we put the single DNS server in Mysore, then all queries from USA must
travel to the other side of the globe, leads delay.
4) Maintenance: The single DNS server would have to keep
records for all Internet hosts.
Root DNS Servers
com DNS servers org DNS servers edu DNS servers
poly.edu
DNS servers
umass.edu
DNS servers
yahoo.com
DNS servers
amazon.com
DNS servers
pbs.org
DNS servers
DNS: a distributed, hierarchical database
client wants IP for www.amazon.com:
• client queries root server to find com DNS server
• client queries .com DNS server to get amazon.com DNS server
• client queries amazon.com DNS server to get IP address for
www.amazon.com
… …
Authoritative
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
3
4
5
6
authoritative DNS server
dns.cs.umass.edu
7
8
TLD DNS server
DNS name
resolution example
• host at cis.poly.edu wants
IP address for
gaia.cs.umass.edu
iterative query:
❖ contacted server
replies with name of
server to contact
❖ “I don’t know this
name, but ask this
server”
4
5
6
3
recursive query:
❖ puts burden of name
resolution on
contacted name server
❖ heavy load at upper
levels of hierarchy?
requesting host
cis.poly.edu
gaia.cs.umass.edu
root DNS server
local DNS server
dns.poly.edu
1
2
7
authoritative DNS server
dns.cs.umass.edu
8
DNS name
resolution example
TLD DNS
server
DNS Record:
Instructions in authoritative DNS servers, provide info( Domain+ IP address )
DNS: distributed database storing resource records (RR)
type=NS(Name Server)
– name is domain
– value is hostname of
authoritative name server for
this domain
RR format: (name, value, type, ttl)
type=A(Address)
▪ name is hostname
▪ value is IP address
type=CNAME
▪ name is alias name for some “canonical”
(the real) name
▪ value is canonical name
type=MX(mail exchange)
▪ value is name of mailserver
associated with name
when a resource
should be removed
from a cache
DNS : Messages
• Query(Request) and reply messages, both with same message format
msg header
❖ identification: 16 bit # for query,
reply to query uses same #
❖ flags:
▪ 1.query(0) or reply(1)
▪ 2. Authoritative: set in
reply msg when DNS is
authoritative server
▪ 3. Recursion Desired: Set
when client desires DNS
performs recursion
identification flags
# questions
questions (variable # of questions)
# additional RRs
# authority RRs
# answer RRs
answers (variable # of RRs)
authority (variable # of RRs)
additional info (variable # of RRs)
2 bytes 2 bytes
Header
Section
(12bytes
Question
Section
Info about query: name, type fields
for a query
RRs in response
to query
records for
authoritative servers
additional “helpful”
info that may be used
identification flags
# questions
questions (variable # of questions)
# additional RRs
# authority RRs
# answer RRs
answers (variable # of RRs)
authority (variable # of RRs)
additional info (variable # of RRs)
DNS Protocol, Messages
2 bytes 2 bytes
domain-name
question being
asked about the
domain-name

More Related Content

PPTX
Unit-3_application layer of osi model.pptx
PPTX
Unit-3_application layer .pptx
PDF
Presentation on Application layer_201.pdf
PPT
Appl layer
PDF
02 - Asassssssspplication Layer (HTTP).pdf
PDF
Application layer
PPT
Ch2 application layer Network
PPT
applayerslides.ppt
Unit-3_application layer of osi model.pptx
Unit-3_application layer .pptx
Presentation on Application layer_201.pdf
Appl layer
02 - Asassssssspplication Layer (HTTP).pdf
Application layer
Ch2 application layer Network
applayerslides.ppt

Similar to Computer networks module 5 content covered in this ppt (20)

PDF
Computer Network notes Application Layer.pdf
PPT
Application Layer.pptand documents of co
PPTX
Module 1
PPTX
Module 1-Application Layer
PPTX
02_Chapter_2_V6_LV.pptx
PDF
2. application layer
PPTX
Chapter_2 jaringan komputer informatika.pptx
PPTX
Net_Chapter_2_ computer network-software.pptx
PPT
Chapter2 l2 modified_um
PDF
Computer Networks Module 1-part 1.pdf
PDF
Lec 6(Application Layer)
PPTX
Module 5 Application and presentation Layer .pptx
PPTX
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
PPTX
Computer Network presentation chapter two
PDF
Chapter2 application layer
PPTX
Chapter_2_v8.1.pptx
PPTX
Chapter_2 Computer Networks Basics....pptx
PPTX
application of http.pptx
PDF
Application Layer Application Layer Application Layer
PPTX
Computer network network edge and network
Computer Network notes Application Layer.pdf
Application Layer.pptand documents of co
Module 1
Module 1-Application Layer
02_Chapter_2_V6_LV.pptx
2. application layer
Chapter_2 jaringan komputer informatika.pptx
Net_Chapter_2_ computer network-software.pptx
Chapter2 l2 modified_um
Computer Networks Module 1-part 1.pdf
Lec 6(Application Layer)
Module 5 Application and presentation Layer .pptx
kkkkkkkkkkkkkkkkkkkmkm,kll;kl;l;l;l;lll;l;l;;;
Computer Network presentation chapter two
Chapter2 application layer
Chapter_2_v8.1.pptx
Chapter_2 Computer Networks Basics....pptx
application of http.pptx
Application Layer Application Layer Application Layer
Computer network network edge and network
Ad

More from vinuthak18 (8)

PPTX
PPT_ Module_2_suruchi presentation notes
PPTX
data science module-3 power point presentation
PPTX
Data science and visualization power point
PPTX
COMPARISION PLOTS power point presentation
PDF
COMPARISION PLOTS topicof data visualization
PDF
Data science and visualization MODULE 3 FG&FS
PPTX
Computer networks presentation of module 1
PDF
digital design and algorithm module 1 ppt
PPT_ Module_2_suruchi presentation notes
data science module-3 power point presentation
Data science and visualization power point
COMPARISION PLOTS power point presentation
COMPARISION PLOTS topicof data visualization
Data science and visualization MODULE 3 FG&FS
Computer networks presentation of module 1
digital design and algorithm module 1 ppt
Ad

Recently uploaded (20)

PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Types and Its function , kingdom of life
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
O7-L3 Supply Chain Operations - ICLT Program
TR - Agricultural Crops Production NC III.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Types and Its function , kingdom of life
Renaissance Architecture: A Journey from Faith to Humanism
STATICS OF THE RIGID BODIES Hibbelers.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
PPH.pptx obstetrics and gynecology in nursing

Computer networks module 5 content covered in this ppt

  • 2. Application Layer 2-2 Outline ❑ Principles of Network Applications ❑ The Web and HTTP ❑ Electronic mail in the Internet o SMTP, POP3, IMAP ❑ DNS-The Internet Directory • Text book 2: Computer Networking: A Top down Approach- James F Kurose 7th Edition
  • 3. Principles of Network Applications ➢Network-applications are the driving forces for the explosive development of the internet. ➢Examples:
  • 4. Creating a network app Write Programs That: • run on (different) end systems • communicate over network • e.g., web server software communicates with browser software. Possible Structure of Applications: • client-server • peer-to-peer (P2P) application transport network data link physical application transport network data link physical application transport network data link physical
  • 5. Client-Server Architecture Server: ➢ always-on host ➢ permanent IP address ➢ data centers for scaling Clients: ➢ Randomly on ➢ communicate with server ➢ may be intermittently connected ➢ do not communicate directly with each other. ➢ Examples: FTP, Web, e-mail client/server
  • 6. Data Center ➢ A data-center is used to create a powerful virtual server. ➢ In date center, hundreds of servers must be powered and maintained. ➢ example: Google has around 50 data-centers distributed around the world. These 50 data-centers handle : search, YouTube, Gmail etc.
  • 7. P2P architecture ➢ No dedicated server ➢ Pairs of hosts are called peers. ➢ The peers communicate directly with each other. ➢ The peers are not owned by the service- provider, instead these are laptops controlled by users. ➢ Ex file sharing (BitTorrent), Internet telephone (Skype) ➢ self-scalability ,Cost effective ➢ Challenges: ISP friendly : P2P traffic does not conform to traditional ISP traffic policies. ➢ Security: Openness & distribution ➢ Incentives: convincing users to volunteer bandwidth & resources to the applications. peer-peer
  • 8. Processes Communicating Process: program running within a host. • within same host, two processes communicate using IPC (defined by OS). • processes in different hosts communicate by exchanging messages. Client process: process that initiates communication Server process: process that waits to be contacted
  • 9. Application Layer 2-9 App-layer protocol defines • types of messages exchanged, – e.g., request, response • message syntax: – what fields in messages & how fields are delineated • message semantics – meaning of information in fields • rules for when and how processes send & respond to messages open protocols: • defined in RFCs • allows for interoperability • e.g., HTTP, SMTP proprietary protocols: • e.g., Skype
  • 10. Transport Services Available to Applications 1. Reliable Data Transfer some apps (e.g., file transfer, web transactions) require 100% reliable data transfer • other apps (e.g., audio) can tolerate some loss 3. Timing • some apps (e.g., Internet telephony, interactive games) require low delay to be “effective” 2.Throughput ❖ BW sensitive app: Guaranteed throughput (e.g., multimedia) ❖ Elastic app: May not need guarantee throughput file transfer, email 4. Security ❖ encryption, data integrity, …
  • 12. 2-12 Internet Transport Protocols Services TCP service: • reliable transport between sending and receiving process • flow control: sender won’t overwhelm receiver • congestion control: throttle sender when network overloaded • connection-oriented: setup required between client and server processes UDP service: • unreliable data transfer between sending and receiving process • does not provide: reliability, flow control, congestion control, timing, throughput guarantee, security, or connection setup,
  • 13. Web and HTTP ➢web page consists of objects(HTML) ➢object is a file - HTML file, JPEG image, audio file,… ➢web page consists of HTML-file & several referenced objects. ➢object is addressable by a URL, www.someschool.edu/someDept/pic.gif host name path name
  • 14. HTTP overview HTTP: hypertext transfer protocol( port 80) • client/server model – client: browser that requests, receives, and “displays” Web objects – server: Web server sends objects in response to requests PC running Firefox browser server running Apache Web server iphone running Safari browser
  • 15. 2-15 HTTP overview (continued) uses TCP: • client initiates TCP connection (creates socket) to server, port 80 • server accepts TCP connection from client • HTTP messages exchanged between browser (HTTP client) and Web server (HTTP server) • TCP connection closed HTTP is “stateless” • server maintains no information about past client requests
  • 16. HTTP connections non-persistent HTTP • at most one object sent over TCP connection – connection then closed • downloading multiple objects required multiple connections persistent HTTP(default) • multiple objects can be sent over single TCP connection between client, server
  • 17. Non-persistent HTTP: 1Req->1Resp suppose user enters URL: 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 2. HTTP client sends HTTP request message (containing URL) intoTCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time (contains text, references to 10 jpeg images) www.someSchool.edu/someDepartment/home.index
  • 18. Non-persistent HTTP (cont.) 5. HTTP client receives response 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 4. HTTP server closesTCP connection. time
  • 19. Non-persistent HTTP: response time RTT: Time for a small packet to travel from client to server and back HTTP response time: • one RTT: To initiate TCP connection • one RTT: HTTP request and first few bytes of HTTP response to return • file transmission time • non-persistent HTTP response time = 2RTT+ file transmission time time to transmit file initiate TCP connection RTT request file RTT file received time time
  • 20. 2-20 Persistent HTTP non-persistent HTTP issues: • requires 2 RTTs per object • OS overhead for each TCP connection • browsers often open parallel TCP connections to fetch referenced objects persistent HTTP: • server leaves connection open after sending response • subsequent HTTP messages between same client/server sent over open connection • client sends requests as soon as it encounters a referenced object • as little as one RTT for all the referenced objects
  • 21. HTTP message: general format Two types of HTTP messages: request, response
  • 22. HTTP request message GET: Browser requests an object from the server. POST: User fills out a form & sends to the server. PUT: Upload objects to servers. DELETE: Allows application to delete object on a server. request line (GET, POST, ,PUT,DELETE) header lines carriage return, line feed at start of line indicates end of header lines GET /index.html HTTP/1.1rn Host: www-net.cs.umass.edurn→ obj residing User-Agent: Firefox/3.6.10rn →browser Accept: text/html,application/xhtml+xmlrn Accept-Language: en-us,en;q=0.5rn Accept-Encoding: gzip,deflatern Accept-Charset: ISO-8859-1,utf-8;q=0.7rn Keep-Alive: 115rn Connection: keep-alivern rn carriage return character line-feed character
  • 24. Application Layer 2-24 HTTP response message status line (protocol status code status phrase) header lines data, e.g., requested HTML file HTTP/1.1 200 OKrn Date: Sun, 26 Sep 2010 20:09:20 GMTrn Server: Apache/2.0.52 (CentOS)rn Last-Modified: Tue, 30 Oct 2007 17:00:02 GMTrn Accept-Ranges: bytesrn Content-Length: 2652rn Keep-Alive: timeout=10, max=100rn Connection: Keep-Alivern Content-Type: text/html; charset=ISO-8859-1rn rn data data data data data ...
  • 25. User-server Interaction: cookies Websites to keep track of user Small text file created by website, stored in user computer(temporarily/perman ent) four components: 1) cookie header line of HTTP response message 2) cookie header line in next HTTP request message 3) cookie file kept on user’s host, managed by user’s browser 4) back-end DB at Web site example: • Susan always access Internet from PC • visits specific e-commerce site for first time • when initial HTTP requests arrives at site, site creates: – unique ID – entry in backend DB for ID
  • 26. Cookies: keeping “state” (cont.) Client Host Server Host usual http response msg usual http response msg cookie file one week later: usual http request msg cookie: 1678 cookie- specific action access ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry usual http response Header set-cookie: 1678 ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- specific action access ebay 8734 amazon 1678 backend database Browser tores ID into cookie file Browser put ID in http request
  • 27. Web caching (Proxy Server) • user sets browser: Web accesses via cache • browser sends all HTTP requests to cache – object in cache: cache returns object – else cache requests object from origin server, then returns object to client – Advantages 1) To reduce response-time for client-request. 2) To reduce traffic on an institution’s access-link to the Internet. 3) To reduce Web-traffic in the Internet. Goal: satisfy client request without involving origin server client Web Cache/ proxy server client origin server origin server
  • 28. The Conditional GET • It is a mechanism that allows a cache to verify that the objects are up to date. • cache: specify date of cached copy in HTTP request If-modified-since: <date> • server: response contains no object if cached copy is up- to-date: HTTP/1.0 304 Not Modified HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 304 Not Modified object not modified before <date> HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object modified after <date> client server
  • 29. The Conditional GET ❖It is a mechanism that allows a cache to verify that the objects are up to date. ❖An HTTP request-message is called conditional GET if 1) Request-message uses the GET method and 2) Response-message includes an If-Modified-Since: header-line.
  • 30. File Transfer: FTP • Used by local host to transfer files to or from a remote-host over the network. • FTP uses client-server architecture • FTP uses 2 parallel TCP connections 1) Control Connection : User ID, password ,commands to change directory , put & get files. 2) Data Connection: To transfer files. FTP commands & replies: USER,PASS,LIST(all files), RETR, STOR
  • 31. FTP commands, responses sample commands: • USER username • PASS password • LIST return list of file in current directory • RETR filename retrieves (gets) file • STOR filename stores (puts) file onto remote host sample return codes • 331 Username OK, password required • 125 data connection already open; transfer starting • 425 Can’t open data connection • 452 Error writing file
  • 32. Electronic mail Three major components: • User agents(UA) • Mail servers(MS) • Simple mail transfer protocol: SMTP User Agent • Read, reply, forward save compose messages • e.g., Outlook, Thunderbird, iPhone mail client user mailbox outgoing message queue mail server mail server mail server SMTP SMTP SMTP user agent user agent user agent user agent user agent user agent
  • 33. 2-33 Electronic mail: mail servers Mail servers: • mailbox contains incoming messages for user • message queue of outgoing (to be sent) mail messages SMTP protocol: • Between mail servers to send email messages , TCP , port - 25 mail server mail server mail server SMTP SMTP SMTP user agent user agent user agent user agent user agent user agent user mailbox outgoing Message Q
  • 34. user agent Scenario: Alice sends message to Bob 1) Alice uses UA to compose message “to” bob@someschool.edu 2) Alice’s UA sends message to her mail server; message placed in message queue 3) client side of SMTP opens TCP connection with Bob’s mail server 4) SMTP client sends Alice’s message over the TCP connection 5) Bob’s mail server places the message in Bob’s mailbox 6) Bob invokes his UA to read message mail server mail server 1 2 3 4 5 6 Alice’s mail server Bob’s mail server user agent SMTP
  • 35. Mail Message Format SMTP: protocol for exchanging email msgs standard for text message format: • header lines, e.g., – To: – From: – Subject: • Body: the “message” – ASCII characters only header body blank line
  • 36. Mail Access Protocols • SMTP: delivery/storage to receiver’s server • Mail access protocol: retrieval from server – POP: Post Office Protocol : authorization, download – IMAP: Internet Mail Access Protocol : manipulation of stored msgs on server, allows user to organize messages in folders – HTTP: gmail, Hotmail, Yahoo! Mail, etc. sender’s mail server SMTP SMTP mail access protocol receiver’s mail server (e.g., POP, IMAP) user agent user agent
  • 37. POP3 protocol-port 110 1. Authorization phase • client commands: – user: username – pass: password • server responses – +OK – -ERR 2. Transaction phase, client: • list: list message numbers • retr: retrieve message by number • dele: delete • Quit 3. Update C: list S: 1 498 S: 2 912 S: . C: retr 1 S: <message 1 contents> S: . C: dele 1 C: retr 2 S: <message 1 contents> S: . C: dele 2 C: quit S: +OK POP3 server signing off S: +OK POP3 server ready C: user bob S: +OK C: pass hungry S: +OK user successfully logged on
  • 38. DNS -The Internet’s Directory Service(port-53) ➢ Translates domain names → IP addresses. ➢ ex: domain-name(Host name) “www.google.com” →IP address “198.105.232.4”. ➢ Because domain-names are alphabetic, easier to remember for human being.
  • 39. DNS provides following services 1) Host Aliasing : A host with a complicated hostname can have one or more alias names. 2) Mail Server Aliasing: For obvious reasons, it is highly desirable that e-mail addresses be mnemonic. 3) Load Distribution : It perform load distribution among replicated servers.
  • 40. Overview of How DNS Works Distributed database design is more preferred over centralized : 1) A Single Point of Failure : If the DNS server crashes then the entire Internet will not stop. 2) Traffic Volume : A Single DNS Server cannot handle the huge global DNS traffic. 3) Distant Centralized DB: A single DNS server cannot be “close to” all the querying clients. ➢ If we put the single DNS server in Mysore, then all queries from USA must travel to the other side of the globe, leads delay. 4) Maintenance: The single DNS server would have to keep records for all Internet hosts.
  • 41. Root DNS Servers com DNS servers org DNS servers edu DNS servers poly.edu DNS servers umass.edu DNS servers yahoo.com DNS servers amazon.com DNS servers pbs.org DNS servers DNS: a distributed, hierarchical database client wants IP for www.amazon.com: • client queries root server to find com DNS server • client queries .com DNS server to get amazon.com DNS server • client queries amazon.com DNS server to get IP address for www.amazon.com … … Authoritative
  • 42. requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu 1 2 3 4 5 6 authoritative DNS server dns.cs.umass.edu 7 8 TLD DNS server DNS name resolution example • host at cis.poly.edu wants IP address for gaia.cs.umass.edu iterative query: ❖ contacted server replies with name of server to contact ❖ “I don’t know this name, but ask this server”
  • 43. 4 5 6 3 recursive query: ❖ puts burden of name resolution on contacted name server ❖ heavy load at upper levels of hierarchy? requesting host cis.poly.edu gaia.cs.umass.edu root DNS server local DNS server dns.poly.edu 1 2 7 authoritative DNS server dns.cs.umass.edu 8 DNS name resolution example TLD DNS server
  • 44. DNS Record: Instructions in authoritative DNS servers, provide info( Domain+ IP address ) DNS: distributed database storing resource records (RR) type=NS(Name Server) – name is domain – value is hostname of authoritative name server for this domain RR format: (name, value, type, ttl) type=A(Address) ▪ name is hostname ▪ value is IP address type=CNAME ▪ name is alias name for some “canonical” (the real) name ▪ value is canonical name type=MX(mail exchange) ▪ value is name of mailserver associated with name when a resource should be removed from a cache
  • 45. DNS : Messages • Query(Request) and reply messages, both with same message format msg header ❖ identification: 16 bit # for query, reply to query uses same # ❖ flags: ▪ 1.query(0) or reply(1) ▪ 2. Authoritative: set in reply msg when DNS is authoritative server ▪ 3. Recursion Desired: Set when client desires DNS performs recursion identification flags # questions questions (variable # of questions) # additional RRs # authority RRs # answer RRs answers (variable # of RRs) authority (variable # of RRs) additional info (variable # of RRs) 2 bytes 2 bytes Header Section (12bytes Question Section
  • 46. Info about query: name, type fields for a query RRs in response to query records for authoritative servers additional “helpful” info that may be used identification flags # questions questions (variable # of questions) # additional RRs # authority RRs # answer RRs answers (variable # of RRs) authority (variable # of RRs) additional info (variable # of RRs) DNS Protocol, Messages 2 bytes 2 bytes domain-name question being asked about the domain-name