~comnets/openwns-systemtest-wimac/systemtest-wimac--main--1.0

33 by Karsten Klagges
new bypass queue test
1
import openwns
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
2
from openwns.pyconfig import Frozen
33 by Karsten Klagges
new bypass queue test
3
import openwns.evaluation.default
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
4
5
import scenarios
6
import scenarios.builders
7
import scenarios.placer
8
import scenarios.antenna
9
10
import ip
11
import ip.BackboneHelpers
12
13
import wimac.support.nodecreators
14
import wimac.support.helper
33 by Karsten Klagges
new bypass queue test
15
import wimac.evaluation.default
34.1.7 by Maciej Muehleisen
First steps of config cleanup and restruct
16
import wimac.support.PostProcessor as PostProcessor
33 by Karsten Klagges
new bypass queue test
17
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
18
from wimac.support.WiMACParameters import ParametersOFDM, ParametersMAC
19
33 by Karsten Klagges
new bypass queue test
20
import random
21
random.seed(7)
22
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
23
# Global station id generator
24
def stationID():
25
    id = 1
26
    while (True):
27
        yield id
28
        id += 1
29
        
30
stationIDs = stationID()
33 by Karsten Klagges
new bypass queue test
31
32
associations = {}
33
34
####################################################
35
###  Distinguished Simulation Settings             #
36
####################################################
37
class Config(Frozen):
38
    # Set basic WiMAX Parameters
39
    parametersPhy         = ParametersOFDM
40
    parametersMAC         = ParametersMAC
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
41
    
34.1.7 by Maciej Muehleisen
First steps of config cleanup and restruct
42
    parametersPhy.slotDuration = 3.0 *  parametersPhy.symbolDuration
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
43
    numberOfTimeSlots = 100
44
59.1.12 by Maciej Muehleisen
New MCSs cause new reference results. Reduced PDU size in Bypass test to fit with most robust MCS.
45
    packetSize = 86.0
40 by Maciej Muehleisen
Harmonized config between Base and Bypass.
46
    trafficUL = 5E5 # bit/s per station
47
    trafficDL = 5E5 # bit/s per station
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
48
    
38 by Maciej Muehleisen
Test further improved. Still problem with simultanious UL transmissions.
49
    noIPHeader = True #Set to true to set IP header to 0
50
    probeWindowSize = 0.01 # Probe per frame
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
51
    scheduler = "RoundRobin" # "PropFair"
71 by Maciej Muehleisen
Activated delta probes. Added settlingTime.
52
    
53
    settlingTime = 0.0
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
54
55
# General Setup
33 by Karsten Klagges
new bypass queue test
56
WNS = openwns.Simulator(simulationModel = openwns.node.NodeSimulationModel())
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
57
openwns.setSimulator(WNS)
41 by Maciej Muehleisen
Reduced simTime which was accidently set too long
58
WNS.maxSimTime = 0.07999 # seconds
33 by Karsten Klagges
new bypass queue test
59
WNS.masterLogger.backtrace.enabled = False
60
WNS.masterLogger.enabled = True
61
WNS.outputStrategy = openwns.simulator.OutputStrategy.DELETE
62
WNS.statusWriteInterval = 30 # in seconds
40 by Maciej Muehleisen
Harmonized config between Base and Bypass.
63
WNS.probesWriteInterval = 300 # in seconds
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
64
        
65
# Pass WiMAX Phy parameters to wimac::parameter::PHY singleton
33 by Karsten Klagges
new bypass queue test
66
WNS.modules.wimac.parametersPHY = Config.parametersPhy
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
67
                
68
WNS.modules.rise.debug.antennas = True                
69
                
70
# Create and place the nodes:
71
# One BS (25m omnidirectional antenna height) with two nodes, one near, one far
72
73
bsPlacer = scenarios.placer.HexagonalPlacer(numberOfCircles = 0, interSiteDistance = 100.0, rotate=0.0)
59.1.12 by Maciej Muehleisen
New MCSs cause new reference results. Reduced PDU size in Bypass test to fit with most robust MCS.
74
uePlacer = scenarios.placer.LinearPlacer(numberOfNodes = 2, positionsList = [10, 4000])
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
75
bsAntenna = scenarios.antenna.IsotropicAntennaCreator([0.0, 0.0, 5.0])
76
bsCreator = wimac.support.nodecreators.WiMAXBSCreator(stationIDs, Config)
77
ueCreator = wimac.support.nodecreators.WiMAXUECreator(stationIDs, Config)
67 by Xiaoniu Yang
made it compatible with scenarios changes about set channel model
78
channelmodelcreator = wimac.support.helper.TestChannelModelCreator()
79
scenarios.builders.CreatorPlacerBuilder(bsCreator, bsPlacer, bsAntenna, ueCreator, uePlacer, channelmodelcreator)
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
80
59.1.1 by Maciej Muehleisen
Adjustments to config to include right TX power and noise figure. Reference outputs changed due to UT noise figure.
81
wimac.support.helper.setupPhy(WNS, Config, "LoS_Test")
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
82
83
# Set the scheduler
84
wimac.support.helper.setupScheduler(WNS, Config.scheduler)
85
86
# Set IP Header to 0 (else it is 20 byte)
87
if Config.noIPHeader:
88
    wimac.support.helper.disableIPHeader(WNS)
89
90
# Always create uplink traffic, if traffic UL is 0 we sent exacly 
91
# one packet for initialization
92
wimac.support.helper.createULPoissonTraffic(WNS, Config.trafficUL, Config.packetSize)
93
94
# Only create downlink traffic if we have any
95
if Config.trafficDL > 0.0:
96
    wimac.support.helper.createDLPoissonTraffic(WNS, Config.trafficDL, Config.packetSize)
97
98
# Configure the window probes
99
wimac.support.helper.setL2ProbeWindowSize(WNS, Config.probeWindowSize)
100
59.1.2 by Xiaoniu Yang
use getNodesByProperty("Type") instead of getNodesByType()
101
utNodes = WNS.simulationModel.getNodesByProperty("Type", "UE")
102
bsNodes = WNS.simulationModel.getNodesByProperty("Type", "BS")
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
103
104
##################################################################################################
105
# Configure the scheduler to use the BypassQueue
59.1.3 by Maciej Muehleisen
Dynamic association is now used. Reference outputs changed since first IP PDU at time 0.0 is lost because stations are not yet associated.
106
for bs in bsNodes:
107
    
108
    # Use the Bypass Queue
109
    # DL Master
110
    bs.dll.dlscheduler.config.txScheduler.queue = wimac.Scheduler.BypassQueue()
111
    bs.dll.dlscheduler.config.txScheduler.alwaysAcceptIfQueueAccepts = True
112
    
113
    # Use the Simple Queue
114
    # UL Master
115
    bs.dll.ulscheduler.config.rxScheduler.queue = openwns.Scheduler.SimpleQueue()
116
    bs.dll.ulscheduler.config.rxScheduler.alwaysAcceptIfQueueAccepts = True        
117
    
118
    # Pop the Reassembly FU
119
    bs.dll.subFUN.connects.pop(0)
120
    bs.dll.group.bottom = "buffer"
121
    
122
    # We need PseudeBWRequests with the Bypass Queue
123
    bs.dll.ulscheduler.config.rxScheduler.pseudoGenerator = wimac.Scheduler.PseudoBWRequestGenerator(
124
                'connectionManager',
125
                'ulscheduler',
126
                _packetSize = Config.packetSize,
127
                _pduOverhead = Config.parametersMAC.pduOverhead)
128
    
129
    if Config.noIPHeader:
130
        bs.dll.ulscheduler.config.rxScheduler.pseudoGenerator.pduOverhead -= 160
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
131
132
for ss in utNodes:
34.1.7 by Maciej Muehleisen
First steps of config cleanup and restruct
133
    # Use the Bypass Queue
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
134
    # UL Slave
135
    ss.dll.ulscheduler.config.txScheduler.queue = wimac.Scheduler.BypassQueue()
136
    ss.dll.ulscheduler.config.txScheduler.alwaysAcceptIfQueueAccepts = True
137
    
138
    # Pop the Reassembly FU
139
    ss.dll.subFUN.connects.pop(0)
140
    ss.dll.group.bottom = "buffer"
141
##################################################################################################
142
143
144
# DHCP, ARP, DNS for IP
145
ip.BackboneHelpers.createIPInfrastructure(WNS, "WIMAXRAN")
146
147
# Probe configuration
33 by Karsten Klagges
new bypass queue test
148
loggingStationIDs = []
149
59.1.6 by Maciej Muehleisen
Recorded new probes because of changed sorting.
150
for node in utNodes + bsNodes:    
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
151
    loggingStationIDs.append(node.dll.stationID)
33 by Karsten Klagges
new bypass queue test
152
71 by Maciej Muehleisen
Activated delta probes. Added settlingTime.
153
wimac.evaluation.default.installDebugEvaluation(WNS, loggingStationIDs, Config.settlingTime, "Moments")
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
154
69 by Maciej Muehleisen
Increased number of CIDs produces more wakeUp() calls, drawing more rnd numbers in FlowSep. Removed OverFrameEval from reference output.
155
#wimac.evaluation.default.installOverFrameOffsetEvaluation(WNS, 
156
#                                                          Config.parametersPhy.symbolsFrame, 
157
#                                                          [1], 
158
#                                                          loggingStationIDs)
59 by Maciej Muehleisen
Restructured and cleaned up config to use scenario builder. Preparation for IMT-Advanced scenarios
159
160
# Not present with BypassQueue
161
WNS.environment.probeBusRegistry.removeMeasurementSource("wimac.schedulerQueue.delay")
33 by Karsten Klagges
new bypass queue test
162
163
openwns.evaluation.default.installEvaluation(WNS)