Question 3
[24 Marks]
a) Using Java codes, create an application that creates a MulticastSocket class to create UDP
multicast sockets to receive datagram packets sent to a multicast IP address and received by
another process. The following instruction should guide you, only on the sender side.
(12)
• Objects (MulticastSender and MulticastReceiver
• Connectionless oriented, the receiver needs to start first.
• On the Multicast receivers
• Specify Class DIP address starting from (225.1.2.3)
• Open any available multicast socket on the UDP port (3456)
• Call the join group method on the multicast socket to join the multicast group.
• Message to be received should be 150 bytes (create an array).
• Create a datagram socket for the expected packets.
• Create and call the receiver method on the Multicast socket to be able to receive the
message.
• Display the message that was received.
• Close the socket.
b) Consider figure 1 below that shows 3 processes (Pl, P2, and P3) executing in a distributed
System with various messages passing between the processes. Assume that initial logical clock
values are all initialized to 0.
Using Vector Clock, for each event shown in the figure, list all the packet's logic clocks. (12)
P3: ____
-111•-="------------••------------
Exam Ends
Total 70 Marks
3