Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
com
JNTUWORLD
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.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
If a transport entity is informed halfway through a long transmission that its n/w
connection has been abruptly terminated, with no indication of what has happened to the data
currently in transit, it can set up a new network connection to the remote transport entity. Using
this new n/w connection, it can send a query to its peer asking which data arrived and which did
not, and then pick up from where it left off. Lost packets and mangled data can be detected and
compensated by transport layer.
With transport layer, it is possible for application programs to be written using a standard
set of primitives and to have these programs work on a wide variety of networks, without having
to worry about dealing with different subnets interfaces and unreliable transmission. i.e. it forms
the major boundary between the Transport Service Provider (the upper 4 layers) and the
Transport Service User(the upper layer(s)).
(ii). Quality Of Service: The primary function of transport layer is to enhance the QOS provided by
the n/w layer. The transport user specifies all these QOS parameters where a connection is
requested. These are specified by the transport user when a connection is requested. Both the desired
and minimum acceptable values can be given. If these are unachievable, the transport layer informs
the caller that the connection attempt failed, (without even contacting the destination) along with
failure reasons. QOS can be characterized by a number of specific parameters such as:
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Throughput.
Transit delay.
Protection.
Priority.
Resilience.
The Throughput parameter measures the number of bytes of user data transferred per
second, measured over some time interval.
The Transit Delay measures the time between a message being sent by the transport user
or the source machine and it is being received by the transport user on the destination
machine.
The residual error ratio measures the number of lost or garbled messages as a fraction
of the total sent.
The protection parameter provides a way for the transport user to specify interest in
having the transport layer provide protection against unauthorized third parties (wire
tappers) reading or modifying the transmitted data.
The resilience parameter gives the probability of the transport layer itself spontaneously
terminating a connection due to internal problems or congestion.
The priority parameter provides a way for the transport user to indicate that some of its
connections are made important than others and in the event of congestion, to make sure
that high-priority connections get serviced before the low-priority ones.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
OPTION NEGOTIATION:
If the transport layer achieve the desired goal, but can achieve a lower, but still
acceptable rate, it then informs the remote machine about this and asks for connection
establishment. If the remote machine cannot handle the proposed value, but it can handle a value
above the minimum, it permits. If it cannot handle any value above the minimum, it rejects the
connection attempt. Finally, the originating transport user is informed of whether the connection
was established, the values of parameters agreed upon. This process is called Option
Negotiation.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
5. When a connection is no longer needed, it must be released to free up table space with in
the 2 transport entries, which is done with DISCONNECT primitive by sending
DISCONNECTION REQUEST TPDU. This disconnection can b done either by
asymmetric variant (connection is released, depending on other one) or by symmetric
variant (connection is released, independent of other one).
Berkely Sockets: These primitives are socket primitives used in Berkely UNIX for TCP.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
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:
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Fig-(a)
Fig-(b)
Fig-(c)
duplicate CONNECTION
CONNECTION REQUEST
CONNECTION ACCEPTED
CONNECTION ACCEPTED
number y or
acknowledgements to y are
duplicate.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Fig-(a)
Fig-(b)
Fig-(c)
Fig-(d)
Initial process is
If the second
Same as in fig-( c)
DR is lost, the
way as in fig-(a).
user initiating
repeated attempts to
the
retransmit the DR
disconnection
are assumed to be
situation is saved
by the timer.
the expected
TPDUs. After N
response, and
expired, the
connection.
connection is
releases the
released.
again.
connection.
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
(v). Multiplexing:
In networks that use virtual circuits with in 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:
1. Up-ward multiplexing: In the below figure, all the 4 distinct transport connections use the
same network connection to the remote host. When connect time forms the major component
of the carriers bill, it is up to the transport layer to group port connections according to their
destination and map each group onto the minimum number of port connections.
2. Down-ward multiplexing:
If too many transport connections are mapped onto the one network connection, the
performance will be poor.
If too few transport connections are mapped onto one network connection, the service
will be expensive.
The possible solution is to have the transport layer open multiple connections and distribute the
traffic among them on round-robin basis, as indicated in the below figure:
With k network connections open, the effective band width is increased by a factor of k.
10
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
No TPDUs outstanding, SO
( UDP)
11
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Eg:
Urgent data is another feature of TCP in which the sending application puts some control
information in the data stream when an interactive user hits the DEL or CTRL-C key to break off
a remote computation that has already begun, and gives it to TCP along with URGENT flag.
This event causes TCP to stop accumulating data and transmit everything it has for that
connection immediately.
When the urgent data are received at the destination, the receiving application is
interrupted and reads the data stream to find the urgent data.
12
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Sockets:
A socket may be used for multiple connections at the same time. In other words, 2 or
more connections may terminate at same socket. Connections are identified by socket identifiers
at same socket. Connections are identified by socket identifiers at both ends. Some of the sockets
are listed below:
Ports: Port numbers below 256 are called Well- known ports and are reserved for standard
services.
Eg:
PORT-21
PORT-23
Every byte on a TCP connection has its own 32-bit sequence number, used both for
acknowledgement and window mechanism. The sending and receiving TCP entities exchange
data in the form of segments [20 byte header + optional part] followed by zero or more data
bytes] segments can be united or splitted, by the TCP s/w accordingly, based on 2 limits:
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
TCP at the design time must deal with different problems like:
Since segments can be fragmented, it is possible that part of a transmitted segment arrives
and is acknowledged, while the rest is lost.
Segments can also arrive out of order
Segments can also be delayed so long in transit that the sender times out and retransmits
them
If retransmitted segment takes other route than the original and reaches the receiver,
duplicates must be differentiated from the original ones.
Segments may occasionally hit congested networks along its path.
c). The TCP Segment Header:
Every segment begins with a fixed-format 20 byte header followed by header options. Then
follows, up to 65,535-20-20=65,515 data bytes if any.
14
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Meaning
Connection reply
SERVER
CLIENT
15
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
16
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
17
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Now the receiver will advertise a window of 2048 as it has only 2048 of buffer space, now.
4.
Now the sender transmits another 2048 bytes which are acknowledged, but the advertised
window is0.
5. The sender must stop until the application process on the receiving host has removed some
data from the buffer, at which time TCP can advertise a layer window.
Initially the TCP buffer on the receiving side is full and the sender knows this(win=0)
Then the interactive application reads 1 character from tcp stream.
Now, the receiving TCP sends a window update to the sender saying that it is all right to
send 1 byte.
The sender obligates and sends 1 byte.
The buffer is now full, and so the receiver acknowledges the 1 byte segment but sets
window to zero. This behavior can go on forever.
18
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
TCP does to try to prevent the congestion from occurring in the first place in the following way:
When a connection is established, a suitable window size is chosen and the receiver
specifies a window based on its buffer size. If the sender sticks to this window size, problems
will not occur due to buffer overflow at the receiving end. But they may still occur due to
internal congestion with in the n/w. lets see this problem occurs.
Error!
In fig (a):
We see a thick pipe leading to a small- capacity receiver. As long as the sender
does not send more water than the bucket can contain, no water will be lost.
In fig (b): The limiting factor is not the bucket capacity, but the internal carrying capacity of the
n/w. if too much water comes in too fast, it will backup and some will be lost.
When a connection is established, the sender initializes the congestion window to the size
of the max segment in use our connection. It then sends one max segment .if this max segment is
acknowledged before the timer goes off, it adds one segment s worth of bytes to the congestion
window to make it two maximum size segments and sends 2 segments. As each of these segment
is acknowledged, the congestion window is increased by one max segment size. When the
congestion window is n segments, if all n are acknowledged on time, the congestion window
is increased by the byte count corresponding to n segments. The congestion window keeps
growing exponentially until either a time out occurs or the receivers window is reached.
19
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
The internet congestion control algorithm uses a third parameter, the threshold in
addition to receiver and congestion windows.
Karns Algorithm
Slow Start
Dynamic window sizing on congestion
Fast Retransmit
Window Management
Fast Recovery
RTT Variance estimation:
Also known as Jacobsons algorithm. This enables a TCP entity to adapt to changes in
round-trip time. Mean-deviation is used as a variation measure and the value is used as
input in the calculation of RTO as.
MDEV(x)
E [ |x-E(x)| ]
RTT(K+1)-ARTT(K)
Therefore
SRTT(K+1)
[(1-g)][SRTT(K)] + [G][RTT(K+1)]
SERR(K+1)
RTT(K+1) - SRTT(K)
SDEV(K+1)
[(1-h)][SDEV(K)] + [h][|SERR(K+1)|]
RTO(K+1)
SRTT(K+1) + [f][SDEV(K+1)]
Where SRTT is an exponentially smoothed estimate of RTT and the values of g, h, f are
given by g=1/8=0.125, h=1/4=0.25, f=2
20
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
RTO
q*RTO, which causes RTO to grow exponentially, with each retransmission this technique is
referred to as Binary Exponential Back-off where q=2
Karns algorithm:
1. Do not use the measured RTT for a retransmitted segment to update SRTT and SDEV
2. Calculate back-off RTO using equation RTO=q*RTO when a retransmission occurs.
3. Use the back-off RTO value for sending segments until an acknowledgement arrives
for a segment that has not been transmitted.
Slow Start:
JACOBSON recommended this procedure in which a congestion window is
defined which is measured in segments rather than octets. At any time, TCP transmission
is constrained by the following relationship.
Where
awnd =
awnd =
cwnd =
credit =
When a new connection is opened, the TCP entity initializes cwnd=1. Each time an
acknowledgement is received, the value of cwnd is increased by 1 up to some maximum value.
cwnd grows exponentially when the first ACK arrives, TCP opens cwnd=2 and can send 2
segments. When these 2 segments are acknowledged, TCP can send 4 segments and so on.
21
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Fast retransmit:
If a TCP entity receives a segment out of order, it must immediately issue an
ACK for the last in order segment that was received. TCP will continue to repeat this
ACK with each incoming segment until the missing segment arrives to plug the hole in
its buffer. When the hole is plugged, TCP sends a cumulative ACK for all of the in order
segments received so for when a source TCP receives a duplicate ACK, it is made to wait
to receive 3 duplicate ACKs to same segment. Retransmission takes place, if 4 ACKs are
not received by sender.
Fast recovery:
Retransmit the last segment, cut the cwnd in half and then proceed with the linear
increase of cwnd. This process can be explained as:
22
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
set
ssthresh
b.
c.
set
cwnd
cwnd/2
ssthresh+3
cwnd
3. For
cwnd >=
Limited transmit:
This algorithm calls for a TCP sender to transmit a new segment the following 3
conditions are must.
1. 2 consecutive duplicate acknowledgements are received
2. The destination TCP entitys advertised allows the transmission of the segment
3. The amount of outstanding data, after sending the new segment, would remain less
than or equal to cwnd+2
1.
acknowledged before the timer expires, the timer is stopped. If on the other hand, the timer goes
23
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
off before the acknowledgement comes in, the segment is retransmitted and the timer is started
again. The algorithm that constantly adjusts the time-out interval, based on continuous
measurements of n/w performance was proposed by JACOBSON and works as follows:
for each connection, TCP maintains a variable RTT, that is the best current estimate of the
round trip time to the destination inn question.
When a segment is sent, a timer is started, both to see how long the acknowledgement takes
and to trigger a retransmission if it takes too long.
If the acknowledgement gets back before the timer expires, TCP measures how long the
measurements took say M
It then updates RTT according to the formula
RTT = RTT + ( 1-
)M
Where = a smoothing factor that determines how much weight is given to
the old value. Typically, =7/8
Retransmission timeout is calculated as
D
D + ( 1-
) | RTT-M |
RTT
Timeout
RTT+(4*D)
Where
2. Persistence timer:
It is designed to prevent the following deadlock:
the receiver sends an acknowledgement with a window size of 0 telling the sender to wait
later, the receiver updates the window, but the packet with the update is lost
now both the sender and receiver are waiting for each other to do something
when the persistence timer goes off, the sender transmits a probe to the receiver
the response to the probe gives the window size
if it is still zero, the persistence timer is set again and the cycle repeats
if it is non zero, data can now be sent
3. Keep-Alive timer: When a connection has been idle for a long time, this timer may go off to
cause one side to check if other side is still there. If it fails to respond, the connection is
terminated.
24
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Source port, destination port: Identifies the end points with in the source and destination
machines.
UDP length: Includes 8-byte header and the data
UDP checksum: Includes the UDP header, the UDP data padded out to an even number o
Of bytes if need be. It is an optional field
AAL - 1
AAL 2
AAL 3
AAL 4
25
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Later, as the technical requirements for classes C&D were similar, they were combined into
AAL - 3/4. AAL - 5 was also defined to meet further requirements
Structure of AAL:
26
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Operation:
From the above figure, when a message comes into the AAL from the application, the
convergence sub layer may give it a header and/or trailer. The message is then broken up into
44-to-48 byte units, which are passed to the SAR sub layer. The SAR sub layer may add its own
header and trailer to each piece and pass them down to the ATM layer for transmission as
independent cells.
AAL - 1:
It is the protocol used for transmitting class-A traffic, that is real-time, constant bit rate,
connection-oriented traffic, such as uncompressed audio and video.
Bits are fed in by the application at a constant rate and must be delivered at the far end, at
the same constant rate, with a minimum of delay, jitter, and overhead.
The o/p is a stream of bits, with no message boundaries.
Missing cells are reported to the application
AAL-1 uses a Convergence & SAR sub layers, in which
Convergence sub layer: Detects lost and mis-inserted cells and also smoothes out incoming
traffic to provide delivery of cells at a constant rate. Finally, it breaks up the i/p messages into
46 or 47 byte units and are given to SAR for transmission. At the other end, it extracts these
and reconstructs the original input.
SAR sub layer: It has a protocol and 2 different formats are present for its cells.
27
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
Both formats begin with a 1-byte header containing a 3-bit cell sequence number, SN ( to
detect missing or mis-inserted cells).
This field is followed by a 3-bit sequence number protection, SNP, over the sequence
number to allow correction of single errors and detection of double errors in the sequence
field. It uses CRC with polynomial x3+x+1
An even parity bit covering the header byte further reduces the likelihood of a bad
sequence number sneaking in unnoticed
The p cells are used when message boundaries must be preserved
The pointer field is used to give offset of start of next message, and its range is 0 to 92
AAL - 2:
This protocol has been designed where message boundaries must be preserved so that the
start of the next full frame can be recognized, even in the presence of lost cells or bad data
like compressed audio or video.
It has a 1-byte header composing of SN(sequence no),which is used for numbering cells in
order to detect missing or mis-inserted cells and IT(information type) indicate that the cell is
the start, middle or end of the message.
The LI(length indicated)field tells how big the payload is, in bytes(<=45 bytes)
CRC field is a checksum over the entire cell, so errors can be detected
28
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
AAL - 3/4:
This protocol can be operate in 2 modes
1. stream mode, in which the boundaries are not preserved
2. message mode, in which the boundaries are preserved
it supports multiplexing, which allows multiple sessions from a single host to travel along
the same virtual circuit ( Eg: remote logins ) and be separated at the destination
It has both the convergence sub layer protocol and a SAR sub layer protocol ,in which
Convergence sub layer: messages come into this layer from application and are first padded
out to a multiple of 4 bytes then a header &trailer are attached.
CPI
Btag
BAsize
Payload ( 1 to 65,535bytes )
padding
Etag
CS header
Length 0 to 65535
CS trailer
CPI ( Common Part Indicator ): gives the message type and counting unit for the BA
size and length fields
B tag, E tag: used to frame messages and are incremented after each new message sent
by which lost or mis-inserted calls can be checked
BA size: used for buffer allocation i.e., tells the receiver to allocate how much bufferspace, for the message in advance of its arrival.
Length: gives the payload length again
SAR sub layer: the message from CS layer is received and chopped into 44-byte chunks
and inserted into payload of a cell whose format is
Error!
ST (Segment Type): used for message framing and indicates whether the cell begins a message,
is in the middle of a message, is the last cell of a message or is a small
(i.e., single cell) message.
29
www.jntuworld.com
www.jntuworld.com
JNTUWORLD
AAL - 5:
Because of the complexity & Inefficiency generated by 2 layers of protocol in AAL3/4, coupled
with short checksum led to the invention of SEAL ( Simple Efficient Adaptation Layer )
protocol i.e., AAL-5.
It offers unreliable service, with options to have cells with checksum errors either
discarded or passed to the application any way
It offers reliable service, with few control to prevent over sums
It supports 2 modes:
Stream mode
It has both a Convergence Sub layer Protocol and SAR Sub layer Protocol in which,
CS protocol: Receives message from the application and adds a trailer (8-byte) the
amount of padding ( < +47bytes )is chosen to make the entire message, including the
padding and trailer, be a multiple of 48 bytes. It doesnt have any header.
Payload(1to65,535bytes)
UU
Length
30
www.jntuworld.com
CRC
www.jntuworld.com
JNTUWORLD
UU(User- to-User): available for a CS-service specific sub layer for its own purpose
Eg: sequencing or multiplexing
Length: tells how long the true payload is, in bytes. A value of 0 is used to abort the
current message mid stream.
CRC: standard 32-bit checksum over the entire message
SAR sub layer : The message from CS, along with trailer is received and is breaked into
48-bytes units, each passed to ATM layer for transmission. PTI field is
set, if message boundaries are to be preserved.
Advantages of AAL-5:
Great efficiency.
Longer checksum calculates lost, mis-inserted or missing cells without using seq. numbers.
31
www.jntuworld.com