UDP Services
Process-to-Process Communication
- UDP provides process-to-process communication using sockets,
- A socket is a combination of IP addresses and port numbers.
Connectionless Services
- UDP Provides a connectionless service. This means that each user datagram sent by UDP is an independent datagram.
- The user datagrams are not numbered.
- There is no connection establishment and no connection termination as the case for TCP.
- Each datagram can travel on a different path.
Flow Control
- UDP is a very simple protocol. It does not have flow control mechanism. The receiver may overflow with incoming messages.
- The process using UDP should provide this service, if needed.
Error Control
- There is no error control mechanism in UDP except for the checksum.
- The sender does not know if a message has been lost or duplicated.
- Receiver detects an error through the checksum, if found the user datagram is sileently discarded.
- The process using UDP should provide this service, if needed.
Congestion Control
- UDP is connectionless protocol, it does not provide congestion control functionality.
- 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 encapsulate and decapsulates messages.
Encapsulation
When a process has a message to send through UDP,
- It passes the message to UDP along with pair of socket address and the length of data.
- UDP passes the user datagram to IP with socket address.
- IP adds its own header and passes to data link layer.
- Data link layer add its own header and trailer and passes it to physical layer.
- The physical layer encodes the bits into electrical or optical signals and sends it to remote machine.
Decapsulation
When the message arrives at the destination host.
- The physical layer decodes the signals into bits and passes it to the data link layer.
- The data link layer uses the header and trailer to check the data for any error. If there is no error, the header and trailer are dropped and the datagram is passed to IP.
- The IP software does its own checking. If there is no error, the header is dropped and the user datagram passed to UDP.
- The UDP uses the checksum to check the entire datagram. If there no error, the header is dropped and the application data along with the sender socket address is passed to the process.
Queuing
At the client site, when a process start, it requests a port number from the operating system.Depending upon implementation operating system will create both incoming and outgoing queue associated with each process.
- The client process can send messages to the outgoing queue by using the source port number specified in the request.
- UDP removes the messages one by one, and after adding the UDP header, it delivers them to IP.
- The outgoing queue can overflow. If this happens, the operating system can ask the client process to wait before sending any more messages.
- When a message arrives for a client, UDP checks to see if an incoming queue has been created, If there is a queue, UDP sends the received user datagram to the end of the queue. If there is no such queue, UDP discards the user datagram and asks ICMP protocol t send a port unreachale message to the server.
No comments:
Post a Comment