Send nd Recieve Packets from one node to another

1,298 views
Skip to first unread message

gyana ranjan Sahu

unread,
Sep 3, 2016, 4:30:12 PM9/3/16
to ns-3-users
Hi All,

I need to create a simulation example, where the communication link is setup between two point-to-point nodes n1 and n2. I want to attach a packet at one end of the node n1 and send it to the other node n2 through udp connection. After that I need to compare the two packets. I have already written the Packet comparison functions. But I am stuck at finding a example which attaches and send the packets from one end to another.

Any help is much appreciated.


Thanks

Tommaso Pecorella

unread,
Sep 4, 2016, 5:38:32 AM9/4/16
to ns-3-users
Hi,

what about all the scripts in the tutorial ?

T.

gyana ranjan Sahu

unread,
Sep 5, 2016, 10:37:21 AM9/5/16
to ns-3-users
Hi Tommaso,

I looked at the example scripts, but it does not describes/shows how to attach a packet to one of the Nodes and send it to the other one. 

If you know of such a tutorial can you please send the link here.

Thanks

Konstantinos

unread,
Sep 5, 2016, 10:48:01 AM9/5/16
to ns-3-users
Hi,

What do you mean by 'attach a packet to one of the nodes'?
It may by the language barrier that is not helping us understand your problem.
Try be be more descriptive.

However, as Tommaso has pointed, the tutorial explains how you can create a traffic generation application to send packets from one node to another.

Regards,
K.

gyana ranjan Sahu

unread,
Sep 5, 2016, 4:21:13 PM9/5/16
to ns-3-users
Hi Konstantinos,

Thank you for following up on my thread. I am describing my requirements here:

The network config is like this: n0------>n1, where n0 and n1 are two nodes.

 I want to have a UDP oriented networking configuration. Next, I want to send a custom packet(with specific data) from n0 to n1 and should be able to retrieve the Packet at n1 node and compare the two packets. 
I was able to write a Packet comparison function which looks at the data in each packet and returns the number of errors(unit test cases were built and passed the test). However, if I get an example where it shows how to attach a packet to a Node and send it to other node via UDP connection it will be very much helpful. 

Thanks

Konstantinos

unread,
Sep 5, 2016, 6:24:33 PM9/5/16
to ns-3-users
Hi,

- Sending UDP traffic is described in the tutorial. Half of the example scenarios are using a UDP connection, the rest are using TCP. There are some with Ping (ICMP).
- Adding custom data to a packet is also described in the documentation (https://www.nsnam.org/support/faq/miscellaneous/) and numerous times in the list (search the archvies).
- You can add errors in the channel using the ReceiveErrorModel attribute of the p2p NetDevice.

ReceiveErrorModel: The receiver error model used to simulate packet loss

Irani Acharjamayum

unread,
Jul 11, 2020, 12:42:54 AM7/11/20
to ns-3-users
Sir, i am stuck with one problem. i have send a packet from one node  to wifi AP Node using UDP echo application.This packet has been received in the wifi AP node. Now i want the same packet to be broadcasted to other wifi station nodes. Problem lies on how to forward the same packet which has been received in the wifi AP node to be broadcasted to only the wifi station nodes. Kindly suggest me some hint sir to solve this problem.

SheikhMuhammadSaleh Farooqui

unread,
Jul 11, 2020, 5:17:10 AM7/11/20
to ns-3-...@googlegroups.com
Hi
You can creat two different networks mean separate for the WiFi nodes then find out the broadcast address and send it to the address the same packet which you have received from the first node


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/5d031fad-b47e-4de5-9a7f-659c5ff7ab16o%40googlegroups.com.

Irani Acharjamayum

unread,
Jul 11, 2020, 5:25:30 AM7/11/20
to ns-3-...@googlegroups.com
problem is how to send the same packet which has been received???



--
Irani Acharjamayum

SheikhMuhammadSaleh Farooqui

unread,
Jul 11, 2020, 5:28:32 AM7/11/20
to ns-3-...@googlegroups.com
Try to forward the packet on two nodes and you will figure out the way to forward to different addresses or you can send it to me I can try in week day

shivanshu shekhar

unread,
May 20, 2022, 11:33:57 PM5/20/22
to ns-3-users
Did you get how to do it?
Reply all
Reply to author
Forward
0 new messages