Skip to first unread message

Dahiru Murtala

unread,
Jul 31, 2014, 5:41:54 PM7/31/14
to ns-3-...@googlegroups.com
I am doing my project on Network Simulation using NS-3. One of the networks I am simulating is MANET which I saw manet-routing-compare.cc in one of the folders. I tried to go through the codes carefully but I was able to understand some few things in it. According to what I understood if I'm correct, packets are being transmitted from one node to another as they move randomly. I found it difficult to modify it as I am new to NS-3. I want to do some analysis using different protocols and compare their performances in terms of time delay, data loss with different conditions such as transmission power, mobility speed, which I think were available in the codes to change the values. My problem is, how can I modify the code in such a way that I can choose the client and the server so that I can analyse the packets transfer from client to server as the nodes move. The way the codes are at the moment, I don't know if I can do any analysis with them.

Konstantinos

unread,
Aug 1, 2014, 6:26:58 AM8/1/14
to ns-3-...@googlegroups.com
Dear Dahiru,

Please do not make the same questions over and over again in new threads. 

To answer your question, the part of the scenario that is responsible for the applications is just these lines

346  for (int i = 0; i < nSinks; i++)
347  {
348  Ptr<Socket> sink = SetupPacketReceive (adhocInterfaces.GetAddress (i), adhocNodes.Get (i));
349 
350  AddressValue remoteAddress (InetSocketAddress (adhocInterfaces.GetAddress (i), port));
351  onoff1.SetAttribute ("Remote", remoteAddress);
352 
353  Ptr<UniformRandomVariable> var = CreateObject<UniformRandomVariable> ();
354  ApplicationContainer temp = onoff1.Install (adhocNodes.Get (i + nSinks));
355  temp.Start (Seconds (var->GetValue (100.0,101.0)));
356  temp.Stop (Seconds (TotalTime));
357  }
358 

Line 348 creates your sink node, which is installed in the i-th node and line 350-4 create your source node installed on the (i-th + nSinks) node.
Now, if you just want to have fixed pairs, i.e. node_1 with node_15 you need to specify that accordingly.

Regards,
K.

Dahiru Murtala

unread,
Aug 1, 2014, 7:42:10 AM8/1/14
to ns-3-...@googlegroups.com
Thanks sir for your reply. By specifying the source and the sink, how can I specify the number of packets to transmit from the source to the sink. I want to check if there will be packets lost along the way. I also want to plot a graph that can show different scenarios but I was confused on which scenarios are available in the codes and how can I fetch out the values to plot.
 


--
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/s1K_JLuoERc/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.

Reply all
Reply to author
Forward
0 new messages