How to properly connect Trace Sources using Config::Connect??

440 views
Skip to first unread message

Moyukh Laha

unread,
Sep 21, 2017, 11:06:01 AM9/21/17
to ns-3-users

Hello friends,
                   I have doubts on how to connect trace sources using Config::Connect. From 'All Trace Sources' in documentation I can find the trace sources available. Then by looking into it I can also find Config Paths. But what is written in the documentation is not working all the time. For example-- ns3::WifiPhyStateHelper has one Trace source State.
                   And in the Documentation the config path is given as:   "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy/State"...............however in one example I find --"/NodeList/0/DeviceList/*/Phy/State/State" with that "$ns3::WifiNetDevice" part missing. [ example/wireless/wifi-sleep.cc example] 
Surprisingly, both the config paths are working.
Why is that? How do I know which GetObject part is to be taken or not? Is there any redundancy?  Is there any method to understand that?? Please help.

Thanks!

Konstantinos

unread,
Sep 22, 2017, 4:35:24 AM9/22/17
to ns-3-users
Hi,

As the API suggests, there are TWO possible config paths for this class. 
    • "/NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy/State"
    • "/NodeList/[i]/DeviceList/[i]/$ns3::WaveNetDevice/PhyEntities/[i]/State"
    As you can see, the first assumes a single Phy element, while the second has PhyEntities and WaveNetDevice. This is for the case of WAVE (802.11p), where you may have multiple channels.
    In other cases/classes there may be only one or multiple.

    Now, to use the path, you will need to replace "[i]" with a number or the wildcard "*" (star)

    Now, regarding the particular example you mention, I can't comment, but I would recommend to follow the config path as reported in the API.

    Regards
    K

    Moyukh Laha

    unread,
    Sep 23, 2017, 2:18:12 AM9/23/17
    to ns-3-...@googlegroups.com
    Thanks K!

    --
    Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
    ---
    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/H76Fjdru4Mo/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to ns-3-users+unsubscribe@googlegroups.com.
    To post to this group, send email to ns-3-...@googlegroups.com.
    Visit this group at https://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