written 8.3 years ago by |
Features of UDP:
- Provides connectionless, unreliable service.
- So UDP faster than TCP.
- Adds only checksum and process-to-process addressing to IP.
- Used for DNS and NFS.
- Used when socket is opened in datagram mode.
- It sends bulk quantity of packets.
- No acknowledgment.
- Good for video streaming it is an unreliable protocol.
- It does not care about the delivery of the packets or the sequence of delivery.
- No flow control /congestion control, sender can overrun receiver's buffer.
- Real time application like video conferencing needs (Because it is faster).
- An UDP datagram is used in Network File System (NFS), DNS, SNMP, TFTP etc.
- It has no handshaking or flow control.
- It not even has windowing capability.
- It is a fire and forget type protocol.
- An application can use a UDP port number and another application can use the same port number for a TCP session from the same IP address.
- UDP and IP are on different levels of the OSI stack and corresponds to other protocols like TCP and ICMP.
- No connection establishment tear down; data is just sent right away.
- For data transfer with UDP a lock-step protocol is required (to be implemented by the application).
- No error control; corrupted data is not retransmitted (even though UDP header has a checksum to detect errors and report these to the application).
For frame format of the UDP datagram
Characteristics Description | UDP | TCP |
---|---|---|
Acronym for | User Datagram Protocol or Universal Datagram | Transmission Control Protocol |
General Description | Simple High speed low functionality "wrapper" that interface applications to the network layer and does little else | Full-featured protocol that allows applications to send data reliably without worrying about network layer issues. |
Protocol connection Setup | Connection less; data is sent without setup | Connection-oriented; Connection must be Established prior to transmission. |
Data interface to application | Message base-based is sent in discrete packages by the application. | Stream-based; data is sent by the application with no particular structure |
Reliability and Acknowledgements | Unreliable best-effort delivery without acknowledgements | Reliable delivery of message all data is acknowledged. |
Retransmissions | Not performed. Application must detect lost data and retransmit if needed. | Delivery of all data is managed, and lost data is retransmitted automatically. |
Features Provided to Manage flow of Data | None | Flow control using sliding windows; window size adjustment heuristics; congestion avoidance algorithms |
Overhead | Very Low | Low, but higher than UDP |
Transmission speed | Very High | High but not as high as UDP |
Data. Quantity Suitability | Small to moderate amounts of data. | Small to very large amounts of data. |
UDP Header Format: UDP packets, called user datagrams, have a fixed-size header of 8 bytes. Figure2shows the format of a user datagram. The fields are as follows:
1) Source port number :
i. This is the port number used by the process running on the source host.
ii. It is 16 bits long, which means that the port number can range from 0 to 65,535.
iii. If the source host is the client, the port number, in most cases, is an ephemeral port number requested by the process and chosen by the UDP software running on the source host.
iv. If the source host is the server, the port number, in most cases, is a well-known port number.
2) Destination port number :
i. This is the port number used by the process running on the destination host. It is also 16 bits long.
ii. If the destination host is the server, the port number, in most cases, is a well-known port number.
iii. If the destination host is the client, the port number, in most cases, is an ephemeral port number.
3) Length :
i. This is a 16-bit field that defines the total length of the user datagram, header plus data.
ii. The 16 bits can define a total length of 0 to 65,535 bytes. The length field in a UDP user datagram is actually not necessary.
4) Checksum :
This field is used to detect errors over the entire user datagram (headerplus data).