Dynamic Da a Plane Upda es
using Lua and libmoon
Manuel Simon, Sebas ian Gallenm¨
ulle , and Geo g Ca le
Chai o Ne wo k A chi ec u es and Se ices, Technical Uni e si y o Munich, Ge many
{simonm|gallenmu|ca le}@ne .in. um.de
Abs ac —Upcoming communica ion ne wo ks, such as 6G,
equi e bo h high pe o mance and eliabili y, while se ice up-
da es ypically in oduce se ice down imes. This s udy explo es
dynamic ne wo k unc ion upda es using libmoon, a DPDK-based
high-pe o mance packe p ocessing amewo k. The app oach
enables seamless, on- he- ly upda es o ne wo k unc ions. By
le e aging LuaJIT, we p o i om jus -in- ime (JIT) compila ion,
allowing o e icien pe - low unc ion upda es. Ou e alua ion
demons a es he easibili y o un ime e-p og ammabili y in
ne wo k da a planes. We show he induced la encies o un ime
changes and examine c oss- low and c oss-co e in luences. Mo e-
o e , we in es iga e he e ec s o JIT compila ion and show he
signi icance o JIT compila ion o long- e m pe o mance.
Index Te ms—Dynamic Ne wo k Func ion, Da a Plane Upda es
I. INTRODUCTION
Mode n communica ion ne wo ks ha e o o e a eliable
bu high-pe o man connec ion. So-called ne wo k unc ions
a e so wa e componen s ha ul ill speci ic asks in a ne wo k.
Upda es o main aining o imp o ing hese ne wo k unc ions
usually cause down imes. We in es iga e so wa e-based dy-
namic ne wo k unc ions o mi iga e his p oblem. Dynamic
upda es allow o he con inua ion o he se ice wi hou se -
ice deg ada ion. Fu he mo e, i allows he se ice mig a ion
o o he nodes by sha ing and dynamically ins alling (pa s) o
he se ice. Going one s ep u he , ne wo k ope a o s can o e
p og ammable da a pa hs, allowing o cus ome -de ined, pe -
low packe p ocessing. Dynamic p og ams can, e.g., be used
o cus omized in-ne wo k compu a ion o eco e y ailo e s.
LuaJIT is a jus -in- ime (JIT) compile o Lua p og ams.
JIT compila ion seems o be a p omising candida e o eal-
ize such dynamic unc ion upda es, as he po en ially cos ly
op imiza ions can be pe o med on- he- ly. This pape de-
sc ibes and analyzes a p o o ype implemen a ion o dynamic
ne wo k unc ions in libmoon, a Lua-based DPDK w appe .
The implemen a ion allows o he dynamic addi ion o new
unc ionali y de ined by i s sou ce code piggybacked by a
packe . The unc ion is ins alled, i.e., changing he sou ce code
o he unning ne wo k unc ion, and JIT compiled. We show
he in luence o JIT compila ion on he applicabili y o he
app oach in he sho and long e m and he impac on o he
lows and CPU co es.
II. RELATED WORK
In p e ious wo k [1], we in eg a ed dynamic eBPF p oces-
so s in o he P4 pipeline, ollowing simila goals. eBPF can be
p e-compiled using pla o m-independen by e code, allowing
as , dynamic upda es. While i was no possible o exchange
such p og ams using sou ce code, i is possible o Lua. This
s udy ocuses on implemen ing dynamic ne wo k unc ions
wi h Lua ins ead o eBPF. Fu he mo e, we look deepe in o
he c oss- low and c oss-co e dependencies o such upda es
and build a sui able es bed and expe imen wo k low.
Run ime ep og ammabili y has been in es iga ed as
capsule-based ac i e ne wo king [2]. Recen ly, he e was wo k
on dynamic upda es in (P4) p og ammable swi ches. Das e
al. [3] implemen ed an ins uc ion se in P4 o modi y packe
p ocessing du ing un ime. Xing e al. [4] buil FlexCo e,
which enables a pa ial econ igu a ion o da a planes du ing
un ime. Feng e al. [5] ex ended P4 o in-si u ep og amma-
bili y. Ou side he P4 domain, Jeykuma e al. in oduced “ iny
packe p og ams (TTPs)” [6] ha a e speci ied by ac i e pack-
e s and can execu e a e y es ic ed amoun o ins uc ions.
Using libmoon, we use a amewo k ha is no es ic ed in
i s unc ionali y and scales using mul iple CPU co es.
III. BACKGROUND & IMPLEMENTATION
This sec ion desc ibes ou p o o ype implemen a ion o
dynamic ne wo k unc ions in libmoon and in oduces he
ea u es used in Lua and LuaJIT.
A. Lua, LuaJIT, & libmoon
libmoon [7] is a Lua lib a y ha combines he ad an ages
o DPDK and LuaJIT [8], p o iding high-pe o mance packe
p ocessing and easy p og ammabili y. The libmoon p ojec is a
gene aliza ion o he MoonGen packe gene a o [9] and is also
based on DPDK and LuaJIT. LuaJIT p o ides a JIT compile
o Lua, a sc ip ing language, e.g., used o games. DPDK is
a amewo k o high-pe o mance use space so wa e packe
p ocessing, bypassing he Linux ke nel ne wo k s ack and
using poll mode d i e s. libmoon uses JIT compila ion o p o-
ide a high-le el DPDK API, combining he high-pe o mance
wi h high-le el language ea u es, such as au oma ic memo y
managemen . Using Recei e Side Scaling (RSS) libmoon can
s a ically dis ibu e di e en lows o di e en CPU co es, o
pa allel p ocessing.
B. P o o ype Implemen a ion
Ou implemen a ion allows a dynamically de ined unc ion
pe low, he e de ined by he sou ce IP add ess. The add ess
is used o look up he associa ed unc ion in a hash able. The
DuT LoadGen
◀
▶
◀
▶
Times ampe
◀
◀
Figu e 1: Measu emen se up.
app oach can easily be ex ended o o he low de ini ions, such
as he 5- uple. I no dynamic unc ion has been se , a de aul
unc ion will be used, e.g., simply o wa ding he packe s.
New unc ionali y can be ins alled by sending an upda e
packe con aining i s Lua sou ce code o he da a plane
ad essing a p e-de ined po . The sou ce code is ex ac ed
om he upda e packe and con e ed o a callable Lua unc-
ion using loads ing() and s o ed in he low- unc ion
hash able. This Lua buil -in unc ion allows he de ini ion o
new unc ions om sou ce code e u ning a unc ion poin e ,
simila o Py hon’s e al() me hod. Be o e passing he
sou ce code, we ex end i o co ec ly pass he a gumen s,
i.e., he packe bu e and possible anno a ions o he JIT
op imiza ions. The LuaJIT compile will compile he unc ion
anspa en ly, and he ollowing packe s o he same low will
au oma ically call he ins alled unc ion. The unc ion hash
able is unsynch onized be ween mul iple p ocessing h eads
and CPU co es. Howe e , he unc ion is de ined pe low, and
RSS maps all packe s o he same low o he same CPU co e.
IV. SETUP
This sec ion desc ibes ou expe imen se up.
A. Topology
We use a h ee-hos se up o e alua ion (c . Figu e 1),
ha ha dwa e imes amps all packe s wi h a esolu ion o
12.5 ns [10]. All h ee hos s use an In el Xeon D-1518 CPU
@ 4×2.2 GHz, 32 GB o RAM and an In el X552 NIC.
The load gene a o (LoadGen) u ilizes MoonGen [9] o
gene a e CBR a ic o wo di e en lows, i.e., di e en
sou ce IP add esses, wi h a o al a e o 200 Mbi /s and a
packe size o 200 B. The De ice-unde -Tes (DuT) uns he
p o o ype implemen a ion w i en o libmoon. The packe s
a e p ocessed indi idually wi hou ba ching o de e mine pe -
packe cos s. The DuT applies o changes he unc ion and
e u ns all packe s o he LoadGen. Using passi e op ical
spli e s, all a ic is duplica ed and mi o ed o a hi d hos ,
he Times ampe . The Times ampe imes amps and eco ds all
incoming packe s. The eco dings a e used la e o ma ch and
analyze he a ic and calcula e he associa ed la encies.
B. Me hodology
The LoadGen sends wo ypes o packe s: packe s whe e he
ne wo k unc ion is applied ( e e ed o as INC) and upda e
packe s ha speci y a new unc ion ha is ins alled ( e e ed o
as DYN). Fi s , 50 k INC packe s a e sen om wo di e en
lows, whe e he de aul unc ion is applied. Then, one DYN
packe is sen , con aining he sou ce code o he dynamic
unc ion. The e o e, only one low is a ec ed by he dynamic
1,635 1,636 1,637 1,638
0
25
50
75
100
125
150
175
200
Expe imen Time [ms]
La ency [µs]
be o e
a e
be o e (o he )
a e (o he )
change
Figu e 2: Dynamic p og am change (one ask) (zoomed).
1,632 1,633 1,634 1,635
0
20
40
60
80
100
120
140
160
Expe imen Time [ms]
La ency [µs]
be o e
a e
be o e (o he )
a e (o he )
change
Figu e 3: Dynamic p og am change ( wo asks) (zoomed).
unc ion change. A e wa d, ano he 200 k INC packe s a e
sen om bo h lows in o al, whe e he new, dynamic unc ion
is applied o he a ec ed low. The o he , una ec ed low
s ays wi h he de aul o wa ding unc ion.
The expe imen s can po en ially di e in he i s -ins alled
de aul unc ion, he dynamic unc ion sen and ins alled by he
DYN packe , he numbe o asks/ h eads, which handle he
packe s a he DuT, and he JIT pa ame e s. He e, we analyze
he basic o e head o changing unc ionali y; he e o e, we
change he de aul unc ion se ing one cons an in a packe
owa ds a dynamic unc ion se ing ano he cons an alue. We
pe o m his using one o wo co es/ h eads while enabling
o disabling he JIT compila ion o Lua using he highes
op imiza ion le el (c . [8], simila o he -O3 op ion o gcc).
V. EVALUATION
This sec ion desc ibes he expe imen s ha we e pe o med
and analyzes hei esul s.
Fi s , we in es iga e how changing he ne wo k unc ion
impac s he la ency o he DYN packe and subsequen INC
packe s. Figu es 2 and 3 show he la encies o 20 packe s
be o e and 200 packe s a e he change o he a ec ed and
he o he , una ec ed low. When he packe p ocessing is
pe o med on a single co e (c . Figu e 2), he change o he
unc ionali y a ec s all lows. In case he lows a e spli among
se e al co es (c . Figu e 3), he o he co es and he associa ed
lows a e una ec ed. The median la ency o he in ol ed low
(also c . Figu e 6 in blue) inc eases sligh ly om 3.550 µs
o 3.737 µs, while he o he low emains unchanged. The
change i sel in oduces a la ency o 50 150 µs, an o e head o
46 600 µs. Howe e , no packe loss occu s in bo h expe imen s.
1,625 1,650 1,675 1,700 1,725 1,750 1,775 1,800
0
20
40
60
80
100
120
Expe imen Time [ms]
La ency [µs]
be o e
a e
be o e (o he )
a e (o he )
change
Figu e 4: Dynamic p og am change ( wo asks) (no JIT).
1,625 1,650 1,675 1,700 1,725 1,750 1,775 1,800
0
20
40
60
80
100
120
140
160
Expe imen Time [ms]
La ency [µs]
be o e
a e
be o e (o he )
a e (o he )
change
Figu e 5: Dynamic p og am change ( wo asks).
We u he in es iga e he in luence o he JIT compila-
ion on he op imized pe o mance o he changed, dynamic
unc ion and he impac on he change i sel . Figu es 4 and
5 depic 1 k INC packe s be o e and 10 k packe s a e he
change o wo lows, espec i ely. The JIT compila ion o he
newly ins alled dynamic unc ion is u ned o in Figu e 4 and
ac i a ed in Figu e 5. The a ie y and pe o mance wi hou
JIT a e, as expec ed, wo se in he long e m. In his case,
Lua in e p e s he sou ce code ins ead o using he JIT-
compiled bina y code. While he median la ency be o e he
change is 3.550 µs, i inc eases o 6.387 µs a e wa d. The
o he low on he o he co e emains unchanged. Figu e 6
addi ionally depic s he median la ency o he i s 5 k packe s
a e he change. Enabling JIT compila ion no only shows
be e pe o mance in he long e m bu also in he sho
e m. Ne e heless, he DYN packe la ency i sel is lowe
o he non-JIT han he JIT e sion (42 737 µs s. 50 150 µs),
be o e be o e
(o he )
change change
(o he )
a e a e
(o he )
0
2,000
4,000
6,000
8,000
La ency [ns]
JIT o
JIT on
Figu e 6: La encies be o e, 5000 packe s a e he change, and
he ea e ).
p obably due o he o e head o he JIT compila ion i sel .
Howe e , in bo h cases, he e a e la ency spikes a e he
change, and he la ency and i s a iance a e inc eased. Mo e
expe imen s ha e o be conduc ed o ge signi ican numbe s.
VI. DISCUSSION & CONCLUSION
This wo k in es iga ed a p o o ype implemen a ion o dy-
namic ne wo k unc ion changes wi hin libmoon. The esul s
show ha i is easible o pe o m such changes, e en o
uncompiled sou ce code. JIT compila ion signi ican ly educes
he o e head in he sho and long e m.
In u u e wo k, we will compa e and analyze he in luence o
di e en op imiza ion s a egies suppo ed by he JIT compile
in mo e de ail. Fu he mo e, we will compa e he echnologies
o o he possible implemen a ions, based on, e.g., P4 and
eBPF [1], na i e eBPF/XDP implemen a ions, o o he (JIT-
compiled) languages. A special ema k lays on he in e play
o he mul iple CPU co es in ol ed in he p ocessing and he
in luence o changes on hem and hei caches. While his wo k
only in es iga ed he base o e head o changing unc ionali y,
di e en ypes o p og ams (e.g., compu a ion o memo y-
hea y) may in ol e addi ional o e head. Mo eo e , he pos-
sibili y o o loading such dynamic unc ions o Sma NICs,
such as he Ne onome Agilio and N idia Blue ield, may be
in es iga ed.
ACKNOWLEDGMENTS
This wo k was suppo ed by he EU’s Ho izon 2020 p o-
g amme as pa o he p ojec s SLICES-PP (10107977) and
G eenDIGIT (4101131207), by he Ge man Fede al Minis y
o Educa ion and Resea ch (BMBF) unde he p ojec s 6G-
li e (16KISK002) and 6G-ANNA (16KISK107), and by he
Ge man Resea ch Founda ion (Hype NIC, CA595/13-1).
REFERENCES
[1] M. Simon, H. S ubbe, S. Gallenm¨
ulle , and G. Ca le, “Honey o he
Ice Bea - Dynamic eBPF in P4,” in ACM SIGCOMM 2024 Wo kshop
on EBPF and Ke nel Ex ensions, 2024, p. 44–50.
[2] D. L. Tennenhouse and D. J. We he all, “Towa ds an Ac i e Ne wo k
A chi ec u e,” SIGCOMM Compu . Commun. Re ., ol. 26, no. 2, p.
5–17, ap 1996.
[3] R. Das and A. C. Snoe en, “Memo y Managemen in Ac i eRMT:
Towa ds Run ime-P og ammable Swi ches,” in ACM SIGCOMM 2023,
p. 1043–1059.
[4] J. Xing, K.-F. Hsu, M. Kadosh, A. Lo, Y. Piase zky, A. K ishnamu hy,
and A. Chen, “Run ime P og ammable Swi ches,” in NSDI 2022, pp.
651–665.
[5] Y. Feng, Z. Chen, H. Song, W. Xu, J. Li, Z. Zhang, T. Yun, Y. Wan,
and B. Liu, “Enabling In-si u P og ammabili y in Ne wo k Da a Plane:
F om A chi ec u e o Language,” in NSDI 2022, pp. 635–649.
[6] V. Jeyakuma , M. Alizadeh, Y. Geng, C. Kim, and D. Mazi`
e es,
“Millions o Li le Minions: Using Packe s o Low La ency Ne wo k
P og amming and Visibili y,” in ACM SIGCOMM 2014, p. 3–14.
[7] Gi Hub, “libmoon/libmoon,” 2025, las accessed: 2025-02-16. [Online].
A ailable: h ps://gi hub.com/libmoon/libmoon
[8] Mike Pall, “The LuaJIT P ojec ,” 2023, las accessed: 2025-02-16.
[Online]. A ailable: h p://luaji .o g/
[9] P. Emme ich, S. Gallenm¨
ulle , D. Raume , F. Wohl a , and G. Ca le,
“MoonGen: A Sc ip able High-Speed Packe Gene a o ,” in IMC 2015.
[10] In el, “In el E he ne Con olle X550 Da ashee e
2.6,” 2021, Las accessed: 2024-09-13. [Online]. A ail-
able: h ps://www.in el.com/con en /www/us/en/con en -de ails/333369/
in el-e he ne -con olle -x550-da ashee .h ml