Lec-70: UDP (User Datagram Protocol) header in Computer Networks in Hindi
Introduction to UDP
In this section, we will discuss the User Datagram Protocol (UDP), which is a connectionless protocol used in transport layer communication.
Connectionless Protocol
- UDP is a connectionless protocol, unlike TCP.
- It does not establish a connection before data transfer, similar to sending mail without making a phone call.
- Data is sent as individual datagrams without any guarantee of delivery or order.
Unreliable and No Ordering
- UDP is considered unreliable because it does not care about lost packets.
- There is no guarantee of packet ordering in UDP.
UDP Header
- The UDP header contains four main options:
- Source Port: Identifies the port number of the sender application.
- Destination Port: Identifies the port number of the receiver application. Both source and destination ports are mandatory for end-to-end delivery.
- Length: Represents the size of the segment in bits. The maximum length is 2^16 - 1 (65535).
- Checksum: Used for error detection during transmission.
Characteristics of UDP
This section explores the characteristics of UDP, including its unreliability and lack of ordering.
Unreliable Delivery
- UDP does not guarantee reliable delivery of packets.
- Lost packets are not retransmitted by default.
No Packet Ordering
- Packets can arrive out-of-order in UDP since there are no sequence numbers used for ordering.
Source Port and Length Fields
This section focuses on two fields in the UDP header, namely Source Port and Length.
Source Port
- The Source Port field identifies the port number used by the sender application.
- Ports range from 0 to 65535, with well-known ports (0-1023) and registered ports (1024-49151).
Length
- The Length field represents the size of the UDP segment in bits.
- The maximum length is 2^16 - 1 (65535), but the actual size can vary.
Understanding Length Field
This section provides a deeper understanding of the Length field in the UDP header.
Actual Size vs. Represented Size
- The Length field is represented by 16 bits, but it does not mean that the length itself is limited to 16 bits.
- The actual size can be up to 2^16 (65536).
Maximum Segment Size
This section discusses the maximum segment size in UDP.
Maximum Segment Size
- The maximum segment size in UDP is determined by the total length field.
- It can be up to 65535, which includes both header and payload.
Conclusion
In this video, we covered the basics of UDP, including its connectionless nature, unreliability, lack of ordering, and key fields in the UDP header.
Understanding Data Calculation and Checksum
In this section, the speaker explains how data calculation and checksum work in the context of UDP and TCP protocols.
Calculating Checksum
- The maximum value of data can be less than the header size of 8 bytes.
- The header is compulsory for sending data.
- Checksum is used for error control to detect errors in the data.
Pseudo Header of IP
- Pseudo header refers to a subset of values from the IP header used in network layer communication.
- Only fixed values, such as source and destination IP addresses, are included in the pseudo header.
Unique Hash Value
- Checksum acts like a hash value that represents a unique value for the data.
- Any changes in the data will result in a different hash value.
- By comparing the received hash value with the calculated one, errors in the data can be detected.
Reliability of UDP and TCP Protocols
This section discusses the reliability aspects of UDP and TCP protocols.
Unreliability of UDP
- UDP is an unreliable protocol that does not care about errors or lost packets.
- Packets can reach their destination through different paths, leading to potential packet loss.
Reliability of TCP
- TCP works on dial-up connections and establishes a connection path for all packets to follow.
- It ensures that packets do not take different paths, reducing packet loss compared to UDP.
Optional Checksum Field
- In IPv4, the checksum field is optional for UDP headers.
- However, it becomes mandatory in IPv6 protocol versions.
Key Values Used in UDP Header
This section highlights three key values commonly used in UDP headers.
Key Values in UDP Header
- Source port and destination port are essential fields in the UDP header.
- Other fixed values from the IP header, such as source and destination IP addresses, are also included.
- These values play a crucial role in UDP communication.