Transport Layer TCP UDP SCTP 3 Way Handshake

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 45

Transport Layer

Process-to-Process Delivery:
UDP, TCP, and SCTP

23.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
23-1 PROCESS-TO-PROCESS DELIVERY

The transport layer is responsible for process-to-


process delivery—the delivery of a packet, part of a
message, from one process to another. Two processes
communicate in a client/server relationship, as we will
see later.
Topics discussed in this section:
Client/Server Paradigm
Multiplexing and Demultiplexing
Connectionless Versus Connection-Oriented Service
Reliable Versus Unreliable
Three Protocols
23.2
Note

The transport layer is responsible for


process-to-process delivery.

23.3
Figure 23.1 Types of data deliveries

23.4
Figure 23.2 Port numbers

23.5
Figure 23.3 IP addresses versus port numbers

23.6
Figure 23.4 IANA ranges

23.7
Figure 23.5 Socket address

23.8
Figure 23.6 Multiplexing and demultiplexing

23.9
Figure 23.7 Error control

23.10
Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite

23.11
23-2 USER DATAGRAM PROTOCOL (UDP)

The User Datagram Protocol (UDP) is called a


connectionless, unreliable transport protocol. It does
not add anything to the services of IP except to provide
process-to-process communication instead of host-to-
host communication.
Topics discussed in this section:
Well-Known Ports for UDP
User Datagram
Checksum
UDP Operation
Use of UDP
23.12
Table 23.1 Well-known ports used with UDP

23.13
Figure 23.9 User datagram format

23.14
Use of UDP

UDP is suitable for a process that requires simple request-response

communication with little concern for flow and error control. It is not

usually used for a process that needs to send bulk data.

UDP is suitable for a process with internal flow and error control

mechanisms.

UDP is a suitable transport protocol for multicasting. Multicasting

23.15
capability is embedded in the UDP software but not in the TCP software.
23-3 TCP

TCP is a connection-oriented protocol; it creates a


virtual connection between two TCPs to send data. In
addition, TCP uses flow and error control mechanisms
at the transport level.

Topics discussed in this section:


TCP Services
TCP Features
Segment
A TCP Connection
Flow Control
Error Control
23.16
Table 23.2 Well-known ports used by TCP

23.17
Figure 23.13 Stream delivery

23.18
Figure 23.14 Sending and receiving buffers

23.19
Figure 23.15 TCP segments

23.20
Note

The bytes of data being transferred in


each connection are numbered by TCP.
The numbering starts with a randomly
generated number.

23.21
Example 23.3

The following shows the sequence number for each


segment:

23.22
Note

The value in the sequence number field


of a segment defines the
number of the first data byte
contained in that segment.

23.23
Note

The value of the acknowledgment field


in a segment defines
the number of the next byte a party
expects to receive.
The acknowledgment number is
cumulative.

23.24
Figure 23.16 TCP segment format

23.25
Figure 23.17 Control field

23.26
Connection establishment using three-way handshaking

ACK, SYN and FIN Flag

23.27
Push Flag explanation
Push Flag explanation

To summarize, TCP's push capability accomplishes two things:

•The sending application informs TCP that data should be sent


immediately.

•The PSH flag in the TCP header informs the receiving host that the data
should be pushed up to the receiving application immediately.
URGENT Flag

The URG flag is used to inform a receiving station that certain data within

a segment is urgent and should be prioritized.

•If the URG flag is set, the receiving station evaluates the urgent pointer, a
16-bit field in the TCP header. This pointer indicates how much of the data

in the segment, counting from the first byte, is urgent.


Three way handshake in TCP

23.31
Connection establishment using three-way handshaking

23.32
Note

A SYN segment cannot carry data, but it


consumes one sequence number.

A SYN + ACK segment cannot


carry data, but does consume one
sequence number.

An ACK segment, if carrying no data,


consumes no sequence number.
23.33
Data transfer

23.34
Connection termination using three-way handshaking

23.35
SCTP
Stream Control Transmission Protocol (SCTP) is a new reliable,
message-oriented transport layer protocol. SCTP, however, is mostly
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), need a more sophisticated
service than TCP can provide. SCTP provides this enhanced
performance and reliability.

23.36
UDP is a message-oriented protocol. A process delivers a message to UDP, which
is encapsulated in a user datagram and sent over the network. UDP conserves the
message boundaries; each message is independent of any other message. This is a
desirable feature when we are dealing with applications such as IP telephony and
transmission of real-time data, as we will see later in the text. However, UDP is
unreliable; the sender cannot know the destiny of messages sent..
o TCP is a byte-oriented protocol. It receives a message or messages from a
process, stores them as a stream of bytes, and sends them in segments. There is no
preservation of the message boundaries. However, TCP is a reliable protocol. The
duplicate segments are detected, the lost segments are resent, and the bytes are
delivered to the end process in order. TCP also has congestion control and flow
control mechanisms.
o SCTP combines the best features of UDP and TCP. SCTP is a reliable message
oriented protocol. It preserves the message boundaries and at the same time detects
lost data, duplicate data, and out-of-order data. It also has congestion control and
flow control mechanisms.

23.37
SCTP Services
Before we discuss the operation of SCTP, let us explain the services offered by
SCTP to the application layer processes.

Multiple Streams
Each connection between a TCP client and a TCP server involves one single
stream. The problem with this approach 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; it is not when we are sending real-time data such as audio or
video. SCTP allows multi-stream 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.

23.38
Multihoming
A TCP connection involves one source and one destination IP address. This means that
even if the sender or receiver is a multihomed host (connected to more than one physical
address with multiple IP addresses), only one of these IP addresses per end can be utilized
during the connection. An SCTP association, on the other hand, supports multihoming
service. The sending and receiving host can define multiple IP addresses in each end for an
association. In this fault-tolerant approach, when one path fails, another interface can be
used for data delivery without interruption. This fault-tolerant feature is very helpful when
we are sending and receiving a real-time payload such as Internet telephony

23.39
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.

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.

Reliable Service
SCTP, like TCP, is a reliable transport protocol. It uses an acknowledgment mechanism
to check the safe and sound arrival of data.

23.40
SCTP Features
Transmission Sequence Number

Data transfer in SCTP is controlled by numbering the data chunks. SCTP uses a
transmission sequence number (TSN) to number the data chunks. In other words, the
TSN in SCTP plays the analogous role to the sequence number in TCP. TSNs are 32
bits long and randomly initialized between 0 and 232 - 1. Each data chunk must carry
the corresponding TSN in its header
Stream Identifier
In TCP, there is only one stream in each connection. In SCTP, there may be several
streams in each association. Each stream in SCTP needs to be identified by using a
stream identifier (SI). Each data chunk must carry the SI in its header so that when it
arrives at the destination, it can be properly placed in its stream

Stream Sequence Number


When a data chunk arrives at the destination SCTP, it is delivered to the appropriate
stream and in the proper order. This means that, in addition to an SI, SCTP defines
each data chunk in each stream with a stream sequence number (SSN).

23.41
23.42
Association Establishment

23.43
1.The client sends the first packet, which contains an INIT chunk.
2. The server sends the second packet, which contains an INIT ACK
chunk.
3. The client sends the third packet, which includes a COOKIE ECHO
chunk. This
is a very simple chunk that echoes, without change, the cookie sent by
the server.
SCTP allows the inclusion of data chunks in this packet.
4. The server sends the fourth packet, which includes the COOKIE ACK
chunk that
acknowledges the receipt of the COOKIE ECHO chunk. SCTP allows
the inclusion
of data chunks with this packet.

23.44
Association Termination
Association termination uses three packets,
Note that although the figure shows the case in which termination
is initiated by the client, it can also be initiated by the server. Note that there can
be several scenarios of association termination.

23.45

You might also like