UNIT-4
1.Transport Layer: Process to Process Communication
1.1 Port Numbers:
1.2 Socket Addresses:
1.3 Multiplexing and Demultiplexing
Multiplexing:
Demultiplexing:
1.4 Connectionless versus Connection-oriented Service
A transport layer protocol can either be connectionless or connection-oriented.
Connectionless Service
Connection Oriented Service
1.5 Reliable versus Unreliable:
Reliable (Connection-Oriented): A communication method that ensures data is delivered accurately, in the correct order, and without duplication or loss.
Characteristics:
Examples:
Unreliable (Connectionless): A communication method that does not guarantee data delivery, order, or accuracy.
Characteristics:
1. Best-effort delivery
2. No guarantee of delivery
3. No error correction
4. No sequential delivery
5. No acknowledgment mechanisms
Examples:
1. UDP (User Datagram Protocol)
2. DNS (Domain Name System)
3. DHCP (Dynamic Host Configuration Protocol)
4. SNMP (Simple Network Management Protocol)
5. Online gaming protocols (e.g., UDP-based)
2.User Datagram Protocol(UDP)
2.1 Well-Known Ports for UDP
2.2 User Datagram or UDP Header format
2.3 UDP Operation (Services)
1.Connectionless Services
2.Flow and Error Control
3.Encapsulation and Decapsulation:
4.Queuing
2.4 UDP applications
The following lists some uses of the UDP protocol:
Advantages & Disadvantages
Advantages:
1. Fast transmission
2. Low overhead
3. Simple implementation
4. Suitable for real-time applications
5. Connectionless
Disadvantages:
1. No guarantee of delivery
2. No error correction
3. No retransmission
4. Packet loss or duplication possible
5. Limited reliability
3.Transmission Control Protocol(TCP )
Topics discussed in this section:
TCP Features
TCP Services
Segment
A TCP Connection
Flow Control
Error Control
3.1 Features of TCP
3.2 TCP Services
2.Stream Delivery Service:
Stream Delivery Services
3.Sending and Receiving Buffers:
TCP segments
4.Full-Duplex Communication:TCP offers full-duplex service, in which data can flow in both directions at the same time.Each TCP then has a sending and receiving buffer, and segments move in both directions.
5.Connection-Oriented Service:
TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to send and receive data from another process at site B, the following occurs:
6.Reliable Service:TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and sound arrival of data. We will discuss this feature further in the section on error control
3.2 TCP Features
23.34
TCP Services: Number System
23.35
The following shows the sequence number for each segment:
Example 23.3
23.36
The value in the sequence number field of a segment defines the
number of the first data byte �contained in that segment.
Note
23.37
The value of the acknowledgment field in a segment defines
the number of the next byte a party expects to receive.
The acknowledgment number is cumulative.
Note
23.38
Figure 23.16 TCP segment format
23.39
Figure 23.17 Control field
23.40
Table 23.3 Description of flags in the control field
23.41
Description of flags in the control field
23.42
Description of flags in the control field
23.43
Connection establishment using three-way handshaking
23.44
A SYN segment cannot carry data, but it consumes one sequence number.
Note
23.45
A SYN + ACK segment cannot �carry data, but does consume one �sequence number.
Note
23.46
An ACK segment, if carrying no data, consumes no sequence number.
Note
23.47
Data transfer
23.48
Connection termination using three-way handshaking
23.49
The FIN segment consumes one sequence number if it does �not carry data.
Note
23.50
The FIN + ACK segment consumes �one sequence number if it �does not carry data.
Note
23.51
Half-close
23.52
Sliding window
23.53
A sliding window is used to make transmission more efficient as well as
to control the flow of data so that the destination does not become
overwhelmed with data. �TCP sliding windows are byte-oriented.
Note
23.54
What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5000 bytes and 1000 bytes of received and unprocessed data?
Example 23.4
Solution
The value of rwnd = 5000 − 1000 = 4000. Host B can receive only 4000 bytes of data before overflowing its buffer. Host B advertises this value in its next segment to A.
23.55
What is the size of the window for host A if the value of rwnd is 3000 bytes and the value of cwnd is 3500 bytes?
Example 23.5
Solution
The size of the window is the smaller of rwnd and cwnd, which is 3000 bytes.
23.56
Figure 23.23 shows an unrealistic example of a sliding window. The sender has sent bytes up to 202. We assume that cwnd is 20 (in reality this value is thousands of bytes). The receiver has sent an acknowledgment number of 200 with an rwnd of 9 bytes (in reality this value is thousands of bytes). The size of the sender window is the minimum of rwnd and cwnd, or 9 bytes. Bytes 200 to 202 are sent, but not acknowledged. Bytes 203 to 208 can be sent without worrying about acknowledgment. Bytes 209 and above cannot be sent.
Example 23.6
23.57
Example 23.6
23.58
Some points about TCP sliding windows:
❏ The size of the window is the lesser of rwnd and� cwnd.
❏ The source does not have to send a full window’s� worth of data.
❏ The window can be opened or closed by the� receiver, but should not be shrunk.
❏ The destination can send an acknowledgment at� any time as long as it does not result in a shrinking� window.
❏ The receiver can temporarily shut down the� window; the sender, however, can always send a� segment of 1 byte after the window is shut down.
Note
23.59
ACK segments do not consume sequence numbers and are not acknowledged.
Note
23.60
In modern implementations, a retransmission occurs if the retransmission timer expires or three duplicate ACK segments have arrived.
Note
23.61
No retransmission timer is set for an ACK segment.
Note
23.62
Data may arrive out of order and be temporarily stored by the receiving TCP,
but TCP guarantees that no out-of-order segment is delivered to the process.
Note
23.63
Figure 23.24 Normal operation
23.64
Lost segment
23.65
The receiver TCP delivers only ordered data to the process.
Note
23.66
Fast retransmission
4.Stream Control Transmission Protocol (SCTP)
Protocol | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | SCTP (Stream Control Transmission Protocol) |
Reliability | Reliable data delivery with error detection, retransmission, and acknowledgement mechanisms | Unreliable data delivery without error recovery or acknowledgement | Reliable data delivery with error detection, retransmission, and acknowledgement mechanisms |
Connection Type | Connection-oriented | Connectionless | Connection-oriented |
Ordering | Guarantees ordered delivery of data packets | Does not guarantee the ordered delivery of data packets | Guarantees ordered delivery of data packets |
Protocol | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | SCTP (Stream Control Transmission Protocol) |
Speed | Slower due to reliability mechanisms | Faster due to minimal overhead | Comparable to TCP, slower than UDP due to additional functionality |
Overhead | Higher overhead due to additional headers and control mechanisms | Lower overhead due to minimal headers and control mechanisms | Moderate overhead due to additional headers and control mechanisms |
Applications | Web browsing, email transfer, file transfer (FTP) | Real-time communication, video streaming, online gaming, DNS | Telecommunications, voice and video over IP, signalling transport |
Protocol | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | SCTP (Stream Control Transmission Protocol) |
Congestion Control | Implements congestion control mechanisms to optimize network performance | No congestion control mechanisms | Implements congestion control mechanisms to optimize network performance |
Error Recovery | Detects and retransmits lost or corrupted packets | No error recovery mechanisms | Detects and retransmits lost or corrupted packets |
Protocol | TCP (Transmission Control Protocol) | UDP (User Datagram Protocol) | SCTP (Stream Control Transmission Protocol) |
Message-Oriented Delivery -No | Yes, supports message-oriented delivery | ||
Multi-streaming (No) | Yes, supports the simultaneous transmission of multiple streams | ||
Multi-homing (No) | Yes, supports multiple IP addresses for fault tolerance and resilience | ||
4.1 SCTP: Services
4.2 Stream Control Transmission Protocol (SCTP): Features
4.3 Stream Control Transmission Protocol (SCTP):Header
4.4 SCTP: 4-Way Handshake (or) SCTP Association
4.5 SCTP: Packet Header
4.6 SCTP: Data Transfer
4.7 SCTP: Packet Transfer
1. The client sends the first packet carrying two DATA chunks with TSNs 7105 and 7106.
2. The client sends the second packet carrying two DATA chunks with TSNs 7107 and 7108.
3. The third packet is from the server. It contains the SACK chunk needed to acknowledge the receipt of DATA chunks from the client. Contrary to TCP, SCTP acknowledges the last in-order TSN received, not the next expected. The third packet also includes the first DATA chunk from the server with TSN 121.
4. After a while, the server sends another packet carrying the last DATA chunk with TSN 122, but it does not include a SACK chunk in the packet because the last DATA chunk received from the client was already acknowledged.
5. Finally, the client sends a packet that contains a SACK(Select Acknowledgment) chunk acknowledging the receipt of the last two DATA chunks from the server.
Categories:
Multistream Delivery: The delivery of the data chunks is controlled by SIs and SSNs(Stream Sequence Number). SCTP can support multiple streams, which means that the sender process can define different streams and a message can belong to one of these streams. Each stream is assigned a stream identifier (SI) which uniquely defines that stream
Fragmentation: Although SCTP shares this term with IP, fragmentation in IP and in SCTP belongs to different levels: the former at the network layer, the latter at the transport layer.
4.8 SCTP: Association Termination
�
4.9 Flow Control: Receivers site
Receivers site:
4.10 Flow Control: Sender site
1. A chunk pointed to by curTSN can be sent if the size of the data is less than or equal to the quantity rwnd(Receiver window) - inTransit.
2. When a SACK is received, the chunks with a TSN less than or equal to the cumulative TSN in the SACK are removed from the queue and discarded.
24.88
5 .Congestion Control and Quality of Service
Data Transfer
The main focus of congestion control and quality of service is data traffic. In congestion control we try to avoid traffic congestion. In quality of service, we try to create an appropriate environment for the traffic. So, before talking about congestion control and quality of service, we discuss the data traffic itself.
Traffic Descriptor�Traffic Profiles
Topics discussed in this section:
Traffic descriptors
Three traffic profiles
Types of Traffic:
1. Voice Traffic: Voice over Internet Protocol (VoIP), phone calls.
2. Video Traffic: Video streaming, conferencing, online movies.
3. Text Traffic: Email, messaging, chat applications.
4. File Traffic: File transfers, downloads, uploads.
5. Real-time Traffic: Online gaming, financial transactions.
Traffic Characteristics:
1. Volume: Amount of data transmitted.
2. Speed: Data transfer rate (bandwidth).
3. Latency: Packet transmission delay.
4. Jitter: Packet delay variation.
5. Packet Loss: Percentage of lost packets.
5.1 Congestion
Network Performance
Topics discussed in this section:
Congestion Control Introduction:
General Principles of Congestion Control
Congestion Control Techniques:
1. Windowing: Regulates data transmission rate
2. Slow Start: Gradually increases transmission rate
3. Congestion Avoidance: Detects congestion, reduces transmission rate
4. Fast Retransmit: Quickly retransmits lost packets
5. Fast Recovery: Recovers from congestion
Queues in a router
24.97
Packet delay and throughput as functions of load
5.2 Congestion control
Congestion control refers to techniques and mechanisms that can either prevent congestion, before it happens, or remove congestion, after it has happened. In general, we can divide congestion control mechanisms into two broad categories: open-loop congestion control (prevention) and closed-loop congestion control (removal).
Open-Loop Congestion Control�Closed-Loop Congestion Control
Topics discussed in this section:
24.99
Congestion control categories
Warning Bit or Backpressure:
24.101
Backpressure method for alleviating congestion
Choke Packets:
5.3 Congestion Prevention Policies
Policies that affect congestion.
5-26
Data Link Layer:
Network Layer:
Transport Layer:
6. QUALITY OF SERVICE
or
Flow characteristics
Reliability
Error detection and correction: The Transport Layer employs mechanisms like checksums to detect errors in transmitted data. If errors are detected, it requests retransmission of the corrupted data.
Sequencing: It ensures that data packets are received in the correct order by numbering them and reordering them if necessary.
Acknowledgment: The receiver acknowledges the receipt of data packets, allowing the sender to know if the data was successfully delivered.
Flow control: It regulates the rate at which data is sent to prevent the receiver from being overwhelmed.
Congestion control: It manages network traffic to avoid congestion and ensure efficient resource utilization.
Rliability
End-to-End Delivery: The Transport Layer establishes a connection between the sender and receiver applications.
It ensures that data is delivered from the source application to the destination application, regardless of the underlying network topology.
Multiple Connections: The Transport Layer allows multiple simultaneous connections between different applications on the same host. Each connection is identified by a unique port number.
Data Integrity: The Transport Layer ensures that data is delivered without modifications or corruption.
It uses checksums and other mechanisms to detect and correct errors.
Session Management: The Transport Layer manages the establishment, maintenance, and termination of connections between applications. t also handles issues like connection timeouts and resets.
Delay
Source –to-destination delay is another flow characteristic Again application can tolerate delay in different degrees.
1.Propagation Delay: Time for signal to travel through medium.
2. Transmission Delay: Time to transmit data packet.
3. Processing Delay: Time to process packet at router/switch.
4. Queuing Delay: Time spent in buffer waiting for transmission.
5. Network Delay: Total delay across entire network.
Jitter
Jitter in the transport layer refers to the variation in the time it takes for data packets to travel from the sender to the receiver. It's essentially the inconsistency or irregularity in the arrival times of packets.
Causes of Jitter
Network Congestion: When the network becomes overloaded, packets may experience delays or even be dropped, leading to varying arrival times.
Routing Changes: If the optimal path for data to travel changes, packets may take different routes with varying delays.
Queueing Delays: Packets may be queued at routers or switches, causing delays depending on the queue length and the priority of the packets.
Wireless Interference: In wireless networks, interference from other devices or environmental factors can cause packets to be retransmitted or delayed.
Jitter
Impact of Jitter on Applications
Voice and Video Communications: Jitter can lead to audio and video quality issues, such as echo, distortion, or pixilation.
Real-time Games: Jitter can cause lag or delays in gameplay, affecting the user experience.
Streaming Media: Jitter can result in buffering or interruptions during video or audio streaming.
Mitigating Jitter
Quality of Service (QoS): Network administrators can implement QoS mechanisms to prioritize certain types of traffic, such as real-time voice or video, and ensure that they receive lower jitter.
Buffering: Applications can use buffering to store incoming data and smooth out variations in arrival times.
Jitter Compensation: Some applications can employ algorithms to compensate for jitter by adjusting playback rates or introducing delays.
Bandwidth
QoS Applications�
1. VoIP (Voice over Internet Protocol): Real-time voice communication.
2. Video conferencing: Real-time video communication.
3. Online gaming: Real-time data exchange.
4. Cloud computing: Reliable data transfer.
5. Financial transactions: Secure and reliable data transfer.
7.TECHNIQUES TO IMPROVE QoS
We tried to define QoS in terms of its characteristics. In this section, we discuss some techniques that can be used to improve the quality of service. We briefly discuss four common methods:scheduling, traffic shaping, admission control, and resource reservation.
Scheduling�Traffic Shaping�Resource Reservation
Admission Control
Topics discussed in this section:
Scheduling
24.116
FIFO queue
Priority queuing
Weighted fair queuing
Random Early Detection:
It is the idea of discarding packets before all the buffer space is really exhausted. A popular algorithm for doing this is called
RED (Random Early Detection)).
Traffic Shaping
24.121
Leaky bucket �
Leaky bucket
Leaky bucket implementation
Advantages:
1. Simple implementation.
2. Effective traffic shaping.
3. Reduces network congestion.
Disadvantages:
1. Can drop packets.
2. May not handle bursty traffic.
Token bucket�
Token bucket
Advantages:
Disadvantages:
Resource Reservation and Admission Control
24.