0% found this document useful (0 votes)
9 views12 pages

Chapter 04 ACN

4 chapter notes

Uploaded by

Mitesh Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views12 pages

Chapter 04 ACN

4 chapter notes

Uploaded by

Mitesh Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Chapter 04 :- Transport layer protocol

Transport Layer Duties and Functionalities


1. Packetizing

 Data Segmentation for Efficient Transmission: Packetizing breaks large data streams
into smaller packets, which makes them easier to manage and transmit over the network,
ensuring optimal use of network resources.

 Maintaining Data Integrity and Error Handling: Each packet includes error-checking
data, which allows corrupted packets to be identified and resent without retransmitting the
entire data stream. This helps maintain data integrity and ensures reliable communication.

 Organizing Data for End-to-End Delivery: By dividing data into packets, the transport
layer fulfills its duty to organize and prepare data for smooth, reliable end-to-end
transmission across the network.

2. Connection Control

Connection Control is a key function of the transport layer, responsible for managing the
establishment, maintenance, and termination of connections between devices over a network.
Here’s a breakdown of its main components:

1. Connection Establishment:
o The transport layer initiates a connection between the sender and receiver
before data transmission.
o In protocols like TCP, a process called a three-way handshake is used to
establish a reliable connection, ensuring both devices are ready to
communicate.
2. Connection Maintenance:
o Once established, the transport layer maintains the connection during the data
transfer phase.
o It ensures data flows smoothly, manages sequence numbers to keep packets in
order, and uses flow control to prevent data overloads.
3. Connection Termination:
o After data transfer is complete, the transport layer is responsible for properly
closing the connection.
o This avoids resource wastage and ensures that both devices end the
communication session gracefully, typically using a four-way handshake in
TCP to confirm disconnection.

Addressing
Addressing in the transport layer uniquely identifies applications on devices to ensure data
packets reach their destinations. It uses port numbers (0–65535) to distinguish applications,
with standard services assigned well-known ports like HTTP (port 80) and FTP (port 21). By
combining IP addresses with port numbers, addressing creates unique socket identifiers,
enabling accurate data delivery and efficient communication across networks.

Flow control

Flow Control is a transport layer mechanism that regulates data transmission between a
sender and receiver to prevent data loss by ensuring the sender doesn’t overwhelm the
receiver. Techniques like Stop-and-Wait require acknowledgment for each packet, while
Sliding Window allows multiple packets to be sent before acknowledgment, improving
efficiency. By using feedback from the receiver, flow control dynamically adjusts the
transmission rate, ensuring reliable data transfer.

Error control

Error Control is a vital transport layer function that ensures reliable data
transmission by detecting and correcting errors. It uses methods like checksums and
cyclic redundancy checks (CRC) to identify corrupted data. When errors occur, it
implements recovery strategies such as retransmitting lost packets, utilizing
acknowledgments (ACK) to confirm successful receipt. By combining error detection
and recovery, error control maintains data integrity, ensuring accurate communication
in networked environments.

User datagram protocol

User Datagram Protocol (UDP) is one of the core protocols of the Internet Protocol (IP) suite.
It is a communication protocol used across the internet for time-sensitive transmissions such
as video playback or DNS lookups . Unlike Transmission Control Protocol (TCP), UDP is
connectionless and does not guarantee delivery, order, or error checking, making it a
lightweight and efficient option for certain types of data transmission.

 Connectionless: UDP does not establish a connection before data transmission, which
reduces overhead and allows for quicker data transfer. This makes it suitable for applications
where speed is critical.

 No Error Recovery: Unlike TCP, UDP does not provide mechanisms for error detection
and correction. It does not guarantee the delivery of packets, meaning some packets may be
lost or arrive out of order without retransmission.

 Lightweight Protocol: With minimal protocol overhead, UDP is efficient for applications
that can tolerate some data loss, such as video streaming, online gaming, and VoIP (Voice
over Internet Protocol).
 Source Port: This field indicates the port from which the UDP packet is sent. It is used to
direct the packet to the correct application on the sender's side.

 Destination Port: This field indicates the port on the receiving device where the UDP
packet should be delivered.

 Length: This field specifies the total length of the UDP header and the data it carries. The
minimum length is 8 bytes, which is just the header size.

 Checksum: The checksum field is used for error-checking. It helps ensure data integrity
by allowing the receiver to verify if the data has been corrupted during transmission. If the
checksum is set to 0, it indicates that no checksum is being used.

ADAVANTAGES

 Low Latency: UDP allows fast data transmission without connection setup, ideal for real-
time applications like gaming and VoIP.

 Reduced Overhead: Its simple header (8 bytes) and lack of connection management lead
to lower overhead, making it efficient for quick data exchange.

 Multicast and Broadcast Support: UDP can send data to multiple recipients
simultaneously, beneficial for live streaming and online gaming.

 Simplicity: The connectionless nature simplifies implementation for developers, making it


easy to use for applications that don’t require reliable delivery.

 Flexibility: Applications can implement their own error handling if needed, allowing for
customization based on specific requirements.

Services

Process-to-Process Communication
 UDP facilitates communication between applications (processes) running on different
devices. Each application is identified by a port number, allowing multiple
applications to use the network simultaneously.

2. Connectionless Services

 UDP provides connectionless communication, meaning it does not establish a


connection before data transfer. Each packet (datagram) is sent independently,
resulting in low latency and faster transmission.

3. Flow Control

 UDP does not implement flow control mechanisms. It allows for continuous
transmission of packets without managing the rate of data sent, which is suitable for
applications that can handle data bursts.

4. Error Control

 UDP includes basic error detection through checksums, but it does not provide error
recovery. This means that if a packet is lost or corrupted, it is up to the application to
handle retransmissions if necessary.

5. Checksum

 The checksum in UDP is used for error-checking the header and data. It helps the
receiving application detect corrupted packets. If the checksum fails, the packet is
discarded, but there’s no automatic retransmission.

6. Congestion Control

 UDP does not implement congestion control mechanisms. This can lead to issues if
the network is congested, as packets may be dropped without notification, potentially
overwhelming the network.

7. Encapsulation and Decapsulation

 Encapsulation: Data from the application layer is wrapped in a UDP header, forming
a UDP segment, which is then encapsulated in an IP packet for transmission.
 Decapsulation: Upon reaching the destination, the IP packet is stripped of its header,
and the UDP segment is extracted, allowing the receiving application to access the
original data.

8. Queuing

 Incoming packets may be queued at the receiving device until they can be processed
by the application. This ensures that packets are handled in an organized manner,
even if they arrive out of order.

9. Multiplexing and Demultiplexing


 Multiplexing: Multiple application data streams can be combined into a single UDP
packet by identifying each stream with a unique port number at the sender's side.
 Demultiplexing: At the receiver, the UDP layer uses the port number to direct
incoming packets to the correct application, allowing multiple applications to receive
data simultaneously.

Features

 Connectionless: UDP sends data packets independently without establishing a


connection, allowing for low latency, making it ideal for real-time applications like online
gaming and VoIP.

 Lack of Error Control: While it includes a checksum for basic error detection, UDP does
not have mechanisms for error recovery or retransmission. Lost or corrupted packets are
discarded, requiring applications to manage recovery if needed.

 Lack of Congestion Control: UDP does not adjust data transmission rates based on
network conditions, which can result in increased packet loss during network congestion
since it continues sending packets without feedback.

 Lightweight Protocol: With a minimal header size of only 8 bytes and no connection
management overhead, UDP is efficient for rapid data transmission, making it suitable for
high-performance applications.

 Support for Multicast and Broadcast: UDP can send packets to multiple recipients
simultaneously, useful for applications like streaming media and video conferencing.

 Simple Design: The simplicity of UDP allows for easy implementation in applications
without complex connection management.

 Multiplexing and Demultiplexing: UDP supports multiplexing by allowing multiple


applications to use different port numbers, and it uses demultiplexing to route incoming

Application

packets to the correct application based on these port numbers.

Used for simple request-response communication when the size of data is less and hence
there is lesser concern about flow and error control.

It is a suitable protocol for multicasting as UDP supports packet switching.

UDP is used for some routing update protocols like RIP(Routing Information Protocol).

Normally used for real-time applications which can not tolerate uneven delays between
sections of a received message.
VoIP (Voice over Internet Protocol) services, such as Skype and WhatsApp, use UDP for
real-time voice communication. The delay in voice communication can be noticeable if
packets are delayed due to congestion control, so UDP is used to ensure fast and efficient
data transmission.

DNS (Domain Name System) also uses UDP for its query/response messages. DNS queries
are typically small and require a quick response time, making UDP a suitable protocol for this
application

Transmission control protocol (TCP)

Transmission Control Protocol (TCP) is a connection-oriented protocol for communications


that helps in the exchange of messages between different devices over a network. The
Internet Protocol (IP), which establishes the technique for sending data packets between
computers, works with TCP.

The position of TCP is at the transport layer of the OSI model. TCP also helps in ensuring
that information is transmitted accurately by establishing a virtual connection between the
sender and receiver.

 Connection-Oriented:

 TCP establishes a reliable connection between the sender and receiver before data
transmission through a process known as the three-way handshake. This ensures that
both parties are ready to communicate, providing a stable communication channel.

 Reliable Data Transfer:

 TCP guarantees the delivery of data packets in the order they are sent. It uses
sequence numbers to track packets and acknowledges receipt. If packets are lost or
corrupted, TCP retransmits them, ensuring data integrity.

 Error Detection and Recovery:

 TCP includes mechanisms for error detection using checksums. If a packet is found to
be corrupted or missing, TCP handles retransmission, ensuring that the data received
is accurate and complete.

 Flow Control:

 TCP implements flow control using a sliding window mechanism, which regulates the
rate of data transmission based on the receiver's ability to process the incoming data.
This prevents overwhelming the receiver and ensures smooth communication.
Tcp services
 Process-to-Process Communication:

 TCP enables communication between applications on different devices, identified by


unique port numbers, allowing multiple applications to share the same network
connection.

 Reliable Services:

 It ensures reliable data delivery through acknowledgments, sequence numbers, and


retransmissions for lost or corrupted packets, guaranteeing accurate data transmission.

 Connection-Oriented Services:

 TCP establishes a connection using a three-way handshake (SYN, SYN-ACK, ACK)


before data transmission, ensuring both parties are ready to communicate.

 Full-Duplex Services:

 It supports simultaneous data sending and receiving, enhancing communication


efficiency.

 Byte and Segment Orientation:

 TCP treats data as a continuous stream of bytes, segmenting it into smaller packets for
transmission, with each segment containing sequence and acknowledgment numbers.

 Sending and Receiving Buffers:

 TCP uses buffers to manage data flow, holding outgoing data until acknowledged and
storing incoming data until processed by the application.

 Streaming Delivery Services:

 It maintains a continuous flow of data, ensuring ordered and gap-free delivery,


making it suitable for applications like video streaming and file transfers.

Header format
Source Port (2 bytes)

 Identification: Indicates the port number of the sending application, allowing the
receiver to know where the data originated.
 Multiple Connections: Enables multiple applications to use the same IP address
simultaneously by differentiating them using different port numbers.

2. Destination Port (2 bytes)

 Target Application: Specifies the port number of the receiving application, directing
incoming packets to the correct application.
 Service Indication: Commonly associated with specific services (e.g., port 80 for
HTTP, port 443 for HTTPS), helping the receiver understand how to process the
incoming data.

3. Sequence Number (4 bytes)

 Data Ordering: Used to number the bytes in the TCP stream, ensuring that data can
be reassembled in the correct order at the receiving end.
 Reliability: Allows the receiver to detect lost packets and request retransmissions,
ensuring that all data is accurately received.

4. Acknowledgment Number (4 bytes)


 Receipt Confirmation: Indicates the next byte that the sender expects to receive,
confirming that all previous bytes have been successfully received.
 Flow Control: Helps manage data transmission between sender and receiver,
ensuring that the sender does not overwhelm the receiver with too much data at once.

5. Data Offset (1 byte)

 Header Length: Specifies the length of the TCP header in 32-bit words, indicating
where the data portion of the segment begins.
 Variable Length: Allows for optional fields in the TCP header, accommodating
additional functionalities without changing the base protocol.

6. Reserved (3 bits)

 Future Use: These bits are reserved for future protocol extensions and should be set
to zero in the current implementation.
 Protocol Compatibility: Helps maintain compatibility with future versions of TCP
without altering the existing header format.

7. Control Flags (9 bits)

 Connection Management: Flags like SYN (synchronize) and FIN (finish) are used to
establish and terminate connections.
 Data Handling: Flags like ACK (acknowledge) and PSH (push) control the flow of
data and the behavior of the connection, influencing how the data is processed by the
receiver.

8. Window Size (2 bytes)

 Flow Control: Indicates the size of the sender's receive window, which tells the
sender how much data can be sent before waiting for an acknowledgment.
 Dynamic Adjustment: Allows for adjusting the window size based on network
conditions and receiver capabilities, optimizing data flow.

9. Checksum (2 bytes)

 Error Detection: Provides a way to check for errors in the header and data, ensuring
the integrity of the transmitted data.
 Retransmission Trigger: If the checksum fails at the receiver, the packet is
discarded, prompting the sender to retransmit the missing or corrupted data.

10. Urgent Pointer (2 bytes)

 Urgent Data Indication: Points to the end of urgent data in the segment when the
URG flag is set, signaling the receiver to prioritize this data.
 Application-Specific Use: Useful in scenarios where timely processing of certain
data is critical, allowing applications to manage urgent information effectively.

11. Options (Variable length)


 Additional Features: Can include options such as Maximum Segment Size (MSS)
and Window Scale, which enhance TCP's functionality.
 Flexibility: Provides flexibility for specific applications or network conditions,
allowing for optimizations without modifying the entire protocol.

12. Padding (Variable length)

 Alignment: Added to ensure the TCP header is a multiple of 32 bits, improving data
alignment for processing.
 No Functional Purpose: Padding itself does not carry information; it exists solely for
the purpose of header alignment.

TCP Connection Establishment: Three-Way Handshake

1. SYN (Synchronize):
o The client initiates the connection by sending a TCP segment with the SYN
flag set to the server. This segment contains an initial sequence number (ISN)
chosen by the client. This step indicates the client's desire to establish a
connection and synchronize sequence numbers.
2. SYN-ACK (Synchronize-Acknowledge):
o Upon receiving the SYN segment, the server responds with a TCP segment
that has both the SYN and ACK flags set. This segment acknowledges the
client's SYN request by sending back an acknowledgment number (equal to
the client’s ISN + 1) and also includes its own ISN for synchronization.
3. ACK (Acknowledge):
o After receiving the SYN-ACK from the server, the client sends another TCP
segment with the ACK flag set. This segment acknowledges the server's ISN
by including an acknowledgment number (equal to the server's ISN + 1). At
this point, the connection is established.

Timer in tcp
 Retransmission Timer

 Purpose: To ensure reliable data transmission by determining when to retransmit a


packet if an acknowledgment (ACK) is not received.
 Functionalities:
o Monitors the time taken for packets to be acknowledged.
o If the timer expires without receiving an ACK, the packet is considered lost,
and the sender retransmits it.
o The timer is dynamically adjusted based on the measured Round Trip Time
(RTT).
 Example: A client sends a TCP segment to a server. If the client does not receive the
expected ACK within 200 milliseconds, it retransmits the packet.

 Persistence Timer

 Purpose: To manage flow control by ensuring the sender can check if the receiver's
window size has changed when it is zero.
 Functionalities:
o If the receiver advertises a window size of zero, the sender sets this timer.
o Upon expiration, the sender sends a probe packet to the receiver to request an
updated window size.
 Example: The sender sends several segments, but the receiver's buffer is full and the
window size is zero. After 60 seconds, the sender probes the receiver to see if it can
accept more data.

 Keep-Alive Timer

 Purpose: To maintain an active connection during periods of inactivity.


 Functionalities:
o Sends periodic keep-alive packets to check if the connection is still alive when
no data has been transmitted for a specified duration.
o If no response is received after several probes, the connection may be
terminated.
 Example: In a long-lived connection where no data is sent for 2 hours, the sender
sends keep-alive packets every 60 seconds. If no response is received after a certain
number of attempts, the connection is closed.

 Fin Wait Timer

 Purpose: To ensure proper closure of a connection during the termination phase.


 Functionalities:
o Monitors the time after a FIN segment is sent to wait for an ACK.
o If the ACK is not received within the timer's duration, the sender retransmits
the FIN segment.
 Example: A client sends a FIN segment to close a connection. If the ACK is not
received within 30 seconds, the client retransmits the FIN to ensure termination.

 Time-Wait Timer

 Purpose: To ensure that all packets associated with a closed connection are properly
received and processed.
 Functionalities:
o Prevents delayed packets from interfering with new connections that may use
the same port numbers.
o The timer is typically set to twice the Maximum Segment Lifetime (MSL).
 Example: After a server sends a FIN segment and enters the TIME-WAIT state, it
waits for 4 minutes (twice the MSL) to ensure no delayed packets arrive before
closing the connection completely.

 Congestion Timer

 Purpose: To manage TCP’s congestion control mechanisms.


 Functionalities:
o Monitors network conditions and adjusts the transmission rate based on packet
loss detection.
o Reduces the congestion window size when congestion is detected and controls
when to resume aggressive sending.
 Example: If a sender detects packet loss through a timeout or three duplicate ACKs,
it reduces its congestion window. The congestion timer helps decide when to
gradually increase the window size again based on network conditions.

Options
 end of Option List (EOL): Marks the end of the options field in the TCP header. It
ensures that the receiving end knows where the options section concludes.

 No-Operation (NOP): Fills in empty space in the options field to maintain proper
alignment of subsequent options. It’s particularly useful for ensuring options are aligned on
32-bit boundaries.

 Maximum Segment Size (MSS): Specifies the largest segment size that can be sent in a
single TCP packet. This helps prevent fragmentation at the IP layer and optimizes
performance based on the maximum size supported by both ends of the connection.

 Window Scale: Allows for the adjustment of the TCP window size to exceed the default
maximum of 65,535 bytes. This is especially beneficial in high-bandwidth, high-latency
networks, enabling more data to be in transit before requiring an acknowledgment.

 SACK Permitted: This option indicates that the sender can use the Selective
Acknowledgment option, which allows the receiver to inform the sender about all segments
that have been received successfully, enabling more efficient retransmission of only lost
segments.

 SACK: When enabled, this option allows the receiver to acknowledge non-contiguous
blocks of data, reducing the amount of data that needs to be retransmitted when losses occur.

 Timestamps: This option provides a mechanism for measuring the round-trip time (RTT)
of packets. It can help in improving the efficiency of the TCP connection by adjusting
retransmission timeouts based on more accurate measurements of network delays.

You might also like