communication network notes
Post on 07-Oct-2015
7 Views
Preview:
DESCRIPTION
TRANSCRIPT
-
Common Internet Applicationspp
W b B i (HTTP) o Web Browsing (HTTP)
o File Transfer Protocol (FTP)
El t ni M il (SMTP)o Electronic Mail (SMTP)
o Domain Name Service (DNS)
o VoIP Internet Telephonyo 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 Paradigmg
Typical network application has two pieces:
client and server interconnected by the network
Network
query/request response/replyquery/request response/reply
-
Client Server Paradigmg
applicationtransportnetwork
Client: i iti t s t t ith s networkdata link
physical initiates contact with server
(speaks first) typically requests service from
s request
server, Web: client implemented in
browser; e-mail: in mail readerl
applicationtransportnetwork
l
reply
Server: provides requested service to client data link
physical provides requested service to client e.g., Web server sends requested Web
page, mail server delivers e-mail
-
Addressing Processes
Identifier used to uniquely identify processes (both sending or receiving) is
< IP Address, Port Number >
IP Address of the host Port Number identifies the IP Address of the host where the process is
runningprocess 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
ill l s b il bl t th sp ifi d ll kn n p t numbwill always be available at the specified well known port number
-
What kind of transport service does an application need?application need?
Data loss BandwidthData loss some apps (e.g., audio) can
tolerate some loss other apps (e.g., file transfer,
some apps (e.g., multimedia) require minimum amount of bandwidth to be effectivepp ( g , f f ,
telnet) require 100% reliable data transfer
Timing
other apps (elastic apps) make use of whatever bandwidth they get Timing
some apps (e.g., Internet telephony, interactive games) require low delay to
y g
g ) q ybe effective
-
Internet Transport Protocol Servicesp
TCP service UDP serviceTransmission Control Protocol (Connection-Oriented Stream Service)
Universal Datagram Protocol (Best-Effort, Connection-Less Datagram Service)
TCP service behaves like a virtual data pipe! Whatever you push in (bywriting to the corresponding TCP socket) at one end of the pipeeventually comes out in sequence from the other end of the pipe (oneventually comes out, in sequence, from the other end of the pipe (onthe corresponding socket) !
UDP is more uncertain. Whatever data you give to UDP must be given asa packet and UDP will try its best to deliver it at the other end. Itp ydoes not give any guarantees on this or even that it will deliver the datapackets in sequence.
-
Internet Transport Protocols Servicesp
TCP service: UDP service: connection-oriented: setup
required between client and server processes
unreliable data transfer between sending and receiving processes
reliable transport between sending and receiving process
flow control: sender wont
does not provide: connection setup, reliability, flow control,
l foverwhelm receiver
congestion control: throttle sender when network
congestion control, timing, or bandwidth guarantee
Application m st first set p aoverloaded does not providing: timing,
minimum bandwidth
Application must first set-up aTCP connection and then useit.
The connection must also beguarantees The connection must also beterminated after use
-
Web and HTTP Hyper Text Transfer Protocol Web page consists of objects Object can be HTML file, JPEG image, Java applet, audio
filefile, Web page consists of base HTML-file which includes several
referenced objects Each object is addressable by a URL Each object is addressable by a URL Example URL:
http://www.iitg.ernet.in/ece/fac.htmp g
host name path namewhere to find the object in the given hostwhere 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 isalways a text file with links/URLs for all the objects reference by the web pagey j y p g
-
How does HTTP operate?
HTTP is the Application LayerProtocol used in the World WideWebWeb
HTTP follows a Client Servermodel with the client sending
PC runningExplorer
model with the client sendingrequests to the server andgetting files/objects from it
Server running
WebServer program like
Apache
Client: Browser program (e.g. IE,Netscape, Mozilla, Opera etc.) thatrequests, receives, and displaysWeb pages/objects/files
Mac runningNavigator
Web pages/objects/files
Server: Web server program (e.g.Apache) sends objects in responseto requests
-
HTTP Overview
Uses TCP as follows -
client initiates TCP
HTTP is a stateless protocol Servers do not keep record of
previous client requests client initiates TCP connection (creates socket) to server, port 80
server accepts TCP
previous client requests
server accepts TCP connection from client
HTTP messages (application-layer protocol messages)
Protocols that maintain state are complex!layer protocol messages)
exchanged between browser (HTTP client) and Web server (HTTP server)
are complex! past history (state) must be
maintained if server/client crashes, their
f b server (HTTP server) TCP connection closed
views of state may be inconsistent, must be reconciled
-
HTTP connections
Non-persistent HTTP Persistent HTTP
At most one object is sent over a TCP connection.
/
Multiple objects can be sent over single TCP
ti b t li t HTTP/1.0 uses non-persistent HTTP
connection between client and server.
HTTP/1.1 uses persistent connections in default connections in default mode
Persistent HTTP would be more efficient as multiple objects can betransferred in one TCP connection, instead of requiring a separate TCPconnection for each objectconnection for each object
-
Types of HTTP Connectionsyp
Non persistent P i t t P sist t ith Non-persistent Persistent without
Pipelining
Persistent with Pipelining
p g
-
Authorization used to control access to server content using name and passwordg p
Client asks for resource which needs authorization
Server asks client to th ti t ithclient serverauthenticate with username and password to get access to requested resource
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 It has to repeat the username/password for subsequent requests forobjects on the server
-
Cookies: Used by server to keep state information on visiting users/clients
Many major Web sites use cookies e g Yahoo Amazon
on visiting users/clients
Many major Web sites use cookies e.g. Yahoo, Amazon, and most major portals and e-commerce sites.
Four Components of Cookie Technology :
1) cookie header line in the HTTP response message2) cookie header line in HTTP request message3) cookie file kept on users host and managed by users 3) cookie file kept on user s host and managed by user s
browser4) back-end database at Web site
-
Cookies: Advantages and Controversiesg
Cookie Supported Featuresh i i
Cookie Controversies cookies permit sites to authorization
shopping carts recommendations
cookies permit sites to learn a lot about you
you may supply name and e-mail to sites
user session state (Web e-mail)mail to sites
search engines use redirection & cookies to learn yet morey
advertising companies obtain info across sites
-
Conditional GET: client-side cachingg(faster operation eliminating redundant accesses)
Client caches (i e stores temporarily) files/objects that it Client caches (i.e. stores temporarily) files/objects that ithas got from the server earlier
For subsequent accesses to the server for a cached object,th i d t d l d th bj t i if ththere is no need to download the object once again if thecached copy is not any older than the copy of the object withthe server
Eliminates redundant accesses and makes downloads moreefficient by downloading only those objects which are either
(a) not already there in clients cache(a) not already there in client s cache
or (b) for which the server has a more recent copy
-
Using a HTTP Proxy (Proxy Server)g y ( y )
Server AClient 1 Proxy
Server
Server A
Server B
Client NClient N
Local Network DomainDomain Internet
-
Using a HTTP Proxy (Proxy Server)g y ( y )
Client makes all its HTTP requests to its Proxy Server Proxy Server gets the response (requested file etc ) from the Proxy Server gets the response (requested file etc.) from the corresponding server and forwards it to the requesting client
I t d fil i
ProxyServer
Client 1Server A
In case requested file is already in the Proxys cache, then it can forward the cached copy to the Client Server Internet Hosts only see the Proxy Server and cannot see the individual clients. Proxy also
Server By
serves as a security barrier (e.g. a firewall) to protect the clients from the Internet
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 file transfer method which does not phave all the functionalities of FTP
NFS N t k Fil S tNFS: Network File System
An on-line shared file access that transparentlyinterconnects the file systems of individual hosts toymake it look like a commonly accessible, large, sharedfile system
-
FTP: File Transfer Protocol
f l ffile transfer FTPserver
FTPuser
interface
FTPclient
l l fil remote fileuser
transfer file to/from remote host
local filesystem
remote filesystem
at host
client/server model client: side that initiates transfer (either to/from
remote) server: remote host server: remote host
ftp: may be between two programs or with a human user on the client side
ftp server: port 21 (well known port)f p p ( p )
-
Schematic Representation of FTPp
o
n
t
r
o
l
c
t
i
o
n
o
n
t
r
o
l
t
i
o
n
Client System Server System
Data Transfer
Control Process
t
D
a
t
a
n
e
c
t
i
o
n
Control Process
Data Transfer
v
e
r
D
a
t
a
n
e
c
t
i
o
n
C
l
i
e
n
t
C
o
C
o
n
n
e
c
S
e
r
v
e
r
C
o
C
o
n
n
e
c
t
Operating System
C
l
i
e
n
C
o
n
n
Operating System
S
e
r
v
C
o
n
TCP/IP Internet
TCP Control Connection and TCP DataConnection between FTP Client and FTP ServerConnection between FTP Client and FTP Server
-
FTP Control and Data Connections
Control Connection established when the FTP session startsand stays for the whole session; Client establishes connectionywith port 21 on the Server side; FTP Server is alwayslistening at port 21 for Clients who want to set up FTPconnections with it
Client uses the Control Connection to do commands likeset/change directory, read directory contents or makenew directory at the Servery
Client also uses the Control Connection to request Server for(a) downloading specified file from Server
or (b) uploading specified file to Serveror (b) uploading specified file to Server
For the actual data transfer for upload/download, theServer 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
TCP control connectionport 21TCP as transport protocol
Client obtains authorization over control connection, login required for authentication FTP FTP
TCP data connectionport 20required for authentication
(guest login may be done) Client browses remote
directory by sending
client serverp
Server opens a second TCP data connection to transfer directory by sending
commands over control connection.
When server receives a
data connection to transfer another file.
Control connection: out of band When server receives a
command for a file transfer, the server opens a TCP data connection to client
band FTP server maintains state:
current directory, earlier authentication
After transferring one file, server closes connection.
authentication
-
Electronic Mail outgoing message queue
Three major components:user mailbox
message queue
useragent
user agents mail servers simple mail transfer protocol:
useragent
mailserver
agent
SMTPSMTP
User Agent
mailserver user
agent
SMTP
SMTP mail reader for composing, editing and
reading mail messagesuseragent
mailserver
SMTP
e.g., Eudora, Outlook, elm, Netscape Messenger
outgoing, incoming messages st d s
useragent
userstored on server agent
-
Electronic Mail
Mail Servers useragent
mailbox contains incoming messages for user
message queue of outgoing (to
useragent
mailserver
agent
SMTP message queue of outgoing (to be sent) mail messages SMTP protocol between mail
servers to send email messages
mailserver user
agent
SMTP
SMTP client: sending mail server server: receiving mail
serveruseragent
mailserver
SMTP
server
useragent
useruseragent
-
Electronic Mail: The SMTP Protocol
uses TCP to reliably transfer email message from client to server port 25to server, port 25
direct transfer: sending server to receiving server three phases of transfer
handshaking (greeting) transfer of messages closure closure
command/response interaction commands: ASCII text response: status code and phrase
messages must be in 7-bit ASCII (MIME extension to support non-ASCII contents described later)pp
-
SMTP: Some Details
SMTP uses persistent connections (like persistent HTTP, all p pfiles 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 legacy of original email service which was only meant to handle text
SMTP requires special extensions for non-ASCII content (multimedia binary files programs etc ) Non ASCII content (multimedia, binary files, programs etc.). Non-ASCII content encoded into the form of ASCII text at the sender and decoded at the receiver (e.g. base 64)
P d f d d dd l f SMTP modified to provide some additional security features as well (these dont work too well, spamming and viruses still get spread)
-
SMTP: Comparisons with HTTPp
SMTP persistent like persistent HTTP/1.0p p 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 Formatg
Standard Format for Text Message:
header lines, e.g.,
headerblankline
, g , To: From: Subject:
body Subjectdifferent from SMTP
commands! bodyy
the message, ASCII characters only
-
Mail Message Format with Multimedia Extensionsg
MIME: multimedia mail extension, RFC 2045, 2056 additional lines in msg header declare MIME content
type
From: alice@crepes.fr To: bob@hamburger.edu Subject: Picture of yummy crepe. MIME-Version: 1.0method used
MIME version
MIME Version: 1.0 Content-Transfer-Encoding: base64 Content-Type: image/jpeg b 64 d d d t
multimedia datatype, subtype,
to encode data
base64 encoded data ..... ......................... ......base64 encoded data
yp , yp ,parameter declaration
encoded data
-
MIME typesContent Type: type/subtype; parametersContent-Type: type/subtype; parameters
Text Video example subtypes: plain,
html example subtypes: mpeg, quicktime
Image example subtypes: jpeg,
gifApplication other data that must be
Audio example subtypes: basic
processed by reader before viewable
example subtypes: example subtypes: basic(8-bit mu-law encoded), 32kadpcm (32 kbps coding)
p ypmsword, octet-stream
-
How exactly would users interact with their mail server to send/receive mail?their mail server to send/receive mail?
useruserSMTP
agent
senders mail
useragent
receivers mail Alice Bob
server server
In early days of email, the typical procedure would be
1 Alice logs into her mail server to write mail for Bob 1. Alice logs into her mail server to write mail for Bob. (Use mail, elm, pine etc. for this.)
2. Alices mail server uses SMTP to forward the mail to Bobs mail serverBob s mail server.
3. Bobs mail server puts the mail in Bobs mail box
4 Bob (when he wants to read his email) logs into his 4. Bob (when he wants to read his email) 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 th i ti U A t t it d d/h dl th their respective User Agents to write and read/handle the mail
The User Agents interact with the corresponding mail g p gserver 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 text mail of early daysbe restricted to the boring text mail of early days
3. Alice and Bob can choose to keep their mail in their owncomputers and not on the mail server
-
Mail access protocols
useragentuseragent
SMTP SMTP Mail AccessP t l
senders mail server
Protocolreceivers mail
server
Sender (Alice) can have her User Agent use SMTPto transfer mail from her computer to her MailServer same style of operation as before withAlices computer acting as the SMTP clientAlice s computer acting as the SMTP client
Bobs User Agent cannot use SMTP to get mail fromhis Mail Server remember, SMTP is a PUSH and nota PULL type of protocol
Solution:
Bob runs a Mail a PULL type of protocol Bobs computer will also not allow his mail server topush mail to him because of security concerns hence,Bobs mail server cannot use SMTP to deliver the mail
Bob runs a Mail Access Protocolto get/read the mail from his Bob s mail server cannot use SMTP to deliver the mail
to Bob server
-
Mail access protocols
useragentuseragent
SMTP SMTP Mail AccessProtocol
senders mail server
Protocolreceivers 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
P b B d b b d E l3. HTTP Using Web Browsers and Web-based Email(like Hotmail, Yahoo etc.) to read/write mail directly at the mail server
-
POP3 Protocol (A simple protocol for Mail Access tomail servers from user machinesmail servers from user machines,commonly supported by most servers )
Three phases of POP3 protocol are Three phases of POP3 protocol are
1. Authorization: User agent telnets to port 110 of mail server and sends login/password to server and sends login/password to authenticate the user downloading the mail
2. Transaction: List messages at server, Retrieve f h M k/ k messages from the server, Mark/unmark
messages for deletion
User (client) issues QUIT command to end ( ) QPOP3 session with the server
3. Update: After user logs out, the server deletes the messages marked for deletionmessages marked for deletion
-
POP3 Optionsp
Two options are possible -Two options are possible
1. Download-&-Delete
Automatically download received mails from mailbox inu m y w m f m mserver to users own computer and DELETE them from theserver
2 Download & Keep2. Download-&-Keep
Automatically download received mails from mailbox inserver to users own computer but KEEP a copy in the
til it i li itl d l t d b thserver until it is explicitly deleted by the user
-
POP3 Optionsp
Download-&-Keep is useful for a user who wants to accesshis/her mail from different computers at different times,pe.g. home PC, office workstation, personal laptop
With Download-&-Delete, mails downloaded by the user fromone computer will no longer be accessible if user accessesone computer will no longer be accessible if user accessesthe mail server from another computer
Options of Download-&-Delete and Download-&-Keep areoptions that may be selected when setting up the POP3options that may be selected when setting up the POP3access system between the users computer (user agent &mail access software) and the mail server. Can also bemodified later by the usermodified later by the user
POP3 is simple to implement because it is stateless across sessions,even though it does maintain some state information (i.e. whichgmails to delete) when a session terminates
-
POP3 and IMAP
With POP3 access, user downloads mails to his/her localhi d th l llmachine and can then locally
(a) organize them into appropriate folders in his own machine
(b) move mails between folders or(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 This poses a problem for nomadic users as these folders andusage options are not accessible to the same user at adifferent machine
IMAP (Internet Mail Access Protocol) is more powerful than IMAP (Internet Mail Access Protocol) is more powerful thanPOP3 and allows these features. However, it is a morecomplicated protocol to support, both at the clients and atthe serverthe server
-
IMAP (Internet Mail Access Protocol)( )
Keep all messages in one place: the serverMay be accessed by the user from different computers atMay be accessed by the user from different computers atdifferent times
Allows user to organize messages in foldersN il h d f l INBOX f ldNew mail enters the default INBOX folder, user cansubsequently create folders and move received mails tothese foldersIMAP k i IMAP keeps user state across sessions:Names of folders and mappings between message IDs andfolder 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 MIMEmessage)Useful for limited access over low-bandwidth connections
-
Web-Based Email using Web Browsersg
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 alsosupport an instant messenger/chat service
Web interface to their normal email service is also providedby most organizations (universities, companies) to theiremployees and studentsp y
Advantage: True Nomadic Mobility as the electronic mailboxcan be accessed from anywhere
Di d i b Disadvantage: Security may be a concern
-
Web-Based Email using Web Browsersg
Alice sends email to Bob where both use web-based email fromdifferent service providersdifferent service providers
1. Alice uses her Web Browser as the User Agent. She usesHTTP to write her email and send it to her Mail Server
2. Alices Mail Server uses SMTP to transfer the email to Bobsemail server
3 When he wants to read his email Bob uses his Web Browser3. When he wants to read his email, Bob uses his Web Browseras the User Agent and HTTP as the protocol to access hismailbox 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 mail server (just as in IMAP)Email Service provider s mail server (just as in IMAP)
-
DNS: Domain Name Systemy
distributed database implemented in hierarchy of many nameservers
application-layer protocols (e.g. HTTP, SMTP, FTP etc.) useDNS services to translate user-supplied host names to IPppaddresses (i.e. resolve names)
application hosts, routers, and name servers to communicateto make this work
DNS is an application layer protocol which provides a coreInternet function to allow other applications to work moreeasily with host names rather than IP addresseseasily with host names rather than IP addresses
Make DNS Query to resolve name of target host
-
DNS The Domain Name S tSystem
Th DNS N S The DNS Name Space Resource Records Name Servers
-
The DNS Name SpaceThe DNS Name Space
A portion of the Internet domain name A portion of the Internet domain name space.
-
Hierarchical Operation of DNSp
UserUser Application DNS Query
DNS other, hierarchically organized name servers
User Host
Response
Local Name
organized name servers on the Internet who can help answer the query
Server 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 if answer obtained then Local Name Server replies with a Eventually, if answer obtained then Local Name Server replies with a DNS Response to the User Host
-
Hierarchical Operation of DNSp
Types of Name Servers
1 L l N S
No server has all the name-to-IP
1. Local Name Server
2. Root Name Server
3 Authoritative Name Server
address mappings Cooperatively, they can usually find one who does 3. Authoritative Name Server
4. Intermediate Name Server
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 requiredinformation if it does not have this itself Caching is used for greaterinformation if it does not have this itself. Caching is used for greaterefficiency and response speed. Cache is also timed out
(Query used may be Iterative or Recursive)
It ti if DNS i t th DNS t it b h lfIterative if a DNS passes queries to other DNS to query on its behalf.Recursive if it finds higher order DNS and contacts them directly
-
Hierarchical Operation of DNSp
Root Name Server
Target Hosts Domain
Local N
Server
Authoritative Name ServerName
ServerName Server
Requesting Host
Target Host for DNS gQuery
-
Hierarchical Operation of DNS
Local Name Servers
Each ISP company has Local (default) Name Server i e Each ISP, company has Local (default) Name Server , i.e.for its local domain (reachable within only a few routers)
For a Host, the IP address of its Local Name Server isusually configured in it when the Host is set upusually configured in it when the Host is set 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 theaddress of the DNS automatically (e.g. from a DomainController))
Hosts DNS query first goes to Local Name Server. DNSresponse will also eventually come back to the Local NameServer even though it may have actually obtained theServer even though it may have actually obtained theinformation from elsewhere
-
Hierarchical Operation of DNSp
A DNS Query which cannot be answered by the Local Name Serverwill be referred up to another hierarchically higher name server Thewill be referred up to another, hierarchically higher, name server. TheLocal Name Sever acts as the DNS Client and queries the next higherDNS that it knows about
A Host in the EEE domain will first ask the EEE DNS.A Host in the EEE domain will first ask the EEE DNS.
If the EEE DNS does not know then it will refer thequery to the next higher CITS DNS
E ntu ll n un ns d DNS qu ill ch R t N m S Eventually, an unanswered DNS query will reach a Root Name Serverof the Internet
The Internet has a few (about a dozen or so) very large Root NameServers. These know more about the Internet mappings than any otherserver and all unanswered DNS queries will eventually be sent to one ofq ythese.
top related