wifiNetwork = NetworkBlock(wifi_block)
                wifiNetwork.setNodes([emu.getNode(gateway_id), emu.getNode(client_id)]) # 2 nodes?
                wifiNetwork.selectInterval(WIFI_EMU_CMD_INTERVAL)

                wifiNetwork.addPreprocessingStep(CutOutPartOfFile(client_startTimes[client_num], client_startTimes[client_num] + EMULATION_DURATION, False))
                wifiNetwork.addPreprocessingStep(SetConstantValueForColumn("", 3, 27000.0))  # empty prefix -> apply to all files

                wifiNetwork.addPreprocessingStep(RepeatIntermedFileUntil(EMULATION_DURATION, False))
                network_blocks.append(wifiNetwork)

                topology.append(str(gateway_id) + "," + str(client_id)+'\n')
                print("abilene-access/client-id: " + str(gateway_id) + "," + str(client_id))

            network_blocks.append(abileneNetwork)
            emu.addNetworkBlocks(network_blocks)




            # parse topology file and retrieve connections (abilene)
            ndn_NetworkOverlay = NDN_NetworkOverlay(emu.getNodes(),topology,"shortest","/localhost/nfd/strategy/best-route")
            
            # log cpu% on every node
            cpuLogging = CPUlogApp(emu.getNodes(), 1)
            
            # setup applications based on groups established before
            ndn_apps = []

            for server in groups:
                clients = groups[server]
示例#2
0
from emulation_lib.emulation import Emulation
from emulation_lib.network_blocks.network_block import NetworkBlock
from emulation_lib.apps.udperf_app import UdperfApp
from emulation_lib.linkcmd_backends.l_ import L_

emu = Emulation("../example.config.py", [0, 1])
emu.setLinkCmdBackend(L_())
n0 = emu.getNode(0)
n1 = emu.getNode(1)

# http://dashif.org/wp-content/uploads/2015/04/DASH-AVC-264-Test-Vectors-v09-CommunityReview.pdf
nb1 = NetworkBlock("./blocks/flicflac")
nb1.setNodes([n0, n1])
nb1.selectInterval(1000)

emu.addNetworkBlocks([nb1])

udperf_app = UdperfApp(n1, n0, 0.0, 12, 10000, 6000, 6001)

n1.addUserResult("/home/nfd/cmdScheduler.log",
                 "cmdSched" + str(n1.getId()) + ".log_%RUN%")

emu.setDuration(14)

emu.addApplications([udperf_app])

emu.setName('flicflac_loss')
emu.setOutputDirectory('./results/' + emu.getName())
emu.setNumberOfRuns(10)
emu.setSecondsBetweenRuns(5)
from emulation_lib.emulation import Emulation
from emulation_lib.network_blocks.random_static_network_block import RandomStaticNetworkBlock
from emulation_lib.apps.udperf_app import UdperfApp
from emulation_lib.linkcmd_backends.bdl_ import BDL_

emu = Emulation("./config_files/example.config.py", [0, 1])
emu.setLinkCmdBackend(BDL_())
n0 = emu.getNode(0)
n1 = emu.getNode(1)


rsb = RandomStaticNetworkBlock('./blocks/rstatic', 2, 0.15, 1337, [4000, 5000], [1, 5], [0, 0], 1000)
rsb.setNodes([n0, n1])

emu.addNetworkBlocks([rsb])

udperf_app1 = UdperfApp(n0, n1, 0.0, 99, 9000, 6000, 6001)
udperf_app2 = UdperfApp(n1, n0, 0.0, 99, 9000, 6000, 6001)

emu.setDuration(102)

emu.addApplications([udperf_app1, udperf_app2])

emu.setName('simpleRandomStatic')
emu.setOutputDirectory('./results/' + emu.getName())
emu.setNumberOfRuns(3)
emu.setSecondsBetweenRuns(15)

emu.start()
示例#4
0
n3 = emu.getNode(3)


nb1 = NetworkBlock("./blocks/symmetric")
nb1.setNodes([n0, n1])
nb1.selectInterval(1000)

nb2 = NetworkBlock("./blocks/symmetric")
nb2.setNodes([n2, n1])
nb2.selectInterval(1000)

nb3 = NetworkBlock("./blocks/symmetric")
nb3.setNodes([n3, n1])
nb3.selectInterval(1000)

emu.addNetworkBlocks([nb1, nb2, nb3])

udperf_app0 = UdperfApp(n1, n0, 0.0, 12, 6000, 6000, 6001)
udperf_app2 = UdperfApp(n1, n2, 0.0, 12, 6000, 6000, 6002)  # own-Ports must be unique on the same node!
udperf_app3 = UdperfApp(n1, n3, 0.0, 12, 6000, 6000, 6003)

n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%")

emu.setDuration(14)

emu.addApplications([udperf_app0, udperf_app2, udperf_app3])

emu.setName('symmetric_threeFlows')
emu.setOutputDirectory('./results/' + emu.getName())
emu.setNumberOfRuns(0)
emu.setSecondsBetweenRuns(5)
示例#5
0
s1_0 = StaticConnection(1, 0, 10983.440, 0.000632, 0.00)
s0_2 = StaticConnection(0, 2, 6442.800, 0.000724, 0.00)
s2_0 = StaticConnection(2, 0, 10983.440, 0.000632, 0.00)
snb = StaticNetworkBlock('../../emulation/test/static',
                         [s0_1, s1_0, s0_2, s2_0], 1000)
snb.setNodes([n0, n1, n2])

nb1 = NetworkBlock("./blocks/TwoNode_80211a_adhoc")
nb1.setNodes([n1, n3])
nb1.selectInterval(1000)

nb2 = NetworkBlock("./blocks/TwoNode_80211a_adhoc")
nb2.setNodes([n2, n3])
nb2.selectedInterval(1000)

emu.addNetworkBlocks([snb, nb1, nb2])

udperf_app0_1 = UdperfApp(n0, n1, 0.0, 99, 9000, 6000, 6001)
udperf_app1_0 = UdperfApp(n1, n0, 0.0, 99, 9000, 6000, 6001)
udperf_app0_2 = UdperfApp(n0, n2, 0.0, 99, 9000, 6000, 6001)
udperf_app2_0 = UdperfApp(n2, n0, 0.0, 99, 9000, 6000, 6001)
udperf_app1_3 = UdperfApp(n1, n3, 0.0, 99, 9000, 6000, 6001)
udperf_app3_1 = UdperfApp(n3, n1, 0.0, 99, 9000, 6000, 6001)
udperf_app2_3 = UdperfApp(n2, n3, 0.0, 99, 9000, 6000, 6001)
udperf_app3_2 = UdperfApp(n3, n2, 0.0, 99, 9000, 6000, 6001)

emu.setDuration(102)

emu.addApplications([
    udperf_app0_1, udperf_app1_0, udperf_app0_2, udperf_app2_0, udperf_app1_3,
    udperf_app3_1, udperf_app2_3, udperf_app3_2
示例#6
0
from emulation_lib.emulation import Emulation
from emulation_lib.network_blocks.static_network_block import StaticNetworkBlock
from emulation_lib.apps.udperf_app import UdperfApp
from emulation_lib.linkcmd_backends.bdl_ import BDL_

emu = Emulation("./config_files/example.config.py", [0, 1])
emu.setLinkCmdBackend(BDL_())
n0 = emu.getNode(0)
n1 = emu.getNode(1)

s1 = StaticConnection(0, 1, 6442.800, 0.001000, 50.00)
s2 = StaticConnection(1, 0, 10983.440, 0.00100, 50.00)
snb = StaticNetworkBlock('./blocks/static', [s1, s2], 1000)
snb.setNodes([n0, n1])

emu.addNetworkBlocks([snb])

udperf_app1 = UdperfApp(n0, n1, 0.0, 99, 9000, 6000, 6001)
udperf_app2 = UdperfApp(n1, n0, 0.0, 99, 9000, 6000, 6001)

emu.setDuration(102)

emu.addApplications([udperf_app1, udperf_app2])

emu.setName('simpleStatic')
emu.setOutputDirectory('./results/' + emu.getName())
emu.setNumberOfRuns(1)
emu.setSecondsBetweenRuns(15)

emu.start()
# and therefore overwrite the columns for delay (#1) and loss (#2) with zeros using the following preprocessing steps
wlan.addPreprocessingStep(SetConstantValueForColumn("", 1, 0))
wlan.addPreprocessingStep(SetConstantValueForColumn("", 2, 0))

# before (part of 1_0_1000.txt)
# 10.000000	0.001542	0.44	5522.400
# 11.000000	0.001679	0.22	5632.848
# 12.000000	0.002284	1.71	3522.064

# after (part of 1_0_1000.txt)
# 10.000000	0	0	5522.400
# 11.000000	0	0	5632.848
# 12.000000	0	0	3522.064

# add the network block to the emulation
emu.addNetworkBlocks([wlan])

#
# configure the applications to be run
#
# Perform iperf bandwidth measurement (UDP) from client_node to server_node.
# Create a new application functional block, passing node references.
# This application block takes care of the application lifecycle (here starting/stopping an iperf UDP bandwidth test)
# as well as the collection of results.
# server, client, client_runtime[s], client_bandwidth[Mbps]
iperfApp = iperf_logapp.IperfLogApp(server=emu.getNode(0),
                                    client=emu.getNode(1),
                                    client_runtime=EMULATION_DURATION - 1,
                                    client_bandwidth=100)

# add the application to the emulation object