1 / 30

UCSD CSE 124 Networked Services Fall 2009

UCSD CSE 124 Networked Services Fall 2009. B. S. Manoj, Ph.D http://cseweb.ucsd.edu/classes/fa09/cse124. Some of these slides are adapted from various sources/individuals including but not limited to the slides from the text books by Kurose and Ross, Tanenbaum, and Peterson and Davie.

Download Presentation

UCSD CSE 124 Networked Services Fall 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UCSD CSE 124Networked ServicesFall 2009 B. S. Manoj, Ph.D http://cseweb.ucsd.edu/classes/fa09/cse124 Some of these slides are adapted from various sources/individuals including but not limited to the slides from the text books by Kurose and Ross, Tanenbaum, and Peterson and Davie. Use of these slides other than for pedagogical purpose for CSE 124, may require explicit permissions from the respective sources. UCSD CSE 124 Networked Services Fall 2009

  2. Design considerations for Network Protocol stack • Design for minimum context switches • e.g., Application layer calls send(.) function with message to be sent • The message can be sent immediately with minimal delay • Application layer calls receive(.): context switching can result • Such cases, call back functions, e.g., deliver(.), can improve performance by minimizing context switches UCSD CSE 124 Networked Services Fall 2009

  3. Design consideration for network protocol stack • Design for copy-free operation • Message copying is expensive • Define and use a common message abstraction across layers and protocols of the stack • Permits passing messages up and down the stack with minimal copying • Manipulation of the messages/packets is done in a copy-free manner • Two approaches • Message processing with a priori memory allocation • Message processing with linked lists UCSD CSE 124 Networked Services Fall 2009

  4. Message processing with a priori memory allocation Pre-assigned memory Application layer message Application Message copy Transport Copy-free Network Copy-free Datalink Copy-free PHY Message copy UCSD CSE 124 Networked Services Fall 2009

  5. Message processing with linked-list implementation Pre-assigned memory Application layer message Application Message copy Transport Copy-free Network Copy-free Datalink Copy-free PHY Message copy UCSD CSE 124 Networked Services Fall 2009

  6. Application Layer Protocols • Hiper Text Transfer Protocol (HTTP) is one of the most popular application layer protocols • HTTP drives the success of WWW • Handles heterogeniety of clients and servers • WWW is a collection of cooperating servers and clients speaking HTTP • A web browser software helps users to open web locations, referred to as Uniform Resource Locators (URLs) • http://www.ucsd.edu/index.html • http://cseweb.ucsd.edu/classes/fa09/cse124 HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator UCSD CSE 124 Networked Services Fall 2009

  7. HTTP • HTTP is a text-based protocol • Readable text-based commands, unlike binary-commands or code-based commands, and information are used for communication • Defines how the communication between a web browser and web server can take place • Is stateless • It does not require any state information • However, new methods are added on to gather state or user information • For example, cookies • Two kinds of messages used • REQUEST messages • RESPONSE messages • General message form • START_LINE <CRLF> • MESSAGE_HEADER <CRLF> • <CRLF> • MESSAGE_ BODY <CRLF> UCSD CSE 124 Networked Services Fall 2009

  8. HTTP • A webpage contains one or more objects • Can be html files, JPEG or GIF images, JAVA applet, or a video clip • A web page with one html file and n other number of additional objects making it n+1 total objects • All these objects are located by URLs • e.g., http://classweb.ucsd.edu/classes/fa09/cse124/index.html • A URL has two parts • A host part: classweb.ucsd.edu • A file name with path information: /classes/fa09/cse124/index/html • A user requests a web server object by • Either entering the URL on the browser’s address bar • Or clicking a hyper link on a web page UCSD CSE 124 Networked Services Fall 2009

  9. Suppose user enters URL www.classweb.ucsd.edu/classes/fa09/cse124/index.html 1a. HTTP client initiates TCP connection to HTTP server (process) at www.classweb.ucsd.edu on port 80 An HTTP session (contains text, references to 10 jpeg images) 1b. HTTP server at host www.classweb.ucsd.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object classes/fa09/cse124/index.html 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time UCSD CSE 124 Networked Services Fall 2009

  10. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects An HTTP Session (cont.) 4. HTTP server closes TCP connection. time 6.Steps 1-5 repeated for each of 10 jpeg objects UCSD CSE 124 Networked Services Fall 2009

  11. HTTP message format • General format => request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.0 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:en (extra carriage return, line feed) header lines Carriage return, line feed indicates end of message UCSD CSE 124 Networked Services Fall 2009

  12. HTTP REQUEST operations • GET: Fetches a specific web object • HEAD: Fetch the status of the specific web object (such as time stamp) • POST: Send information (filled forms, or other info) to the server • PUT: Store documents at the specific web URL (used for uploading documents) • DELETE: Delete a specific URL (with sufficient permissions) • TRACE: Loop back the message (for debugging, or for security verifications) • CONNECT: For use by proxy servers or for future purpose • OPTIONS: Query certain options available with servers UCSD CSE 124 Networked Services Fall 2009

  13. Response messages status line (protocol status code status phrase) HTTP/1.1 200 OK Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data content here (NON textual data in MIME encoded) header lines data, e.g., requested HTML file UCSD CSE 124 Networked Services Fall 2009

  14. initiate TCP connection RTT request file time to transmit file RTT file received time time Non-Persistent HTTP: Response time Definition of RTT: time for a small packet to travel from client to server and back. Response time: • one RTT to initiate TCP connection • one RTT for HTTP request and first few bytes of HTTP response to return • file transmission time total = 2RTT+transmit time UCSD CSE 124 Networked Services Fall 2009

  15. Non-persistent and Persistent HTTP UCSD CSE 124 Networked Services Fall 2009

  16. Data rendering using HTML • Very simple text-based format • Uses a set of tags to render the information in a web browser • Supports a large number of types of data to be typed • Image, scripts, forms, etc • Constantly being improved • For example, XML or other dynamic forms • Originally defined for static content UCSD CSE 124 Networked Services Fall 2009

  17. Dynamic content • Dynamic content are produced as a result of execution some back-end program or script at the web-server • Most recent web-based systems require dynamic content generation and delivery • Two types • Server side dynamic content generation • Many popular types • CGI Scripts • Server-based scripts • PHP • Java Server Pages • Active Server Pages • Client side dynamic content generation • Executed at the client web-browser • JavaScripts • ActiveX Controls UCSD CSE 124 Networked Services Fall 2009

  18. Common Gateway Interface (CGI) scripts • Allows web servers to talk to back-end programs or data bases • CGI scripts accepts data and generate HTML pages in return • Usually implemented in Perl or scripting languages • Usually CGI scripts are placed in a folder called CGI-bin • e.g., www.somesite.com/cgi-bin/signup.perl UCSD CSE 124 Networked Services Fall 2009

  19. Server-side scripts for dynamic content generation • Simpler than CGI-scripts • Can be embedded in the HTML files • can be executed by the web server directly for generating the dynamic content • A popular open source solution is PHP • PHP: Hypertext Preprocessor • Pages created by php has extension .php • An example script • Other solutions • Java Server Pages • Active Server Pages UCSD CSE 124 Networked Services Fall 2009

  20. Client-side dynamic content generation • Unlike server-side dynamic content generation, client-side dynamic content generation does not involve server interaction • JavaScript or ActiveX controls are popular software scripts for generating client-side dynamic content generation UCSD CSE 124 Networked Services Fall 2009

  21. State maintenance in HTTP sessions • Most recent web servers attempt to maintain state information • To better serve connections and users • To provide differentiated services to users • Two main methods: • protocol endpoints: maintain state at sender/receiver over multiple transactions • cookies: carried in http messages can contain session state • Cookies • State information is maintained by storing small text files called cookies • Server can request to store a short text file or information in the client machine’s hard disk • For subsequent visits, the client web browser transmits the information back to the server • Four steps for Cookies • cookie header line of HTTP responsemessage • cookie header line in HTTP requestmessage • cookie file kept on user’s host, managed by user’s browser • back-end database at Web site UCSD CSE 124 Networked Services Fall 2009

  22. ebay 8734 usual http request msg Amazon server creates ID 1678 for user usual http response Set-cookie: 1678 create entry ebay 8734 amazon 1678 ebay 8734 amazon 1678 usual http request msg cookie: 1678 access cookie- specific action usual http response msg usual http response msg access usual http request msg cookie: 1678 cookie- spectific action Cookies: An example client server cookie file backend database one week later: UCSD CSE 124 Networked Services Fall 2009

  23. 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 HTTP request HTTP request HTTP response HTTP response HTTP request HTTP response Web caches (proxy server) Goal: satisfy client request without involving origin server origin server Proxy server client client origin server UCSD CSE 124 Networked Services Fall 2009

  24. A Web cache acts as both client and server Typically Web 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) More about Web caching UCSD CSE 124 Networked Services Fall 2009

  25. Assumptions average object size = 1,000,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 sec Consequences utilization on LAN = (15/sec)x(1Mbits)/100Mbps= 15% utilization on access link = (15/sec)x(1Mbits)/15Mbps =100% total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + milliseconds Caching example origin servers public Internet 15 Mbps access link institutional network 100 Mbps LAN institutional cache UCSD CSE 124 Networked Services Fall 2009

  26. possible solution increase bandwidth of access link to, say, 100 Mbps consequence utilization on LAN = 15% utilization on access link = 15% Total delay = Internet delay + access delay + LAN delay = 2 sec + msecs + msecs often a costly upgrade Caching example (cont) origin servers public Internet 100 Mbps access link institutional network 100 Mbps LAN institutional cache UCSD CSE 124 Networked Services Fall 2009

  27. possible solution: install cache suppose hit rate is 0.4 consequence 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 secs Caching example (cont) origin servers public Internet 15 Mbps access link institutional network 100 Mbps LAN institutional cache UCSD CSE 124 Networked Services Fall 2009

  28. Goal: don’t send object if cache has up-to-date cached version cache: specify date 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 response HTTP/1.0 304 Not Modified Conditional GET server cache HTTP request msg If-modified-since: <date> object not modified HTTP request msg If-modified-since: <date> object modified HTTP response HTTP/1.0 200 OK <data> UCSD CSE 124 Networked Services Fall 2009

  29. Summary • Copy free operations for protocol stack efficiency • Application layer protocol: HTTP • Dynamic content generation for HTTP • Web Caching/Proxy servers for HTTP UCSD CSE 124 Networked Services Fall 2009

  30. Homework-1 • Capture one or more HTTP session messages using Wireshark for the following two URLs and briefly explain the trace including the image of the trace • http://cseweb.ucsd.edu/classes/fa09/cse124/index.html • http://blink.ucsd.edu • Deadline: Next week Thursday, the 8th October, 2009 • Submission by email with SUBJECT: CSE-124-Fall-2009-HomeWork-1:<YourFirstName> • Chapter 2, Problem P9 from Kurose and Ross (Page 183) in 5th edition • Submission either in paper or by email with SUBJECT: CSE-124-Fall-2009-HomeWork-1:<YourFirstName> UCSD CSE 124 Networked Services Fall 2009

More Related