ping in dsr.cc

75 views
Skip to first unread message

Lincy Elizebeth Jim

unread,
May 1, 2015, 2:55:34 AM5/1/15
to ns-3-...@googlegroups.com
Hi all


I want to implement v4ping in dsr.cc ,

i put  the function
void
 InstallApplications (Ipv4InterfaceContainer interfaces, double TotalTime, uint32_t size, NodeContainer adhocNodes)
{
  V4PingHelper ping (interfaces.GetAddress (size- 1));
  ping.SetAttribute ("Verbose", BooleanValue (true));

  ApplicationContainer p = ping.Install (adhocNodes.Get (size-1));
  p.Start (Seconds (0));
  p.Stop (Seconds (TotalTime) - Seconds (0.001));

  // move node away
  Ptr<Node> node = adhocNodes.Get (size/2);
  Ptr<MobilityModel> mob = node->GetObject<MobilityModel> ();
  Simulator::Schedule (Seconds (TotalTime/3), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5));
}

just above main in dsr.cc

and included the following line of code in dsr.cc

  InstallApplications (allInterfaces, TotalTime,nWifis,adhocNodes);//for ping


when i run dsr.cc

all i can see is  PING 10.1.1.50 56(84)  bytes of data

i am not getting the output of x packets transmitted,y received like i seen in aodv

kindly guide me as to where I went wrong

thanking in advance
lincy

Konstantinos

unread,
May 1, 2015, 4:46:02 AM5/1/15
to ns-3-...@googlegroups.com
Hi,

First of all, the structure of aodv.cc and dsr.cc examples are completely different. The first is more object oriented than the second which is just a single main().
So just by copying parts from one scenario to another will not work. You must have done other changes as well.

Also, you have not copied the code correctly. Study the code snippet you posted line by line and understand what you have written.
Refer to the Ping application API to see what these lines do
V4PingHelper ping (interfaces.GetAddress (size- 1));
and 

ApplicationContainer p = ping.Install (adhocNodes.Get (size-1));

If you understand them, you can find the problem yourself.

Lincy Jim

unread,
May 6, 2015, 1:54:33 AM5/6/15
to ns-3-...@googlegroups.com
Hi Konstantinos

I tried ping on dsr.cc,yes i understand what those lines mean "size=no.of nodes"
ApplicationContainer p = ping.Install (adhocNodes.Get (size-1)); implies installing ping on the nodes


i put  the function
void
 InstallApplications (Ipv4InterfaceContainer interfaces, double TotalTime, uint32_t size, NodeContainer adhocNodes)
{
  V4PingHelper ping (interfaces.GetAddress (size- 1));
  ping.SetAttribute ("Verbose", BooleanValue (true));

  ApplicationContainer p = ping.Install (adhocNodes.Get (size-1));
  p.Start (Seconds (0));
  p.Stop (Seconds (TotalTime) - Seconds (0.001));

  // move node away
  Ptr<Node> node = adhocNodes.Get (size/2);
  Ptr<MobilityModel> mob = node->GetObject<MobilityModel> ();
  Simulator::Schedule (Seconds (TotalTime/3), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5));
}

just above main in dsr.cc

and included the following line of code in dsr.cc

  InstallApplications (allInterfaces, TotalTime,nWifis,adhocNodes);//for ping

and i did get an output finally!!!
why is it 100%packet loss?(i have attached screenshot of the same) kindly provide me with a hint


thanking in advance

lincy


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/UddgoGtmHEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Screenshot from 2015-05-06 15:47:02.png

Konstantinos

unread,
May 6, 2015, 4:19:56 AM5/6/15
to ns-3-...@googlegroups.com
Hi,

I do not think that you understood exactly what those line do

First you have this: 
V4PingHelper ping (interfaces.GetAddress (size- 1));

Quoting the API
ns3::V4PingHelper::V4PingHelper(Ipv4Address remote)

Create a V4PingHelper which is used to make life easier for people wanting to use ping Applications.

Parameters
remoteThe address which should be pinged

It will create a Ping application and the "interfaces.GetAddress (size- 1)" will be your remote server, the one that you want to ping.
And then you have
ApplicationContainer p = ping.Install (adhocNodes.Get (size-1));

Again from the API
ApplicationContainer ns3::V4PingHelper::Install(PtrNode > node)const

Install a Ping application on the provided Node.

The Node is specified directly by a Ptr<Node>

Parameters
nodeThe node to install the V4PingApplication on.

You will install the previously configured Ping one the nodes adhocNodes.Get (size-1)  
If you see what you have here, you ping 'yourself' because the node to be installed has the remote address... 
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Lincy Jim

unread,
May 10, 2015, 9:42:42 PM5/10/15
to ns-3-...@googlegroups.com
hi konstantinos

thank you for your reply.i tried this now(guven below is the function above main)


void
 InstallApplications (Ipv4InterfaceContainer interfaces, double TotalTime, uint32_t size, NodeContainer adhocNodes)
{
  V4PingHelper ping (interfaces.GetAddress (size- 1));
  ping.SetAttribute ("Verbose", BooleanValue (true));

  ApplicationContainer p = ping.Install (adhocNodes);

  p.Start (Seconds (0));
  p.Stop (Seconds (TotalTime) - Seconds (0.001));

  // move node away
  Ptr<Node> node = adhocNodes.Get (size/2);
  Ptr<MobilityModel> mob = node->GetObject<MobilityModel> ();
  Simulator::Schedule (Seconds (TotalTime/3), &MobilityModel::SetPosition, mob, Vector (1e5, 1e5, 1e5));
}

i got "you are attempting to read beyond buffer.(attached screenshot)

kindly guide

thanking in advance
lincy

ps:sorry for the delay in trying.right finger tip got amputated in kitchen. plastic surgery was done 2 days back

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/UddgoGtmHEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Screenshot from 2015-05-11 11:36:24.png

Konstantinos

unread,
May 11, 2015, 1:36:44 PM5/11/15
to ns-3-...@googlegroups.com, lin...@gmail.com
Could be a bug with DSR headers, need to investigate it more.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/UddgoGtmHEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.

Lincy Jim

unread,
May 19, 2015, 4:12:04 AM5/19/15
to ns-3-...@googlegroups.com
hi konstantinos

is it better to drop using ping application in dsr and go for trace sink in order to see the packets tranmitted information.Kindly guide

thanking in advance

regards
lincy

To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/UddgoGtmHEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/UddgoGtmHEs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages