Object names seem not to work properly

37 views
Skip to first unread message

Yuxiang

unread,
Nov 26, 2018, 3:20:00 AM11/26/18
to ns-3-users
Hello everyone,

I met a question as I tried running examples/naming/object-names.cc. I find that Config::Set ("/Names/client/eth0/Mtu", UIntegerValue (1234)) does not have any effect on attributes mtu, but Config::Set ("/NodeList/1/eth0/Mtu", UIntegerValue (1234)) could indeed alter the attribute value. I really appreciate it if someone could tell me why the object name does not work. Many thanks.

Best,
Yuxiang

jared...@gmail.com

unread,
Nov 27, 2018, 4:41:01 PM11/27/18
to ns-3-users
Did you actually create the named object via something like

Ptr<Node> nodeObject = …;
Names::Add("client", nodeObject);
Names::Add("client", "eth0", nodeObject->GetDevice(0));

Named objects don't exist by default, you have to explicitly create that name / object association.

Good luck,
Jared.

Yuxiang

unread,
Nov 27, 2018, 7:49:08 PM11/27/18
to ns-3-users
Hi Jared,

Thanks for the reply. Actually the script I use do associate the name with the corresponding object. You could find the example script I use under examples/naming/object-names.cc without any modification.

Best regards,
Yuxiang

Yuxiang

unread,
Dec 4, 2018, 6:56:14 AM12/4/18
to ns-3-users
hi everyone,

After several tries, I find if I do not install internet stack on the node, the aforementioned problem disappears, i.e., the attribute can be properly configured by Config::Set ("/Names/client/eth0/Mtu", UIntegerValue (1234)). This phenomenon really confuses. Could anyone give me some help? Many thanks.

Yuxiang

unread,
Dec 5, 2018, 12:27:30 AM12/5/18
to ns-3-users
Hi,

I find [Bug 2765 Config::Set may fail to set the attribute by using Names::Add] describes exactly the same problem I met. Has this bug already been fixed or is there any solution (The link therein seems no more valid)? Many thanks.

Best,
Yuxiang

Yuxiang

unread,
Dec 6, 2018, 8:18:43 PM12/6/18
to ns-3-users
Hi all,

the developer who reported Bug 2765 actually proposed a possible solution, which at least works in my case.

Best,
Yuxiang
Reply all
Reply to author
Forward
0 new messages