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.bdl_ import BDL_ emu = Emulation("./config_files/example.config.py", [0, 1]) emu.setLinkCmdBackend(BDL_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/TwoNode_80211a_adhoc") nb1.setNodes([n0, n1]) emu.addNetworkBlocks([nb1]) udperf_app1 = UdperfApp(n0, n1, 0.0, 99, 9000, 6000, 6001) udperf_app2 = UdperfApp(n1, n0, 0.0, 99, 9000, 6000, 6001) n0.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched0.log_%RUN%") n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched1.log_%RUN%") emu.setDuration(102) emu.addApplications([udperf_app1, udperf_app2]) emu.setName('simple_sequence') emu.setNumberOfRuns(3) emu.setSecondsBetweenRuns(15) for intervalSize in [1000, 500, 250, 100]: emu.setName(intervalSize)
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.bdl_ import BDL_ from emulation_lib.linkcmd_backends.netem_bdl_ import netem_BDL_ from emulation_lib.linkcmd_backends.d_bl import D_BL emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(D_BL()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/two_node_7000") nb1.setNodes([n0, n1]) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 7500, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(1) for interval in [1000]: nb1.selectInterval(interval)
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.preprocessing.set_constant_value_for_column import SetConstantValueForColumn from emulation_lib.linkcmd_backends.bdl_ import BDL_ from emulation_lib.linkcmd_backends.d_bl import D_BL emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(D_BL()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/two_node_7000") nb1.setNodes([n0, n1]) nb1.addPreprocessingStep(SetConstantValueForColumn("", 3, 27000.0)) # empty prefix -> apply to all files emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 7500, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(1) for interval in [1000]: nb1.selectInterval(interval)
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.b_ import B_ emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/symmetric_half") nb1.setNodes([n0, n1]) nb1.selectInterval(1000) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 12, 3000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(14) emu.addApplications([udperf_app]) emu.setName('symmetric_half') emu.setOutputDirectory('./results/' + emu.getName()) emu.setNumberOfRuns(10) emu.setSecondsBetweenRuns(5) emu.start()
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.preprocessing.set_constant_value_for_column import SetConstantValueForColumn from emulation_lib.linkcmd_backends.bd_ import BD_ from emulation_lib.linkcmd_backends.bdl_ import BDL_ from emulation_lib.linkcmd_backends.netem_bdl_ import netem_BDL_ from emulation_lib.linkcmd_backends.d_bl import D_BL from emulation_lib.linkcmd_backends.dl_b import DL_B cmd_dists = [BD_(), BDL_(), netem_BDL_(), D_BL(), DL_B()] emu = Emulation("../example.config.py", [0, 1]) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/original_sim_normal") nb1.selectInterval(1000) nb1.setNodes([n0, n1]) nb1.addPreprocessingStep(SetConstantValueForColumn( "", 3, 27000.0)) # empty prefix -> apply to all files emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 7500, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app])
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.b_ import B_ emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/baseline_60Mbps") nb1.setNodes([n0, n1]) nb1.selectInterval(1000) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 12, 60000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(14) emu.addApplications([udperf_app]) emu.setName('baseline_60Mbps') emu.setOutputDirectory('./results/' + emu.getName()) emu.setNumberOfRuns(10) emu.setSecondsBetweenRuns(5) emu.start()
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.preprocessing.set_constant_value_for_column import SetConstantValueForColumn from emulation_lib.linkcmd_backends.bd_ import BD_ from emulation_lib.linkcmd_backends.bdl_ import BDL_ from emulation_lib.linkcmd_backends.netem_bdl_ import netem_BDL_ from emulation_lib.linkcmd_backends.d_bl import D_BL from emulation_lib.linkcmd_backends.dl_b import DL_B cmd_dists = [BD_(), BDL_(), netem_BDL_(), D_BL(), DL_B()] emu = Emulation("../example.config.py", [0, 1]) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/TwoNode_80211a_adhoc") nb1.selectInterval(1000) nb1.setNodes([n0, n1]) nb1.addPreprocessingStep(SetConstantValueForColumn( "", 3, 27000.0)) # empty prefix -> apply to all files emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 7500, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app])
from emulation_lib.linkcmd_backends.b_ import B_ # ==> n0 # |^| # n1==> n2 # |v| # ==> n3 emu = Emulation("../example.config.py", [0, 1, 2, 3]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) n2 = emu.getNode(2) 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!
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.d_bl import D_BL emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(D_BL()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/original_sim_normal") nb1.setNodes([n0, n1]) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 7500, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(1) for interval in [1000, 500, 250, 100]: nb1.selectInterval(interval) emu.setName('original_sim_normal_interval_' + str(interval)) emu.setOutputDirectory('./results/' + emu.getName()) emu.start()
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.b_ import B_ from emulation_lib.preprocessing.repeat_file_until import RepeatIntermedFileUntil emu_duration = 60 # seconds emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/symmetric") nb1.setNodes([n0, n1]) nb1.selectInterval(1000) nb1.addPreprocessingStep(RepeatIntermedFileUntil(emu_duration, False)) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, emu_duration - 2, 6000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(emu_duration) emu.addApplications([udperf_app]) emu.setName('symmetric_repeated') emu.setOutputDirectory('./results/' + emu.getName())
emu = Emulation("./config_files/example.config.py", [0, 1, 2, 3]) emu.setLinkCmdBackend(BDL_()) n0 = emu.getNode(0) n1 = emu.getNode(1) n2 = emu.getNode(2) n3 = emu.getNode(3) s0_1 = StaticConnection(0, 1, 6442.800, 0.000724, 0.00) 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)
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.b_ import B_ emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/symmetric") nb1.setNodes([n0, n1]) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 12, 6000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(14) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(10) for interval in [1000, 500, 250, 100]: nb1.selectInterval(interval) emu.setName('symmetric_interval_' + str(interval)) emu.setOutputDirectory('./results/' + emu.getName()) emu.start()
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/NP2j") 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('NP2j_loss') emu.setOutputDirectory('./results/' + emu.getName()) emu.setNumberOfRuns(10) emu.setSecondsBetweenRuns(5)
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.b_ import B_ from emulation_lib.preprocessing.set_constant_value_for_column import SetConstantValueForColumn emu_duration = 14 # seconds emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(B_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/symmetric") nb1.setNodes([n0, n1]) nb1.selectInterval(1000) nb1.addPreprocessingStep(SetConstantValueForColumn("1_0", 3, 10000.0)) emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, emu_duration - 2, 6000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(emu_duration) emu.addApplications([udperf_app]) emu.setName('symmetric_constantValue') emu.setOutputDirectory('./results/' + emu.getName())
emu = Emulation("./example.config.py", list(range(0,12 + NUM_CLIENTS))) emu.setName(os.path.basename(wifi_block) + "_" + app_type + "_" + str(run)) emu.setLinkCmdBackend(BDL_()) emu.setSecondsBetweenRuns(5) emu.setOutputDirectory('./results/onlyNdnDemoApps_experiment/' + emu.getName()) emu.setDuration(EMULATION_DURATION) # seconds # ensure NFD-logfiles are cleaned up and wldrdaemons are shutdown for node in emu.getNodes(): node.scheduleUserCmd(constants.SETUP_TIME, "sudo rm /var/run/shm/nfd_packet_log/nfd_packet_log.csv") node.scheduleUserCmd(constants.SETUP_TIME, "sudo killall wldrdaemon_udp") node.scheduleUserCmd(constants.SETUP_TIME, "sudo killall tail") # set up network-blocks abileneNetwork = NetworkBlock("./blocks/abilene") abileneNetwork.setNodes(emu.getNodes()[0:12]) abileneNetwork.selectInterval(1000) # without consequence as network-properties are static anyway (in this scenario) abileneNetwork.addPreprocessingStep(RepeatIntermedFileUntil(EMULATION_DURATION, False)) network_blocks = [] # read topology from file with open("./topologies/abilene.txt","r") as topologyFile: topology = topologyFile.readlines() groups = {emu.getNode(serverNode): []} clientGatewayAssoc = {} # add blocks for "last-miles" for client_num in range(0, len(client_gateways)):
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.bdl_ import BDL_ emu = Emulation("./config_files/example.config.py", [0, 1]) emu.setLinkCmdBackend(BDL_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/profile1") nb1.setNodes([n0, n1]) nb1.selectInterval(1000) emu.addNetworkBlocks([nb1]) udperf_app1 = UdperfApp(n0, n1, 0.0, 19, 3000, 6000, 6001) udperf_app2 = UdperfApp(n1, n0, 0.0, 19, 3000, 6000, 6001) n0.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched0.log_%RUN%") n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched1.log_%RUN%") emu.setDuration(20) emu.addApplications([udperf_app1, udperf_app2]) emu.setName('reactionTime') emu.setOutputDirectory('./results/' + emu.getName()) emu.setNumberOfRuns(3) emu.setSecondsBetweenRuns(15)
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.preprocessing.set_constant_value_for_column import SetConstantValueForColumn from emulation_lib.linkcmd_backends.bdl_ import BDL_ emu = Emulation("example.config.py", [0, 1]) emu.setLinkCmdBackend(BDL_()) n0 = emu.getNode(0) n1 = emu.getNode(1) nb1 = NetworkBlock("./blocks/simple_mobility_802.11G_AdHoc_constant") nb1.setNodes([n0, n1]) nb1.addPreprocessingStep(SetConstantValueForColumn("", 3, 27000.0)) # empty prefix -> apply to all files emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 10000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(40) for interval in [1000, 500, 250, 100, 50, 25]: nb1.selectInterval(interval) emu.setName(str(interval))
import os emu = Emulation("../example.config.py", [0, 1]) emu.setLinkCmdBackend(BDL_()) n0 = emu.getNode(0) n1 = emu.getNode(1) blockPaths = [ "./blocks/sim2/simple_mobility_802.11A_AdHoc", "./blocks/sim2/simple_mobility_802.11G_AdHoc_Arf", "./blocks/sim2/simple_mobility_802.11G_AdHoc_constant", "./blocks/sim2/two_nodes_802.11G", "./blocks/sim2/wifi_linearDistanceUDP_deferredStart_udperf", "./blocks/sim2/two_nodes_802.11G_unidir" ] nb1 = NetworkBlock(blockPaths[0]) # init nb1 emu.addNetworkBlocks([nb1]) udperf_app = UdperfApp(n1, n0, 0.0, 110, 10000, 6000, 6001) n1.addUserResult("/home/nfd/cmdScheduler.log", "cmdSched" + str(n1.getId()) + ".log_%RUN%") emu.setDuration(112) emu.addApplications([udperf_app]) emu.setSecondsBetweenRuns(5) emu.setNumberOfRuns(1) for bpath in blockPaths: # update nb1
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)
emu = Emulation("./example.config.py", list(range(0, NUMBER_OF_NODES))) emu.setName("HelloWorld") emu.setLinkCmdBackend(BDL_()) emu.setSecondsBetweenRuns(5) emu.setOutputDirectory('./results/HelloWorld') # time in seconds, after which a run is to be considered finished, which triggers the fetching # of the results and the initiation of the next run emu.setDuration(EMULATION_DURATION) # seconds # # configure network block # # the folder containing the pre-calculated intermediate files to be used WIFI_BLOCK = "./blocks/simple_mobility_802.11G_AdHoc_constant" # create a new network block object based on the given intermediate file folder wlan = NetworkBlock(WIFI_BLOCK) wlan.setNodes( emu.getNodes() [0:NUMBER_OF_NODES]) # assign all two nodes to be part of the network # select interval of network condition changes # ./blocks/simple_mobility_802.11G_AdHoc_constant/0_1_1000.txt # ./blocks/simple_mobility_802.11G_AdHoc_constant/1_0_1000.txt wlan.selectInterval(1000) # preprocessing steps are ways to modify intermediate files without changing the originals (experimentation) # if the given intermediate files were too long, here we could use a preprocessing step to only take the first n seconds wlan.addPreprocessingStep(RepeatIntermedFileUntil(EMULATION_DURATION, False)) # for this example, we only want to restrict the bandwidth (column #3 in the intermediate file) # and therefore overwrite the columns for delay (#1) and loss (#2) with zeros using the following preprocessing steps wlan.addPreprocessingStep(SetConstantValueForColumn("", 1, 0))