Netlink on DCE

113 views
Skip to first unread message

Matt Anonyme

unread,
Apr 20, 2015, 3:31:11 PM4/20/15
to ns-3-...@googlegroups.com
Hi,

I am trying to run  program under DCE that uses netlink to be notified of IP change events.

Right now it crashes:
====
0.600099s 1 DceTime:dce_gmtime(0x136ac80, 1)
0.600099s 1 Dce:dce_inet_ntop(0x136ac80, 1, 2, 0x7f87e1c68028, , 128)
0.600099s 1 Dce:dce_inet_ntop(0x136ac80, 1, 2, 0x7f87e1c68060, , 128)
0.600099s 1 Dce:dce_inet_ntop(0x136ac80, 1, 2, 0x7f87e1c68044, , 128)
0.600099s 1 ProcessUtils:UtilsAllocateFd(0x136ac80)
0.600099s 1 ProcessUtils:UtilsAllocateFd(): [DEBUG] Allocated fd=4
0.600099s 1 ProcessUtils:UtilsGetRealFilePath(0x136ac80, /proc/net/if_inet6)
0.600099s 1 ProcessUtils:UtilsGetVirtualFilePath(0x136ac80, /proc/net/if_inet6)
0.600099s 1 ProcessUtils:UtilsAllocateFd(0x136ac80)
0.600099s 1 ProcessUtils:UtilsAllocateFd(): [DEBUG] Allocated fd=4
assert failed. cond="m_ipv4Routing != 0", msg="Netlink Socket requires Ipv4DceRouting to be installed on the node", file=../netlink/netlink-socket.cc, line=277
terminate called without an active exception
====
While I could find the helper, I was hoping an example on how to install Ipv4DceRouting couild be pushed to DCE repository please ?

Best regards
Matt

Richard

unread,
Apr 22, 2015, 4:21:23 PM4/22/15
to ns-3-...@googlegroups.com
I'm assuming you are missing the following;

LinuxStackHelper stack;
Ipv4DceRoutingHelper ipv4RoutingHelper;
stack
.SetRoutingHelper (ipv4RoutingHelper);
stack
.Install (nodes);

Without a sample of your code though, I can't be 100% sure, this is covered somewhere in the documentation/examples but I can't recall where exactly. 

Matt

unread,
Apr 24, 2015, 7:34:14 AM4/24/15
to ns-3-...@googlegroups.com
Do you know if I must use the kernel or if there is a stub
implementation of Netlink (so that I can test without the kernel) ?
> --
> 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/EoZ6DssRiqM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ns-3-users+...@googlegroups.com.
> To post to this group, send email to ns-3-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

Richard

unread,
Apr 25, 2015, 6:58:07 PM4/25/15
to ns-3-...@googlegroups.com
As far as I know, you will need to use the kernel.

As a side note, I've had some issues with libnl inside DCE, libmnl has been much more stable. 

Matt Anonyme

unread,
Apr 26, 2015, 7:13:04 PM4/26/15
to ns-3-...@googlegroups.com
I used you code but replaced  the LinuxStackHelper by InternetStackHelper and so far it looks ok.

Thanks a lot !

Matt Anonyme

unread,
Apr 28, 2015, 3:07:27 PM4/28/15
to ns-3-...@googlegroups.com
Hi,

I am looking for the best way to debug netlink communications within DCE. I have got an error when calling dce_getifaddrs:
====
0.600022s 1 SimuFd:dce_recvmsg(0x8f6680, nodeId=, 1,  fd=, 5,  msg=, 0x7f82f1d2f170,  flags=, 0)
0.600022s 1 UnixDatagramSocketFd:DoRecvmsg(0x99c830, 0x8f6680, flags=, 0)
0.600022s 1 UnixDatagramSocketFd:DoRecvmsg(): [WARN ] msg_controllen < 0 , is that a problem ? <==== this is the error => returns -1  => error => dce_exit
0.600022s 1 SimuFd:dce_recvmsg(0x8f6680, nodeId=, 1,  fd=, 5,  msg=, 0x7f82f1d2f170,  flags=, 0)
0.600022s 1 UnixDatagramSocketFd:DoRecvmsg(0x99c830, 0x8f6680, flags=, 0)
0.600022s 1 UnixDatagramSocketFd:DoRecvmsg(): [WARN ] Kesako ?
1.6s 1 ProcessUtils:UtilsDoSignal(): [DEBUG] deliver signal=14
1.6s 1 SimuFd:dce_write(0x8f6680, 1, 1, 0x7f82e9b1b90d, 28)
1.6s 1 UnixFileFd:Write(0x8916d0, 0x8f6680, 0x7f82e9b1b90d, 28)
1.6s 1 UnixDatagramSocketFd:DoRecvmsg(): [WARN ] Empty packet
1.6s 1 DceNetdb:netlink_request(): [WARN ] read_len=-1 < 0
1.6s 1 DceNetdb:dce_getifaddrs(): [WARN ] Could not RTM_GETLINK.
====
Ideally I would like to export this to a pcap file and open it with wireshark dissector (https://www.wireshark.org/docs/dfref/n/netlink.html). Any idea on how to best tackle this pb please ?

Matt
Message has been deleted

Mohammad Abu Shattal

unread,
Jul 27, 2015, 12:54:22 PM7/27/15
to ns-3-users, matt...@gmail.com
Hello All,
I'm trying to sniff packets over DCE using libpacp, the code is worknig fine my my native mahcine. Hever, I have this error message related to Netlink issue discussed here.

 
assert failed. cond="m_ipv4Routing != 0", msg="Netlink Socket requires Ipv4DceRouting to be installed on the node", file=../netlink/netlink-socket.cc, line=277
terminate called without an active exception
Fatal Python error: Aborted

I followed discussion above but recevied the follwoing error when I tried to setnetwork stack:

Code:
dceManager = ns.dce.DceManagerHelper()
dceManager.SetNetworkStack ("ns3::LinuxSocketFdFactory", "Library", ns.core.StringValue ("liblinux.so"))
stack = LinuxStackHelper()
stack.Install (node);
Error:
dceManager.SetNetworkStack ("ns3::LinuxSocketFdFactory", "Library", ns.core.StringValue ("liblinux.so"))
AttributeError: 'dce.DceManagerHelper' object has no attribute 'SetNetworkStack'

Is this related to installation error? since it is supported by the API.
any suggestion to solve both problems?

Thanks .....

Matt Anonyme

unread,
Jul 27, 2015, 3:22:01 PM7/27/15
to ns-3-users, eng...@gmail.com
Hi,

You can look in https://github.com/teto/ns-3-dce/blob/clock_support/myscripts/ntp/dce-ntpd.cc to setup "Ipv4DceRoutingHelper ipv4RoutingHelper;".
Beware that netlink support in DCE has some problems. I intend to send a patch this week but I dunno when.

Good luck to you

Mohammad Abu Shattal

unread,
Jul 27, 2015, 4:00:50 PM7/27/15
to ns-3-users, matt...@gmail.com
Thank you Matt for your reply.

I reviewed the file you mentioned above, I'm scripting the ns3 code in python and the problem is that I couldn’t set the network stack.
Do you have any idea why the interpreter/compiler doesn't "see"  this function, although it sees all other DCE-application-manager-helper functions ..

Thank you ....

Matt

unread,
Jul 27, 2015, 4:48:09 PM7/27/15
to Mohammad Abu Shattal, ns-3-users
Sorry I don't use the bindings so I don't know why it doesn't appear.
My advice would be to look in wscript files and in the "bindings"
folder.

Mohammad Abu Shattal

unread,
Jul 27, 2015, 5:52:19 PM7/27/15
to ns-3-users
Thank you for your reply. I will will follow your recommendation to see what's going on with wscript and Python binding.
Thanks
Reply all
Reply to author
Forward
0 new messages