COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.

Slides:



Advertisements
Similar presentations
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Advertisements

HyperText Transfer Protocol (HTTP)
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Web, HTTP and Web Caching
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
PL-IV- Group A HTTP Request & Response Header
FTP (File Transfer Protocol) & Telnet
Mail (smtp), VoIP (sip, rtp)
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
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.
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,…
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
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,
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
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.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
2: Application Layer1 Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
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.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
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.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
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.
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Aras Atalar Prajith R G.
Application Layer Dr. Adil Yousif Lecture 2 CS.
Hypertext Transfer Protocol
Tiny http client and server
Block 5: An application layer protocol: HTTP
How HTTP Works Made by Manish Kushwaha.
Content from Python Docs.
HTTP – An overview.
Hypertext Transfer Protocol
The Hypertext Transfer Protocol
Application layer 1 Principles of network applications 2 Web and HTTP
Lecture 2 Dr. Richard Spillman Fall 2009
Hypertext Transfer Protocol
Hypertext Transport Protocol
Internet transport protocols services
Networks Problem Set 1 Due Oct 3 Bonus Date Oct 2
HTTP Protocol.
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
Computer Communication & Networks
Multimedia and Networks
EEC-484/584 Computer Networks
HTTP Request Method URL Protocol Version GET /index.html HTTP/1.1
لایه ی کاربرد مظفر بگ محمدی 2: Application Layer.
CS 5565 Network Architecture and Protocols
Data Communication EDA344, DIT420 Description of Lab 1 and Optional Programming HTTP Assignment Aras Atalar Prajith R G 24/01/2018.
HyperText Transfer Protocol
Hypertext Transfer Protocol (HTTP)
EEC-484/584 Computer Networks
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
The Application Layer: HTTP
Traditional Internet Applications
HTTP Hypertext Transfer Protocol
An Introduction to the Internet and the Web
CSCI-351 Data communication and Networks
Presentation transcript:

COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017

HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model Client (browser): requests, receives and displays Web objects, can be HTML files, images, videos, … Server (Web server): responds requests with objects Stateless Server maintains no information about past client requests

HTTP message Two types: request, response HTTP request message ASCII (human-readable format) Request line GET /hypertext/WWW/TheProject.html HTTP/1.1 Header lines Host: info.cern.ch User-agent: Mozilla/5.0 Connection: keep-alive Accept-language: en-US End of message (extra carriage return \r, line feed \n)

HTTP methods GET (HTTP/1.0+) POST (HTTP/1.0+) HEAD (HTTP/1.0+) Requests the header only, without the response body PUT (HTTP/1.1+) Uploads the file in the entity body to the path specified in the URL field DELETE (HTTP/1.1+) Deletes the file specified in the URL field

HTTP message HTTP response message Status line HTTP/1.1 200 OK Header lines Date: Thu, 28 Jan 2016 09:53:26 GMT Server: Apache Last-Modified: Thu, 03 Dec 1992 08:37:20 Content-Length: 2217 Connection: close Content-Type: text/html Data <HEADER> <TITLE>The World Wide Web Project</TITLE> </HEADER> <BODY> …

HTTP response status codes 200 OK Request succeeded, requested resource in this message later 301 Moved Permanently Requested resource moved, new location specified in this message later (Location:) 404 Not Found Requested resource not found on this server 451 Unavailable For Legal Reason Requested resource cannot be served for legal reasons 503 Service Unavailable The server is currently unavailable (due to overloading or maintenance)

Content Explore several aspects of the HTTP protocol with Wireshark Basic HTTP GET/response interaction The HTTP CONDITIONAL GET/response interaction Retrieving long documents HTML documents with embedded objects HTTP authentication

Web cache A mechanism for the temporary storage (caching) of web documents, such as HTML pages and images, to reduce bandwidth usage, server load, and perceived lag Clear cache Google Chrome: Ctrl+Shift+Delete → Clear browsing data Mozilla Firefox: Ctrl+Shift+Delete → Clear Now Internet Explorer: Use Chrome or Firefox

Practice 1 Y:\Win32\WiresharkPortable Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-1.html Question 1 (12 marks) What is the HTTP version? What language(s), if any, does your browser indicate that it can accept from the server? What are the IP addresses of your computer and the server? What is the status code returned from the server for the HTML file? When was the HTML file last modified at the server? How many bytes of content are returned to your browser?

Practice 2 Question 2 (10 marks) Inspect the contents of the HTTP request Is there any “If-Modified-Since” line in the request? Does the server explicitly return the contents of the file? How can you tell? Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-1.html again Inspect the contents of the second HTTP request Is there any “If-Modified-Since” line in the request? If so, what information follows the “If-Modified-Since” header? What is the status code returned from the server? Does the server explicitly return the contents of the file? Explain.

Practice 3 Open a new incognito or private window in your browser Google Chrome: Ctrl+Shift+N Mozilla Firefox: Ctrl+Shift+P Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-1.html again Question 3 (4 marks) Does the server explicitly return the content of the file when the browser is in incognito mode? Explain this behavior? Does the browser cache the content in incognito mode? Assuming yes to (b), when will the browser clear the content cached when operating in incognito mode?

Practice 4 Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-2.html Select an HTTP message → Right-click on the TCP layer → Protocol Preferences → Uncheck Allow subdissector to reassemble TCP stream Question 4 (4 marks) How many HTTP requests are sent by your browser? How many data-containing TCP segments were needed to carry the single HTTP response? What is the status code of the response? Are there any HTTP status lines in packets marked as “Continuation”?

Practice 5 Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-3.html Question 5 (4 marks) How many HTTP requests were sent by your browser to retrieve the two images? What IP address(es) was the requests sent to? Does your browser download the two images serially or in parallel? Explain.

Practice 6 Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-4.php Username: ICE-9 Password: Dashwood Question 6 (4 marks) What is the status code of the response to the first HTTP request? What new field is included in the second HTTP request?

Practice 7 Visit http://www4.comp.polyu.edu.hk/~cswklee/comp2322/HTTP/HTTP-5.html Look for the request to retrieve the image file Question 7 What is the status code of the response to the request? What does that mean? Where has the image file been moved to? Normally a second request would be made to retrieve a moved resource from its new location. Why cannot you see the second request in this case?