Ngondya 1
Ngondya 1
Protocols
Source port:
Uses 2 Bytes=16Bits
UDP port of the sending host.
The sending port value is optional.
If not used, it is set to zero.
Destination port:
Uses 2 Bytes=16Bits
UDP port of destination host.
T h i s p r o v i d e s a n e n d p o i n t f o r
communications.
Length:
Uses 2 Bytes=16Bits.
Refers to the size of the UDP message.
The minimum UDP packet contains only the
header information (8 bytes).
UDP length includes header and data.
UDP length = IP length – IP header’s
length
7/14/2021 4:32 AM TN211 CIVE 2018/19 21
UDP Header Format
Checksum:
Uses 2 Bytes=16Bits.
Verifies that the header is not corrupted.
The checksum value is optional in IPv4,
required in IPv6.
If not used, it is set to zero.
It is the same algorithm used for TCP and
IP.
7/14/2021 4:32 AM TN211 CIVE 2018/19 22
UDP Header Format
Checksum:
If an error is detected, the entire UDP
segment is discarded and no further action
is taken.
It is computed over message data, UDP
header, and pseudo-header–protocol
number and source and destination IP
addresses, plus TN211
7/14/2021 4:32 AM
UDP length.
CIVE 2018/19 23
Checksum Calculation of a Simple
UDP User Datagram
Name System
Overhead of connection establishment is
“12.3.4.15”
overkill
7/14/2021 4:32 AM TN211 CIVE
31 2018/19
UDP Case Studies
DHCP – Dynamic Host Configuration
Protocol
TCP
connection is impossible
We don't have an IP address yet!
TFTP
TCP implementation is too expensive
Boot code in BIOS...size is limited
Kerberos, Zephyr
Like DNS: many clients, request/response
pattern
T C P c o n n e c t iTN211
7/14/2021 4:32 AM
o nCIVEi 2018/19
s t o o e x p e n s i v e &34
UDP Case Studies
AFS - “Andrew File System” (or not)
Counts as “experimental transport
protocol”
In 1980's, many TCP implementations
had poor throughput
Easier to implement a similar protocol
than to fix kernels
Unclear what the “right” answer is
No connection state:
No allocation of buffers, parameters,
sequence #s, etc.
… making it easier to handle many active
clients at once.
Small packet header overhead:
UDP header is only eight-bytes long.
54
Sliding Window
TCP utilizes a sliding window when
determining transmission size.
A sliding window allows for devices to
negotiate a window size to allow for
more than one byte to be sent during
a single transmission.
This sliding window also allows the
destination device to indicate to the
source a need to decrease or increase
the amount of data being sent
because it is incapable at that time of
dealing with that much data.
Sliding Window..
The size of the window is the lesser of
receiver’s window and sender’s
window.
The source does not have to send a full
window’s worth of data.
The window can be opened or closed by
the receiver, but should not be shrunk.
The destination can send an
acknowledgment at any time as long as
it does not result in a shrinking
window.
The receiver can temporarily shut down
Sliding Window..
What is the value of the receiver window
(rwnd) for host A if the receiver, host B, has
a buffer size of 5000 bytes and 1000 bytes
of received and unprocessed data?
Solution
The value of rwnd = 5000 − 1000 = 4000.
Host B can receive only 4000 bytes of data
before overflowing its buffer. Host B
advertises this value in its next segment to
A.
What is the size of the window for host A
if the value of rwnd is 3000 bytes and the
value of sender’s window (cwnd) is 3500
bytes?
Solution
Sliding Window..
Sequencing Numbers
TCP applies sequence numbers to the data
segments it is transmitting so that the
receiver will be able to properly reassemble
the bytes in their original order.
Sequencing numbers indicate to the
destination device the correct order in
which to put the bytes when they are
received.
These sequencing numbers also act as
reference numbers so that the receiver will
know if it has received all of the data.
They also identify the missing data pieces
to the sender so it can retransmit the
missing data.
Sequencing Numbers..
This offers increased efficiency since the
sender only needs to re-transmit the
missing segments instead of the entire set
of data.
The value in the sequence number field of a
segment defines the number assigned to
the first data byte contained in that
segment.
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.
Read about Kevin Mitnick and Predictable
Sequencing Numbers..
Solution:
The following shows the sequence
number for each segment:
Protecting against
Wraparound
Relevance of the 32-bit sequence number
space.
The sequence number used on a given
connection might wraparound.
A byte with sequence number x could be
sent at one time, and then at a later time
a second byte with the same sequence
number x could be sent.
Packets cannot survive in the Internet for
longer than the Maximum Segment
Lifetime (MSL).
MSL is set to 120 sec.
We need to make sure that the sequence
Protecting against
Wraparound..
Positive ACK
Acknowledgement is a common step in the
synchronization process which includes
sliding windows and data sequencing.
TCP utilizes positive acknowledgment and
retransmission to control data flow and
confirm data delivery.
Positive acknowledgment and retransmission
(PAR) is a common technique many protocols
use to provide reliability.
With PAR, the source sends a packet, starts
a timer, and waits for an acknowledgment
before sending the next packet.
If the timer expires before the source
receives an acknowledgment, the source
retransmits the packet and starts the timer
TCP Header