Application Layer 1
Application Layer 1
LAYER
Computer Networking: A Top-Down Approach
OVERVIEW OF APPLICATION
LAYER
Definition: The Application Layer is responsible for providing end-user
services and enabling communication between software applications over
the network.
Main Tasks:
•Supports user-facing applications like web browsers, email clients, and file transfer
utilities.
•Defines how messages should be formatted, transmitted, and interpreted between
hosts.
Protocols:
• HTTP: Used for web browsing.
• DNS: Translates domain names to IP addresses.
• SMTP: Used for sending emails.
• FTP: Transfers files between computers.
NETWORK APPLICATION
ARCHITECTURES
Network Application Architectures define how
applications interact and exchange data over a network. Two common
architectures are the Client-Server Model and the Peer-to-
Peer (P2P) Model.
Client-Server Architecture
• Definition: In a client-server model, clients request services, and
the server responds by providing them. The server is a centralized
entity that handles all the processing and resource distribution.
NETWORK APPLICATION
ARCHITECTURES CONT…
Characteristics:
• Server: Always on, awaiting requests.
• Client: Requests services from the server.
• Scalability: Can be an issue as the server needs more resources to handle a
growing number of clients.
Examples:
• Fault Tolerance: No single point of failure; if one peer disconnects, others can still
share resources.
Disadvantages:
1 Client-Server Interaction:
• The client process initiates communication by sending a request to the
server process using the server’s socket address (IP + port).
• The server listens on its socket for incoming requests and responds
accordingly.
2 TCP vs UDP for Process Communication:
• TCP (Transmission Control Protocol):
• Connection-oriented protocol, meaning a connection must be
established before data is sent.
• Ensures reliable delivery of data with error checking,
acknowledgments, and retransmission in case of data loss.
• Example: HTTP, FTP.
Definition:
HTTP is a stateless, application-layer protocol used to transfer
hypertext documents on the web.
HTTP Methods:
• GET: Requests data from a server.
• When you load a webpage, your browser sends a request to the web server for the page.
• After the server sends the page back, it “forgets” everything about you. If you request another
page, the server treats it like a new request, with no memory of the previous one.
HTTP - HYPERTEXT
TRANSFER PROTOCOL
CONT..
How This Affects Websites:
• Without some way to remember you, the server wouldn’t know if you were
logged in or what items you added to your shopping cart.
• This is where cookies and sessions come in. They help websites keep track
of users even though HTTP itself doesn’t remember anything.
In short, stateless means that the server doesn't remember anything
between requests unless extra mechanisms (like cookies) are used to
maintain session information.
Assignment HTTP Versions:
• HTTP/1.1: Persistent connections, chunked transfer encoding.
• HTTP/2: Multiplexing, header compression for improved speed.
• HTTP/3: Built on QUIC protocol, reducing latency and improving
reliability.
FTP - FILE TRANSFER
PROTOCOL
Definition: FTP is used to transfer files between a client and a server
over a TCP connection.
How it Works:
• Control Connection: Established for sending commands (port
21).
• Data Connection: Established separately for transferring data
(port 20).
Modes:
Active Mode: Client opens a port, and the server initiates the data
connection.
Passive Mode: Server opens a port, and the client initiates the
data connection.
FTP - FILE TRANSFER
PROTOCOL
Advantages:
Reliable file transfer with support for authentication.
Disadvantages:
Lacks encryption (unless FTPS or SFTP is used), making it vulnerable
to interception.
DNS - DOMAIN NAME
SYSTEM
Definition: DNS is a distributed hierarchical system that translates human-
readable domain names (e.g., www.example.com) into IP addresses (e.g.,
192.168.1.1)..
How DNS Works:
1. Local DNS Resolver:
A local DNS resolver (also known as a DNS client or stub resolver) is typically
part of the operating system of the user’s device. Its main job is to look up DNS
information.
Before making any requests to external DNS servers, it checks its local cache for
any recently resolved domain names.
If the domain name (e.g., example.com) is found in the cache, the resolver uses
the cached result, avoiding the need for a network request and reducing latency.
DNS - DOMAIN NAME
SYSTEM
2. Recursive Query:
• If the local DNS resolver does not have the domain information cached, it
performs a recursive query.
This means the resolver queries other DNS servers on behalf of the user to find
the correct IP address associated with the domain name.
It starts by contacting a root DNS server, then moves on to a TLD (Top-Level
Domain) server (e.g., for .com domains), and finally reaches the
authoritative DNS server that holds the correct IP address for the domain.
This process continues until the resolver gets the needed information, which is
then cached for future use.
PEER-TO-PEER
APPLICATIONS
Definition: In P2P applications, each user (peer) both consumes
and
provides resources.
Examples:
BitTorrent: Uses “P2P" to download and upload pieces of a file from multiple
peers simultaneously.
Skype: Initially used a P2P architecture for voice calls, allowing scalable and
decentralized connections.
Advantages:
• Highly scalable as resources grow with the number of users.
Reliability:
• Applications like email and file transfers require reliable transport (e.g.,
TCP), ensuring all data is received.
• Applications like real-time video may tolerate some data loss and use
unreliable transport (e.g., UDP).
Throughput:
Timing: