Sie sind auf Seite 1von 35

Computer Networks

(3150710)
Chapter 3: Transport Layer
Weightage: 25%

Krupali Joshi
Assistant Professor
Computer Department
Introduction to Transport Layer
• The transport layer is a 4th layer from the top.
• The standard protocols used by Transport Layer is TCP and UDP.
• The main role of the transport layer is to provide the communication services directly to the
application processes and take services from the network layer.
Duties and services of Transport Layer
• Real communication normally takes place between two processes (application programs). We
need process-to-process delivery. Transport basically deals with the process to process delivery.
• Let us understand the duties of this layer first :
1. Flow Control
2. Error Control
3. Addressing
4. Connection Control
5. Packetizing
Duties and services of Transport Layer
1. Flow Control and Error Control
• The transport layer also can provide flow control. But this flow control is performed end to end
and not across a single link . The transport layer can further provide error control as well.
• But error control at the transport layer is performed end to end and not across a single link. Error
correction is generally achieved by re-transmission of the packets discarded due to errors.
2. Addressing
• The client needs the address of the remote computer it wants to communicate with.
• Such a remote computer has a unique address so that it can be distinguished from all the other
computers.
Duties and services of Transport Layer
3. Connection Control
• Transport layer provides two types of services:
1. Connectionless
2. connection-oriented services.
• A connection-oriented transport layer protocol will establish a connection i.e. virtual path
between sender and receiver.
• A connectionless transport protocol will treat each of the packets independently. There is no
connection between them.
4. Packetizing
• The transport layer creates packets with the help of encapsulation on the messages received from
the application layer. This is a process of dividing a long message into smaller ones. These packets
are then encapsulated into the data field of the transport layer packet. The headers containing
source and destination addresses are then added.
Duties and services of Transport Layer
• Congestion Control and QoS (quality of service)
• The congestion can take place in the data link, network, or transport layer. But the effect of
congestion is generally enhanced in the transport layer. The transport layer enhances the QoS
provided by the network layer.
Process to Process Delivery
• While Data Link Layer requires the MAC address (48 bits address contained inside the Network
Interface Card of every host machine) of source-destination hosts to correctly deliver a frame and
Network layer requires the IP address for appropriate routing of packets , in a similar way
Transport Layer requires a Port number to correctly deliver the segments of data to the correct
process amongst the multiple processes running on a particular host.
• A port number is a 16 bit address used to identify any client-server program uniquely.
Addressing in Transport Layer
• At the data link layer we need a MAC address, at the network layer we need to use an IP address.
A datagram uses the destination IP address to deliver the datagram and uses the source IP
address for the destination’s reply.
• At the transport layer, a transport layer address called a port number is required to be used to
choose among multiple processes running on the destination host.
• The destination port number is required to make the packet delivery and the source port number
is needed to return back the reply.
• The client program identifies itself with a port number that is chosen randomly. This number is
called as ephemeral port number .
• The server process should also identify itself with a port number but this port number can not be
chosen randomly. The Internet uses universal port numbers for servers and these numbers are
called as well known port numbers.
• Every client process knows the well-known port numbers of the pre-identified server process.
Addressing in Transport Layer
Addressing in Transport Layer
• IP Address and Port Number:
• The destination IP address is used for defining a particular host among the millions of hosts
(individual machines) in the world.
• After a particular host is selected, the port number is used for identifying one of the processes on
this selected host.
• The port numbers are divided into three ranges by IANA (International Assigned Number
Authority). The ranges are as follows :
1. Well known ports (The ports from 0 to 1023 are known as well known ports. They are assigned as
well as controlled by lANA)
2. Registered ports (The ports from 1024 to 49,151 are neither controlled nor assigned by lANA. We
can only register them with lANA to avoid duplication)
3. Dynamic or private ports (The ports from 49,152 to 63,535 are known as dynamic ports and they
are neither controlled nor registered. They can be used by any process)
Multiplexing and Demultiplexing
• Multiplexing :
• At the sending end, there are several processes that are interested in sending packets. But there
is only one transport layer protocol (UDP or TCP). Thus it is a many processes-one transport layer
protocol situation. Such a many-to-one relationship requires multiplexing.
• The protocol first accepts messages from different processes. These messages are separated from
each other by their port numbers. Each process has a unique port number assigned to it. Then the
transport layer adds a header and passes the packet to the network layer .
• Demultiplexing:
• At the receiving end, the relationship is one as to many. So we need a demultiplexer. First the
transport layer receives datagram packets from the network layer. The transport layer then checks
for errors and drops the header to obtain the messages and delivers them to the appropriate
process based on the port number.
Multiplexing and Demultiplexing
Connection Oriented & Connectionless
Services
1. Connection Oriented Services:
• The Connection-oriented services, as the name suggests establishes a dedicated connection
between the users before data is exchanged.
• The establishment of connection may take place on the physical level or logical level and needs
some kind of signalling.
• This type of connection establishment needs some form of resource reservation (such as
bandwidth).
• After the connection establishment, the actual data transfer will take place.
• After the exchange of data, the connection is cleared or broken(terminated).
• The best-known example of a connection-oriented service is the telephone network.
Connection Oriented & Connectionless
Services
2. Connectionless Services:
• Now, the Connectionless type of service does not require a connection to be established in order
to exchange data.
• Instead, information is transferred by using independent data units.
• Each data unit contains the complete destination address. This is analogous to the postal mailing
service.
• This connectionless service can exchange data without setting an explicit communication path or
connection.
• The packets are not numbered. They can get delayed, lost, or can arrive out of sequence.
• There is no acknowledgement, UDP is a connectionless protocol.
Connection Oriented & Connectionless
Services
Reliability at Transport Layer
• Transport Layer services can be of 2 types:
1. Reliable services:
• If the application layer program needs reliability then the reliable transport layer protocol is
used which implements the flow and error control at the transport layer. But this services will
be slow and more complex.
• TCP is connection oriented and reliable protocol.
2. Unreliable services:
• But some application layer program do not need reliability because they have their own flow
and error control mechanisms. Such programs are an unreliable service.
• UDP is connectionless and unreliable protocol.
Quality of Service
1. Connection Establishment Delay
• Source-to-destination delay is a flow characteristic. Again applications can tolerate delay in
different degrees. In this case, telephony, audio conferencing, video conferencing, and remote
login basically need a minimum delay, while delay in file transfer or e-mail is less important.
• The time difference mainly between the instant at which a transport connection is requested and
the instant at which it is confirmed is called connection establishment delay. The shorter the
delay the better the quality of service (qos).
2. Connection Establishment Failure Probability
• It is the probability that a connection is not established even after the maximum connection
establishment delay. This can be due to network congestion, lack of table space, or some other
problems.
Quality of Service
3. Throughput
• It mainly measures the number of bytes of user data transferred per second, measured over
some time interval. It is measured separately for each direction.
• Different applications need different bandwidths. In video conferencing, we need to send millions
of bits per second to refresh a color screen while the total number of bits in an e-mail may not
reach even a million.
4. Transit Delay
• It is the time between a message being sent by the transport user on the source machine and its .
being received by the transport user in the destination machine.
5. Residual Error Ratio
• It measures the number of lost or distorted messages as a fraction of the total messages sent.
Ideally, the value of this ratio should be zero and practically it should be as small as possible.
Quality of Service
6. Priority
• This parameter provides a way for the user to show that some of its connections are more
important (have higher priority) than the other ones.
• This is important while handling congestion. Because the higher priority connections should get
service before the low priority connections.
7. Resilience
• Due to internal problems or congestion, the transport layer spontaneously terminates a
connection. The resilience parameter gives the probability of such a termination .
8. Reliability
• Lack of reliability means losing a packet or acknowledgment(being sent on its successful reach to
destination), which entails retransmission.
• However, the sensitivity of any application programs to reliability is not the same. for e.g file
transfer and email service require reliable service unlike telephone or audio conferencing.
Quality of Service
9. Jitter
• Jitter is the variation in delay for packets associated with the same flow. For applications such as
audio and video applications, it does not matter if the packets arrive with a short or long delay as
long as the delay is the same for all packets.
Transport Service Primitive
• A service is specified by a set of primitives. A primitive means operation. To access the service a
user process can access these primitives. These primitives are different for connection oriented
service and connectionless service.
• There are five types of service primitives:
• LISTEN : When a server is ready to accept an incoming connection it executes the LISTEN
primitive. It blocks waiting for an incoming connection.
• CONNECT : It connects the server by establishing a connection. Response is awaited.
• RECIEVE: Then the RECIEVE call blocks the server.
• SEND : Then the client executes SEND primitive to transmit its request followed by the execution
of RECIEVE to get the reply. Send the message.
• DISCONNECT : This primitive is used for terminating the connection. After this primitive one can’t
send any message. When the client sends DISCONNECT packet then the server also sends the
DISCONNECT packet to acknowledge the client. When the server package is received by client
then the process is terminated.
Transport Service Primitive
• TPDU:
• The message sent from transport entity to transport entity is called as Transport Protocol Data
Unit or TPDU.
• Nesting of TPDU, Packets and Frames:
Transport Service Primitive
• Nesting of TPDU, Packets and Frames:
• a. To start with, the server executes a LISTEN primitive, typically by calling a library procedure that
makes a system call to block the server until a client turns up.
• b. For lack of a better term, we will reluctantly use the some what ungainly acronym
TPDU(Transport Protocol Data Unit) for message sent from transport entity to transport entity.
• c. Thus, TPDUs(exchanged by the transport layer) are contained in packets(exchanged by the
network layer).
• d. In turn, packets are contained in frames(exchanged by the data link layer).
• e. When a frame arrives, the data link layer processes the frame header and passes the contents
of the frame payload field up to the network entity.
• f. When a client wants to talk to the server, it executes a CONNECT primitive.
• g. The transport entity carries out this primitives by blocking the caller and sending a packet to
the server.
Transport Service Primitive
• Nesting of TPDU, Packets and Frames:
• h. Encapsulated in the payload of this packet is a transport layer message for the server’s
transport entity.
• i. The client’s CONNECT call causes a CONNECTION REQUEST TPDU to be sent to the server.
• j. When it arrives, the transport entity checks to see that the server is blocked on a LISTEN.
• k. It then unblocks the server and sends a CONNECTION ACCEPTED TPDU back to the client.
• l. When this TPDU arrives, the client is unblocked and the connection is established. Data can now
be exchanged using the SEND and RECEIVE primitives.
• m. In the simplest form, either party can do a(blocking)RECEIVE to wait for the other party to do a
SEND. When the TPDU arrives, the receiver is unblocked.
• n. It can then process the TPDU and send a reply. As long as both sides can keep track of whose
turn it is to send, this scheme works fine.
• o. When a connection is no longer needed, it must be released to free up table space within the
two transport entities.
Elements of Transport Protocol
• In order to implement the transport layer services between the two transport entity, we have to
use a transport Protocol.
• The transport protocols have to deal with the following tasks:
1. Error control
2. Sequencing
3. Flow Control
• The transport protocols are similar to the data link protocol in many ways but there are some
dissimilarities as well.
Elements of Transport Protocol
• At datalink layer two router communicate directly via a physical
channel as show in fig (i), where as the transport layer the physical
channel is replaced by the entire subnet as show in fig. (ii)

(i) (ii)
Elements of Transport Protocol
• The difference between Data link layer and transport layer
SR no Datalink Layer Transport Layer

1. Communication is through a physical Communication is through a Subnet.


channel.
2. It is not necessary to specify the destination Explicit addressing of destination is essential.
router.
3. Establishing a connection is simple. Initial connection establishment is more
complicated.
4. No storage capacity. There is some storage capacity in the subnet.

5. No additional delay. Delay is introduced due to the storing capacity


of subnet.
6. Different approaches are used for buffering and flow control by the two layers.
Elements of Transport Protocol
• Following are some of the important elements of transport protocol:
1. Addressing
2. Establishing a connection
3. Releasing a connection
4. Flow control and buffering
5. Multiplexing
6. Crash recovery
Connection Oriented services
• Connection Establishment:
• Following steps are taken to establish a connection:
1. Host A sends a connection request packet to host B. This contain the initialisation information
about data from A to B.
2. Host B sends the packet of acknowledgement to confirm that it has received the request from
A.
3. Host B sends a connection request to A along with the initialisation information about traffic
from B to A.
4. Host A sends a packet od Acknowledgement to confirm that it has received the request from B.
Note: each connection request must have a sequence number which is helpful in recovering from
the loss or duplication of the packet. Each acknowledgement also should have an acknowledgement
number.
Connection Oriented services
• Tree way handshaking technique:
• Note: The delay duplicate packets problem solved by three way handshaking technique.
Connection Oriented services
• Tree way handshaking technique:
• Step 1 (SYN) : In the first step, client wants to establish a connection with server, so it sends a
segment with SYN(Synchronize Sequence Number) which informs server that client is likely to
start communication and with what sequence number it starts segments with
• Step 2 (SYN + ACK): Server responds to the client request with SYN-ACK signal bits set.
Acknowledgement(ACK) signifies the response of segment it received and SYN signifies with what
sequence number it is likely to start the segments with
• Step 3 (ACK) : In the final part client acknowledges the response of server and they both establish
a reliable connection with which they will start the actual data transfer
Connection Oriented services
• Tree way handshaking technique:
• Operation in the abnormal circumstances:
Connection Oriented services
• Tree way handshaking technique:
• Duplicate CR and duplicate ACK:
Connection Oriented services
• Connection Release:
Connection Oriented services
• Connection Release:
• Type of connection release:
1. Asymmetric Release: When one party stops communicating the connection is broken. It an
abrupt release and it may lead to loss of data.
2. Symmetric Release: It treats the connection as two separate unidirectional connections and in
order to release the connection each side must release the connection on its side.

Das könnte Ihnen auch gefallen