Week 2: HTTP
#Activity
#2.1 - Activity
SSH in using ssh [email protected] -p 5000 and password isfun. Once connected, you will be dropped into the same shell as last week, but this time, we can simplify the process using nc, or netcat! Simply run nc IP PORT, and you will be put into an interactive shell where you simply type what you want to send to the TCP server you connected to, and any data received is immediately printed on the screen.
Connect to the HTTP server on IP 10.0.2.2 (using the default HTTP port!) and follow the instructions. Remember that this is an HTTP server, so you must first send an HTTP GET request manually!
#2.2 - Activity
Continue with context from the previous activity.
#2.3 - Activity
Continue with context from the previous activity.
#2.4 - Activity
Continue with context from the previous activity.
#2.5 - Activity
Continue with context from the previous activity.
#Cookies
#Cookies 1
List the following events in the order in which they occur.
- Client sends
Cookieheader in HTTP request. - Client stores cookie in local file.
- Server accesses cookie entry in backend database.
- Server creates entry in backend database.
- Client sends HTTP request with no
Cookieheader. - Server sends
Set-Cookieheader in HTTP response.
Answer in a list, such as 1,2,3.
#Cookies 2
A user visits amazon.com for the first time. A cookie for the user for amazon.com is saved in the process. A week later, the user returns to the site. Which of the following are components of the cookie system represented in this interaction?
Cookieheader in the HTTP requestCookieheader in the HTTP responseSet-Cookieheader in the HTTP requestSet-Cookieheader in the HTTP response- Cookie file kept by your browser
- Cookie file kept on the website’s server
- Executable script that runs on the user’s computer
- Backend database at the website
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HOL Blocking
#HOL Blocking 1
HTTP/2 introduced a few new communication elements with the goal of mitigating head-of-line (HOL) blocking. Order the following HTTP/2 communication elements from innermost to outermost.
- Stream
- Frame
- Message
Answer with a list, like 1,2,3.
#HOL Blocking 2
A client requests 1 large video file and 3 smaller images using HTTP/2. The objects are divided into frames, which are interleaved to mitigate HOL blocking at the application layer. As shown in the image, the objects are multiplexed into a single stream where the frame arrival order is: two frames of O1, one frame of O2, one frame of O3, and so on.
Suppose the third frame of O1 gets lost. Which objects can be delivered to the client before the loss is recovered? List them in order of their arrival at the client.
Answer with a list, like 1,2,3.
#HTTP
#HTTP 1
Which HTTP operation model typically consumes a larger amount of server resources for the same web page containing many small images and JS/CSS files: nonpersistent HTTP with parallel TCP connections or a single persistent connection with pipelining? Why?
Please note: you only get one submission, so make sure your answer is ready before submitting!
#HTTP 2
Which of the following is found in every HTTP/1.0 and later request message?
- Human-readable status
- Nonce
- Port
- Method
- Path (URL)
- HTTP version
- Host
- Status code
- Stream #
- Content type
- HTML
- Body
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HTTP 3
Which of the following is found in every HTTP 1.0 and later response message?
- Human-readable status
- Nonce
- Port
- Method
- Path (URL)
- HTTP version
- Host
- Status code
- Stream #
- Content type
- HTML
- Body
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HTTP Delay
#HTTP Delay 1
Suppose we are trying to fetch a web page’s index.html page alongside 8 large (1 MB) objects. We are using HTTP/1.0 without parallel connections. Assume the network bandwidth is 10 Mbps. How long does it take to fetch all these objects?
For the sake of simplicity, assume it takes 0.5 seconds to establish a TCP connection. Ignore the time taken to send HTTP requests or to receive small HTTP responses. Ignore other propagation delays.
#HTTP Delay 2
Repeat the scenario in HTTP Delay 1 but now, we are using HTTP/1.0 with 8 parallel connections for the large objects. However, when opening this many connections, the network bandwidth degrades to 1.25 Mbps.
#HTTP Delay 3
Repeat the scenario in HTTP Delay 1 but now, we are using HTTP/1.1 with one persistent connection for all requests.
#HTTP Delay 4
Suppose in the scenario for HTTP Delay 3, we also used HTTP/1.1 pipelining. After the first request to the server, the client knows the 8 objects it needs to request. Then, it can send 8 pipelined requests for these objects. Would this significantly improve the latency compared to HTTP Delay 3? Why or why not?
Please note: you only get one submission, so make sure your answer is ready before submitting!
#HTTP Versions
#HTTP Versions 1
Which of the following features does HTTP/1.0 support?
- Parallel connections
- Persistent connections
- Pipelining
- Multiplexing
- Binary encoding
- Header compression
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HTTP Versions 2
Which of the following features does HTTP/1.1 support?
- Parallel connections
- Persistent connections
- Pipelining
- Multiplexing
- Binary encoding
- Header compression
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HTTP Versions 3
Which of the following features does HTTP/2 support?
- Parallel connections
- Persistent connections
- Pipelining
- Multiplexing
- Binary encoding
- Header compression
Answer with a list, like 1,2,3. List the items in the order in which they appear above.
#HTTP Versions 4
What is the first version of HTTP that allowed for virtual hosting, and what is the name of the header that allowed this to occur?
Answer like 5,cats for HTTP version 5 and header called cats.