6.Application layer protocol

Chapter 6: Application Layer

6.3 Application Layer Protocols

  • Definition: An application layer protocol specifies how processes on different end systems pass messages to each other.

  • Key Components:

    • Types of Messages: Defines the types of messages, e.g., request and response messages.

    • Syntax: Outlines the format of various message types, including fields and their delineation.

    • Semantics: Describes the meaning of the information within the message fields.

    • Rules: Establishes protocols for sending and responding to messages.

6.4 The Web, HTTP, and HTTPS

  • World Wide Web (WWW):

    • Developed by Tim Berners-Lee in 1994, the first Internet application.

    • Acts as a repository of linked documents globally, accessible through web browsers.

  • HTTP (Hyper Text Transfer Protocol):

    • The application-layer protocol for the WWW, foundational for data communication.

    • Defined in RFC 1945 and RFC 2616.

    • Operates over TCP connection, utilizing port 80.

    • HTTPS:

      • Stands for HTTP over Secure Socket Layer (SSL), providing secure communication.

      • Encrypts data sent between the web browser and server.

      • Operates over port 443.

  • Web Page Components:

    • Composed of objects such as HTML files, images, applets, etc.

    • Each object located through a URL (Universal Resource Locator).

6.4.1 Architecture of WWW

  • Interaction:

    • The user initiates an HTTP request via their browser which gets the object from the server as an HTTP response.

    • Process Steps:

      1. User clicks hyperlink.

      2. Browser retrieves URL and queries DNS for server IP address.

      3. Browser establishes TCP connection and sends HTTP request.

      4. Server processes request and responds.

6.4.2 HTTP Transactions

  • Stages:

    • Client sends request to server and receives a response.

    • Messages include Request and Response.

  • Client/Server Model:

    • Clients: Web browsers requesting resources.

    • Servers: Provide resources in response to requests.

  • Connection: Utilizes TCP as the transport protocol, ensuring reliable delivery.

6.4.3 Connection Types

  • Non-persistent Connection:

    • One TCP connection per request/response, leading to delays (two RTTs - Round-Trip Time).

    • Limitations include overhead on servers and inefficiency.

  • Persistent Connection:

    • Keeps connections open for multiple requests, reducing overhead by sending objects back-to-back.

6.4.4 HTTP Methods

  • Common Methods:

    • GET: Read a Web page.

    • HEAD: Read header information.

    • POST: Append data to a Web page.

    • PUT: Store a Web page.

    • DELETE: Remove a Web page.

    • OPTIONS: Query options for a page.

6.4.5 HTTP Response Codes

  • Categories:

    • 1xx: Informational responses (e.g., 100 - Continue).

    • 2xx: Successful requests (e.g., 200 - OK).

    • 3xx: Redirection (e.g., 301 - Moved Permanently).

    • 4xx: Client errors (e.g., 404 - Not Found).

    • 5xx: Server errors (e.g., 500 - Internal Server Error).

6.4.6 HTTPS Details

  • Functionality: Encrypts HTTP messages for secure transmission.

  • Port: Uses port 443.

6.4.7 Proxy Server/Web Caching

  • Proxy Server:

    • Holds recent response copies, reducing server load and improving latency.

  • Web Caching: Intended to speed up data retrieval and minimize redundant server requests.

6.4.8 Web Application Server

  • Hosts website content and provides services via web applications.

6.4.9 Mail Application Server

  • Function: Manages email traffic, including receiving and forwarding messages.

  • Common examples: Microsoft Exchange, sendmail.

6.5 Internet Cookies

  • Definition: Small data pieces identifying users, stored on local drives.

  • Usage: Helps websites personalize experiences, especially in shopping.

  • Privacy Concerns: Used for tracking user activity across the web.

6.6 File Transfer Protocol (FTP)

  • Definition: Standard method for transferring files over TCP/IP.

  • Architecture:

    • Two connections: Data connection (port 20) and Control connection (port 21).

  • Process: Consists of authentication, commands for transferring/routing files.

  • Commands: Commands like USER, PASS, LIST, RETR are used to control file operations.

6.7 Similarities and Differences: HTTP vs FTP

  • Connections: HTTP uses a single TCP connection; FTP utilizes separate control and data connections.

  • State Maintenance: HTTP is stateless; FTP maintains user states.

6.8 SSH and File Transfer Applications

  • Putty & WinSCP: For secure file transfers, SSH and Telnet support.

  • Web references provided for downloading.

6.9 SFTP (Secure File Transfer Protocol)

  • Operates over SSH, providing secure encrypted file transfers.

6.10 Electronic Mail (E-mail)

  • Components: User agents, mail servers, SMTP (Simple Mail Transfer Protocol).

  • User Agents: Allow composition and management of email messages.

6.11 SMTP Protocol

  • Functionality: Used for sending emails; works over port 25.

  • Process: Involves handshaking and command interactions similar to HTTP.

6.11.1 SMTP vs HTTP

  • Transfer Model: HTTP pulls data while SMTP pushes messages.

6.11.2 Mail Access Protocols

  • POP3: Allows downloading emails; limited in management capabilities.

  • IMAP4: More powerful, enables mailbox management on the server.

6.11.3 MIME (Multipurpose Internet Mail Extensions)

  • Allows sending non-ASCII or binary data via email, expanding email capabilities.

6.12 Domain Name Server (DNS)

  • Function: Translates hostnames to IP addresses.

  • Structure: Distributed system composed of root, TLD, and authoritative servers.

6.12.1 Problems with Centralized DNS

  • Centralized systems risk single points of failure and traffic overloads.

6.12.2 Hierarchical Structure of DNS

  • Organization: The DNS is organized into a distributed, hierarchically structured database.

6.13 TELNET

  • Purpose: Enables access to remote machines and services.

  • Connection: Utilizes TCP and operates through control characters.

Chapter 6: Application Layer

6.3 Application Layer Protocols

Definition: An application layer protocol specifies how processes on different end systems pass messages to each other, serving as the interface between the applications and underlying network layers.Key Components:

  • Types of Messages: Defines the various types of messages that can be exchanged, such as request messages asking for resources and response messages providing those resources or information back to the requester.

  • Syntax: Outlines the specific format of various message types, including the structure of fields, their delineation, and encoding. This ensures that both the sender and receiver interpret the messages consistently.

  • Semantics: Describes the meaning of the information contained within the message fields. This includes understanding what a successful response is versus an error message and the specific implications of different types of data included in message exchanges.

  • Rules: Establishes the protocols for sending and responding to messages, which include procedures for establishing connections, handling errors, ensuring data integrity, and managing session control as necessary.

6.4 The Web, HTTP, and HTTPS

World Wide Web (WWW):

  • Developed by Tim Berners-Lee in 1994, the WWW marked the first Internet application that revolutionized how information is shared.

  • Acts as a repository of linked documents globally, which can be accessed through web browsers, providing the foundation for an interconnected information environment.

HTTP (Hyper Text Transfer Protocol):

  • The application-layer protocol for the WWW, fundamental for data communication over the Internet. It facilitates the transfer of hypertext documents, allowing users to navigate between different resources seamlessly.

  • Defined in RFC 1945 and RFC 2616, establishing the technical standards for communication on the web.

  • Operates over a Transmission Control Protocol (TCP) connection, typically utilizing port 80 for its operations.

HTTPS:

  • Stands for HTTP over Secure Socket Layer (SSL) or Transport Layer Security (TLS), providing a secure communication channel over a computer network.

  • Encrypts data sent between the web browser and the server, ensuring confidentiality, integrity, and authentication of the exchanged information.

  • Operates through port 443, enhancing security for sensitive transactions such as online banking and e-commerce.

Web Page Components:

  • Composed of various objects, including HTML files, images, applets, scripts, and stylesheets, contributing to the visual and functional aspects of websites.

  • Each object is located through a URL (Universal Resource Locator), which serves as the web address linking to resources.

6.4.1 Architecture of WWW

Interaction:

  • The user initiates an HTTP request via their browser, which retrieves the requested object from the specified server as an HTTP response.

  • Process Steps:

    1. User clicks a hyperlink on a web page, initiating a request for more information.

    2. The browser retrieves the URL and queries DNS (Domain Name System) to resolve the server's IP address.

    3. The browser establishes a TCP connection with the server and sends out the HTTP request with the necessary details.

    4. The server processes the request, retrieves the requested resource, and sends back an HTTP response containing the data or status code.

6.4.2 HTTP Transactions

Stages:

  • The client sends a request to the server and receives a response, completing the cycle of communication.

  • Messages exchanged include both Request and Response types, each serving specific purposes in the transaction.

Client/Server Model:

  • Clients: Typically web browsers or user applications that send requests for resources on the server.

  • Servers: Hosting platforms that provide the requested resources and responses to client inquiries.

  • Connection: Utilizes TCP as the transport protocol, ensuring reliable delivery of messages through error-checking and retransmission where necessary.

6.4.3 Connection Types

Non-persistent Connection:

  • One TCP connection is established for each request/response cycle, which can lead to increased delays as it requires two Round-Trip Times (RTTs) for each transaction.

  • Limitations include significant overhead on server resources and overall inefficiency in handling multiple requests.

Persistent Connection:

  • Keeps TCP connections open for multiple requests, allowing objects to be sent back-to-back without needing to reopen a new connection for each one, thus reducing overhead and improving server performance.

6.4.4 HTTP Methods

Common Methods:

  • GET: Requests to read and retrieve a webpage or resource without causing any modifications.

  • HEAD: Requests header information, similar to GET, but without the body of the resource. Useful for retrieving meta-information.

  • POST: Sends data to the server, often used for submitting forms or uploading files, which can modify the server state.

  • PUT: Used to store or update a resource at a specified URL.

  • DELETE: Requests the removal of a specified resource from the server.

  • OPTIONS: Queries the server for allowed methods and extra options available for a specific page, helpful for discovering capabilities.

6.4.5 HTTP Response Codes

Categories:

  • 1xx (Informational responses): Indicates that the request has been received and the process is ongoing (e.g., 100 - Continue).

  • 2xx (Successful requests): Confirms successful processing of the request (e.g., 200 - OK).

  • 3xx (Redirection): Indicates further action is needed to complete the request (e.g., 301 - Moved Permanently).

  • 4xx (Client errors): Represents errors caused by the client (e.g., 404 - Not Found).

  • 5xx (Server errors): Indicates that the server failed to fulfill a valid request due to internal error (e.g., 500 - Internal Server Error).

6.4.6 HTTPS Details

Functionality:

  • Encrypts HTTP messages for secure transmission, protecting data from eavesdroppers and ensuring user privacy during online interactions.

  • Utilizes port 443 for secure communication, marking a foundational standard for secure web interactions.

6.4.7 Proxy Server/Web Caching

Proxy Server:

  • Acts as an intermediary between the client and the server, holding recent response copies to reduce direct server load, enhancing response times, and improving latency for repeated requests.

Web Caching:

  • Designed to speed up data retrieval by storing copies of previously requested resources, minimizing redundant server requests and optimizing network bandwidth usage.

6.4.8 Web Application Server

  • A specialized server that hosts web content and applications, providing dynamic web services and processing client requests, often serving as the backend for web applications.

6.4.9 Mail Application Server

Function:

  • Manages the flow of email traffic, including receiving, storing, and forwarding messages between users and servers.Common Examples:

  • Microsoft Exchange and sendmail, known for their robust features in handling organizational email communications.

6.5 Internet Cookies

Definition:

  • Small pieces of data stored on the user's local drive, aimed at identifying and tracking users for personalization.

Usage:

  • Helps websites enhance user experience by remembering user preferences, login states, and activity particularly for online shopping.

Privacy Concerns:

  • Cookies are often used for tracking user activities across the web, raising concerns about user privacy and data security.

6.6 File Transfer Protocol (FTP)

Definition:

  • A standard application layer protocol for transferring files over TCP/IP, providing a reliable means for file manipulation.

Architecture:

  • Comprises two types of connections:

    • Data Connection (port 20): Used for transferring the actual file data.

    • Control Connection (port 21): Utilized for sending commands and receiving responses between the client and the server.

Process:

  • Involves user authentication, commands for transferring/routing files (such as listing directories, uploading, or downloading files).

Commands:

  • Standard commands such as USER, PASS, LIST, RETR are employed to manage file operations effectively.

6.7 Similarities and Differences: HTTP vs FTP

Connections:

  • HTTP typically uses a single TCP connection for request/response, while FTP utilizes separate control and data connections for efficient file transfers.

State Maintenance:

  • HTTP is generally stateless, meaning each request is independent; FTP can maintain user states, enabling ongoing sessions and better management of file transfers.

6.8 SSH and File Transfer Applications

  • Tools like Putty & WinSCP enable secure file transfers using secure shell (SSH) and Telnet, ensuring encrypted communication.

  • Various web references are provided for downloading relevant tools.

6.9 SFTP (Secure File Transfer Protocol)

  • Operates over SSH, providing secure and encrypted file transfer capabilities, hence serving as a safer alternative for file transfers compared to traditional FTP.

6.10 Electronic Mail (E-mail)

Components:

  • Encompasses user agents, mail servers, and protocols such as SMTP (Simple Mail Transfer Protocol), which facilitate email communication by defining how email messages are sent and received.

User Agents:

  • Software that allow users to compose, send, receive, and manage their email messages effectively.

6.11 SMTP Protocol

Functionality:

  • Specifically designed for sending emails, operates over port 25 to transfer email messages between servers.

Process:

  • Involves handshaking and command interactions, resembling HTTP processes, ensuring reliable transmission of email content.

6.11.1 SMTP vs HTTP

Transfer Model:

  • Unlike HTTP which pulls data from servers upon request, SMTP implements a push model, actively sending email messages from the client to the server.

6.11.2 Mail Access Protocols

  • POP3: Permits downloading of emails to a local client, characterized by limited management capabilities for organizing emails.

  • IMAP4: A more advanced protocol that enables server-side management of-mail, offering functionality for organizing, deleting, and editing emails directly on the server, allowing for better synchronization across devices.

6.11.3 MIME (Multipurpose Internet Mail Extensions)

  • Expands email capabilities beyond ASCII text, allowing for the transmission of non-ASCII or binary data (like images and rich-text formatting) via email, enhancing overall email communication richness.

6.12 Domain Name Server (DNS)

Function:

  • Resolves hostnames to IP addresses, acting as a critical system for finding resources on the internet.

Structure:

  • Organized as a distributed system composed of root servers, top-level domain (TLD) servers, and authoritative servers ensuring efficiency and redundancy in hostname resolution.

6.12.1 Problems with Centralized DNS

Risks:

  • Centralized systems pose risks such as single points of failure, which can lead to widespread outages, and traffic overloads, causing system performance degradation.

6.12.2 Hierarchical Structure of DNS

Organization:

  • The DNS is structured in a distributed, hierarchical manner, facilitating efficient hostname resolution across diverse domains and subdomains.

6.13 TELNET

Purpose:

  • Enables users to access remote machines and services, typically for command-line interface (CLI) usage over the Internet.Connection:

  • Utilizes TCP (Transmission Control Protocol) for communication and often operates through control characters, allowing for remote management of devices and systems.