Lab 6
Lab 6
There are four fields in the header of UDP. Their Names are as Follows,
Source Port, Destination Port, Length, Checksum.
Task 2
The size of each field is 16 bit.
Task 3
Length: A 16-bit field that specifies the length of the UDP header and the data in bytes
To verify this claim we can inspect the Length field in the UDP header of the captured packet, we can see
that the value is equal to the total length of the UDP datagram in bytes, including the header and the
data. We can confirm this by comparing the value in the Length field to the length of the entire UDP
packet. the Length field value is 41, which matches the total length of the UDP packet, including the 8-
byte header and the 33-byte data payload.
Task 4
The maximum number of bytes that can be included in a UDP payload is 65,507 bytes. However, If the
length field of a UDP packet has a value of 41 then the maximum number of bytes that can be included
in a UDP payload with a length field value of 41 is 33 bytes.
Task 5
The largest possible source port number in UDP is 65,535 (2^16 - 1), as the source port field in the UDP
header is a 16-bit field, allowing for port numbers between 0 and 65,535.
Task 6
The protocol number for UDP is 17. This value is found in the Protocol field of the IP datagram that
contains the UDP segment.
The Protocol field in the IP header is an 8-bit field that identifies the protocol used in the data portion of
the IP datagram. The value 17 in the Protocol field indicates that the data portion of the IP datagram
contains a UDP segment.
In hexadecimal notation, the value of the Protocol field for UDP is 0x11. In decimal notation, the value is
17.
Task 7
In a typical client-server communication scenario using UDP, when a client sends a UDP packet to a
server, the server typically responds with a UDP packet that is a reply to the client's first packet. The
source port number in the first packet will be the destination port number in the second packet, and vice
versa.
Here is an example of a pair of UDP packets captured in Wireshark in which the first packet is sent by the
client (source IP address: 192.168.1.101, source port number: 58029) and the second packet is a reply to
the first packet sent by the server (destination IP address: 192.168.1.101, destination port number:
58029).
the source port number in the first packet (58029) is the destination port number in the second packet,
and the destination port number in the first packet (9000) is the source port number in the second
packet (9000).
This relationship between the port numbers in the two packets ensures that the server knows which
client sent the request and can send the reply back to the correct client.