VILLASframework
Modular co-simulation framework
Lab 9: Network emulation and statistics
villas_hook_stats.svg

The stats hook can be used to collect statistics about the co-simulation interface like:

  • One way delay (OWD)
  • Packet loss
  • Packet reordering
  • Sending rate
$ villas signal -r 1000 -l 10000 sine | villas hook -o verbose=true -o warmup=3000 stats

With network emulation

villas_hook_stats_netem.svg
1 nodes = {
2  udp_node1 = {
3  type = "socket",
4  layer = "udp",
5 
6  in = {
7  address = "*:12000"
8 
9  signals = {
10  count = 8,
11  type = "float"
12  }
13  },
14  out = {
15  address = "127.0.0.1:12001",
16 
17  netem = {
18  enabled = true,
19  loss = 0, # in %
20  corrupt = 0, # in %
21  duplicate = 0, # in %
22  delay = 100000, # in uS
23  jitter = 5000, # in uS
24  distribution = "normal"
25  }
26  }
27  }
28 }

In the first terminal:

$ villas signal -r 1000 sine | villas pipe etc/lab9_netem.conf udp_node1

In a second terminal:

$ villas pipe etc/lab9_netem.conf udp_node1 -x > delayed_data.dat

After a few seconds, press Ctrl-C to stop the processing. Now we can analyze the delay distribution of the received data:

$ villas hook -o verbose=true -o warmup=1000 stats < delayed_data.dat > /dev/null

For more details see Network Emulation

Go to [lab 10] =>(node-lab-10)