GSoC 2012: Edo Monticelli's Final Report
The throughput meter is a tool to measure network performance between two batman nodes. With userspace programs like iperf or netperf, data must be copied between user space and kernel space and the TCP header and/or payload must be aligned. On devices with limited resources, like routers, the context switching between userspace and the kernel and memory aligning are expensive operations, leading to packet loss and to falsified test results. The Throughput Meter is implemented entirely in kernel space and provides an aligned protocol similar to TCP, so it should give a reasonable approximation of the results that would be obtained by TCP. Tests are initiated through batctl - a brief concept description follows.
The throughput meter test can be started through batctl:
# batctl bw 00:13:02:43:e3:1a Throughput meter called towards 00:13:02:43:e3:1a Test over in 3564 ms. sent 70000000 bytes. Throughput 19640000 Byte/s
The following illustration shows how, after launching the above batctl command, the test is triggered: batctl sends a message through a local socket to the local batman-adv kernel module. The module generates and sends packets to the specified remote host. When the test is over, a message is returned to batctl, which prints the results. The test can be aborted with the typical SIGINT (CTRL-C) or SIGTERM signals.
Protocol Overview and Possible Enhancements¶
The currently implemented protocol is Go-back-N, with cumulative acknowledgement and a fixed window size. In our experiments, the achieved protocol throughput does not match up with TCP and under certain network conditions the difference can be significant. For sure the absence of a dynamic window and of a dynamic RTT/Timeout limits the protocol performance: since the maximum throughput (number of packets) is limited to one "window" per RTT, the protocol performance is strongly bound to the relation between the window size and the RTT.
The used protocol must adapt to the parameters of the network, like available throughput or packet loss. For example, if the window size changed dynamically, the protocol performance should reflect the available throughput more realistically. Another element that could enhance performance is something similar to TCP's "fast retransmission": When a single packet is lost the throughput meter waits for the timeout (400 ms) before retransmitting the the lost packets. In the future, the throughput meter could guess that a packet was lost if it received several ACKs belonging to later packets and resend the missing packet without waiting for the timeout.
It might take a while before the code is merged with master, because we need to break compatibility, so until then you find the code in a separate repository for batman-adv and batctl. Technical specification is given at the throughput meter protocol page and questions are welcome on the mailing list.