DOC PREVIEW
UCLA COMSCI 118 - Chapter2B_4th_ed

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS118 Spring 2014Let’s look at HTTP in actionUser-server state: cookiesCookies: keeping “state” (cont.)Cookies (continued)Web caches (proxy server)More about Web cachingCaching exampleCaching example (cont)Slide 10Conditional GETChapter 2: Application layerFTP: the file transfer protocolFTP: separate control, data connectionsFTP commands, responsesSlide 16Electronic MailScenario: Alice sends message to BobSlide 19Electronic Mail: mail serversElectronic Mail: SMTP [RFC 2821]Slide 22Sample SMTP interactionTry SMTP interaction for yourself:SMTP: final wordsMail message formatMessage format: multimedia extensionsMail access protocolsPOP3 protocolPOP3 (more) and IMAPCS118 Spring 2014Lecture 2B2: Application Layer 2Let’s look at HTTP in actiontelnet exampleEthereal example2: Application Layer 3User-server state: cookiesMany major Web sites use cookiesFour components:1) cookie header line of HTTP response message2) cookie header line in HTTP request message3) cookie file kept on user’s host, managed by user’s browser4) back-end database at Web siteExample:Susan always accesses Internet from PCvisits specific e-commerce site as first thingwhen initial HTTP requests arrives at site, site creates: unique IDentry in backend database for ID2: Application Layer 4Cookies: keeping “state” (cont.)clientserverusual http response msgusual http response msgcookie fileone week later:usual http request msgcookie: 1678cookie-specificactionaccessebay 8734usual http request msgAmazon servercreates ID1678 for usercreate entryusual http response Set-cookie: 1678 ebay 8734amazon 1678usual http request msgcookie: 1678cookie-spectificactionaccessebay 8734amazon 1678backenddatabase2: Application Layer 5Cookies (continued)What cookies can bring:authorizationshopping cartsrecommendationsuser session state (Web e-mail)Cookies and privacy:cookies permit sites to learn a lot about youyou may supply name and e-mail to sitesasideHow to keep “state”:protocol endpoints: maintain state at sender/receiver over multiple transactionscookies: http messages carry state2: Application Layer 6Web caches (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 clientGoal: satisfy client request without involving origin serverclientProxyserverclientHTTP requestHTTP responseHTTP requestHTTP requestorigin serverorigin serverHTTP responseHTTP response2: Application Layer 7More about Web cachingcache acts as both client and servertypically cache is installed by ISP (university, company, residential ISP)Why Web caching?reduce response time for client requestreduce traffic on an institution’s access link.Internet dense with caches: enables “poor” content providers to effectively deliver content (but so does P2P file sharing)2: Application Layer 8Caching example Assumptionsaverage object size = 100,000 bitsavg. request rate from institution’s browsers to origin servers = 15/secdelay from institutional router to any origin server and back to router = 2 secConsequencesutilization on LAN = 15%utilization on access link = 100%total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + millisecondsoriginserverspublic Internetinstitutionalnetwork10 Mbps LAN1.5 Mbps access linkinstitutionalcache2: Application Layer 9Caching example (cont)possible solutionincrease bandwidth of access link to, say, 10 Mbpsconsequenceutilization on LAN = 15%utilization on access link = 15%Total delay = Internet delay + access delay + LAN delay = 2 sec + msecs + msecsoften a costly upgradeoriginserverspublic Internetinstitutionalnetwork10 Mbps LAN10 Mbps access linkinstitutionalcache2: Application Layer 10Caching example (cont)possible solution: install cachesuppose hit rate is 0.4consequence40% requests will be satisfied almost immediately60% requests satisfied by origin serverutilization of access link reduced to 60%, resulting in negligible delays (say 10 msec)total avg delay = Internet delay + access delay + LAN delay = .6*(2.01) secs + .4*milliseconds < 1.4 secsoriginserverspublic Internetinstitutionalnetwork10 Mbps LAN1.5 Mbps access linkinstitutionalcache2: Application Layer 11Conditional GETGoal: don’t send object if cache has up-to-date cached versionserver: response contains no object if cached copy is up-to-date: HTTP/1.0 304 Not Modifiedcache: specify date of cached copy in HTTP requestIf-modified-since: <date>cacheserverHTTP request msgIf-modified-since: <date>HTTP responseHTTP/1.0 304 Not Modifiedobject not modifiedHTTP request msgIf-modified-since: <date>HTTP responseHTTP/1.0 200 OK<data>object modified2: Application Layer 12Chapter 2: Application layer2.1 Principles of network applications2.2 Web and HTTP2.3 FTP 2.4 Electronic MailSMTP, POP3, IMAP2.5 DNS2.6 P2P file sharing2.7 Socket programming with TCP2.8 Socket programming with UDP2.9 Building a Web server2: Application Layer 13FTP: the file transfer protocoltransfer file to/from remote hostclient/server modelclient: side that initiates transfer (either to/from remote)server: remote hostftp: RFC 959ftp server: port 21file transferFTPserverFTPuserinterfaceFTPclientlocal filesystemremote filesystemuser at host2: Application Layer 14FTP: separate control, data connectionsFTP client contacts FTP server at port 21, TCP is transport protocolclient authorized over control connectionclient browses remote directory by sending commands over control connection.when server receives file transfer command, server opens 2nd TCP connection (for file) to clientafter transferring one file, server closes data connection.FTPclientFTPserverTCP control connectionport 21TCP data connectionport 20server opens another TCP data connection to transfer another file.control connection: “out of band”FTP server maintains “state”: current directory, earlier authentication2: Application Layer 15FTP commands, responsesSample commands:sent as ASCII text over control channelUSER usernamePASS passwordLIST return list of file in current directoryRETR filename retrieves (gets) fileSTOR filename stores (puts) file onto remote hostSample return codesstatus code and phrase (as in HTTP)331 Username


View Full Document

UCLA COMSCI 118 - Chapter2B_4th_ed

Download Chapter2B_4th_ed
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter2B_4th_ed and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter2B_4th_ed 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?