-
Notifications
You must be signed in to change notification settings - Fork 1
Module TiNet
sat edited this page Jan 3, 2026
·
2 revisions
This page describes the TiNET module for dot2net.
TiNET (Tiny Network) is a lightweight container-based network emulation tool. It uses Docker containers connected via Linux network namespaces and veth pairs to create virtual network topologies.
The TiNET module generates spec.yaml, the specification file for TiNET:
nodes:
- name: r1
image: quay.io/frrouting/frr:8.5.0
interfaces:
- { name: net0, type: direct, args: r2#net0 }
sysctls:
- sysctl: net.ipv4.ip_forward=1
mounts:
- { src: ./r1/frr.conf, dst: /etc/frr/frr.conf }
switches: []
node_configs:
- name: r1
cmds:
- cmd: vtysh -b| Section | Source | Description |
|---|---|---|
nodes |
DOT nodes | Node definitions with image, interfaces, mounts |
switches |
- | Switch definitions (if any) |
node_configs |
startup block |
Commands to run on each node |
- interfaces: Automatically generated from DOT edge definitions
-
mounts: Generated from FileDefinitions that have
pathset -
cmds: Generated from user-defined
startupconfig block
Each non-virtual node must have this parameter defined:
| Parameter | Description | Example |
|---|---|---|
image |
Container image | quay.io/frrouting/frr:8.5.0 |
Define this in your NodeClass:
nodeclass:
- name: router
values:
image: quay.io/frrouting/frr:8.5.0The startup config block defines commands to run inside the container. This is used to generate the cmds section in node_configs.
nodeclass:
- name: router
config:
- name: startup
template:
- "vtysh -b"
- "ip addr add {{ .ip_loopback }}/32 dev lo"Behavior:
- If
startupexists and is non-empty →node_configsentry is generated - If
startupis missing or empty → nonode_configsentry for that node
Files with path defined in FileDefinition are automatically mounted into containers:
file:
- name: frr.conf
path: /etc/frr/frr.conf # This triggers mount generation
- name: daemons
path: /etc/frr/daemonsGenerated mounts:
mounts:
- { src: ./r1/frr.conf, dst: /etc/frr/frr.conf }
- { src: ./r1/daemons, dst: /etc/frr/daemons }name: ospf_lab
module:
- tinet
- frr
file:
- name: frr.conf
path: /etc/frr/frr.conf
- name: daemons
path: /etc/frr/daemons
layer:
- name: ip
default_connect: true
policy:
- name: p2p
range: 10.0.0.0/16
prefix: 30
nodeclass:
- name: router
values:
image: quay.io/frrouting/frr:8.5.0
config:
- file: frr.conf
template:
- "hostname {{ .name }}"
- "!"
- "router ospf"
- " router-id {{ .ip_loopback }}"
- file: daemons
sourcefile: ./daemons
- name: startup
template:
- "vtysh -b"digraph {
r1 [class="router"]
r2 [class="router"]
r1 -- r2
}nodes:
- name: r1
image: quay.io/frrouting/frr:8.5.0
interfaces:
- { name: net0, type: direct, args: r2#net0 }
sysctls:
- sysctl: net.ipv4.ip_forward=1
mounts:
- { src: ./r1/frr.conf, dst: /etc/frr/frr.conf }
- { src: ./r1/daemons, dst: /etc/frr/daemons }
- name: r2
image: quay.io/frrouting/frr:8.5.0
interfaces:
- { name: net0, type: direct, args: r1#net0 }
sysctls:
- sysctl: net.ipv4.ip_forward=1
mounts:
- { src: ./r2/frr.conf, dst: /etc/frr/frr.conf }
- { src: ./r2/daemons, dst: /etc/frr/daemons }
switches: []
node_configs:
- name: r1
cmds:
- cmd: vtysh -b
- name: r2
cmds:
- cmd: vtysh -bAfter generating files with dot2net:
# Generate configuration files
dot2net build -c input.yaml input.dot
# Deploy the lab
sudo tinet up -c spec.yaml | sudo sh -x
# Execute commands on nodes
sudo tinet conf -c spec.yaml | sudo sh -x
# Destroy the lab
sudo tinet down -c spec.yaml | sudo sh -x| Feature | TiNET | Containerlab |
|---|---|---|
| Complexity | Simpler, lightweight | More features |
| Node types | Docker containers | Multiple kinds (SR Linux, cEOS, etc.) |
| Execution | Shell script output | Direct deployment |
| Interface naming | Configurable | Fixed pattern |
- Module System - How modules work
- File Output - File generation and bind mounts
- Module: Containerlab - Alternative container-based platform
- Module: FRR - FRR configuration helpers