List of usable attributes for certain SetAttribute-functions

101 views
Skip to first unread message

D G

unread,
Aug 4, 2017, 11:28:26 AM8/4/17
to ns-3-users
Hello everyone,
I am pretty new to ns3 and I've got a problem.
I have no idea which attributes I may use.
For example the OnOffHelper:

OnOffHelper onOffHelper("Factory", Address);
onOffHelper.SetAttribute("Attribute", Value);

Where can I look up what attributes are availble for me to use?

It may be obvious but I unfortunately can't see it right now.

Thanks in advance.

Konstantinos

unread,
Aug 4, 2017, 2:28:22 PM8/4/17
to ns-3-users
Hi,

The list of all attributes is available here

For helper classes, such as the OnOffHelper, please refer to the underlying base class, the OnOffApplication.

Regards
K

D G

unread,
Aug 15, 2017, 5:52:00 AM8/15/17
to ns-3-users

Thank you very much.
Even though it was an obvious place to look i didn't see it :)

Best
D. G.

D G

unread,
Aug 16, 2017, 4:51:00 AM8/16/17
to ns-3-users
I still have a question related to this topic.
I now know where to find which attributes are setable, but i still have no clue which values are valid.
Looking at the referenced source code I havn't been able to look those values up, maybe there is another list which I didn't find yet.

Best
D. G.

Konstantinos

unread,
Aug 16, 2017, 4:59:21 AM8/16/17
to ns-3-users
If you open the API for a particular class, e.g. OnOffApplication, you will see the description of each of the attributes, their initial value, range (min/max) if applicable etc.

D G

unread,
Aug 16, 2017, 8:19:24 AM8/16/17
to ns-3-users
I am maybe still to blind to see it but i apreciate your effort to enlighten me, thank you.

Another example would be this from the examples.

Config::SetDefault("ns::WifiRemoteStationManager::NonUnicastMode", StringValue("DsssRate1Mbps"));

I am looking at the "All Attributes" list and I can find the list of all the WifiRemoteStationManager, so far so good.
Now I am looking at the attributes of this manager it provides these Information:

NonUnicastMode: Wifi mode used for non-unicast transmissions.
  • Set with class: WifiModeValue
  • Underlying type: WifiMode
  • Initial value: Invalid-WifiMode
  • Flags: construct write read
At this point it seems obvious that some kind of WifiModeValue is needed, the crux, however, is that I am not able to figure these out. Where can I look something like "DsssRate1Mbps"

I belive there is a pretty simple way to figure that out, but I still can't see it.

Sorry for my timeconsuming repeating questions but I really want to know that.

Thanks in advance
D. G.

Konstantinos

unread,
Aug 16, 2017, 8:45:08 AM8/16/17
to ns-3-users
Hi,

I understand your frustration and that it could be better documented for some of the attributes, but there is some intuition into this and some search within the API or 'grep' in the code.
There is no static list of available WifiMode classes, as they are updated with each wifi update. 
You can find them in the wifi-phy.h as static member functions from with you have infer the available modes. Even that is not concrete, as each Wifi standard supports different modes.
Then in the wifi-phy.cc you have several 'Configure80211xxx' methods which add the valid modes for each standard. e.g. for 802.11a you have the Ofdm6-54Mbs, which for 802.11b you have Dsss

836 void
838 {
839  NS_LOG_FUNCTION (this);
840 
849 }

853 {
854  NS_LOG_FUNCTION (this);
855 
860 }

D G

unread,
Aug 16, 2017, 9:04:21 AM8/16/17
to ns-3-users
Thank you so much Konstantions!

I confess: I am pretty knew to all this linux based work so I am not that familiar with those basic tools like grep yet.
But your answer really helped me out.

Marek Ciesla

unread,
Aug 16, 2017, 11:15:10 AM8/16/17
to ns-3-users
 A useful command for searching from the ns3 directory is :
find . -name '*.cc' | xargs grep WHAT_YOU_WANT_TO_SEARCH
Example:

find . -name '*.cc' | xargs grep MonitorSniffRx

This will output the lines where itll find MonitorSniffRx in all the .cc files that are contained in the parent directory.
Reply all
Reply to author
Forward
0 new messages