rmartin5 / aqua-sim-ng

Aqua-Sim on NS3
81 stars 41 forks source link

Some problems about the examples #7

Closed BigRabbit71 closed 5 years ago

BigRabbit71 commented 5 years ago

Hi Robert,

I have installed the Aqua-Sim-NG with ns-3.26 on Ubuntu 16.04, but I have met some problems when I tried to run the examples.

My work path is: ~/eclipse-workspace/NS3

  1. bMAC.cc the command line is: ./waf --run src/aqua-sim-ng/examples/bMAC It generated a trace file called "bMAC-trace.asc", but it didn't print any "Received a packet." sentence which is bind with the callback function (according to the line 177 in bMAC.cc). Below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- fin.

  2. floodtest.cc the command line is: ./waf --run src/aqua-sim-ng/examples/floodtest But it seems like that the transmissions are not successful, and the callback function didn't work. Below is the output: -----------Initializing simulation----------- Creating Nodes Node: 0x10fee00 newDevice: 0x10e85b0 Position:(0,0,0) freq:25 Node: 0x10ff690 newDevice: 0x10e9170 Position:(0,2000,0) freq:25 Node: 0x10ff7d0 newDevice: 0x10e9d30 Position:(2000,0,0) freq:25 Node: 0x10ff900 newDevice: 0x10eaaa0 Position:(2000,2000,0) freq:25 Sink: 0x10ffa30 newDevice: 0x10eb820 Position:(4000,1000,0) -----------Running Simulation----------- -----------Printing Simulation Results----------- Channel Counters= SendUpFromChannel(35) AllRecvers(should be =n*sendup)(175) SchedPhyRecv(140) Sent Pkts(Source_NetDevice->Stack): (NetworkTotal) 0 SendUp Pkts(Sink_RoutingLayer): (NetworkTotal) 0 Recv Pkts(@PhyLayer): (NetworkTotal) 0 End.

  3. GOAL_string.cc the command line is ./waf --run src/aqua-sim-ng/examples/GOAL_string It generated errors, below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- assert failed. cond="tAbsolute >= TimeStep (m_currentTs)", file=../src/core/model/default-simulator-impl.cc, line=236 terminate called without an active exception Command ['/home/mac/eclipse-workspace/NS3/build/src/aqua-sim-ng/examples/ns3.26-GOAL_string-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run --command-template="gdb --args %s ").

I'm sorry for bothering you, but it really confused me, look forward to your reply.

Thanks, Yiqian Xia

rmartin5 commented 5 years ago

Yiqian Xia,

For both 1 and 2 you should be receiving some type of packet on the receiver side. A few troubleshooting techniques are to adjust the locality of nodes and other range-based components of the simulation scripts (since they may possible be not within decodable range of each other). Additionally, you could try turning on the debugger for each layer to try and track the progression, to see where these packets are being dropped. One area that I don't believe was ever fully hashed out was globally creating packet headers (and instead is handled in an ad hoc type of manor). Therefore, packets could be dropped in one of the various layers dependent on how packets are created and populated.

For 3, I believe this type of error typically happens when the code tries to deserialize a packet header when the header is already empty or too small (aka out-of-bounds). Excuse my lack of knowledge here since it has been quite some time since I have used either NS-3 or Aqua-Sim NG. This can sometimes be a bit tricky to track since many components touch a packets header throughout the progress. Fortunately, I tried to make each layer modularized (and as independent as possible) when it comes to packet headers. The best way to try and look for any possible bugs would be to either use the suggested debugger command given in the error prompt or use NS-3 debugger with given base layers and see where this error is occurring and peak at the given packet.

Hope this helps, -Robert

On Sun, Nov 25, 2018 at 4:50 AM BigRabbit71 notifications@github.com wrote:

Hi Robert,

I have installed the Aqua-Sim-NG with ns-3.26 on Ubuntu 16.04, but I have met some problems when I tried to run the examples.

My work path is: ~/eclipse-workspace/NS3

1.

bMAC.cc the command line is: ./waf --run src/aqua-sim-ng/examples/bMAC It generated a trace file called "bMAC-trace.asc", but it didn't print any "Received a packet." sentence which is bind with the callback function (according to the line 177 in bMAC.cc). Below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- fin. 2.

floodtest.cc the command line is: ./waf --run src/aqua-sim-ng/examples/floodtest But it seems like that the transmissions are not successful, and the callback function didn't work. Below is the output: -----------Initializing simulation----------- Creating Nodes Node: 0x10fee00 newDevice: 0x10e85b0 Position:(0,0,0) freq:25 Node: 0x10ff690 newDevice: 0x10e9170 Position:(0,2000,0) freq:25 Node: 0x10ff7d0 newDevice: 0x10e9d30 Position:(2000,0,0) freq:25 Node: 0x10ff900 newDevice: 0x10eaaa0 Position:(2000,2000,0) freq:25 Sink: 0x10ffa30 newDevice: 0x10eb820 Position:(4000,1000,0) -----------Running Simulation----------- -----------Printing Simulation Results----------- Channel Counters= SendUpFromChannel(35) AllRecvers(should be =n*sendup)(175) SchedPhyRecv(140) Sent Pkts(Source_NetDevice->Stack): (NetworkTotal) 0 SendUp Pkts(Sink_RoutingLayer): (NetworkTotal) 0 Recv Pkts(@PhyLayer): (NetworkTotal) 0 End. 3.

GOAL_string.cc the command line is ./waf --run src/aqua-sim-ng/examples/GOAL_string It generated errors, below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- assert failed. cond="tAbsolute >= TimeStep (m_currentTs)", file=../src/core/model/default-simulator-impl.cc, line=236 terminate called without an active exception Command ['/home/mac/eclipse-workspace/NS3/build/src/aqua-sim-ng/examples/ns3.26-GOAL_string-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run --command-template="gdb --args %s ").

I'm sorry for bothering you, but it really confused me, look forward to your reply.

Thanks, Yiqian Xia

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rmartin5/aqua-sim-ng/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/ANWx70YSJPeXL17SQfCL8SWeYwlUaSNhks5uymfYgaJpZM4Yxy4F .

On Sun, Nov 25, 2018 at 4:50 AM BigRabbit71 notifications@github.com wrote:

Hi Robert,

I have installed the Aqua-Sim-NG with ns-3.26 on Ubuntu 16.04, but I have met some problems when I tried to run the examples.

My work path is: ~/eclipse-workspace/NS3

1.

bMAC.cc the command line is: ./waf --run src/aqua-sim-ng/examples/bMAC It generated a trace file called "bMAC-trace.asc", but it didn't print any "Received a packet." sentence which is bind with the callback function (according to the line 177 in bMAC.cc). Below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- fin. 2.

floodtest.cc the command line is: ./waf --run src/aqua-sim-ng/examples/floodtest But it seems like that the transmissions are not successful, and the callback function didn't work. Below is the output: -----------Initializing simulation----------- Creating Nodes Node: 0x10fee00 newDevice: 0x10e85b0 Position:(0,0,0) freq:25 Node: 0x10ff690 newDevice: 0x10e9170 Position:(0,2000,0) freq:25 Node: 0x10ff7d0 newDevice: 0x10e9d30 Position:(2000,0,0) freq:25 Node: 0x10ff900 newDevice: 0x10eaaa0 Position:(2000,2000,0) freq:25 Sink: 0x10ffa30 newDevice: 0x10eb820 Position:(4000,1000,0) -----------Running Simulation----------- -----------Printing Simulation Results----------- Channel Counters= SendUpFromChannel(35) AllRecvers(should be =n*sendup)(175) SchedPhyRecv(140) Sent Pkts(Source_NetDevice->Stack): (NetworkTotal) 0 SendUp Pkts(Sink_RoutingLayer): (NetworkTotal) 0 Recv Pkts(@PhyLayer): (NetworkTotal) 0 End. 3.

GOAL_string.cc the command line is ./waf --run src/aqua-sim-ng/examples/GOAL_string It generated errors, below is the output: -----------Initializing simulation----------- Creating Nodes -----------Running Simulation----------- assert failed. cond="tAbsolute >= TimeStep (m_currentTs)", file=../src/core/model/default-simulator-impl.cc, line=236 terminate called without an active exception Command ['/home/mac/eclipse-workspace/NS3/build/src/aqua-sim-ng/examples/ns3.26-GOAL_string-debug'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run --command-template="gdb --args %s ").

I'm sorry for bothering you, but it really confused me, look forward to your reply.

Thanks, Yiqian Xia

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rmartin5/aqua-sim-ng/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/ANWx70YSJPeXL17SQfCL8SWeYwlUaSNhks5uymfYgaJpZM4Yxy4F .

BigRabbit71 commented 5 years ago

Hi Robert,

Thanks for your kind reply! And after some attempts, I'm still confused about the examples.

  1. for the bMAC.cc I have called the print function from the aqua-sim-helper just like: asHelper.GetChannel()->PrintCounters(); and the output is like:
    -----------Initializing simulation-----------
    Creating Nodes
    -----------Running Simulation-----------
    Channel Counters= SendUpFromChannel(425) AllRecvers(should be =n*sendup)(1696) SchedPhyRecv(1271)
    Sent Pkts(Source_NetDevice->Stack):
    (NetworkTotal) 6
    SendUp Pkts(Sink_RoutingLayer):
    (NetworkTotal) 206
    Recv Pkts(@PhyLayer):
    (NetworkTotal) 946
    fin.

It seems like that the transmissions are successful, but it still didn't print any "Received a packet." sentence, means the callback function didn't work.

  1. GOAL_string.cc I changed the duration of the simulation from 500s to 400s, and then the error disappeared. And I have called the print function from the aqua-sim-helper just like: asHelper.GetChannel()->PrintCounters(); and the output is like:

    -----------Initializing simulation-----------
    Creating Nodes
    Node: 0x10e12c0 newDevice: 0x10e4cd0 Position: 0,0,0
    Node: 0x10e0d90 newDevice: 0x10e5ea0 Position: 100,0,0
    Node: 0x10e0aa0 newDevice: 0x10e7170 Position: 200,0,0
    Node: 0x10e03f0 newDevice: 0x10e8630 Position: 300,0,0
    Node: 0x10e0780 newDevice: 0x1158b70 Position: 400,0,0
    Node: 0x10e0570 newDevice: 0x115a080 Position: 500,0,0
    -----------Running Simulation-----------
    Channel Counters= SendUpFromChannel(56) AllRecvers(should be =n*sendup)(336) SchedPhyRecv(280)
    Sent Pkts(Source_NetDevice->Stack):
    (NetworkTotal) 8
    SendUp Pkts(Sink_RoutingLayer):
    (NetworkTotal) 0
    Recv Pkts(@PhyLayer):
    (NetworkTotal) 280
    End.

    It's the same as the bMAC.cc. And even adjusting the range component from 100m to 200m doesn't help.

  2. Reservation-based MAC protocols I'd like to test some reservation-based MAC protocols, like Slotted-FAMA, and I don't know which routing protocol should be used.

a) When I set the routing protocol as dummy routing protocol in bMAC.cc like: asHelper.SetRouting("ns3::AquaSimRoutingDummy"); the output is like:

Channel Counters= SendUpFromChannel(282) AllRecvers(should be =n*sendup)(846) SchedPhyRecv(564)
Sent Pkts(Source_NetDevice->Stack):
 (NetworkTotal) 6
SendUp Pkts(Sink_RoutingLayer):
 (NetworkTotal) 0
Recv Pkts(@PhyLayer):
 (NetworkTotal) 564
fin.

Since the destination addresses for the packets are broadcast address in dummy routing, the handshake process in Slotted-FAMA cannot be successful, thus the transmissions always failed.

b) When I set the routing protocol as dynamic routing protocol in bMAC.cc like: asHelper.SetRouting ("ns3::AquaSimDynamicRouting", "AccessibleVar", IntegerValue (1)); Errors generated, the output is like:

-----------Initializing simulation-----------
Creating Nodes
AquaSimSFama:AquaSimSFama(0x1e539b0)
AquaSimDynamicRouting:AquaSimDynamicRouting_PktTimer(0x1e549b8)
AquaSimDynamicRouting:AquaSimDynamicRoutingTable(0x1e54a00)
AquaSimDynamicRouting:AquaSimDynamicRouting(0x1e548a0)
AquaSimDynamicRouting:SetRouting(0x1e54a00)
Command ['/home/mac/eclipse-workspace/NS3/build/scratch/bMAC'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

Could you please give me some suggestions about which routing protocol is suitable for the reservation-based MAC protocols?

I'm sorry for bothering you, but it really confused me, look forward to your reply.

Many thanks, Yiqian Xia

BigRabbit71 commented 5 years ago

An update about the reservation-based MAC protocol:

I found the cross-layer protocol, GOAL, could solve my problem: reservation-based MAC protocol + Geo-based dynamic routing protocol.

So I started to work with the GOAL source code, there are some problems in the pointer processing and packet header management, and I almost fixed GOAL protocol at: https://github.com/BigRabbit71/aqua-sim-ng/blob/master/model/aqua-sim-mac-goal.cc

Except for one problem that at MAC layer, the DATA packet generated from the upper layer doesn't have a unique packet ID, so I assign one for it in a stupid way, you can see in line 328 & 329. What's more, I added a example scratch to test the GOAL protocol in 'examples' folder.