Data mule using p2p links

11 views
Skip to first unread message

Caleb Bowers

unread,
Apr 25, 2019, 8:06:02 AM4/25/19
to ns-3-users
I am attempting to construct a scenario where n0 has a p2p link with n1, and then n1 has a p2p link with n2. This would then enable n1 to transfer data to n3. I transfer data using the BulkSendApplication.

I am able to establish a p2p link between n0 and n1, but I am unsure how to create the last leg.

Here is some relevant code:

  Ptr<Node> n0 = CreateObject<Node> ();
  Ptr<Node> n1 = CreateObject<Node> ();
  Ptr<Node> n2 = CreateObject<Node> ();

  // Instantiate nodes object
  NodeContainer nodes (n0, n1, n2);

  // Holds all netdevices created
  NetDeviceContainer node0_2_node1;
  // Establishes p2p link from n1 to n2
  node0_2_node1 = pointToPoint.Install (nodes.Get (0), nodes.Get (1));

  // Established p2p link from n1 to n2
  NetDeviceContainer node1_2_node2;
  node1_2_node2 = pointToPoint.Install (nodes.Get (1), nodes.Get(2));


I don't think I want to execute:

p2p_links = pointToPoint.Install (nodes.Get (0), nodes.Get (1), nodes.Get(2));

because that would also create a p2p link between n0 and n2, which is not what I want (it would not reflect the actual scenario I am trying to simulate).


Thanks,

Caleb

Caleb Bowers

unread,
Apr 26, 2019, 2:47:24 PM4/26/19
to ns-3-users
I resolved this issue.
Reply all
Reply to author
Forward
0 new messages