Unit2 Application Layer
Unit2 Application Layer
The Application Layer is the topmost layer in both the OSI and TCP/IP models, serving as the
interface between end-user applications and the underlying network services. It is not an
application itself, but a set of protocols and services that enable applications—such as web
browsers, email clients, and file transfer tools—to communicate over the network [1] [2] [3] .
1. Client-Server Architecture
Structure: There is at least one dedicated, always-on server with a permanent IP address.
Clients (such as PCs, smartphones, etc.) connect to the server to request services or
resources [5] [6] [7] [8] .
Operation: Clients initiate requests; the server processes these requests and sends
responses. Clients typically do not communicate directly with each other [5] [6] [7] .
Examples:
Web browsing (HTTP)
Email (SMTP, IMAP, POP3)
File transfer (FTP) [1] [2] [9]
Advantages:
Centralized management and control
Easier to secure and maintain
Scalable by adding more servers [7]
Disadvantages:
Potential bottlenecks at the server
Higher setup costs due to server infrastructure [7]
Summary
The Application Layer is fundamental to modern networking, providing the protocols and
services that allow user applications to communicate over diverse network architectures. Its
principles ensure interoperability, security, and efficient resource sharing, while its architectures
—client-server and peer-to-peer—offer different models for designing scalable and robust
network applications [1] [2] [6] [7] [3] .
⁂
Client and Server Processes
Client and server processes are fundamental components in the client-server architecture,
where tasks and resources are separated between service requesters (clients) and service
providers (servers).
Client Process:
The client is typically a software application or process that initiates communication by
sending requests to the server for specific resources or services [12] [13] .
Clients are responsible for presenting the user interface, collecting user input, and
forwarding requests to the server. For example, a web browser acts as a client when
accessing a website [12] [13] .
The client process waits for a response after sending a request and then processes the
server’s reply, such as displaying a web page or updating application data [14] .
Server Process:
The server is a software application or process that listens for incoming requests from
clients and provides the requested resources or services [12] [13] .
Servers may be stateless (handling each request independently) or stateful (maintaining
session information across multiple requests from the same client) [15] .
Servers often handle multiple client requests simultaneously, using techniques like the
master-slave pattern, where a master process listens for requests and spawns slave
processes to handle them [15] .
The server process typically starts before any client connects and remains available to
handle new requests as they arrive [16] [17] .
Key Points:
The client initiates communication; the server responds [13] [14] .
Communication is typically unidirectional per request, but can be bidirectional over a
session [12] .
The processes may run on the same machine or on different machines across a network [18]
[12] .
The architecture allows for clear separation of concerns, scalability, and easier
maintenance [12] .
Summary Table
This model is the backbone of most modern network applications, enabling distributed access to
resources and services [12] [13] [14] .
⁂
Three-Tier Architecture
Three-tier architecture is a modular client-server software design pattern that divides an
application into three distinct logical layers or tiers: the Presentation Tier, Application (Logic)
Tier, and Data Tier. Each tier is responsible for specific functions and can be developed,
managed, and scaled independently, providing flexibility and maintainability for complex
applications [20] [21] [22] [23] .
Summary Table
Tier Function Example Technologies
Presentation Tier User interface, handles user interaction HTML, CSS, JavaScript
Application Tier Business logic, processes requests Java, Python, .NET, Node.js
Data Tier Data storage, retrieval, and management MySQL, PostgreSQL, MongoDB
Three-tier architecture is widely used in modern web and enterprise applications due to its
robust separation of concerns, scalability, and ease of maintenance [20] [21] [22] [23] .
⁂
Hybrid Architecture
Hybrid architecture refers to the integration of multiple types of network or IT infrastructures—
most commonly combining on-premises (local) resources with public and/or private cloud
environments—to create a unified, flexible, and efficient system for running applications and
managing data [25] [26] [27] [28] .
Key Characteristics of Hybrid Architecture:
Integration of Diverse Environments: Hybrid architectures blend local servers, private
clouds, public clouds, and sometimes edge computing, allowing organizations to distribute
workloads optimally based on performance, security, and regulatory needs [26] [27] .
Flexibility and Scalability: Workloads can be dynamically shifted between on-premises and
cloud resources. This enables businesses to scale up quickly by leveraging cloud resources
when demand spikes, without over-investing in local infrastructure [25] [26] .
Security and Compliance: Sensitive data can be kept on-premises for compliance or
security reasons, while less critical workloads are offloaded to the cloud, reducing risk and
exposure [25] [27] .
Cost Optimization: Organizations can reduce costs by only using cloud resources for
specific tasks or during peak times, while maintaining essential operations on their own
infrastructure [25] [29] .
Unified Management: Modern hybrid architectures often use orchestration tools, unified
identity management, and monitoring solutions to present a seamless platform for users and
administrators, regardless of where resources actually reside [27] .
Technical Components:
Connectivity Infrastructure: Secure, high-bandwidth links (e.g., VPNs, dedicated circuits)
connect on-premises data centers with cloud providers [27] [28] .
Orchestration Layer: Tools for managing resource provisioning, application deployment,
and workload balancing across environments [27] .
Identity and Access Management: Unified authentication and authorization across all
environments [27] .
Data Synchronization: Mechanisms to keep data consistent between local and cloud
systems [27] .
Monitoring and Management: Centralized tools for visibility and control across the hybrid
environment [27] .
Pattern Description
Hub-and-
Centralized hub connects multiple environments, routing and managing traffic securely [30] .
Spoke
Direct connections between multiple environments, offering flexibility and resilience but with
Mesh
more complexity [30] .
Cloud
Uses a gateway to bridge on-premises and cloud resources [30] .
Gateway
Use Cases:
Enterprise Resource Planning (ERP): Speeding up deployment and improving performance
by splitting workloads between local and cloud systems [29] .
Customer Relationship Management (CRM): Rapid deployment and integration of new
applications and large datasets [29] .
Big Data Analytics & IoT: Managing and analyzing large volumes of data generated from
distributed devices and sources [29] .
Business Continuity: Using cloud as a backup or failover for on-premises systems [31] [29] .
Benefits:
Increased agility and responsiveness to changing business needs
Improved reliability and disaster recovery
Optimized costs through selective resource allocation
Enhanced security and regulatory compliance [25] [26] [32] [27]
Hybrid architecture is now a standard approach for enterprises aiming to balance control,
performance, and innovation by leveraging the strengths of both on-premises and cloud
environments [26] [32] [27] [28] .
⁂
Process Communication
Process communication refers to the mechanisms and methods that allow separate processes
(programs running independently) to exchange data and coordinate actions. In networking and
distributed systems, this is crucial for enabling interaction between clients and servers, as well
as among processes on the same or different machines.
Example Scenario
When a user accesses online banking, their web browser (client process) sends a login
request to the bank's web server (server process). The server processes the request,
interacts with the database if needed, and sends a response back to the client. Each
step involves structured process communication, often using sockets and following the
request-response pattern [37] [35] .
Summary Table
Communication Method Typical Use Case Example Technology
Process communication is foundational to building robust, scalable, and efficient networked and
distributed systems, enabling processes to interact, share resources, and coordinate their
actions [33] [37] [34] [35] .
⁂
Summary Table
Step Function
Conclusion:
The socket interface is the standard mechanism by which processes interact with the computer
network. It provides a flexible, file-like abstraction that supports both local and remote
communication, hiding the complexities of the underlying network stack and protocols [38] [40]
[39] .
Conclusion
Yes, the content in the handwritten notes is essentially the same as the previous detailed
explanation. Both describe the interface between a process and the computer network,
emphasizing the role of the network stack (and socket interface) in facilitating communication
between processes and the network [44] .
⁂
1. Process-to-Process Communication
Enables direct communication between specific processes on different hosts, not just
between computers.
Uses port numbers to identify sending and receiving processes [48] [46] [47] .
2. Reliable Data Transfer
Guarantees that data sent by the sender is delivered accurately and in order to the receiver.
Achieved using protocols like TCP (Transmission Control Protocol), which provides
acknowledgments, retransmissions, and sequencing [45] [46] [49] .
6. Flow Control
Prevents the sender from overwhelming the receiver by regulating the rate of data
transmission.
TCP uses techniques like windowing to manage flow control [46] [54] .
8. Congestion Control
Manages data transmission to prevent network congestion, adjusting the sending rate
based on network conditions.
TCP includes built-in congestion control mechanisms [46] [54] .
9. Encapsulation and Decapsulation
The transport layer encapsulates application data into segments (TCP) or datagrams (UDP)
before passing it to the network layer and decapsulates received data for the application
layer [48] [46] .
Summary
The transport layer offers a range of services to the application layer, including reliable and
unreliable data transfer, process-to-process communication, multiplexing, flow and congestion
control, and error handling [45] [48] [46] . Application developers choose the appropriate transport
service (TCP or UDP) based on the specific needs of their applications, balancing reliability,
speed, and resource usage [49] [50] [47] .
⁂
Multi-Streaming:
SCTP supports multiple independent data streams within a single connection (called an
"association"). This avoids head-of-line blocking: if one stream is delayed, others can
continue unaffected [56] [57] [62] .
Multihoming:
SCTP allows each endpoint to have multiple IP addresses. If one path fails, data can be
rerouted through another available path, providing redundancy and fault tolerance [56] [60]
[63] .
Multi-streaming No No Yes
Multihoming No No Yes
Common Applications
Telephony signaling over IP (e.g., SS7 over IP using SIGTRAN)
Voice over IP (VoIP) signaling
Reliable server pooling
File transfer and streaming applications that benefit from multi-streaming and partial
reliability [57] [61] .
Summary
SCTP is a robust, message-oriented, and connection-oriented transport protocol that combines
the reliability of TCP with the flexibility of UDP, while adding advanced features like multi-
streaming, multihoming, and enhanced security. It is especially useful in applications requiring
high reliability, fault tolerance, and efficient parallel data delivery [56] [60] [57] [58] .
⁂
Connection-
Yes No Yes
Oriented
Packet Delivery
In-order Unordered Unordered
Order
Retransmission Yes No No
Lower (due to
Timeliness High High (no retransmissions)
retransmissions)
Typical Applications
Streaming Media: Video and audio streaming where late packets are useless.
Internet Telephony (VoIP): Real-time voice communication.
Online Gaming: Multiplayer games needing timely data delivery.
Any application requiring timely, congestion-controlled, but not necessarily reliable,
delivery.
Summary
DCCP fills the gap between TCP and UDP by providing congestion control for unreliable
datagram flows, making it ideal for real-time applications that need timely delivery but can
tolerate some packet loss. It allows applications to benefit from fair network usage and
congestion management without the delay and overhead of TCP's reliability mechanisms [65] [66]
[70] [67] .
HTTPS Secure web browsing Encrypted version of HTTP for secure communication [76] .
Protocol Purpose/Use Case Description
FTP File transfer Transfers files between computers over a network [72] [73] [76] .
SMTP Email transmission Sends and receives email messages between servers [72] [73] [76] .
DNS Domain name resolution Translates domain names to IP addresses [73] [76] [75] .
Telnet Remote terminal access Provides command-line access to remote computers [73] [77] .
SSH Secure remote access Secure alternative to Telnet for remote login [73] [76] .
SNMP Network management Monitors and manages network devices [73] [76] .
Dynamic IP address
DHCP Automatically assigns IP addresses to devices [73] .
assignment
NFS Network file sharing Allows file sharing across different systems [73] .
Routing information
RIP Shares routing information between routers [73] .
exchange
Examples in Practice
Web Browsing: When you visit a website, your browser (client) sends an HTTP request to
the web server, which responds with the requested web page [72] [76] [78] .
Email: Sending an email involves SMTP for sending the message and POP3 or IMAP for
retrieving it from the mail server [73] [76] .
File Transfers: FTP allows users to upload or download files between computers over the
internet [72] [73] [76] .
Domain Name Resolution: DNS converts human-readable domain names into IP addresses
required for network communication [73] [76] [75] .
Summary
Application layer protocols are essential for enabling communication between software
applications over networks. They provide the necessary rules for data exchange, session
management, error handling, and security, forming the backbone of internet services such as
web browsing, email, file transfer, and remote access [72] [73] [76] .
⁂
Non-Persistent Connection
Definition:
A non-persistent connection is established for each request/response pair. After the server
sends the requested object, the connection is closed immediately [79] [80] .
How it works:
The client opens a new TCP connection to the server for every single object (such as an
HTML file or image).
Once the object is transferred, the connection is closed.
To fetch multiple objects (e.g., a web page with images), multiple TCP connections are
opened and closed sequentially or in parallel [81] [79] [80] .
Characteristics:
Default in HTTP/1.0.
Each object transfer requires a new connection, resulting in higher overhead due to
repeated TCP handshakes.
Increased latency and network congestion for pages with many objects.
Requires 2 RTTs (Round-Trip Times) per object: one for connection setup, one for the
actual data transfer [82] [80] .
Persistent Connection
Definition:
A persistent connection remains open for multiple request/response exchanges between the
client and server [83] [84] .
How it works:
The client opens a single TCP connection and uses it to send multiple requests and
receive multiple responses.
The connection stays open for a configurable timeout or until explicitly closed by either
side.
HTTP/1.1 and later use persistent connections by default [85] [79] [83] .
Types:
Without pipelining: The client waits for each response before sending the next
request.
With pipelining: The client can send multiple requests without waiting for responses,
improving efficiency [86] [79] .
Characteristics:
Default in HTTP/1.1.
Reduces overhead and latency by avoiding repeated connection setups.
More efficient for web pages with multiple objects.
Reduces network congestion and CPU usage [83] [82] .
Connection is closed after a timeout period or when explicitly instructed.
Comparison Table
Feature Non-Persistent Connection Persistent Connection
Connection per object Yes (one per object) No (one for multiple objects)
Summary
Non-persistent connections open and close for each object, causing more overhead and
latency.
Persistent connections stay open for multiple objects, reducing overhead and improving
performance, especially for modern web pages with many resources [83] [82] [80] .
HTTP/1.1 and later default to persistent connections, making web browsing faster and more
efficient [85] [79] [83] .
Persistent connections are now the standard for most web applications, enabling faster and
more scalable communication between clients and servers.
⁂
HTTP Cookies
Cookies are small pieces of data sent by a web server to a user's browser, which the browser
stores and sends back to the server with subsequent requests to the same domain. Cookies are
a fundamental mechanism for maintaining state and user information across the inherently
stateless HTTP protocol.
Types of Cookies
Session Cookies:
Do not have an expiration date.
Stored in memory and deleted when the browser is closed.
Used for temporary information, like session management [87] [90] [91] .
Persistent Cookies:
Have an expiration date set via the Expires or Max-Age attribute.
Stored on the user's device and remain after the browser is closed, until they expire or
are deleted.
Used for remembering login details, user preferences, etc. [87] [88] [90] [91] .
Client Request:
Cookie: sessionToken=abc123
This allows the server to identify the user and maintain session state [87] [88] [89] .
Summary Table
Cookie Type Lifetime Storage Location Typical Use
Cookies are essential for enabling stateful interactions on the web, supporting everything from
login sessions to personalized experiences, while also requiring careful management for security
and privacy [87] [88] [92] .
⁂
File Transfer Protocol (FTP) and Its Subtopics
Overview of FTP
File Transfer Protocol (FTP) is a standard network protocol used to transfer files between a
client and a server over a TCP/IP network. FTP operates at the application layer of the OSI
model and is widely used for uploading, downloading, and managing files on remote servers [93]
[94] [95] .
FTP uses a client-server architecture, where the client initiates a connection to the FTP server to
perform file operations. It supports both authenticated and anonymous access, allowing users to
log in with credentials or access public files without authentication [94] [96] .
Connection Steps
1. Establish Connection: The client connects to the server using an FTP client.
2. Authentication: The user logs in (either with credentials or anonymously).
3. Command/Data Channels: Two channels are established for commands and data transfer.
4. File Operations: The user uploads, downloads, or manages files.
5. Session Termination: The connection is closed after operations are complete [94] [95] [96] .
FTP Modes
1. Active Mode
The client opens a random port and sends the port number to the server.
The server initiates the data connection from its port 20 to the client's specified port.
May face issues with firewalls blocking incoming connections [93] [96] [97] .
2. Passive Mode
The client requests the server to listen on a port for the data connection.
The client initiates both control and data connections, which works better with firewalls and
NAT [93] [96] [97] .
FTP Data Transfer Modes
FTP supports several data transfer modes that define how files are transferred:
ASCII Mode: Used for text files. Converts line endings and character encoding as
needed [98] [99] .
Binary Mode: Used for non-text files (images, executables, archives) to ensure data
integrity [98] [99] .
Stream Mode: Data is sent as a continuous stream, with all processing handled by TCP [100]
[101] .
Block Mode: Data is sent in blocks, each with a header and byte count—useful for record-
oriented files [100] .
Compressed Mode: Data is compressed before transfer to save bandwidth, though rarely
used today [100] [101] .
FTP Commands
FTP provides a wide range of commands for file and directory management. Some of the most
important commands include [102] :
Command Description
FTPES (FTP over Explicit SSL/TLS): Upgrades an FTP connection to use TLS/SSL
encryption explicitly after the initial connection [94] [103] .
Advantages
Efficient transfer of large files and directories [107] .
Supports resuming interrupted transfers and scheduling file transfers [107] .
Compatible with various operating systems and platforms [107] .
Allows queueing and automation of file operations [107] .
Disadvantages
Lacks built-in encryption; data, including credentials, is sent in plain text [107] [108] .
Vulnerable to interception and unauthorized access [107] [108] .
Complex firewall and NAT configuration, especially in active mode [97] [104] .
Limited integrity checks and monitoring capabilities [108] .
Use Cases
Website management (uploading/downloading web files) [96] .
Software distribution and updates [95] .
Backup and archival of data [107] .
Sharing large files or datasets between organizations [94] [95] .
Pros & Cons High speed and efficiency vs. lack of security and complexity
FTP remains a foundational protocol for file transfer, though its use is declining in favor of more
secure alternatives like SFTP and FTPS for modern applications [94] [103] [105] .
⁂
What is SMTP?
SMTP, or Simple Mail Transfer Protocol, is the standard protocol for sending email across the
Internet. It operates at the application layer of the TCP/IP protocol suite and defines how email
messages are transferred from the sender’s device to the recipient’s mail server [109] [110] [111] [112]
[113] .
Key Characteristics
Connection-Oriented & Text-Based: SMTP establishes a reliable, ordered connection
(typically using TCP) and communicates using text-based command strings and
responses [109] [111] [112] .
Client-Server Model: The sender’s system acts as the SMTP client, and the recipient’s mail
server acts as the SMTP server. The client initiates the connection and issues commands;
the server responds and processes the request [110] [111] [114] .
Port Numbers: SMTP commonly uses port 25 for server-to-server communication, port 587
for client submission, and port 465 for secure (SSL/TLS) connections [112] [113] .
Not for Retrieval: SMTP is used only for sending and relaying email, not for retrieving it.
Retrieval is handled by protocols like IMAP or POP3 [110] [115] [112] .
1. Connection Establishment
The email client (Mail User Agent, MUA) connects to the SMTP server (Mail Transfer Agent,
MTA) over TCP, usually on port 25, 587, or 465 [110] [114] [112] .
The client begins the session by sending a greeting command (HELO or EHLO) [110] [111] [115] .
2. Mail Transaction
MAIL Command: Specifies the sender’s email address (envelope sender) [109] [111] [112] .
RCPT Command: Specifies each recipient’s email address. This command can be repeated
for multiple recipients [109] [111] [112] .
DATA Command: Signals the start of the actual message content, which includes headers
(e.g., Subject, From, To) and the message body. The message ends with a line containing
only a period (.) [109] [111] [112] .
4. Session Termination
After the message is sent, the client issues a QUIT command, and the server closes the
connection [109] [110] [111] [115] .
Security in SMTP
Lack of Built-in Security: By default, SMTP transmits data in plain text, making it vulnerable
to interception.
Encryption: Secure SMTP (SMTPS) uses SSL/TLS to encrypt the connection, typically on
port 465 or via STARTTLS on port 587 [113] .
Authentication: Modern SMTP servers require authentication to prevent spam and
unauthorized use [114] [113] .
Summary Table
Aspect SMTP Details
Data Format Plain text (with MIME for attachments and non-ASCII content)
Server Storage Usage More (emails remain on server) Less (emails deleted from server)
Best For Multi-device access, shared mailboxes Single-device use, limited server storage
Default Ports 143 (unencrypted), 993 (SSL/TLS) 110 (unencrypted), 995 (SSL/TLS)
Summary
IMAP is modern, flexible, and supports synchronization across devices, making it the default
for most email clients today.
POP3 is simple, lightweight, and stores emails locally, which can be useful for single-device
users or those with limited server space.
Both protocols are for receiving (not sending) emails; sending is handled by SMTP [118] .
For most users today, IMAP is recommended due to its convenience and synchronization
features, but POP3 remains useful in specific scenarios where local storage and offline access
are priorities [117] [118] [120] [121] [119] .
⁂
8. Return IP Address:
The DNS resolver returns the IP address to your computer. Your computer stores this
information in its cache for future use [129] [125] [123] .
9. Browser Connects to Website:
The browser uses the IP address to connect to the web server and load the website [129] [123]
[126] .
Additional Notes
Caching: DNS information is often cached at multiple levels (local computer, resolver, etc.)
to speed up future lookups [127] [122] [129] .
Types of DNS Servers:
Recursive Resolver: Handles the full lookup process for the client [127] [125] .
Root Server: Directs queries to TLD servers [123] [124] .
TLD Server: Directs queries to authoritative servers for specific domains [123] [124] .
Authoritative Server: Holds the actual DNS records for the domain [129] [123] [124] .
In summary:
DNS lookup is a multi-step process that starts with your browser and ends with the website’s IP
address being returned, allowing your device to connect to the desired web server [127] [129] [123]
[124] .
Peers: Each participant is a peer, and every peer can act as both a downloader and an
uploader. This means as soon as you have a piece of the file, you can start sharing it with
others [131] [136] [137] .
3. File Splitting and Piece Distribution
Chucks/Pieces: The target file is divided into many small pieces (chunks), typically a few
hundred kilobytes each [135] [136] [133] [138] .
Parallel Downloading: Peers download different pieces from different peers at the same
time, maximizing bandwidth usage and reducing the load on any single peer or server [133]
[138] [134] .
.torrent Metadata file containing info about the file and tracker
Fault Tolerance Low (server is single point) High (no single point)
Conclusion
BitTorrent is a powerful example of P2P file distribution, enabling fast, efficient, and resilient
sharing of large files by leveraging the collective bandwidth and storage of all participating
peers. Its decentralized nature, incentive mechanisms, and piecewise file distribution make it a
cornerstone of modern file sharing [131] [132] [133] [134] .
⁂
Detailed Answers
a. BitTorrent’s Use of Parallel Downloads vs. Traditional FTP
BitTorrent uses a peer-to-peer (P2P) architecture where files are split into many small pieces,
and each peer can download different pieces from multiple other peers simultaneously [139] . This
parallel downloading increases the overall download speed and efficiency because:
Load Distribution: Instead of relying on a single server (as in FTP), BitTorrent distributes the
upload burden among all peers, preventing server bottlenecks [139] .
Bandwidth Utilization: Peers download from multiple sources at once, maximizing available
bandwidth and reducing download times [139] .
Scalability: As more peers join the swarm, the total available upload bandwidth increases,
improving performance for everyone [139] .
Fault Tolerance: If one peer goes offline, others still provide the remaining pieces, making
the system robust [139] .
In contrast, traditional FTP uses a client-server model where all clients download files from a
central server, often leading to congestion and slower speeds as more clients connect [139] .
b. DNS Resolver Query Time Calculation
If a DNS resolver queries three servers sequentially with round-trip times (RTTs) of 60 ms, 30
ms, and 10 ms, the total time to resolve the name is the sum of all RTTs:
First server: 60 ms
Second server: 30 ms
Third server: 10 ms
Total time = 60 ms + 30 ms + 10 ms = 100 ms.
References:
[139] https://www.geeksforgeeks.org/bittorrent-protocol/
https://www.cs.cornell.edu/courses/cs5412/2017sp/slides/lecture7.pdf
https://www.tutorialspoint.com/computer_fundamentals/computer_networking_layers.htm
⁂
References:
[140] https://www.geeksforgeeks.org/bittorrent-protocol/
https://www.cs.cornell.edu/courses/cs5412/2017sp/slides/lecture7.pdf
⁂
20, 21 FTP (File Transfer Protocol) File transfer (data and control)
143 IMAP (Internet Message Access Prot.) Advanced email retrieval and management
Port Number Service Name Description
TCP ports range from 0 to 65535, but ports 0–1023 are known as "well-known ports" and are
reserved for standard services [146] [147] [148] .
Acknowledgments ACKs confirm receipt, trigger retransmission if lost [141] [143] [142] [144]
Congestion Control Adjusts sending rate to avoid network congestion [141] [145]
TCP's robust reliability mechanisms and standardized port assignments make it the backbone
for most critical internet services, including web browsing, email, file transfer, and remote
access [141] [143] [146] .
⁂
20, 21 FTP (File Transfer Protocol) File transfer (data and control)
143 IMAP (Internet Message Access Prot.) Advanced email retrieval and management
Ports 0–1023 are known as "well-known ports" and are reserved for standard services [151] [152] .
TCP’s reliability mechanisms and standardized port assignments make it the backbone for
critical internet services such as web browsing, email, file transfer, and remote access [149] [150]
[151] .
7. How It Works
When an application wants to send data, it passes it to the transport layer, which
segments the data, adds necessary headers (including port numbers, sequence
numbers, etc.), and hands it to the Internet layer for delivery [161] [157] .
At the receiving end, the transport layer reassembles the segments, checks for errors,
manages flow, and delivers the data to the correct application process [161] [157] .
8. Port Numbers and Multiplexing
The transport layer uses port numbers to distinguish between different applications and
services running on the same device, enabling multiple simultaneous connections [153]
[157] .
9. Peer-to-Peer Communication
The transport layer communicates directly with its peer on the remote host,
encapsulating data in transport layer Protocol Data Units (PDUs), which are then
transmitted over the network [156] .
10. Summary Table: Main Transport Layer Protocols in the Internet
Flow Congestion
Protocol Type Reliability Ordering Use Cases
Control Control
Streaming,
UDP Connectionless No No No No
DNS, gaming
Connection- Telephony,
SCTP Yes Yes Yes Yes
oriented signaling
Real-time
DCCP Connectionless No No Yes Yes
multimedia
In summary:
The transport layer is essential for reliable, efficient, and organized data transfer in computer
networks, especially on the Internet. It provides critical services such as segmentation, reliability,
flow control, and multiplexing, using protocols like TCP and UDP to meet the diverse needs of
modern networked applications [153] [155] [156] [158] [159] [157] .
⁂
Difference Between Connection-Oriented and
Connectionless Services
Introduction
In computer networking, connection-oriented and connectionless services define how data is
transmitted between devices. These two types of services have distinct characteristics,
advantages, disadvantages, and use cases, which are crucial for understanding network
protocol design and application suitability [162] [163] [164] .
Connection-Oriented Services
Key Features
Connection Establishment: A dedicated connection (or session) is established between
sender and receiver before any data transfer begins [162] [163] [164] .
Reliable Delivery: Data is delivered reliably, with mechanisms for error detection, correction,
and retransmission if necessary [162] [163] [165] .
Ordered Data Transfer: Data packets are delivered in the same order as they were
sent [162] [163] [164] .
Acknowledgments: The receiver sends acknowledgments for received data, ensuring no
loss or duplication [162] [163] [164] .
Flow and Congestion Control: Mechanisms are in place to manage data flow and prevent
network congestion [165] [164] .
Connection Termination: The connection is properly closed after data transfer is
complete [164] .
Examples
TCP (Transmission Control Protocol): Used in web browsing (HTTP/HTTPS), email
(SMTP), and file transfers (FTP) [162] [163] [164] .
Mobile voice calls: Where a continuous, reliable connection is required [163] [166] .
Advantages
Ensures data integrity and reliability [162] [163] [165] .
Maintains the correct order of data packets [162] [163] .
Suitable for applications where accuracy and completeness are critical [162] [163] [164] .
Disadvantages
Higher overhead due to connection setup and maintenance [162] [163] [165] .
Slower performance compared to connectionless services, especially for small or sporadic
data transfers [162] [163] .
Consumes more resources for maintaining the connection state [162] [163] [164] .
Connectionless Services
Key Features
No Connection Setup: Data is sent without establishing a dedicated connection; each
packet is independent [162] [163] [164] .
Unreliable Delivery: No guarantees for delivery, order, or error correction—packets may be
lost, duplicated, or arrive out of order [162] [163] [165] .
No Acknowledgments: Receivers do not send acknowledgments for received data [162] [163]
[164] .
Lower Overhead: Minimal setup and maintenance, leading to faster data transmission [162]
[163] [165] .
Examples
UDP (User Datagram Protocol): Used in streaming media, online gaming, VoIP, and DNS
queries [162] [163] [164] .
ICMP (Internet Control Message Protocol): Used for network diagnostics like ping [163] .
Advantages
Faster data transmission due to minimal overhead [162] [163] [165] .
More efficient for real-time and broadcast/multicast applications [162] [163] [164] .
Suitable for applications where speed is more important than reliability [162] [163] [164] .
Disadvantages
No guarantee of delivery or correct order of data [162] [163] [165] .
Application must handle any required error checking or retransmission [162] [163] .
Less suitable for critical applications requiring data integrity [162] [163] .
Comparison Table
Feature Connection-Oriented Connectionless
Acknowledgments Yes No
Real-World Analogies
Connection-Oriented: Like a telephone call—both parties establish a connection,
communicate, and then hang up [167] [164] .
Connectionless: Like sending postcards—each postcard travels independently, may arrive
out of order, or not at all, and no confirmation is received [167] [163] .
Summary
Connection-oriented services are best for applications needing reliable, ordered, and
guaranteed delivery of data, but come with higher overhead and slower performance [162]
[163] [164] .
Connectionless services are ideal for applications prioritizing speed and efficiency, where
occasional data loss is acceptable [162] [163] [164] .
Choosing between these services depends on the application's requirements for reliability,
speed, and resource usage.
⁂
Multiplexing
What Is Multiplexing?
Multiplexing is the process of combining data from multiple application processes on the
sender's side and preparing it for transmission over a single network channel [168] [169] [170] .
Each data stream is assigned a unique identifier, typically a port number, which is included in
the transport layer header [168] [169] .
This allows multiple applications (such as web browsers, email clients, and chat apps) to
send data simultaneously using the same network connection [168] [170] .
Types of Multiplexing
Frequency Division Multiplexing (FDM): Assigns different frequency ranges to different
data streams.
Time Division Multiplexing (TDM): Allocates different time slots to each data stream.
Statistical Multiplexing: Dynamically allocates resources based on demand, optimizing
bandwidth usage [170] .
Demultiplexing
What Is Demultiplexing?
Demultiplexing is the process at the receiver’s end where the transport layer examines
incoming data segments and delivers them to the correct application process based on the
port number and other identifiers in the segment header [168] [169] [171] .
This ensures that data meant for a specific application (e.g., a web browser or FTP client) is
delivered correctly, even if multiple applications are running simultaneously [168] [171] .
Example
Suppose you are browsing the web, downloading files via FTP, and chatting online at the same
time:
Multiplexing: All data streams from these applications are combined and sent over the
network with unique port numbers.
Demultiplexing: At the destination, the transport layer uses port numbers to deliver each
segment to the correct application [168] [171] [170] .
Comparison Table
Feature Multiplexing Demultiplexing
Combine data from multiple sources for Deliver data to correct application at
Purpose
sending receiver
Key Identifier Port number (and IP for TCP) Port number (and IP for TCP)
Step-by-Step Calculation
1. Header Calculation
Number of Layers: 5
Header Size per Layer: 20 bytes
Total Header Size:
2. Total Transmission Size
Original Message Size: 200 bytes
Total Header Size: 100 bytes
Total Transmission Size:
Final Answer
The total transmission size is 300 bytes.
Explanation
As the message passes through each of the 5 layers, each layer adds its own 20-byte
header.
The headers accumulate, increasing the total size of the data to be transmitted.
The sum of all headers (100 bytes) is added to the original message (200 bytes), resulting in
a total of 300 bytes that will be transmitted over the network.
⁂
Stop-and-Wait Protocol
Operation: The sender transmits one frame and waits for an acknowledgment before
sending the next frame. If the acknowledgment is not received within a timeout period, the
sender retransmits the frame [178] [179] .
Features:
Simple and easy to implement.
Only one frame is in transit at any time.
Sender is idle while waiting for acknowledgment, leading to low efficiency for long-delay
networks [178] .
Error Control: Lost or corrupted frames are retransmitted after a timeout [178] [179] .
Go-Back-N Protocol
Operation: The sender can transmit multiple frames (up to a window size N) without waiting
for individual acknowledgments. If a frame is lost or an error occurs, all frames from the
erroneous one onward are retransmitted [178] [179] .
Features:
Uses a sliding window for efficient data transfer.
Receiver only accepts frames in order; out-of-order frames are discarded [178] .
Cumulative acknowledgments are used to confirm receipt of multiple frames [178] .
Efficiency: Higher than Stop-and-Wait, but can waste bandwidth if errors are frequent, as
many frames may be retransmitted unnecessarily [178] [179] .
Comparison Table
Feature Stop-and-Wait Go-Back-N Selective Repeat
Summary
Connection-oriented protocols ensure reliable, ordered, and error-free data transfer
through connection setup, data transfer, and termination phases [174] [175] .
Stop-and-Wait is simple but inefficient for long or high-delay networks [178] [179] .
Go-Back-N improves efficiency with a sliding window but may retransmit unnecessary
frames [178] [179] .
Selective Repeat offers the best efficiency by retransmitting only lost or corrupted frames
and supporting out-of-order delivery [178] [179] .
These protocols are foundational for reliable data communication in modern networks.
⁂
1. https://artoonsolutions.com/glossary/application-layer/
2. https://www.tutorialspoint.com/data_communication_computer_network/application_layer_introduction.h
tm
3. https://networkencyclopedia.com/application-layer/
4. https://en.wikipedia.org/wiki/Application_layer
5. https://www.youtube.com/watch?v=abeupgK5z48
6. https://www.youtube.com/watch?v=1bRfeKQfDbU
7. https://www.fs.com/blog/clientserver-vs-peertopeer-networks-similarities-and-differences-1694.html
8. https://birkhoffg.github.io/blog/posts/networking-application-layer/
9. https://www.scribd.com/document/804605467/Principles-of-Network-Applications
10. https://www.kentik.com/kentipedia/network-architecture/
11. https://www.coursera.org/articles/application-layer
12. https://cs.uwaterloo.ca/~m2nagapp/courses/CS446/1195/Arch_Design_Activity/ClientServer.pdf
13. https://homepages.laas.fr/adoncesc/FILS/Lecture1_ClientServer.pdf
14. https://www.jaroeducation.com/blog/client-server-architechture-guide/
15. http://www.cs.sjsu.edu/faculty/pearce/modules/patterns/distArch/server.htm
16. https://www.ibm.com/docs/en/zos/2.4.0?topic=internets-typical-client-server-program-flow-chart
17. https://www.ibm.com/docs/en/zos/2.2.0?topic=tcpip-typical-clientserver-program-flow-chart&rut=7de
596353a28e225a8ff2f0ef1fe0fd87e39419f40b0836bf5783670e8af9519
18. https://www.interviewbit.com/blog/client-server-architecture/
19. https://intellipaat.com/blog/what-is-client-server-architecture/
20. https://www.techtarget.com/searchsoftwarequality/definition/3-tier-application
21. https://vfunction.com/blog/3-tier-application/
22. https://epgp.inflibnet.ac.in/epgpdata/uploads/epgp_content/S000007CS/P001063/M017513/ET/147462
6693etext-mod15.pdf
23. https://learn.microsoft.com/lv-lv/windows/win32/cossdk/using-a-three-tier-architecture-model
24. https://www.cbtnuggets.com/blog/technology/networking/3-tier-network-structure-explained
25. https://www.alooba.com/skills/concepts/cloud-networking-497/hybrid-network-architectures/
26. https://www.ibm.com/think/topics/hybrid-cloud-architecture
27. https://www.virtana.com/glossary/what-is-hybrid-infrastructure/
28. https://docs.aws.amazon.com/wellarchitected/latest/hybrid-networking-lens/definition.html
29. https://www.itbusinessedge.com/it-management/evolving-digital-transformation-implementation-with-
hybrid-architectures/
30. https://www.hpe.com/in/en/what-is/hybrid-cloud-networking.html
31. https://nordvpn.com/cybersecurity/glossary/hybrid-wan/
32. https://www.verizon.com/business/resources/articles/s/what-is-a-hybrid-network-and-how-can-it-bene
fit-your-business/
33. https://www.emblogic.com/blog/10/project-6-client-server-using-inter-process-communication-mecha
nism/
34. https://learn.microsoft.com/en-us/windows/win32/ipc/interprocess-communications
35. https://www.idc-online.com/technical_references/pdfs/data_communications/Client_Server_Model.pdf
36. https://learn.sandipdas.in/client-server-communication-deep-dive-314a7fe15c06
37. https://easyexamnotes.com/client-server-communication/
38. https://www.ibm.com/docs/en/aix/7.2.0?topic=sockets-interface
39. https://courses.cs.vt.edu/cs4254/fall04/slides/Socket Programming_6.pdf
40. https://w3.cs.jmu.edu/kirkpams/OpenCSF/Books/csf/html/Sockets.html
41. https://docs.idris-lang.org/en/latest/st/examples.html
42. https://www.cs.dartmouth.edu/~campbell/cs50/socketprogramming.html
43. https://www.cs.fsu.edu/~sudhir/courses/2025scnt4504/Lecture-SP-cnt4504.pdf
44. image.jpg
45. https://electronicspost.com/transport-services-available-to-applications/
46. https://www.coursera.org/articles/transport-layer
47. https://s.web.umkc.edu/sbs7vc/IT321/Transport/
48. https://educlash.com/wp-content/uploads/2019/03/Computer-Network-unit-5.pdf
49. https://www.bbau.ac.in/dept/CS/TM/tcpudp.pdf
50. https://www.avast.com/c-tcp-vs-udp-difference
51. https://www.spiceworks.com/tech/networking/articles/tcp-vs-udp/
52. https://www.youtube.com/watch?v=KY_Bqp2xDVc
53. https://www.computernetworkingnotes.com/ccna-study-guide/reliable-and-unreliable-connections-exp
lained.html
54. https://www.radware.com/cyberpedia/application-security/the-osi-model-breaking-down-its-seven-lay
ers/
55. https://www.tutorialspoint.com/what-are-the-services-provided-by-the-transport-layer
56. https://en.wikipedia.org/wiki/Stream_Control_Transmission_Protocol
57. https://solveforce.com/sctp-stream-control-transmission-protocol/
58. https://www.tutorialspoint.com/what-are-the-stream-control-transmission-protocol-sctp-services
59. https://www.techtarget.com/searchnetworking/definition/SCTP
60. https://www.ibm.com/docs/en/aix/7.1.0?topic=protocol-stream-control-transmission
61. https://testbook.com/full-form/sctp-full-form
62. https://docs.oracle.com/en/industries/communications/session-border-controller/9.3.0/configuration/str
eam-control-transfer-protocol-overview.html
63. https://info.support.huawei.com/hedex/api/pages/EDOC1100149308/AEJ0713J/17/resources/admin/sec_
admin_sctp_0002.html
64. https://docs.oracle.com/cd/F11875_01/docs.468/SIGTRAN/sctp-stream-control-transmission-protocol.ht
ml
65. https://www.telecomtrainer.com/dccp-datagram-congestion-control-protocol/
66. https://solveforce.com/dccp/
67. https://en.wikipedia.org/wiki/Datagram_Congestion_Control_Protocol
68. https://datatracker.ietf.org/wg/dccp/about/
69. https://www.techniques-ingenieur.fr/en/resources/article/ti382/new-multimedia-transport-techniques-th
e-dccp-protocol-te7576/v1
70. https://wiki.wireshark.org/DCCP
71. https://www.icir.org/floyd/papers/dccp.pdf
72. https://lightyear.ai/tips/what-are-application-layer-protocols
73. https://www.prepbytes.com/blog/computer-network/application-layer-protocols-in-computer-network
s/
74. https://en.wikipedia.org/wiki/Application_layer
75. https://www.scribd.com/document/750671570/Application-layer-and-protocols
76. https://sites.google.com/view/computer-network-shreya/application-layer-protocols
77. https://www.scaler.com/topics/computer-network/application-layer-protocols/
78. https://www.linkedin.com/pulse/application-layer-look-key-protocols-powering-your-digital-uthra-hnc
df
79. https://www.chiragbhalodia.com/2022/01/compare-persistent-http-non-persistent-http.html
80. https://appassets.softecksblog.in/dccn/assets/dccn2/11.htm
81. https://www.youtube.com/watch?v=5AXVLO4VW4U
82. https://www.tutorialandexample.com/difference-between-persistent-and-non-persistent-connection
83. https://www.techtarget.com/whatis/definition/persistent-connection-HTTP-persistent-connection
84. https://en.wikipedia.org/wiki/HTTP_persistent_connection
85. https://serverfault.com/questions/1027090/does-http-work-on-persistent-or-non-persistent-connection
s
86. https://www.scaler.in/http-non-persistent-amp-persistent-connection/
87. https://www.cisco.com/c/en/us/support/docs/security/web-security-appliance/117925-technote-csc-00.
html
88. https://en.wikipedia.org/wiki/HTTP_cookie
89. https://www.lirmm.fr/~poupet/enseignement/internet10/cookies.pdf
90. https://beeceptor.com/docs/concepts/http-cookies/
91. https://learn.microsoft.com/en-us/previous-versions/iis/6.0-sdk/ms526029(v=vs.90)?redirectedfrom=M
SDN
92. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies
93. https://en.wikipedia.org/wiki/File_Transfer_Protocol
94. https://www.techtarget.com/searchnetworking/definition/File-Transfer-Protocol-FTP
95. https://www.box.com/en-in/resources/what-is-ftp
96. https://www.hostinger.co.uk/tutorials/what-is-ftp
97. https://www.jscape.com/blog/active-v-s-passive-ftp-simplified
98. https://www.jscape.com/blog/ftp-binary-and-ascii-transfer-types-and-the-case-of-corrupt-files
99. https://support.hpe.com/techhub/eginfolib/networking/docs/switches/5980/5200-3912_fund_cg/conten
t/498671072.htm
100. https://blog.devgenius.io/the-essential-guide-to-file-transfer-protocol-ftp-for-reliable-and-secure-file
-transfers-741ed503da26?gi=5f83dd61b020
101. https://www.fortinet.com/resources/cyberglossary/file-transfer-protocol-ftp-meaning
102. https://www.ionos.com/digitalguide/server/know-how/ftp-commands/
103. https://www.scaler.com/topics/computer-network/file-transfer-protocol/
104. https://www.solarwinds.com/resources/it-glossary/sftp-vs-ftps
105. https://www.kiteworks.com/secure-file-transfer/sftp-vs-ftp/
106. https://www.knownhost.com/blog/what-is-ftp-complete-guide-to-file-transfer-protocol/
107. https://www.chtips.com/computer-fundamentals/advantages-and-disadvantages-of-ftp/
108. https://www.kiteworks.com/risk-compliance-glossary/file-transfer-protocol/
109. https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
110. https://www.techtarget.com/whatis/definition/SMTP-Simple-Mail-Transfer-Protocol
111. https://mailtrap.io/blog/smtp/
112. https://en.wikipedia.org/wiki/SMTP_protocol
113. https://aws.amazon.com/what-is/smtp/
114. https://www.atera.com/glossary/simple-mail-transfer-protocol-smtp/
115. https://www.cloudns.net/blog/smtp-simple-mail-transfer-protocol-explained/
116. https://www.darktrace.com/cyber-ai-glossary/simple-mail-transfer-protocol-smtp
117. https://www.spiceworks.com/tech/tech-general/articles/imap-vs-pop3/
118. https://world.siteground.com/tutorials/email/protocols-pop3-smtp-imap/
119. https://www.cloudflare.com/learning/email-security/what-is-imap/
120. https://mailtrap.io/blog/pop3-vs-imap/
121. https://www.nexcess.net/help/email-protocols-imap-versus-pop3/
122. https://www.mailmodo.com/guides/dns-lookup/
123. https://karanpratapsingh.com/courses/system-design/domain-name-system
124. https://www.pingdom.com/blog/a-visual-explanation-of-how-dns-lookups-work/
125. https://eitca.org/cybersecurity/eitc-is-cnf-computer-networking-fundamentals/domain-name-system/in
troduction-to-dns/examination-review-introduction-to-dns/describe-the-process-of-a-dns-lookup-whe
n-a-client-queries-a-dns-server-for-a-specific-domain-name-including-how-the-server-responds-if-i
t-is-authoritative-or-non-authoritative-for-the-domain/
126. https://www.youtube.com/watch?v=uloSthkU0Oc
127. https://www.cloudflare.com/learning/dns/what-is-dns/
128. https://w3speedup.com/dns-lookups-guide/
129. https://www.liquidweb.com/blog/how-to-demystify-the-dns-process/
130. https://www.digicert.com/faq/dns/how-does-dns-lookup-work
131. https://www.linkedin.com/pulse/understanding-bittorrent-basics-beyond-kiran-u-kamath-ctn7c
132. https://www.lenovo.com/us/en/glossary/bittorrent/
133. https://www.britannica.com/technology/BitTorrent
134. https://www.practicallynetworked.com/bittorrent-101-a-peer-to-peer-review/
135. https://sites.cs.ucsb.edu/~almeroth/classes/W10.290F/exams/03.pdf
136. https://www.youtube.com/watch?v=6U94bBuBVVU
137. https://iq.opengenus.org/bittorrent-architecture/
138. https://www.youtube.com/watch?v=23uTlbdCKbw
139. image.jpg
140. image.jpg
141. https://cs.stackexchange.com/questions/142552/why-is-tcp-known-as-reliable-protocol
142. https://www.educative.io/answers/how-does-the-tcp-reliability-algorithm-work
143. https://en.wikipedia.org/wiki/Transmission_Control_Protocol
144. http://totozhang.github.io/2016-01-03-tcp-reliable-communication/
145. https://www.haikel-fazzani.eu.org/blog/post/protocol-tcp
146. https://ipwithease.com/common-tcp-ip-well-known-port-numbers/
147. https://www.uninets.com/blog/what-is-tcp-port
148. https://forum.tufin.com/support/kc/latest/Content/ST2/USP/PredefinedServices.htm
149. https://en.wikipedia.org/wiki/Transmission_Control_Protocol
150. https://cs.stackexchange.com/questions/142552/why-is-tcp-known-as-reliable-protocol
151. https://ipwithease.com/common-tcp-ip-well-known-port-numbers/
152. https://sencode.co.uk/the-top-30-most-common-tcp-ports-and-their-services/
153. https://en.wikipedia.org/wiki/Transport_layer
154. https://www.techtarget.com/searchnetworking/definition/TCP-IP
155. https://www.simplilearn.com/tutorials/cyber-security-tutorial/what-is-tcp-ip-model
156. https://www.erg.abdn.ac.uk/users/gorry/course/inet-pages/transport.html
157. https://www.ibm.com/docs/en/aix/7.1?topic=protocols-internet-transport-level
158. http://www.eitc.org/research-opportunities/future-internet-and-optical-quantum-communications/intern
et-networks-and-tcp-ip/internet-protocol-suite-and-data-transmission/internet-protocol-suite-and-ser
vice-models/network-protocols-and-service-models/internet-transport-layer-and-services
159. https://icannwiki.org/TCP/IP
160. https://en.wikipedia.org/wiki/Internet_protocol_suite
161. https://docs.oracle.com/cd/E19504-01/802-5753/6i9g71m2g/index.html
162. https://diffstudy.com/connection-oriented-vs-connection-less-key-differences/
163. https://www.scaler.in/difference-between-connection-oriented-and-connectionless-services/
164. https://jumpcloud.com/it-index/connection-oriented-vs-connectionless-protocols-explained
165. https://www.baeldung.com/cs/connection-oriented-vs-connectionless-protocols
166. https://www.tutorialspoint.com/distinguish-between-connection-oriented-and-connectionless-service
167. https://www.difference.wiki/connection-oriented-service-vs-connection-less-service/
168. https://www.tutorialspoint.com/multiplexing-and-demultiplexing-in-transport-layer
169. https://www.scaler.in/multiplexing-and-demultiplexing-in-computer-networks/
170. https://www.prepbytes.com/blog/computer-network/multiplexing-and-demultiplexing-in-transport-laye
r/
171. https://electronicspost.com/multiplexing-and-demultiplexing-in-transport-layer/
172. https://www.youtube.com/watch?v=CekW6ipRrGA
173. https://www.scaler.com/topics/multiplexing-tcp-and-udp-socket/
174. https://beta.computer-networking.info/syllabus/default/principles/transport.html
175. https://jumpcloud.com/it-index/connection-oriented-vs-connectionless-protocols-explained
176. https://www.ibm.com/docs/fi/i/7.3?topic=design-creating-connection-oriented-socket
177. http://www2.ic.uff.br/~michael/kr1999/3-transport/3_05-segment.html
178. https://www.tutorialspoint.com/difference-between-stop-and-wait-gobackn-and-selective-repeat-prot
ocols
179. https://cshub.in/error-recovery-protocols-stop-and-wait-go-back-n-selective-repeat/