...
 
Commits (2)
......@@ -386,7 +386,7 @@ def parse_pcap(path, delta_t):
'Sending Rate': fairness_sending_rate
}
bbr_values, cwnd_values = parse_bbr_and_cwnd_values(path)
cwnd_values, bbr_values, bbr2_values = parse_bbr_and_cwnd_values(path)
bbr_total_values, sync_phases, sync_duration = compute_total_values(bbr_values)
buffer_backlog = parse_buffer_backlog(path)
......@@ -405,6 +405,7 @@ def parse_pcap(path, delta_t):
sending_rate=sending_rate,
bbr_values=bbr_values,
bbr_total_values=bbr_total_values,
bbr2_values=bbr2_values,
cwnd_values=cwnd_values,
retransmissions=retransmissions,
retransmissions_interval=retransmissions_interval,
......@@ -440,8 +441,9 @@ def parse_buffer_backlog(path):
def parse_bbr_and_cwnd_values(path):
bbr_values = {}
cwnd_values = {}
bbr_values = {}
bbr2_values = {}
paths = glob.glob(os.path.join(path, '*.{}*'.format(FLOW_FILE_EXTENSION)))
......@@ -449,8 +451,9 @@ def parse_bbr_and_cwnd_values(path):
for i, file_path in enumerate(all_files):
bbr_values[i] = ([], [], [], [], [], [])
cwnd_values[i] = ([], [], [])
bbr_values[i] = ([], [], [], [], [], [])
bbr2_values[i] = ([], [], [])
f = open_compressed_file(file_path)
......@@ -501,8 +504,20 @@ def parse_bbr_and_cwnd_values(path):
bbr_values[i][4].append(cwnd_gain)
bbr_values[i][5].append(bw * rtt / 1000)
if split[4] != '':
bbr2 = split[4].replace('bbr_bw_lo=', '')\
.replace('bbr_bw_hi=','')
bbr2 = bbr2.split(',')
bbr_bw_lo = int(bbr2[0], 16)
bbr_bw_hi = int(bbr2[1], 16)
bbr2_values[i][0].append(timestamp)
bbr2_values[i][1].append(bbr_bw_lo)
bbr2_values[i][2].append(bbr_bw_hi)
f.close()
return bbr_values, cwnd_values
return cwnd_values, bbr_values, bbr2_values
def parse_timestamp(string):
......
......@@ -25,6 +25,7 @@ PLOT_TYPES = [
'rt_prop',
'window_gain',
'pacing_gain',
'bbr_bw_lo_hi',
]
......@@ -46,6 +47,7 @@ CSV_FILE_NAMES = {
'sending_rate': 'sending_rate.csv',
'bbr_values': 'bbr_values.csv',
'bbr_total_values': 'bbr_total_values.csv',
'bbr2_values': 'bbr2_values.csv',
'cwnd_values': 'cwnd_values.csv',
'retransmissions': 'retransmissions.csv',
'retransmissions_interval': 'retransmissions_interval.csv',
......
......@@ -49,6 +49,7 @@ def plot_all(path, pcap_data, plot_only, hide_total=False, all_plots=False):
sending_rate = pcap_data.sending_rate
bbr_values = pcap_data.bbr_values
bbr_total_values = pcap_data.bbr_total_values
bbr2_values = pcap_data.bbr2_values
cwnd_values = pcap_data.cwnd_values
retransmissions = pcap_data.retransmissions
retransmissions_interval = pcap_data.retransmissions_interval
......@@ -136,6 +137,17 @@ def plot_all(path, pcap_data, plot_only, hide_total=False, all_plots=False):
Plot((bbr_values, bbr_total_values), plot_bbr_pacing, 'plot_bbr_pacing.pdf', 'Pacing Gain', '', len(bbr_values))
]
has_bbr2 = False
for i in bbr2_values:
if len(bbr2_values[i][0]) > 0:
has_bbr2 = True
break
if 'bbr_bw_lo_hi' in plot_only and has_bbr2:
plots += [
Plot(bbr2_values, plot_bbr_bw_lo_hi, 'plot_bbr_bw_lo_hi.pdf', 'BBR2 BW Lo and Hi', 'bit', len(bbr2_values)),
]
if all_plots:
for plot in plots:
print_line(' * {} ...'.format(plot.plot_name), new_line=False)
......@@ -428,6 +440,19 @@ def plot_diff_inflight_bdp(data, p_plt):
p_plt.plot(ts, diff, label='{}'.format(c))
def plot_bbr_bw_lo_hi(bbr_bw_lo_hi, p_plt):
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
p_plt.plot([], [], label='bbr_bw_lo', color='black')
p_plt.plot([], [], ':', label='bbr_bw_hi', color='black')
p_plt.legend()
for i, c in enumerate(bbr_bw_lo_hi):
data = bbr_bw_lo_hi[c]
p_plt.plot(data[0], data[1], color=colors[i % len(colors)])
p_plt.plot(data[0], data[2], ':', color=colors[i % len(colors)])
def filter_smooth(data, size, repeat=1):
x = data[0]
y = data[1]
......
......@@ -65,6 +65,7 @@ def read_from_csv(path):
'sending_rate_file': os.path.join(path, CSV_FILE_NAMES['sending_rate']),
'bbr_values_file': os.path.join(path, CSV_FILE_NAMES['bbr_values']),
'bbr_total_values_file': os.path.join(path, CSV_FILE_NAMES['bbr_total_values']),
'bbr2_values_file': os.path.join(path, CSV_FILE_NAMES['bbr2_values']),
'cwnd_values_file': os.path.join(path, CSV_FILE_NAMES['cwnd_values']),
'retransmissions_file': os.path.join(path, CSV_FILE_NAMES['retransmissions']),
'retransmissions_interval_file': os.path.join(path, CSV_FILE_NAMES['retransmissions_interval']),
......@@ -79,6 +80,7 @@ def read_from_csv(path):
sending_rate = read_csv(data_files['sending_rate_file'])
bbr_values = read_csv(data_files['bbr_values_file'], 6)
bbr_total_values = read_csv(data_files['bbr_total_values_file'])
bbr2_values = read_csv(data_files['bbr2_values_file'], 3)
cwnd_values = read_csv(data_files['cwnd_values_file'], 3)
retransmissions = read_csv(data_files['retransmissions_file'], 1)
retransmissions_interval = read_csv(data_files['retransmissions_interval_file'], 3)
......@@ -92,6 +94,7 @@ def read_from_csv(path):
sending_rate=sending_rate,
bbr_values=bbr_values,
bbr_total_values=bbr_total_values,
bbr2_values=bbr2_values,
cwnd_values=cwnd_values,
retransmissions=retransmissions,
retransmissions_interval=retransmissions_interval,
......
class PcapData:
def __init__(self, rtt, inflight, throughput, fairness, avg_rtt, sending_rate, bbr_values,
bbr_total_values, cwnd_values, retransmissions, retransmissions_interval, buffer_backlog,
bbr_total_values, bbr2_values, cwnd_values, retransmissions, retransmissions_interval, buffer_backlog,
data_info=None):
self.rtt = rtt
self.inflight = inflight
......@@ -10,6 +10,7 @@ class PcapData:
self.sending_rate = sending_rate
self.bbr_values = bbr_values
self.bbr_total_values = bbr_total_values
self.bbr2_values = bbr2_values
self.cwnd_values = cwnd_values
self.retransmissions = retransmissions
self.retransmissions_interval = retransmissions_interval
......@@ -26,6 +27,7 @@ class PcapData:
'sending_rate': self.sending_rate,
'bbr_values': self.bbr_values,
'bbr_total_values': self.bbr_total_values,
'bbr2_values': self.bbr2_values,
'cwnd_values': self.cwnd_values,
'retransmissions': self.retransmissions,
'retransmissions_interval': self.retransmissions_interval,
......@@ -43,6 +45,7 @@ class PcapData:
sending_rate=pcap_dict['sending_rate'],
bbr_values=pcap_dict['bbr_values'],
bbr_total_values=pcap_dict['bbr_total_values'],
bbr2_values=pcap_dict['bbr2_values'],
cwnd_values=pcap_dict['cwnd_values'],
retransmissions=pcap_dict['retransmissions'],
retransmissions_interval=pcap_dict['retransmissions_interval'],
......
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: analyze.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/analyze.py",
"args" : ["-r", "-d", "test"],
//"debugOptions": ["Sudo"]
},
{
"name": "Python: run_mininet.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/run_mininet.py",
"args" : ["example4-bbr2.conf"],
//"debugOptions": ["Sudo"]
},
{
"name": "Python: script_retransmissions.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/script_retransmissions.py",
//"args" : ["create", "configs"]
"args" : ["analyze", "test"]
},
{
"name": "Python: script_increasing_rtt.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/script_increasing_rtt.py",
//"args" : ["create", "configs"]
"args" : ["analyze", "test"]
},
{
"name": "Python: script_increasing_buffersize.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/script_increasing_buffersize.py",
//"args" : ["create", "configs"]
"args" : ["analyze", "test"]
},
{
"name": "Python: script_performance_bw_despite_loss.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/script_performance_bw_despite_loss.py",
//"args" : ["create", "configs"]
"args" : ["analyze", "test"]
},
{
"name": "Python: script_performance_ld_despite_bloated_buffers.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/script_performance_ld_despite_bloated_buffers.py",
//"args" : ["create", "configs"]
"args" : ["analyze", "test"]
}
]
}
\ No newline at end of file