Chapter 04 ACN
Chapter 04 ACN
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 (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.
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
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.
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.
Features
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.
Application
Used for simple request-response communication when the size of data is less and hence
there is lesser concern about flow and error control.
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
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.
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.
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:
Reliable Services:
Connection-Oriented Services:
Full-Duplex Services:
TCP treats data as a continuous stream of bytes, segmenting it into smaller packets for
transmission, with each segment containing sequence and acknowledgment numbers.
TCP uses buffers to manage data flow, holding outgoing data until acknowledged and
storing incoming data until processed by the application.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
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.