sflow-rt receiving data from mininet hosts

83 views
Skip to first unread message

Ramon Fontes

unread,
Jun 2, 2021, 8:09:22 AM6/2/21
to sFlow-RT
Can I use sflow-rt to map between sFlow agent addresses and ifIndex numbers/Mininet host/port names? I have an wireless adhoc network topology with multiple nodes and I'd like to send some objects/information to sflow-rt, such as network interface, network topology, and others.

Since I'm using mac80211_hwsim I though to take the ifIndex either from "/sys/devices/virtual/mac80211_hwsim/hwsim*/net" or "/sys/devices/virtual/net/" but they are only accessible from the nodes that are running in different network namespaces. 

Has anyone done something like that? Any suggestion?

Regards,
Ramon

Peter Phaal

unread,
Jun 2, 2021, 6:50:10 PM6/2/21
to sFlow-RT
Open vSwitch reports the port name, openflow datapath id, and openflow port for each switch port. You can query this information using the REST API, e.g.

[
 [
  {
   "metricValue": "22",
   "agent": "127.0.0.1",
   "metricName": "ifindex",
   "dataSource": "22",
   "lastUpdate": 4579
  },
  {
   "metricValue": "s1",
   "agent": "127.0.0.1",
   "metricName": "ifname",
   "dataSource": "22",
   "lastUpdate": 4579
  },
  {
   "metricValue": "0000000000000001",
   "agent": "127.0.0.1",
   "metricName": "of_dpid",
   "dataSource": "22",
   "lastUpdate": 4579
  },
  {
   "metricValue": "65534",
   "agent": "127.0.0.1",
   "metricName": "of_port",
   "dataSource": "22",
   "lastUpdate": 4579
  }
 ],
 [
  {
   "metricValue": "19",
   "agent": "127.0.0.1",
   "metricName": "ifindex",
   "dataSource": "19",
   "lastUpdate": 1558
  },
  {
   "metricValue": "s1-eth1",
   "agent": "127.0.0.1",
   "metricName": "ifname",
   "dataSource": "19",
   "lastUpdate": 1558
  },
  {
   "metricValue": "0000000000000001",
   "agent": "127.0.0.1",
   "metricName": "of_dpid",
   "dataSource": "19",
   "lastUpdate": 1558
  },
  {
   "metricValue": "1",
   "agent": "127.0.0.1",
   "metricName": "of_port",
   "dataSource": "19",
   "lastUpdate": 1558
  }
 ],
 [
  {
   "metricValue": "20",
   "agent": "127.0.0.1",
   "metricName": "ifindex",
   "dataSource": "20",
   "lastUpdate": 6581
  },
  {
   "metricValue": "s1-eth2",
   "agent": "127.0.0.1",
   "metricName": "ifname",
   "dataSource": "20",
   "lastUpdate": 6581
  },
  {
   "metricValue": "0000000000000001",
   "agent": "127.0.0.1",
   "metricName": "of_dpid",
   "dataSource": "20",
   "lastUpdate": 6581
  },
  {
   "metricValue": "2",
   "agent": "127.0.0.1",
   "metricName": "of_port",
   "dataSource": "20",
   "lastUpdate": 6581
  }
 ]
]

The sflow-rt.tar.gz distribution includes a Mininet helper script for posting topology:


You might also find the Mininet Dashboard application useful:


I haven't tried Mininet-WiFi, but any traffic flowing through Open vSwitch should be visible.

Ramon Fontes

unread,
Jun 2, 2021, 7:14:18 PM6/2/21
to Peter Phaal, sFlow-RT
Please correct me if I am wrong: it seems that the issue is that we are limited to Open vSwitch. It doesn't matter if we are using either Mininet-WiFi or Mininet. I can make it work with APs (APs are ovs switches equipped with wifi interface - e.g. https://github.com/intrig-unicamp/mininet-wifi/blob/master/examples/sflow.py). However, it doesn't work with Mininet hosts nor Mininet-WiFi stations because these nodes have their own NS and the network interface is only accessible from these nodes. 

Making sflow accessible to Mininet hosts might not seem interesting. However, in wireless adhoc networks, where stations can communicate directly without an L2/L3 device (e.g. OVS), it may be important for some use cases. I could make the switch interface work in adhoc mode and that would solve the sflow problem. However, it would create another bigger network problem, as all nodes would be able to communicate directly with each other cause all the nodes would be running in the root NS.

Sent from my android

--
You received this message because you are subscribed to a topic in the Google Groups "sFlow-RT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sflow-rt/FYeI1SWJbIY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sflow-rt+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sflow-rt/de8ecd44-fc17-46c1-b005-22ba0fc17f59n%40googlegroups.com.

Peter Phaal

unread,
Jun 2, 2021, 7:32:07 PM6/2/21
to sFlow-RT
I don't know if it is practical in your use case, but you could try running Host sFlow instances in each of the host namespaces. 

The following article provides an example of this approach using CONTAINERlab:

Ramon Fontes

unread,
Jun 2, 2021, 7:35:37 PM6/2/21
to Peter Phaal, sFlow-RT
Thanks Peter! I really appreciate your response and help.

I'm going to try your suggestion right now.

Cheers,
Ramon

Ramon Fontes

unread,
Jun 7, 2021, 8:03:33 PM6/7/21
to Peter Phaal, sFlow-RT
Hello Peter,

I've tried a different approach, and it worked for my purposes. What I did was adding an ethernet link between each station and a central OVS switch. Then, I used the traffic mirroring function from Linux Tc to copy all the data crossing the wlan interface.

Thank you one more time.

Cheers,
Ramon
Reply all
Reply to author
Forward
0 new messages