If a UDP datagram is sent from host A, port P to host B, port Q, but at host B there is no process listening to port Q, then B is to send back an ICMP Port Unreachable message to A. Like all ICMP messages, this is addressed to A as a whole, not to port P on A.
(a) Give an example of when an application might want to receive such ICMP messages.
(b) Find out what an application has to do, on the operating system of your choice, to receive such messages.
(c) Why might it not be a good idea to send such messages directly back to the originating port P on A?