Podcast
Questions and Answers
What does the HTTP status code 200 indicate?
What does the HTTP status code 200 indicate?
- The requested document was not found.
- The request succeeded and the requested object is included in the response. (correct)
- The requested object has been moved permanently.
- The request was not understood by the server.
Which status code would you receive if the document requested does not exist on the server?
Which status code would you receive if the document requested does not exist on the server?
- 400 Bad Request
- 200 OK
- 301 Moved Permanently
- 404 Not Found (correct)
What is the purpose of the 'Host' header in an HTTP GET request?
What is the purpose of the 'Host' header in an HTTP GET request?
- It identifies the web server being contacted. (correct)
- It specifies the method of the request.
- It informs the server of the requested object's location.
- It indicates the version of HTTP being used.
If a webpage has moved to a new URL permanently, which status code is returned?
If a webpage has moved to a new URL permanently, which status code is returned?
What is indicated by a 505 HTTP Version Not Supported status code?
What is indicated by a 505 HTTP Version Not Supported status code?
What is a key characteristic of non-persistent HTTP connections?
What is a key characteristic of non-persistent HTTP connections?
Why must state be maintained in a client-server architecture, particularly with HTTP?
Why must state be maintained in a client-server architecture, particularly with HTTP?
What is the total response time for non-persistent HTTP when transferring a file?
What is the total response time for non-persistent HTTP when transferring a file?
Which HTTP method is used to submit form input to a server in the entity body?
Which HTTP method is used to submit form input to a server in the entity body?
What status code indicates a successful HTTP request in the response message?
What status code indicates a successful HTTP request in the response message?
In the context of HTTP, what does RTT stand for?
In the context of HTTP, what does RTT stand for?
Which HTTP method allows for the deletion of a file specified in the URL field?
Which HTTP method allows for the deletion of a file specified in the URL field?
Which header line in an HTTP request message indicates the end of header fields?
Which header line in an HTTP request message indicates the end of header fields?
Which of the following correctly describes persistent HTTP's handling of requests?
Which of the following correctly describes persistent HTTP's handling of requests?
What part of an HTTP request carries the details that define what action to perform on the server?
What part of an HTTP request carries the details that define what action to perform on the server?
What character sequence indicates that the server should keep the connection alive for persistent HTTP?
What character sequence indicates that the server should keep the connection alive for persistent HTTP?
A client-server architecture requires that clients communicate directly with each other.
A client-server architecture requires that clients communicate directly with each other.
In peer-to-peer (P2P) architecture, every peer can request services from other peers and provide services in return.
In peer-to-peer (P2P) architecture, every peer can request services from other peers and provide services in return.
The socket serves as a mechanism for a process to send and receive messages, analogous to a door.
The socket serves as a mechanism for a process to send and receive messages, analogous to a door.
Processes in different hosts communicate by exchanging messages rather than through inter-process communication.
Processes in different hosts communicate by exchanging messages rather than through inter-process communication.
In a client-server architecture, the server always has a dynamic IP address.
In a client-server architecture, the server always has a dynamic IP address.
The client directly queries the authoritative name server for the IP address of a website.
The client directly queries the authoritative name server for the IP address of a website.
DNS operates as a distributed, hierarchical database system.
DNS operates as a distributed, hierarchical database system.
Load distribution can be achieved through host aliasing in DNS.
Load distribution can be achieved through host aliasing in DNS.
Root DNS servers have the capability to resolve names directly without contacting any other servers.
Root DNS servers have the capability to resolve names directly without contacting any other servers.
A single point of failure in a DNS infrastructure can impact the entire system's reliability.
A single point of failure in a DNS infrastructure can impact the entire system's reliability.
Once a name server learns the mapping, it will keep the mapping indefinitely in its cache.
Once a name server learns the mapping, it will keep the mapping indefinitely in its cache.
The type 'MX' in DNS records refers to the alias name for a canonical name.
The type 'MX' in DNS records refers to the alias name for a canonical name.
DDoS attacks on root servers have been completely unsuccessful to date.
DDoS attacks on root servers have been completely unsuccessful to date.
Inserting DNS records requires providing only the IP address of the authoritative server.
Inserting DNS records requires providing only the IP address of the authoritative server.
The DNS query message format consists of a header and variable number of questions and answers.
The DNS query message format consists of a header and variable number of questions and answers.
Cached DNS entries always reflect the current IP address associated with a hostname.
Cached DNS entries always reflect the current IP address associated with a hostname.
The 'A' type record in DNS specifies an authoritative name server for a given domain.
The 'A' type record in DNS specifies an authoritative name server for a given domain.
The term 'recursion desired' in a DNS message indicates that the server should not perform additional queries.
The term 'recursion desired' in a DNS message indicates that the server should not perform additional queries.
Type 'CNAME' in DNS indicates that the name is an alias for another canonical name.
Type 'CNAME' in DNS indicates that the name is an alias for another canonical name.
A typical DDoS attack relies solely on bombarding TLD servers without filtering traffic.
A typical DDoS attack relies solely on bombarding TLD servers without filtering traffic.
In a client-server architecture, clients may have static IP addresses.
In a client-server architecture, clients may have static IP addresses.
P2P architecture does not require an always-on server.
P2P architecture does not require an always-on server.
The socket is used by a process to manage network communications like a mailbox.
The socket is used by a process to manage network communications like a mailbox.
In peer-to-peer (P2P) architecture, peers can communicate directly with each other.
In peer-to-peer (P2P) architecture, peers can communicate directly with each other.
Processes on different hosts communicate using inter-process communication defined by the operating system.
Processes on different hosts communicate using inter-process communication defined by the operating system.
An IP address and port number together suffice for identifying a process on a host.
An IP address and port number together suffice for identifying a process on a host.
TCP service provides unreliable transport between sending and receiving processes.
TCP service provides unreliable transport between sending and receiving processes.
Some applications can tolerate a minimum amount of throughput to be considered effective.
Some applications can tolerate a minimum amount of throughput to be considered effective.
UDP provides flow control to manage data transfer between processes.
UDP provides flow control to manage data transfer between processes.
Real-time audio and video applications require a lossless data transfer to be effective.
Real-time audio and video applications require a lossless data transfer to be effective.
UDP requires a connection between client and server processes.
UDP requires a connection between client and server processes.
HTTP is designed to be a stateless protocol.
HTTP is designed to be a stateless protocol.
TCP provides encryption and data integrity features.
TCP provides encryption and data integrity features.
SMTP is used for sending emails and operates over TCP.
SMTP is used for sending emails and operates over TCP.
HTTP operates exclusively over UDP to ensure fast transmission of data.
HTTP operates exclusively over UDP to ensure fast transmission of data.
SSL operates at the application layer.
SSL operates at the application layer.
Each object in a web page can be identified by a URL.
Each object in a web page can be identified by a URL.
A process communicating over a socket uses shared memory for message exchange.
A process communicating over a socket uses shared memory for message exchange.
File Transfer Protocol (FTP) uses UDP for its operations.
File Transfer Protocol (FTP) uses UDP for its operations.
In a client-server model, the client is responsible for sending requests to the server.
In a client-server model, the client is responsible for sending requests to the server.
Study Notes
HTTP Response Status Codes
- Indicates the status of the HTTP request.
- 200 OK: The request succeeded, and the requested object is later in the response message.
- 301 Moved Permanently: The requested object has moved, the new location is specified in the Location header.
- 400 Bad Request: The request message is not understood by the server.
- 404 Not Found: The requested document is not found on the server.
- 505 HTTP Version Not Supported: The server does not support the HTTP version used in the request.
Trying out HTTP (Client-Side):
- Telnet to a web server:
telnet cis.poly.edu 80
opens a TCP connection to port 80 (default HTTP server port). - Send a GET HTTP request:
GET /~ross/ HTTP/1.1\r\n Host: cis.poly.edu\r\n\r\n
This sends a minimal but complete GET request to the HTTP server.
Non-Persistent HTTP: Response Time
- HTTP response time is the time taken for a response message to be sent back to the client.
- Response time= 2RTT + File Transmission Time:
- One RTT to initiate the TCP connection.
- One RTT for the HTTP request and the first few bytes of the HTTP response to return.
- File transmission time from the server to the client.
Persistent HTTP
- Employs a single TCP connection for multiple HTTP requests and responses.
- Benefits:
- Reduces Response time because only one TCP connection is needed.
- Server leaves the connection open after sending the response, allowing for subsequent HTTP messages to be sent over the open connection.
HTTP Request Message
- A request message is sent from the client to the server containing the request method, URL, version, headers, and data.
- Common methods: GET, POST, HEAD, PUT, DELETE.
- GET: Requests a resource from the server, used for retrieving information, typically with data included in the URL.
- POST: Used to send data to the server, often for form submissions or uploading data, typically with data in the entity body.
- HEAD: Similar to GET, but returns only the headers of the response message, useful for retrieving metadata.
- PUT: Uploads a file in the entity body to a path specified in the URL field.
- DELETE: Deletes a file or resource specified in the URL field.
HTTP Response Message
- Sent by the server back to the client.
- Includes the status line: Protocol version, status code, status phrase.
- Headers: Metadata related to the response like Content-Type, Content-Length, Date, and Server.
- Data: The actual content of the requested resource.
HTTP Connections
- Non-Persistent HTTP:
- One TCP connection for each request.
- Each TCP connection is closed after one object transmission.
- Persistent HTTP:
- One TCP connection can be shared for multiple requests.
- Server maintains the connection open after sending the response, allowing several requests/responses over the same connection.
Application Layer
- Chapter 2 delves into the Application Layer, a crucial layer in the network architecture responsible for enabling communication between applications running on different end systems.
- It covers various aspects like the principles of network applications, the implementation details of popular application protocols, and the creation of network applications using socket programming.
Application Architecture
- There are two primary application architectures: client-server and peer-to-peer (P2P).
- In the client-server architecture, one or more clients communicate with a dedicated server, which provides services.
- The server typically has a permanent IP address and is always on, while clients can be intermittent and use dynamic IP addresses.
- P2P architecture lacks a centralized server; instead, peers directly communicate with each other.
- This model allows for self-scalability as new peers contribute to both service capacity and demand.
Processes and Sockets
- Processes running on different end systems communicate via sockets, which act like doors allowing processes to send and receive messages.
- Sockets are controlled by the application developer but rely on the transport layer (TCP/UDP) and network layer (IP) for data transmission.
Addressing Processes
- Processes need unique identifiers for communication, consisting of both an IP address and port number.
- Host aliasing allows multiple IP addresses to be associated with a single hostname.
- The Domain Name System (DNS) provides a hierarchical and distributed database for mapping hostnames to IP addresses.
DNS: A Distributed Database
- Local name servers query root DNS servers to find the authoritative name server for a specific hostname.
- Authoritative name servers store the records for a domain, including IP addresses, alias names (CNAME), and mail server names (MX).
- Caching mechanisms are used by DNS servers to improve performance but can introduce potential inconsistencies.
- DNS records (RRs) are stored as tuples of (name, value, type, ttl) and can be updated using mechanisms like RFC 2136.
DNS Attacks
- Denial-of-service (DDoS) attacks can target root servers, TLD servers, or even exploit DNS itself to amplify traffic.
- Redirect attacks, like DNS poisoning, exploit DNS to send bogus replies to DNS servers, which then cache incorrect mappings.
P2P Applications
- P2P applications benefit from the absence of a centralized server and allow direct communication between peers.
- Examples include file distribution (BitTorrent), streaming (KanKan), and VoIP (Skype).
Socket Programming (TCP/UDP)
- Sockets provide a programming interface for creating client/server applications that communicate using either UDP or TCP.
- UDP is a connectionless, unreliable datagram protocol suitable for applications with lower latency requirements.
- TCP is a connection-oriented, reliable protocol that guarantees delivery of data in the correct order.
Summary
- The chapter stresses the importance of understanding network protocols and their key features:
- Control vs. data messages
- In-band vs. out-of-band signaling
- Centralized vs. decentralized architecture
- Stateless vs. stateful communication
- Reliable vs. unreliable message transfer
- The concept of "complexity at the network edge" highlights the importance of application layer considerations for network performance and security.
Application Layer Protocols
-
Principles
- Web and HTTP: Client/server model using TCP
- Non-persistent HTTP
- Requires 2 RTTs per object
- Overhead for each TCP
- Persistent HTTP
- Server keeps connection open, subsequent requests travel over open connection
- Can complete all requests with only 1 RTT
-
HTTP Request Message
- Message Format: Consists of request line, header lines, and entity body
- Methods:
- GET: Retrieves data from the server
- POST: Sends data to the server
- HEAD: Asks server for headers only
-
HTTP Response Message
- Message Format: Consists of status line, header lines, and entity body
- Status Code:
- 200 OK: Successful Request
- 400 Bad Request
- 404 Not Found
-
Uploading Form Input
- POST: Form input uploaded as entity body
- GET: Input encoded in URL field
Electronic Mail: Mail Reader & User Agents
- User agents are applications that enable users to compose, edit, and read email messages.
- Examples of user agents include Outlook, Thunderbird, and iPhone mail clients.
- User agents interact with mail servers to send and receive messages.
- Users interact with user agents, user agents interact with mail servers, and mail servers interact with other mail servers using protocols like SMTP.
Electronic Mail: Mail Servers
- Mail servers are responsible for storing and managing email messages.
- They maintain a mailbox for each user, containing their incoming messages.
- They also manage a queue of outgoing messages waiting to be sent.
Electronic Mail: SMTP
- SMTP (Simple Mail Transfer Protocol) is a protocol used for sending email messages between mail servers.
- It relies on TCP (Transmission Control Protocol) for reliable message transfer over port 25.
- SMTP operates through a direct transfer between sending and receiving servers.
- The transfer process has three distinct phases: handshaking (greeting), message transfer, and closure.
- SMTP uses a command/response interaction system similar to HTTP and FTP.
- Commands are sent in ASCII text, while responses include a status code and a phrase.
- Email messages must be formatted in 7-bit ASCII.
Scenario: Alice Sends a Message to Bob
- Alice composes an email using her user agent and addresses it to [email protected].
- Alice's user agent sends the message to her mail server, where it is placed in the message queue.
- The SMTP client on Alice's mail server establishes a TCP connection with Bob's mail server.
- The message is transmitted over the TCP connection.
- Bob's mail server stores the message in Bob's mailbox.
- Bob uses his user agent to access and read the message.
Sample SMTP Interaction
- The server initiates the connection by sending a "220" status code, indicating readiness.
- The client sends a "HELO" command with the sender's domain name, in this case, crepes.fr.
- The server responds with "250" acknowledging the connection and greeting.
- The client uses the "MAIL FROM" command to specify the sender's email address.
- The server responds with "250" indicating successful acceptance of the sender address.
- The interaction continues with further commands and responses for recipient addresses, message contents, and final delivery.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge of HTTP response status codes and client-side HTTP requests. Learn about the meanings of different status codes like 200, 301, and 404, and how to send requests using Telnet. This quiz will help solidify your understanding of HTTP communication.