[ixpmanager] sflow not visible with Arista Reseller Ports

Dominik Bay db at rrbone.net
Tue Oct 12 10:21:51 IST 2021


On 10/11/21 18:15, Nick Hilliard wrote:
> Dominik Bay wrote on 11/10/2021 10:45:
>> When I check the sflow pcap, I only see sflow.flow_sample.index ==
>> ifIndex of the parent interface. Only in sflow_245.vlan.in /
>> sflow_245.vlan.out I see the VLAN of the reseller port.
>>
>> So I guess there's some matching going wrong in the IXPM sflow
>> collector? Or did I miss an Arista setting?
> 
> Arista is basically doing the right thing.  But at the moment, IXP-M
> doesn't properly support resellers via breakout trunk ports.  Apart from
> some UI stuff, there are a couple of DB schema enhancements that it
> needs, which we didn't want to go near until the Doctrine->Eloquent
> migration was complete.  When this code is written, we'll have the
> capability to specify per customer vlans, which will allow the sflow
> collection tool to map these flows properly.

Thanks for the explanation. I thought the same when I checked the IXP-M
code and how things are handled. In combination with the vlan fields in
the sflow data I figured there are some pieces missing.

Fortunately Alex Senderkin from BCIX lend me a hand. He already got a
workaround.

It relies on configured MAC addresses and needs manual intervention each
time a peer changes. There's a function added to the sflow handler which
fixes the vlan stuff so IXP-M can use it again.

diff --git a/tools/runtime/sflow/sflow-to-rrd-handler
b/tools/runtime/sflow/sflow-to-rrd-handler
index 796caaa28..800a1c9c0 100755
--- a/tools/runtime/sflow/sflow-to-rrd-handler
+++ b/tools/runtime/sflow/sflow-to-rrd-handler
@@ -156,6 +156,8 @@ while (<SFLOWTOOL>) {
                next;
        }

+        $vlan = rewrite_subint_vlan ($agent, $srcswport, $vlan);
+
        my $srcvli = getvlifrommactable ($mactable, $infraid, $vlan,
$srcmac);
        my $dstvli = getvlifrommactable ($mactable, $infraid, $vlan,
$dstmac);

@@ -444,3 +446,34 @@ sub reload_mactable

        return $json;
 }
+
+sub rewrite_subint_vlan
+{
+        my ($agent, $srcswport, $vlan) = @_;
+
+        ### ISP A via ISP B
+        if($agent eq '1.2.3.4' && $srcswport == '50001' && $vlan == '3025')
+        {
+                return '100';
+        }

[add other peers here]

+        return $vlan;
+}

where agent is the sflow Agent IP, 50001 is the ifIndex of the physical
port and vlan is the vlan ID of the reseller port.

One can easily find these values via sflowtool -4 -p 6343 -l | grep
"1.2.3.4" | grep "MACofPeer" or do a tcpdump capture and comfortably
drill down in Wireshark.

Thanks again to Alex for this workaround :)

Cheers,
Dominik

-- 
rrbone GmbH - Ruhrallee 9 - 44139 Dortmund
HR B 23168 Amtsgericht Dortmund - Geschaeftsfuehrer: Dominik Bay


More information about the ixpmanager mailing list