Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 145 additions & 13 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,29 @@ module: labn-munet-config
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw transmit
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw receive
| | +--rw delay? uint64
| | +--rw jitter? uint64
| | +--rw jitter-correlation? decimal64
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| +--rw env* [name]
| | +--rw name string
| | +--rw value? string
Expand Down Expand Up @@ -145,6 +165,26 @@ module: labn-munet-config
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw transmit
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw receive
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw connections* [to]
| | +--rw to string
| | +--rw name? string
Expand All @@ -155,9 +195,40 @@ module: labn-munet-config
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw transmit
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | | +--rw rate? number64
| | | | +--rw limit? number64
| | | | +--rw burst? number64
| | | +--rw peers* [peer]
| | | +--rw peer string
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw receive
| | +--rw delay? uint64
| | +--rw jitter? uint64
| | +--rw jitter-correlation? decimal64
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| +--rw nodes* [name]
| +--rw id? uint32
| +--rw kind? -> ../../../kinds/name
Expand Down Expand Up @@ -217,9 +288,29 @@ module: labn-munet-config
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw transmit
| | | +--rw delay? uint64
| | | +--rw jitter? uint64
| | | +--rw jitter-correlation? decimal64
| | | +--rw loss? uint64
| | | +--rw loss-correlation? decimal64
| | | +--rw rate
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw receive
| | +--rw delay? uint64
| | +--rw jitter? uint64
| | +--rw jitter-correlation? decimal64
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| +--rw env* [name]
| | +--rw name string
| | +--rw value? string
Expand Down Expand Up @@ -568,6 +659,30 @@ munet>
}
}

grouping directional-intf-constraints {
description
"Traffic control constraints by direction. Direction is relative to
the owner of the config: the node for node connections, and the
network (bridge) for network config.";
uses intf-constraints {
status deprecated;
description
"Constraints outside of ./transmit or ./receive apply to transmit.
Use ./transmit instead.";
}
container transmit {
description
"Constraints on traffic sent by this end (local egress). These
override the deprecated unwrapped constraints.";
uses intf-constraints;
}
container receive {
description
"Constraints on traffic received by this end (local ingress).";
uses intf-constraints;
}
}

grouping common-node {
description "Common node properties";
leaf-list ip {
Expand Down Expand Up @@ -879,7 +994,7 @@ munet>
default "virtio-net-pc";
description "driver name for qemu based interfaces";
}
uses intf-constraints;
uses directional-intf-constraints;
}
list env {
key name;
Expand Down Expand Up @@ -1158,15 +1273,16 @@ munet>
}

/* default network tc parameters */
uses intf-constraints;
uses directional-intf-constraints;

list connections {
key to;
description
"Overriding network side configuration for connections to nodes from
this network. If the default network tc parameters are not being
overriden for a specific node connection then this configuration is
not required.";
not required. Here transmit is traffic toward the node and receive
is traffic from the node.";

leaf to {
type string;
Expand All @@ -1182,7 +1298,23 @@ munet>
"The remote name of the connection. This is used for disambiguation
when there are multiple connections to the same remote node.";
}
uses intf-constraints;
uses directional-intf-constraints {
augment "transmit" {
description "Per-sender overrides for traffic toward the node.";
list peers {
key peer;
description
"Constraints for traffic sent by a peer node on this network
toward this connection's node. Constraints not given here
are taken from ../ (transmit) and the node's receive.";
leaf peer {
type string;
description "Name of the sending node.";
}
uses intf-constraints;
}
}
}
}
}

Expand Down
114 changes: 108 additions & 6 deletions doc/source/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,26 @@ Tree diagram for network config::
| +--rw rate? number64
| +--rw limit? number64
| +--rw burst? number64
+--rw transmit
| +--rw delay? uint64
| +--rw jitter? uint64
| +--rw jitter-correlation? decimal64
| +--rw loss? uint64
| +--rw loss-correlation? decimal64
| +--rw rate
| +--rw rate? number64
| +--rw limit? number64
| +--rw burst? number64
+--rw receive
| +--rw delay? uint64
| +--rw jitter? uint64
| +--rw jitter-correlation? decimal64
| +--rw loss? uint64
| +--rw loss-correlation? decimal64
| +--rw rate
| +--rw rate? number64
| +--rw limit? number64
| +--rw burst? number64
+--rw connections* [to]
+--rw to string
+--rw name? string
Expand All @@ -128,15 +148,85 @@ Tree diagram for network config::
+--rw loss? uint64
+--rw loss-correlation? decimal64
+--rw rate
+--rw rate? number64
+--rw limit? number64
+--rw burst? number64
| +--rw rate? number64
| +--rw limit? number64
| +--rw burst? number64
+--rw transmit
| +--rw delay? uint64
| +--rw jitter? uint64
| +--rw jitter-correlation? decimal64
| +--rw loss? uint64
| +--rw loss-correlation? decimal64
| +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| +--rw peers* [peer]
| +--rw peer string
| +--rw delay? uint64
| +--rw jitter? uint64
| +--rw jitter-correlation? decimal64
| +--rw loss? uint64
| +--rw loss-correlation? decimal64
| +--rw rate
| +--rw rate? number64
| +--rw limit? number64
| +--rw burst? number64
+--rw receive
+--rw delay? uint64
+--rw jitter? uint64
+--rw jitter-correlation? decimal64
+--rw loss? uint64
+--rw loss-correlation? decimal64
+--rw rate
+--rw rate? number64
+--rw limit? number64
+--rw burst? number64

The ``connections`` configuration is entirely optional, and is present to allow
overriding default network quality parameters (e.g., ``delay``, ``jitter``,
etc). If no override is required it is enough for the nodes to specify their
connection to the network.

Network quality parameters are directional and relative to the network:
``transmit`` shapes traffic the network sends toward a node, and ``receive``
shapes traffic the network receives from a node. Both are applied on the
network's bridge port, so the node's own qdiscs are left untouched. Parameters
given outside of ``transmit``/``receive`` are deprecated and apply to
``transmit``.

For example, to shape both directions between ``wan1`` and ``r1``::

networks:
- name: wan1
connections:
- to: r1
transmit:
delay: 2500
rate: { rate: "15M", burst: 16384, limit: 131072 }
receive:
delay: 2500
rate: { rate: "5M", burst: 16384, limit: 131072 }

A connection's ``transmit`` may also list ``peers`` to give traffic from a
specific sending node on the network its own parameters, so each pair of nodes
can have different link quality in each direction. Parameters not given for a
peer are taken from the connection's ``transmit`` (and the node's ``receive``).
Traffic is classified by the bridge port it arrived on, so this also applies to
broadcast and multicast. For example, to make ``r1`` to ``r2`` slow and lossy
while other nodes reach ``r2`` with the default delay::

networks:
- name: radio
connections:
- to: r2
transmit:
delay: 1000
peers:
- peer: r1
delay: 20000
loss: 5


Nodes
^^^^^
Expand Down Expand Up @@ -234,9 +324,21 @@ Tree diagram for node connections::
| | +--rw loss? uint64
| | +--rw loss-correlation? decimal64
| | +--rw rate
| | +--rw rate? number64
| | +--rw limit? number64
| | +--rw burst? number64
| | | +--rw rate? number64
| | | +--rw limit? number64
| | | +--rw burst? number64
| | +--rw transmit
| | | ... same constraints as above
| | +--rw receive
| | ... same constraints as above

Connection quality parameters are relative to the node: ``transmit`` shapes
traffic the node sends and ``receive`` shapes traffic the node receives.
Parameters given outside of ``transmit``/``receive`` are deprecated and apply to
``transmit``. For connections to a network both directions are shaped on the
network's bridge port, and node values override network values. For
point-to-point connections the shaping is applied on the sending node's
interface, combining the sender's ``transmit`` with the receiver's ``receive``.


Mounts
Expand Down
Loading
Loading