Exemple #1
0
    def __init__(self, id, eui64=None):

        # store params
        self.id = id

        # admin
        self.dataLock = threading.RLock()

        # singletons (quicker access, instead of recreating every time)
        self.log = SimEngine.SimLog.SimLog().log
        self.engine = SimEngine.SimEngine.SimEngine()
        self.settings = SimEngine.SimSettings.SimSettings()

        # stack state
        self.dagRoot = False
        self._init_eui64(eui64)
        self.ipv6_prefix = None

        # stack
        self.app = app.App(self)
        self.secjoin = secjoin.SecJoin(self)
        self.rpl = rpl.Rpl(self)
        self.sixlowpan = sixlowpan.Sixlowpan(self)
        self.trae = trae.TRAE(self)
        self.sf = sf.SchedulingFunction(self)
        self.sixp = sixp.SixP(self)
        self.tsch = tsch.Tsch(self)
        self.radio = radio.Radio(self)
        self.batt = batt.Batt(self)
Exemple #2
0
    def __init__(self, id, eui64=None):

        # store params
        self.id = id

        # admin
        self.dataLock = threading.RLock()

        # singletons (quicker access, instead of recreating every time)
        self.log = SimEngine.SimLog.SimLog().log
        self.engine = SimEngine.SimEngine.SimEngine()
        self.settings = SimEngine.SimSettings.SimSettings()

        # stack state
        self.dagRoot = False
        self._init_eui64(eui64)
        self.ipv6_prefix = None

        # stack
        self.app = app.App(self)
        self.secjoin = secjoin.SecJoin(self)
        self.rpl = rpl.Rpl(self)
        self.sixlowpan = sixlowpan.Sixlowpan(self)
        self.sf = sf.SchedulingFunction(self)
        self.sixp = sixp.SixP(self)
        self.tsch = tsch.Tsch(self)
        self.radio = radio.Radio(self)
        self.batt = batt.Batt(self)

        # :) energy save
        self.lock_schedule = 0

        # Generation of periodic traffic

        delay = self.settings.tsch_slotDuration + (self.settings.app_pkPeriod *
                                                   random.random())
        gen_timeslot = int(((self.engine.getAsn() + delay / 0.01) %
                            self.settings.tsch_slotframeLength - 1))
        print "~#ID", self.id, "Gen Timeslot", gen_timeslot

        self.gen_timeslot = gen_timeslot
Exemple #3
0
    def __init__(self, id, eui64=None):

        # store params
        self.id                        = id

        # admin
        self.dataLock                  = threading.RLock()

        # singletons (quicker access, instead of recreating every time)
        self.log                       = SimEngine.SimLog.SimLog().log
        self.engine                    = SimEngine.SimEngine.SimEngine()
        self.settings                  = SimEngine.SimSettings.SimSettings()

        # stack state
        self.dagRoot                   = False
        self._init_eui64(eui64)
        self.ipv6_prefix               = None

        # stack
        self.app                       = app.App(self)
        self.secjoin                   = secjoin.SecJoin(self)
        self.rpl                       = rpl.Rpl(self)
        self.sixlowpan                 = sixlowpan.Sixlowpan(self)
        self.sf                        = sf.SchedulingFunction(self)
        self.sixp                      = sixp.SixP(self)
        self.tsch                      = tsch.Tsch(self)
        self.radio                     = radio.Radio(self)
        self.batt                      = batt.Batt(self)

        # :) Low Delay Scheduling Function - Virtual Slot Frame proportional to CBR of the node.

        self.flow_gen_time             = -1  # offset of subframe of flow of data
        self.hops                      = -1  # initialize hops
        self.lock_TX                   =  0  # locking TX before Scheduling
        self.start_tx                  = -1
        self.tx_slot                   = -1
        self.lock_schedule             =  0
        self.is_leaf                   =  1  # 1 - is leaf, 0- is relay node
        self.flip_flop                 =  0  # enable more childrens for DagRoot mote

        self.black_parent                 = [] #mac  address