Application Layer: Introduction
Introduction
The Application Layer is the topmost layer of the TCP/IP protocol suite. The entire
Internet—both hardware and software—was designed primarily to provide services at the
application layer. This layer is where end users interact directly with the network through
application programs such as web browsers, e-mail clients, and file transfer tools.
The other four layers (Transport, Network, Data Link, and Physical) exist only to support and
enable these application-layer services.
(Source: Page 1)
Logical Communication at Application Layer
Communication at the application layer is provided using a logical connection.
This means that:
● The two application-layer processes (sender and receiver) assume an imaginary direct
connection between them.
● In reality, data passes through all lower layers and multiple networks, but applications
are abstracted from this complexity.
● The application layer focuses only on message exchange, not on how data is physically
transmitted.
This abstraction simplifies application development and usage.
(Source: Page 1)
Diagram Explanation (Page 1):
● The diagram shows two end systems communicating at the application layer.
● Lower layers (transport, network, data-link, physical) handle actual data transfer.
● A logical connection is shown directly between application layers of sender and
receiver.
Providing Services
The Internet was originally designed to provide services to users around the world.
The layered architecture of TCP/IP makes the Internet:
● More flexible
● More scalable
● Easier to upgrade and extend
Unlike traditional networks (postal or telephone systems), protocols can be:
● Added
● Removed
● Replaced
without affecting the entire system, as long as they follow layer rules.
(Source: Page 1–2)
Special Characteristics of the Application Layer
● It is the highest layer in the TCP/IP suite.
● It does not provide services to any other layer.
● It only receives services from the transport layer.
● Protocols can be easily added or removed, making the Internet adaptable.
● New application protocols are continuously developed to meet user needs.
(Source: Page 2)
Importance of Application Layer
● It is the only layer visible to users.
● Enables services like web browsing, e-mail, file transfer, and remote login.
● Encourages rapid innovation by allowing new applications to be deployed easily.
Conclusion
The Application Layer forms the foundation of user interaction with the Internet. By
providing logical communication and abstracting lower-layer complexities, it ensures flexibility,
scalability, and continuous growth of Internet services.
Client–Server Programming
Introduction
In the client–server paradigm, communication at the application layer takes place between
two running application programs, called processes:
● Client process
● Server process
A client is a program that initiates communication by sending a request, whereas a server is
a program that waits for requests, processes them, and sends back responses.
This model is the most widely used paradigm for Internet applications.
(Source: Page 4)
Client and Server Characteristics
● The server process must be running all the time and waiting for client requests.
● The client process is started only when service is needed.
● The lifetime of a server is infinite, while the client has a finite lifetime.
● Communication is strictly role-based:
○ A client cannot act as a server
○ A server cannot act as a client
(Source: Page 4)
Basic Working of Client–Server Programming
1. The client sends a request message to the server.
2. The server receives and processes the request.
3. The server prepares a response.
4. The response is sent back to the client.
5. The client receives the response and terminates (or sends another request).
This communication occurs using services provided by the transport layer (TCP or UDP).
(Source: Page 4)
Application Programming Interface (API)
To enable communication between client and server processes, an Application Programming
Interface (API) is used.
● API is a set of instructions that allows application-layer processes to interact with the
operating system.
● The operating system encapsulates the lower four layers of TCP/IP.
● A computer manufacturer must implement these layers and provide an API.
Common APIs include:
● Socket Interface
● Transport Layer Interface (TLI)
● STREAM
(Source: Page 4–5)
Diagram Explanation (Page 5):
● Shows client site and server site
● Socket interface lies between application layer and transport layer
● Communication happens through sockets, not directly between processes
Sockets in Client–Server Programming
● A socket is an abstraction, not a physical entity.
● It behaves like a file or terminal.
● Communication is considered as socket-to-socket communication.
● One socket exists at the client side and one at the server side.
From the application’s point of view:
● Client sends requests to its socket
● Server receives requests from its socket
(Source: Page 5)
Socket Addresses
For communication, a pair of socket addresses is required:
● Local socket address
● Remote socket address
A socket address consists of:
● IP address (identifies the computer)
● Port number (identifies the process)
This ensures correct delivery of data between specific client and server processes.
(Source: Page 5–6)
Conclusion
Client–server programming forms the backbone of Internet applications. By using APIs and
sockets, it enables reliable and structured communication between distributed processes,
allowing efficient service delivery to users across the Internet.
Standard Client–Server Protocols: World Wide Web
(WWW) and HTTP
Introduction
The World Wide Web (WWW) is one of the most widely used standard client–server services
on the Internet. It allows users to access documents, images, audio, and video stored on
remote servers using a web browser.
The protocol that enables communication between a web client (browser) and a web server is
the HyperText Transfer Protocol (HTTP).
WWW follows the client–server paradigm, where the client requests resources and the server
responds with the requested data.
(Source: Chapter 26 – Page 1)
World Wide Web (WWW)
The World Wide Web is a distributed information system that uses:
● Clients → Web browsers (Chrome, Firefox, etc.)
● Servers → Web servers that store web pages
● Resources → Web pages identified using URLs
Key features of WWW:
● Uses hypertext, which allows linking documents.
● Web pages are written using HTML.
● Resources are identified using Uniform Resource Locators (URLs).
● Communication is handled using HTTP over TCP.
(Source: Page 1–2)
Client–Server Architecture of WWW
● The client sends an HTTP request to the server.
● The server processes the request.
● The server sends an HTTP response containing the requested resource.
● The client displays the content to the user.
This interaction is request–response based.
(Source: Page 2)
Diagram Explanation (Page 2):
● Browser acts as HTTP client
● Web server stores web resources
● Internet connects client and server
● HTTP request and response messages are exchanged
HyperText Transfer Protocol (HTTP)
HTTP is a standard application-layer protocol used by the WWW.
Characteristics of HTTP:
● Client–server protocol
● Stateless protocol (server does not remember previous requests)
● Uses TCP as transport protocol
● Default port number: 80
HTTP defines:
● Format of requests
● Format of responses
● Rules for communication between client and server
(Source: Page 2–3)
HTTP Request
An HTTP request message contains:
1. Request line (method, URL, version)
2. Header fields
3. Optional body
Common HTTP methods:
● GET – retrieve a document
● POST – send data to server
● HEAD – retrieve header only
(Source: Page 3)
HTTP Response
An HTTP response message contains:
1. Status line (version, status code)
2. Header fields
3. Response body (requested content)
Examples of status codes:
● 200 OK – request successful
● 404 Not Found – resource not available
(Source: Page 3)
Working of WWW using HTTP
1. User enters a URL in the browser.
2. Browser sends an HTTP request to the server.
3. Server processes the request.
4. Server sends an HTTP response.
5. Browser displays the received content.
Each request–response pair is independent.
(Source: Page 2–3)
Conclusion
The World Wide Web is a powerful client–server application built using HTTP. By using a simple
request–response mechanism and stateless communication, HTTP enables efficient access to
web resources, making WWW the backbone of modern Internet usage.
Standard Client–Server Protocol: File Transfer Protocol
(FTP)
Introduction
File Transfer Protocol (FTP) is a standard application-layer client–server protocol used to
transfer files between two computers over a TCP/IP network. FTP allows a user to upload,
download, rename, delete, and manage files on a remote server.
FTP follows the client–server paradigm, where the client initiates requests and the server
provides file-related services.
(Source: Chapter 26 – FTP section)
Purpose of FTP
FTP is designed to:
● Transfer files reliably
● Support remote file access
● Allow file management operations
● Work across different operating systems
FTP is widely used for website file uploads, software distribution, and data sharing.
(Source: Page related to FTP)
FTP Architecture
FTP uses a dual-connection model, which is its most important characteristic.
FTP establishes two separate TCP connections:
1. Control Connection
2. Data Connection
● Control connection is used for commands and responses
● Data connection is used for actual file transfer
Diagram Explanation (FTP Architecture):
● FTP client and FTP server communicate
● Control connection remains open throughout the session
● Data connection is opened and closed for each file transfer
(Diagram based on FTP explanation in PDF)
Control Connection
● Uses TCP
● Server listens on port 21
● Carries:
○ User commands (e.g., login, list, retrieve)
○ Server replies
● Remains open during the entire FTP session
(Source: FTP description)
Data Connection
● Used only for file transfer
● Opened each time data is sent
● Closed after transfer completes
● Can be:
○ Active mode
○ Passive mode
This separation improves efficiency and control.
(Source: FTP section)
FTP Working
1. Client establishes control connection with server (port 21).
2. Client sends authentication details (username and password).
3. Client issues file operation commands.
4. For each file transfer:
○ A data connection is created
○ File is transferred
○ Data connection is closed
5. Control connection stays active until session ends.
(Source: FTP operation)
Features of FTP
● Reliable file transfer using TCP
● Supports authentication
● Allows directory listing and file manipulation
● Uses separate connections for control and data
● Platform-independent
Limitations of FTP
● Data and passwords are sent in plain text
● Not secure for sensitive data
● Requires additional secure versions like SFTP or FTPS
(Source: FTP discussion)
Conclusion
FTP is a powerful and reliable client–server protocol for file transfer. Its dual-connection
mechanism efficiently separates control information from data transfer, making it suitable for
large file exchanges, though it lacks built-in security.
(Source: Chapter 26 – FTP)
Standard Client–Server Protocol: Electronic Mail
Introduction
Electronic Mail (E-mail) is one of the oldest and most widely used application-layer services
on the Internet. It allows users to send and receive messages electronically across networks.
E-mail follows the client–server paradigm and uses multiple application-layer protocols,
each designed for a specific function such as sending, receiving, and retrieving messages.
(Source: Chapter 26 – Electronic Mail section)
Components of Electronic Mail System
An electronic mail system consists of the following main components:
1. User Agent (UA)
2. Mail Transfer Agent (MTA)
3. Mail Access Agent (MAA)
4. Mail Servers
Each component performs a specific role to ensure reliable message delivery.
(Source: Page related to E-mail architecture)
User Agent (UA)
● It is the e-mail client software used by users.
● Examples: Gmail interface, Outlook, Thunderbird.
● Functions:
○ Composing messages
○ Reading received mails
○ Replying, forwarding, and deleting mails
(Source: E-mail description)
Mail Transfer Agent (MTA)
● Responsible for sending e-mails from sender’s server to receiver’s server.
● Uses Simple Mail Transfer Protocol (SMTP).
● Works in a client–server manner between mail servers.
(Source: SMTP section)
Mail Access Agent (MAA)
● Used by the receiver to retrieve messages from the mail server.
● Common protocols:
○ POP3 (Post Office Protocol version 3)
○ IMAP (Internet Message Access Protocol)
(Source: POP3/IMAP section)
E-mail Architecture
Electronic mail uses store-and-forward architecture:
● Message is stored temporarily on mail servers.
● Forwarded until it reaches the destination server.
Diagram Explanation (Electronic Mail Architecture):
● Sender uses User Agent to compose mail
● Mail sent to sender’s mail server
● Transferred to receiver’s mail server using SMTP
● Receiver accesses mail using POP3 or IMAP
(Diagram based on PDF explanation)
Protocols Used in Electronic Mail
SMTP (Simple Mail Transfer Protocol)
● Used for sending e-mails
● Push protocol
● Uses TCP
● Server port number: 25
(Source: SMTP description)
POP3
● Used for retrieving e-mails
● Downloads mails to client and deletes them from server
● Suitable for offline reading
(Source: POP3 section)
IMAP
● Also used for retrieving mails
● Keeps messages on the server
● Supports folder management and synchronization
(Source: IMAP section)
Working of Electronic Mail
1. Sender composes a message using UA.
2. UA sends mail to the sender's mail server.
3. Mail server forwards message using SMTP.
4. The receiver's mail server stores the message.
5. Receiver retrieves message using POP3 or IMAP.
(Source: E-mail working)
Features of Electronic Mail
● Fast and cost-effective communication
● Supports text, images, and attachments
● Asynchronous communication
● Reliable message delivery
Conclusion
Electronic mail is a powerful client–server application that enables global communication. By
combining SMTP for sending and POP3/IMAP for retrieval, the e-mail system ensures reliable,
flexible, and efficient message transfer across the Internet.
Standard Client–Server Protocol: Domain Name System
(DNS)
Introduction
The Domain Name System (DNS) is a standard application-layer client–server protocol
used to translate human-readable domain names into IP addresses.
Since computers communicate using numerical IP addresses, DNS acts as a directory service
of the Internet, allowing users to access resources using easy-to-remember names instead of
numbers.
(Source: Chapter 26 – DNS section)
Need for DNS
● Humans prefer names (e.g., [Link])
● Computers require IP addresses (e.g., [Link])
● DNS provides name-to-address mapping
● Eliminates the need to remember IP addresses
(Source: DNS introduction)
DNS Architecture
DNS follows a hierarchical and distributed architecture.
Main components:
1. Domain Name Space
2. DNS Servers
3. Resolvers (Clients)
DNS does not rely on a single server; instead, the database is distributed across the Internet.
(Source: DNS architecture)
Diagram Explanation (DNS Architecture):
● Root DNS server at the top
● Top-Level Domain (TLD) servers (e.g., .com, .org)
● Authoritative DNS servers
● Client queries flow from resolver to servers
(Diagram based on PDF explanation)
Domain Name Space
● DNS uses a tree-structured hierarchical name space
● Root is at the top, represented by a dot (.)
● Below root are Top-Level Domains (TLDs) such as:
○ Generic (gTLD): .com, .org, .edu
○ Country code (ccTLD): .in, .uk
● Lower levels represent organizations and hosts
(Source: DNS name space)
DNS Servers
Types of DNS servers:
1. Root Server
2. TLD Server
3. Authoritative Server
4. Local DNS Server
Each server is responsible for a specific portion of the name space.
(Source: DNS servers)
DNS Resolution Process
1. Client sends a DNS query to local resolver.
2. Resolver contacts root server.
3. Root server directs query to TLD server.
4. TLD server points to authoritative server.
5. Authoritative server returns IP address.
6. Resolver sends IP address to client.
(Source: DNS working)
DNS Protocol Features
● Application-layer protocol
● Uses UDP for most queries (port 53)
● Uses TCP for zone transfers
● Supports caching for faster responses
(Source: DNS protocol details)
Advantages of DNS
● Easy to use and remember
● Distributed and scalable
● Fault tolerant
● Efficient name resolution
Conclusion
DNS is a critical Internet service that bridges the gap between human-friendly domain names
and machine-readable IP addresses. Its hierarchical, distributed design ensures scalability,
reliability, and efficient name resolution across the global Internet.
Standard Client–Server Protocol: TELNET
Introduction
TELNET is a standard application-layer, client–server protocol that allows a user to log in
remotely to another computer over a network. It enables a user at one machine (client) to
access and use the resources of a remote machine (server) as if the user were locally
present.
TELNET was one of the earliest remote-login protocols used on the Internet.
(Source: Chapter 26 – TELNET section)
Purpose of TELNET
TELNET is designed to:
● Provide remote login capability
● Allow users to execute commands on a remote host
● Enable interaction with remote systems using a text-based interface
It is mainly used for administration, testing, and educational purposes.
(Source: TELNET description)
Client–Server Architecture of TELNET
● The TELNET client runs on the user’s local machine.
● The TELNET server runs on the remote machine.
● Communication is established using TCP.
● The default port number used by TELNET is 23.
TELNET uses a virtual terminal concept to standardize communication between different
systems.
(Source: TELNET architecture)
Diagram Explanation (TELNET Architecture):
● User interacts with TELNET client
● Client sends keystrokes to server
● Server executes commands
● Output is sent back to client
● Virtual terminal ensures compatibility
(Diagram based on PDF explanation)
Network Virtual Terminal (NVT)
TELNET uses a Network Virtual Terminal (NVT) to solve compatibility issues between different
operating systems.
● Client converts user input into NVT format
● Server converts NVT commands into its local format
● Output is again converted back into NVT
This ensures uniform communication between heterogeneous systems.
(Source: NVT explanation)
Working of TELNET
1. Client establishes a TCP connection with the server (port 23).
2. User provides login credentials.
3. Client sends user commands to the server.
4. Server executes commands on its local system.
5. Output is sent back to the client for display.
(Source: TELNET working)
Features of TELNET
● Supports remote login
● Uses TCP for reliable communication
● Text-based command execution
● Platform-independent using NVT
Limitations of TELNET
● No security: data, including passwords, is sent in plain text
● Vulnerable to eavesdropping and attacks
● Not suitable for secure communication
(Source: TELNET limitations)
Conclusion
TELNET is a simple and effective client–server protocol for remote login and command
execution. However, due to the absence of security mechanisms, it has largely been replaced
by more secure protocols such as SSH for modern Internet communication.
Standard Client–Server Protocol: Secure Shell (SSH)
Introduction
Secure Shell (SSH) is a standard application-layer client–server protocol used to provide
secure remote login and communication over an unsecured network. SSH was developed as
a secure replacement for TELNET, which transmits data in plain text.
SSH ensures confidentiality, integrity, and authentication during communication between a
client and a server.
(Source: Chapter 26 – SSH section)
Purpose of SSH
SSH is designed to:
● Provide secure remote login
● Protect data from eavesdropping
● Authenticate users and servers
● Securely transfer commands and files
It is widely used for system administration and secure network management.
(Source: SSH description)
Client–Server Architecture of SSH
● SSH client runs on the user’s machine.
● SSH server runs on the remote system.
● Communication uses TCP.
● Default port number: 22.
SSH encrypts all communication before transmission.
(Source: SSH architecture)
Diagram Explanation (SSH Architecture):
● User sends commands via SSH client
● Commands are encrypted
● Secure channel established over TCP
● Server decrypts and executes commands
● Encrypted responses sent back
(Diagram based on PDF explanation)
SSH Security Services
SSH provides the following security services:
1. Authentication
○ Verifies the identity of the user and server
○ Uses passwords or public-key authentication
2. Confidentiality
○ Encrypts data using cryptographic algorithms
○ Prevents unauthorized access
3. Integrity
○ Ensures data is not altered during transmission
○ Uses message authentication codes (MAC)
(Source: SSH security features)
Working of SSH
1. Client initiates TCP connection to server (port 22).
2. Server sends its public key.
3. Secure session is established using encryption.
4. User is authenticated.
5. Encrypted commands and responses are exchanged.
(Source: SSH working)
Advantages of SSH
● Secure communication
● Strong authentication
● Protection against packet sniffing
● Replacement for insecure protocols like TELNET
Comparison with TELNET
Feature TELNET SSH
Security No Yes
Encryption No Yes
Port 23 22
(Source: TELNET vs SSH comparison)
Conclusion
SSH is a secure and reliable client–server protocol that provides protected remote access over
the Internet. By offering encryption, authentication, and integrity, SSH has become the standard
choice for secure remote administration and communication.
Connection Types in HTTPS and Format of Messages
(Exam-oriented | 10 marks)
HTTPS: Brief Overview
HTTPS (HyperText Transfer Protocol Secure) is the secure version of HTTP. It uses HTTP
over TLS/SSL to provide:
● Confidentiality (encryption)
● Integrity
● Authentication
HTTPS works in a client–server model and uses TCP port 443.
Connection Types in HTTPS
HTTPS supports the same connection management styles as HTTP, but all communication
is encrypted using TLS.
1. Non-Persistent HTTPS Connection
In a non-persistent connection, each HTTP request–response pair uses a separate
TCP/TLS connection.
Working
1. Client establishes TCP connection.
2. TLS handshake is performed.
3. Client sends one HTTPS request.
4. Server sends one HTTPS response.
5. Connection is closed.
Characteristics
● One request per connection
● Repeated TLS handshakes
● Higher overhead
● Slower performance
2. Persistent HTTPS Connection
In a persistent connection, multiple HTTP requests and responses share the same
TCP/TLS connection.
Working
1. Client establishes TCP connection.
2. Single TLS handshake is performed.
3. Multiple HTTPS requests are sent.
4. Multiple HTTPS responses are received.
5. Connection is closed after inactivity.
Characteristics
● Multiple requests per connection
● One TLS handshake
● Better performance
● Reduced latency
Modern HTTPS uses persistent connections by default.
Comparison
Feature Non-Persisten Persistent
t
TCP One per One for many
connections request requests
TLS handshake Multiple Single
Efficiency Low High
Performance Slower Faster
Format of HTTPS Messages
HTTPS uses standard HTTP message formats, but the entire message is encrypted by TLS
before transmission.
HTTPS Request Message Format
Structure
[Link] Line
Method URL HTTP-Version
Example:
GET /[Link] HTTP/1.1
2. Header Fields
Host: [Link]
User-Agent: Chrome
Accept: text/html
3. Blank Line
[Link] Body (Optional)
○ Used in POST requests
Entire request is encrypted using TLS.
HTTPS Response Message Format
Structure
[Link] Line
HTTP-Version Status-Code Status-Phrase
Example:
HTTP/1.1 200 OK
[Link] Fields
Content-Type: text/html
Content-Length: 1024
[Link] Line
4. Response Body
Requested resource (HTML page, image, etc.)
Entire response is encrypted before transmission.
HTTPS Connection Establishment (TLS Handshake –
Short)
1. Client → Server: Hello + supported encryption methods
2. Server → Client: Certificate + public key
3. Secure session key is generated
4. Encrypted communication begins
Conclusion
HTTPS supports non-persistent and persistent connections, with persistent connections
being more efficient. Although the message format is identical to HTTP, HTTPS encrypts all
messages using TLS, ensuring secure and reliable web communication.