A topology costs a few lines of text and a few seconds. Nothing on
your machine is touched. When you have broken it beyond repair you type
del all and build it again.
A lan is an Open vSwitch bridge. A kvm guest has its own kernel. A cnt guest is a real container with a real network stack. The routing daemons are the ones a carrier runs, and they do not know they are in a demo. When OSPF reconverges after you cut a cable, that is OSPF reconverging.
The daemons, the kernels and the frames are those of real machines: a configuration works or fails in cloonix for the reason it does on them, the timing of the hardware aside (What cloonix is not, below).
Every demo leaves the network running when it ends, so the topology it built is there to be changed, broken and captured after the last line of the script.
The demos are chosen for failure modes where the symptom names a different layer than the cause. Stop OSPF in the dns demo and name resolution stops: the symptom is DNS, the cause is routing. Leave out the discard route in frrmix and every BGP session comes up, reports itself established, and carries nothing.
A counter inside a guest reports what that guest believes; a capture reports what crossed the wire. Cloonix puts a sniffer on any capturable interface and hands back only what matches a filter — and the filter is applied on the server, so what does not match never crosses the wire to you.
Two subscriptions with the same filter, one on each side of a tunnel or a translation, is the standard way here of showing that something was encrypted, dropped or rewritten. The grammar is a subset of tcpdump's, and its limits are part of what it shows: below IP it knows arp alone, so a demo about EAPOL or batman OGMs says so and captures unfiltered rather than inventing a filter that cannot exist.
Subject areas, then one python file per demo:
demos/<area>/<demo>.py. The docstring at the top of each
one says what the software is and what the demo does with it, then the
topology as ascii art, then the packet to catch; its first line is what the
Demo panel of the canvas shows beside the name. The chapters of the
user book give every demo its history,
its network and its commands, area by area.
Twelve packages, each a few demos on one subject, ordered so that a package uses only what the ones before it showed. On every step: run the demo, read the canvas and its Comments panel, catch the packet, break one thing and repair it. The chapter Learning with cloonix of the user book gives each package its steps, its packet and its break.
| package | demos | what it shows | |
|---|---|---|---|
| 0 | The first network | cloonix/cnt.py cloonix/kvm.py | add, plug, ssh, sniff, del all |
| 1 | The cloonix items | cloonix/a2b.py snf.py nat.py c2c.py nginx.py mount.py limit.py systemd.py cntwifi.py kvmwifi.py cntkvmwifi.py | a shaped wire, the capture, the way out, three nets joined, the way in, mounts and caps, an init, the radios |
| 2 | One wire | switching/vlan.py stp.py | 802.1Q tags, a loop and spanning tree |
| 3 | Addresses, names, time | address/dhcp.py ipv6.py dns.py unbound.py knot.py ntp.py | a relay, an address made from an advertisement, udp 53 and tcp 53, udp 123 |
| 4 | Routing | routing/frrspider.py frrspider_bgp.py frrmix.py bird.py isis.py babel.py batman.py | OSPF, BGP, redistribution, a second daemon, IS-IS, rerouting, a layer 2 mesh in the kernel |
| 5 | Encryption and tunnels | security/tls.py wg.py openvpn.py tinc.py ipsec.py | https beside http, then what the middle wire shows before and after a tunnel |
| 6 | The edge | security/nftables.py suricata.py ebpf.py radius.py arp.py | filter, inspect, drop in the kernel, authenticate, and arp poisoning |
| 7 | Services | services/proxy.py squid.py smtp.py mqtt.py asterisk.py | proxies, mail, publish and subscribe, a phone call |
| 8 | Staying up | availability/vrrp.py cluster.py | an address that moves, a service that fails over |
| 9 | Overlays and the real network | switching/vxlan.py ovn.py cloonix/phy.py realnet.py watching/perf.py | a layer 2 net over a routed core, Geneve, a real interface taken in, a cloonix inside a kvm, where the throughput goes |
| 10 | Wifi | wifi/cnt_*.py kvm_*.py cntkvm_*.py | an open air, WPA2, WPA3, a bridge, roaming, a mesh, a home box, a login per user, a listener |
| 11 | Other guests | freebsd.py windows.py cisco.py | a BSD with the agent, a windows desktop, a router on its console |
It emulates a network, not hardware. Forwarding at line rate, ASIC behaviour,
optics, anything where the timing of the silicon is the subject — those are
outside it. An a2b shapes a cable enough to show what
TCP does about a bad line; it is not a channel model. The wifi radios are
mac80211_hwsim: the 802.11 state machine is real, association and
EAPOL are real, the propagation is not.