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.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)
wifi_blocks = ["./blocks/randomWalk2d4040", "./blocks/constantPosition4040","./blocks/randomDirection4040"] for wifi_block in wifi_blocks: for app_type in ["NDN_DemoApps"]: for run in range(0, NUM_RUNS): # determine client-server groups random.seed(run*1000) serverNode = random.randint(0,11) client_gateways = [] for c in range(0, NUM_CLIENTS): client_gateways.append(random.randint(0,11)) client_startTimes = random.sample(range(0, int(EMULATION_DURATION / 2)), NUM_CLIENTS) print("client_start-times: " + str(client_startTimes)) # general emulation settings 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")
from emulation_lib.emulation import Emulation from emulation_lib.network_blocks.network_block import NetworkBlock from emulation_lib.preprocessing.set_constant_value_for_column import SetConstantValueForColumn from emulation_lib.preprocessing.repeat_file_until import RepeatIntermedFileUntil from emulation_lib.linkcmd_backends.bdl_ import BDL_ import iperf_logapp NUM_RUNS = 2 EMULATION_DURATION = 100 # seconds NUMBER_OF_NODES = 2 # # general emulation settings # 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(