COMPUTER NETWORKS
MODULE 4
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
1
Transport Layer
Transport layer provides a process-to-process communication between two application layers, one at local host and other at the remote host
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
2
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
3
Transport Layer Services
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
4
Process to Process Communication
A process is an application-layer entity (running program) that uses the services of the transport layer.
A transport-layer protocol is responsible for delivery of the message to the appropriate process. � �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
5
Addressing: Port Numbers
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
6
If the computer at the server site runs a server process and assigns a random number as the port number, the process at the client site that wants to access that server and use its services will not know the port number.
Of course, one solution would be to send a special packet and request the port number of a specific server, but this creates more overhead. TCP/IP has decided to use universal port numbers for servers; these are called well-known port numbers. ��
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
7
Port Numbers
IP addresses versus port numbers
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
8
ICANN Ranges
Well-known ports. The ports ranging from 0 to 1023 are assigned and controlled by ICANN.
Registered Ports. The ports ranging from 1024 to 49,151 are not assigned or controlled by ICANN.
Dynamic Ports. The ports ranging from 49,152 to 65,535 are neither controlled nor registered. �� �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
9
Socket Addresses
The combination of an IP address and a port number is called a socket address. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
10
Encapsulation and Decapsulation
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
11
Encapsulation happens at the sender site. When a process has a message to send, it passes the message to the transport layer along with a pair of socket addresses and some other pieces of information, which depend on the transport-layer protocol. �
Decapsulation happens at the receiver site. When the message arrives at the destination transport layer, the header is dropped and the transport layer delivers the message to the process running at the application layer. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
12
Whenever an entity accepts items from more than one source, this is referred to as multiplexing (many to one); whenever an entity delivers items to more than one source, this is referred to as demultiplexing (one to many). �
Multiplexing and Demultiplexing
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
13
Flow Control
Whenever an entity produces items and another entity consumes them, there should be a balance between production and consumption rates. If the items are produced faster than they can be consumed, the consumer can be overwhelmed and may need to discard some items. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
14
Pushing or Pulling
If the sender delivers items whenever they are produced without a prior request from the consumer the delivery is referred to as pushing. If the producer delivers the items after the consumer has requested them, the delivery is referred to as pulling. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
15
Flow control at transport layer
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
16
Buffers
Flow control can be implemented by maintaining 2 buffers.
One at sending transport layer and the other at the receiving transport layer.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
17
Error Control
Error control at the transport layer is responsible for
1. Detecting and discarding corrupted packets.
2. Keeping track of lost and discarded packets and resending them.
3. Recognizing duplicate packets and discarding them.
4. Buffering out-of-order packets until the missing packets arrive. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
18
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
19
Sliding Window
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
20
Congestion Control
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 that control the congestion and keep the load below the capacity. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
21
Connectionless protocols
Connectionless and Connection-Oriented Protocols
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
22
Connection Oriented Protocols
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
23
FSM of Connectionless and Connection Oriented Service
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
24
Transport Layer Protocols
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
25
Go-Back N Protocol
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
26
Sequence Numbers
The sequence numbers are modulo 2^m, where m is the size of the sequence number field in bits.
Acknowledgment Numbers
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
27
Send Window
The send window is an imaginary box covering the sequence numbers of the data packets that can be in transit or can be sent.
In each window position, some of these sequence numbers define the packets that have been sent; others define those that can be sent. The maximum size of the window is 2^m − 1�
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
28
Sliding the send window
The figure shows how a send window can slide one or more slots to the right when an acknowledgment arrives from the other end. In the figure, an acknowledgment with ackNo = 6 has arrived. This means that the receiver is waiting for packets with sequence number 6. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
29
Receive Window
In Go-Back-N, the size of the receive window is always 1. The receiver is always looking for the arrival of a specific packet. Any packet arriving out of order is discarded and needs to be resent. �
The receive window is an abstract concept defining an imaginary box of size 1 with a single variable Rn. The window slides when a correct packet has arrived; sliding occurs one slot at a time.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
30
Timers
There can be a timer for each packet that is sent, in our protocol we use only
One. The reason is that the timer for the first outstanding packet always expires first. Resend all outstanding packets when this timer expires.
Resending packets
When the timer expires, the sender resends all outstanding packets.
For example, suppose the sender has already sent packet 6 (Sn = 7), but the only timer expires. If Sf = 3, this means that packets 3, 4, 5, and 6 have not been acknowledged; the sender goes back and resends packets 3, 4, 5, and 6. That is why the protocol is called Go-Back-N. On a time-out, the machine goes back N locations and resends all packets.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
31
FSM of Go-Back N
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
32
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
33
Send Window Size
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
34
Flow Diagram of Go-Back-N
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
35
Selective Repeat Protocol
Each time a single packet is lost or corrupted, the sender resends all outstanding packets, even though some of these packets may have been received safe and sound but out of order.
If the network layer is losing many packets because of congestion in the network, the resending of all of these outstanding packets makes the congestion worse, and eventually more packets are lost.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
36
The Selective-Repeat protocol allows as many packets as the size of
the receive window to arrive out of order and be kept until there is a set of consecutive packets to be delivered to the application layer.
Because the sizes of the send window and receive window are the same, all the packets in the send packet can arrive out of order and be stored until they can be delivered.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
37
Selective Repeat Protocol
Selective Repeat Protocol resend only selective packets
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
38
Send window for Selective-Repeat Protocol
The send window maximum size can be 2m−1. For example, if m = 4, the sequence numbers go from 0 to 15, but the maximum size of the window is just 8.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
39
Receive Window for Selective Repeat Protocol
The size of the receive window is the same as the size of the send window (maximum 2m−1). The Selective-Repeat protocol allows as many packets as the size of the receive window to arrive out of order and be kept until there is a set of consecutive packets to be delivered to the application layer.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
40
Timer
Selective-Repeat uses one timer for each outstanding packet. When a timer expires, only the corresponding packet is resent.
However, most transport-layer protocols that implement SR use only a single timer. For this reason, we use only one timer.�
Acknowledgments
In SR, an ackNo defines the sequence number of a single packet that is received safe and sound; there is no feedback for any other. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
41
FSM of Selective Repeat
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
42
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
43
Flow Diagram of SR
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
44
Piggybacking
piggybacking is used to improve the efficiency of the bidirectional protocols. When a packet is carrying data from A to B, it can also carry acknowledgment feedback about arrived packets from B; when a packet is carrying data from B to A, it can also carry acknowledgment feedback about the arrived packets from A. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
45
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
46
Introduction to Transport Layer Protocols
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
47
Services of Transport Layer Protocols
UDP
UDP is an unreliable connectionless transport-layer protocol used for its simplicity and efficiency in applications where error control can be provided by the application-layer process.
TCP
TCP is a reliable connection-oriented protocol that can be used in any application where reliability is important.
SCTP
SCTP is a new transport-layer protocol that combines the features of UDP and TCP �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
48
Port Numbers
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
49
The User Datagram Protocol (UDP) is a connectionless, unreliable transport protocol. It does not add anything to the services of IP except for providing process-to-process communication instead of host-to-host communication. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
50
User Datagram
UDP packets, called user datagrams, have a fixed-size header of 8 bytes made of four fields, each of 2 bytes (16 bits). �
UDP Packet Format
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
51
UDP Services
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
52
Process- to Process Communication
UDP provides process-to-process communication using socket addresses, a combination of IP addresses and port numbers. �
Connectionless Services
User datagram sent by UDP is an independent datagram.
There is no relationship between the different user datagrams even if they are coming from the same source process and going to the same destination program. The user datagrams are not numbered. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
53
Flow Control
UDP is a very simple protocol. There is no flow control, and hence no window mechanism. �
Error Control
There is no error control mechanism in UDP except for the checksum. This means that the sender does not know if a message has been lost or duplicated. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
54
Checksum
UDP checksum calculation includes three sections:
a pseudoheader,
the UDP header,
and the data coming from the application layer.
The pseudoheader is the part of the header of the IP packet in which the user datagram is to be encapsulated with some fields filled with 0s �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
55
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
56
Congestion Control
Since UDP is a connectionless protocol, it does not provide congestion control. UDP assumes that the packets sent are small and sporadic and cannot create congestion in the network.�
Encapsulation and Decapsulation
To send a message from one process to another, the UDP protocol encapsulates and decapsulates messages. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
57
Queuing
In UDP, queues are associated with ports �
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 demultiplexes. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
58
UDP Applications
UDP Features
Connectionless Service
UDP is a connectionless protocol.
Each UDP packet is independent from other packets sent by the same application program.
It is an advantage if, for example, a client application needs to send a short request to a server and to receive a short response.�
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
59
Lack of Error Control
UDP does not provide error control; it provides an unreliable service. Most applications expect reliable service from a transport-layer protocol �
Lack of Congestion Control
UDP does not provide congestion control. However, UDP does not create additional traffic in an error-prone network. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
60
Typical Applications
❑ UDP is suitable for a process that requires simple request-response communication
with little concern for flow and error control.
❑ UDP is suitable for a process with internal flow- and error-control mechanisms.
For example, the Trivial File Transfer Protocol (TFTP) process includes flow and
error control. It can easily use UDP.
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
61
❑ 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)
❑ UDP is normally used for interactive real-time applications that cannot tolerate
uneven delay between sections of a received message�
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
62
Transmission Control Protocol (TCP) is a connection-oriented, reliable protocol. TCP explicitly defines connection establishment, data transfer, and connection teardown phases to provide a connection-oriented service. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
63
TCP Services
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
64
Process-to-Process Communication
TCP provides process-to-process communication using port numbers. �
Stream Delivery Service
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
65
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
66
Sending & Receiving Buffers
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
67
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
68
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
69
Segments
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
70
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
71
Full-Duplex Communication
Multiplexing and Demultiplexing
Like UDP, TCP performs multiplexing at the sender and demultiplexing at the receiver.
However, since TCP is a connection-oriented protocol, a connection needs to be established for each pair of processes �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
72
Connection-Oriented Service
TCP, unlike UDP, is a connection-oriented protocol. When a process at site A wants to send to and receive data from another process at site B, the following three phases occur:
1. The two TCP’s establish a logical connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
73
Reliable Service
TCP is a reliable transport protocol. It uses an acknowledgment mechanism to check the safe and sound arrival of data. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
74
TCP Features
- Byte Number
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
75
Numbering System
Although the TCP software keeps track of the segments being transmitted or received, there is no field for a segment number value in the segment header. Instead, there are two fields, called the sequence number and the acknowledgment number. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
76
Byte Number
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
77
Sequence Number
After the bytes have been numbered, TCP assigns a sequence number to each segment that is being sent. The sequence number, in each direction, is defined as follows:
1. The sequence number of the first segment is the ISN (initial sequence number),
which is a random number.
2. The sequence number of any other segment is the sequence number of the previous
segment plus the number of bytes (real or imaginary) carried by the previous segment. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
78
Acknowledgment Number
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
79
Segment- TCP Segment Format
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
80
Source port address. This is a 16-bit field that defines the port number of the application program in the host that is sending the segment.
❑ Destination port address. This is a 16-bit field that defines the port number of the application program in the host that is receiving the segment.
Sequence number. This 32-bit field defines the number assigned to the first byte of data contained in this segment.
Acknowledgment number. This 32-bit field defines the byte number that the receiver of the segment is expecting to receive from the other party. If the receiver of the segment has successfully received byte number x from the other party, it returns x + 1 as the acknowledgment number. ���
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
81
Header length. This 4-bit field indicates the number of 4-byte words in the TCP header. The length of the header can be between 20 and 60 bytes.
Control. This field defines 6 different control bits or flags, ��
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
82
Window size. This field defines the window size of the sending TCP in bytes. The length of this field is 16 bits, which means that the maximum size of the window is 65,535 bytes �Checksum. This 16-bit field contains the checksum. The calculation of the checksum for TCP follows the same procedure as the one described for UDP. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
83
Urgent pointer. This 16-bit field, which is valid only if the urgent flag is set, is used when the segment contains urgent data. It defines a value that must be added to the sequence number to obtain the number of the last urgent byte in the data section of the segment.
Options. There can be up to 40 bytes of optional information in the TCP header. � �Encapsulation
A TCP segment encapsulates the data received from the application layer. The TCP segment is encapsulated in an IP datagram, which in turn is encapsulated in a frame at the data-link layer. �
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
/skit.org.in
/skit.org.in
/skit.org.in
Sri Krishna Institute of Technology
(Approved by AICTE, Accredited by NAAC, Affiliated to VTU, Karnataka)
12/5/2024
84