2
from openwns.pyconfig import Frozen
3
import openwns.evaluation.default
6
import scenarios.builders
7
import scenarios.placer
8
import scenarios.antenna
11
import ip.BackboneHelpers
13
import wimac.support.nodecreators
14
import wimac.support.helper
15
import wimac.evaluation.default
16
import wimac.support.PostProcessor as PostProcessor
18
from wimac.support.Parameters16m import ParametersOFDMA, ParametersMAC
23
# Global station id generator
30
stationIDs = stationID()
34
####################################################
35
### Distinguished Simulation Settings #
36
####################################################
38
# Set basic WiMAX Parameters
39
parametersPhy = ParametersOFDMA(5)
40
parametersMAC = ParametersMAC
43
parametersPhy.slotDuration = 6 * parametersPhy.symbolDuration
45
# 3 * 6 = 18 symbols UD and 18 DL, total of 36 symbols. Other 47 - 36 = 11 symbols
46
# are for PYH, control, and management traffic
51
# Only generate one initial UL packet per UT
52
trafficUL = 0.0 # bit/s per station
53
trafficDL = 0.0 # bit/s per station
55
noIPHeader = True #Set to true to set IP header to 0
56
probeWindowSize = 0.01 # Probe per frame
57
scheduler = "RoundRobin" # "PropFair"
60
WNS = openwns.Simulator(simulationModel = openwns.node.NodeSimulationModel())
61
openwns.setSimulator(WNS)
62
WNS.maxSimTime = 0.0201 # seconds
63
WNS.masterLogger.backtrace.enabled = False
64
WNS.masterLogger.enabled = True
65
WNS.outputStrategy = openwns.simulator.OutputStrategy.DELETE
66
WNS.statusWriteInterval = 30 # in seconds
67
WNS.probesWriteInterval = 300 # in seconds
69
# Pass WiMAX Phy parameters to wimac::parameter::PHY singleton
70
WNS.modules.wimac.parametersPHY = Config.parametersPhy
72
WNS.modules.rise.debug.antennas = True
74
bsCreator = wimac.support.nodecreators.WiMAXBSCreator(stationIDs, Config)
75
ueCreator = wimac.support.nodecreators.WiMAXUECreator(stationIDs, Config)
77
scenario = scenarios.builders.CreatorPlacerBuilderUrbanMacro(
84
wimac.support.helper.setupPhy(WNS, Config, "UMa")
87
wimac.support.helper.setupScheduler(WNS, Config.scheduler)
89
# Set IP Header to 0 (else it is 20 byte)
91
wimac.support.helper.disableIPHeader(WNS)
93
# Always create uplink traffic, if traffic UL is 0 we sent exacly
94
# one packet for initialization
95
wimac.support.helper.createULPoissonTraffic(WNS, Config.trafficUL, Config.packetSize)
97
# Only create downlink traffic if we have any
98
if Config.trafficDL > 0.0:
99
wimac.support.helper.createDLPoissonTraffic(WNS, Config.trafficDL, Config.packetSize)
101
# Configure the window probes
102
wimac.support.helper.setL2ProbeWindowSize(WNS, Config.probeWindowSize)
104
utNodes = WNS.simulationModel.getNodesByProperty("Type", "UE")
106
# DHCP, ARP, DNS for IP
107
ip.BackboneHelpers.createIPInfrastructure(WNS, "WIMAXRAN")
109
# Probe configuration
110
loggingStationIDs = []
113
loggingStationIDs.append(node.dll.stationID)
115
wimac.evaluation.default.installDebugEvaluation(WNS, loggingStationIDs, "Moments")
117
openwns.evaluation.default.installEvaluation(WNS)