Unit 5
Unit 5
19.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Contents
Process to Process Communication, User
Datagram Protocol (UDP),
Transmission Control Protocol (TCP), SCTP
Congestion Control;
Quality of Service (QoS)
QoS improving techniques - Leaky Bucket
and Token Bucket algorithms
19.2
UDP
UDP provides a connectionless
service for application-level
procedures.
Thus, UDP is basically an unreliable
service; delivery and duplicate
protection are not guaranteed.
However, this does reduce the
overhead of the protocol and may be
adequate in many cases
19.3
Examples
19.6
UDP header
19.7
UDP Header
The header includes a source port
and destination port.
The Length field contains the length
of the entire UDP segment, including
header and data.
The checksum is the same algorithm
used for TCP and IP.
19.8
UDP Header
For UDP, the checksum applies to the
entire UDP segment plus a pseudo
header prefixed to the UDP header at the
time of calculation and which is the same
pseudo header used for TCP.
If an error is detected, the segment is
discarded and no further action is taken.
The Checksum field in UDP is optional. If
it is not used, it is set to zero.
19.9
UDP Operation
To send a message from one process to
another, the UDP protocol encapsulates
and decapsulates messages
19.10
Encapsulation
When a process has a message to send
through UDP, it passes the message to UDP
along with a pair of socket addresses and the
length of data.
UDP receives the data and adds the UDP
header.
UDP then passes the user datagram to IP with
the socket addresses.
IP adds its own header, using the value 17 in
the protocol field, indicating that the data has
come from the UDP protocol.
19.11
Encapsulation
The IP datagram is then passed to the
data link layer.
The data link layer receives the IP
datagram, adds its own header (and
possibly a trailer), and passes it to the
physical layer.
The physical layer encodes the bits into
electrical or optical signals and sends it
to the remote machine.
19.12
Decapsulation
When the message arrives at the destination
host, the physical layer decodes the signals
into
bits and passes it to the data link layer.
The data link layer uses the header (and the
trailer) to check the data. If there is no error,
the header and trailer are dropped and the
datagram is passed to IP.
The IP software does its own checking. If there
is no error, the header is dropped and the user
datagram is passed to UDP with the sender
and receiver IP addresses.
19.13
Decapsulation
The sender socket address is passed to
the process in case it needs to respond to
the message received.
UDP uses the checksum to check the
entire user datagram. If there is no error,
the header is dropped and the application
data along with the sender socket address
is passed to the process.
19.14
Queuing
In UDP, queues are associated with ports.
At the client site, when a process starts, it
requests a port number from the operating
system.
Some implementations create both an
incoming and an outgoing queue
associated with each process.
Other implementations create only an
incoming queue associated with each
process.
19.15
Queuing
19.16
Queuing
Even if a process wants to communicate with
multiple processes, it obtains only one port
number and eventually one outgoing and one
incoming queue.
The queues function as long as the process is
running.
When the process terminates, the queues are
destroyed.
19.17
Queuing
When a message arrives for a client, UDP checks
to see if an incoming queue has been created for
the port number specified in the destination port
number field of the user datagram.
If there is such a queue, UDP sends the received
user datagram to the end of the queue.
If there is no such queue, UDP discards the user
datagram and asks the ICMP protocol to send a
port unreachable message to the server
19.18
Multiplexing and Demultiplexing
In a host running a TCP/IP protocol suite, there is
only one UDP but possibly several processes that
may want to use the services of UDP. To handle
this situation, UDP multiplexes and multiplexes.
19.19
Typical Applications
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 such as FTP 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 capability is embedded in the UDP
software but not in the TCP software.
UDP is used for management processes such as SNMP.
UDP is used for some route updating protocols such as
Routing Information Protocol (RIP).
19.20
Transmission Control
Protocol
19.21
Position of TCP in TCP/IP protocol
suite
19.22
Figure 12-2
TCP versus IP
Port numbers
23.25
Figure 23.15 TCP
segments
23.26
Note
23.27
Example 23.3
23.28
Note
23.29
Note
23.30
Figure 23.16 TCP segment
format
23.31
Figure 23.17 Control
field
23.32
Table 23.3 Description of flags in the control
field
23.33
Figure 23.18 Connection establishment using three-way
handshaking
Note
23.35
Note
23.36
Note
23.37
TCP 3 way Handshake Process
23.42
Figure 23.20 Connection termination using three-way
handshaking
23.43
TCP Connection Termination
Step 1: Initiating Closure (Client to Server):
•The client, which wishes to terminate the connection, sends a TCP
segment with the FIN (Finish) flag set to the server.
•The FIN flag indicates that the client has no more data to send but is still
willing to receive data.
Step 2: Acknowledgment and Server Closure
(Server to Client):
• Upon receiving the FIN segment from the client, the server
acknowledges the receipt by sending an ACK (Acknowledgment)
segment back to the client.
• At this point, the server can still send data to the client, but it can no
longer accept data from the client.
• Once the server has finished sending any remaining data, it sends a
TCP segment with the FIN flag set to the client.
• This indicates that the server has no more data to send and is also
ready to terminate the connection.
TCP Connection Termination
Step 3: Final Acknowledgment (Client to Server):
•Upon receiving the FIN segment from the server, the client
acknowledges it by sending an ACK segment back to the
server.
•At this point, the client can no longer send data to the server,
but it can still receive any remaining data from the server.
Note
23.46
Note
23.47
23-4 SCTP
23.49
Figure 23.27 Multiple-stream concept
23.50
Note
23.51
Figure 23.28 Multihoming concept
23.52
Note
23.53
Note
23.54
Note
To distinguish between
different streams, SCTP
uses an SI.
23.55
Note
23.56
Note
23.57
Figure 23.29 Comparison between a TCP segment and an SCTP
packet
23.58
SCTP Working
Flow Control: SCTP provides a flow control mechanism that allows the
sender to adapt its transmission rate to the receiver's capacity,
preventing congestion and buffer overflow at the receiver.
24.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or
24-1 DATATRAFFIC
The main focus of congestion control and quality of
service is data traffic. In congestion control we try to
avoid traffic congestion. In quality of service, we try to
create an appropriate environment for the traffic. So,
before talking about congestion control and quality of
service, we discuss the data traffic itself.
24.2
Figure 24.1 Traffic
descriptors
24.3
Figure 24.2 Three traffic
profiles
24.4
24-2 CONGESTION
24.5
Figure 24.3 Queues in a
router
24.6
Figure Packet delay and throughput as functions of load
24.7
24-3 CONGESTIONCONTROL
24.8
Figure 24.5 Congestion control
categories
24.9
Figure 24.6 Backpressure method for alleviating
congestion
24.10
Figure 24.7 Choke packet
24.11
24-5 QUALITYOFSERVICE
24.23
Figure 24.15 Flow
characteristics
24.24
24-6 TECHNIQUESTOIMPROVEQoS
24.25
Figure 24.16 FIFO queue
24.26
Figure 24.17 Priority
queuing
24.27
Figure 24.18 Weighted fair
queuing
24.28
Figure 24.19 Leaky bucket
24.29
Figure 24.20 Leaky bucket
implementation
24.30
Note
24.31
Note
24.32
Figure 24.21 Token bucket
24.33