0% found this document useful (0 votes)
45 views121 pages

Unit4 TransportLayer CSED Final

The document discusses the transport layer in computer networks. It covers topics like services provided by the transport layer such as connection establishment, addressing, data transfer, flow control, error control and congestion control. It also discusses elements of transport layer like port numbers, socket addresses, multiplexing and demultiplexing, and flow control mechanisms.

Uploaded by

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

Unit4 TransportLayer CSED Final

The document discusses the transport layer in computer networks. It covers topics like services provided by the transport layer such as connection establishment, addressing, data transfer, flow control, error control and congestion control. It also discusses elements of transport layer like port numbers, socket addresses, multiplexing and demultiplexing, and flow control mechanisms.

Uploaded by

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

Computer Networks and Security

Subject code:310247

Unit IV Transport Layer

Instructor: Dr. Salman Baig


Unit IV Transport Layer
Introduction

• The transport layer is the fourth layer from the bottom in the OSI reference
model.
• It is responsible for message delivery from process running in source
computer to the process running in the destination computer.
• Transport layer does not perform any function in the intermediate nodes.
• It is active only in the end systems.
Unit IV Transport Layer
Introduction

• Data Link Layer is responsible for delivery of frames between two


neighboring nodes over a link.
✔ This is called node-to-node delivery.
• Network Layer is responsible for delivery of datagrams between two hosts.
✔ This is called host-to-host delivery.
• Transport Layer is responsible for delivery of entire message from one
process running on source to another process running on destination.
✔ This is called process-to process delivery
Unit IV Transport Layer
Introduction
Unit IV Transport Layer
Services

• The transport layer delivers the message from one process to another process running on
two different hosts.
• Thus, it has to perform number of functions to ensure the accurate delivery of message.
• The various functions/services of transport layer are:
• Establishing, Maintaining & Releasing Connection
• Addressing
• Data Transfer
• Flow Control
• Error Control
• Congestion Control
Unit IV Transport Layer
Services
• Establishing, Maintaining & Releasing Connection:
• The transport layer establishes, maintains & releases end-to-end transport connection
on the request of upper layers.
• Establishing a connection involves allocation of buffers for storing user data,
synchronizing the sequence numbers of packets etc.
• A connection is released at the request of upper layer.
Unit IV Transport Layer
Services

Addressing:
• In order to deliver the message from one process to another, an addressing scheme is
required.
• Several process may be running on a system at a time.
• In order to identify the correct process out of the various running processes, transport
layer uses an addressing scheme called port number.
• Each process has a specific port number
Unit IV Transport Layer
Services
Data Transfer:
• Transport layer breaks user data into smaller units and attaches a transport layer header
to each unit forming a TPDU (TransPort Layer Data Unit).
• The TPDU is handed over to the network layer for its delivery to destination.
• The TPDU header contains port number, sequence number, acknowledgement number,
checksum and other fields.
Unit IV Transport Layer
Services

Flow Control:
• Flow control is used to prevent the sender from overwhelming the receiver.
• If the receiver is overloaded with too much data, then the receiver discards the packets
and asking for the retransmission of packets.
• This increases network congestion and thus, reducing the system performance.
• The transport layer is responsible for flow control.
• It uses the sliding window protocol that makes the data transmission more efficient as
well as it controls the flow of data so that the receiver does not become overwhelmed.
Unit IV Transport Layer
Services

Error control at 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.
Unit IV Transport Layer
Services
Congestion Control:
• Transport layer also handles congestion in the networks.
• The amount of data sent by a sender is not only controlled by the receiver (flow control),
but is also determined by the level of congestion in the network
• Several different congestion control algorithms are used to avoid congestion.
Unit IV Transport Layer
Services

• Transport layer protocols can provide two types of services:


▪ Connection Oriented Service
▪ Connectionless Service

• Similarly, there are also two types of transport service. The connection-oriented transport
service is similar to the connection-oriented network service in many ways.

• In both cases, connections have three phases:


▪ Establishment
▪ Data transfer
▪ Release.
Unit IV Transport Layer
Services

Connection Oriented Service:


• In connection-oriented service, a connection is first established between sender and the
receiver.
• Then, transfer of user data takes place.
• At the end, connection is released.
• The connection-oriented service is generally reliable.
• Transport layer protocols that provide connection-oriented service are TCP and SCTP
(Stream Control Transmission Protocol).
Unit IV Transport Layer
Services
Connectionless Service:
• In the service, the packets are sent from sender to receiver without the establishment of
connection.
• In such service, packets are not numbered.
• The packets may be lost, corrupted, delayed or disordered.
• Connectionless service is unreliable.
• Transport layer protocol that provides this service is UDP
Unit IV Transport Layer
Elements

Addressing:
• In order to deliver data from one process to another, address is required.
• In order to deliver data from one node to another, MAC address is required.
Such an address is implemented at Data Link Layer and is called Physical
Addressing
• In order to deliver data from one network to another, IP address is required.
Such an address is implemented at Network Layer and is called Logical
Addressing.
• Similarly, in order to deliver data from a process running on source to
process running on destination, transport layer defines the Service Point
Address or Port Numbers
Unit IV Transport Layer Protocols
Elements
Port Numbers:
• Each communicating process is assigned a specific port number.
• In order to select among multiple processes running on a destination host, a port
number is required.
• The port numbers are 16-bit integers between 0 and 65,535.
• Port numbers are assigned by Internet Assigned Number Authority (IANA).
Unit IV Transport Layer Protocols
Elements

• IANA has divided the port numbers in three categories:


▪ Well Known Ports: The ports ranging from 0 to 1023. For e.g.: HTTP: 80,
SMTP: 25, FTP: 21.
▪ Registered Ports: The ports ranging from 1024 to 49,151. These are not
controlled by IANA.
▪ Dynamic Ports: The ports ranging from 49,152 to 65,535. These can be used by
any process.

List of ports - https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers


Unit IV Transport Layer Protocols
Elements

https://www.youtube.com/watch?v=RDotMcs0Erg
Unit IV Transport Layer Protocols
Elements

Socket Address:
• Socket address is a combination of IP address and port number.
• In order to provide communication between two different processes on different
networks, both IP address and port number, i.e. socket address is required.
Unit IV Transport Layer Protocols
Elements
Multiplexing & Demultiplexing:
• A network connection can be shared by various
applications running on a system.

• There may be several running processes that


want to send data and only one transport layer
connection available, then transport layer
protocols may perform multiplexing.

• The protocol accepts the messages from different


processes having their respective port numbers,
and add headers to them
Unit IV Transport Layer Protocols
Elements

Multiplexing & Demultiplexing:


• The transport layer at the receiver end
performs demultiplexing to separate the
messages for different processes.

• After checking for errors, the headers of


messages are dropped and each message is
handed over to the respective processes based
on their port numbers.
Unit IV Transport Layer Protocols
Elements

Flow Control:
• Whenever an entity (sender) produces items and another entity (receiver) consumes
them, there should be a balance between production and consumption rates.
• If the items are produced faster than they can be consumed, the consumer can be
overwhelmed and may need to discard some items.
• If the items are produced more slowly than they can be consumed, the consumer must
wait, and the system becomes less efficient.
• Flow control prevents losing the data items at the consumer site
Unit IV Transport Layer Protocols
Flow Control (Contd….):
Elements
Pushing and pulling
• Delivery of items from a producer (source) to a consumer (receiver) can occur in one of two ways: pushing or
pulling.
• If the sender delivers items whenever they are produced without a prior request from the consumer the
delivery is referred to as pushing.
• If the producer delivers the items after the consumer has requested them, the delivery is referred to as pulling.
• 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.
• In other words, the consumer needs to warn the producer to stop the delivery and to inform the producer when
it is again ready to receive 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
Unit IV Transport Layer Protocols
Elements
Flow Control (Contd….):
• We are dealing with four entities: sender process, sender
transport layer, receiver transport layer, and receiver
process.
• The sending process at the application layer is only a
producer. It produces message chunks and pushes them to
the transport layer.
• The sending transport layer has a double role: it is both a
consumer and a producer. It consumes the messages
pushed by the producer. It encapsulates the messages in
packets and pushes them to the receiving transport layer.
• The receiving transport layer also has a double role: it is
the consumer, for the packets received from the sender
and the producer then decapsulates the messages and
delivers them to the application layer.
• The last delivery-receiver process, however, is normally a
pulling delivery; the transport layer waits until the
application-layer process asks for messages
Unit IV Transport Layer Protocols
Elements

Buffers:
• Although flow control can be implemented in several ways, one of the solutions 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.
• The flow control communication can occur by sending signals from the consumer to the producer.
• When the buffer of the sending transport layer is full, it informs the application layer to stop passing chunks
of messages; when there are some vacancies, it informs the application layer that it can pass message chunks
again.
• When the buffer of the receiving transport layer is full, it informs the sending transport layer to stop sending
packets. When there are some vacancies, it informs the sending transport layer that it can send packets again
Unit IV Transport Layer
Elements

Connection Establishment:
• Before communicating, the source device must first determine the availability of
the other to exchange data.
• Path must be found through the network by which the data can be sent.
• This is called Connection Establishment.
• Connection establishment involves Three-Way Handshaking mechanism:
▪ The source sends a connection request packet to the destination.
▪ The destination returns a confirmation packet back to the source.
▪ The source returns a packet acknowledging the confirmation.
Unit IV Transport Layer
Elements

Connection Release:
• Once all of the data has been transferred, the connection must be released.

• It also requires a Three-Way Handshaking mechanism:


▪ The source sends a disconnect request packet to the destination.
▪ The destination returns a confirmation packet back to the source.
▪ The source returns a packet acknowledging the confirmation
Unit IV Transport Layer
Elements
Each host tells its ISN
A B to the other host.
SYN
• Initial sequence numbers (ISN) refers to
the unique 32-bit sequence number
CK
SYN A assigned to each new connection on a
Transmission Control Protocol
ACK (TCP)-based data communication.
• It helps with the allocation of a sequence
Data
number that does not conflict with other
Data
data bytes transmitted over a TCP
connection.
• An ISN is unique to each connection and
separated by each device.
• Three-way handshake to establish connection
• Host A sends a SYN (open) to the host B
• Host B returns a SYN acknowledgment (SYN ACK)
• Host A sends an ACK to acknowledge the SYN ACK
Unit IV Transport Layer
Protocols

• As we know, Transport layer provides two types of services:


▪ Connection Oriented Service
▪ Connectionless Service

• For this, transport layer defines two different protocols:


▪ Transmission Control Protocol (TCP)
▪ User Datagram Protocol (UDP)
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

• Transmission Control Protocol (TCP) is a connection oriented protocol


that provides reliable services between processes on different hosts.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
The basic features of TCP are:
• It provides efficient method for numbering different bytes of data.
• It provides stream data transfer.
• It offers reliability.
• It provides efficient flow control.
• It provides full duplex operation.
• It provides multiplexing.
• It provides connection-oriented service
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

• TCP segment is the unit of data transferred between two processes.


• Each TCP segment consists of two parts:
▪ Header Part
▪ Data Part
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

Format of TCP segment

• Source Port:
▪ It indicates the port number of a source process. It is of 2 bytes.

• Destination Port:
▪ It indicates the port number of destination process. It is also 2 bytes.

• Sequence Number:
▪ It specifies the number assigned to the current message. It is of 4 bytes.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

Format of TCP segment


(Contd…)

•Acknowledgement Number:
▪ It indicates the sequence number of the next byte
of data. It is of 4 bytes.
•Header Length:
▪ It indicates number of words in the TCP header.
It is a 4 bit field.
•Reserved:
▪ This 6 bit field is reserved for future use.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
Format of TCP segment (Contd…)

• Control:
This 6 bit field consists of 6 different flags:
✔ URG (Urgent Pointer)
✔ ACK (Acknowledgement)
✔ PSH (Request for Push)
✔ RST (Reset the Connection)
✔ SYN (Synchronize)
✔ FIN (Final or Terminate the Connection)

• Window:
▪ It specifies the size of sender’s receiving window, i.e.,
the buffer space available for incoming data. It is of 2
bytes.

• Checksum:
▪ This 16-bit field contains the checksum.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
Format of TCP segment (Contd…)

• Urgent Pointer:
▪ This 16-bit field is valid only if urgent pointer in
flags is set to 1.
• Options:
▪ It contains the optional information in the TCP
header. It is of 32 bytes.
• Data:
▪ This field contains the upper layer information. It
is of variable size.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
The connection establishment in TCP is called three-way
handshaking.

• In this example, an application program, called the client,


wants to make a connection with another application
program, called the server, using TCP as the transport-layer
protocol.

• 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. Although the server TCP is ready
to accept a connection from any machine in the world, it
cannot make the connection itself.

• The client program issues a request for an active open. A


client that wishes to connect to an open server tells its TCP
to connect to a particular server. TCP can now start the
three-way handshaking process, as shown in Fig.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
Connection establishment using three-way handshaking

The three steps in this phase are as follows :


1. The client sends the first segment, a SYN segment,
A SYN segment cannot carry data, but it consumes one
sequence number. This sequence number is called the initial
sequence number (ISN).

2. The server sends the second segment, a SYN + ACK segment


A SYN + ACK segment cannot carry data, but does
consume one sequence number.

3. The client sends the third segment, an ACK segment. It


acknowledges the receipt of the second segment
An ACK segment, if carrying no data, consumes no
sequence number.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)
The connection termination using three-way handshaking.

1. In this situation, the client TCP, after receiving a close


command from the client process, sends the first segment, a
FIN segment
The FIN segment consumes one sequence number if it
does not carry data.

2. The server TCP, after receiving the FIN segment, informs its
process of the situation and sends the second segment, a FIN +
ACK segment, to confirm the receipt of the FIN segment from
the client and at the same time to announce the closing of the
connection in the other direction.
The FIN + ACK segment consumes one sequence number
if it does not carry data.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

3. The client TCP sends the last segment, an ACK segment, to confirm the receipt of the FIN segment
from the TCP server. This segment cannot carry data and consumes no sequence numbers.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

Half-Close
• In TCP, one end can stop sending data while still
receiving data. This is called a halfclose.
• Either the server or the client can issue a half-close
request. It can occur when the server needs all the data
before processing can begin.
• A good example is sorting
▪ When the client sends data to the server to be sorted,
the server needs to receive all the data before sorting
can start.
▪ This means the client, after sending all data, can
close the connection in the client-to-server direction.
▪ However, the server-to-client direction must remain
open to return the sorted data.
▪ The server, after receiving the data, still needs time
for sorting; its outbound direction must remain open.
▪ Figure 24.13 shows an example of a half-close.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

Half-Close
• The data transfer from the client to the server stops. The
client half-closes the connection by sending a FIN
segment.
• The server accepts the half-close by sending the ACK
segment. The server, however, can still send data.
• When the server has sent all of the processed data, it
sends a FIN segment, which is acknowledged by an ACK
from the client.

• Note: 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.
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

SYN Flooding Attack


• This happens when one or more malicious attackers send a large number of SYN
segments to a server pretending that each of them is coming from a different client
by faking the source IP addresses in the datagrams

• This SYN flooding attack belongs to a group of security attacks known as a denial
of service attack, in which an attacker monopolizes a system with so many service
requests that the system overloads and denies service to valid requests
Unit IV Transport Layer
Protocols-Transmission Control Protocol (TCP)

https://www.youtube.com/watch?v=OWLGUgiz_eE
Unit IV Transport Layer
Protocols-User Datagram Protocol (UDP)

• User Datagram Protocol (UDP) is a connectionless, unreliable transport protocol.


• Like TCP, UDP also provides process-to-process communication.
• Unlike TCP, it does not provide flow control and error control mechanisms.
• It is connectionless, therefore, it transfers data without establishing a connection.
• The various features of UDP are:
▪ It provides connectionless transport service.
▪ It is unreliable.
▪ It does not provide flow control and error control.
▪ It is less complex and is simple than TCP, and easy to implement.
▪ User datagrams (packets) are not numbered.
Unit IV Transport Layer
Protocols-User Datagram Protocol (UDP)

• A datagram is the unit of data transferred between two processes.


• Each UDP datagram consists of two parts:
▪ Header Part
▪ Data Part.
Unit IV Transport Layer
Protocols-User Datagram Protocol (UDP)

• Source Port:
▪ It indicates the port number of source process.
It is of 16 bits.

• Destination Port:
▪ This 16 bit field specifies the port number of
destination process.

• Length:
▪ It specifies the total length of the user datagram
(header + data). It is of 16 bits.

• Checksum:
▪ The contains the checksum, and is optional. It is
also of 16 bits.
Unit IV Transport Layer
Protocols-TCP vs UDP

https://www.youtube.com/watch?v=cA9ZJdqzOoU
Unit IV Transport Layer
Protocols-TCP vs UDP
Transmission control protocol (TCP) User datagram protocol (UDP)
TCP is a connection-oriented protocol. Connection-orientation means that UDP is the Datagram oriented protocol. This is because there is no overhead
the communicating devices should establish a connection before for opening a connection, maintaining a connection, and terminating a
transmitting data and should close the connection after transmitting the connection. UDP is efficient for broadcast and multicast type of network
data. transmission.

TCP is reliable as it guarantees the delivery of data to the destination The delivery of data to the destination cannot be guaranteed in UDP.
router.
TCP provides extensive error checking mechanisms. It is because it
UDP has only the basic error checking mechanism using checksums.
provides flow control and acknowledgement of data.
Acknowledgement segment is present. No acknowledgement segment.
Sequencing of data is a feature of Transmission Control Protocol (TCP). There is no sequencing of data in UDP. If the order is required, it has to be
this means that packets arrive in-order at the receiver. managed by the application layer.
TCP is comparatively slower than UDP. UDP is faster, simpler, and more efficient than TCP.
There is no retransmission of lost packets in the User Datagram Protocol
Retransmission of lost packets is possible in TCP, but not in UDP.
(UDP).
TCP has a (20-60) bytes variable length header. UDP has an 8 bytes fixed-length header.
TCP is heavy-weight. UDP is lightweight.
Uses handshakes such as SYN, ACK, SYN-ACK It’s a connectionless protocol i.e. No handshake
TCP doesn’t support Broadcasting. UDP supports Broadcasting.
TCP is used by HTTP, HTTPs, FTP, SMTP and Telnet. UDP is used by DNS, DHCP, TFTP, SNMP, RIP, and VoIP.
Unit IV Transport Layer
Protocols-TCP vs UDP
• SCTP stands for Stream Control Transmission Protocol.
• It is sometimes referred to as next generation TCP or TCPng, SCTP makes it easier to
support telephonic conversation on Internet.
• Primary Motivation – Transportation of telephony signalling messages over IP networks
• Telephony Signalling – rigid timing & reliability requirements

• TCP Limitations
• UDP
head-of-line blocking
No Reliability
Byte-oriented, not message-oriented
no support for multi-homing Absence of congestion control
vulnerable to SYN Flooding attacks Absence of flow control
Unit IV Transport Layer
Protocols-TCP vs UDP

• It is sometimes referred to as next generation TCP or TCPng, SCTP makes it easier to


support telephonic conversation on Internet.
• Stream Control Transmission Protocol (SCTP) is a new reliable, message-oriented
transport layer protocol.
• SCTP is a reliable protocol that combines the best features of UDP and TCP
• It is a connection- oriented protocol in computer networks which provides a full-duplex
association i.e., transmitting multiple streams of data between two end points at the same
time that have established a connection in network.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)

• A telephonic conversation requires transmitting of voice along with other data at the
same time on both ends, SCTP protocol makes it easier to establish reliable connection.
• SCTP is also intended to make it easier to establish connection over wireless network and
managing transmission of multimedia data.
• SCTP, is designed for Internet applications that have recently been introduced.
• These new applications, such as IUA (ISDN over IP), M2UA and M3UA (telephony
signaling), H.248 (media gateway control), H.323 (IP telephony), and SIP (IP telephony),
etc
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)

What TCP and SCTP both have:


✔reliability (retransmissions)
✔congestion control
✔connection oriented

SCTP adds the following:


✔4-way handshake
to reduce vulnerability to Denial of Service attacks
✔multihoming
instead of one IP address per endpoint, a set of IP addresses per endpoint
✔framing
preserve message boundaries
✔multistreaming
instead of one ordered stream, up to 64K independent ordered streams
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)
• In TCP 3-way handshake, the client sends a SYN packet (short for Synchronize) for
which the server responds with a SYNACK packet (Synchronize-Acknowledge).
• Finally, the client confirms receipt with an ACK packet.

• The problem that can occur with TCP is when when one or more malicious attackers
send a large number of SYN segments to a server pretending that each of them is
coming from a different client by faking the source IP addresses in the datagrams
• The server allocates resources for the connections upon receipt of the SYN, then under
a flood of SYN packets, the system with so many service requests overloads and denies
service to valid requests.This is called a Denial of Service (DoS) attack.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Services
(SYN) INIT
4-way Handshake
(SYN-ACK) INIT-ACK

COOKIE-ECHO

COOKIE-ACK

End-Point A End-Point Z
• In SCTP, a client initiates a connection with an INIT packet.
• The server responds with an INIT-ACK, which includes the cookie (a unique context identifying this proposed
connection).
• The client then responds with a COOKIE-ECHO, which contains the cookie sent by the server. (verifying that
the connection request is coming from a valid IP address)
• At this point, the server allocates the resource for the connection and acknowledges this by sending a
COOKIE-ACK to the client.
• To solve the problem of delayed data movement with the four-way handshake, SCTP permits data to be
included in the COOKIE-ECHO and COOKIE-ACK packets.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Services
SCTP Services:
1. Process-to-Process Communication
• SCTP, like UDP or TCP, provides process-to-process communication.

2. Multiple Streams
• Since TCP is a stream-oriented protocol, each connection between a TCP client and a TCP server involves a single
stream.
• The problem with this approach (in TCP) is that a loss at any point in the stream blocks the delivery of the rest of the
data. This can be acceptable when we are transferring text; and it is not acceptable when we are sending real-time data
such as audio or video.
• SCTP 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.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Services

3. Multihoming
• Multihoming is the ability of an SCTP association to support multiple IP paths to its peer endpoint.
• The benefit of multihoming associations is that it makes the association more fault-tolerant against physical
network failures and other issues on the interfaces.
• It allows re-routing of packets in the event of failure and also provides an alternate path for retransmissions
• Figure shows the idea of multihoming.

Internet

End-Point A End-Point Z
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Services

4. Full-Duplex Communication:
Like TCP, SCTP offers full-duplex service, in which data can flow in both directions at the same time. Each SCTP then has
a sending and receiving buffer, and packets are sent in both directions.

5. Connection-Oriented Service:
Like TCP, SCTP is a connection-oriented protocol. However, in SCTP, a connection is called an association. When a process
at site A wants to send and receive data from another process at site B, the following occurs:
1. The two SCTPs establish an association between each other.
2. Data are exchanged in both directions.
3. The association is terminated

6. Reliable Service
SCTP, like TCP, is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and sound arrival of
data
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Features

Features of SCTP

• Data chunks are identified by three items: TSN, SI, and SSN.
• TSN is a cumulative number identifying the association;
• SI defines the stream;
• SSN defines the chunk in a stream.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP) Features
Features of SCTP

Transmission Sequence Number (TSN)


• The unit of data in TCP is a byte. Data transfer in TCP is controlled by numbering bytes by using a sequence
number.
• On the other hand, the unit of data in SCTP is a DATA chunk that may or may not have a one-to-one relationship
with the message coming from the process because of fragmentation.

Stream Identifier (SI)


• In TCP, there is only one stream in each connection.
• In SCTP, there may be several streams in each association.
• Each stream in SCTP needs to be identified by using a stream identifier (SI).
• Each data chunk must carry the SI in its header so that when it arrives at the destination, it can be properly placed
in its stream. The SI is a 16-bit number starting from 0.

Stream Sequence Number (SSN)


• When a data chunk arrives at the destination in SCTP, it is delivered to the appropriate stream and in the proper
order.
• This means that, in addition to an SI, SCTP defines each data chunk in each stream with a stream sequence
number (SSN).
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)

Packets
• In TCP, a segment carries data and control information. Data is carried as a collection of bytes; control
information is defined by six control flags in the header.
• The design of SCTP is totally different: data is carried as data chunks; control information is carried as
control chunks.
• Several control chunks and data chunks can be packed together in a packet.
• A packet in SCTP plays the same role as a segment in TCP.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)

Flow Control
Like TCP, SCTP implements flow control to avoid overwhelming the receiver.

Error Control
Like TCP, SCTP implements error control to provide reliability. TSN numbers and acknowledgement
numbers are used for error control.

Congestion Control
Like TCP, SCTP implements congestion control to determine how many data chunks can be injected into the
network.
Unit IV Transport Layer
Protocols-Stream Control Transmission Protocol (SCTP)

Advantages of SCTP :
1.It is a full- duplex connection i.e. users can send and receive data simultaneously.
2.It allows half- closed connections.
3.The message’s boundaries are maintained and application doesn’t have to split
messages.
4.It has properties of both TCP and UDP protocol.
5.It doesn’t rely on IP layer for resilience of paths.

Disadvantages of SCTP :
One of key challenges is that it requires changes in transport stack on node.
1. Applications need to be modified to use SCTP instead of TCP/UDP.
2. Applications need to be modified to handle multiple simultaneous streams.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)
• Real-time Transport Protocol (RTP) is the protocol designed to
handle real-time traffic on the Internet.
• RTP does not have a delivery mechanism (multicasting, port
numbers, and so on); and that is why it must be used with
UDP
• RTP typically runs on top of UDP. Specifically, audio or video
chunks of data, generated by the sending side of a multimedia
application, are encapsulated in RTP packets, and each RTP
packet is in turn encapsulated in a UDP segment.
• Because RTP provides services (timestamps, sequence
numbers, etc.) to the multimedia application, RTP can be
viewed as a sublayer of the transport layer,
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• The data from multimedia applications are encapsulated in


RTP, which in turn passes them to the transport layer.

• In other words, the socket interface is located between RTP


and UDP, which implies that the developer includes the
functionality of RTP in client-server programs in application
layer for each multimedia application (ex: text, graphics,
images, sound/audio, animation and/or video)
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• For Eg: The application precedes each chunk of the audio data
with an RTP header, which includes the type of audio
encoding, a sequence number and a timestamp.
• The audio chunk along with the RTP header forms the RTP
packet, which is then sent into the UDP socket interface, where
it is encapsulated in a UDP packet.
• At the receiver side, the application receives the RTP packet
from its socket interface. The application extracts the audio
chunk from the RTP packet, and uses the header fields of the
RTP packet to properly decode and playback the audio chunk.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• The basic function of RTP is to multiplex several real-time data streams onto
a single stream of UDP packets.

• The UDP stream can be sent to a single destination (unicasting) or to multiple


destinations (multicasting).

• Each packet sent in an RTP stream is given a number one higher than its
predecessor.

• RTP has no flow control, no error control, no acknowledgements, and no


mechanism to request retransmission.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• Figure 28.35 shows the format of the RTP


packet header.
• The format is very simple and general enough
to cover all real-time applications.
• The explanation of each field of header format
is given below:
▪ Version :
This 2-bit field defines version number. The
current version is 2.

▪ P–
The length of this field is 1-bit. If value is 1,
then it denotes presence of padding at end of
packet and if value is 0, then there is no
padding.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• Contributor count –
This 4-bit field indicates number of
contributors. Here maximum possible
number of contributor is 15 as a 4-bit field
can allows number form 0 to 15.
• M–
The length of this field is 1-bit and it is used
as end marker by application to indicate end
of its data.
• Payload types –
This field is of length 7-bit to indicate type of
payload. We list applications of some
common types of payload.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

▪ Sequence number.
✔ This field is 16 bits in length. It is used to number
the RTP packets.
✔ The sequence number of the first packet is chosen
randomly; it is incremented by 1 for each
subsequent packet.
✔ The sequence number is used by the receiver to
detect lost or out of order packets.

▪Timestamp.
✔ This is a 32-bit field that indicates the time relationship between packets.
✔ The timestamp for the first packet is a random number.
✔ For each succeeding packet, the value is the sum of the preceding timestamp plus the time the
first byte is produced (sampled). The value of the clock tick depends on the application.
✔ For example, audio applications normally generate chunks of 160 bytes; the clock tick for this
application is 160. The timestamp for this application increases 160 for each RTP packet.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• Synchronization source (SSRC) identifier.


✔ If there is only one source, this 32-bit field
defines the source.
✔ However, if there are several sources, the mixer
is the synchronization source and the other
sources are contributors.
✔ The value of the source identifier is a random
number chosen by the source.
✔ The protocol provides a strategy in case of
conflict (two sources start with the same
sequence number).
✔ Note: A mixer is an intermediate system that
receives RTP packets from a group of
sources and combines them into a single output
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• Contributing source (CSRC) identifier.


• Each of these 32-bit identifiers (a maximum of 15) defines a source.
• When there is more than one source in a session, the mixer is the synchronization
source and the remaining sources are the contributors.
Unit IV Transport Layer
Protocols-Real Time Transport Protocol (RTP)

• Real-time Transport Protocol (RTP) allows only


that type of message, which carries data from the
source to the destination.
• But in some cases, we need some other type of
messages in a session.
• The messages that can control the transmission and
quality of data as well as also allow the recipients
so that they can send feedback to the source or
sources.
• A protocol designed for this purpose, which is
known as Real-time Transport Control Protocol
(RTCP).
Unit IV Transport Layer
Congestion Control and Quality of Service

• Congestion control and quality of service are two issues so closely bound together that
improving one means improving the other and ignoring one usually means ignoring the
other.
• Most techniques to prevent or eliminate congestion also improve the quality of service in a
network.

• DATA TRAFFIC
✔ 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.
Unit IV Transport Layer
Congestion Control and Quality of Service
• Traffic Descriptor:
✔ Traffic descriptors are qualitative values that
represent a data flow.
✔ Following figure shows a traffic flow with some of
these values.

Average Data Rate


The average data rate is the number of bits sent during a
period of time, divided by time period.

Average data rate =amount of data time/time

This is a very useful characteristic as it indicates the


average bandwidth needed by the traffic.
Unit IV Transport Layer
Congestion Control and Quality of Service

Peak Data Rate


• The peak data rate defines the maximum data rate of the traffic.
• It indicates the peak bandwidth that the network requires for the
traffic to pass through without changing its data flow.

Maximum Burst Size


• The maximum burst size normally refers to the maximum length of
time when the traffic is generated at peak rate.

Effective bandwidth :
• The effective bandwidth is the bandwidth that the network needs to
allocate for the flow of traffic.
• The effective bandwidth is basically a function of three values i.e
average data rate, peak data rate, and maximum burst size.
Unit IV Transport Layer
Congestion Control and Quality of Service
Traffic Profiles:
A data flow can have one of the following three
traffic profiles: constant bit rate, variable bit rate, or
bursty

Constant Bit Rate or fixed-rate


• In this type of flow, the average data rate and the
peak data rate are the same.
• The maximum burst size is not applicable.
• This type of traffic is very easy for a network to
handle since it is predictable.
• The network knows in advance how much
bandwidth to allocate for this type of flow
Unit IV Transport Layer
Congestion Control and Quality of Service
Variable Bit Rate
• The rate of the data flow changes in time, with the
changes smooth instead of sudden and sharp.
• In this type of flow, the average data rate and the peak
data rate are different.
• The maximum burst size is usually a small value.
• This type of traffic is more difficult to handle than
constant-bit-rate traffic

Bursty
• The data rate changes suddenly in a very short time.
• This is the most difficult type of traffic for a network
to handle because the profile is very unpredictable.
• Bursty traffic is one of the main causes of congestion
in a network.
Unit IV Transport Layer
Congestion Control and Quality of Service

• 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 to control the congestion
and keep the load below the capacity
Unit IV Transport Layer
Congestion Control and Quality of Service
We may ask why there is congestion on a network?
• Congestion happens in any system that involves waiting.
• Congestion in a network or internetwork occurs because routers and switches have queues-buffers
that hold the packets before and after processing.
• A router, for example, has an input queue and an output queue for each interface.
Unit IV Transport Layer
Congestion Control and Quality of Service
• When a packet arrives at the incoming interface, it undergoes three steps before departing, as shown in the
following figure.
1. The packet is put at the end of the input queue while waiting to be checked.
2. The processing module of the router removes the packet from the input queue once it reaches the front
of the queue and uses its routing table and the destination address to find the route.
3. The packet is put in the appropriate output queue and waits its turn to be sent.
• We need to be aware of two issues.
o First, if the rate of packet arrival is higher than the packet processing rate, the input queues become
longer and longer.
o Second, if the packet departure rate is less than the packet processing rate, the output queues become
longer and longer.
Unit IV Transport Layer
Congestion Control and Quality of Service

Network Performance
• Congestion control involves two factors that measure the performance of a network: delay
and throughput.
• Following figure shows these two performance measures as function of load.

Fig. Packet delay and throughput as functions of load


Unit IV Transport Layer
Congestion Control and Quality of Service

Delay Versus Load


• Note that when the load is much less than the capacity of the
network, the delay is at a minimum. This minimum delay is
composed of propagation delay and processing delay, both of which
are negligible.
• However, when the load reaches the network capacity, the delay
increases sharply ( the waiting time in the queues (for all routers in
the path) is added to the total delay).
• Note that the delay becomes infinite when the load is greater than the
capacity.
• Delay has a negative effect on the load and consequently the
congestion. When a packet is delayed, the source, not receiving the
acknowledgment, retransmits the packet, which makes the delay, and
the congestion, worsens
Unit IV Transport Layer
Congestion Control and Quality of Service

Throughput Versus Load


• Throughput in a network is the number of packets passing through
the network in a unit of time.
• Notice that when the load is below the capacity of the network, the
throughput increases proportionally with the load.
• We expect the throughput to remain constant after the load reaches
the capacity, but instead the throughput declines sharply. The reason
is the discarding of packets by the routers.
• When the load exceeds the capacity, the queues become full and the
routers have to discard some packets. Discarding packet does not
reduce the number of packets in the network because the sources
retransmit the packets, using time-out mechanisms, when the packets
do not reach the destinations.
Unit IV Transport Layer
Congestion Control and Quality of Service
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) as
shown in the following figure.
Unit IV Transport Layer
Congestion Control and Quality of Service

Open-Loop Congestion Control


In open-loop congestion control, policies are applied to prevent congestion before it happens.
In these mechanisms, congestion control is handled by either the source or the destination.

Retransmission Policy
• Retransmission is sometimes unavoidable.
• If the sender feels that a sent packet is lost or corrupted, the packet needs to be retransmitted.
Retransmission in general may increase congestion in the network.

• Therefore, a good retransmission policy can prevent congestion. The retransmission policy and the
retransmission timers must be designed to optimize efficiency and at the same time prevent congestion.
• For example, the retransmission policy used by TCP is designed to prevent or alleviate congestion.
Unit IV Transport Layer
Congestion Control and Quality of Service

Window Policy
• The Selective Repeat window is better than the Go-Back-N window for congestion control.
• Using a bigger window size is better

Acknowledgment Policy
• If the receiver does not acknowledge every packet it receives, it may slow down the sender and help
prevent congestion.
• Several approaches are used in this case.
• A receiver may send an acknowledgment only if it has a packet to be resent or a special timer expires.
• A receiver may decide to acknowledge only N packets at a time.
Unit IV Transport Layer
Congestion Control and Quality of Service

Discarding Policy
• A good discarding policy by the routers may prevent congestion and at the same time may not harm the
integrity of the transmission.

Admission Policy
• An admission policy, which is a quality-of-service mechanism, can also prevent congestion in
virtual-circuit networks.
• Switches in a flow first check the resource requirement of a flow before admitting it to the network.
• A router can deny establishing a virtual circuit connection if there is congestion in the network or if there is
a possibility of future congestion.
Unit IV Transport Layer
Congestion Control and Quality of Service
Closed-Loop Congestion Control
Closed-loop congestion control mechanisms tries to alleviate congestion after it happens

Backpressure
• The technique of backpressure refers to a congestion control mechanism in which a congested node stops
receiving data from the immediate upstream node or nodes.
• This may cause the upstream node or nodes to become congested, and they, in turn, reject data from their
upstream nodes
• Backpressure is a node-to-node congestion control that starts with a node and propagates, in the opposite
direction of data flow, to the source.
• The backpressure technique can be applied only to virtual circuit networks, in which each node has
information of its above upstream node.
Unit IV Transport Layer
Congestion Control and Quality of Service

• In the diagram the III node is congested and stops receiving packets as a result II node
may be get congested due to slowing down of the output data flow.
• Similarly I node may get congested and informs the source to slow down.
Unit IV Transport Layer
Congestion Control and Quality of Service

Choke Packet Technique :


• Choke packet technique is applicable to both virtual networks as well as datagram subnets.
• A choke packet is a packet sent by a node to the source to inform it of congestion.
• Each router monitor its resources and the utilization at each of its output lines.
• Whenever the resource utilization exceeds the threshold value which is set by the
administrator, the router directly sends a choke packet to the source giving it a feedback to
reduce the traffic.
• The intermediate nodes through which the packets have traveled are not warned about
congestion.
Unit IV Transport Layer
Congestion Control and Quality of Service

Implicit Signaling
• In implicit signaling, there is no communication between the congested node or nodes
and the source.
• The source guesses that there is a congestion somewhere in the network from other
symptoms.
• For example, when a source sends several packets and there is no acknowledgment for
a while, one assumption is that the network is congested.
• The delay in receiving an acknowledgment is interpreted as congestion in the network;
the source should slow down.
Unit IV Transport Layer
Congestion Control and Quality of Service

Explicit Signaling
• In explicit signaling, if a node experiences congestion it can explicitly sends a packet to the
source or destination to inform about congestion.
• The difference between choke packet and explicit signaling is that the signal is included in
the packets that carry data rather than creating different packet as in case of choke packet
technique.
• Explicit signaling can occur in either forward or backward direction.
• Forward Signaling : In forward signaling signal is sent in the direction of the
congestion. The destination is warned about congestion. The receiver in this case adopt
policies to prevent further congestion.
• Backward Signaling : In backward signaling signal is sent in the opposite direction of
the congestion. The source is warned about congestion and it needs to slow down.
Unit IV Transport Layer
Congestion Control and Quality of Service

• A stream of packets from a source to destination is called a flow. Quality of Service is


defined as something a flow seeks to attain.
• In connection oriented network, all the packets belonging to a flow follow the same order.
• In a connectionless network, all the packets may follow different routes.

The needs of each flow can be characterized by four primary parameters as shown in the Fig.
below:
Unit IV Transport Layer
Congestion Control and Quality of Service

• Reliability, Lack of reliability means losing a packet or acknowledgement which entertains


retransmission.

• Delay, Increase in delay means destination will find the packet later than expected, Importance of delay
changes according to the various application.

• Jitter, Variation of the delay is jitter, If the delay is not at a constant rate, it may result in poor quality.

• Bandwidth, Increase in bandwidth means increase in the amount of data which can be transferred in
given amount of time, Importance of bandwidth also varies according to various application.
Unit IV Transport Layer
Socket Programming
What is a socket?
● Socket: An interface between an application process and transport layer
• The application process can send/receive messages to/from another application
process (local or remote)via a socket
• a socket takes care to transport the information to the destination.
• a socket brings back an answer (if requested) from the receiver

Two types of (TCP/IP) sockets


• Stream sockets (e.g. uses TCP)
▪ provide reliable byte-stream service
• Datagram sockets (e.g. uses UDP)
▪ provide best-effort datagram service
Unit IV Transport Layer
Socket Programming

▪ Server
• passively waits for and responds to clients
• passive socket

▪ Client
• initiates the communication
• must know the address and the port of the server
• active socket
Unit IV Transport Layer
Socket Programming with TCP
TCP service: reliable transfer of bytes from one process
to another

Client must contact server


• server process must first be running
• server must have created socket (door) that welcomes
client’s contact

Client contacts server by:


• creating client-local TCP socket
• specifying IP address, port number of server process
• when client creates socket: client TCP establishes
connection to server TCP
• when contacted by client, server TCP creates new
socket for server process to communicate with client
✔ allows server to talk with multiple clients
✔ source port numbers used to distinguish clients
Unit IV Transport Layer
Socket Programming with TCP

Application viewpoint

• TCP provides reliable, in-order transfer of bytes (“pipe”) between client and server (see
TCP-Protocol presentation)

• The applications are usually implemented as “Processes”. In that case a “Process” can get
transport service if it uses an available socket

• Usually the transport layer offers 64,000 such sockets

• In order to get the required transport service a process needs to transfer the socket the
corresponding parameters. So called sockets identification is done by associating to it:
- IP-Address of the residing host
- transport layer portnr. (i.e.: either TCP-portnr. or UDP-portnr.)
Unit IV Transport Layer
Socket Programming with TCP

Application viewpoint

• Based on its unique identification a socket will enter into a “connection” relationship to another
socket within the network.
- TCP protocol uses a so called “3 way handshake” for establishing a connection (this is done
at the TCP level not at the process level!
Unit IV Transport Layer
Socket Programming with TCP
Client/server socket interaction: TCP
Unit IV Transport Layer
Socket Programming with TCP
Working with stream of information:
• A stream is a sequence of characters that flow into or out of a process.
• An input stream is attached to some input source for the process, e.g., keyboard or socket.
• An output stream is attached to an output source, e.g., monitor or socket
Unit IV Transport Layer
Socket Programming with TCP

Socket programming with TCP Example:


Client-Server application in Java
1) client reads line from standard input (inFromUser stream) , sends to server via socket
(outToServer stream)
2) server reads line from socket
3) server converts line to uppercase, sends back to client
4) client reads, prints modified line from socket (inFromServer stream)
Unit IV Transport Layer
Socket Programming with TCP
Example: Client code (TCP)
import java.io.*;
import java.net.*;
// Create an input stream attached to socket
BufferedReader inFromServer =
class TCPClient {
new BufferedReader(new
public static void main(String argv[]) throws Exception
InputStreamReader(clientSocket.getInputStream()));
{
sentence = inFromUser.readLine();
String sentence;
String modifiedSentence;
// Send a line to server
outToServer.writeBytes(sentence + '\n');
// Create an input stream
BufferedReader inFromUser =
// Read a line from server
new BufferedReader(new InputStreamReader(System.in));
modifiedSentence = inFromServer.readLine();
System.out.println("FROM SERVER: " +
// Create a client socket,
modifiedSentence);
// connect to server
clientSocket.close();
Socket clientSocket = new Socket("hostname", 2009);
}
}
// Create an output stream attached to the socket
DataOutputStream outToServer =
new DataOutputStream(clientSocket.getOutputStream());
Unit IV Transport Layer
Socket Programming with TCP

Example: Server code (TCP)


import java.io.*; // Create output stream, attached to socket
import java.net.*; DataOutputStream outToClient = new
DataOutputStream(connectionSocket.getOutputStream());
class TCPServer {
public static void main(String argv[]) throws Exception // Read in line from socket
{ clientSentence = inFromClient.readLine();
String clientSentence; capitalizedSentence = clientSentence.toUpperCase() + '\n’;
String capitalizedSentence;
// Write out line to socket
// Create welcoming socket at port 2009 outToClient.writeBytes(capitalizedSentence);
ServerSocket welcomeSocket = new ServerSocket(2009);
while(true) { // End of while loop, bloop back and
// wait for another client connection
// Wait, on welcoming socket for contact by client }
Socket connectionSocket = welcomeSocket.accept(); }
}
// Create input stream, attached to socket
BufferedReader inFromClient = new BufferedReader(new
InputStreamReader(connectionSocket.getInputStream()));
Unit IV Transport Layer
Socket Programming with TCP

Questions:
1) Please compile and run your applications in the following order:

first TCP- Server and then TCP-Client

Please capture traffic with Wireshark and make the interpretation of the results

2) Please run your applications in the following order:

first TCP- Client and then TCP-Server

What happens? Please capture traffic with Wireshark and make the interpretation of the results

3) Please change the port number of the client process:

please change port number 2009 to port number 2010

Recompile the client process and run your application again. Observe what happens? Please capture traffic with Wireshark
and make the interpretation of the results.
Unit IV Transport Layer
Socket Programming with UDP

UDP: no “connection” between client and server


• no handshaking
• sender explicitly attaches IP address and port of destination to each packet
• server must extract IP address, port of sender from received packet
UDP: transmitted data may be received out of order, or lost

Application viewpoint
UDP provides reliable transfer of groups of bytes (“datagrams”) between client and server
Unit IV Transport Layer
Socket Programming with UDP

Client/server socket interaction based on UDP-Protocol


Unit IV Transport Layer
Socket Programming with UDP

Example: Client code(UDP)


Unit IV Transport Layer
Differentiated Services

• Two models have been designed to provide quality of service in the


Internet: Integrated Services and Differentiated Services
• Integrated Services is a flow-based QoS model designed for IP.
• We will be focusing on Differentiated services (as only this is included
in the syllabus)
• Differentiated Services (DS or Diffserv) was introduced by the IETF
(Internet Engineering Task Force) to handle the shortcomings of
Integrated Services.
• Differentiated Services is a class-based QoS model designed for IP.
Unit IV Transport Layer
Differentiated Services

• As mentioned earlier Differentiated Services (DS or Diffserv) was introduced to handle the
shortcomings of Integrated Services.
• Two fundamental changes were made:
1. The main processing was moved from the core of the network to the edge of the network. This
solves the scalability problem. The routers do not have to store information about flows. The
applications, or hosts, define the type of service they need each time they send a packet.
2. The per-flow service is changed to per-class service. The router routes the packet based on the
class of service defined in the packet, not the flow. This solves the service-type limitation
problem. We can define different types of classes based on the needs of applications.
Unit IV Transport Layer
Differentiated Services

• In DiffServ, each packet contains a field called the DS field. The value of this field is set
at the boundary of the network by the host or the first router designated as the boundary
router.
• The DS field contains two subfields: DSCP and CU. The DSCP (Differentiated Services
Code Point) is a 6-bit subfield that defines the per-hop behavior (PHB). The 2-bit CU
(Currently Unused) subfield is not currently used.
Unit IV Transport Layer
Differentiated Services
• The DiffServ model defines per-hop behaviors (PHBs) for each node that receives a packet. So far three PHBs
are defined: DE PHB, EF PHB, and AF PHB.
DE PHB
• The DE PHB (default PHB) is the same as best-effort delivery, which is compatible with ToS (Type of
service).
EF PHB
• The EF PHB (expedited forwarding PHB) provides the following services:
a. Low loss.
b. Low latency.
c. Ensured bandwidth.
• This is the same as having a virtual connection between the source and destination.
AF PHB
• The AF PHB (assured forwarding PHB) delivers the packet with a high assurance as long as the class traffic
does not exceed the traffic profile of the node. The users of the network need to be aware that some packets
may be discarded.
Unit IV Transport Layer
Differentiated Services
• To implement DiffServ, the DS node uses traffic conditioners such
as meters, markers, shapers, and droppers, as shown in Figure
Meter
• The meter checks to see if the incoming flow matches the negotiated
traffic profile. The meter also sends this result to other components.
The meter can use several tools such as a token bucket to check the
profile.
Marker
• A marker can re-mark a packet that is using best-effort delivery or
down-mark a packet based on information received from the meter.
Down-marking (lowering the class of the flow) occurs if the flow
does not match the profile. A marker does not up-mark a packet
(promote the class).
Shaper
• A shaper uses the information received from the meter to reshape
the traffic if it is not compliant with the negotiated profile.
Dropper
• A dropper, which works as a shaper with no buffer, discards packets
if the flow severely violates the negotiated profile.
Unit IV Transport Layer
TCP for Wireless Networks

Motivation
• Transport protocols typically designed for
▪ Fixed end-systems
▪ Fixed, wired networks
• TCP congestion control
▪ Packet loss in fixed networks typically due to (temporary) overload situations
▪ Routers discard packets as soon as the buffers are full
▪ TCP recognizes congestion only indirectly via missing acknowledgements
▪ Retransmissions unwise, they would only contribute to the congestion and make it
even worse
▪ Slow-start mechanism
Unit IV Transport Layer
TCP for Wireless Networks

Some other Problems with Traditional TCP in wireless environments


• Slow Start mechanism in fixed networks decreases the efficiency of TCP if used with
mobile receivers or senders.
• Error rates on wireless links are orders of magnitude higher compared to fixed fiber or
copper links. This makes compensation for packet loss by TCP quite difficult.
• Mobility itself can cause packet loss. There are many situations where a soft handover
from one access point to another is not possible for a mobile end-system.
• Standard TCP reacts with slow start if acknowledgements are missing, which does not help
in the case of transmission errors over wireless links and which does not really help during
handover. This behavior results in a severe performance degradation of an unchanged TCP
if used together with wireless links or mobile nodes
Unit IV Transport Layer
TCP for Wireless Networks

Indirect TCP (I-TCP)


• Indirect TCP segments a TCP connection into a fixed part and a wireless part
• Standard TCP is used between the fixed computer and the access point.
• No computer in the internet recognizes any changes to TCP. Instead of the mobile
host, the access point now terminates the standard TCP connection, acting as a
proxy. This means that the access point is now seen as the mobile host for the fixed
host and as the fixed host for the mobile host.
• Between the access point and the mobile host, a special TCP, adapted to wireless
links, is used
Unit IV Transport Layer
TCP for Wireless Networks

• The foreign agent acts as a proxy and relays all data in both directions.
• If CH (correspondent host) sends a packet to the mobile host (MH), the Foreign agent (FA)
acknowledges it and forwards it to the MH. MH acknowledges on successful reception, but this is only
used by the FA.
• If a packet is lost on the wireless link, CH does not observe it and FA tries to retransmit it locally to
maintain reliable data transport.
• If the MH sends a packet, the FA acknowledges it and forwards it to CH.
• If the packet is lost on the wireless link, the mobile hosts notices this much faster due to the lower
round trip time and can directly retransmit the packet.
• Packet loss in the wired network is now handled by the foreign agent.
Unit IV Transport Layer
TCP for Wireless Networks
Advantages
• No changes in the fixed network necessary, no changes for the hosts (TCP protocol)
necessary, all current optimizations to TCP still work
• Wireless link transmission errors isolated from those in fixed network
• simple to control, mobile TCP is used only for one hop between, e.g., a foreign agent
and mobile host
• therefore, a very fast retransmission of packets is possible, the short delay on the mobile
hop is known
Disadvantages
• Loss of end-to-end semantics:- an acknowledgement to a sender no longer means that a
receiver really got a packet, foreign agents might crash
• higher latency possible due to buffering of data within the foreign agent and forwarding
to a new foreign agent
• Security issue
Unit IV Transport Layer
TCP for Wireless Networks
Early Approach-Snooping TCP-I
• “Transparent” extension of TCP within the foreign agent
• buffering of packets sent to the mobile host
• lost packets on the wireless link (both directions!) will be retransmitted immediately by the
mobile host or foreign agent, respectively (so called “local” retransmission)
• the foreign agent therefore “snoops” the packet flow and recognizes acknowledgements in both
directions, it also filters ACKs
• Changes of TCP only within the foreign agent (+min. changes in MH)
Unit IV Transport Layer
TCP for Wireless Networks
Snooping TCP II
Data transfer to the mobile host
• FA buffers data until it receives ACK of the MH, FA detects packet loss via duplicated ACKs or time-out
• fast retransmission possible, transparent for the fixed network
Data transfer from the mobile host
• FA detects packet loss on the wireless link via sequence numbers, FA answers directly with a NACK
(negative acknowledgement) to the MH
• MH can now retransmit data with only a very short delay
Advantages:
• Maintain end-to-end semantics
• No change to correspondent node
• No major state transfer during handover
Problems
• Snooping TCP does not isolate the wireless link well
• May need change to MH to handle NACKs
• Snooping might be useless depending on encryption schemes

You might also like