Saturday, November 21, 2026

Monitoring SRv6 uSID traffic flows

The linear topology shown in the diagram was created using Containerlab with FRR nodes implementing IPv6 segment routing (SRv6) using compact uSID (micro-SID) encoding of path segments. Each router node is instrumented using Host sFlow agents. FRR and Host sFlow are used in SONiC open source network operating system so the lab is a realistic reflection the data you would get from a production network. The sFlow telemetry is sent to an instance of the sFlow-RT real-time analytics engine in order to demonstrate visibility into SRv6 traffic flows.

Click on image to enlarge

The open source browse-flows application is an easy way to explore flows. The following command uses the sflow/prometheus Docker image, configured with the SRv6 uSID scheme and prefix:

docker run -p 6343:6343/udp -p 8008:8008 sflow/prometheus \
-Ddecode.srv6usid.scheme=f3216 \
-Ddecode.srv6usid.prefix=fcbb:bb00::

In this case, the chart displays the ingress segment list seen by each router along the path. The segment list is assembled by examining the destination IPv6 address (which can encode up to 6 uSID segments). For example, r1 encodes the path in the IPv6 address fcbb:bb00:102:103:104:105:106:107. The remaining segments are encoded in the IPv6 segment routing option fcbb:bb00:108:109:10a:10b:10c:d000. When the initial 6 segments are exhausted at router r7, the remaining segments are copied from the router option into the destination address and the ip6routesegsleft counter decrements to zero indicating that this is the final set of segments. See Defining Flows for the full set of packet attributes that can be used to filter and characterize flows.

Multipath Reliable Connection (MRC) is an extension to RoCEv2 that uses source routing to spray packets across a large number of separate paths across an AI / ML fabric in order to avoid congestion caused by large flow collisions. SRv6 uSID encoding allows MRC host adapters to explicitly select packet paths across the fabric and respond quickly to congestion or link failure. Enabling industry standard sFlow telemetry on network switches complements MRC by exposing traffic distribution, path utilization, congestion, packet loss, and failure behavior.

The two protocols are completely independent, complementary, and non-interfering:

  • MRC is implemented in the host network adapters to make an AI training network resilient and performant through packet spraying, adaptive load balancing, and rapid recovery from failures.
  • sFlow telemetry is a standard feature of the multi-plane switch fabric connecting the hosts and consumes no host resources that could interfere with MRC performance. sFlow provides independent, network-wide, visibility into how the fabric is actually behaving.
    Note: Traditional network flow based technologies (IPFIX, NetFlow, ...) struggle with packet spraying (which spreads the packets in each flow over many disjoint paths - rendering flow based monitoring in the routers ineffective). In contrast, sFlow's stateless packet oriented (rather than flow oriented) sampling and packet header export mechanism provides detailed real-time visibility without burdening the network devices making the measurements.
Getting Started describes how to quickly get a real-time sFlow analytics pipeline up and running.

Tuesday, November 3, 2026

Detecting incast congestion of RDMA flows

The recently released open source GitHub project, ai-monitor, is a proof of concept demonstrating that real-time sFlow telemetry can detect and characterize incast RoCEv2 RDMA flow collisions between GPUs during AI training.
docker run -p 6343:6343/udp -p 8008:8008 sflow/ai-monitor
The pre-built sflow/ai-monitor image is the quickest way to try out the software. The diagram at the top of this page shows test RDMA flows crossing a 4 leaf / 2 spine test network to generate an incast collision. The flows are displayed using the trace-flow application that is included in the image.

The ai-monitor application uses packet samples to detect when GPU port is oversubscribed:

  1. Detect when an leaf switch egress port utilization exceeds 80%
  2. Count the number of sources sending traffic to the port - single flows are ignored
  3. Trace each of the flows back across the topology to its source GPU

The instant the threshold is crossed, the following incast_congestion event is generated by querying information maintained within the sFlow-RT analytics engine. Real-time elephant flow monitoring in AI / ML fabrics describes how standard sFlow from data center switches streams real-time telemetry that can be used to detect elephant flows with a few milliseconds.

{
 "event": "incast_congestion",
 "agent": "172.16.0.1",
 "ifindex": "1",
 "flows": {
  "merged": 3,
  "full": 3
 },
 "sources": [
  {
   "source": "10.0.2.1",
   "bps": 925688221883.1704
  },
  {
   "source": "10.0.3.1",
   "bps": 870534914611.966
  },
  {
   "source": "10.0.4.1",
   "bps": 784496057037.5735
  }
 ],
 "bps": 321113612931.7887,
 "time": 1793734322720,
 "node": "leaf1",
 "port": "Ethernet1/1",
 "destination": "10.0.1.1",
 "paths": [
  {
   "keys": {
    "ipsource": "10.0.2.1",
    "ipdestination": "10.0.1.1",
    "udpsourceport": "64160",
    "udpdestinationport": "4791",
    "ibbtdestinationqp": "14449313"
   },
   "path": [
    {
     "node": "leaf2",
     "agent": "172.16.0.2",
     "port": "Ethernet1/1",
     "values": [
      64
     ],
     "dataSource": "1",
     "value": 15726107505.399204
    },
    {
     "agent": "172.16.0.6",
     "remotenode": "leaf2",
     "values": [
      63
     ],
     "localnode": "spine2",
     "localport": "Ethernet2/1",
     "remoteport": "Ethernet3/1",
     "linkname": "leaf2-spine2-0",
     "dataSource": "2",
     "value": 15310584095.297842
    },
    {
     "agent": "172.16.0.1",
     "remotenode": "spine2",
     "values": [
      62
     ],
     "localnode": "leaf1",
     "localport": "Ethernet3/1",
     "remoteport": "Ethernet1/1",
     "linkname": "leaf1-spine2-0",
     "dataSource": "3",
     "value": 14456650141.853611
    }
   ]
  },
  {
   "keys": {
    "ipsource": "10.0.3.1",
    "ipdestination": "10.0.1.1",
    "udpsourceport": "51329",
    "udpdestinationport": "4791",
    "ibbtdestinationqp": "8669314"
   },
   "path": [
    {
     "node": "leaf3",
     "agent": "172.16.0.3",
     "port": "Ethernet1/1",
     "values": [
      64
     ],
     "dataSource": "1",
     "value": 14491953189.079569
    },
    {
     "agent": "172.16.0.5",
     "remotenode": "leaf3",
     "values": [
      63
     ],
     "localnode": "spine1",
     "localport": "Ethernet3/1",
     "remoteport": "Ethernet2/1",
     "linkname": "leaf3-spine1-0",
     "dataSource": "3",
     "value": 12347461757.959143
    },
    {
     "agent": "172.16.0.1",
     "remotenode": "spine1",
     "values": [
      62
     ],
     "localnode": "leaf1",
     "localport": "Ethernet2/1",
     "remoteport": "Ethernet1/1",
     "linkname": "leaf1-spine1-0",
     "dataSource": "2",
     "value": 13595310385.61916
    }
   ]
  },
  {
   "keys": {
    "ipsource": "10.0.4.1",
    "ipdestination": "10.0.1.1",
    "udpsourceport": "50140",
    "udpdestinationport": "4791",
    "ibbtdestinationqp": "2638813"
   },
   "path": [
    {
     "node": "leaf4",
     "agent": "172.16.0.4",
     "port": "Ethernet1/1",
     "values": [
      64
     ],
     "dataSource": "1",
     "value": 13670813591.56359
    },
    {
     "agent": "172.16.0.6",
     "remotenode": "leaf4",
     "values": [
      63
     ],
     "localnode": "spine2",
     "localport": "Ethernet4/1",
     "remoteport": "Ethernet3/1",
     "linkname": "leaf4-spine2-0",
     "dataSource": "4",
     "value": 14294256814.497116
    },
    {
     "agent": "172.16.0.1",
     "remotenode": "spine2",
     "values": [
      62
     ],
     "localnode": "leaf1",
     "localport": "Ethernet3/1",
     "remoteport": "Ethernet1/1",
     "linkname": "leaf1-spine2-0",
     "dataSource": "3",
     "value": 12251625078.67275
    }
   ]
  }
 ]
}
The event has three types of information:
  1. The switch leaf1 and port Ethernet1/1 experiencing the incast congestion event
  2. The sources of the traffic 10.0.2.1, 10.0.3.1 and 10.0.4.1
  3. The paths that each QP flow takes across the fabric (sorted by TTL)
This proof of concept demonstrates how real-time analytics can be used to monitor the state of large AI / ML fabrics in real-time using standard instrumentation built into data center switches. Offloading monitoring from hosts to the network hardware frees up resources on the hosts and ensures monitoring doesn't perturb machine learning tasks.

The recent NANOG talk, Monitoring RoCEv2 with sFlow,  describes the latest developments by the sFlow community to address the requirements of AI / ML workloads, including transit delay (in nanoseconds), queue depth, dropped packet notifications, and related upgrades to the open source SONiC network operating system. In addition, sFlow's export of sampled packet headers future proofs measurements to provide visibility into new protocols such as MRC / IPv6 uSID segment routing used in the newest generation of ML supercomputing clusters, OpenAI Supercomputer networking to accelerate large scale AI training.

Wednesday, October 28, 2026

Booth Demo

Quickly engaging an audience is a challenge at a trade show - all Ethernet switches look pretty much the same and they don't do much other than blink LEDs. Real-time sFlow telemetry is a core feature of switches that can be used to create intriguing animated dashboards that draw customers into the booth by demonstrating how the switch addresses their needs.

The example above uses the open source sFlow-RT booth-demo application to demonstrate a 400G data center switch carrying RoCEv2 test traffic. The demo shows a series of RDMA write operations in the Traffic Trend chart. The Switch Port Traffic Flows diagram shows the paths traffic takes as it flows through the switch. In this example, a NCCL ring topology results traffic flowing from port to port as it goes around the logical ring of GPUs.

The quickest way to set up the demo is to run the a pre-built sflow/booth-demo image on a laptop connected to the booth display screen. The Traffic Trend chart is easily customizable to show different flow attributes that are relevant to the demo and the title can be changed to include branding and messaging. If more extensive customization is required, clone the GitHub project and modify it to suit your demo, see Writing Applications.

The Getting Started guide describes how to set up sFlow-RT, describes some of the other tools included in the image, and provides an overview of real-time analytics customer solutions.

Sunday, September 20, 2026

Real-time elephant flow monitoring in AI / ML fabrics

The diagram shows a Probability Density Function (PDF) of the time taken to fill a default 1,400 byte sFlow datagram for a 400G switch port, randomly sampling 1-in-100,000 packets, handling a line rate RoCEv2 RDMA transfer using 4096 byte packets.

Calculations:

  • Packet Size (4KB): 4,096 bytes × 8 bits/byte = 32,768 bits
  • Line Rate Packet Speed: 400,000,000,000 bits/sec ÷ 32,768 bits = 12,207,031.25 packets per second
  • Average Time per Packet: 1 ÷ 12,207,031.25 pps = 81.92 nanoseconds
  • Average Sample Interval: 81.92 nanoseconds × 100,000 = 0.008192 seconds (8.192 ms)
  • Default 1400 byte sFlow datagrams fills with 6 packet samples (each sample containing 128 bytes of packet header + metadata)
  • Time taken to fill the datagram with 6 samples given by the Erlang-6 distribution
  • Mean: 49.15ms, Median: 46.45ms, Standard Deviation: 20.07ms
  • sFlow agent required to send UDP datagram as soon as buffer fills
  • Network transit delay is less than 1ms and can be ignored
  • Maximum delay is 1000ms. sFlow agent required to send datagram within 1 second of the first record being added

The net result is that an sFlow analyzer will receive streaming telemetry describing an elephant flow within 100ms of the flow start and on average every 50ms for the duration of the flow. The resulting 120 packet headers per second allows the analyzer to provide detailed information on individual RDMA transfers between Infiniband Queue Pairs (QP).

Varying the sampling rate has a significant impact on response time and variability. The current setting of 1-in-100,000 is a good balance between fast response, low overhead on switch, and a datagram rate that can scale to large numbers of switch ports. For example a 64 port switch with all ports handling line rate RDMA flows would generate only 1280 sFlow datagrams per second. Enabling sFlow on all switches and ports in the AI/ML fabric provides a comprehensive view of end-to-end traffic.

In practice, the 100ms fill time for one port can be treated as an upper bound since more than one switch port is typically active at a time. The combined samples from all the active ports cause the datagram fill time to be significantly reduced. The diagram shows that with five active ports fill time drops below 20ms.

The chart from AI / ML network performance metrics at scale shows the result of combining data from all the links in the fabric: The signals are highly correlated since the AI training compute / exchange cycle is synchronized across all compute nodes in the cluster. Constructive interference from combining data from all the links removes the noise in each individual signal and clearly shows the traffic pattern for the cluster.

The sFlow-RT real-time analytics engine processes sFlow telemetry from the fabric to characterize sub-second network wide traffic patterns. See Live Dashboards for examples, including the real-time heatmap shown above.

Tuesday, August 25, 2026

Testing DDoS mitigation software

The recently released open source sflowgen tool is a synthetic sFlow generator intended for testing, demonstrations, dashboards, and attack-detection validation. This article uses sflowgen to test the DDoS Protect application.

The screen capture shows how sflowgen DDoS attack telemetry appears in the DDoS Protect dashboard. Charts in the dashboard show different types of DDoS attack. You can see normal low level background activity below the red horizontal threshold line. DDoS traffic can be seen ramping up on the udp_flood and ip_flood charts and leveling off once the attack reaches maximum intensity. Notice that as soon as the attack traffic crosses the threshold, the Controls chart indicates that a Pending control has been created to mitigate the attack.

The Controls table shows the udp_flood attack against host 10.10.0.42 using port 443 as the attack vector. In this case the control action is set to drop, i.e. use a Remotely Triggered Black Hole (RTBH) as the mitigation action. The pending status indicates that it is waiting for user confirmation before being applied.

The Settings tab has been configured to add a local address group containing the 10.10.0.0/24 and 2001:db8:10::/64 CIDRs used in the default sflowgen examples. In addition the udp_flood attack mitigation setting has been set to drop.

./bin/sflowgen ambient --config examples/ambient.yaml
Starts the ambient background traffic.
./bin/sflowgen attack --config examples/attack-ipv4.yaml
Adds the simulated attack traffic.
DDoS protection quickstart guide provides details on how to configure BGP RTBH / FlowSpec with Arista, Cisco, and Juniper routers. With DDoS Protect set to Automatic mode, mitigation actions occur the instant the attack is detected and the traffic is blocked before the attack fully develops. Fast automated DDoS detection and mitigation is essential to protect against the costly disruption caused by DDoS flood attacks.

Tuesday, May 19, 2026

Fixing Ghost Drops: How eBPF Rescued IPv6 Telemetry


A customer complains that they aren't getting IPFIX flow data from a router.

Use socat to check that IPFIX is being received (IANA assigned port for IPFIX is 4739):

socat -b 0 -dd -u UDP6-RECV:4739 - 2>&1
Output demonstrates that at least some IPFIX messages can be received when listening on port 4739.
2026/05/15 22:46:32 socat[108419] N using stdout for writing
2026/05/15 22:46:32 socat[108419] N starting data transfer loop with FDs [5,5] and [1,1]
2026/05/15 22:46:33 socat[108419] N received packet with 0 bytes from AF=10 [fec0:0000:0000:0000:0001:000c:2744:69f1]:50978
2026/05/15 22:46:33 socat[108419] N received packet with 0 bytes from AF=10 [fec0:0000:0000:0000:0001:000c:2744:69f1]:50978
Use tcpdump to check for IPFIX packets. This gives visibility into packets before the host network stack, so you can see packets before they are dropped by host network stack or host firewall
tcpdump -i enp0s3 -n udp port 4739
The output shows that IPFIX datagrams are being received from a second source, fec0::1:c:2744:69f0, but they aren't showing up in the socat output, so the Linux kernel must be dropping them for some reason.
dropped privs to tcpdump
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on enp0s3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
21:09:57.217821 IP6 fec0::1:c:2744:69f1.50978 > fec0::27ff:fe8d:4f0b.ipfix: UDP, length 1432
21:09:57.217921 IP6 fec0::1:c:2744:69f0.50978 > fec0::27ff:fe8d:4f0b.ipfix: UDP, length 1428
A check of the host firewall and reverse path filtering settings don't explain the drops, so take a more detailed look with tcpdump with the -v (verbose) option.
tcpdump -i enp0s3 -nv udp port 4739
This time we see that packets from fec0::1:c:2744:69f0 have a bad UDP checksum.
dropped privs to tcpdump
tcpdump: listening on enp0s3, link-type EN10MB (Ethernet), snapshot length 262144 bytes
22:07:36.443823 IP6 (flowlabel 0x1991c, hlim 64, next-header UDP (17) payload length: 1230) fec0::1:c:2744:69f1.50978 > fec0::27ff:fe8d:4f0b.ipfix: [udp sum ok] UDP, length 1222
22:07:37.356528 IP6 (flowlabel 0x1991c, hlim 64, next-header UDP (17) payload length: 1008) fec0::1:c:2744:69f0.50978 > fec0::27ff:fe8d:4f0b.ipfix: [bad udp cksum 0xfc60 -> 0xfb60!] UDP, length 1000
Verify by looking at the UDP error counter:
nstat -az Udp6InErrors
Results show an increasing error counter, confirming that the packets are being dropped by the Linux kernel.
#kernel
Udp6InErrors                    5106               0.0
Unfortunately, simple fixes that might work for IPv4 (disabling/ignoring UDP checksum) are not available for IPv6, see RFC 8200 Internet Protocol, Version 6 (IPv6) Specification
Unlike IPv4, the default behavior when UDP packets are originated by an IPv6 node is that the UDP checksum is not optional. That is, whenever originating a UDP packet, an IPv6 node must compute a UDP checksum over the packet and the pseudo-header, and, if that computation yields a result of zero, it must be changed to hex FFFF for placement in the UDP header. IPv6 receivers must discard UDP packets containing a zero checksum and should log the error.
Ideally the router would send IPFIX with correctly computed UDP checksum and on closer examination it looks that some IFPIX messages from the router do have a correct UDP checksum while others do not. The messages with the correct checksum originate from the routers management CPU, while the messages with incorrect checksum are being directly generated in hardware by the routing chip.

This isn't too surprising - if this were IPv4 export, the hardware could set the UDP checksum to zero (since it is optional) and there would be no issue, However, with IPv6 the mandatory checksum must be computed - a complex calculation that is likely to produce errors.

Computation of the UDP checksum involves creating an IPv6 pseudo header (shown above) and then calculating the checksum over the IPv6 pseudo header, the UDP header, and the UDP payload.

Ideally, the router vendor will fix the issue, but it may not be possible if there are hardware limitations, or it may take time if a fix isn't seen as a priority, so a workaround is needed.

This is where eBPF comes to the rescue! The GitHub fix-udp6-checksum project uses an eBPF program, fix_checksum.c, to compute and rewrite the UDP checksum before the IPFIX packet is handed to the Linux network stack.

Dowload and compile the fix_checksum.c program on a system running Docker:

git clone https://github.com/inmoncorp/fix-udp6-checksum.git
cd fix-udp6-checksum
./build.sh

Copy the resulting fix_checksum.o file to the IPFIX collector.

Install the eBPF program on interface enp0s3

sudo tc qdisc add dev enp0s3 clsact
sudo tc filter add dev enp0s3 ingress bpf da obj fix_checksum.o sec tc/ingress

Check to see that the filter has been installed

sudo tc -s filter show dev enp0s3 ingress
The output shows that the filter is installed and that the eBPF Just-In-Time (JIT) compiler has run for maximum performance.
filter protocol all pref 49151 bpf chain 0 
filter protocol all pref 49151 bpf chain 0 handle 0x1 fix_checksum.o:[tc/ingress] direct-action not_in_hw id 230 name fix_ipfix_check tag c6a96524b9f80adb jited
Finally, using socat to verify that the missing IPFIX data is being received:
2026/05/18 14:06:02 socat[945320] N using stdout for writing
2026/05/18 14:06:02 socat[945320] N starting data transfer loop with FDs [5,5] and [1,1]
2026/05/18 14:06:03 socat[945320] N received packet with 0 bytes from AF=10 [fec0:0000:0000:0000:0001:000c:2744:69f1]:50978
2026/05/18 14:06:03 socat[945320] N received packet with 0 bytes from AF=10 [fec0:0000:0000:0000:0001:000c:2744:69f0]:50978
eBPF is a game changer, providing the ability to change how Linux processes packets without having to build a new kernel or even reboot a production system. What would otherwise have been a major issue is transformed into a relatively straightforward fix and a happy customer.

Tuesday, April 14, 2026

Four public live production flow analytics dashboards

The following publicly accessible dashboards show live data from operational networks, including: an AI/ML RoCEv2 fabric, a world-wide Kubernetes cluster, and an Internet Exchange Provider (IXP). Click on the [ LIVE DASHBOARD ] link under each screen capture to access the live dashboard.

San Diego Supercomputer Center Expanse Cluster AI/ML dashboard using ai-metrics application. See AI Metrics with Prometheus and Grafana for detailed, step-by-step, instructions for setting up monitoring and dashboard.

San Diego Supercomputer Center Expanse Cluster AI/ML traffic matrix using heatmap application. See Real-time visualization of AI / ML traffic matrix for an explanation of the chart with examples.

National Research Platform Nautilus Cluster GPU, CPU, and network resources in world-wide Kubernetes cluster using sunburst application. See Real-time Kubernetes cluster monitoring example for more details and step-by-step instructions for deploying monitoring.

San Francisco Metropolitan Internet Exchange overall traffic dashboard using ixp-metrics application. See Internet eXchange Provider (IXP) Metrics for detailed, step-by-step, instructions for setting up overall exchange traffic and per member peering traffic dashboards.

Live Dashboards maintains a current list publicly accessible dashboards. If you have dashboard to share, would like help learning to build your own dashboards, or have a general interest in real-time flow analytics (DDoS mitigation, traffic engineering, etc), then you are welcome with the community of users and developers.

The Getting Started guide provides step by step instructions for setting up real-time traffic analytics. Even if you don't have immediate access to a network, Real-time network and system metrics as a service describes how to replay captured sFlow data to explore the capabilities of the software on your laptop. Alternatively, sflow-rt/containerlab includes projects that emulate leaf and spine networks, EVPN, and DDoS mitigation, that can be run on a laptop using Docker Desktop.