MultiCast Tree
MultiCast Tree
MultiCast Tree: Real-Time Home Network Traffic Visualizer with W5500 and WS2812 LED Strip
A humorous but technically impressive home network monitor that uses W5500-equipped Arduino to receive UDP traffic data from distributed edge routers and visualizes it in real time on a WS2812 LED strip — revealing TCP/UDP/ICMP flows, broadcast storms, and multicast patterns at a glance.
PROJECT DESCRIPTION
1. Project Background and Technical Goals
Most home networks operate invisibly — routers process packets silently, and the only indication of a problem is when something stops working. This project was initiated to change that by building a real-time, physical network traffic visualizer: a "MultiCast Tree" that makes network activity tangible and observable.
The network spans 4 segments, each connected to the Internet via Asus edge routers. An OPNsense box (FreeBSD 14.1) serves as the central aggregator, running BPF (Berkeley Packet Filter) to examine raw Ethernet frames. The core challenge is to collect live traffic statistics — RX/TX byte counts, TCP/UDP/ICMP connection counts, multicast/broadcast ratios — from multiple distributed routers, deliver them to a microcontroller, and render them meaningfully on a WS2812 LED strip with sub-second latency.
The project's name is intentionally ironic: "MultiCast Tree" does not actually use IP multicast for internal communication. With only 1 receiver and 4 senders, true multicast would be wasteful. UDP unicast to a single OPNsense collector, combined with W5500-equipped Arduino as the display node, delivers the same result with minimal network overhead — approximately 8MB of daily traffic per edge node.
2. Key Technical Elements and Selection Reasons (Methodology)
Components were selected for cost-effectiveness, Linux/BSD compatibility, and real-time performance.
Edge Nodes (Asus Routers with Fluxstream): Asus consumer routers running a stripped BusyBox Linux 2.6 kernel serve as the 4 edge monitoring points. A custom tool called "Fluxstream" — cross-compiled for MIPS — runs on each router and transmits live traffic statistics once per second via UDP. Despite the aged kernel, these devices provide the one critical capability that matters for this role: Wi-Fi. OPNsense (BSD-based) remains limited in Wi-Fi chipset driver support, making Asus routers the pragmatic choice for wireless-connected network segments.
Central Aggregator (OPNsense / FreeBSD 14.1): The OPNsense box serves dual roles: it receives UDP packets from all 4 edge routers, and it independently runs BPF to inspect local Ethernet frames for multicast and broadcast MAC address patterns. This dual-source data collection allows the system to distinguish between protocol-level traffic (TCP/UDP/ICMP counts from routers) and frame-level patterns (broadcast storms, mDNS multicast, OSPF multicast) detected directly on the wire.
Display Node (Arduino with W5500): An Arduino microcontroller equipped with the WIZnet W5500 Ethernet controller receives the aggregated traffic data from OPNsense over UDP and drives the WS2812 LED strip using the FastLED library. The W5500's hardware TCP/IP stack offloads all network protocol processing, allowing the Arduino to dedicate its cycles entirely to the LED animation engine without interruption.
LED Strip (WS2812): The addressable WS2812 LED strip serves as the visual output medium. Each pixel maps to a specific traffic metric: color encodes protocol type (TCP/UDP/ICMP), brightness encodes RX/TX flow intensity, and position represents time (a scrolling "snail" animation advancing at a 1-second heartbeat rate).
3. In-depth Analysis of Hardware Operating Principles (Hardware Mechanics)
The system operates as a pipeline: edge routers collect → OPNsense aggregates → W5500 receives → Arduino renders → WS2812 displays.
Edge Data Collection (Fluxstream): Each Asus router runs Fluxstream, which reads kernel network counters and formats them into compact UDP packets:
seq 1> RX: 50 | TX: 50 | TCP: 512 | UDP: 200 | ICMP: 1
seq 2> RX: 10 | TX: 20 | TCP: 900 | UDP: 111 | ICMP: 1
These packets are transmitted every second to the OPNsense collector.
BPF Frame Inspection (OPNsense): On the OPNsense box, a BPF listener examines destination MAC addresses on raw Ethernet frames to classify traffic as:
- Broadcast (FF:FF:FF:FF:FF:FF) — ARP, Windows NetBIOS, Samba discovery
- Multicast (01:00:5E:xx:xx:xx) — mDNS (Apple/Chromecast), SSDP/UPnP (smart devices), OSPF (224.0.0.5)
- Unicast — standard directed traffic
This frame-level classification provides insight that router-level counters alone cannot reveal — particularly for diagnosing broadcast storms and identifying misbehaving IoT devices generating excessive multicast.
LED Animation Engine (Arduino + W5500): The Arduino receives the aggregated data packet from OPNsense and feeds it into the LED animation engine. A "snail" (Lighthouse-style) animation is used: new data pixels are pushed into a FIFO queue and crawl from top to bottom of the strip at a 1-second tick rate. Old data falls off the bottom. This approach prevents the "Christmas tree" problem of individual LEDs simply flashing on/off each second with raw values — instead, the animation provides temporal continuity, making trend changes visually readable.
Traffic Flow → LED Brightness Smoothing: Mapping RX/TX flow directly to LED brightness would cause harsh flickering because connection counts can jump dramatically within one second (e.g., TCP connections jumping from 512 to 900). A 10-tick smoothing window averages the traffic delta and adjusts brightness gradually — a technique borrowed from classic Arduino signal processing.
4. Communication Interface: The Role and Necessity of W5500
Reliable, low-overhead network communication is the backbone of this system. The W5500 plays a decisive role at the display node where real-time responsiveness is critical.
W5500 Hardware TCP/IP Stack on Arduino: The Arduino display node uses the W5500 Ethernet controller to receive UDP packets from OPNsense. Unlike software-based TCP/IP stacks (such as LWIP), the W5500 handles all Ethernet frame reception, IP layer processing, and UDP socket management entirely in hardware. This frees the Arduino's processor to run the FastLED animation engine at full speed without network interrupt overhead — critical for smooth LED rendering at the 1-second tick rate.
UDP One-Way Push Architecture: Polling was deliberately rejected for data delivery. A TCP polling model (3-way handshake, request, response, teardown) would impose unnecessary latency and CPU cost on both the OPNsense box and the Arduino. Instead, edge routers push UDP packets to OPNsense, and OPNsense pushes a consolidated UDP packet to the W5500 on the Arduino. This one-way push model is fire-and-forget — occasional packet loss is acceptable since fresh data arrives every second. The result is minimal network overhead (~8MB/day per edge node) and deterministic 1-second refresh cadence.
Broadcast/Multicast Protocol Awareness: The system's most technically distinctive feature is its ability to separately visualize broadcast and multicast traffic — not just aggregate bandwidth. The W5500 receives not just the router-reported counters, but also the BPF-classified frame data from OPNsense, enabling the display node to render distinct visual channels for:
- Unicast TCP/UDP/ICMP (normal traffic volume indicator)
- Broadcast (ARP, Windows protocols — should remain low; spikes warn of misconfigured devices)
- Multicast (mDNS, SSDP, OSPF — expected background; excessive volume flags service discovery storms)
Ethernet Reliability vs. Wi-Fi for the Display Node: The Arduino display node uses wired Ethernet via W5500 rather than Wi-Fi. In a home network monitoring scenario, using Wi-Fi for the monitoring device itself would create a circular dependency — a Wi-Fi disruption event would simultaneously be the event to monitor AND the failure that breaks the monitoring display. Wired Ethernet via W5500 ensures the visualizer remains operational even during Wi-Fi-affecting events.
5. Software Implementation and Optimization (Software & Coding)
The software stack spans three runtime environments: MIPS Linux (Asus routers), FreeBSD (OPNsense), and Arduino.
Fluxstream (Asus Router / MIPS Linux): A lightweight C program cross-compiled for MIPS using the Asus toolchain. It reads /proc network counters, formats them into UDP packets, and transmits them once per second. An x86/64 build is also provided for testing on standard Linux machines. The tool is deliberately minimal to fit within the Asus router's 50MB writable yaffs partition.
Multicast-Tree Daemon (OPNsense / FreeBSD 14.1): A FreeBSD C program that simultaneously listens for UDP packets from all 4 Asus edge routers, runs a BPF listener on the local interface to classify broadcast/multicast frames, consolidates all data into a single aggregated UDP packet, and forwards it to the W5500-equipped Arduino display node every second. The BPF listener uses direct MAC address inspection rather than IP-layer filtering, enabling classification of non-IP traffic (raw Ethernet broadcasts) that IP-layer tools miss entirely.
Arduino LED Engine (Arduino IDE 2.x + FastLED): The Arduino firmware receives the consolidated UDP packet via the W5500, parses the per-router traffic metrics, and executes the display logic:
- Protocol Color Encoding: Each data pixel's hue maps to its dominant protocol (TCP-heavy = one color, UDP-heavy = another, ICMP/broadcast = warning color)
- Brightness Smoothing: A 10-sample rolling average of RX+TX delta drives LED brightness, preventing harsh flickering while still showing meaningful traffic trends
- Snail FIFO Animation: New pixels enter at the top of the strip and age downward, providing a scrolling time-series view of network activity over the last N seconds
- Broadcast Storm Detection: If broadcast frame count from BPF exceeds a configurable threshold, the entire strip switches to a storm alert pattern — a "Christmas tree" effect that is normally unwanted but becomes a deliberate alarm signal
6. Project Result and Conclusion
This project demonstrates that professional-grade network visibility can be achieved in a home environment using open-source tools, off-the-shelf routers, and the W5500 hardware Ethernet stack.
Technical Achievement: The system achieves genuine real-time network visualization at a 1-second refresh rate across 4 distributed network segments, with protocol-aware differentiation between TCP/UDP/ICMP, broadcast, and multicast traffic. The W5500 hardware TCP/IP offloading is essential to this result — it allows the Arduino to maintain smooth LED animation without network processing interrupts degrading display quality.
Scalability: The architecture scales by adding more edge routers running Fluxstream. Each new node sends independent UDP packets to the OPNsense aggregator; the aggregator handles consolidation. No changes to the W5500 display node firmware are required to add new data sources.
Unique Value: The BPF-based broadcast/multicast classification is the system's most distinctive capability. Commercial home routers and network dashboards typically report only aggregate bandwidth. This system reveals the protocol texture of network traffic — identifying broadcast storms, unexpected multicast sources, and IoT device discovery traffic that aggregate counters would mask entirely.
Conclusion: By combining distributed edge monitoring, BPF frame classification, and a W5500-equipped Arduino display node, the MultiCast Tree delivers a practical, low-cost, and visually engaging home network monitoring solution that reveals network behavior invisible to conventional tools.
한국어 설명
1. 프로젝트 배경 및 기술적 목표
대부분의 홈 네트워크는 눈에 보이지 않게 동작합니다 — 라우터는 패킷을 조용히 처리하고, 뭔가 문제가 생겼을 때야 비로소 인지하게 됩니다. 이 프로젝트는 그 현실을 바꾸기 위해 시작되었습니다. 네트워크 트래픽을 실시간으로 물리적으로 시각화하는 "멀티캐스트 트리(MultiCast Tree)" — 네트워크 활동을 눈으로 직접 확인할 수 있는 장치를 만드는 것입니다.
이 네트워크는 4개의 세그먼트로 구성되며, 각각 Asus 엣지 라우터를 통해 인터넷에 연결됩니다. OPNsense 박스(FreeBSD 14.1)가 중앙 집계 역할을 담당하고, BPF(Berkeley Packet Filter)를 활용해 원시 이더넷 프레임을 직접 검사합니다. 핵심 과제는 분산된 여러 라우터로부터 실시간 트래픽 통계(RX/TX 바이트, TCP/UDP/ICMP 연결 수, 멀티캐스트/브로드캐스트 비율 등)를 수집하고, 이를 마이크로컨트롤러에 전달하여 WS2812 LED 스트립에 1초 이하의 지연으로 의미 있게 렌더링하는 것입니다.
프로젝트 이름은 의도적으로 아이러니합니다. "멀티캐스트 트리"는 실제로 내부 통신에 IP 멀티캐스트를 사용하지 않습니다. 수신자 1개, 송신자 4개의 구조에서는 진짜 멀티캐스트가 오히려 낭비입니다. 대신 단일 OPNsense 수집기로의 UDP 유니캐스트와 W5500 장착 Arduino 디스플레이 노드의 조합으로 동일한 결과를 최소한의 네트워크 오버헤드로 달성합니다 — 엣지 노드당 하루 약 8MB의 트래픽만 발생합니다.
2. 핵심 기술 요소 및 선정 이유 (Methodology)
비용 효율성, Linux/BSD 호환성, 실시간 성능을 기준으로 부품을 선정하였습니다.
엣지 노드 (Asus 라우터 + Fluxstream): BusyBox Linux 2.6 커널이 탑재된 Asus 소비자용 라우터 4대가 모니터링 엣지 포인트로 사용됩니다. MIPS용으로 크로스 컴파일된 커스텀 도구 "Fluxstream"이 각 라우터에서 실행되며, 매 초 UDP로 실시간 트래픽 통계를 전송합니다. 구형 커널임에도 이 장치들이 선택된 이유는 단 하나 — Wi-Fi입니다. OPNsense(BSD 기반)는 Wi-Fi 칩셋 드라이버 지원이 제한적이라, 무선 연결 세그먼트에는 Asus 라우터가 현실적인 선택입니다.
중앙 집계기 (OPNsense / FreeBSD 14.1): OPNsense 박스는 두 가지 역할을 동시에 수행합니다. 4개 엣지 라우터로부터 UDP 패킷을 수신하는 것과, BPF를 통해 로컬 이더넷 프레임의 멀티캐스트/브로드캐스트 MAC 주소 패턴을 독립적으로 검사하는 것입니다. 이 이중 데이터 수집 구조 덕분에 라우터 레벨의 트래픽(TCP/UDP/ICMP 카운트)과 프레임 레벨의 패턴(브로드캐스트 스톰, mDNS 멀티캐스트, OSPF 멀티캐스트)을 구분하여 시각화할 수 있습니다.
디스플레이 노드 (Arduino + W5500): WIZnet W5500 이더넷 컨트롤러가 장착된 Arduino 마이크로컨트롤러가 OPNsense로부터 집계된 트래픽 데이터를 UDP로 수신하고, FastLED 라이브러리를 통해 WS2812 LED 스트립을 구동합니다. W5500의 하드웨어 TCP/IP 스택이 모든 네트워크 프로토콜 처리를 오프로딩하여, Arduino가 방해 없이 LED 애니메이션 엔진에만 전념할 수 있습니다.
LED 스트립 (WS2812): 주소 지정 가능한 WS2812 LED 스트립이 시각적 출력 매체로 사용됩니다. 각 픽셀은 특정 트래픽 지표에 매핑됩니다. 색상은 프로토콜 타입(TCP/UDP/ICMP)을 나타내고, 밝기는 RX/TX 흐름 강도를 나타내며, 위치는 시간을 나타냅니다(1초 심박수로 스크롤되는 "달팽이" 애니메이션).
3. 하드웨어 작동 원리에 대한 심층 분석 (Hardware Mechanics)
시스템은 파이프라인으로 작동합니다: 엣지 라우터 수집 → OPNsense 집계 → W5500 수신 → Arduino 렌더링 → WS2812 표시.
엣지 데이터 수집 (Fluxstream): 각 Asus 라우터에서 Fluxstream이 커널 네트워크 카운터를 읽고 콤팩트한 UDP 패킷으로 포맷합니다. 이 패킷들은 매 초 OPNsense 수집기로 전송됩니다.
BPF 프레임 검사 (OPNsense): OPNsense 박스에서 BPF 리스너가 원시 이더넷 프레임의 목적지 MAC 주소를 검사하여 트래픽을 분류합니다. 브로드캐스트(FF:FF:FF:FF:FF:FF) — ARP, Windows NetBIOS, Samba 검색; 멀티캐스트(01:00:5E:xx:xx:xx) — mDNS(Apple/Chromecast), SSDP/UPnP(스마트 기기), OSPF; 유니캐스트 — 일반 지향성 트래픽. 이 프레임 레벨 분류는 라우터 레벨 카운터만으로는 알 수 없는 정보를 제공합니다.
LED 애니메이션 엔진 (Arduino + W5500): Arduino가 OPNsense로부터 집계 데이터 패킷을 수신하고 LED 애니메이션 엔진에 공급합니다. "달팽이"(라이트하우스 스타일) 애니메이션이 사용됩니다. 새 데이터 픽셀이 FIFO 큐에 푸시되어 1초 틱 속도로 스트립 위에서 아래로 이동합니다. 오래된 데이터는 아래로 떨어집니다.
트래픽 흐름 → LED 밝기 스무딩: RX/TX 흐름을 LED 밝기에 직접 매핑하면 심한 깜빡임이 발생합니다(예: TCP 연결이 512에서 900으로 급증). 10틱 스무딩 윈도우가 트래픽 델타를 평균화하여 밝기를 점진적으로 조정합니다.
실제로 어떻게 작동하나요?
가정내 네트워크는 보통 아래와 같이 구성됩니다.
- 공유기 (WiFi 나오는 것)
- 공유기에 연결된 여러 노드들 (기기들)
- 인터넷 회선
MultiCast Tree는 이 모든 기기들이 정상적으로 작동하는지를 감시
1️⃣ **여러 곳의 공유기들(엣지 라우터라고 부르는 것들)**이 자기 상태를 계속 보고합니다
- "지금 몇 명이 나한테 연결되어 있어요?"
- "인터넷 속도가 얼마나 빠른가요?"
- "지금까지 몇 GB의 데이터가 지나갔어요?"
2️⃣ 중앙에 있는 모니터링 시스템이 이 모든 정보를 받아서 정리합니다
3️⃣ Arduino와 LED 스트립이 그 정보를 화려한 불빛으로 표시해줍니다
- 데이터가 많이 오가면 → 빨간색 불
- 조용하면 → 파란색 불
4. 통신 인터페이스: W5500의 역할과 필요성
신뢰할 수 있는 저오버헤드 네트워크 통신이 이 시스템의 근간입니다. W5500은 실시간 응답성이 중요한 디스플레이 노드에서 결정적인 역할을 합니다.
Arduino의 W5500 하드웨어 TCP/IP 스택: Arduino 디스플레이 노드는 W5500 이더넷 컨트롤러를 사용하여 OPNsense로부터 UDP 패킷을 수신합니다. LWIP 같은 소프트웨어 기반 TCP/IP 스택과 달리, W5500은 모든 이더넷 프레임 수신, IP 레이어 처리, UDP 소켓 관리를 하드웨어에서 처리합니다. 이로 인해 Arduino 프로세서는 네트워크 인터럽트 오버헤드 없이 FastLED 애니메이션 엔진을 최대 속도로 실행할 수 있습니다 — 1초 틱 속도의 부드러운 LED 렌더링에 필수적입니다.
UDP 단방향 푸시 아키텍처: 데이터 전달에 폴링은 의도적으로 배제되었습니다. TCP 폴링 모델(3-way 핸드셰이크, 요청, 응답, 종료)은 OPNsense 박스와 Arduino 양쪽에 불필요한 지연과 CPU 부담을 줍니다. 대신 엣지 라우터들이 OPNsense로 UDP 패킷을 푸시하고, OPNsense가 W5500 장착 Arduino로 통합 UDP 패킷을 푸시합니다. 매 초 새 데이터가 도착하므로 간헐적인 패킷 손실은 허용 가능합니다.
브로드캐스트/멀티캐스트 프로토콜 인식: 시스템의 가장 기술적으로 독특한 기능은 브로드캐스트와 멀티캐스트 트래픽을 집계 대역폭과 별도로 시각화하는 능력입니다. W5500은 라우터 보고 카운터뿐만 아니라 OPNsense의 BPF 분류 프레임 데이터도 수신하여, 유니캐스트/브로드캐스트/멀티캐스트 각각에 대한 독립적인 시각 채널을 렌더링할 수 있습니다.
디스플레이 노드의 이더넷 vs. Wi-Fi: Arduino 디스플레이 노드는 Wi-Fi 대신 W5500을 통한 유선 이더넷을 사용합니다. 홈 네트워크 모니터링 시나리오에서 모니터링 장치 자체에 Wi-Fi를 사용하면 순환 의존성이 발생합니다 — Wi-Fi 장애 이벤트가 동시에 모니터링해야 할 이벤트이자, 모니터링 디스플레이를 망가뜨리는 장애가 되는 것입니다. W5500을 통한 유선 이더넷은 Wi-Fi에 영향을 주는 이벤트 중에도 시각화 장치가 동작을 유지하도록 보장합니다.
5. 소프트웨어 구현 및 최적화 (Software & Coding)
소프트웨어 스택은 세 가지 런타임 환경에 걸쳐 있습니다: MIPS Linux(Asus 라우터), FreeBSD(OPNsense), Arduino.
Fluxstream (Asus 라우터 / MIPS Linux): Asus 툴체인을 사용하여 MIPS용으로 크로스 컴파일된 경량 C 프로그램입니다. /proc 네트워크 카운터를 읽고, UDP 패킷으로 포맷하여 매 초 전송합니다. Asus 라우터의 50MB 쓰기 가능 yaffs 파티션에 맞도록 의도적으로 최소화되어 있습니다.
Multicast-Tree 데몬 (OPNsense / FreeBSD 14.1): 4개 Asus 엣지 라우터로부터 UDP 패킷을 동시 수신하고, BPF 리스너로 로컬 인터페이스의 브로드캐스트/멀티캐스트 프레임을 분류하며, 모든 데이터를 단일 집계 UDP 패킷으로 통합하여 W5500 장착 Arduino 디스플레이 노드로 매 초 전달하는 FreeBSD C 프로그램입니다.
Arduino LED 엔진 (Arduino IDE 2.x + FastLED): W5500을 통해 통합 UDP 패킷을 수신하고, 라우터별 트래픽 지표를 파싱하여 디스플레이 로직을 실행합니다. 프로토콜 색상 인코딩(TCP 우세 = 특정 색상, UDP 우세 = 다른 색상, ICMP/브로드캐스트 = 경고 색상), 10샘플 이동 평균을 통한 밝기 스무딩, 달팽이 FIFO 애니메이션(네트워크 활동의 스크롤 시계열 뷰), 브로드캐스트 스톰 감지(BPF 브로드캐스트 프레임 수가 임계값 초과 시 경보 패턴으로 전환) 기능을 구현합니다.
6. 프로젝트 결과 및 결론
이 프로젝트는 오픈소스 도구, 기성 라우터, W5500 하드웨어 이더넷 스택만으로 홈 환경에서 전문가 수준의 네트워크 가시성을 달성할 수 있음을 증명합니다.
기술적 성과: 4개의 분산 네트워크 세그먼트에 걸쳐 1초 갱신 속도의 실시간 네트워크 시각화를 달성하였으며, TCP/UDP/ICMP, 브로드캐스트, 멀티캐스트 간의 프로토콜 인식 구분이 가능합니다. W5500 하드웨어 TCP/IP 오프로딩은 이 결과의 필수 요소입니다.
확장성: 아키텍처는 Fluxstream을 실행하는 엣지 라우터를 추가하는 것만으로 확장됩니다. 각 새 노드가 독립적인 UDP 패킷을 OPNsense 집계기에 전송하며, 집계기가 통합을 처리합니다. W5500 디스플레이 노드 펌웨어 변경 없이 새 데이터 소스를 추가할 수 있습니다.
독자적 가치: BPF 기반 브로드캐스트/멀티캐스트 분류는 시스템의 가장 독특한 기능입니다. 상용 홈 라우터와 네트워크 대시보드는 일반적으로 집계 대역폭만 보고합니다. 이 시스템은 네트워크 트래픽의 프로토콜 질감을 드러냅니다 — 브로드캐스트 스톰, 예상치 못한 멀티캐스트 소스, 집계 카운터가 감출 수 있는 IoT 기기 검색 트래픽을 식별합니다.
결론: 분산 엣지 모니터링, BPF 프레임 분류, W5500 장착 Arduino 디스플레이 노드를 결합하여, 기존 도구로는 보이지 않는 네트워크 동작을 드러내는 실용적이고 저렴하며 시각적으로 매력적인 홈 네트워크 모니터링 솔루션을 완성하였습니다.
