-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow packet has only one defined interface #71
Comments
Yes. The interface number 0x3FFFFFFF means "internal" in sFlow. In a regular network switch we use "internal" for all packets that were to/from the switch CPU, such as SNMP request/response packets. That's because the SNMP MIB-II ifTable (usually) does not have an entry that represents the local CPU. When monitoring a server like this, the model is similar. It's like a switch with one port. Everything to/from the host is considered to be to/from the "internal" interface. When you sample using pcap { dev=eth1 } you are enabling bidirectional sampling on that NIC and adopting that model. If you think of the whole packet-switched network as a graph then what you are saying is that this NIC represents the entry-point to the graph. It's a little different if you ask hsflowd to monitor a virtual switch such as Open vSwitch or the Docker bridge, because then you are allowing the network-graph to extend to the virtual switch ports. But after that the model is the same. Note that this issue is similar to this one about proxy forwarding: |
It seems that I do not understand something.
And I see the same situation.
Should it be one filled interface in raw and the other interface should be , if traffic is forwarded between two interfaces (eth1, eth2)? |
Yes, strictly speaking that would be more correct, but hsflowd does not know all the details of the forwarding decision in each case. An sFlow agent embedded in the FRR routing engine that VyOS runs could probably populate in+out ports correctly, but here hsflowd is running as a regular systemd service only knows so much. If hsflowd were to query the routing tables via netlink then it might do better, but this is where Linux can be tricky. You would have to know which routing table to query, and that might depend on a mark set by iptables/nftables. Furthermore, even if you can look up the L3 route, there might still be ECMP options and the decision on which L2 component link to send the packet out on might be made somewhere else. So the disaggregated nature of Linux networking makes this harder. When sFlow is implemented on an ASIC it can be architected to attach the right metadata to each sample down in the silicon (although some ASICs do not do any better than what you are seeing here). Open vSwitch and VPP agents have a better chance of knowing more about the forwarding too. Doing the same thing for generic Linux networking is a challenge. The good news is that most of the value provided by sFlow is still there. You know what the traffic is on each link, and your collector has the information to resolve the traffic matrix for the whole network. If your collector can run BGP peering then some of the missing routing information can be spliced in that way. |
Debian 12.2.0-14. VyOS 1.5 rolling release
I build and install the latest package of hsflowd 2.1.12-4
Interface configuration.
ICMP traffic is generated from host 192.168.30.10 to host 192.168.40.10 via this router.
sFlow config:
If I run hsflowd in debug mode I see only one interface is defined. The other interface is not found.
As a result, one of the interface indexes is 1073741823 in the flow packets.
Is it a normal situation or not? If yes, can you explain why?
The text was updated successfully, but these errors were encountered: