computer networks - application layerpcosta.azurewebsites.net/cn_slides/cn_07-handout.pdf ·...

12
Computer Networks Application Layer Paolo Costa [email protected] http://www.cs.vu.nl/~costa Vrije Universiteit Amsterdam (Version June 18, 2008) Paolo Costa 07 - Application Layer 1 / 47 Application Layer Now, we will study some real network applications: Domain Name System Electronic Mail World Wide Web Multimedia Peer-to-peer Gnutella Skype Emule BitTorrent Distributed Hash Table (Chord, Kadmelia) Paolo Costa 07 - Application Layer 2 / 47 The Domain Name System Every host has a worldwide unique name that is bound to an IP address. originally all mapping were contained in the file hosts in 1982, they switch to the Domain Name System (DNS) DNS provides name-lookup facilities: when given a hostname, it returns that host’s IP address. A domain name is a path from a leaf node up to the root. A domain is a subtree in the domain name space Each domain can have a set of resource records which are stored (in a file) at name servers Paolo Costa 07 - Application Layer Domain Name System 3 / 47 DNS Name Servers Idea: Divide the name space into a collection of non-overlapping zones, each one taken care of by one or more name servers: Root servers: 13 “root” DNS servers know where the top-level servers are (labeled A through M) see http://www.root-servers.org Top-level domain servers: each one is associated with a top-level domain (e.g., .com, .edu, .ch, .org, .tv) Authoritative servers: for each domain, there is an authoritative DNS server that holds the map of hosts within that domain A resolver is capable of sending DNS queries to a name server a resolver is often just a library linked to an application. Paolo Costa 07 - Application Layer Domain Name System 4 / 47 Notes Notes Notes Notes

Upload: truongtram

Post on 24-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Computer NetworksApplication Layer

Paolo [email protected]

http://www.cs.vu.nl/~costa

Vrije Universiteit Amsterdam

(Version June 18, 2008)

Paolo Costa 07 - Application Layer 1 / 47

Application Layer

Now, we will study some realnetwork applications:

Domain Name SystemElectronic MailWorld Wide WebMultimediaPeer-to-peer

GnutellaSkypeEmuleBitTorrentDistributed Hash Table(Chord, Kadmelia)

Paolo Costa 07 - Application Layer 2 / 47

The Domain Name System

Every host has a worldwide unique name that is bound to an IPaddress.

originally all mapping were contained in the file hostsin 1982, they switch to the Domain Name System (DNS)

DNS provides name-lookup facilities: when given a hostname, itreturns that host’s IP address.

A domain name is a path from a leaf node up to the root. Adomain is a subtree in the domain name spaceEach domain can have a set of resource records which are stored(in a file) at name servers

Paolo Costa 07 - Application Layer Domain Name System 3 / 47

DNS Name Servers

Idea: Divide the name space into a collection of non-overlappingzones, each one taken care of by one or more name servers:

Root servers: 13 “root” DNS servers know where the top-levelservers are (labeled A through M)

see http://www.root-servers.orgTop-level domain servers: each one is associated with a top-leveldomain (e.g., .com, .edu, .ch, .org, .tv)Authoritative servers: for each domain, there is an authoritativeDNS server that holds the map of hosts within that domainA resolver is capable of sending DNS queries to a name server

a resolver is often just a library linked to an application.Paolo Costa 07 - Application Layer Domain Name System 4 / 47

Notes

Notes

Notes

Notes

Resource Records

Every domain, whether it is a single host or a top-level domain,can have a set of resource records associated with it.For a single host, the most common resource record is just its IPaddress, but many other kinds of resource records also exist.A resource record is a five-tuple (Class is always IN)〈 Domain_name, Time_to_live, Class, Type, Value 〉

Type AssociatedDescription

entitySOA Zone Holds information on the represented zoneA Host Contains an IP address of the host this node representsMX Domain Refers to a mail server to handle mail addressed to this nodeSRV Domain Refers to a server handling a specific serviceNS Zone Refers to a name server that implements the represented zoneCNAME Node Symbolic link with the primary name of the represented nodePTR Host Contains the canonical name of a hostHINFO Host Holds information on the host this node representsTXT Any kind Contains any entity-specific information considered useful

Paolo Costa 07 - Application Layer Domain Name System 5 / 47

Resource RecordExample

Paolo Costa 07 - Application Layer Domain Name System 6 / 47

DNS Iterative Name ResolutionName resolution can be iterative, in which the client repeatedlyasks name servers to resolve part of a nameIt mirrors the hierarchical structure of the namespace

in many cases, caching can be employedroot

DNS servers

.nlDNS servers

.vu.nlDNS server

cs.vu.nlDNS server

applicationwww.cs.vu.nl?

local DNS?

?

see .nl at 192.5.5.241. . .?

see .vu.nl at 193.176.144.2. . .?

see cs.vu.nl at 130.37.129.4. . .?

130.37.20.20!

130.37.20.20!

Paolo Costa 07 - Application Layer Domain Name System 7 / 47

DNS Recursive Name ResolutionWith recursive resolution, a higher level server passes the queryto a lower one instead of passing it back to the querying server.

it requires more processing on higher-level nodes.

rootDNS servers

.nlDNS servers

.vu.nlDNS server

cs.vu.nlDNS server

applicationwww.cs.vu.nl ?

local DNS?

??

?

?130.37.20.20!

130.37.20.20!

130.37.20.20!130.37.20.20!

130.37.20.20!

Paolo Costa 07 - Application Layer Domain Name System 8 / 47

Notes

Notes

Notes

Notes

DNS Address Resolution

You can also find the name of a host when given its address:host 192.31.231.80 80.231.31.192.in-addr.arpadomain name pointer veldersschuit.cs.vu.nl

Solution: IP addresses are stored in the special in-addr.arpadomain:

80

231

31

192

in-addr

arpa

.

0 255

0

0

0

255

255

255

Paolo Costa 07 - Application Layer Domain Name System 9 / 47

Round robin DNSRound robin DNS is a technique for balancing the load ofgeographically-distributed Web serversRound robin works by responding to DNS requests not with asingle IP address, but a list of IP addresses

the order in which IP addresses are returned is the keythe IP address at the top of the list is returned a set number oftimes before it is moved to the bottom, thus promoting the secondIP address to the top of the list

e.g., executing host www.google.com returnswww.google.com is an alias for www.l.google.com.www.l.google.com has address 66.249.91.99www.l.google.com has address 66.249.91.104www.l.google.com has address 66.249.91.103www.l.google.com has address 66.249.91.147

Each DNS reply has associated a TTL, telling how long it can becached

if load-balancing is used, TTL must be small (e.g., 18 seconds forgoogle.com)

In some cases, the address returned also depends on thegeographic location of the querying node (e.g., Akamai)

Paolo Costa 07 - Application Layer Domain Name System 10 / 47

Lab Sessionnslookup

The nslookup command can be used to find various detailsrelating to DNSe.g., by typing nslookup www.cs.vu.nl, we can obtain the IPaddress of the google serversServer: 192.168.1.254Address: 192.168.1.254#53

Non-authoritative answer:www.cs.vu.nl canonical name = soling-public.few.vu.nl.Name: soling-public.few.vu.nlAddress: 130.37.20.20

The first line specifies the address of the DNS server usedNon-autorhative means that the reply has been extracted from aprevious cachenslookup -type=NS www.cs.vu.nl tells us the address ofthe authoritative DNS servernslookup www.cs.vu.nl star.cs.vu.nl asks the serverstar (the authorative DNS) for a reply

Paolo Costa 07 - Application Layer Domain Name System 11 / 47

Lab Sessiondig

Domain Information Groper (dig) is a network tool that queriesDNS name servers.e.g., dig www.cs.vu.nl; <<>> DiG 9.4.2 <<>> www.cs.vu.nl;; QUESTION SECTION:;www.cs.vu.nl. IN A

;; ANSWER SECTION:www.cs.vu.nl. 57224 IN CNAME soling-public.few.vu.nl.soling-public.few.vu.nl. 86398 IN A 130.37.20.20

;; Query time: 82 msec;; SERVER: 192.168.1.254#53(192.168.1.254);; WHEN: Sun Jun 15 13:03:03 2008;; MSG SIZE rcvd: 78

dig also enables querying for other DNS recorde.g., to obtain info about the mail server type dig MX cs.vu.nl

similar information can also be obtained by running host with the-v option

Paolo Costa 07 - Application Layer Domain Name System 12 / 47

Notes

Notes

Notes

Notes

A Postal Service for the Internet

Paolo GuillaumeGuillaume PierreDe Boelelaan 1081Amsterdam, 1081 HVNetherlands

Paolo CostaDe Boelelaan 1081Amsterdam, 1081 HV,NL

Paolo Costa

Amsterdam, June 18, 2008

Re: Italy vs. France (Euro 2008)

Dear Guillaume,how about yesterday’s match ? ;)

Take care,Paolo

Paolo Costa 07 - Application Layer Electronic Mail 13 / 47

Electronic Mail

Features and GoalsAsynchronous communication

Alice sends a message when it is convenient to herBob reads Alice’s message whenever he has time to do that

One-to-many communicationAlice can send a message to Bob and Charliea mailing list sends messages to several receivers

Multi-media contentimages and all sorts of attachments as well as normal text

LimitationsNo authentication

messages can be modifiedmessages can be forged

No confidentialitythe message can be read by others

Little or no delivery guaranteesmessages can be accidentally lost or intentionally blockedno reliable acknowledgment system

Paolo Costa 07 - Application Layer Electronic Mail 14 / 47

Architecture

User agentallows a user to read, compose, reply to, send, and forwardmessagesand also to save, classify, sort, search, . . .

Mail serversaccept messages for remote delivery

store messages in a local persistent queuedeliver messages to a remote (destination) server using the transportprotocol

accept messages for local deliverysave messages in some local persistent mailbox

allow user agents to access local mailboxesuser agents can retrieve and/or delete messagesthis is done through an access protocol

Paolo Costa 07 - Application Layer Electronic Mail 15 / 47

Email: Message Transfer

The message transfer agent extracts the destination host from themessage, and queries DNS to obtain the destination address.DNS keeps track of mailers in MX records:nslookup -type=MX cs.vu.nlServer: 192.168.1.254Address: 192.168.1.254#53

Non-authoritative answer:cs.vu.nl mail exchanger = 1 mail.few.vu.nl.

Example: mail for [email protected] is sent to the messagetransfer agent on mail.few.vu.nl

of course, mail is looked up as well to retrieve its IP addressThe message transfer agent extracts the user and makes anattempt to deposit the incoming message into the user’s mailbox.The user may then be notified.Note: We’re assuming that the user’s mailbox is accessible for theagent, not necessarily the user.

protocols exist that allow a user to remotely access the mailbox.

Paolo Costa 07 - Application Layer Electronic Mail 16 / 47

Notes

Notes

Notes

Notes

Simple Mail Transfer Protocol (SMTP)

SMTP: (Simple Mail Transfer Protocol)Really simple (a reason of its success):

1. set up TCP/IP connection between client and server2. client requests server to accept its messages3. server responds, so that client can send.

It is an old protocol, compared to HTTP.the first RFCs date back to the early 80sit has some archaic characteristics. E.g., it is restricted to 7-bitcharacters

Paolo Costa 07 - Application Layer Electronic Mail 17 / 47

Simple Mail Transfer Protocol (SMTP)Abstract Example

elet.polimi.it

clie

nt

cs.vu.nl

server

hellohello, this is elet.polimi.it

hello elet.polimi.it, go aheadI have a message from [email protected]

okay, I got the senderthe message is for [email protected]

okay, I got the receiverhere comes the message

okay, I’m ready to copy. . .

okay, I got the messagebye now

okay, bye

Paolo Costa 07 - Application Layer Electronic Mail 18 / 47

Concrete Example

elet.polimi.it

clie

nt

cs.vu.nl

server

220 cs.vu.nl

HELO elet.polimi.it

250 ok

MAIL FROM: <[email protected]>

250 ok

RCPT TO: <[email protected]>

250 ok

DATA

354 End data with <CR><LF>.<CR><LF>

...

250 Message accepted

QUIT

221 Bye

Paolo Costa 07 - Application Layer Electronic Mail 19 / 47

Message Format

From: [email protected]: Wed, 18 Jun 2006 13:48:22 +0200 (CEST)To: [email protected]: how to send fake e-mail messages

headerlines

empty lineHey Dude,I heard this story about forging messages.Do you know anything about that?...

messagebody

Paolo Costa 07 - Application Layer Electronic Mail 20 / 47

Notes

Notes

Notes

Notes

Message FormatDescription

Basic idea: Don’t prescribe anything concerning the content of amessage, but specify only the header:

To: e-mail address(es) main destinationCc: e-mail address(es) to send copiesBcc: e-mail address(es) to send blind copiesFrom: name of sender(s)Sender: e-mail address senderReceived: line added by each intermediate transfer agentReturn-path: return addressDate: the date and time the message was sentSubject: short summary of the messageReply-To: E-mail address to which replies should be sent

The From: field is often the same as Sender:, so that the latter canbe left out.

Paolo Costa 07 - Application Layer Electronic Mail 21 / 47

Received: Headers

SMTP is almost completely oblivious to the content of a message.One exception is the Received: header.Every receiving SMTP server must add a Received: header.

Received: from tornado.few.vu.nl (tornado.few.vu.nl[130.37.20.3]) by top.few.vu.nl with esmtp id m1K7vVc-000NDJC;Wed, 18 Jun 2008 13:48:34 +0200Received: from smtp2.elet.polimi.it (smtp2.elet.polimi.it[131.175.120.37]) by tornado.few.vu.nl with esmtp idm1K7vVb-000010C for <[email protected]>; Wed, 18 Jun 2008 13:48:34+0200Received: from localhost (localhost.localdomain [127.0.0.1])by smtp2.elet.polimi.it (Postfix) with ESMTP id 8CBE66F59A for<[email protected]>; Wed, 18 Jun 2008 13:48:34 +0200 (CEST)Received: from smtp2.elet.polimi.it ([127.0.0.1]) by localhost(smtp2.elet.polimi.it [127.0.0.1]) (amavisd-new, port 10024)with ESMTP id l20g9fscAq2b for <[email protected]>; Wed, 18 Jun2008 13:48:32 +0200 (CEST)

Paolo Costa 07 - Application Layer Electronic Mail 22 / 47

Message vs. Envelope

Consider the following SMTP client directives

1. MAIL FROM: <[email protected]>

2. RCPT TO: <[email protected]>

3. From: George W. Bush <[email protected]>To: Osama <[email protected]>Subject: warning...

You can run, but you can’t hide!

QuestionAnything wrong with this exchange?

Paolo Costa 07 - Application Layer Electronic Mail 23 / 47

Message vs. Envelope

The MAIL FROM: and RCPT TO: SMTP messages specifyenvelope addressesFrom: and To: (and Cc:) headers within a message definemessage addressesThere are many situations in which it is perfectly legitimate to haveenvelope addresses that don’t match up with the messageaddresses

a message from a mailing lista “blind” copya message to multiple receivers (To: and/or Cc:)a forwarded (or re-sent) message

Paolo Costa 07 - Application Layer Electronic Mail 24 / 47

Notes

Notes

Notes

Notes

Limitations of the Message Format

The standard message format has some serious limitations7-bit (text) contentonly textessentially good exclusively for the English language

The Multipurpose Internet Mail Extensions (MIME) specification(RFC 2045 and RFC 2046) defines useful extensions

Text Plain unformattedRichtext formatted RTF

Image Gif GIF stillJpeg JPEG still

Audio BasicVideo Mpeg MPEG videoApplication Octet-stream binaries

Postscript printable docMessage RFC822 Embedded rfc822 msg

Partial more to followExternal-body provide URL

Multipart Mixed independent partsAlternative same in diff. formatsParallel view all at onceDigest set of rfc822s

Paolo Costa 07 - Application Layer Electronic Mail 25 / 47

POP3

Problem: a user’s mailbox may be stored on a different machinethan the user agent. We need remote access to incoming (andactually also outgoing) messagesSolution: use the Post Office Protocol (POP3):

Paolo Costa 07 - Application Layer Electronic Mail 26 / 47

POP3Example

You can try to connect to you ISP’s POP 3 servertelnet pop3.isp.com 110

Client Server+OK POP3 server ready

USER carolyn+OK

PASS vegetables+OK login successful

LIST1 25052 14302.

RETR 1(sends message 1)

DELE 1RETR 2

(sends message 2)DELE 2QUIT

+OK POP3 server disconnectingPaolo Costa 07 - Application Layer Electronic Mail 27 / 47

IMAP

Observation: POP3 (implicitly) assumes that retrieved mail isdeleted at the server

not a good idea for people wanting to access mail from differentcomputers.

The Internet Message Access Protocol solves this problem.Feature POP3 IMAPWhere is e-mail stored User’s PC ServerWhere is e-mail read Off-line On-lineConnect time required Little MuchUse of server resources Minimal ExtensiveMultiple mailboxes No YesWho backs up mailboxes User ISPGood for mobile users No YesUser control over downloading Little GreatPartial message downloads No YesAre disk quotas a problem No Could be in timeSimple to implement Yes NoWidespread support Yes Growing

Paolo Costa 07 - Application Layer Electronic Mail 28 / 47

Notes

Notes

Notes

Notes

World Wide Web

Basic model: Users and organizations maintain pages ofinformation that contain references to each other as hyperlinksSelecting a link has the effect of pulling in the referenced page

The client has a Web browser that can display Web pages.web pages are formatted in a special markup language which isinterpreted by the browserthis allows for fancy typefonts and the like.

A hyperlink identifies a (remote) Web server that has access to thereferred Web page

when selecting a link, the browser establishes a TCP connection tothe server, and the page is transferred to the user.

A Web server listens for connection requests, accepts one request,returns the page over the connection, and closes it again

a connected client and server speak HTTP (HyperText TransferProtocol).

Paolo Costa 07 - Application Layer WWW 29 / 47

World Wide WebClient/Server Interaction

When a client receives a new Web page, it can access otherservers through the links contained in that new page.Each special feature in a page (i.e. in-line images) is transferredseparately after the page has been copied to the client

this also means establishing and releasing several connections tothe original server

⇒ HTTP 1.1 allows for reusing persistent TCP connectionsPaolo Costa 07 - Application Layer WWW 30 / 47

Web ServersProblem: Most servers need to process many incoming requestsSolution: An often applied design is to use multithreaded servers

If too many requests come in each second, the CPU will not beable to handle the processing load ⇒ use server farms

a front end still accepts incoming requests but sprays them overmultiple CPUs rather than multiple threads

Paolo Costa 07 - Application Layer WWW 31 / 47

Uniform Resource Locators (URL)A URL contains three informative parts(1) the name of a page(2) the name of its location(3) the access protocol

Name Usage Examplehttp Hypertext http://www.cs.vu.nl/~costa/cn/

ftp File transfer ftp://ftp.cs.vu.nl/pub/minix/README

file Local file file:/home/costa/www/cn/index.html

news News group news:comp.os.minix

news News article news:[email protected]

gopher Gopher gopher://gopher.tc.umn.edu/11/Libs

mailto Sending email mailto:[email protected]

telnet Remote login telnet://www.w3.org:80

Disadvantage: URLs contain location informationthey refer to the location where a page is found.this makes it much harder to move/replicate pages around

In both cases, you don’t care where the page is, but just that it hasa worldwide unique name

IETF is working on a system of URNs (Universal Resource Names)to generalize URLs

Paolo Costa 07 - Application Layer WWW 32 / 47

Notes

Notes

Notes

Notes

HTTPOverview

Communication in the Web is generally based on the HyperTextTransfer ProtocolUses a connection-oriented transport mechanism (i.e., TCP)

although it can also work on UDP

Consists of a sequence of requests issued by the client, andresponses issued by the server, each one in response to a singlerequestHTTP is stateless

the behavior of a request does not depend on previous requestsRequest...and reply

try yourself: telnet www.cs.vu.nl 80

GET /~costa/index.php HTTP/1.1Host: www.cs.vu.nlConnection: closeUser-agent: Mozilla/4.0Accept-Language: it

HTTP/1.1 200 OKConnection: closeDate: Wed, 18 Jun 2008 14:00:01 GMTServer: Apache/1.3.0 (Unix)Last-Modified: Tue, 17 Jun 2008 16:44:00 GMTContent-Length: 2557Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-/W3C//DTD HTML 4.01//EN"...

Paolo Costa 07 - Application Layer WWW 33 / 47

HTTPRequests

HTTP supports the following request messages:

Operation DescriptionHead Request to return the header of a documentGet Request to return a document to the clientPut Request to store a documentPost Provide data that are to be added to a document (collection)Delete Request to delete a document

Paolo Costa 07 - Application Layer WWW 34 / 47

HTTPHeader

The request line (e.g., the line with the GET method) may befollowed by additional lines with more information:

Header C/S Contents

Accept C The type of documents the client can handle

Accept-Charset C The character sets are acceptable for the client

Accept-Encoding C The document encodings the client can handle

Accept-Language C The natural language the client can handle

Authorization C A list of the client’s credentials

Date C+S Date and time the message was sent

ETag S The tags associated with the returned document

Expires S The time for how long the response remains valid

From C The client’s e-mail address

Host C The server’s DNS name

If-Match C The tags the document should have

If-None-Match C The tags the document should not have

If-Modified-Since C Tells the server to return a document only if it has been modified since the specified time

If-Unmodified-Since C Tells the server to return a document only if it has not been modified since the specified time

Last-Modified S The time the returned document was last modified

Location S A document reference to which the client should redirect its request

Referer C Refers to client’s most recently requested document

Upgrade C+S The application protocol sender wants to switch to

Warning C+S Information about status of the data in the message

Paolo Costa 07 - Application Layer WWW 35 / 47

Cookies

Problem: The Web is stateless: servers do not keep track of theirclients.

this may be (mis)useful in many casese.g., how do you implement a “shopping cart” ?

Solution: drop a cookie at the client side containing server staterelevant for that client

when a browser contacts a server, a related cookie is sent to theserver, after which a page can be displayed relevant to thatcookie/client.

Domain Contenttoms-casino.com CustomerID=497793521joes-store.com Cart=1-00501;1-07031;2-13721aportal.com Prefs=Stk;SUNW+ORCL;Spt:Jetssneaky.com UserID=3627239101

There is also an Expires fieldThe Secure field indicates that a cookie may be returned only to asecure server.

Paolo Costa 07 - Application Layer WWW 36 / 47

Notes

Notes

Notes

Notes

Example

webbrowser

hispeed.nl

webserver

blah.com

GET / HTTP/1.1Host: blah.com. . .

Session 687876HTTP/1.1 200 OKSet-Cookie: 687876. . .<html><head>. . .</head><body><a href="let-zeppelin">Buy</a>

<a href="deep-purple">Buy</a>

. . .

blah.com: 687876

GET /led-zeppelin HTTP/1.1Host: blah.comCookie: 687876. . .

Led Zeppelin

HTTP/1.1 200 OK. . .<html><head>. . .</head><body><a href="cream">Buy</a>

<a href="beatles">Buy</a>

. . .

GET /cream HTTP/1.1Host: blah.comCookie: 687876. . .

Cream

HTTP/1.1 200 OK. . .<html><head>. . .</head><body><a href="abba">Buy</a>

<a href="ac-dc">Buy</a>

. . .

GET /end-session HTTP/1.1Host: blah.comCookie: 687876. . .

Led Zeppelin

HTTP/1.1 200 OKSet-Cookie: END. . .<html><head>. . .</head><body>Thank you!

. . .

blah.com: END

Paolo Costa 07 - Application Layer WWW 37 / 47

Dynamic Web PagesEssence: Instead of storing and returning statically defined Webpages, servers often generate pages on-the-fly:

Common Gateway Interface: CGI essentially allows you to identifya program and its parameters in a URL.

The server will start a process to execute that program, which, inturn, will return its results (if any) as a regular Web page

#/bin/shecho Content-Type: text/htmlechoecho "<html><head><title>$QUERY_STRING</title><head>"echo "<body><h1>A host interface</h1><pre>"/usr/bin/host "$QUERY_STRING"echo "</pre></body></html>"

Servlet are the Java-based solutionthe webserver contains an instance of the Java virtual machinethey can maintain state (CGI is stateless)

Paolo Costa 07 - Application Layer WWW 38 / 47

Scripting and Web PagesAlternative approach: Let Web pages incorporate interpretablecode; when a page is being processed, the embedded script issimply executed.Distinguish server-side (a) and client-side solutions (b):

e.g.,Server-side: PHP: Hypertext Preprocessor (PHP)<html><head><title>PHP Test</title></head><body><? print("Hello, World!"); ?></body></html>

e.g., Client-side JavaScript<html><body><script language=javascript>document.write("Hello World!");</script></body></html>

Paolo Costa 07 - Application Layer WWW 39 / 47

WWWProxy Servers

Original idea: It is also possible to transfer information referencedby a different transfer protocol (notably FTP).

if the browser does not speak that protocol, a proxy was used.Now: Proxies are mainly used to enhance Web performance bycaching responses.

the proxy cache simply keeps previously requested pages andreturns them on the next request.

Caching can occur both on client-side and server sideIssue: not very useful nowadays with so much dynamic content

on the other hand, we have more and more available bandwidth

Paolo Costa 07 - Application Layer WWW 40 / 47

Notes

Notes

Notes

Notes

Content Delivery Networks

Basic idea: Install a bunch of servers across the Internet andsimply replicate Web pages on those servers.

be sure to redirect clients to the nearest replica serverit exploits the Location header to redirect clients

Example:looking up www.furry-video.com which is a page containingreferences to replicated web pages (identified ashttp://cdn-server.com/...)

Paolo Costa 07 - Application Layer WWW 41 / 47

Multimedia

Problem: The Internet is by-and-large turning partly into aninfrastructure for broadcasting multimedia streams.

streams consist of packets containing samples of audio and video,possibly augmented with data (such as used for subtitles ormeta-information).

Streaming audio: The simplest way to handle this type ofstreaming:

Issue: There’s no real streaminginstead a (potentially very large) file is sent to the client for playbackthe user may have to wait for hours (e.g., a movie) before playing it

Paolo Costa 07 - Application Layer Multimedia 42 / 47

Real Time Streaming Protocol

Better solution: Let the browser start an media player applicationthat sets up a connection to the server, which in turn startsstreaming packets to the player.

we are using RTP on top of UDP.To reduce jitter, buffers are used:

Push Server1. the server just pumps out data until the buffer is filled to the

high-water mark.2. Then the media player tells it to pause and start playing3. When the buffer hits the low-water mark, the media player tells the

media server to start again.Command DescriptionDESCRIBE List media parametersSETUP Establish channelPLAY Start sending data to clientRECORD Start accepting data from clientPAUSE Temporarily stop sending dataTEARDOWN Release channel

Paolo Costa 07 - Application Layer Multimedia 43 / 47

Voice over IP

Essence: Instead of using traditional circuit-switching technology,it may pay off to send digitized voice over a packet-switchingnetwork.Two groups defined a standard.

ITU (the telcos) invented H.323.It’s big, as all other ITU protocols are.

The IETF invented SIPIt’s simpler, like most IETF protocols.

Session Initiation Protocol (SIP)It deals only with setup, management, and termination of sessions.The data transport should use other protocols like RTP.SIP is text-based and runs on UDP as well as TCP.Users are addressed through, for example, telephone URLs

e.g., sip:[email protected]

Not all Voice-over-IP services support ite.g., Skype doesn’t (a proprietary protocol is used)...... but MSN does !

Paolo Costa 07 - Application Layer Multimedia 44 / 47

Notes

Notes

Notes

Notes

SIPExample

Method DescriptionINVITE Request initiation of a sessionACK Confirm initiation of sessionBYE Request termination of sessionOPTIONS Query a host about capabilitiesCANCEL Cancel a pending requestREGISTER Inform redirection server about current location

Paolo Costa 07 - Application Layer Multimedia 45 / 47

Video-on-Demand

Two models:(1) The user can request any video, and stop the incoming stream at

any time(2) The provider broadcasts popular videos, but starts several at short

intervals (near video on demand).

Paolo Costa 07 - Application Layer Multimedia 46 / 47

Video-on-DemandIssues

1. The video server can be pretty hot stuffit requires a lot of storage, which will include tape archives, opticaldisks (as in a juke box), and arrays of magnetic disks (RAIDs).

2. The client will have a set-top box, which is just a simple computerthat does the (MPEG) decoding, has an interface to the network,and controls the TV set (monitor & remote control).

3. How are we ever going to get the bandwidth to our homes (the localloop problem) ?

there are so many possible solutions, and all of them cost a lot.what we’ll need is a convergence of solutions to standards.this means a lot of experimentation in the coming years, much ofwhich is already going on (ADSL, Fiber-to-the-house, etc.)

Paolo Costa 07 - Application Layer Multimedia 47 / 47

Notes

Notes

Notes

Notes