CS 372 – introduction to computer networks* Wednesday June 30

Slides:



Advertisements
Similar presentations
HTTP Cookies. CPSC Application Layer 2 User-server state: cookies Many major Web sites use cookies Four components: 1) cookie header line of HTTP.
Advertisements

EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
HyperText Transfer Protocol (HTTP)
Application Layer-11 CSE401N: Computer Networks Lecture-4 Application Layer Overview HTTP.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
2: Application Layer1 Chapter 2: Application Layer Our goals: r conceptual, implementation aspects of network application protocols m transport-layer service.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chapter 2: Application Layer
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
1 Creating a network app Write programs that m run on different end systems and m communicate over a network. m e.g., Web: Web server software communicates.
Application Layer Overview and Web/HTTP
9/16/2003-9/18/2003 The Application Layer and Java Programming September 16-18, 2003.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Week 11: Application Layer1 Week 11: Application layer r 2.1 Principles of network applications r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail  SMTP,
Web, HTTP and Web Caching
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
2: Application Layer1 Chapter 2: Application Layer Our goals: r conceptual, implementation aspects of network application protocols m transport-layer service.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
1 K. Salah Module 2.1: Application Layer Application-level protocols provide high-level services –Web and HTTP –DNS –Electronic mail –Remote login –FTP.
Chapter 2 Application Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 4.
Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP  FTP  SMTP / POP3 / IMAP  Focus on client-server.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Some slides are in courtesy of J. Kurose and K. Ross Review of Previous Lecture Network access and physical media Internet structure and ISPs Delay & loss.
2: Application Layer World Wide Web (WWW). Introduction 1-2 Internet protocol stack (recap) r application: supporting network applications m FTP,
Chapter 2, slide: 1 ECE/CS 372 – introduction to computer networks Lecture 5 Announcements: r Lab1 is due today r Lab2 is posted and is due next Tuesday.
CS 3830 Day 7 Introduction : Application Layer 2 Processes communicating Process: program running within a host. r within same host, two processes.
FTP (File Transfer Protocol) & Telnet
Mail (smtp), VoIP (sip, rtp)
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
20-1 Last time □ NAT □ Application layer ♦ Intro ♦ Web / HTTP.
2: Application Layer1 Internet apps: their protocols and transport protocols Application remote terminal access Web file transfer streaming multimedia.
Week 11: Application Layer1 Web and HTTP First some jargon r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,…
Introduction 1 Lecture 6 Application Layer (HTTP) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
2: Application Layer1 Web and HTTP First some jargon Web page consists of base HTML-file which includes several referenced objects Object can be HTML file,
2: Application Layer1 Chapter 2 Application Layer Part 2: Web & HTTP These slides derived from Computer Networking: A Top Down Approach, 6 th edition.
1 Computer Communication & Networks Lecture 28 Application Layer: HTTP & WWW p Waleed Ejaz
Sockets process sends/receives messages to/from its socket
CS1652 September 5 th, 2013 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
1 HTTP EECS 325/425, Fall 2005 September Chapter 2: Application layer r 2.1 Principles of network applications m app architectures m app requirements.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 8 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Application Layer 2-1 Chapter 2 Application Layer 2.2 Web and HTTP.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
Lecture 23 Application Layer ELEN E6761: Communication Networks Instructor: Javad Ghaderi Slides adapted from “Computer Networking: A Top Down Approach”
2: Application Layer 1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April.
Dr. Philip Cannata 1 The Web and HTTP. Dr. Philip Cannata 2 Application Layer 2-2 Chapter 2 Application Layer Computer Networking: A Top Down Approach.
Application Layer 2-1 Lecture 4: Web and HTTP. Web and HTTP First, a review… web page consists of objects object can be HTML file, JPEG image, Java applet,
2: Application Layer 1 Application layer  Principles of network applications  Web and HTTP  FTP, TFTP  TELNET  Electronic Mail  SMTP, POP3, IMAP.
Important r There will be NO CLASS on Friday 1/30/2015! r Please mark you calendars 1.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach, 4 th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
Advance Computer Networks Lecture#05 Instructor: Engr. Muhammad Mateen Yaqoob.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
EEC-484/584 Computer Networks Lecture 4 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Week 11: Application Layer 1 Web and HTTP r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Lecture 5 Internet Core: Protocol layers. Application Layer  We will learn about protocols by examining popular application-level protocols  HTTP 
2: Application Layer 1 Chapter 2 Application Layer These ppt slides are originally from the Kurose and Ross’s book. But some slides are deleted and added.
Block 5: An application layer protocol: HTTP
Internet transport protocols services
Computer Communication & Networks
EEC-484/584 Computer Networks
CS 5565 Network Architecture and Protocols
EEC-484/584 Computer Networks
Presentation transcript:

CS 372 – introduction to computer networks* Wednesday June 30 Announcements: Assignment 2 is posted. * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Acknowledgement: slides drawn heavily from Kurose & Ross Chapter 2, slide:

Chapter 2: Application layer Principles of network applications app architectures app requirements Web and HTTP File transfer: FTP P2P file sharing Socket programming with TCP Chapter 2, slide:

Web and HTTP First some terminologies: Web page consists of objects Object can be HTML file, JPEG image, Java applet, audio file,… Web page consists of base HTML-file which includes several referenced objects Each object is addressable by a URL Example URL (Uniform Resource Locator): www.someschool.edu/someDept/pic.gif host name path name Chapter 2, slide:

HTTP overview: app architecture HTTP: hypertext transfer protocol Web’s appl-layer protocol client/server model client: browser that requests, receives, “displays” Web objects server: Web server sends objects in response to requests HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068 HTTP request PC running Explorer HTTP response HTTP request Server running Apache Web server HTTP response Mac running Navigator Chapter 2, slide:

HTTP overview (continued) Uses TCP: client initiates TCP connection (creates socket) to server, port 80 server accepts TCP connection from client HTTP messages exchanged between browser (HTTP client) and Web server (HTTP server) TCP connection closed HTTP is “stateless” server maintains no information about past client requests aside Protocols that maintain “state” are complex! past history (state) must be maintained if server/client crashes, their views of “state” may be inconsistent, must be reconciled Chapter 2, slide:

HTTP connections Nonpersistent HTTP At most one object is sent over a TCP connection. HTTP/1.0 uses nonpersistent HTTP Persistent HTTP Multiple objects can be sent over single TCP connection between client and server. HTTP/1.1 uses persistent connections in default mode Chapter 2, slide:

Nonpersistent HTTP (contains text, references to 10 jpeg images) Suppose user enters URL www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 1b. HTTP server at host www.someSchool.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 someDepartment/home.index 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time Chapter 2, slide:

Nonpersistent HTTP (cont.) 4. HTTP server closes TCP connection. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects time 6. Steps 1-5 repeated for each of 10 jpeg objects Chapter 2, slide:

Non-Persistent HTTP: Response time Definition of RTT (round trip time): time to send 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 = 2RTT + transmit time time to transmit file initiate TCP connection RTT request received time Chapter 2, slide:

Non-Persistent HTTP: issues time to transmit file initiate TCP connection RTT request received time Nonpersistent HTTP: Name some issues?? requires 2 RTTs per object E.g., a 10 object-page needs ~ 20 RTTs Open/close TCP connection for each object => OS overhead Any ideas for improvement? Chapter 2, slide:

Persistent HTTP Persistent HTTP server leaves connection open after sending response subsequent HTTP messages between same client/server sent over open connection reduces response time Persistent without pipelining: client issues new request only when previous response has been received one RTT for each referenced object Persistent with pipelining: default in HTTP/1.1 client sends requests as soon as it encounters a referenced object as little as one RTT for all the referenced objects Chapter 2, slide:

HTTP request message two types of HTTP messages: request, response ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 Connection: close Accept-language:fr (extra carriage return, line feed) header lines Carriage return, line feed indicates end of message Chapter 2, slide:

HTTP response message 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 data data data data ... header lines Entity body: data, e.g., requested HTML file Chapter 2, slide:

HTTP response status codes In first line in server -> client response message. A few sample codes: 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message (Location:) 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported Chapter 2, slide:

Trying out HTTP (client side) for yourself 1. Telnet to your favorite Web server: telnet cis.poly.edu 80 Opens TCP connection: to port 80 (default HTTP port) at cis.poly.edu (~ IP address) anything typed is sent there 2. Type in a GET HTTP request: By typing this in (hit carriage return twice), you send this minimal (but complete) GET request to HTTP server GET /~ross/ HTTP/1.1 Host: cis.poly.edu 3. Look at response message sent by HTTP server! Try it at home or lab! Chapter 2, slide:

Web and HTTP: Review Question A HTTP request consists of: 1 basic html object 2 referenced JPEG objects All objects of size = 106bits RTT = 1 second Transmission rate = 1Mbps Consider transmission delay of objects only Question: how long it takes to receive the entire page: Non-persistent connection Persistent without pipelining Persistent with pipelining time to transmit file initiate TCP connection RTT request received time Chapter 2, slide:

Web and HTTP: Review Question A HTTP request consists of: 1 basic html object 2 referenced JPEG objects All objects of size = 106bits RTT = 1 second Transmission rate = 1Mbps Consider transmission delay of objects only Answer: (transmit time = 1 sec) a) 3+3+3=9 sec initiate + request + transmit for each of all 3 b) 1+2+2+2=7 sec initiate + (request + transmit for each of all 3) c) 1+2+3=6 sec initiate + (request + transmit for basic) + (one request for 2 + two transmits, one for each of the 2 objects) time to transmit file initiate TCP connection RTT request received time Chapter 2, slide:

User-server state: cookies Example: Susan always access Internet always from PC visits specific e-commerce site for first time when initial HTTP requests arrives at site, site creates: unique ID entry in backend database for ID Many major Web sites use cookies Four components: 1) cookie header line of HTTP response message 2) cookie header line in HTTP request message 3) cookie file kept on user’s host, managed by user’s browser 4) back-end database at Web site

Cookies: keeping “state” (cont.) client server ebay 8734 usual http request msg Amazon server creates ID 1678 for user create entry cookie file usual http response Set-cookie: 1678 ebay 8734 amazon 1678 usual http request msg cookie: 1678 cookie- specific action access usual http request msg cookie: 1678 cookie- spectific action access usual http response msg backend database one week later: ebay 8734 amazon 1678 usual http response msg

Cookies (continued) Cookies and privacy: What cookies can bring: aside Cookies and privacy: cookies permit sites to learn a lot about you you may supply name and e-mail to sites What cookies can bring: authorization shopping carts recommendations user session state (Web e-mail) How to keep “state”: protocol endpoints: maintain state at sender/receiver over multiple transactions cookies: http messages carry state

Web caches (or proxy server) Goal: satisfy client request without involving origin server If page is needed, browser requests it from the Web cache Q: what if object not in cache?? cache requests object from origin server, then returns object to client origin server HTTP response Proxy server HTTP request client HTTP request HTTP response client origin server Chapter 2, slide:

More 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. Chapter 2, slide:

Caching example Assumptions Consequences origin servers avg. object size = 0.1x106bits avg. request rate from institution to origin servers = 10/sec Internet delay = 2 sec Consequences utilization on LAN = 10% (LAN: local area network) utilization on access link = 100% total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + milliseconds public Internet 1 Mbps access link institutional network 10 Mbps LAN institutional cache Chapter 2, slide:

Caching example (cont) origin servers possible solution increase bandwidth of access link to, say, 10 Mbps consequence utilization on LAN = 10% utilization on access link = 10% Total delay = Internet delay + access delay + LAN delay = 2 sec + msecs + msecs often a costly upgrade public Internet 10 Mbps access link institutional network 10 Mbps LAN institutional cache Chapter 2, slide:

Caching example (cont) origin servers possible solution: web 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% total avg delay will also be reduced public Internet 1 Mbps access link institutional network 10 Mbps LAN institutional cache Chapter 2, slide:

Web cache (cont) Solution Advantages are obvious: Upon receiving a web request, a cache must consult origin server to check whether the requested page is up-to-date Conditional GET method What: Sent by cache to origin server: check page status When: For each new request: client checks with cache Advantages are obvious: Reduce response time Reduce internet traffic Any problems with caches?? Local cache copies of web pages may not be up-to-date?? What do we do then? Chapter 2, slide:

If-modified-since: <date> If-modified-since: <date> Conditional GET cache server HTTP request msg If-modified-since: <date> HTTP response HTTP/1.0 304 Not Modified object not modified Goal: don’t send object if cache has up-to-date version How: cache specifies 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 request msg If-modified-since: <date> HTTP response HTTP/1.0 200 OK <data> object modified Chapter 2, slide:

Chapter 2: Application layer Principles of network applications Web and HTTP FTP P2P file sharing Socket programming with TCP Chapter 2, slide:

FTP: the file transfer protocol user interface client file transfer FTP server user at host remote file system local file system transfer file to/from remote host client/server model client: that initiates transfer (to or from remote) server: remote host ftp: RFC 959 Chapter 2, slide:

FTP: separate control, data connections FTP client contacts FTP server to open TCP control connection client browses remote directory by sending commands over the TCP control connection. TCP control connection port 21 TCP data connection port 20 FTP client FTP server when server receives file transfer command, server opens 2nd TCP data connection (for file) to client after transferring one file, server closes TCP data connection. Chapter 2, slide:

FTP: separate control, data connections More on FTP server opens a separate TCP data connection for each file to transfer TCP control stays on control connection: called: “out of band” FTP client server TCP control connection port 21 TCP data connection port 20 FTP server maintains “state”: current directory, earlier authent. => limit on concurrent connections Chapter 2, slide:

Chapter 2: Application layer Principles of network applications Web and HTTP FTP P2P file sharing Socket programming with TCP Chapter 2, slide:

File sharing approaches server peers Alice Bob There are 2 approaches Centralized: Client-server architecture Distributed: P2P architecture (e.g., BitTorrent) obtain list of peers trading chunks peer server Chapter 2, slide:

File sharing: P2P vs. client-server architectures Single point of failure Not scalable More secure Bottleneck P2P Fault-tolerant Scalable Less secure Better Robustness to failure Scalability Security Performance Chapter 2, slide:

Comparing Client-Server, P2P architectures Question : What is the file distribution time: from one server to N hosts? us u2 d1 d2 u1 uN dN Server Network (with abundant bandwidth) File, size F us: server upload bandwidth ui: client/peer i upload bandwidth di: client/peer i download bandwidth Chapter 2, slide:

Client-server: file distribution time server sequentially sends N copies: NF/us time client i takes F/di time to download F u2 u1 d1 d2 us Network (with abundant bandwidth) dN uN = dcs > max { NF/us, F/min(di) } i Time to distribute F to N clients using client/server approach increases linearly in N (for large N) lower bound is also achievable Chapter 2, slide:

P2P: file distribution time server must send one copy: F/us time client i takes F/di time to download Server F u2 u1 d1 d2 us Network (with abundant bandwidth) dN NF bits must be downloaded - NF bits must be uploaded - Fastest possible upload rate (assuming all nodes sending file chunks to same peer) is: us + Sui uN i=1,N dP2P > max { F/us, F/min(di) , NF/(us + Sui) } i=1,N Chapter 2, slide:

Comparing Client-server, P2P architectures Chapter 2, slide:

Chapter 2: Application layer Principles of network applications app architectures app requirements Web and HTTP FTP P2P file sharing Socket programming with TCP (assignment 2) Chapter 2, slide:

Assignment 2- programming part Building a Multi-Threaded Web Server Read Chapter 2, Section 7 first Good examples on how to write socket-programs in Java using TCP Then do your assignment Socket/Java programming: relatively simple and easy to do Chapter 2, slide:

Chapter 2: Summary our study of network apps now complete! specific protocols: HTTP FTP P2P socket programming (assignment 2) application architectures client-server P2P application service requirements: reliability, bandwidth, delay Internet transport service model connection-oriented, reliable: TCP unreliable, datagrams: UDP Chapter 2, slide: