How to modify received packet during simulation?

20 views
Skip to first unread message

farah aphie

unread,
Feb 21, 2017, 3:17:24 AM2/21/17
to ns-3-users
Dear all,
i am still beginner in the ns3 environment.
actually i want to create send-receive message through udp between 2 nodes.
1. node 1 --> send message --> node2
2. node 2 --> accept message --> modify message --> send back --> node 1

I'll try to modify seventh.cc example by Creating MyApp Application. It only has SendPacket() function. I add ReceivePacket(Ptr<Socket>)


I found problem when receiving message, how can i modify receiving message during simulation ? because the received message is dynamic object which can not be known at configuration time (before simulation start)

please help me
thank you

farah,
institut teknologi sepuluh nopember, surabaya, Indonesia


Konstantinos

unread,
Feb 21, 2017, 5:29:59 AM2/21/17
to ns-3-users
Hi Farah,

Your question is not very clear. Particularly what is hindering you to modify the received packet.
See for example the UdpEchoServer application, and particularly the "HandleRead()" method.
When the server receives a packet, it re-sends it (the same packet).
You can change that method to apply any modifications to the received packet and send it back.

Regards,
K

farah aphie

unread,
Feb 21, 2017, 9:50:13 AM2/21/17
to ns-3-users
thank you for your information
i'll try to learn more about udp echo client server




Reply all
Reply to author
Forward
0 new messages