Unit4 TransportLayer CSED Final
Unit4 TransportLayer CSED Final
Subject code:310247
• 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
• 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
• 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.
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
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.
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.
• 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)
•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.
• 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.
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.
• 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)
• 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
• 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)
• 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
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)
• 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.
• Each packet sent in an RTP stream is given a number one higher than its
predecessor.
▪ 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)
• 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.
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
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.
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
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
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
• 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
▪ 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
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
• 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
Questions:
1) Please compile and run your applications in the following order:
Please capture traffic with Wireshark and make the interpretation of the results
What happens? Please capture traffic with Wireshark and make the interpretation of the results
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
Application viewpoint
UDP provides reliable transfer of groups of bytes (“datagrams”) between client and server
Unit IV Transport Layer
Socket Programming with UDP
• 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
• 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