Skip to content
Snippets Groups Projects
Commit 4822f50b authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

update print receive rate

parent e82fe91b
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ def generate_and_send_traffic_matrix():
traffic_matrix[point_ip_send][point_ip_recv] = mean_rate
trace_receive = {}
for src_ip, dests in traffic_matrix.items():
for dest_ip, mean_rate in dests.items():
if src_ip != dest_ip:
......@@ -59,14 +60,20 @@ def generate_and_send_traffic_matrix():
listen_port_map[dest_ip] += 1
file.write(f"{src_ip} {command}\n")
if dest_ip not in trace_receive:
trace_receive[dest_ip] = 0
trace_receive[dest_ip] += mean_rate
# print(f"Commands written to {file_path}")
itg_manager_path = "/home/osboxes/D-ITG-2.8.1-r1023-src/D-ITG-2.8.1-r1023/bin/ITGManager"
process = subprocess.Popen([itg_manager_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
time.sleep(1) # sleep to not overflow generator tool
print("Output:", stdout.decode())
time.sleep(0.5) # sleep to not overflow generator tool
# print("Output:", stdout.decode())
# print("Error:", stderr.decode())
for ip, receive_rate in trace_receive.items:
print("IP:", ip, " should received rate:", receive_rate)
print("Finish sending traffic matrix")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment