Podcast
Questions and Answers
What HTTP response status code indicates that the requested object has been moved to a new location?
What HTTP response status code indicates that the requested object has been moved to a new location?
In the context of HTTP, what does a 404 status code signify?
In the context of HTTP, what does a 404 status code signify?
When establishing a TCP connection to an HTTP server, what is the default port used?
When establishing a TCP connection to an HTTP server, what is the default port used?
What does a 400 status code signify in the context of HTTP?
What does a 400 status code signify in the context of HTTP?
Signup and view all the answers
Which HTTP version is mentioned in the request message 'GET /fee/NewsDetails/142317/en HTTP/1.1'?
Which HTTP version is mentioned in the request message 'GET /fee/NewsDetails/142317/en HTTP/1.1'?
Signup and view all the answers
What does sending a minimal GET request involve in terms of communication with an HTTP server?
What does sending a minimal GET request involve in terms of communication with an HTTP server?
Signup and view all the answers
Which status code indicates that the HTTP version used in the request is not supported?
Which status code indicates that the HTTP version used in the request is not supported?
Signup and view all the answers
'ncat www.menofia.edu.eg 80' is an example of what kind of connection in the context of HTTP?
'ncat www.menofia.edu.eg 80' is an example of what kind of connection in the context of HTTP?
Signup and view all the answers
'GET /fee/NewsDetails/142317/en HTTP/1.1' is an example of what part of an HTTP transaction?
'GET /fee/NewsDetails/142317/en HTTP/1.1' is an example of what part of an HTTP transaction?
Signup and view all the answers
'Host: www.menofia.edu.eg' is typically found in which part of an HTTP request message?
'Host: www.menofia.edu.eg' is typically found in which part of an HTTP request message?
Signup and view all the answers
Study Notes
HTTP Protocol
- Past history (state) must be maintained, and reconciled in case of server/client crashes
- HTTP connections have two types: non-persistent and persistent
Non-Persistent HTTP
- One TCP connection is opened and closed for each object
- Example: user enters URL
www.someSchool.edu/someDepartment/home.index
containing text and references to 10 jpeg images - Steps:
- HTTP client initiates TCP connection to HTTP server at port 80
- HTTP client sends HTTP request message containing URL
- HTTP server receives request message, forms response message, and sends message into its socket
- HTTP server closes TCP connection
- This process is repeated for each of the 10 jpeg objects
- RTT (Round Trip Time) is the time for a small packet to travel from client to server and back
- HTTP response time per object: 2RTT + file transmission time
Issues with Non-Persistent HTTP
- Requires 2 RTTs per object
- OS overhead for each TCP connection
- Browsers often open multiple parallel TCP connections to fetch referenced objects in parallel
Persistent HTTP (HTTP 1.1)
- Server leaves connection open after sending response
- Subsequent HTTP messages between same client/server are sent over open connection
- Client sends requests as soon as it encounters a referenced object
- Response time is reduced to as little as one RTT for all referenced objects
HTTP Request and Response Messages
- Two types of HTTP messages: request and response
- HTTP request message:
- ASCII (human-readable format)
- Request line (GET, POST, HEAD commands)
- Header lines
- HTTP response message:
- Status codes (e.g. 200 OK, 301 Moved Permanently, 400 Bad Request, 404 Not Found, 505 HTTP Version Not Supported)
Trying out HTTP (Client Side)
- Use
ncat
tool to connect to a web server (e.g.www.menofia.edu.eg
) - Type in a GET HTTP request message (e.g.
GET /fee/NewsDetails/142317/en HTTP/1.1
) - Observe the response message sent by the HTTP server
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn about the differences between persistent and non-persistent HTTP connections in this quiz. Explore how maintaining the past history (state) is crucial, and how to reconcile inconsistent views of 'state' when servers or clients crash.