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

Cs3591cn Unit II

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 65

CS3591 – Computer

Networks Unit II –
Transport Layer

CS8591
UNIT II – Transport Layer

Introduction – Transport Layer Protocols – Services – Port


Numbers – User Datagram Protocol – Transmission Control
Protocol – SCTP.

2
CS8591
Introduction
• The transport layer is located between the application layer and the network layer.
• It provides a process-to-process communication between two application layers, one at
the local host and the other at the remote host.
• Communication is provided using a logical connection, which means that the two
application layers, which can be located in different parts of the globe.
• Alice’s host in the Sky Research company creates a logical connection with Bob’s host
in the Scientific Books company at the transport layer.
• The two companies communicate at the transport layer as though there is a
real connection between them.

3
CS8591
Introduction

4
CS8591
Introduction: Transport Layer Services
1. Process-to-process Communication
• The first duty of a transport-layer protocol is to provide process-to-
process communication.
• A process is an application-layer entity (running program) that uses the services of the
transport layer.
• A transport-layer protocol is responsible for delivery of the message to the appropriate
process.

5
CS8591
Introduction: Transport Layer Services
2. Addressing: Port Numbers
• To define the processes, identifiers are needed, called port numbers.
• In the TCP/IP protocol suite, the port numbers are integers between 0 and 65,535 (16
bits).

ICANN Ranges
• Well-known Ports: The ports ranging from 0 to 1023 are assigned and controlled by
ICANN.
• Registered Ports: The ports ranging from 1024 to 49,151 are not assigned or controlled
by ICANN. They can only be registered with ICANN to prevent duplication.
• Dynamic ports: The ports ranging from 49,152 to 65,535 are neither controlled nor
registered. They can be used as temporary or private port numbers.

6
CS8591
Introduction: Transport Layer Services
2. Addressing: Port Numbers

Port numbers

Socket Address IP addresses versus port numbers


• The combination of an IP address and a port number is called a socket
address.
• The client socket address defines the client process uniquely.
• The server socket address defines the server process uniquely.

7
CS8591
Introduction: Transport Layer Services
3. Encapsulation and Decapsulation
• To send a message from one process to another, the transport-layer protocol encapsulates
and decapsulates messages.
• When a process has a message to send, it passes the message to the transport layer along
with a pair of socket addresses and some other pieces of information.
• The transport layer receives the data and adds the transport-layer header.
• When the message arrives at the destination transport layer, the header is dropped and
the transport layer delivers the message to the process running at the application layer.
• The sender socket address is passed to the process in case it needs to respond to the
message received.

8
CS8591
Introduction: Transport Layer Services
4. Multiplexing and Demultiplexing
• Whenever an entity accepts items
from more than one source, this is
referred to as multiplexing (many
to one).
• Whenever an entity delivers items to
more than one source, this is
referred to as demultiplexing (one
to many).
• The transport layer at the source
performs multiplexing; the transport
layer at the destination performs
demultiplexing
9
CS8591
Introduction: Transport Layer Services
5. Flow Control
• Delivery of items from a producer to a consumer can occur in one of two ways: pushing
or pulling.
• Pushing: If the sender delivers items whenever they are produced without a prior
request from the consumer.
• Pulling: If the producer delivers the items after the consumer has requested them.
• When the producer pushes the items, the consumer may be overwhelmed and there is a
need for flow control, in the opposite direction, to prevent discarding of the items.
• When the consumer pulls the items, it requests them when it is ready. In this case, there
is no need for flow control.

10
CS8591
Introduction: Transport Layer Services
5. Flow Control
• Communication at the transport layer deals with four entities: sender process, sender
transport layer, receiver transport layer, and receiver process.

Buffers
• One of the solutions for flow control is normally to use two buffers.
• One at the sending transport layer and the other at the receiving transport layer.
• A buffer is a set of memory locations that can hold packets at the sender and
receiver.

11
CS8591
Introduction: Transport Layer Services
5. Error Control
• Reliability can be achieved to add error control services to the transport layer.
• Error control at the transport layer is responsible for

1. Detecting and discarding corrupted packets.

2. Keeping track of lost and discarded packets and resending them.

3. Recognizing duplicate packets and discarding them.

4. Buffering out-of-order packets until the missing packets arrive.


• Sequence Number: When a packet is corrupted or lost, the receiving transport layer can
somehow inform the sending transport layer to resend that packet using the sequence
number.
• Acknowledgement: Use both positive and negative signals as error control.

12
CS8591
Introduction: Transport Layer Services
6. Congestion Control
• Congestion in a network may occur if the load on the network (the number of packets
sent to the network) is greater than the capacity of the network (the number of packets a
network can handle).
• Congestion control refers to the mechanisms and techniques that control the congestion
and keep the load below the capacity.

7. Connectionless and Connection Oriented Protocols


• In a connectionless service, the source process needs to divide its message into chunks
and deliver them to the transport layer one by one.
• The transport layer treats each chunk as a single unit without any relation between
the chunks.
• When a chunk arrives from the application layer, the transport layer encapsulates it in a
packet and sends it.
13
CS8591
Introduction: Transport Layer Services
7. Connectionless and Connection Oriented Protocols
• Since there is no dependency between the packets at the transport layer, the packets
may arrive out of order at the destination and will be delivered out of order to the
server process
• No flow control, error control, or congestion control can be effectively implemented in a
connectionless service.

14
CS8591
Introduction: Transport Layer Services
7. Connectionless and Connection Oriented Protocols
• In a connection-oriented service, the client and the server first need to establish a
logical connection between themselves.
• The data exchange can only happen after the connection establishment. After data
exchange, the connection needs to be torn down.
• Flow control, error control, and congestion control are implemented in a connection
oriented protocol.

15
CS8591
Transport Layer Protocols
1. Simple Protocol
• A simple connectionless protocol with neither flow nor error control.
• The receiver can never be overwhelmed with incoming packets.
• The transport layer at the sender gets a message from its application layer, makes a
packet out of it, and sends the packet.
• The transport layer at the receiver receives a packet from its network layer, extracts the
message from the packet, and delivers the message to its application layer.
• The transport layers of the sender and receiver provide transmission services for their
application layers.

16
CS8591
Transport Layer Protocols
2. Stop-and-Wait Protocol
• A connection-oriented protocol, which uses both flow and error control.
• Both the sender and the receiver use a sliding window of size 1.
• The sender sends one packet at a time and waits for an acknowledgment before
sending the next one.
• To detect corrupted packets, we need to add a checksum to each data packet.
• Every time the sender sends a packet, it starts a timer.
• If an acknowledgment arrives before the timer expires, the timer is stopped and the
sender sends the next packet.
• If the timer expires, the sender resends the previous packet, assuming that the packet was
either lost or corrupted.

17
CS8591
Transport Layer Protocols
3. Go-Back-N Protocol (GBN)
• To improve the efficiency of transmission, multiple packets must be in transition while
the sender is waiting for acknowledgment.
• The key to Go-back-N is that the sender can send several packets before receiving
acknowledgments, but the receiver can only buffer one packet.
• Sender must keep a copy of the sent packets until the acknowledgments arrive.
• The acknowledgment number is cumulative and defines the sequence number of the next
packet expected to arrive.

Design of piggybacking in Go-Back-N


18
CS8591
Transport Layer Protocols
4. Selective-Repeat Protocol
• The Go-Back-N protocol simplifies the process at the receiver.
• The receiver keeps track of only one variable, and there is no need to buffer out-of-
order packets; they are simply discarded.
• Each time a single packet is lost or corrupted, the sender resends all outstanding packets,
even though some of these packets may have been received safe and sound but out of
order.
• If the network layer is losing many packets because of congestion in the network, the
resending of all of these outstanding packets makes the congestion worse.
• Selective-Repeat (SR) protocol resends only selective packets, those that are actually
lost.

• An acknowledgment number defines the sequence

number of the error-free packet received.

CS8591 19
Transport Layer Protocols
5. Bidirectional Protocols: Piggybacking
• Unidirectional Protocols: data packets flow in only one direction and acknowledgments
travel in the other direction.
• In real life, data packets are normally flowing in both directions: from client to server
and from server to client.
• A technique called piggybacking is used to improve the efficiency of the bidirectional
protocols.
• When a packet is carrying data from A to B, it can also carry acknowledgment feedback
about arrived packets from B; when a packet is carrying data from B to A, it can also
carry acknowledgment feedback about the arrived packets from A.

20
CS8591
Transport Layer Protocols

• Responsible for process-to-process delivery of the entire message.

Position of transport-layer protocols in the TCP/IP protocol suite

21
CS8591
Services
• UDP: Unreliable connectionless transport-layer protocol used for its simplicity and
efficiency in applications where error control can be provided by the application-layer
process.
• TCP: Reliable connection-oriented protocol that can be used in any application where
reliability is important.
• SCTP: A new transport-layer protocol that combines the features of UDP and TCP.

CS8591
Port Numbers
• To create a process-to-process communication, these protocols use port numbers to
accomplish.
• Port numbers provide end-to-end addresses at the transport layer and allow multiplexing
and demultiplexing.

CS8591
User Datagram Protocol
• A connectionless, unreliable transport protocol.
• It does not add anything to the services of IP except for providing process-to-process
communication.
• UDP is a very simple protocol using a minimum of overhead.
• If a process wants to send a small message and does not care much about reliability, it
can use UDP.

User Datagram

CS8591
User Datagram Protocol
User Datagram
• UDP packets, called user datagrams, have a fixed-size header of 8 bytes made of four
fields, each of 2 bytes (16 bits).
• Source Port Number: Port number of the source process.
• Destination Port Number: Port number of the destination process.
• Header: Total length of the UDP datagram
• Checksum: For error correction
• The total length of a UDP user datagram is stored in an IP datagram: 65,535 bytes.

CS8591
User Datagram Protocol
UDP Services
• Process-to-Process Communication: UDP provides process-to-process communication
using socket addresses, a combination of IP addresses and port numbers.
• Connectionless Services: User datagram sent by UDP is an independent datagram.
There is no connection establishment and no connection termination. Each user
datagram can travel on a different path.
• Flow Control: There is no flow control, and hence no window mechanism. The
receiver may overflow with incoming messages.
• Error Control: There is no error control mechanism in UDP except for the
checksum. The sender does not know if a message has been lost or duplicated. When the
receiver detects an error through the checksum, the user datagram is silently discarded.
• Congestion Control: It does not provide congestion control. UDP assumes that the
packets sent are small and sporadic and cannot create congestion in the network.

CS8591
User Datagram Protocol
UDP Services
• Encapsulation and Decapsulation: To send a message from one process to another, the
UDP protocol encapsulates and decapsulates messages.
• Queuing: In UDP, queues are associated with ports.
• Multiplexing and Demultiplexing: Several processes that may want to use the services
of UDP. To handle this situation, UDP multiplexes and demultiplexes.
• Checksum: UDP checksum calculation includes three sections: a pseudoheader, the
UDP header, and the data coming from the application layer.

CS8591
User Datagram Protocol
UDP Applications
• UDP Features:
– Connectionless Service

– Lack of Error Control.

• Typical Applications:
– Suitable for a process that requires simple request-response communication with
little concern for flow and error control.
– Suitable for a process with internal flow- and error-control mechanisms.

– Suitable transport protocol for multicasting.

– Used for management processes such as SNMP.

– Used for some route updating protocols such as Routing Information Protocol (RIP).

– Used for interactive real-time applications that cannot tolerate uneven delay between
sections of a received message
CS8591
Transmission Control Protocol
• Connection-oriented, reliable protocol.
• TCP explicitly defines connection establishment, data transfer, and connection
teardown phases to provide a connection-oriented service.
• To ensure reliability, TCP uses checksum (for error detection), retransmission of lost
or corrupted packets, cumulative and selective acknowledgments, and timers.

CS8591
Transmission Control Protocol
TCP Services
• Process-to-Process Communication: TCP provides process-to-process communication using port
numbers.
• Stream Delivery Service: Allows the sending process to deliver data as a stream of bytes and allows
the receiving process to obtain data as a stream of bytes.
– Sending and Receiving Buffers: TCP needs buffers for storage. The sending buffer and the
receiving buffer, one for each direction.
– Segments: TCP groups a number of bytes together into a packet called a segment.

• Full-Duplex Communication: Data can flow in both directions at the same time.
• Multiplexing and Demultiplexing: TCP performs multiplexing at the sender and demultiplexing at
the receiver.
• Connection-Oriented Service: The two TCP’s establish a logical connection between them. Data are
exchanged in both directions. The connection is terminated.
• Reliable Service: TCP uses an acknowledgment mechanism to check the safe and sound arrival of
data.
CS8591
Transmission Control Protocol
TCP Features
• Numbering System: TCP software keeps track of the segments being transmitted or
received.
• Byte Number: The bytes of data being transferred in each connection are numbered by
TCP. The numbering starts with an arbitrarily generated number.
• Sequence Number: Defines the number assigned to the first data byte contained in
that segment.
• Acknowledgment Number: Defines the number of the next byte a party expects to
receive. The acknowledgment number is cumulative.

CS8591
Transmission Control Protocol
Segment
• A packet in TCP is called a segment.
• The segment consists of a header of 20 to 60 bytes, followed by data from the application
program.

CS8591
Transmission Control Protocol
Segment
• Source port address: A 16-bit field that defines the port number of the application
program in the host that is sending the segment.
• Destination port address: A 16-bit field that defines the port number of the application
program in the host that is receiving the segment.
• Sequence number: A 32-bit field defines the number assigned to the first byte of data
contained in this segment.
• Acknowledgment number: A 32-bit field defines the byte number that the receiver of the
segment is expecting to receive from the other party.
• Header length: A 4-bit field indicates the number of 4-byte words in the TCP header.
• Control: This field defines 6 different control bits or flags.

CS8591
Transmission Control Protocol
Segment
• Window size: This field defines the window size of the sending TCP in bytes. The
maximum size of the window is 65,535 bytes.
• Checksum: A 16-bit field for error detection and correction.
• Urgent pointer: A 16-bit field, which is valid only if the urgent flag is set, is used when
the segment contains urgent data.
• Options: Can be up to 40 bytes of optional information in the TCP header.

Encapsulation
• A TCP segment encapsulates the data received from the application layer.
• The TCP segment is encapsulated in an IP datagram, which in turn is encapsulated in a
frame at the data-link layer.

CS8591
Transmission Control Protocol
TCP Connection – Connection Establishment
• TCP transmits data in full-duplex mode.
• The connection establishment in TCP is called
three-way handshaking.
• The process starts with the server. The server
program tells its TCP that it is ready to accept
a
connection. This request is called a passive open.
• The client program issues a request for an active
open.
• A SYN segment cannot carry data, but it
consumes one sequence number.
• A SYN + ACK segment cannot carry data, but it
does consume one sequence number.
• An ACK segment, if carrying no data, consumes
no sequence number.

• SYN Flooding Attack: Happens when one


or more malicious attackers send a large
CS8591
Transmission Control Protocol
TCP Connection – Data Transfer
• After connection is established, bidirectional data transfer can take place.
• The client and server can send data and acknowledgments in both directions.

• Pushing Data: The sending TCP must not


wait for the window to be filled. It must
create a segment and send it immediately.
The sending TCP must also set the push bit
(PSH) to let the receiving TCP know that
not to wait for more data to come.
• Urgent Data: The sending TCP creates a
segment and inserts the urgent data at the
beginning of the segment. The rest of the
segment can contain normal data from the
buffer. The urgent pointer field in the
header defines the end of the urgent data.

CS8591
Transmission Control Protocol
TCP Connection – Connection Termination
• The two parties involved in exchanging data (client or server) can close the connection, although it is
usually initiated by the client.
• Two options for connection termination: Three-way handshaking and Four-way handshaking with
a half-close option.

Three-Way Handshaking
• The FIN segment consumes one sequence number if it does not carry data.
• The FIN + ACK segment consumes only one sequence number if it does not carry data.
• An ACK segment, to confirm the receipt of the FIN segment from the TCP server.

CS8591
Transmission Control Protocol
TCP Connection – Connection Termination
Half-Close
• In TCP, one end can stop sending data while still receiving data.
• After half-closing the connection, data can travel from the server to the client and acknowledgments
can travel from the client to the server. The client cannot send any more data to the server.

CS8591
Transmission Control Protocol
TCP State Transition Diagram

CS8591
Transmission Control Protocol
Windows in TCP
• TCP Sliding Window provides,
– Reliable delivery of data,

– Data is delivered in order, and

– Flow control between the sender and the receiver.

Reliable delivery and Ordered Delivery

CS8591
Transmission Control Protocol
Windows in TCP
Sending Side
• LastByteAck
ed ≤
LastByteSent
– Receiver
cannot
acknowle
dge a
byte that
has not
been sent.
• LastByteSent

LastByteWri
tten
– TCP
cannot
send a
byte that
CS8591the
Transmission Control Protocol
TCP Flow Control
• Both sender and receiver buffer size is finite size, denoted by
MaxSendBuffer, MaxRcvBuffer.
• In sliding window, window size sets the amount of data that can be sent without waiting
for acknowledgement.
• Here receiver gives the maximum window size for the sender by advertising a window
that is no larger than the data that it can buffer.
• Receiver side must keep,
– LastByteRcvd – LastByteRead ≤ MaxRcvBuffer

• To avoid overflowing its buffer (Receive Buffer).

– AdvertisedWindow = MaxRcvBuffer – ((NextByteExpected -1) – LastByteRead)

• Represents the amount of free space remaining in the buffer

CS8591
Transmission Control Protocol
TCP Flow Control
• Sender side must keep,
– LastByteSent – LastByteAcked ≤ AdvertisedWindow

– EffectiveWindow = AdvertisedWindow – (LastByteSent – LastByteAcked)

– To avoid the overflow of the send buffer by local application process, sender must
make sure,
• LastByteWritten – LastByteAcked ≤ MaxSendBuffer

CS8591
Transmission Control Protocol
TCP Flow Control – Triggering Transmission
How does TCP decide to transmit a segment?
– TCP supports a byte stream abstraction.

– Application programs write bytes into streams.

– It is up to TCP to decide that it has enough bytes to send a segment.

TCP has three mechanisms to trigger the transmission of a segment


• TCP maintains a variable MSS and sends a segment as soon as it has collected MSS bytes from the
sending process
– MSS is usually set to the size of the largest segment TCP can send without causing local IP to
fragment.
– MSS: MTU of directly connected network – (TCP header + and IP header).

• Sending process has explicitly asked TCP to send it


– TCP supports push operation.

• When a timer fires


– Resulting segment contains as many bytes as are currently buffered for transmission.
CS8591
Transmission Control Protocol
TCP Flow Control – Silly Window Syndrome
• In TCP ―full‖ containers (data segments) going in one direction and empty containers (ACKs) going
in the reverse direction, then MSS-sized segments correspond to large containers and 1-byte
segments correspond to very small containers.
• If the sender aggressively fills an empty container as soon as it arrives, then any small container
introduced into the system remains in the system indefinitely.
• That is, it is immediately filled and emptied at each end.

• To avoid silly window syndrome Nagle’s algorithm is used.

CS8591
Transmission Control Protocol
TCP Flow Control – Nagle’s Algorithm
• If there is data to send but the window is open less than MSS, then we may want to wait some amount
of time before sending the available data.
• If we wait too long, then we hurt interactive applications like Telnet.
• If we don’t wait long enough, then we risk sending a bunch of tiny packets and falling into the silly
window syndrome.
– The solution is to introduce a timer and to transmit when the timer expires.

• Nagle introduced an elegant self-clocking solution.


• Key Idea
– As long as TCP has any data in flight, the sender will eventually receive an ACK.

– This ACK can be treated like a timer firing, triggering the transmission of more data.
When the application produces data to send,
if both the available data and the window ≥ MSS
send a full segment
else if there is unACKed data in flight
buffer the new data until an ACK arrives
else
send all the new data now
CS8591
Transmission Control Protocol
TCP Error Control
• TCP provides reliability using error control.
• Error control includes mechanisms for detecting and resending corrupted segments, resending lost
segments, storing out-of order segments until missing segments arrive, and detecting and discarding
duplicated segments.
• Error control in TCP is achieved through the use of three simple tools:

1. Checksum: Each segment includes a checksum field, which is used to check for a corrupted segment.

2. Acknowledgment: Confirm the receipt of data segments.


– Cumulative Acknowledgment (ACK)

– Selective Acknowledgment (SACK)

3. Time-out: When the retransmission timer expires or when the sender receives three duplicate ACKs
for the first segment in the queue, that segment is retransmitted.
– Retransmission after RTO

– Retransmission after Three Duplicate ACK Segments

CS8591
Transmission Control Protocol
TCP Congestion Control
• The idea of TCP congestion control is for each source to determine how much capacity
is available in the network, so that it knows how many packets it can safely have in
transit.
o Once a given source has this many packets in transit, it uses the arrival of an ACK
as a signal that one of its packets has left the network, and that it is therefore safe to
insert a new packet into the network without adding to the level of congestion.
o By using ACKs to pace the transmission of packets, TCP is said to be self-clocking.

CS8591
Transmission Control Protocol
TCP Congestion Control - Additive Increase/Multiplicative Decrease
• TCP maintains a new state variable for each connection, called CongestionWindow,
which is used by the source to limit how much data it is allowed to have in transit at a
given time.
• The congestion window is congestion control’s counterpart to flow control’s advertised
window.
• TCP is modified such that the maximum number of bytes of unacknowledged data
allowed is now the minimum of the congestion window and the advertised window.

MaxWindow = MIN(CongestionWindow, AdvertisedWindow)


EffectiveWindow = MaxWindow − (LastByteSent − LastByteAcked)
• That is, MaxWindow replaces AdvertisedWindow in the calculation
of
EffectiveWindow.
• Thus, a TCP source is allowed to send no faster than the slowest component—the network
or the destination host—can accommodate.
CS8591
Transmission Control Protocol
TCP Congestion Control - Additive Increase/Multiplicative Decrease
• The problem, of course, is how TCP comes to learn an value
appropriate for
CongestionWindow.
• Unlike the AdvertisedWindow, which is sent by the receiving side of the connection, there
is no one to send a suitable CongestionWindow to the sending side of TCP.
– The answer is that the TCP source sets the CongestionWindow based on the level of
congestion it perceives to exist in the network.
– This involves decreasing the congestion window when the level of congestion goes up
and increasing the congestion window when the level of congestion goes down.
– Taken together, the mechanism is commonly called additive increase/multiplicative
decrease (AIMD).

CS8591
Transmission Control Protocol
TCP Congestion Control - Additive Increase/Multiplicative Decrease
• How does the source determine that the network is congested and that it should
decrease the congestion window?
– Based on the observation that the main reason packets are not delivered, and a timeout
results, is that a packet was dropped due to congestion. It is rare that a packet is
dropped because of an error during transmission.
– Therefore, TCP interprets timeouts as a sign of congestion and reduces the rate at
which it is transmitting.
– Specifically, each time a timeout occurs, the source sets CongestionWindow to half of
its previous value. This halving of the CongestionWindow for each timeout
corresponds to the “multiplicative decrease” part of AIMD.
– For example, suppose the CongestionWindow is currently set to 16 packets. If a loss
is detected, CongestionWindow is set to 8.

z
CS8591 51
Transmission Control Protocol
TCP Congestion Control - Additive Increase/Multiplicative Decrease
• How does the source determine that the network is congested and that it should
decrease the congestion window?
– Additional losses cause CongestionWindow to be reduced to 4, then 2, and finally to 1
packet.
– CongestionWindow is not allowed to fall below the size of a single packet, i.e.,
maximum segment size (MSS).
• Increase the congestion window to take advantage of newly available capacity in the
network.
• This is the “additive increase” part of AIMD, and it works as follows.
– Every time the source successfully sends a CongestionWindow’s worth of packets—
that is, each packet sent out during the last RTT has been ACKed—it adds the
equivalent of 1 packet to CongestionWindow.

CS8591
Transmission Control Protocol
TCP Congestion Control - Additive Increase/Multiplicative Decrease
• TCP does not wait for an entire window’s worth of ACKs to add 1 packet’s worth to the
congestion window, but instead increments CongestionWindow by a little for each ACK
that arrives.
• Specifically, the congestion window is incremented as follows each time an ACK arrives:
– Increment = MSS × (MSS/CongestionWindow)

– CongestionWindow += Increment

– That is, rather than incrementing CongestionWindow by an entire MSS bytes each
RTT, we increment it by a fraction of MSS every time an ACK is received.
– Assuming that each ACK acknowledges the receipt of MSS bytes, then that fraction is
MSS/CongestionWindow.

CS8591
Transmission Control Protocol
TCP Congestion Control – Slow Start
• Additive Increase / Multiplicative Decrease is only suitable for source, that is operating
close to the available capacity of the network, but it takes too long to ramp up a connection
when it is starting from scratch.
• Slowstart, which is used to increase the congestion window rapidly from a cold start.

• Slow start effectively increases the congestion window exponentially, rather than linearly.

– The source starts out by setting CongestionWindow to one packet.

– When the ACK for this packet arrives, TCP adds 1 to CongestionWindow and then
sends two packets.
– Upon receiving the corresponding two ACKs, TCP increments CongestionWindow by
2 - one for each ACK - and next sends four packets.
– The end result is that TCP effectively doubles the number of packets it has in transit
every RTT.

CS8591
Transmission Control Protocol
TCP Congestion Control - Slow Start

Two different situations in which slow start runs,


• The first is at the very beginning of a connection, at which time the source has no idea
how many packets it is going to be able to have in transit at a given time.
– In this situation, slow start continues to double CongestionWindow each RTT until
there is a loss, at which time a timeout causes multiplicative decrease to divide
CongestionWindow by 2.
• The second situation in which slow start is used is a bit more subtle; it occurs when
the
connection goes dead while waiting for a timeout to occur.
– The source then uses slow start to restart the flow of data.

• Specifically, the source has a current (and useful) value of CongestionWindow; this is the
value of CongestionWindow that existed prior to the last packet loss, divided by 2 as a
result of the loss.
CS8591
Transmission Control Protocol
TCP Congestion Control - Slow Start
• This value used as the ―target‖ congestion window also called as CongestionThreshold.
• Slow start is used to rapidly increase the sending rate up to this value, and then additive
increase is used beyond this point.

i.e., assume congestion window size is x at the time of timeout


• A time out happens, causing the congestion window to be divided by 2, dropping the
CongestionWindow size x to x/2 and CongestionThreshold is set to this amount (x/2).
• CongestionWindow is reset to one packet, as the sender enters slow start.
• Slow start increases the congestion window exponentially until it
reaches
CongestionThreshold.
• CongestionWindow then grows linearly (i.e., it uses additive increase)

CS8591
Transmission Control Protocol
TCP Congestion Control - Fast Retransmit and Fast Recovery
• The idea of fast retransmit is straightforward.

• Every time a data packet arrives at the receiving side, the receiver responds with an
acknowledgment, even if this sequence number has already been acknowledged.
• Thus, when a packet arrives out of order— that is, TCP cannot yet acknowledge the data
the packet contains because earlier data has not yet arrived—TCP resends the same
acknowledgment it sent the last time.
• This second transmission of the same acknowledgment is called a duplicate ACK.

• When the sending side sees a duplicate ACK, it knows that the other side must have
received a packet out of order, which suggests that an earlier packet might have been lost.
• Since it is also possible that the earlier packet has only been delayed rather than lost, the
sender waits until it sees some number of duplicate ACKs and then retransmits the missing
packet.
CS8591
Transmission Control Protocol
TCP Congestion Control - Fast Retransmit and Fast Recovery
• In practice, TCP waits until it has seen three duplicate ACKs before retransmitting the
packet.
• When the fast retransmit mechanism signals congestion, rather than drop the congestion
window all the way back to one packet and run slow start, it is possible to use the ACKs
that are still in the pipe to clock the sending of packets.
• This mechanism, which is called fast recovery, effectively removes the slow start phase
that happens between when fast retransmit detects a lost packet and additive increase
begins.

CS8591
Stream Control Transmission Protocol (SCTP)
• A new transport-layer protocol designed to combine some features of UDP and TCP in
an effort to create a better protocol for multimedia communication.

SCTP Services
• Process-to-Process Communication: It provides process-to-process communication
• Multiple Streams: It allows multistream service in each connection, which is called
association in SCTP terminology. If one of the streams is blocked, the other streams can
still deliver their data.
• Multihoming: The sending and receiving host can define multiple IP addresses in each
end for an association. In this fault-tolerant approach, when one path fails, another
interface can be used for data delivery without interruption.
• Connection-Oriented Service: A connection is called an association.
• Reliable Service: It uses an acknowledgment mechanism to check the safe and sound
arrival of data.
CS8591
Stream Control Transmission Protocol (SCTP)
SCTP Features
• Transmission Sequence Number (TSN): It is used to number the data chunks. TSNs are
32 bits long and randomly initialized between 0 and 232 - 1.
• Stream Identifier (SI): Each stream in SCTP needs to be identified using a stream
identifier (SI).
• Stream Sequence Number (SSN): SCTP defines each data chunk in each stream with a
stream sequence number (SSN).

CS8591
Stream Control Transmission Protocol (SCTP)
Packets
• SCTP is totally different: data are carried as data chunks, control information as control
chunks.
• Several control chunks and data chunks can be packed together in a packet.

SCTP Packet Format

The verification tag is a 32-bit field that


matches a packet to an association.
General Header
CS8591
Stream Control Transmission Protocol (SCTP)
Packets

CS8591
Stream Control Transmission Protocol (SCTP)
An SCTP Association – Association Establishment
• A connection in SCTP is called an association.
• No other chunk is allowed in a packet carrying an INIT or INIT ACK
chunk.
• A COOKIE ECHO or a COOKIE ACK chunk can carry data chunks.

CS8591
Stream Control Transmission Protocol (SCTP)
An SCTP Association – Data Transfer
• In SCTP, only data chunks consume TSNs; data chunks are the only chunks that are
acknowledged.
• The acknowledgment in SCTP defines the cumulative TSN, the TSN of the last data
chunk
received in order.

CS8591
Stream Control Transmission Protocol (SCTP)
An SCTP Association – Association Termination
• SCTP does not allow a ―half-closed‖
association

CS8591

You might also like