From ac48fb802b9843a46d486482f226a1838883ab09 Mon Sep 17 00:00:00 2001 From: paul <83798867+HastyMonkey@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:10:32 -0800 Subject: [PATCH 1/2] Update SimAI.conf Specify trajectory node --- astra-sim-alibabacloud/inputs/config/SimAI.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/astra-sim-alibabacloud/inputs/config/SimAI.conf b/astra-sim-alibabacloud/inputs/config/SimAI.conf index eeabe1ac..53b1b91c 100644 --- a/astra-sim-alibabacloud/inputs/config/SimAI.conf +++ b/astra-sim-alibabacloud/inputs/config/SimAI.conf @@ -47,6 +47,7 @@ ACK_HIGH_PRIO 0 LINK_DOWN 0 0 0 ENABLE_TRACE 1 +TRACE_NODE 0 KMAX_MAP 6 25000000000 400 50000000000 800 100000000000 1600 200000000000 1200 400000000000 3200 1600000000000 2400 KMIN_MAP 6 25000000000 100 50000000000 200 100000000000 400 200000000000 300 400000000000 800 1600000000000 600 @@ -62,4 +63,4 @@ MON_START 0 MON_END 20000 QP_MON_INTERVAL 100 QLEN_MON_INTERVAL 10000 -BW_MON_INTERVAL 10000 \ No newline at end of file +BW_MON_INTERVAL 10000 From ea0f31ca04317671e9d74c3632dcb8e8f86bc926 Mon Sep 17 00:00:00 2001 From: paul <83798867+HastyMonkey@users.noreply.github.com> Date: Wed, 26 Feb 2025 23:19:47 -0800 Subject: [PATCH 2/2] Update common.h Get trajectory data for the specified node. --- .../astra-sim/network_frontend/ns3/common.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/astra-sim-alibabacloud/astra-sim/network_frontend/ns3/common.h b/astra-sim-alibabacloud/astra-sim/network_frontend/ns3/common.h index fb57a169..bc2aaf81 100644 --- a/astra-sim-alibabacloud/astra-sim/network_frontend/ns3/common.h +++ b/astra-sim-alibabacloud/astra-sim/network_frontend/ns3/common.h @@ -85,6 +85,7 @@ uint64_t link_down_time = 0; uint32_t link_down_A = 0, link_down_B = 0; uint32_t enable_trace = 1; +uint32_t trace_node = 0; uint32_t buffer_size = 16; @@ -658,6 +659,8 @@ bool ReadConf(string network_topo,string network_conf) { conf >> pint_log_base; } else if (key.compare("PINT_PROB") == 0) { conf >> pint_prob; + } else if (key.compare("TRACE_NODE") == 0) { + conf >> trace_node; } fflush(stdout); } @@ -981,13 +984,13 @@ void SetupNetwork(void (*qp_finish)(FILE *, Ptr),void (*send_fini } NodeContainer trace_nodes; - for (uint32_t i = 0; i < trace_num; i++) { - uint32_t nid; - tracef >> nid; - if (nid >= n.GetN()) { - continue; - } - trace_nodes = NodeContainer(trace_nodes, n.Get(nid)); +// The following code loops through all the nodes and writes them to the trajectory file. + // for (uint32_t i = 0; i < node_num; i++) { + // trace_nodes = NodeContainer(trace_nodes, n.Get(i)); + // } +// The following code retrieves the trajectory data for the specified node. + if (trace_node < node_num) { + trace_nodes = NodeContainer(trace_nodes, n.Get(trace_node)); } FILE *trace_output = fopen(trace_output_file.c_str(), "w");