Skip to content

Commit ffd4ff2

Browse files
committed
change to per host-pair port number allocation
1 parent 92f1444 commit ffd4ff2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

analysis/fct_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_pctl(a, p):
2222
# For the exact naming, please check ../simulation/mix/fct_*.txt output by the simulation.
2323
CCs = [
2424
'hpccPint95ai50log1.05p1.000',
25-
'hp95ai50',
25+
#'hp95ai50',
2626
]
2727

2828
step = int(args.step)

simulation/scratch/third.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ map<uint32_t, map<uint32_t, uint64_t> > pairRtt;
115115

116116
std::vector<Ipv4Address> serverAddress;
117117

118-
// maintain port number for each host
119-
std::unordered_map<uint32_t, uint16_t> portNumder;
118+
// maintain port number for each host pair
119+
std::unordered_map<uint32_t, unordered_map<uint32_t, uint16_t> > portNumder;
120120

121121
struct FlowInput{
122122
uint32_t src, dst, pg, maxPacketCount, port, dport;
@@ -134,7 +134,7 @@ void ReadFlowInput(){
134134
}
135135
void ScheduleFlowInputs(){
136136
while (flow_input.idx < flow_num && Seconds(flow_input.start_time) == Simulator::Now()){
137-
uint32_t port = portNumder[flow_input.src]++; // get a new port number
137+
uint32_t port = portNumder[flow_input.src][flow_input.dst]++; // get a new port number
138138
RdmaClientHelper clientHelper(flow_input.pg, serverAddress[flow_input.src], serverAddress[flow_input.dst], port, flow_input.dport, flow_input.maxPacketCount, has_win?(global_t==1?maxBdp:pairBdp[n.Get(flow_input.src)][n.Get(flow_input.dst)]):0, global_t==1?maxRtt:pairRtt[flow_input.src][flow_input.dst]);
139139
ApplicationContainer appCon = clientHelper.Install(n.Get(flow_input.src));
140140
appCon.Start(Time(0));
@@ -978,7 +978,9 @@ int main(int argc, char *argv[])
978978
// maintain port number for each host
979979
for (uint32_t i = 0; i < node_num; i++){
980980
if (n.Get(i)->GetNodeType() == 0)
981-
portNumder[i] = 10000; // each host use port number from 10000
981+
for (uint32_t j = 0; j < node_num; j++){
982+
if (n.Get(j)->GetNodeType() == 0)
983+
portNumder[i][j] = 10000; // each host pair use port number from 10000
982984
}
983985

984986
flow_input.idx = 0;

0 commit comments

Comments
 (0)