VALE(4)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– VALE(4) πŸ’– β€” the very fast Virtual Local Ethernet, netmap edition

okay bestie so this is the vale page from the Kernel Interfaces Manual and honestly? it's a whole vibe. buckle up πŸŽ€


✨ NAME ✨

vale β€” a very fast Virtual Local Ethernet using the netmap API πŸ¦‹


🌸 SYNOPSIS 🌸

device netmap

that's it. that's the whole synopsis. iconic.


πŸ’… DESCRIPTION πŸ’…

so vale is a feature of the netmap(4) module, and what it does is implement multiple Virtual switches β€” plural, a whole lil ecosystem β€” that you can use to interconnect netmap clients. and when we say clients we mean everything: traffic sources and sinks, packet forwarders, userspace firewalls, and so on. the whole friend group 🫢

the bestie part? vale is implemented completely in software, and it is extremely fast. no cap. on a modern machine it can move almost 20 Million packets per second (Mpps) per core with small frames, and about 70 Gbit/s with 1500 byte frames. that's not a typo, that's just her being her. πŸ’…βœ¨


πŸ¦‹ OPERATION πŸ¦‹

vale dynamically creates switches and ports as clients connect to it using the netmap(4) API. it just... makes them. on demand. main character energy fr fr.

here's the naming tea, because you will need it:

  • vale ports are named valeSSS:PPP
  • vale is the prefix that says "hey, this is a VALE switch, not a standard interface"
  • SSS is a specific switch (the colon is the separator πŸ‘€)
  • PPP is a port within that switch

and the rules for the names:

  • both SSS and PPP have the form [0-9a-zA-Z_]+
  • the string cannot exceed IFNAMSIZ characters
  • and PPP cannot be the name of any existing OS network interface β€” like, hard no, don't even try it πŸ™ˆ

see netmap(4) for details on the API. 🧚

🌈 LIMITS 🌈

okay so the boundaries, bestie:

  • vale currently supports up to 254 ports per switch.
  • the maximum number of switches is provided by the max_bridges sysctl variable.

that's the whole limit situation. respect the 254. πŸ”₯


⭐ SYSCTL VARIABLES ⭐

see netmap(4) for a list of sysctl variables that affect vale bridges. that's where the knobs live, go look πŸ‘‘


πŸ“ EXAMPLES πŸ“

example one: create one switch, with a traffic generator connected to one port, and a netmap-enabled tcpdump instance on another port:

tcpdump -ni valea:1 &
pkt-gen  -i valea:0 -f tx &

example two: create two switches, each connected to two qemu machines on different ports:

qemu -net nic -net netmap,ifname=vale1:a ... &
qemu -net nic -net netmap,ifname=vale1:b ... &
qemu -net nic -net netmap,ifname=vale2:c ... &
qemu -net nic -net netmap,ifname=vale2:d ... &

look at her go. four machines, two switches, zero drama. 😭πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

also this absolute classic, which you should absolutely read:

Luigi Rizzo, Giuseppe Lettieri: VALE, a switched ethernet for virtual machines, June 2012, http://info.iet.unipi.it/~luigi/vale/


πŸ‘‘ AUTHORS πŸ‘‘

the vale switch was designed and implemented in 2012 by Luigi Rizzo and Giuseppe Lettieri at the Universita di Pisa. legends, honestly. 🫢

vale was funded by the European Commission within FP7 Projects CHANGE (257422) and OPENLAB (287581). shoutout to the funding besties, none of this would exist without y'all πŸ’–


quick vibe check reminder: PPP really cannot be the name of any existing OS network interface, and the whole name can't exceed IFNAMSIZ characters. no cap, it will not work, save yourself the heartbreak 😭

okay that's the whole page, and yes this shipped on Debian, dated August 30, 2024, and it's VALE(4) β€” the very fast one. slay, go build a switch πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from