Skip to content
View Adam010341's full-sized avatar
📡
Porting NDTwin to P4/BMv2
📡
Porting NDTwin to P4/BMv2

Organizations

@ndtwin-lab

Block or report Adam010341

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
Adam010341/README.md

Hi, I'm Adam Fan

     .--.        adam@ndtwin
    |o_o |       -----------
    |:_/ |       Host       NCKU CSIE × Purdue ECE (dual degree candidate)
   //   \ \      Role       Research Assistant @ Academia Sinica NSL
  (|     | )     Focus      NDTwin, P4/BMv2 development line
 /'\_   _/`\     Languages  C · C++ · Python · P4 · Java · Verilog · MATLAB · asm
 \___)=(___/     Research   learned indexes for packet classification,
                            measurement validity in BMv2 benchmarking
                 Contact    adam010341@gmail.com

Education

  • NCKU CSIE, Junior · Purdue ECE–NCKU CSIE Dual Degree Program candidate
  • GPA 3.85/4.0
  • TOEIC 980/990

Experience

  • Summer intern, Network and System Laboratory, Academia Sinica — Jul 2026 — Sep 2026
  • Research Assistant, Network and System Laboratory, Academia Sinica — Sep 2026–
  • Undergraduate Researcher, Computer & Internet Architecture Lab, NCKU — Jul 2026–
  • Class representative, Purdue ECE–NCKU CSIE Dual Degree Program

Research

  • Learned index structures for packet classification (capstone, NCKU CIAL, advised by Prof. Yen-Kuang Chang). Patches and an exhaustive certifier: nuevomatch-error-bound-fixes
  • Measurement validity in BMv2 benchmarking (preprint in prep) — Independent research

NDTwin: open-source network digital twin

NDTwin keeps a live copy of a network: its topology, every flow and the bandwidth it uses, and which switches are on. Apps try a change on that copy first, then push the best one to the real switches.

What it is used for:

  • Some links are congested while others sit idle. The traffic-engineering app watches every ECMP group and re-maps flows so the group's links share the load.
  • The network is nearly empty at night, yet every switch stays powered. The energy-saving app turns off switches whose links fall below a low watermark, and turns them back on when traffic returns, without lowering QoS.
  • "What if I turn these switches off?" Apps simulate many what-if cases in parallel on the twin's current state, pick the best outcome, and apply it in real time.
  • Writing your own network app. The kernel's REST API covers topology, flows, rules, power and fault injection. A traffic generator launches thousands of TCP/UDP flows from one config file, and a Mininet network lets you test before going to hardware.

NDTwin runs on OpenFlow hardware switches or on Mininet. On a P4 switch, its sFlow scheme (IEEE ICC 2026) can sample as often as every packet with zero control-plane overhead, so even small flows are detected and measured accurately.

My part: a P4/BMv2 backend next to the original Open vSwitch + Ryu one, behind the same kernel API, so behaviour that lives in a P4 pipeline can be studied with the same twin. Apps that rely on OpenFlow group tables, such as traffic engineering, stay on OpenFlow.

Code: ndtwin-lab (kernel, apps and tools) · NDTwin-Kernel-P4 (P4 backend, testing release)

Animated NDTwin architecture: NDTwin apps (traffic-engineering, energy-saving, simulation / AI-driven) talk to the NDTwin kernel, which talks REST to two interchangeable backends. In the P4 backend (my addition), the P4 proxy agent drives BMv2 simple_switch_grpc in Mininet over P4Runtime (gRPC); a packet crosses h1, s1, s2, h2, each switch lights the ndtwin_switch.p4 table it matched (flow_5tuple first, ipv4_lpm on a miss), and a 1-in-256 sampled copy goes to the proxy, which sends synthesised sFlow v5 to the kernel. In the upstream OpenFlow backend, the Ryu controller drives Open vSwitch in Mininet over OpenFlow, and OVS sends sFlow to the kernel.

Tech stack

Skills

Pinned Loading

  1. NDTwin-Kernel-P4 NDTwin-Kernel-P4 Public

    Network digital twin kernel with P4/BMv2 data-plane support, via a P4Runtime proxy behind Ryu's northbound API.

    Shell 5

  2. ndtwin-analysis ndtwin-analysis Public

    Measurement drivers, analysers and figure scripts from ten NDTwin P4/bmv2 measurement rounds.

    Python 2

  3. cache-aware-riscv-optimization cache-aware-riscv-optimization Public

    Tree-PLRU cache replacement in Spike + cache-blocked matrix transpose (-76% misses) + RVV-tiled GEMM for MLP inference.

    C

  4. fourier-comms-matlab fourier-comms-matlab Public

    Purdue × NCKU Fourier & communications projects in MATLAB: room acoustics, Fourier series, a software AM/SSB radio.

    MATLAB

  5. PIC18F4520-Assembly-Labs PIC18F4520-Assembly-Labs Public

    PIC18F4520 assembly labs (MPASM): six simulator-verified projects, up to an in-place iterative quicksort.

    Makefile

  6. rvv-mel-spectrogram rvv-mel-spectrogram Public

    Mel spectrogram (FFT, power spectrum, mel filter bank) hand-vectorised with RISC-V Vector 1.0 intrinsics.

    C 1