ns3.25 visualizer how can i choose what OSI layer to show in simulation

297 views
Skip to first unread message

nobody s

unread,
Oct 25, 2016, 10:23:23 PM10/25/16
to ns-3-users
Good day:

using ns3.25
ubuntu14.04

Before view the routing packets visualization
i wold like to see in the simulation when using the --viz option
any of the OSI layers,  i mean physical (the link) the MAC (data link)
is there a way to setup this?

Tommaso Pecorella

unread,
Oct 27, 2016, 7:31:50 PM10/27/16
to ns-3-users
Hi,

no, mainly because OSI layers are (nowadays) just something you'll find in books.

T.

nobody s

unread,
Oct 31, 2016, 5:36:08 PM10/31/16
to ns-3-users
Good day Tommaso:

I think  dint´t explained my self, let me try again, When you run a simulation, let say: the "third.cc" program
you see traffic in the visualizer as shown in the attached picture.

So i will re-phrase my question.

How do I, from a .cc script, control what OSI Layer to observe in this case I meaning for example i don´t want to see the kb/s
just want to see that the phy-wifi link is there between the nodes, is that something you can do in the visualizer or only in the netanim.

So basically i would like to be able to see a constant line between nodes as long as there is a wifi connection between nodes and if the wifi connection is lost then don't see the line.

Hope i explained my self better.

thanks in advance and best regards
 
Screen Shot 2016-10-31 at 3.31.05 PM.png

Tommaso Pecorella

unread,
Nov 1, 2016, 11:17:55 AM11/1/16
to ns-3-users
Hi,

yes, now your problem is much clearer.

Sadly the answer is: I don't know. The python visualizer was built mainly to show the packet flowing, not the PHY connections. Moreover, the wireless "connections" are even harder to track, because you never know if a node is in range or not until you send a packet. In ns-3 there's no way to know this in advance, you have to send a packet and see if it is received.

You could change the node's color, but also that option is limited by the knowledge of the connection status, which you don't know until you have packets being sent.
The best option I can suggest is to work on a 2-color system.
Let's say that you assign a red color to the AP1 (other APs could have another color). AP is a square and the STA is a circle.
You can change the STA color according to the WiFi MAC status (see StaWifiMac::IsAssociated) and to the AP it is associated with.

Note that most probably this will have to be encoded somewhere in your application, or in the Wi-Fi code, and that I have absolutely no clue about how to do it. I know for sure it can be done in NetAnim. About PyViz... no idea at all, I had arguments with Python some years ago and we still are avoiding each other.


T.

nobody s

unread,
Nov 2, 2016, 7:59:13 PM11/2/16
to ns-3-users
Good day Tommasso:

I have been digging in the forum as well as in the code so I hope my questions are more detailed and clear.

The algorithm which I will be working on will be for MANETs, that being said, It relies on the physical link, meaning 
The algorithm is based on how many links (meaning the two wireless nodes have the enough Received Signal Strength to be able to send a message)
Therefore before even getting in to the routing algorithms i, just want to see the communication at MAC level

I made an experiment, you can see in the febalart_manet_v1.cc  and the xml result was febalart_manet_v1.xml
I literally commented everything until the mac layer configuration, and commented the internet stack layer,
as you mention in this discussion
 

The MAC layer do "send" messages beside the periodic ones necessary for framing and contention resolution

But as you see in the xml replay on net anim there is no packets to be seen, so 
am i´m missing  a net anim command to enable to see the packets of the MAC layer? or this is due to my configuration as Adhoc mac layer and not STA or AP

In the experiment, you can see in the manet-2015-netani.cc which is my template base test and the xml result was MANET-2015-netanim.xml
you can see the links and concentric circles of propagation

You talked about L2 beacons, can you point to a module or .cc of ns3, i have been reading the maclayer wifi, module, the yanshelpers and others but  i´m quite lost.

Thanks in advance and best regards
febalart_manet_v1.xml
MANET-2015-netanim.xml
febalart_manet_v1.cc
manet-2015-netani.cc

Francisco Eduardo Balart Sanchez

unread,
Nov 4, 2016, 9:14:42 PM11/4/16
to ns-3-users
Further more i found the wifi-adhoc test and the wifi-simple-adhoc test, the first one does not implement routing protocol and only setups until mac layer
the second does install an internetstackhelper

are those the L2 beacons you talked about?

Is weird that for the wifiadhoc test when ran in --vis you see packets while the node is moving, nevertheles the xml shows nothing in the replay on net anim
in the other hand the wifi-simple-adhoc shows a packet transmited in the xml replay on net anim

there are only two main differences i spotted the wifi-adhoc does only setup truly up to mac layer and only add the socket items

- a socket pointer
- a PacketSocketHelper
- and a PacketSocketAddress


while the second the wifi-simple-adhoc test 

- an Inetsocketadress and the internetstackhelper

Is the sockets helpers of the wifi-adhoc test just emulating the mac layer package transactions and that is why in the net anim i dont see anything or i screwed up in something,


thanks again
WifiAdhocNetAnim.xml
WifiSimpleAdhoc.xml
wifi-simple-adhoc-netanim.cc
wifi-adhoc-netanim.cc

Tommaso Pecorella

unread,
Nov 5, 2016, 7:03:33 AM11/5/16
to ns-3-users
Hi,

I did suggest to check the beacons in that post, but you don't have beacons in AdHoc networks. You can add your own, of course, but the MAC will not send stuff if the L3 will not give it packets to send.
In the post I mentioned I was suggesting possible implementations, but they had to be made by the student.

About the other question, please upgrade to the latest ns-3 version. I just ran your scripts with 3.26 and there's a LOT of packets in the traces, even too many.

Cheers,

T.
Message has been deleted
Message has been deleted
Message has been deleted

Francisco Eduardo Balart Sanchez

unread,
Nov 5, 2016, 5:40:46 PM11/5/16
to ns-3-users
Good day Tommaso:

Just installed the ns 3.26

which scripts you ran? the wifi-simple-adhoc-netanim.cc and wifi-adhoc-netanim.cc?
or the  manet-2015-netani.cc and the febalart_manet_v1.cc 

since the the  manet-2015-netani.cc and the febalart_manet_v1.cc i assume it has to do with some functionality changed from 3.25 to 3.26

aborted. cond="!(iss.eof ())", msg="Attribute value "5.0,Max=10.0" is not properly formatted", file=../src/core/model/double.cc, line=35
terminate called without an active exception
Command ['/home/balart40/Desktop/balart40/ns/ns-allinone-3.26/ns-3.26/build/scratch/febalart_manet_v1', '--SimulatorImplementationType=ns3::VisualSimulatorImpl'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

so for the scripts that worked

the wifi-adhoc runs in the visualizer until the nodes is far from RSS, shows packets 
but the net anim shows the same thing nothing.. (attached the xml)
the wifi-simple-adhoc shows one packet
how you are running the scripts, maybe i missing something?

Im using the same terminal in which i installed 3.25, is there some env vars i need to change or i miss something?

And for the second one i have no clue since was a test i got from a template of a uni in olso, just copy pasted but shows that error on the viz SIGIOT

I´ll continue trying to see what i could do wrong
WifiAdhocNetAnim.xml
WifiSimpleAdhoc.xml

Francisco Eduardo Balart Sanchez

unread,
Nov 16, 2016, 2:34:13 PM11/16/16
to ns-3-users
Good day:

Have you got the time to see my previous post?

thanks in advance and best regards
Eduardo

Francisco Eduardo Balart Sanchez

unread,
Nov 25, 2016, 3:58:22 PM11/25/16
to ns-3-users
It seems for some reason that if i finish the simulation with --vis before it completes it does not generate any xml
if i run it without the --vis generates the traces you mentioned

a little bit of this was discussed as well here:


Thanks and best regards
Reply all
Reply to author
Forward
0 new messages