QQ1. (a). Write a UDP client and UDP server program in C language on Unix/Linux, where client program interact with the Server as given below: 1. The client will send a message "welcome" to the Server. 2. Server program sends an acknowledgement for receiving the message. 3. The sever program will find the length of the message and send it to the respective client. 4. The client will send an acknowledgement to the server upon receiving the response. 5. The server program will reverse the message and send it to the respective client. 6. The client will send an acknowledgement to the server upon receiving the response.
- UDP uses `SOCK_DGRAM` for connectionless, unreliable datagram communication.
- Server employs `socket()`, `bind()`, `recvfrom()`, `sendto()` for communication.
- Client uses `socket()`, `sendto()` to target server, and `recvfrom()` for responses.
- `sockaddr_in` structure holds IP address and port, `htons()` converts port byte order.
Answer: UDP (User Datagram Protocol) offers a connectionless communication model, making it suitable for applications where speed is more critical than guaranteed delivery, such as streaming or gaming. For BCSL-056, understanding how to implement basic UDP client-server interaction in C is fundamental, leveraging system calls like `socket()`, `bind()`, `sendto()`, and `recvfrom()` as detailed in the course material. This exercise involves a specific six-step interaction between a UDP client and a UDP s...