Nodes in ns2 should be able to send the user desired message.And we should know,that message is delivered to the destination node.And destination should display the received message.
Get used to with the source code for ns2 ... there is a good documentation available .... you need to understand some C++ code and then you can write some function in those source files which inputs and outputs a message. recomplete the ns2 source and things should work ... but first you need to know the source code of ns I feel