# Measuring Tools¶

## EL470¶

The Newtec EL470 versions that Telecom Bretagne owns have no protocol testing capabilities. However, when in ACM mode, the ACM controller (the HUB) keeps a log file containing the modulation and coding schemes as well as bitrate and Es/N0 estimated . The log files are stored as .csv (Comma Separated Values). These are created per six hours intervals and a log file history of the previous 24hours can be consulted. An example can be seen below:

Timestamp,Demod,RqModCod,EsNo,CarrierBitrate
2014-12-12 15:04:58,1,16APSK-2/3,11.30,1445835
2014-12-12 15:05:10,1,16APSK-2/3,11.20,1445835
2014-12-12 15:05:24,1,16APSK-2/3,10.72,1324072
2014-12-12 15:05:28,1,16APSK-2/3,10.61,1324072
2014-12-12 15:05:31,1,16APSK-2/3,10.66,1324072
2014-12-12 15:05:34,1,8PSK-3/4,10.19,1313479
2014-12-12 15:05:37,1,8PSK-3/4,11.87,1313479
2014-12-12 15:05:41,1,8PSK-3/4,10.40,1313479
2014-12-12 15:06:47,1,QPSK-5/6,6.93,884389
2014-12-12 15:06:51,1,QPSK-5/6,8.18,884389
2014-12-12 15:06:54,1,QPSK-5/6,7.02,825503


It is unclear though what the sampling frequency is. We have determined that this rate depends on the rate at which Es/N0 estimates change. From the csv file we can extract the following information:

• Timestamp (in seconds)
• Modcod parameter (modulation + coding rate)
• Estimate of E s / N 0
• Information bitrate (in bps)

This log file can be accessed through in the FlexACM controller tab. It is the button labeled Controller Log:

A much simpler way though is to use the following link:

http://192.168.88.100/cgi-bin/pegui-cgi/cli/cgi+acmcdem?filename=acmcdem.csv

## Traffic generation and capture¶

In order to measure performance at the application level we will use Iperf. Iperf is a tool to generate streams of TCP and UDP traffic as well as measuring throughput and other statistics. It has a client and server functionality, and can measure the throughput between the two ends. For more information and download links as well as documentation check Iperf3's website here. In order to have a finer control over the values obtained, we will capture all traffic using tcpdump and perform an offline calculation of throughput using pcaptput.py.

notice. We will generate a UDP data stream in order to test throughput.

To setup Iperf we will have to launch it on both the HUB PC (as client) and Station PC (as server). Since the HUB PC will be the one sending packets it has to be setup as a client. Likewise, the Station PC must be setup as a server.

# STATION PC LISTENING ON PORT 5201

$iperf3 -s -u -i1 -p 5201 ------------------------------------------------------------ Server listening on UDP port 5201 Receiving 1470 byte datagrams UDP buffer size: 192 KByte (default) ------------------------------------------------------------  # HUB PC STARTS UDP DATA STREAM DES_PORT = 5201$ iperf3 -c 10.0.0.130 -u -t <duration in secs> -b <bandwidth> -l <udp size> -p 5201
------------------------------------------------------------
Client connecting to 10.0.0.130, UDP port 5201
Sending <udp size>  byte datagrams
UDP buffer size: 9.00 KByte (default)
------------------------------------------------------------


At the same time the Station PC must capture all incoming traffic, we will use the following command:

# CAPTURE INCOMING TRAFFIC

$tcpdump -w output_file_name.pcap  # Scripts¶ In order to process obtained data we have created multiple scripts to parse and display results: • pcaptput.py : Calculates throughput metrics from .pcap file. • bulk_pcaptput : Bash script to run pcaptput.py on all measurements and generate .tput files. • ConsolidateRun.m : MATLAB class to import and consolidate .pcap as well as .tput data. • bulk_consolidate_results.m : MATLAB script to generate all graphs in this wiki. All of these as well as all measurements are contained in measurements.zip. There is also README for further clarification. ## pcaptput.py¶ pcaptput.py is a small python script we wrote in order to calculate application (UDP) throughput as well as layer 3 end-to-end throughput considering only IP packets (header + payload). It uses the dpkt. library which is a "fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols" Python library. #!/usr/bin/python2.6 # pcaptput.py import sys, dpkt if len(sys.argv) != 2: raise ValueError('.pcap file needs to be specified.') filename = sys.argv[1]; udpPort = 5201 tRes = 1 periodn = 0 baseTimeStamp = 0 iter = 0 # Total IP packet counter ipBitCount = 0 # UDP payload counter udpBitCount = 0 print 'Time[s]', 'IP-Throughput[bps]', 'UDP-Throughput[bps]' for timeStamp, buf in dpkt.pcap.Reader(open(filename, 'r')): iter += 1 if iter == 1: baseTimeStamp = timeStamp # Get ethernet frame eth = dpkt.ethernet.Ethernet(buf) # Check for pure IP traffic only (no ARP packets) if type(eth.data) != dpkt.ip.IP: continue ip = eth.data ts = timeStamp - baseTimeStamp # Histogram bins if ts >= periodn * tRes: print periodn * tRes, ipBitCount / tRes, udpBitCount / tRes periodn += 1 udpBitCount = 0 ipBitCount = 0 # Counters ipBitCount += ip.len * 8 if isinstance(ip.data, dpkt.udp.UDP) and (udpPort == ip.data.dport): udpBitCount += ip.data.ulen * 8  Usage is as follows: $ ./pcaptput.py input.pcap > output.tput

Time[s] IP-Throughput[bps] UDP-Throughput[bps]
0 0 0
1 4688 0
2 3984 96
3 754720 742944
4 775552 763872
5 860544 847584
6 903040 889440
7 1019904 1004544
8 1083648 1067328
9 1221760 1203360
10 1296128 1276608
11 903040 889440
12 764928 753408
13 807424 795264
14 860544 847584
15 956160 941760
16 988032 973152
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.42155957221984863, "perplexity": 5064.833103428151}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780056752.16/warc/CC-MAIN-20210919065755-20210919095755-00064.warc.gz"}