Professional Documents
Culture Documents
CH 23
CH 23
Transport
Layer
Protocols
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 3: Outline
24.1 INTRODUCTION
24.2 UDP
24.3 TCP
24.4 SCTP
Figure 24.1: Position of transport-layer protocols in the TCP/IP
protocol suite
24.3
24.24.1 Services
24.4
24.24.2 Port Numbers
24.5
Table 24.1: Some well-known ports used with UDP and TCP
24.6
24-2 UDP
24.7
24.2.1 User Datagram
24.9
24.2.2 UDP Services
24.10
24-3 TCP
24.11
24.3.1 TCP Services
d)Reliable Service
24.12
Figure 24.4: Stream delivery
Sending Receiving
process process
Stream of bytes
24.13
Figure 24.5: Sending and receiving buffers
Sending
process Receiving
process
Stream of bytes
• TCP need Buffers to store stream of bytes both at the sending process and the receiving process because
sending and receiving process may not write or read data at the same speed.
• These segments are encapsulated in the Packet at the Network Layer and
further passed to the Data Link Layer and the Physical Layer for the
24.15 transmission.
24.3.2 TCP Features
a) Byte Number b)Sequence Number
What TCP do when it receive the stream of Bytes from the Process.
TCP do the following tasks
a) It store the incoming bytes of data into Buffer.
b)TCP numbers all the data bytes by generating the random number between 0
and 2^ 32-1 for the number of First byte.
c) It group the bytes to create the Segment and assign the Sequence number to
each segment .
d) The sequence number of each segment is usually the number of the First
Byte.
24.16
Example 24.7
Suppose a TCP connection is transferring a file of 5,000
bytes. The first byte is numbered 10,001. What are the
sequence numbers for each segment if data are sent in five
segments, each carrying 1,000 bytes?
Solution
The following shows the sequence number for each
segment:
24.17
Acknowledgement Number
• TCP waits for the acknowledgement of the bytes that it send to the
receiver.
24.18
24.3.3 Segment
24.19
Figure 24.7: TCP segment format
24.20
Figure 24.8: Control field
24.21
Figure 24.9: Pseudoheader added to the TCP datagram
24.22
24.3.4 A TCP Connection
• TCP is connection-oriented.
24.23
Figure 24.10: Connection establishment using three-way handshaking
24.24
Figure 24.11: Data transfer
24.25
Figure 24.12: Connection termination using three-way handshaking
24.26
TCP uses a Sliding Window Protocol to handle the FlowControl.
We already see the concept of Sliding window in DataLink Flow Control where
the window is maintained both at the sender and the receiver side.
In Data Link the Window describes the Number of Frames than can be
simultaneously transmitted from the sender towards the receiver while in wait
for the Acknowledgement .
In Data link - Go Back n and Selective Repeat works on the concept of Sliding
Window. The size of the Window at the sender and the receiver remains fixed.
Go Back N : Sender window size is 2 k - 1.
Receiver window size is 1.
Selective Repeat: Sender window size is 2 k - 1.
Receiver window size is 2 k - 1.
But when we look the Sliding Window at the Transport Layer
The size of the TCP sliding window at the Transport Layer is variable.
In TCP we divide the data received from the Higher Layers into manageable
units called as Segments.
The Segments are Byte Oriented .
TCP assigns a sequence number to each segment. Usually the sequence
number is number given to the First Byte present in the segment.
Suppose a TCP connection is transferring a file of 5,000 bytes. The first byte is
numbered 10,001. What are the sequence numbers for each segment if data are
sent in five segments, each carrying 1,000 bytes?
Solution
The following shows the sequence number for each segment:
In TCP sliding window protocol the size of the sender
window depends upon two paramters
a) Receiver Window Size ( rwnd) which is advertised by
the receiver to sender for not overwhelming him.
b) Congestion Window Size(cwnd) which is determined by
the Network to avoid the Congestion.