0% found this document useful (0 votes)
2 views

lecture4-1

The document discusses the transport layer of networking, detailing its role in providing reliable data transport between processes on different machines, independent of the physical networks. It explains concepts such as transport entities, service providers, and users, as well as the types of transport services (connection-oriented and connectionless). Additionally, it covers connection establishment, release, flow control, and the elements of transport protocols, emphasizing the importance of addressing and error control in data transmission.

Uploaded by

Amna Ahmed
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)
2 views

lecture4-1

The document discusses the transport layer of networking, detailing its role in providing reliable data transport between processes on different machines, independent of the physical networks. It explains concepts such as transport entities, service providers, and users, as well as the types of transport services (connection-oriented and connectionless). Additionally, it covers connection establishment, release, flow control, and the elements of transport protocols, emphasizing the importance of addressing and error control in data transmission.

Uploaded by

Amna Ahmed
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/ 11

‫يسرى عبد الصاحب سيف الدين‬.‫د‬.

‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

Transport layer
The network layer provides end-to-end packet delivery using data-grams or virtual
circuits. The transport layer builds on the network layer to provide data transport from a process
on a source machine to a process on a destination machine with a desired level of reliability
that is independent of the physical networks currently in use. It provides the abstractions that
applications need to use the network.
Transport Entity: The hardware and/or software which make use of services provided by the
network layer, (within the transport layer) is called transport entity.
Transport Service Provider: Layers 1 to 4 are called Transport Service Provider.
Transport Service User: The upper layers i.e., layers 5 to 7 are called Transport Service User.
Transport Service Primitives: Which allow transport users (application programs) to access
the transport service.
TPDU (Transport Protocol Data Unit): Transmissions of message between 2 transport
entities are carried out by TPDU. The transport entity carries out the transport service
primitives by blocking the caller and sending a packet the service. Encapsulated in the payload
of this packet is a transport layer message for the server’s transport entity. The task of the
transport layer is to provide reliable, cost-effective data transport from the source machine to
the destination machine, independent of physical network or networks currently in use.

Figure 1.
Services Provided to the Upper Layers
The ultimate goal of the transport layer is to provide efficient, reliable, and cost-
effective data transmission service to its users, normally processes in the application layer. To
achieve this, the transport layer makes use of the services provided by the network layer. The
software and/or hardware within the transport layer that does the work is called the transport
entity. The transport entity can be located in the operating system kernel, in a library package
bound into network applications, in a separate user process, or even on the network interface
card.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

Figure 2. The network, Application and transport layer


There are two types of network service
 Connection-oriented
 Connectionless
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.
 Addressing and flow control are also similar in both layers. Furthermore, the
connectionless transport service is also very similar to the connectionless network
service.
 The bottom four layers can be seen as the transport service provider, whereas the
upper layer(s) are the transport service user.
Transport Service Primitives
 To allow users to access the transport service, the transport layer must provide some
operations to application programs, that is, a transport service interface. Each
transport service has its own interface.
 The transport service is similar to the network service, but there are also some
important differences.
 The main difference is that the network service is intended to model the service
offered by real networks. Real networks can lose packets, so the network service is
generally unreliable.
 The (connection-oriented) transport service, in contrast, is reliable
As an example, consider two processes connected by pipes in UNIX. They assume the
connection between them is perfect. They do not want to know about acknowledgements, lost
packets, congestion, or anything like that. What they want is a 100 percent reliable connection.
Process A puts data into one end of the pipe, and process B takes it out of the other. A second
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

difference between the network service and transport service is whom the services are intended
for. The network service is used only by the transport entities. Consequently, the transport
service must be convenient and easy to use.

Consider an application with a server and a number of remote clients.


1. The server executes a “LISTEN” primitive by calling a library procedure that makes a
System call to block the server until a client turns up.
2. When a client wants to talk to the server, it executes a “CONNECT” primitive, with
“CONNECTION REQUEST” TPDU sent to the server.
3. When it arrives, the TE unblocks the server and sends a “CONNECTION ACCEPTED”
TPDU back to the client.
4. When it arrives, the client is unblocked and the connection is established. Data can now be
exchanged using “SEND” and “RECEIVE” primitives.
5. When a connection is no longer needed, it must be released to free up table space within the
2 transport entries, which is done with “DISCONNECT” primitive by sending
“DISCONNECTION REQUEST” TPDU. This disconnection can be done either by
asymmetric variant (connection is released, depending on other one) or by symmetric variant
(connection is released, independent of other one).

Figure 3. Nesting of TPDUs, packets, and frames


The term segment for messages sent from transport entity to transport entity.
 TCP, UDP and other Internet protocols use this term. Segments (exchanged by the
transport layer) are contained in packets (exchanged by the network layer).
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

 These packets are contained in frames(exchanged by the data link layer).When a


frame arrives, the data link layer processes the frame header and, if the destination
address matches for local delivery, passes the contents of the frame payload field up
to the network entity.
 The network entity similarly processes the packet header and then passes the contents
of the packet payload up to the transport entity.

Figure 4. A state diagram for a simple connection management scheme. Transitions labelled
in italics are caused by packet arrivals. The solid lines show the client's state sequence. The
dashed lines show the server's state sequence.
In fig. 4 each transition is triggered by some event, either a primitive executed by the local
transport user or an incoming packet. For simplicity, we assume here that each TPDU is
separately acknowledged. We also assume that a symmetric disconnection model is used, with
the client going first. Please note that this model is quite unsophisticated. We will look at more
realistic models later on.
ELEMENTS OF TRANSPORT PROTOCOLS
The transport service is implemented by a transport protocol used between the two transport
entities. The transport protocols resemble the data link protocols. Both have to deal with error
control, sequencing, and flow control, among other issues. The difference transport protocol
and data link protocol depends upon the environment in which they are operated. These
differences are due to major dissimilarities between the environments in which the two
protocols operate, as shown in Fig. 5.
At the data link layer, two routers communicate directly via a physical channel, whether wired
or wireless, whereas at the transport layer, this physical channel is replaced by the entire
network. This difference has many important implications for the protocols.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

Figure .5 Figure (a) Environment of the data link layer. (b) Environment of the transport
layer.
In the data link layer, it is not necessary for a router to specify which router it wants to talk to.
In the transport layer, explicit addressing of destinations is required. In the transport layer,
initial connection establishment is more complicated, as we will see. Difference between the
data link layer and the transport layer is the potential existence of storage capacity in the subnet
Buffering and flow control are needed in both layers, but the presence of a large and
dynamically varying number of connections in the transport layer may require a different
approach than we used in the data link layer. The transport service is implemented by a
transport protocol between the 2 transport entities.

Figure 6. Illustrates the relationship between the NSAP, TSAP and transport connection.
Application processes, both clients and servers, can attach themselves to a TSAP to establish
a connection to a remote TSAP.
These connections run through NSAPs on each host, as shown. The purpose of having TSAPs
is that in some networks, each computer has a single NSAP, so some way is needed to
distinguish multiple transport end points that share that NSAP.
The elements of transport protocols are:
1. ADDRESSING
2. Connection Establishment.
3. Connection Release.
4. Error control and flow control
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

5. Multiplexing.
1. ADDRESSING
When an application (e.g., a user) process wishes to set up a connection to a remote application
process, it must specify which one to connect to. The method normally used is to define
transport addresses to which processes can listen for connection requests. In the Internet, these
endpoints are called ports. There are two types of access points.
TSAP (Transport Service Access Point) to mean a specific endpoint in the transport layer. The
analogous endpoints in the network layer (i.e., network layer addresses) are not surprisingly
called NSAPs (Network Service Access Points). IP addresses are examples of NSAPs.

Fig 7: TSAP and NSAP network connections


Application processes, both clients and servers, can attach themselves to a local TSAP to
establish a connection to a remote TSAP. These connections run through NSAPs on each host.
The purpose of having TSAPs is that in some networks, each computer has a single NSAP, so
some way is needed to distinguish multiple transport endpoints that share that NSAP.
A possible scenario for a transport connection is as follows:
1. A mail server process attaches itself to TSAP 1522 on host 2 to wait for an incoming call.
How a process attaches itself to a TSAP is outside the networking model and depends entirely
on the local operating system. A call such as our LISTEN might be used, for example.
2. An application process on host 1 wants to send an email message, so it attaches itself to
TSAP 1208 and issues a CONNECT request. The request specifies TSAP 1208 on host 1 as
the source and TSAP 1522 on host 2 as the destination. This action ultimately results in a
transport connection being established between the application process and the server.
3. The application process sends over the mail message.
4. The mail server responds to say that it will deliver the message.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

5. The transport connection is released.


2. CONNECTION ESTABLISHMENT:
With packet lifetimes bounded, it is possible to devise a fool proof way to establish connections
safely. Packet lifetime can be bounded to a known maximum using one of the following
techniques:
 Restricted subnet design
 Putting a hop counter in each packet
 Time stamping in each packet
Using a 3-way hand shake, a connection can be established. This establishment protocol
doesn’t require both sides to begin sending with the same sequence number.

Fig 8. Three protocol scenarios for establishing a connection using a three-way handshake.
CR denotes CONNEC TION REQUEST (a) Normal operation. (b) Old duplicate
CONNECTION REQUEST appearing out of nowhere. (c) Duplicate CONNECTION
REQUEST and duplicate ACK.
 The first technique includes any method that prevents packets from looping,
combined with some way of bounding delay including congestion over the longest
possible path. It is difficult, given that internets may range from a single city to
international in scope.
 The second method consists of having the hop count initialized to some appropriate
value and decremented each time the packet is forwarded. The network protocol
simply discards any packet whose hop counter becomes zero.
 The third method requires each packet to bear the time it was created, with the routers
agreeing to discard any packet older than some agreed-upon time.
In fig (A) Tomlinson (1975) introduced the three-way handshake.
 This establishment protocol involves one peer checking with the other that the
connection request is indeed current. Host 1 chooses a sequence number, x , and sends
a CONNECTION REQUEST segment containing it to host 2. Host 2replies with an
ACK segment acknowledging x and announcing its own initial sequence number, y.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

 Finally, host 1 acknowledges host 2’s choice of an initial sequence number in the first
data segment that it sends
In fig (B) the first segment is a delayed duplicate CONNECTION REQUEST from an old
connection.
 This segment arrives at host 2 without host 1’s knowledge. Host 2 reacts to this segment
by sending host1an ACK segment, in effect asking for verification that host 1 was
indeed trying to set up a new connection.
 When host 1 rejects host 2’s attempt to establish a connection, host 2 realizes that it
was tricked by a delayed duplicate and abandons the connection. In this way, a delayed
duplicate does no damage.
 The worst case is when both a delayed CONNECTION REQUEST and an ACK are
floating around in the subnet.
In fig (C) previous example, host 2 gets a delayed CONNECTION REQUEST and replies
to it.
 At this point, it is crucial to realize that host 2 has proposed using y as the initial
sequence number for host 2 to host 1 traffic, knowing full well that no segments
containing sequence number y or acknowledgements to y are still in existence.
 When the second delayed segment arrives at host 2, the fact that z has been
acknowledged rather than y tells host 2 that this, too, is an old duplicate.
 The important thing to realize here is that there is no combination of old segments that
can cause the protocol to fail and have a connection set up by accident when no one
wants it.
3. CONNECTION RELEASE:
A connection is released using either asymmetric or symmetric variant. But, the improved
protocol for releasing a connection is a 3-way handshake protocol. There are two styles of
terminating a connection:
1) Asymmetric release and
2) Symmetric release.
Asymmetric release is the way the telephone system works: when one party hangs up, the
connection is broken. Symmetric release treats the connection as two separate unidirectional
connections and requires each one to be released separately.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

4. FLOW CONTROL AND BUFFERING:


Flow control is done by having a sliding window on each connection to keep a fast transmitter
from over running a slow receiver. Buffering must be done by the sender, if the network service
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

is unreliable. The sender buffers all the TPDUs sent to the receiver. The buffer size varies for
different TPDUs.
They are:
a) Chained Fixed-size Buffers
b) Chained Variable-size Buffers
c) One large Circular Buffer per Connection
(a). Chained Fixed-size Buffers:
If most TPDUs are nearly the same size, the buffers are organized as a pool of identical size
buffers, with one TPDU per buffer.
(b). Chained Variable-size Buffers:
This is an approach to the buffer-size problem. i.e., if there is wide variation in TPDU size,
from a few characters typed at a terminal to thousands of characters from file transfers, some
problems may occur:
 If the buffer size is chosen equal to the largest possible TPDU, space will be wasted
whenever a short TPDU arrives.
 If the buffer size is chosen less than the maximum TPDU size, multiple buffers will
be needed for long TPDUs.
To overcome these problems, we employ variable-size buffers.
(c). One large Circular Buffer per Connection:
A single large circular buffer per connection is dedicated when all connections are heavily
loaded.
1. Source Buffering is used for low band width bursty traffic
2. Destination Buffering is used for high band width smooth traffic.
3. Dynamic Buffering is used if the traffic pattern changes randomly.
‫يسرى عبد الصاحب سيف الدين‬.‫د‬.‫م‬ ‫مادة الشبكات‬ ‫قسم علوم الحاسوب‬/ ‫كلية العلوم للبنات‬

Figure 9 (a) Chained fixed-size buffers. (b) Chained variable-sized buffers. (c) One large
circular buffer per connection.
5. MULTIPLEXING:
In networks that use virtual circuits within the subnet, each open connection consumes some
table space in the routers for the entire duration of the connection. If buffers are dedicated to
the virtual circuit in each router as well, a user who left a terminal logged into a remote
machine, there is need for multiplexing. There are 2 kinds of multiplexing:

Figure 10. (a) Upward multiplexing. (b) Downward multiplexing

You might also like