Application layer 2 Flashcards
What is the Hypertext Transfer Protocol (HTTP)?
• The web’s application layer protocol
• Defined in RFC 1945 (HTTP/1.0) and RFC 2616 (HTTP/1.1)
• Typically operates on port 80
What does a web page consist of?
• A base HTML file
• Several referenced objects (e.g., images, Java applets, audio files)
• Each object is addressable by a URL
How does HTTP operate as a client/server protocol?
• The client (browser) requests and displays web objects
• The server sends requested objects
• HTTP servers are stateless
What underlying transport protocol does HTTP use?
• TCP
What does the first diagram (D1) represent?
- Communication between client browsers (PC and iPhone) and a web server
- Via HTTP request and HTTP response messages
What browser and server software are shown in D1?
- PC: Firefox browser
- iPhone: Safari browser
- Server: Apache Web Server
In the TCP handshake and data transfer diagram (D2), what steps are shown?
- Initiating TCP connection
- Requesting a file
- Receiving a file after Round Trip Time (RTT) delays
What does RTT represent?
- Round-trip time for a small packet to travel to the server and back, including delays
How many RTTs are involved before file data transmission starts in non-persistent HTTP?
- 2 RTTs
How does non-persistent HTTP handle multiple objects?
• Opens a new TCP connection for each object
• Closes the connection after each object transfer
How does persistent HTTP improve performance?
• Keeps the TCP connection open
• Allows multiple objects to be transferred in fewer RTTs
What does the HTTP request message structure (D3) show?
- Request line (method, URL, HTTP version)
- Header lines
- Blank line
- Optional entity body
Give an example of an HTTP request line.
```plaintext
GET /index.html HTTP/1.1\r\n
~~~
What is indicated by a carriage return and line feed (\r\n) in HTTP?
• Marks the end of header lines
What are common HTTP request methods?
• GET
• POST
• HEAD
What does an HTTP response message consist of?
• Status line (protocol version, status code, status phrase)
• Header lines
• Blank line
• Data (requested content)
What is the purpose of cookies in HTTP?
• Maintain session state information
• Identify users and manage personalized sessions
What components make up an HTTP cookie system?
• Cookie header in HTTP request and response
• Cookie file on the client
• Server-side database
What is a web cache (proxy server)?
• Satisfies HTTP requests on behalf of an origin server
• Reduces response time and network traffic
What is conditional GET used for in caching?
• Avoids stale data
• Uses If-Modified-Since and Last-Modified headers
What does the SMTP email diagram (D4) illustrate?
- Mail servers communicating via SMTP
- User agents interacting with mail servers
- Outgoing message queues and user mailboxes
What three components make up an email system?
• User agents
• Mail servers
• SMTP protocol
How does SMTP transfer email?
• Uses TCP (port 25)
• Direct server-to-server message transfer
What are the three phases of SMTP interaction?
• Handshaking
• Message transfer
• Closure