Commit 53fa8c2d authored by Hejing Li's avatar Hejing Li
Browse files

nodeconfig: add Iperf appconfig for deterministic experiment

Also add no checkpoint parameter
parent b0e1a500
......@@ -20,90 +20,55 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
########################################################################
# This script is for reproducing [Table 1] in the paper.
# It generates experiments for all combinations of simulation.
#
# Host type has qemu-kvm(qemu in short), gem5-timing-mode(gt), qemu-timing-mode(qt)
# Nic type has Intel_i40e behavioral model(ib), corundum behavioral model(cb), corundum verilator(cv)
# Net type has Switch behavioral model(sw), ns-3(ns3)
#
# In each simulation, two hosts are connected by a switch
# [HOST_0] - [NIC_0] ---- [SWITCH] ---- [NIC_1] - [HOST_1]
# server client
#
# The server host runs netperf server and client host runs TCP_RR and
# TCP_STREAM test
#
# The command to run all the experiments is:
# $: python3 run.py pyexps/ae/t1_combination.py --filter nf-* --verbose
########################################################################
import simbricks.experiments as exp
import simbricks.simulators as sim
import simbricks.nodeconfig as node
from simbricks.simulator_utils import create_basic_hosts
host_types = ['qemu', 'gt', 'qt']
nic_types = ['ib', 'cb', 'cv']
net_types = ['sw', 'ns3']
host_types = ['gt']
nic_types = ['ib']
net_types = ['sw']
num_cores = 1
n_client = 1
experiments = []
# Create multiple experiments with different simulator permutations, which can
# be filtered later.
for host_type in host_types:
for nic_type in nic_types:
for net_type in net_types:
e = exp.Experiment('nf-' + host_type + '-' + net_type + '-' + nic_type)
# network
if net_type == 'sw':
net = sim.SwitchNet()
elif net_type == 'ns3':
net = sim.NS3BridgeNet()
else:
raise NameError(net_type)
e.add_network(net)
# host
if host_type == 'qemu':
host_class = sim.QemuHost
elif host_type == 'qt':
def qemu_timing():
h = sim.QemuHost()
h.sync = True
return h
host_class = qemu_timing
elif host_type == 'gt':
host_class = sim.Gem5Host
e.checkpoint = True
else:
raise NameError(host_type)
# nic
if nic_type == 'ib':
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
elif nic_type == 'cb':
nic_class = sim.CorundumBMNIC
nc_class = node.CorundumLinuxNode
elif nic_type == 'cv':
nic_class = sim.CorundumVerilatorNIC
nc_class = node.CorundumLinuxNode
else:
raise NameError(nic_type)
# create servers and clients
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class,
nc_class, node.NetperfServer)
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class,
nc_class, node.NetperfClient, ip_start = 2)
for c in clients:
c.wait = True
c.node_config.app.server_ip = servers[0].node_config.ip
# add to experiments
experiments.append(e)
e = exp.Experiment('dt-gt-ib-sw')
net = sim.SwitchNet()
e.add_network(net)
host_class = sim.Gem5Host
e.checkpoint = False
nic_class = sim.I40eNIC
nc_class = node.I40eLinuxNode
# create a host
servers = create_basic_hosts(e, 1, 'server', net, nic_class, host_class,
nc_class, node.IperfUDPServer, ip_start=2)
servers[0].node_config.nockp = 1
servers[0].cpu_freq = '3GHz'
# create a host
clients = create_basic_hosts(e, 1, 'client', net, nic_class, host_class,
nc_class, node.IperfUDPShortClient, ip_start=2)
clients[0].cpu_freq = '3GHz'
clients[0].node_config.cores = num_cores
clients[0].node_config.app.is_sleep = 1
clients[0].node_config.nockp = 1
clients[0].node_config.app.is_last = True
clients[0].wait = True
print(e.name)
# add to experiments
experiments.append(e)
......@@ -61,11 +61,16 @@ class NodeConfig(object):
"""App to be run on simulated host."""
mtu = 1500
"""Networking MTU."""
nockp = 0
"""Do not make checkpoint in Gem5."""
def config_str(self):
if self.sim == 'qemu':
cp_es = []
exit_es = ['poweroff -f']
else:
if (self.nockp):
cp_es = []
else:
cp_es = ['m5 checkpoint']
exit_es = ['m5 exit']
......@@ -386,6 +391,22 @@ class IperfUDPClient(AppConfig):
return cmds
class IperfUDPShortClient(AppConfig):
server_ip = '10.0.0.1'
rate = '150m'
is_last = False
def run_cmds(self, node):
cmds = ['sleep 1',
'iperf -c ' + self.server_ip + ' -u -n 1 ']
if self.is_last:
cmds.append('sleep 0.5')
else:
cmds.append('sleep 10')
return cmds
class IperfUDPClientSleep(AppConfig):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment