gt_udp_multi.py 2.35 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import modes.experiments as exp
import modes.simulators as sim
import modes.nodeconfig as node


# iperf TCP_multi_client test
# naming convention following host-nic-net-app
# host: gem5-timing
# nic:  cv/cb/ib
# net:  switch/dumbbell/bridge
# app: UDPm

kinds_of_host = ['gem5-timing']
kinds_of_nic = ['cv','cb','ib']
kinds_of_net = ['switch', 'dumbbell', 'bridge']
kinds_of_app = ['UDPm']

num_client = 4
rate = '200m'

experiments = []

# set network sim
for n in kinds_of_net:

    if n == 'switch':
        net_class = sim.SwitchNet
    if n == 'dumbbell':
        net_class = sim.NS3DumbbellNet
    if n == 'bridge':
        net_class = sim.NS3BridgeNet


    # set nic sim
    for c in kinds_of_nic:
        net = net_class()
        e = exp.Experiment('gt-'  + c + '-' + n + '-' + 'UDPm')
        e.checkpoint = True
        e.add_network(net)
        
        if c == 'cv':
            servers = sim.create_basic_hosts(e, 1, 'server', net, sim.CorundumVerilatorNIC, sim.Gem5Host, 
                                             node.CorundumLinuxNode, node.IperfUDPServer)
            clients = sim.create_basic_hosts(e, num_client, 'client', net, sim.CorundumVerilatorNIC, sim.Gem5Host, 
                                             node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2)

        
        if c == 'cb':
            servers = sim.create_basic_hosts(e, 1, 'server', net, sim.CorundumBMNIC, sim.Gem5Host, 
                                             node.CorundumLinuxNode, node.IperfUDPServer)
            clients = sim.create_basic_hosts(e, num_client, 'client', net, sim.CorundumBMNIC, sim.Gem5Host, 
                                             node.CorundumLinuxNode, node.IperfUDPClient, ip_start = 2)
            
        

        if c == 'ib':
            servers = sim.create_basic_hosts(e, 1, 'server', net, sim.I40eNIC, sim.Gem5Host, 
                                             node.I40eLinuxNode, node.IperfUDPServer)
            clients = sim.create_basic_hosts(e, num_client, 'client', net, sim.I40eNIC, sim.Gem5Host, 
                                             node.I40eLinuxNode, node.IperfUDPClient, ip_start = 2)
            
        
        for cl in clients:
            cl.wait = True
            cl.node_config.app.server_ip = servers[0].node_config.ip
            cl.node_config.app.rate = rate

        print(e.name)
        experiments.append(e)