Hi Nipa,
Are you sure that your code compiles? From a brief look at the ReceivedPacket function, I doubt it.
The trace you use is triggered in
PacketSink::HandleRead (
Ptr<Socket> socket) and it returns the address
of the originator. You can also see how this address is converted to IPv4 in that function (you know the transmitter and the recipient that
this traffic is destined to). You could also get the address of the recipient by changing the way you use the trace.