Computer networks module 5 content covered in this ppt

vinuthak18 43 views 46 slides May 07, 2024
Slide 1
Slide 1 of 46
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46

About This Presentation

ppt


Slide Content

Module-V
Application
Layer

Application Layer 2-2
Outline
❑Principles of Network Applications
❑The Web and HTTP
❑Electronic mail in the Internet
oSMTP, POP3, IMAP
❑DNS-The Internet Directory
•Text book 2: Computer Networking: A Top down Approach-
James F Kurose 7
th
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
•rulesfor 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 throughputfile
transfer, email
4. Security
❖encryption, data integrity,

2-12
Internet Transport Protocols Services
TCP service:
•reliable transportbetween
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 pageconsists 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
pathname

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
iphonerunning
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) into TCP
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 messagecontaining
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 closes TCP 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 eachTCP
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.1 \r\n
Host: www-net.cs.umass.edu\r\n→objresiding
User-Agent: Firefox/3.6.10\r\n →browser
Accept: text/html,application/xhtml+xml\r\n
Accept-Language: en-us,en;q=0.5\r\n
Accept-Encoding: gzip,deflate\r\n
Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n
Keep-Alive: 115\r\n
Connection: keep-alive\r\n
\r\n
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 OK\r\n
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
Accept-Ranges: bytes\r\n
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 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
responsemessage
2) cookie header line in next
HTTP requestmessage
3) cookie file kept on user’s
host, managed by user’s
browser
4) back-end DBat 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 DBfor 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 usercreate
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
databaseBrowser
stores 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 trafficon an
institution’s access-link to
the Internet.
3) To reduce Web-trafficin
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 cacheto verify that the
objects are up to date.
•cache: specifydate 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
❖Itisamechanismthatallowsacachetoverifythatthe
objectsareuptodate.
❖AnHTTPrequest-messageiscalledconditionalGETif
1)Request-messageusestheGETmethodand
2)Response-messageincludesanIf-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
•LISTreturn list of file in
current directory
•RETR filename
retrieves (gets) file
•STOR filenamestores
(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,
iPhonemail 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:
•mailboxcontains incoming
messages for user
•message queueof 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”
[email protected]
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: +OKuser successfully logged on

DNS -The Internet’s Directory Service(port-53)
➢Translatesdomainnames→IPaddresses.
➢ex: domain-name(Host name) “www.google.com” →IP address
“198.105.232.4”.
➢Becausedomain-namesarealphabetic,easierto
rememberforhumanbeing.

DNS provides following services
1)HostAliasing:Ahostwithacomplicatedhostnamecan
haveoneormorealiasnames.
2)MailServerAliasing:Forobviousreasons,itishighlydesirablethat
e-mailaddressesbemnemonic.
3)LoadDistribution:Itperformloaddistributionamongreplicated
servers.

Overview of How DNS Works
Distributeddatabasedesignismorepreferredover
centralized:
1)ASinglePointofFailure:IftheDNSservercrashesthenthe
entireInternetwillnotstop.
2)TrafficVolume:ASingleDNSServercannothandlethehuge
globalDNStraffic.
3)DistantCentralizedDB:AsingleDNSservercannotbe
“closeto”allthequeryingclients.
➢IfweputthesingleDNSserverinMysore,thenallqueriesfromUSAmust
traveltotheothersideoftheglobe,leadsdelay.
4)Maintenance:ThesingleDNSserverwouldhavetokeep
recordsforallInternethosts.

Root DNS Servers
com DNS servers
org DNS servers eduDNS 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:
•clientqueriesrootservertofindcomDNSserver
•clientqueries.comDNSservertogetamazon.comDNSserver
•clientqueriesamazon.comDNSservertogetIPaddressfor
www.amazon.com
……
Authoritative

requesting host
cis.poly.edu
gaia.cs.umass.edu
rootDNS server
local DNS server
dns.poly.edu
1
2
3
4
5
6
authoritativeDNS server
dns.cs.umass.edu
7
8
TLDDNS 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)
–nameis domain
–valueis hostname of
authoritative name server for
this domain
RR format:(name, value, type, ttl)
type=A(Address)
▪nameis hostname
▪valueis IP address
type=CNAME
▪nameis alias name for some “canonical”
(the real) name
▪valueis canonical name
type=MX(mail exchange)
▪valueis name of mailserver
associated withname
when a resource
should be removed
from a cache

DNS : Messages
•Query(Request)and replymessages, both with same message format
msgheader
❖identification:16 bit # for query,
reply to query uses same #
❖flags:
▪1.query(0) or reply(1)
▪2. Authoritative: set in
reply msgwhen 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
Tags