1 / 19

IERG 4180 Tutorial 6 Lei Deng 2013-10-30/2013-11-01

IERG 4180 Tutorial 6 Lei Deng 2013-10-30/2013-11-01. Some contents are from the Internet. Some Reminders. Please submit your declaration form to us for your project 2. Either is OK: Hard Copy Soft copy to Jim’s email, nhw013@ie.cuhk.edu.hk. HTTP: Introduction.

tovah
Download Presentation

IERG 4180 Tutorial 6 Lei Deng 2013-10-30/2013-11-01

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. IERG 4180 Tutorial 6 Lei Deng2013-10-30/2013-11-01 Some contents are from the Internet

  2. Some Reminders • Please submit your declaration form to us for your project 2. Either is OK: • Hard Copy • Soft copy to Jim’s email, nhw013@ie.cuhk.edu.hk

  3. HTTP: Introduction • HTTP: HyperTextTransfer Protocol • Rules for request-response transfer between web servers (web sites) and web clients (web browser) • HTML: HyperTextMarkup Language • Definitions of tags that are integrated into web text documents to control their appearance • Language of the Web • Foundation of data communication for the World Wide Web (WWW)

  4. HTTP: History • HTTP/0.9 – 1991 • Created by Tim Berners-Lee, along with HTML • Only GET and HTML • HTTP/1.0 – 1995 • RFC 1945 • Meta-information,Caching, Authorization, etc. • HTTP/1.1 - 1999 • RFC 2616 • Byte ranges, Chunked encoding, Content Negotiation, Protocol switching, Digest authentication, etc.

  5. HTTP: Layer HTTP is an application layer protocol Transport Protocol: TCP Known port: 80

  6. I would like to open a connection GET <file location> Display response Close connection OK Send page or error message OK HTTP: A Conversation Example Client Server

  7. HTTP: URI • URI: Uniform Resource Identifiers • provide a simple and extensible means for identifying a resource • Include URN (Uniform Resource Name) and URL (Uniform Resource Locator) • Examples: • ftp://ftp.is.co.za/rfc/rfc1808.txt • http://www.math.uio.no/faq/compression-faq/part1.html • mailto:mduerst@ifi.unizh.ch • telnet://melvyl.ucop.edu/

  8. HTTP: URI • URI with scheme HTTP • syntax: • "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]] • Same URIs in HTTP • http://abc.com:80/~smith/home.html • http://ABC.com/%7Esmith/home.html • http://ABC.com:/%7esmith/home.html

  9. HTTP: Methods • GET • retrieve a HTTP URI from the server • The only one required in Project 3! • OPTIONS, HEAD, POST, PUT, DELETE, TRACE, CONNECT

  10. HTTP: Request • Format: <request-line><general-headers><request-headers><entity-headers><empty-line>[<message-body>][<message-trailers>] • request-line Method SP Request-URI SP HTTP-Version CRLF • Examples: • GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1 • GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.w3.org

  11. HTTP: Request Examples

  12. HTTP: Response • Format: <status-line> <general-headers> <response-headers> <entity-headers> <empty-line> [<message-body>] [<message-trailers>] • Status-line HTTP-Version SP Status-Code SP Reason-Phrase CRLF • Message-body • html file, video, image, etc. • Only text html file required in Project 3!

  13. HTTP: Response • Status Code • 1xx: Informational - Request received, continuing process • 2xx: Success - The action was successfully received, understood, and accepted • 3xx: Redirection - Further action must be taken in order to complete the request • 4xx: Client Error - The request contains bad syntax or cannot be fulfilled • 5xx: Server Error - The server failed to fulfill an apparently valid request

  14. HTTP: Response Example:

  15. HTTPERF: Introduction httperf is a tool for measuring web server performance by generating various HTTP workloads Free GNU software Only for Linux system Support HTTP/1.1

  16. HTTPERF: How to Build • I tried sourceforge version but cannot build. And 0.9.0 version works from ftp://ftp.hpl.hp.com/pub/httperf/. • SRCDIR refers to the httperf source directory • e.g., /home/dlll/httperf-0.9.0/httperf-0.9.0 • Build Batch • $ mkdir build • $ cd build • $ SRCDIR/configure • $ make • $ make install (may need root access)

  17. HTTPERF: Test Example • httperf --hop Use as many TCP ports as possible --server www.cuhk.edu.hk Specify the sever --port 80 Specify the port --uri/english/index.html The file you want to download --rate 400 The rate in requests/second --num-conn 8000 The total number of TCP Connections --timeout 20 The request will fail if it takes longer than this

  18. HTTPERF: Test Example

  19. HTTPERF: Resources • HP httperf Homepage: • http://www.hpl.hp.com/research/linux/httperf/ • httperf source packages: • http://sourceforge.net/projects/httperf/ • ftp://ftp.hpl.hp.com/pub/httperf/ • Ted Bullock's httperfpage • http://www.comlore.com/httperf.html

More Related