Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Abhi CS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

A Case Study on

Transport Layer
Submitted in partial fulfilment of Request for the award of degree in

DEPARTMENT OF COMPUTER APPLICATIONS


Of
BENGALURU CITY UNIVERSITY
BENGALURU

ACHARYA INSTITUTE OF GRADUATE STUDIES


(NAAC Reaccredited ‘A+’ Grade and Affiliated to Bengaluru City University)
1#89/90,Soledevanahalli,Hesaraghatta Road, Bengaluru -560107

2023-2024
A Case Study on

Transport Layer
Submitted in partial fulfilment of Request for the award of degree in

DEPARTMENT OF COMPUTER APPLICATIONS


of
BENGALURU CITY UNIVERSITY
BENGALURU

UNDER THE GUIDANCE OF


Prof. Yamuna Mam
Department of Computer Applications
AIGS, Bengaluru

ACHARYA INSTITUTE OF GRADUATE STUDIES


(NAAC Reaccredited ‘A+’ Grade and Affiliated to Bengaluru City
University)1#89/90,Soledevanahalli,Hesaraghatta Road, Bengaluru -560107

2023-2024
ACKNOWLEDGEMENT

Life enhances better opportunity with better blessings with adequate space and
time. It was a great blessing for doing this Case study on “Transport Layer”
where we have put all our efforts and dedication towards it resulting ingetting
undiscovered knowledge, better experiences, and ideas behind. To give brighter
and broader measures there has been a few concerns supportive to make this
project to be real time application, without which our project would have been
meaningless.

First, my heartfelt gratitude and respect to Dr. Gurunath Rao Vaidya, Principal
of AIGS and to Prof. Ramakrishna C.N, HOD , Dept. of Computer
Applications. With utmost thanks and dedication, I would like to thank our
guide Prof. Mrs. Yamuna , where she was aside in every step of work that I
have done and with some important advises and corrective measures.

I would like to extend my thanks and gratitude to every faculty of BCA


Department and to my family inmates and friend who are concerned for
the Case study.

ABHISHEK SINGH
BCA 2nd Year (Section – C)
TABLE OF CONTENT

TITLE PAGE NO.

1. INTRODUCTION TO TRANSPORT LAYER 1

2. TRANSPORT LAYER PROTOCOL 2

3. TCP SERVICES 3

4. TCP FEATURES 4

5. TCP SEGMENTS 5

6. TCP CONNECTIONS 6

7. TCP CONGESTION CONTROL 8


INTRODUCTION OF TRANSPORT LAYER

o The transport layer is a 4th layer from the top.


o The main role of the transport layer is to provide the communication services directly to
the application processes running on different hosts.
o The transport layer provides a logical communication between application processes
running on different hosts. Although the application processes on different hosts are not
physically connected, application processes use the logical communication provided by the
transport layer to send the messages to each other.
o The transport layer protocols are implemented in the
end systems but not in the network routers.
o A computer network provides more than one protocol
to the network applications. For example, TCP and
UDP are two transport layer protocols that provide a
different set of services to the network layer.
o All transport layer protocols provide
multiplexing/demultiplexing service. It also provides
other services such as reliable data transfer, bandwidth
guarantees, and delay guarantees.

o Each of the applications in the application layer has the ability to send a message by using
TCP or UDP. The application communicates by using either of these two protocols. Both
TCP and UDP will then communicate with the internet protocol in the internet layer. The
applications can read and write to the transport layer. Therefore, we can say that
communication is a two-way process
TRANSPORT LAYER PROTOCOL
The Transport Layer is the fourth layer in the OSI (Open Systems Interconnection) model and the
TCP/IP (Transmission Control Protocol/Internet Protocol) model. Its primary function is to
provide end-to-end communication and data transfer between applications on different devices.
Two of the most commonly used transport layer protocols are:

Transmission Control Protocol (TCP):

TCP is a connection-oriented protocol, which means that it. Stablishes a reliable and error-
checked connection before data exchange begins.

It ensures the reliable delivery of data by using acknowledgments and retransmission of lost or
corrupted packets.

TCP also implements flow control to prevent a fast sender from overwhelming a slow receiver
and congestion control to manage network congestion.
User Datagram Protocol (UDP):

UDP is a connectionless protocol,


meaning it does not establish a
dedicated connection before sending
data.
It is simpler and faster than TCP but
does not guarantee the reliable
delivery of data. There is no
acknowledgment or retransmission
mechanism.
UDP is often used in applications where low latency and real-time communication are more
critical than ensuring that every piece of data arrives intact (e.g., streaming media, online
gaming). Both TCP and UDP play crucial roles in network communication, and the choice
between them depends on the specific requirements of the application. TCP is commonly used for
applications
that require reliable and error-free data delivery, while UDP is suitable for applications where low
latency and real-time data transmit

TCP SERVICES

TCP is often used for applications that require a reliable and error-checked connection, such as file
transfer, email, and web browsing. Here are some common TCP services:

HTTP (Hypertext Transfer Protocol):


HTTP is the foundation of data
communication on the World Wide
Web. It is used for transmitting
hypertext, images, and other files
between web browsers and web servers.
Web browsers use HTTP to request
web pages, and web servers use HTTP
to respond with the requested content.

HTTPS (Hypertext Transfer Protocol Secure): Similar to HTTP, but with an additional layer
of security provided by SSL/TLS encryption. It is commonly used for secure communication over
the internet, such as online banking, shopping, and accessing sensitive information.

FTP (File Transfer Protocol): FTP is used for transferring files between a client and a server on
a computer network. It uses separate control and data connections, and it can operate in either
active or passive mode.

SMTP (Simple Mail Transfer Protocol): SMTP is used for sending email messages between
servers. It works in conjunction with other email protocols, such as POP3 (Post Office Protocol)
and IMAP (Internet Message Access Protocol), which are used for retrieving emails from a
server.

Telnet: Telnet is a network protocol used to provide a bidirectional interactive text-oriented


communication using a virtual terminal connection. While it was widely used in the past for
remote access to computers and networking devices, it is now largely replaced by more

secure protocols like SSH (Secure Shell).

POP3 (Post Office Protocol version 3): POP3 is an email retrieval protocol that allows a client
to download email messages from a mail server. It is one of the methods used by email clients
to retrieve messages from a mail server.

IMAP (Internet Message Access Protocol): IMAP is another email protocol used for retrieving
messages from a mail server. Unlike POP3, IMAP allows users to view and manipulate
messages on the server without downloading them to the local device.

DNS (Domain Name System): DNS uses both UDP (User Datagram Protocol) and TCP. While
UDP is used for most DNS queries, TCP is used for zone transfers and larger data transfers.

FEATURES OF TCP PROTOCOL

o Transport Layer Protocol :- TCP is a transport layer protocol as it is used in transmitting


the data from the sender to the receiver.

o Reliable:- TCP is a reliable protocol as it


follows the flow and error control
mechanism. It also supports the
acknowledgment mechanism, which checks
the state and sound arrival of the data. In the
acknowledgment mechanism, the receiver
sends either positive or negative
acknowledgment to the sender so that the
sender can get to know whether the data
packet has been received or needs to resend.
o Order of the data is maintained:- This protocol ensures that the data reaches the
intended receiver in the same order in which it is sent. It orders and numbers each segment
so that the TCP layer on the destination side can reassemble them based on their ordering.

o Connection-oriented:- It is a connection-oriented service that means the data exchange


occurs only after the connection establishment. When the data transfer is completed, then
the connection will get terminated.

o Full duplex :- It is a full-duplex means that the data can transfer in both directions at the
same time.

o Stream-oriented :- TCP is a stream-oriented protocol as it allows the sender to send the


data in the form of a stream of bytes and also allows the receiver to accept the data in the
form of a stream of bytes. TCP creates an environment in which both the sender and
receiver are connected by an imaginary tube known as a virtual circuit. This virtual circuit
carries the stream of bytes across the internet

TCP SEGMENTS

TCP (Transmission Control Protocol) divides data into smaller units known as segments for
transmission over a network. These segments are the basic units of data transfer in TCP
communication. Each segment contains a header and, optionally, data. Here is an overview of the
components of a TCP segment:

TCP Header:

Source Port Number (16 bits): Indicates the source port of the sender.

Destination Port Number (16 bits): Specifies the destination port on the receiver's side.

Sequence Number (32 bits): Represents the sequence number of the first data byte in the current
segment. This is used for ordering and reassembly of segments at the receiver.

Acknowledgment Number (32 bits): If the ACK flag is set, this field contains the value of the
next sequence number that the sender is expecting to receive. It acknowledges receipt of all prior
bytes.
Data Offset (4 bits): Specifies the length of the TCP header in 32-bit words. It indicates where the
data begins.

Reserved (6 bits): Reserved for future use; set to zero.

Flags (6 bits): Various control flags indicating the purpose and characteristics of the TCP segment.
Flags include URG, ACK, PSH, RST, SYN, and FIN.

Window Size (16 bits): Specifies the size of the receive window, indicating how much data the
sender can send before waiting for an acknowledgment.

Checksum (16 bits): Used for error-checking of the header and data.

Urgent Pointer (16 bits): If the URG flag is set, this field indicates the offset from the sequence
number indicating the last urgent data byte.

Options: Variable-length field providing additional information. Options may include Maximum
Segment Size (MSS), Window Scale Factor, Timestamps, and more.

Data: The actual payload or data being transmitted. The length of the data is determined by the total
length of the TCP segment minus the length of the TCP header

TCP CONNECTION

TCP is a connection-oriented protocol and every connection-oriented protocol needs to establish a


connection in order to reserve resources at both the communicating ends.

Connection Establishment –

1. Sender starts the process with the following:

Sequence number (Seq=521): contains the random initial sequence number generated at the
sender side.
Syn flag (Syn=1): request the receiver to synchronize its sequence number with the above-
provided sequence number.
Maximum segment size (MSS=1460 B): sender tells its maximum segment size, so that receiver
sends datagram which won’t require any fragmentation. MSS field is present inside Option field in
TCP header.
Window size (window=14600 B): sender tells about his buffer capacity in which he has to store
messages from the receiver.

2. TCP is a full-duplex protocol so both sender and receiver require a window for
receiving messages from one another.
Sequence number (Seq=2000): contains the random initial sequence number generated at the
receiver side.
Syn flag (Syn=1): request the sender to synchronize its sequence number with the above-provided
sequence number.
Maximum segment size (MSS=500 B): receiver tells its maximum segment size, so that sender
sends datagram which won’t require any fragmentation. MSS field is present inside Option field in
TCP header.
Since MSSreceiver < MSSsender, both parties agree for minimum MSS i.e., 500 B to avoid
fragmentation of packets at both ends.
Acknowledgement Number (Ack no.=522): Since sequence number 521 is received by the

receiver so, it makes a request for the next sequence number with Ack no.=522 which is the next
packet expected by the receiver since Syn flag consumes 1 sequence no.
ACK flag (ACk=1): tells that the acknowledgement number field contains the next sequence
expected by the receiver.

TCP congestion control


Slow Start: Initial Phase: When a TCP connection is established or re-established, the sender
starts by sending a small number of segments.
Exponential Growth: As acknowledgments are received, indicating successful delivery, the sender
exponentially increases its congestion window size, allowing for faster data transfer.
Congestion Avoidance:

Linear Growth: Once the sender's congestion window reaches a certain threshold (often set by
the network's capacity), it switches to a linear growth mode.
Additive Increase: The congestion window increases by one for each round-trip time, helping to
avoid overwhelming the network with too much data.
Fast Retransmit and Fast Recovery:
Duplicate ACKs: If the sender receives duplicate acknowledgments for the same data, it assumes
that a segment has been lost.
Fast Retransmit: Instead of waiting for a timeout, the sender quickly retransmits the missing
segment, avoiding unnecessary delays.

Fast Recovery: Upon detecting segment loss, the sender reduces its congestion window and
enters a "fast recovery" state. It then continues sending new data while waiting for further
acknowledgments.
Timeouts and Retransmission:

Timeouts: If an acknowledgment is not received within a certain time (indicating possible loss),
the sender may retransmit the unacknowledged data.
Exponential Backoff: After a timeout, the sender reduces its congestion window size and restarts
with a slow start, preventing excessive retransmission attempts.
TCP Reno and TCP Tahoe:
TCP Reno: Builds on TCP Tahoe and includes fast retransmit and fast recovery mechanisms to
improve efficiency in handling segment loss.

TCP Tahoe: Implements basic congestion control mechanisms, including slow start and
congestion avoidance.
Explicit Congestion Notification (ECN):

ECN Capable: TCP can be configured to support ECN, allowing routers to notify endpoints of
impending congestion without dropping packets.
ECN-Echo and Congestion Window Reduction: When ECN is enabled, the sender reduces its
congestion window upon receiving ECN-Echo signals from the network
.
TCP congestion control algorithms are continuously evolving, with various improvements and
enhancements introduced over time. Examples of modern congestion control algorithms include
TCP Cubic, TCP Vegas, and TCP BBR (Bottleneck Bandwidth and Round-trip propagation time).
These algorithms aim to provide efficient and fair utilization of network resources while
minimizing the impact of congestion on performance. The choice of congestion control algorithm
can have significant implications for the responsiveness and throughput of TCP connections in
different network conditions.

You might also like