Вы находитесь на странице: 1из 50

Common Internet Applications

pp
o Web
W b Browsing
B
i (HTTP)
o File Transfer Protocol (FTP)
o Electronic
El t ni M
Mail
il (SMTP)
o Domain Name Service (DNS)
o VoIP,
VoIP Internet Telephony
o Peer-to-peer Services

(This set of slides are mainly from the lecture notes of Prof. S. K. Bose)

Client Server Paradigm


g
Typical network application has two pieces:

client and server interconnected by the network

Network

query/request

response/reply

Client Server Paradigm


g
Client:
initiates
i iti t s contact
t t with
ith sserver

(speaks first)
typically requests service from
s
server,
Web: client implemented in
browser; e-mail: in mail reader

application
transport
network
data link
physical

Server:
provides requested service to client
e.g., Web server sends requested Web

page, mail server delivers e-mail

request

reply
l
application
transport
network
data link
l
physical

Addressing Processes
Identifier used to uniquely identify processes (both sending or
receiving) is
< IP Address, Port Number >

IP Address of the host


where the process is
running

Port Number identifies the


process in the host, e.g. HTTP
Server: 80, Mail Server: 25,
Telnet Service: 23

Well Known Port Numbers dedicated to particular applications


In a host supporting such an application, the service provided

will
ill always
l
s be
b available
il bl att the
th specified
sp ifi d well
ll kn
known
n p
portt number
numb

What kind of transport service does an


application need?
Data loss
some apps (e.g., audio) can
tolerate some loss
other apps
pp (e.g.,
( g , file
f transfer,
f ,
telnet) require 100% reliable
data transfer
Timing
some apps (e.g., Internet
telephony, interactive
games)) require
g
q
low delay
y to
be effective

Bandwidth
some apps (e.g., multimedia)
require minimum amount of
bandwidth to be effective
other apps (elastic apps)
make use of whatever
bandwidth they
y get
g

Internet Transport
p
Protocol Services
TCP service
Transmission Control Protocol
(Connection-Oriented Stream
Service)

UDP service
Universal Datagram Protocol
(Best-Effort, Connection-Less
Datagram Service)

TCP service behaves like a virtual data pipe! Whatever you push in (by
writing to the corresponding TCP socket) at one end of the pipe
eventually comes out,
out in sequence,
sequence from the other end of the pipe (on
the corresponding socket) !

UDP is more uncertain. Whatever data you give to UDP must be given as
packet and UDP will try
y its best to deliver it at the other end. It
a p
does not give any guarantees on this or even that it will deliver the data
packets in sequence.

Internet Transport
p
Protocols Services
TCP service:

connection-oriented: setup

required between client and


server processes
reliable transport between
sending and receiving process
fflow control: sender wont
overwhelm receiver
congestion control: throttle
sender when network
overloaded
does not providing: timing,
minimum bandwidth
guarantees

UDP service:
unreliable data transfer
between sending and
receiving processes
does not provide:
connection setup,
reliability, flow control,
l timing,
congestion control,
or bandwidth guarantee
Application must
m st first set-up
set p a
TCP connection and then use
it.
The connection must also be
terminated after use

Web and HTTP

Hyper Text Transfer


Protocol

Web page consists of objects


Object can be HTML file, JPEG image, Java applet, audio

file
file,
Web page consists of base HTML-file which includes several
referenced objects
Each object is addressable by a URL
Example URL:

http://www.iitg.ernet.in/ece/fac.htm
p
g
host name

path name
where to find the object in the given host

Try View Source in IE to see the HTML file for a web page. Note that this is
y a text file with links/URLs for all the objects
j
reference byy the web p
page
g
always

How does HTTP operate?


HTTP is the Application Layer

Protocol used in the World Wide


Web

HTTP follows a Client Server

model with the client sending


requests to the server and
getting files/objects from it

PC running
Explorer

Server
running
Web
Server program like
Apache

Client: Browser program (e.g. IE,


Netscape, Mozilla, Opera etc.) that
requests, receives, and displays
Web pages/objects/files
Server: Web server program (e.g.
Apache) sends objects in response
to requests

Mac running
Navigator

HTTP Overview
Uses TCP as follows client initiates TCP

connection (creates socket)


to server, port 80
server accepts TCP
connection from client
HTTP messages (applicationlayer protocol messages)
exchanged between browser
(HTTP client) and Web
server (HTTP server)
TCP connection closed

HTTP is a stateless protocol


Servers do not keep record of
previous client requests

Protocols that maintain state


are complex!
past history (state) must be
maintained
if server/client crashes, their
views of
f state

may be
b
inconsistent, must be
reconciled

HTTP connections
Non-persistent HTTP

Persistent HTTP

At most one object is sent

Multiple objects can be

over a TCP connection.


HTTP/1.0
/
uses nonpersistent HTTP

sent over single TCP


ti b
between
t
client
li t
connection
and server.
HTTP/1.1 uses persistent
connections in default
mode

Persistent HTTP would be more efficient as multiple objects can be


transferred in one TCP connection, instead of requiring a separate TCP
connection for each object

Types
yp of HTTP Connections

Non persistent
Non-persistent

Persistent
P
i t t
without
Pipelining
p
g

Persistent
P
sist t with
ith
Pipelining

Authorization

used to control access to server


content using
g name and password
p
Client asks for resource which
needs authorization

client

Server asks client to


authenticate
th ti t with
ith username
and password to get access
to requested resource

server

Client asks for the resource again and includes


username and password with request
Clients Browser remembers the username/password
It has to repeat the username/password for subsequent requests for
objects on the server

Cookies:

Used by server to keep state information


on visiting users/clients

Many major Web sites use cookies e.g.


e g Yahoo
Yahoo, Amazon,
Amazon
and most major portals and e-commerce sites.

Four Components of Cookie Technology :


1) cookie header line in the HTTP response message
2) cookie header line in HTTP request message
3) cookie file kept on user
userss host and managed by users
user s
browser
4) back-end database at Web site

Cookies:

Advantages
g and Controversies

Cookie Supported Features


authorization
h i
i
shopping carts
recommendations
user session state (Web e-mail)

Cookie Controversies

cookies permit sites to


learn a lot about you
you may supply name and email to sites
search engines use
redirection & cookies to
learn y
yet more
advertising companies
obtain info across sites

Conditional GET: client-side caching


g
(faster operation eliminating redundant accesses)

Client caches (i.e.


(i e stores temporarily) files/objects that it
has got from the server earlier
For subsequent accesses to the server for a cached object,
th
there
i no need
is
d to
t download
d
l d the
th object
bj t once again
i if the
th
cached copy is not any older than the copy of the object with
the server
Eliminates redundant accesses and makes downloads more
efficient by downloading only those objects which are either
(a) not already there in client
clientss cache
or

(b) for which the server has a more recent copy

Using
g a HTTP Proxy
y (Proxy
(
y Server))

Client 1

Server A
Proxy
Server

Server B

Client N
Local Network
Domain

Internet

Using
g a HTTP Proxy
y (Proxy
(
y Server))
Client makes all its HTTP requests to its Proxy Server
Proxy Server gets the response (requested file etc.)
etc ) from the
corresponding server and forwards it to the requesting client
In
I case requested
t d fil
file iis
already in the Proxys cache, then Client 1
it can forward the cached copy
to the Client
Internet Hosts only see the
Proxy Server and cannot see the
individual clients. Proxy
y also
serves as a security barrier (e.g.
a firewall) to protect the clients
from the Internet

Server A
Proxy
Server

Server B

Client N

File Transfer and Access Methods


FTP: File Transfer Protocol

Most common file transfer protocol used to


transfer files over a network
TFTP: Trivial File Transfer Protocol

Simpler
p
file transfer method which does not
have all the functionalities of FTP
NFS Network
NFS:
N t
k File
Fil System
S t

An on-line shared file access that transparently


interconnects the file systems
y
of individual hosts to
make it look like a commonly accessible, large, shared
file system

FTP: File Transfer Protocol

user
at host

FTP
FTP
user
client
interface

f l transfer
file
f

llocall fil
file
system

FTP
server
remote file
system

transfer file to/from remote host


client/server model

client: side that initiates transfer (either to/from

remote)
server: remote host
ftp: may be between two programs or with a human user
on the client side
f
ftp
p server: port
p
21 (well
(
known p
port))

Control
Process

Server System
Control
Process

Data
Transfer

Operating System

Operating System

TCP/IP
Internet

TCP Control Connection and TCP Data


Connection between FTP Client and FTP Server

Servver Data
Connection

Data
Transfer

Server Co
ontrol
Connecttion

Client Data
Conn
nection

Client System

Client Co
ontrol
Connec
ction

Schematic Representation
p
of FTP

FTP Control and Data Connections


Control Connection established when the FTP session starts

and stays
y for the whole session; Client establishes connection
with port 21 on the Server side; FTP Server is always
listening at port 21 for Clients who want to set up FTP
connections with it
Client uses the Control Connection to do commands like

set/change directory, read directory contents or make


new directory
y at the Server
Client also uses the Control Connection to request Server for

or

(a) downloading specified file from Server


(b) uploading specified file to Server

For the actual data transfer for upload/download, the

Server sets up the Data Connection as needed.

Data connection taken down after the transfer

FTP: Separate Control & Data Connections


FTP client contacts FTP

server at port 21, specifying


TCP as transport protocol
Client obtains authorization
over control connection, login
required for authentication
(guest login may be done)
Client browses remote
directory by sending
commands over control
connection.
When server receives a
command for a file transfer,
the server opens a TCP data
connection to client
After transferring one file,
server closes connection.

TCP control connection


port 21

FTP
client

TCP data connection


port 20
p

FTP
server

Server opens a second TCP

data connection to transfer


another file.
Control connection: out of
band
band
FTP server maintains state:
current directory, earlier
authentication

Electronic Mail

outgoing
message queue
user mailbox

Three major components:


user agents
mail servers
simple mail transfer protocol:

user
agent
mail
server

SMTP

SMTP

User Agent

SMTP

mail reader
for composing, editing and

reading mail messages


e.g., Eudora, Outlook, elm,
Netscape Messenger
outgoing, incoming messages
st
stored
d on sserver

user
agent

SMTP
mail
server
user
agent
user
agent

mail
server

user
agent

user
agent

Electronic Mail
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
client: sending mail server
server: receiving mail
server

user
agent
mail
server

user
agent

SMTP
SMTP
SMTP
mail
server
user
agent
user
agent

mail
server

user
agent

user
agent

Electronic Mail: The SMTP Protocol


uses TCP to reliably transfer email message from client

to server,
server port 25

direct transfer: sending server to receiving server


three phases of transfer

handshaking (greeting)

transfer of messages

closure

command/response interaction

commands: ASCII text

response: status code and phrase

messages must be in 7-bit ASCII (MIME extension to

pp
non-ASCII contents described later)
support

SMTP: Some Details


SMTP uses p
persistent connections (like persistent
p
HTTP, all

files are transferred in the same connection)

SMTP requires message (header & body) to be in 7-bit ASCII

legacy of original email service which was only meant to


handle text

SMTP requires special extensions for non-ASCII content

(multimedia, binary files,


(multimedia
files programs etc
etc.).
) Non
Non-ASCII
ASCII content
encoded into the form of ASCII text at the sender and
decoded at the receiver (e.g. base 64)

SMTP
P modified
d f d to provide
d some additional
dd
l security f
features

as well (these dont work too well, spamming and viruses still
get spread)

SMTP: Comparisons
p
with HTTP
SMTP p
persistent like persistent
p
HTTP/1.0
HTTP: pull (client picks up content from web server)
SMTP: push (client pushes content to other server)
Both HTTP and SMTP have ASCII command/response

interaction and status codes

SMTP requires every thing in 7-bit ASCII (unlike HTTP)

and special encoding needed for non-text content

HTTP: each object encapsulated in its own response msg


SMTP: multiple objects sent in one multipart msg

Mail Message
g Format
Standard Format for Text
Message:

header

header lines,, e.g.,


g,

To:
From:
Subject:
Subject

different from SMTP


commands!
body
y

the message, ASCII


characters only

body

blank
line

Mail Message
g Format with Multimedia Extensions
MIME: multimedia mail extension, RFC 2045, 2056
additional lines in msg header declare MIME content

type

MIME version
method used
to encode data
multimedia data
type,
yp , subtype,
yp ,
parameter declaration
encoded data

From: alice@crepes.fr
To: bob@hamburger.edu
Subject: Picture of yummy crepe.
MIME-Version:
MIME
Version: 1.0
Content-Transfer-Encoding: base64
Content-Type: image/jpeg
base64
b
64 encoded
d d d
data
t .....
.........................
......base64 encoded data

MIME types

Content Type: type/subtype; parameters


Content-Type:
Text

example subtypes: plain,

html

Image

example subtypes: jpeg,

gif

Audio

example subtypes: basic

(8-bit mu-law encoded),


32kadpcm (32 kbps
coding)

Video

example subtypes: mpeg,

quicktime

Application
other data that must be

processed by reader
before viewable
example
p subtypes:
yp
msword, octet-stream

How exactly would users interact with


their mail server to send/receive mail?
user
agent

Alice

SMTP

user
agent

Bob
senders mail
server

receivers mail
server

In early days of email, the typical procedure would be


1
1.

Alice logs
logs into her mail server to write mail for Bob
Bob.
(Use mail, elm, pine etc. for this.)

2. Alices mail server uses SMTP to forward the mail to


Bobss mail server.
Bob
server
3. Bobs mail server puts the mail in Bobs mail box
4 Bob (when he wants to read his email) logs
4.
logs into his
mail server and reads his mail. (Use mail, elm, pine
etc. for this.)

This is generally not a preferred implementation today


The current trend is for the sender and receiver to run

their
th
i respective
ti User
U
Agents
A
t to
t write
it and
d read/handle
d/h dl th
the
mail
The User Agents
g
interact with the corresponding
p
g mail

server to get the required job done


Some advantages of this are -

1.

Bobs mail server can be down when Alice writes her mail,

2.

Alice and Bob can handle multimedia mail and do not have to
be restricted to the boring
boring text mail of early days

3.

Alice and Bob can choose to keep their mail in their own
computers and not on the mail server

Mail access protocols


user
agent

SMTP

SMTP

senders mail
server

Mail
Access
P t
Protocol
l

user
agent

receivers mail
server

Sender (Alice) can have her User Agent use SMTP

to transfer mail from her computer to her Mail


Server same style of operation as before with
Alicess computer acting as the SMTP client
Alice
Bobs User Agent cannot use SMTP to get mail from

his Mail Server remember, SMTP is a PUSH and not


a PULL type of protocol
Bobs computer will also not allow his mail server to

push mail to him because of security concerns hence,


Bobss mail server cannot use SMTP to deliver the mail
Bob
to Bob

Solution:
Bob runs a Mail
Access Protocol
to get/read the
mail from his
server

Mail access protocols


user
agent

SMTP

SMTP

senders mail
server

Mail
Access
Protocol

user
agent

receivers mail
server

Some Mail Access Protocols that Bob can typically run are
1. POP3

Post Office Protocol ((Version 3))

2. IMAP

Internet Mail Access Protocol

3. HTTP
P

Using Web
b Browsers
B
and
d Web-based
b b
dE
Emaill
(like Hotmail, Yahoo etc.) to read/write mail
directly at the mail server

POP3 Protocol

(A simple protocol for Mail Access to


mail servers from user machines,
machines
commonly supported by most servers )

Three phases of POP3 protocol are


1. Authorization: User agent telnets to port 110 of mail
server and sends login/password to
authenticate the user downloading the mail
2. Transaction:

List messages at server, Retrieve


messages f
from the
h server, Mark/unmark
M k/
k
messages for deletion
User ((client)) issues Q
QUIT command to end
POP3 session with the server

3. Update:

After user logs out, the server deletes the


messages marked for deletion

POP3 Options
p
Two options are possible 1. Download-&-Delete

Automatically
u m
y download
w
received m
mails ffrom
m m
mailbox in
server to users own computer and DELETE them from the
server
2 Download
2.
Download-&-Keep
& Keep

Automatically download received mails from mailbox in


server to users own computer but KEEP a copy in the
server until
til it is
i explicitly
li itl deleted
d l t d by
b the
th user

POP3 Options
p

Download-&-Keep is useful for a user who wants to access


his/her mail from different computers
p
at different times,
e.g. home PC, office workstation, personal laptop

With Download-&-Delete, mails downloaded by the user from


one computer will no longer be accessible if user accesses
the mail server from another computer

Options of Download-&-Delete and Download-&-Keep are


options that may be selected when setting up the POP3
access system between the users computer (user agent &
mail access software) and the mail server. Can also be
modified later by the user

POP3 is simple to implement because it is stateless across sessions,


even though
g it does maintain some state information (i.e. which
mails to delete) when a session terminates

POP3 and IMAP

With POP3 access, user downloads mails to his/her local


machine
hi and
d can then
th llocally
ll
(a) organize them into appropriate folders in his own machine
(b) move mails between folders or
(c) search for mail by sender name or subject

This poses a problem for nomadic users as these folders and


usage options are not accessible to the same user at a
different machine

IMAP (Internet Mail Access Protocol) is more powerful than


POP3 and allows these features. However, it is a more
complicated protocol to support, both at the clients and at
the server

IMAP ((Internet Mail Access Protocol))


Keep all messages in one place: the server

May be accessed by the user from different computers at


different times
Allows user to organize messages in folders

New mail
N
il enters the
h default
d f l INBOX folder,
f ld
user can
subsequently create folders and move received mails to
these folders
IMAP keeps
k
user state across sessions:
i

Names of folders and mappings between message IDs and


folder names need to be remembered for each user
Has commands to allow access to components of a message

(e.g. message header or only parts of a multipart MIME


message)
Useful for limited access over low-bandwidth connections

Web-Based Email using


g Web Browsers
Web-based Email started with Hotmail who offered it free
Free Web-based Email now provided by almost every major

portal site. Service financed by advertisements and may also


support an instant messenger/chat service

Web interface to their normal email service is also provided

by most organizations (universities, companies) to their


employees
p y
and students

Advantage: True Nomadic Mobility as the electronic mailbox

can be accessed from anywhere

Disadvantage:
Di d
Security
i may be
b a concern

Web-Based Email using


g Web Browsers
Alice sends email to Bob where both use web-based email from
different service providers
1. Alice uses her Web Browser as the User Agent. She uses
HTTP to write her email and send it to her Mail Server
2. Alices Mail Server uses SMTP to transfer the email to Bobs
email server
3 When he wants to read his email,
3.
email Bob uses his Web Browser
as the User Agent and HTTP as the protocol to access his
mailbox at the mail server and read/write email
User can run his Web Browser from anywhere and on any machine
User can create and manage his/her own folders at the Web-based

Email Service providers


provider s mail server (just as in IMAP)

DNS: Domain Name System


y
distributed database implemented in hierarchy of many

servers

name

application-layer protocols (e.g. HTTP, SMTP, FTP etc.) use

pp
host names to IP
DNS services to translate user-supplied
addresses (i.e. resolve names)

application hosts, routers, and name servers to communicate

to make this work

DNS is an application layer protocol which provides a core

Internet function to allow other applications to work more


easily with host names rather than IP addresses

Make DNS Query to resolve name of target host

DNS The Domain Name


S t
System

The DNS N
Th
Name Space
S
Resource Records
Name Servers

The DNS Name Space


A portion of the Internet domain name
space.

Hierarchical Operation
p
of DNS
User
Application

DNS Query

DNS
User Response
Host

Local
Name
Server

other, hierarchically
organized name servers
on the Internet who can
help answer the query

Hosts DNS Query sent


first to Local Name Server
Local Name Server replies if it knows; otherwise, it passes the query
on to other Name Servers on the Internet
Eventually,
Eventually if answer obtained then Local Name Server replies with a
DNS Response to the User Host

Hierarchical Operation
p
of DNS
Types of Name Servers
1 L
1.
Locall Name
N
Server
S
2. Root Name Server
3 Authoritative Name Server
3.
4. Intermediate Name Server

No server has
all the name-to-IP
address mappings
Cooperatively,
they can usually
find one who does
have this

Hosts sends DNS query only to its own Local Name Server
Local Name Server may query others to get the required
information if it does not have this itself.
itself Caching is used for greater
efficiency and response speed. Cache is also timed out
(Query used may be Iterative or Recursive)
Iterative
It
ti if a DNS passes queries
i to
t other
th DNS to
t query on its
it behalf.
b h lf
Recursive if it finds higher order DNS and contacts them directly

Hierarchical Operation
p
of DNS

Root
Name
Server

Local
N
Name
Server

Requesting
Host

Target Hosts
Domain

Authoritative
Name Server

Target
g Host for DNS
Query

Hierarchical Operation of DNS


Local Name Servers

Each ISP,
ISP company has Local (default) Name Server , i.e.
ie
for its local domain (reachable within only a few routers)
For a Host, the IP address of its Local Name Server is
usually configured in it when the Host is set up.
up
Some times, multiple local name servers may be set up, e.g.
as Primary Name Server and Secondary Name Server.
In some networks, Hosts may be configured to get the
address of the DNS automatically (e.g. from a Domain
Controller))

Hosts DNS query first goes to Local Name Server. DNS


response will also eventually come back to the Local Name
Server even though it may have actually obtained the
information from elsewhere

Hierarchical Operation
p
of DNS
A DNS Query which cannot be answered by the Local Name Server
will be referred up to another,
another hierarchically higher,
higher name server.
server The
Local Name Sever acts as the DNS Client and queries the next higher
DNS that it knows about
A Host in the EEE domain will first ask the EEE DNS.
If the EEE DNS does not know then it will refer the
query to the next higher CITS DNS
Eventually,
E ntu ll an
n unanswered
un ns
d DNS query
qu
will
ill reach
ch a Root
R t Name
N m Server
S
of the Internet

The Internet has a few (about a dozen or so) very large Root Name
Servers. These know more about the Internet mappings than any other
queries will eventually
y be sent to one of
server and all unanswered DNS q
these.

Вам также может понравиться