Skip to content

Commit bdbce9f

Browse files
committed
Add fat tree topo build script, and P4 flow entry configuration to help build large topo network simulation
1 parent 7472756 commit bdbce9f

58 files changed

Lines changed: 11816 additions & 381 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ build_lib(
5050
utils/format-utils.cc
5151
utils/switch-api.cc
5252
utils/p4-queue.cc
53+
utils/fattree-topo-helper.cc
5354
model/p4-bridge-channel.cc
5455
model/p4-p2p-channel.cc
5556
model/custom-header.cc
@@ -64,12 +65,14 @@ build_lib(
6465
helper/p4-helper.cc
6566
helper/p4-topology-reader-helper.cc
6667
helper/p4-p2p-helper.cc
68+
helper/build-flowtable-helper.cc
6769
HEADER_FILES # equivalent to headers.source
6870
utils/p4-queue.h
6971
utils/format-utils.h
7072
utils/switch-api.h
7173
utils/register-access-v1model.h
7274
utils/primitives-v1model.h
75+
utils/fattree-topo-helper.h
7376
model/p4-bridge-channel.h
7477
model/p4-p2p-channel.h
7578
model/custom-header.h
@@ -84,6 +87,7 @@ build_lib(
8487
helper/p4-helper.h
8588
helper/p4-topology-reader-helper.h
8689
helper/p4-p2p-helper.h
90+
helper/build-flowtable-helper.h
8791
LIBRARIES_TO_LINK
8892
${libcore}
8993
${libnetwork}

examples/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ build_lib_example(
8585
${libflow-monitor}
8686
)
8787

88+
# fattree test
89+
build_lib_example(
90+
NAME p4-topo-fattree
91+
SOURCE_FILES p4-topo-fattree.cc
92+
LIBRARIES_TO_LINK
93+
${libp4sim}
94+
${libinternet}
95+
${libapplications}
96+
${libnetwork}
97+
)
98+
8899
# [ ================= PSA Arch ================= ]
89100

90101
# simple 2 hosts 1 switch topology [ipv4 forwarding]
@@ -112,6 +123,18 @@ build_lib_example(
112123
${libnetwork}
113124
)
114125

126+
# fattree test
127+
build_lib_example(
128+
NAME topo-fattree
129+
SOURCE_FILES topo-fattree.cc
130+
LIBRARIES_TO_LINK
131+
${libp4sim}
132+
${libinternet}
133+
${libapplications}
134+
${libnetwork}
135+
${libnix-vector-routing}
136+
)
137+
115138
# [ ================= Test ================= ]
116139

117140
# custom header test

examples/p4-basic-tunnel.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ unsigned long start = getTickCount();
4040
double global_start_time = 1.0;
4141
double sink_start_time = global_start_time + 1.0;
4242
double client_start_time = sink_start_time + 1.0;
43-
double client_stop_time = client_start_time + 30; // sending time
43+
double client_stop_time = client_start_time + 3; // sending time
4444
double sink_stop_time = client_stop_time + 5;
4545
double global_stop_time = sink_stop_time + 5;
4646

@@ -185,7 +185,7 @@ main(int argc, char* argv[])
185185

186186
int running_number = 0;
187187
uint16_t pktSize = 1000; // in Bytes. 1458 to prevent fragments, default 512
188-
std::string appDataRate[] = {"10Mbps", "40Mbps"}; // Default application data rate
188+
std::string appDataRate[] = {"1Mbps", "4Mbps"}; // Default application data rate
189189
std::string ns3_link_rate = "100Mbps";
190190
bool enableTracePcap = true;
191191

@@ -350,7 +350,7 @@ main(int argc, char* argv[])
350350
// p4SwitchHelper.SetDeviceAttribute("ChannelType", UintegerValue(0));
351351
p4SwitchHelper.SetDeviceAttribute("P4SwitchArch", UintegerValue(0));
352352
p4SwitchHelper.SetDeviceAttribute("ChannelType", UintegerValue(1));
353-
p4SwitchHelper.SetDeviceAttribute("SwitchRate", UintegerValue(10000));
353+
p4SwitchHelper.SetDeviceAttribute("SwitchRate", UintegerValue(1000));
354354

355355
for (unsigned int i = 0; i < switchNum; i++)
356356
{

examples/p4-l3-router.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ main(int argc, char* argv[])
263263
Simulator::Destroy();
264264

265265
return 0;
266-
}
266+
}

0 commit comments

Comments
 (0)