Bug 2190 - Add LrWpan support to NetAnim
Add LrWpan support to NetAnim
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: netanim
ns-3-dev
All All
: P5 enhancement
Assigned To: John Abraham
:
Depends on: 2191
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-04 16:31 UTC by Tommaso Pecorella
Modified: 2017-03-12 20:42 UTC (History)
3 users (show)

See Also:


Attachments
Initial LrWpan support (10.38 KB, patch)
2015-10-05 18:02 UTC, Tommaso Pecorella
Details | Diff
LrWpan support (10.59 KB, patch)
2017-03-12 09:33 UTC, Tommaso Pecorella
Details | Diff
LrWpan screenshot (297.65 KB, image/png)
2017-03-12 09:36 UTC, Tommaso Pecorella
Details
Simplest test program (3.93 KB, text/x-csrc)
2017-03-12 09:38 UTC, Tommaso Pecorella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2015-10-04 16:31:24 UTC
I'm trying to figure out if an easy patch is possible.
Comment 1 Tommaso Pecorella 2015-10-05 18:02:36 UTC
Created attachment 2160 [details]
Initial LrWpan support

I have no idea of what I did. It's just a monkey-copy of te WiFi one (with some modifications to skip the ACKs).

As a side note, ACKs are skipped because it's damn hard to track the actual source and destination.
Comment 2 Tommaso Pecorella 2016-04-26 16:35:12 UTC
Bug #2191 dependency is because even if we apply this patch, without 2191 the user will not see anything really useful.
Comment 3 MariaCulman 2016-12-29 21:06:24 UTC
Hello Professor Tommaso,

I am currently working with NS-3 (3.26) and NetAnim (3.107). I have created a network of 6LoWPAN nodes (based on the example: src/sixlowpan/examples/example-ping-lr-wpan.cc) and I have included animation to the network (based on the example: src/netanim/examples/wireless-animation.cc). I can see the nodes in the NetAnim but I do no get any animation on the ping6 exchange. 

Here you have attached a patch, how does that work? how can I installed/included/used it to make my animation work?

I am totally new in this, but I am a good student.

Thanks!
Comment 4 John Abraham 2017-03-10 16:57:26 UTC
Hi Tommaso,

Can you give me a sample program so that I work on pushing this diff?

john
Comment 5 Tommaso Pecorella 2017-03-10 19:10:39 UTC
(In reply to John Abraham from comment #4)
> Hi Tommaso,
> 
> Can you give me a sample program so that I work on pushing this diff?
> 
> john

Hi John,

for lr-wpan this will do:
src/sixlowpan/examples/example-ping-lr-wpan.cc

Cheers
Comment 6 John Abraham 2017-03-11 20:41:35 UTC
(In reply to Tommaso Pecorella from comment #5)
> (In reply to John Abraham from comment #4)
> > Hi Tommaso,
> > 
> > Can you give me a sample program so that I work on pushing this diff?
> > 
> > john
> 
> Hi John,
> 
> for lr-wpan this will do:
> src/sixlowpan/examples/example-ping-lr-wpan.cc
> 
> Cheers

Can you please confirm, 
if this diff is still good from your side?

ns-3-dev johnabraham$ hg diff src/lr-wpan/model/lr-wpan-phy.cc
diff -r a6ab52173a9c src/lr-wpan/model/lr-wpan-phy.cc
--- a/src/lr-wpan/model/lr-wpan-phy.cc	Sat Mar 11 16:53:26 2017 -0800
+++ b/src/lr-wpan/model/lr-wpan-phy.cc	Sat Mar 11 17:39:19 2017 -0800
@@ -546,6 +546,10 @@
           LrWpanLqiTag lqiTag;
           p->RemovePacketTag (lqiTag);
 
+          m_phyTxBeginTrace (p);
+          m_currentTxPacket.first = p;
+          m_currentTxPacket.second = false;
+
           Ptr<LrWpanSpectrumSignalParameters> txParams = Create<LrWpanSpectrumSignalParameters> ();
           txParams->duration = CalculateTxTime (p);
           txParams->txPhy = GetObject<SpectrumPhy> ();
@@ -557,9 +561,6 @@
           m_channel->StartTx (txParams);
           m_pdDataRequest = Simulator::Schedule (txParams->duration, &LrWpanPhy::EndTx, this);
           ChangeTrxState (IEEE_802_15_4_PHY_BUSY_TX);
-          m_phyTxBeginTrace (p);
-          m_currentTxPacket.first = p;
-          m_currentTxPacket.second = false;
           return;
         }
       else if ((m_trxState == IEEE_802_15_4_PHY_RX_ON)
Comment 7 Tommaso Pecorella 2017-03-12 09:33:08 UTC
Hi John,

not really. AnimationInterface must be updated to handle the new NetDevices.
I'm attaching a new patch (it's the old one, I just fixed the patching errors).
Comment 8 Tommaso Pecorella 2017-03-12 09:33:43 UTC
Created attachment 2795 [details]
LrWpan support
Comment 9 Tommaso Pecorella 2017-03-12 09:36:58 UTC
Created attachment 2796 [details]
LrWpan screenshot

To clarify the previous message.
Without the AnimationInterface changes the nodes are correctly shown (also their addresses), but the packets aren't.
Comment 10 Tommaso Pecorella 2017-03-12 09:38:31 UTC
Created attachment 2797 [details]
Simplest test program

W.r.t. the standard example, this one has:
- AnimationInterface enabled, and
- IPv4 stack disabled (not really necessary)
Comment 11 John Abraham 2017-03-12 12:04:30 UTC
Thanks I committed, http://code.nsnam.org/ns-3-dev/rev/2d47f478b889
Comment 12 Tommaso Pecorella 2017-03-12 19:32:45 UTC
Should we close this and #2191 ?