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

Unit 5

Uploaded by

kabipip482
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Unit 5

Uploaded by

kabipip482
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 82

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

1. Inward data collection:


 Involves the periodic active or passive
sampling of data sources, such as
sensors, and automatic self-test reports
from security equipment or network
components.
 In a real-time monitoring situation, the
loss of an occasional data unit would
not cause distress, because the next
report should arrive shortly.
19.4
2. Outward data dissemination:
 Includes broadcast messages to network
users, the announcement of a new node or
the change of address of a service, and the
distribution of real-time clock values.
3. Request-response:
 Applications in which a transaction service
is provided by a common server to a
number of distributed users, and for which a
single request-response sequence is typical.
 Use of the service is regulated at the
application level, and lower-level
connections are often unnecessary and
cumbersome.
19.5
4. Real-time applications:
 Such as voice and telemetry, involving
a degree of redundancy and/or a real-
time transmission requirement.
 These must not have connection-
oriented functions such as
retransmission

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

TCP ( Transmission Control Protocol)

19.21
Position of TCP in TCP/IP protocol
suite

19.22
Figure 12-2

TCP versus IP

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


Figure 12-3

Port numbers

McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000


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.25
Figure 23.15 TCP
segments

23.26
Note

The bytes of data being transferred in


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

23.27
Example 23.3

The following shows the sequence number for each


segment:

23.28
Note

The value in the sequence number field


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

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

A SYN segment cannot carry data, but


it consumes one sequence number.

23.35
Note

A SYN + ACK segment cannot


carry data, but does consume one
sequence number.

23.36
Note

An ACK segment, if carrying no


data, consumes no sequence
number.

23.37
TCP 3 way Handshake Process

• The TCP (Transmission Control Protocol) connection


establishment follows a three-way handshake process to
ensure that both the client and the server are ready to
exchange data.
This three-step process is as follows:
Step 1: Client to Server (SYN):
• The client initiates the connection by sending a TCP segment with the SYN
(Synchronize) flag set to the server.
• The client also selects an initial sequence number (ISN) for this connection. This
sequence number is used to keep track of the order of the data sent and
received.
• The client also chooses an initial value for its receive window size, which
specifies the amount of data it can receive
TCP 3 way Handshake Process

Step 2: Server to Client (SYN-ACK):


•Upon receiving the initial SYN segment from the client, the
server acknowledges the receipt by sending back a TCP segment
with both the SYN and ACK (Acknowledgment) flags set.
•Similar to the client, the server also selects an initial sequence
number (ISN) for its side of the connection.
•The server also selects an initial value for its receive window
size, just like the client.
•The ACK flag indicates that the server is willing to accept data
from the client.
TCP 3 way Handshake Process

Step 3: Client to Server (ACK):


•The client acknowledges the receipt of the SYN-ACK from
the server by sending a TCP segment with the ACK flag set.
•This segment also acknowledges the server's initial
sequence number.
•At this point, both the client and server have confirmed that
they are ready to exchange data, and the connection is
established.
Data Transfer
• After this three-way handshake, the client and server can
start transmitting data in both directions.
• The TCP connection is now open and can be used for
data transfer.
• Additionally, each side of the connection continues to
increment its sequence numbers for data segments,
ensuring that data is delivered in the correct order and
can be reassembled at the receiving end.
Figure 23.19 Data
transfer

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

The FIN segment consumes one


sequence number if it does
not carry data.

23.46
Note

The FIN + ACK segment consumes


one sequence number if it
does not carry data.

23.47
23-4 SCTP

Stream Control Transmission Protocol (SCTP) is a


new reliable, message-oriented transport layer
protocol. however, is mostly designed for
SCTP, Internet
applications that have recently been
introduced. These new applications need a more
sophisticated service than TCP can
provide. Topics discussed in this section:
SCTP Services and Features
Packet Format
An SCTP Association
Flow Control and Error
Control
23.48
Note

SCTP is a message-oriented, reliable


protocol that combines the best features
of UDP and TCP.

23.49
Figure 23.27 Multiple-stream concept

23.50
Note

An association in SCTP can involve


multiple streams.

23.51
Figure 23.28 Multihoming concept

23.52
Note

SCTP association allows multiple IP


addresses for each end.

23.53
Note

In SCTP, a data chunk is


numbered using a
TSN.

23.54
Note

To distinguish between
different streams, SCTP
uses an SI.

23.55
Note

To distinguish between different data


chunks belonging to the same stream,
SCTP uses SSNs.

23.56
Note

TCP has segments; SCTP has packets.

23.57
Figure 23.29 Comparison between a TCP segment and an SCTP
packet

23.58
SCTP Working

Association Establishment: SCTP establishes an association between two


endpoints, much like a TCP connection. However, SCTP allows for multiple
streams within a single association, which enables parallel data transmission.

Reliable Data Transfer: SCTP ensures reliable data transfer by using


acknowledgments, retransmissions, and a sequence number mechanism
similar to TCP. However, it offers more flexibility in terms of handling out-of-
order delivery.
Message-Oriented: SCTP is message-oriented, meaning it preserves message
boundaries. Applications can send messages of various sizes, and SCTP
ensures that the message arrives intact and in the correct order at the receiver.
SCTP Working
Multi-Homing: SCTP supports multi-homing, which means an endpoint
can have multiple IP addresses. This feature enhances fault tolerance
and load balancing by allowing communication to continue if one IP
address becomes unreachable.

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.

Selective Acknowledgments (SACK): SCTP uses a SACK mechanism


that allows the receiver to inform the sender about the specific
chunks or segments that were received successfully. This feature
reduces the need for unnecessary retransmissions.
Congestion
Control and
Quality of Service

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.

Topics discussed in this section:


Traffic Descriptor Traffic Profiles

24.2
Figure 24.1 Traffic
descriptors

24.3
Figure 24.2 Three traffic
profiles

24.4
24-2 CONGESTION

Congestion in a network may occur if the load on the


network—the number of packets sent to the network—
is greater than the capacity of the network—the
number of packets a network can handle. Congestion
control refers to the mechanisms and techniques to
control the congestion and keep the load below the
capacity.

Topics discussed in this section:


Network Performance

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

Congestion control refers to techniques and


mechanisms that can either prevent congestion, before
it happens, or remove congestion, after it has
happened. In general, we can divide congestion
control mechanisms into two broad categories: open-
loop congestion control (prevention) and closed-loop
congestion control (removal).

Topics discussed in this section: Open-Loop Congestion


Control Closed-Loop Congestion Control

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

Quality of service (QoS) is an internetworking issue


that has been discussed more than defined. We can
informally define quality of service as something a
flow seeks to attain.

Topics discussed in this


section:
Flow Characteristics Flow Classes

24.23
Figure 24.15 Flow
characteristics

24.24
24-6 TECHNIQUESTOIMPROVEQoS

In Section 24.5 we tried to define QoS in terms of its


characteristics. In this section, we discuss some
techniques that can be used to improve the quality of
service. We briefly discuss four common methods:
scheduling, traffic shaping, admission control, and
resource reservation.
Topics discussed in this section:
Scheduling Traffic Shaping
Resource Reservation Admission Control

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

A leaky bucket algorithm shapes bursty


traffic into fixed-rate traffic by averaging
the data rate. It may drop the packets if
the bucket is full.

24.31
Note

The token bucket allows bursty traffic at


a regulated maximum rate.

24.32
Figure 24.21 Token bucket

24.33

You might also like