Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
274f06bf
Commit
274f06bf
authored
Dec 03, 2020
by
Hejing Li
Browse files
dctcp.py: add O3
parent
232952d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
63 deletions
+71
-63
experiments/pyexps/dctcp.py
experiments/pyexps/dctcp.py
+71
-63
No files found.
experiments/pyexps/dctcp.py
View file @
274f06bf
...
@@ -10,19 +10,21 @@ import modes.nodeconfig as node
...
@@ -10,19 +10,21 @@ import modes.nodeconfig as node
# net: switch/dumbbell/bridge
# net: switch/dumbbell/bridge
# app: DCTCPm
# app: DCTCPm
types_of_host
=
[
'qemu'
,
'qt'
,
'gt'
]
types_of_host
=
[
'qemu'
,
'qt'
,
'gt'
,
'gO3'
]
types_of_nic
=
[
'cv'
,
'cb'
,
'ib'
]
types_of_nic
=
[
'cv'
,
'cb'
,
'ib'
]
types_of_net
=
[
'dumbbell'
]
types_of_net
=
[
'dumbbell'
]
types_of_app
=
[
'DCTCPm'
]
types_of_app
=
[
'DCTCPm'
]
types_of_mtu
=
[
1500
,
4000
,
9000
]
num_pairs
=
2
num_pairs
=
2
max_k
=
199680
max_k
=
199680
#
k_step = 8320
k_step
=
8320
k_step
=
16640
#
k_step = 16640
link_rate_opt
=
'--LinkRate=10Gb/s '
# don't forget space at the end
link_rate_opt
=
'--LinkRate=10Gb/s '
# don't forget space at the end
link_latency_opt
=
'--LinkLatency=
0
'
link_latency_opt
=
'--LinkLatency=
500ns
'
cpu_freq
=
'5GHz'
#GHz
cpu_freq
=
'5GHz'
#GHz
mtu
=
4000
#mtu = 4000
sys_clock
=
'2GHz'
# if not set, default 1GHz
ip_start
=
'192.168.64.1'
ip_start
=
'192.168.64.1'
...
@@ -31,64 +33,70 @@ experiments = []
...
@@ -31,64 +33,70 @@ experiments = []
# set network sim
# set network sim
net_class
=
sim
.
NS3DumbbellNet
net_class
=
sim
.
NS3DumbbellNet
for
mtu
in
types_of_mtu
:
for
h
in
types_of_host
:
for
c
in
types_of_nic
:
for
k_val
in
range
(
0
,
max_k
+
1
,
k_step
):
net
=
net_class
()
net
.
opt
=
link_rate_opt
+
link_latency_opt
+
f
'--EcnTh=
{
k_val
}
'
e
=
exp
.
Experiment
(
h
+
'-'
+
c
+
'-'
+
'dumbbell'
+
'-'
+
'DCTCPm'
+
f
'
{
k_val
}
'
+
f
'-
{
mtu
}
'
)
e
.
add_network
(
net
)
# host
if
h
==
'qemu'
:
host_class
=
sim
.
QemuHost
elif
h
==
'qt'
:
def
qemu_timing
():
h
=
sim
.
QemuHost
()
h
.
sync
=
True
return
h
host_class
=
qemu_timing
elif
h
==
'gt'
:
host_class
=
sim
.
Gem5Host
host_class
.
sys_clock
=
sys_clock
e
.
checkpoint
=
True
elif
h
==
'gO3'
:
host_class
=
sim
.
Gem5Host
host_class
.
cpu_type
=
'DerivO3CPU'
host_class
.
sys_clock
=
sys_clock
e
.
checkpoint
=
True
else
:
raise
NameError
(
h
)
# nic
if
c
==
'ib'
:
nic_class
=
sim
.
I40eNIC
nc_class
=
node
.
I40eDCTCPNode
elif
c
==
'cb'
:
nic_class
=
sim
.
CorundumBMNIC
nc_class
=
node
.
CorundumDCTCPNode
elif
c
==
'cv'
:
nic_class
=
sim
.
CorundumVerilatorNIC
nc_class
=
node
.
CorundumDCTCPNode
else
:
raise
NameError
(
c
)
servers
=
sim
.
create_dctcp_hosts
(
e
,
num_pairs
,
'server'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
DctcpServer
,
cpu_freq
,
mtu
)
clients
=
sim
.
create_dctcp_hosts
(
e
,
num_pairs
,
'client'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
DctcpClient
,
cpu_freq
,
mtu
,
ip_start
=
num_pairs
+
1
)
for
h
in
types_of_host
:
for
c
in
types_of_nic
:
for
k_val
in
range
(
0
,
max_k
+
1
,
k_step
):
net
=
net_class
()
net
.
opt
=
link_rate_opt
+
link_latency_opt
+
f
'--EcnTh=
{
k_val
}
'
e
=
exp
.
Experiment
(
h
+
'-'
+
c
+
'-'
+
'dumbbell'
+
'-'
+
'DCTCPm'
+
f
'
{
k_val
}
'
+
f
'-
{
mtu
}
'
)
e
.
add_network
(
net
)
# host
if
h
==
'qemu'
:
host_class
=
sim
.
QemuHost
elif
h
==
'qt'
:
def
qemu_timing
():
h
=
sim
.
QemuHost
()
h
.
sync
=
True
return
h
host_class
=
qemu_timing
elif
h
==
'gt'
:
host_class
=
sim
.
Gem5Host
e
.
checkpoint
=
True
else
:
raise
NameError
(
h
)
# nic
if
c
==
'ib'
:
nic_class
=
sim
.
I40eNIC
nc_class
=
node
.
I40eDCTCPNode
elif
c
==
'cb'
:
nic_class
=
sim
.
CorundumBMNIC
nc_class
=
node
.
CorundumDCTCPNode
elif
c
==
'cv'
:
nic_class
=
sim
.
CorundumVerilatorNIC
nc_class
=
node
.
CorundumDCTCPNode
else
:
raise
NameError
(
c
)
servers
=
sim
.
create_dctcp_hosts
(
e
,
num_pairs
,
'server'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
DctcpServer
,
cpu_freq
,
mtu
)
clients
=
sim
.
create_dctcp_hosts
(
e
,
num_pairs
,
'client'
,
net
,
nic_class
,
host_class
,
nc_class
,
node
.
DctcpClient
,
cpu_freq
,
mtu
,
ip_start
=
num_pairs
+
1
)
i
=
0
for
cl
in
clients
:
cl
.
node_config
.
app
.
server_ip
=
servers
[
i
].
node_config
.
ip
i
+=
1
# All the clients will not poweroff after finishing iperf test except the last one
i
=
0
# This is to prevent the simulation gets stuck when one of host exits.
for
cl
in
clients
:
cl
.
node_config
.
app
.
server_ip
=
servers
[
i
].
node_config
.
ip
# The last client waits for the output printed in other hosts, then cleanup
i
+=
1
clients
[
num_pairs
-
1
].
node_config
.
app
.
is_last
=
True
clients
[
num_pairs
-
1
].
wait
=
True
# All the clients will not poweroff after finishing iperf test except the last one
# This is to prevent the simulation gets stuck when one of host exits.
print
(
e
.
name
)
experiments
.
append
(
e
)
# The last client waits for the output printed in other hosts, then cleanup
clients
[
num_pairs
-
1
].
node_config
.
app
.
is_last
=
True
clients
[
num_pairs
-
1
].
wait
=
True
print
(
e
.
name
)
experiments
.
append
(
e
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment