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

update log

parent 0b851e23
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ def generate_and_send_traffic_matrix(): ...@@ -30,7 +30,7 @@ def generate_and_send_traffic_matrix():
global map_point, traffic_matrix, f, A, p_NAT, num_machine, P_values global map_point, traffic_matrix, f, A, p_NAT, num_machine, P_values
listen_port_map = {} listen_port_map = {}
point_ips = sorted(map_point.keys()) point_ips = sorted(map_point.keys(), key=lambda ip_term: tuple(map(int, ip_term.split('.'))))
for i in range(len(point_ips)): for i in range(len(point_ips)):
point_ip_send = point_ips[i] point_ip_send = point_ips[i]
if point_ip_send not in traffic_matrix: if point_ip_send not in traffic_matrix:
...@@ -46,7 +46,7 @@ def generate_and_send_traffic_matrix(): ...@@ -46,7 +46,7 @@ def generate_and_send_traffic_matrix():
mean_rate = 1000 mean_rate = 1000
else: else:
mean_rate = round((f * A[i] * P_values[j]) / sum(P_values) + ((1 - f) * A[j] * P_values[i]) / sum(P_values)) mean_rate = round((f * A[i] * P_values[j]) / sum(P_values) + ((1 - f) * A[j] * P_values[i]) / sum(P_values))
# print("mean_rate", mean_rate, "Ai", A[i], "P_values j", P_values[j], "P_values i", P_values[i], "Aj", A[j], "f", f) print(f"{i}->{j}", "mean_rate", mean_rate, "Ai", A[i], "P_values j", P_values[j], "P_values i", P_values[i], "Aj", A[j], "f", f)
traffic_matrix[point_ip_send][point_ip_recv] = mean_rate traffic_matrix[point_ip_send][point_ip_recv] = mean_rate
...@@ -56,7 +56,7 @@ def generate_and_send_traffic_matrix(): ...@@ -56,7 +56,7 @@ def generate_and_send_traffic_matrix():
if src_ip != dest_ip: if src_ip != dest_ip:
with open(file_path, "w") as file: with open(file_path, "w") as file:
dest_port = listen_port_map[dest_ip] dest_port = listen_port_map[dest_ip]
command = f"-T TCP -a {dest_ip} -rp {dest_port} -O {mean_rate} -o 1400 -t 30000" command = f"-T UDP -a {dest_ip} -rp {dest_port} -O {mean_rate} -t 120000"
listen_port_map[dest_ip] += 1 listen_port_map[dest_ip] += 1
file.write(f"{src_ip} {command}\n") file.write(f"{src_ip} {command}\n")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment