コード例 #1
0
    def onSessionStarts(self, sessId):
        self._delayDataProbdist = histo.uniform(0)
        if self._histograms:
            self.relayBurstHistogram(
                **dict(self._histograms["burst"]["snd"], **{"when": "snd"}))
            self.relayBurstHistogram(
                **dict(self._histograms["burst"]["rcv"], **{"when": "rcv"}))
            self.relayGapHistogram(
                **dict(self._histograms["gap"]["snd"], **{"when": "snd"}))
            self.relayGapHistogram(
                **dict(self._histograms["gap"]["rcv"], **{"when": "rcv"}))
        else:
            if self.weAreClient:
                # parameters have been estimated from real web traffic
                hist_dict_incoming = self.getHistoFromDistrParams("weibull", 0.406831232, scale=0.002465967)
                hist_dict_outgoing = self.getHistoFromDistrParams("beta", (0.1620305, 35.3933556))
                low_bins_inc, high_bins_inc = self.divideHistogram(hist_dict_incoming)
                low_bins_out, high_bins_out = self.divideHistogram(hist_dict_outgoing)
                self.relayBurstHistogram(low_bins_inc, "rcv")
                self.relayBurstHistogram(low_bins_inc, "snd")
                self.relayGapHistogram(high_bins_inc, "rcv")
                self.relayGapHistogram(high_bins_inc, "snd")
                self.sendControlMessage(const.OP_BURST_HISTO, [low_bins_out, True, True, "rcv"])
                self.sendControlMessage(const.OP_BURST_HISTO, [low_bins_out, True, True, "snd"])
                self.sendControlMessage(const.OP_GAP_HISTO, [high_bins_out, True, True, "rcv"])
                self.sendControlMessage(const.OP_GAP_HISTO, [high_bins_out, True, True, "snd"])

        WFPadTransport.onSessionStarts(self, sessId)
コード例 #2
0
ファイル: adaptive.py プロジェクト: fowlslegs/wfpadtools
    def onSessionStarts(self, sessId):
        self._delayDataProbdist = histo.uniform(0)
        if self._histograms:
            self.relayBurstHistogram(
                **dict(self._histograms["burst"]["snd"], **{"when": "snd"}))
            self.relayBurstHistogram(
                **dict(self._histograms["burst"]["rcv"], **{"when": "rcv"}))
            self.relayGapHistogram(
                **dict(self._histograms["gap"]["snd"], **{"when": "snd"}))
            self.relayGapHistogram(
                **dict(self._histograms["gap"]["rcv"], **{"when": "rcv"}))
        else:
            if self.weAreClient:
                # parameters have been estimated from real web traffic
                hist_dict_incoming = self.getHistoFromDistrParams("weibull", 0.406831232, scale=0.002465967)
                hist_dict_outgoing = self.getHistoFromDistrParams("beta", (0.1620305, 35.3933556))
                low_bins_inc, high_bins_inc = self.divideHistogram(hist_dict_incoming)
                low_bins_out, high_bins_out = self.divideHistogram(hist_dict_outgoing)
                self.relayBurstHistogram(low_bins_inc, "rcv")
                self.relayBurstHistogram(low_bins_inc, "snd")
                self.relayGapHistogram(high_bins_inc, "rcv")
                self.relayGapHistogram(high_bins_inc, "snd")
                self.sendControlMessage(const.OP_BURST_HISTO, [low_bins_out, True, True, "rcv"])
                self.sendControlMessage(const.OP_BURST_HISTO, [low_bins_out, True, True, "snd"])
                self.sendControlMessage(const.OP_GAP_HISTO, [high_bins_out, True, True, "rcv"])
                self.sendControlMessage(const.OP_GAP_HISTO, [high_bins_out, True, True, "snd"])

        WFPadTransport.onSessionStarts(self, sessId)
コード例 #3
0
ファイル: csbuflo.py プロジェクト: fowlslegs/wfpadtools
    def onSessionStarts(self, sessId):
        # Initialize rho stats
        self.constantRatePaddingDistrib(self._period)
        if self._padding_mode == const.TOTAL_PADDING:
            self.relayTotalPad(sessId, self._period, False)
        elif self._padding_mode == const.PAYLOAD_PADDING:
            self.relayPayloadPad(sessId, self._period, False)
        else:
            raise RuntimeError("Value passed for padding mode is not valid: %s" % self._padding_mode)

        if self._early_termination and self.weAreServer:
            stopCond = self.stopCondition
            def earlyTermination(self):
                return not self.session.is_peer_padding or stopCond()
            self.stopCondition = earlyTermination
        WFPadTransport.onSessionStarts(self, sessId)
コード例 #4
0
ファイル: bwdiff.py プロジェクト: fowlslegs/wfpadtools
    def onSessionStarts(self, sessId):
        self._lengthDataProbdist = hs.uniform(self._length)
        self._delayDataProbdist = hs.uniform(0)
        WFPadTransport.onSessionStarts(self, sessId)
#         if self._padding_mode == const.TOTAL_PADDING:
#             self.relayTotalPad(sessId, self._period, False)
#         elif self._padding_mode == const.PAYLOAD_PADDING:
#             self.relayPayloadPad(sessId, self._period, False)
#         else:
#             raise RuntimeError("Value passed for padding mode is not valid: %s" % self._padding_mode)
        if self._early_termination and self.weAreServer:
            stopCond = self.stopCondition
            def earlyTermination(self):
                return not self.session.is_peer_padding or stopCond()
            self.stopCondition = earlyTermination
        self.iat_length_tuples = [[]]
        self.getBwDifferential()
コード例 #5
0
    def onSessionStarts(self, sessId):
        self._lengthDataProbdist = hs.uniform(self._length)
        self._delayDataProbdist = hs.uniform(0)
        WFPadTransport.onSessionStarts(self, sessId)
        #         if self._padding_mode == const.TOTAL_PADDING:
        #             self.relayTotalPad(sessId, self._period, False)
        #         elif self._padding_mode == const.PAYLOAD_PADDING:
        #             self.relayPayloadPad(sessId, self._period, False)
        #         else:
        #             raise RuntimeError("Value passed for padding mode is not valid: %s" % self._padding_mode)
        if self._early_termination and self.weAreServer:
            stopCond = self.stopCondition

            def earlyTermination(self):
                return not self.session.is_peer_padding or stopCond()

            self.stopCondition = earlyTermination
        self.iat_length_tuples = [[]]
        self.getBwDifferential()
コード例 #6
0
    def onSessionStarts(self, sessId):
        # Initialize rho stats
        self.constantRatePaddingDistrib(self._period)
        if self._padding_mode == const.TOTAL_PADDING:
            self.relayTotalPad(sessId, self._period, False)
        elif self._padding_mode == const.PAYLOAD_PADDING:
            self.relayPayloadPad(sessId, self._period, False)
        else:
            raise RuntimeError(
                "Value passed for padding mode is not valid: %s" %
                self._padding_mode)

        if self._early_termination and self.weAreServer:
            stopCond = self.stopCondition

            def earlyTermination(self):
                return not self.session.is_peer_padding or stopCond()

            self.stopCondition = earlyTermination
        WFPadTransport.onSessionStarts(self, sessId)
コード例 #7
0
ファイル: buflo.py プロジェクト: fowlslegs/wfpadtools
 def onSessionStarts(self, sessId):
     log.debug("[buflo {}] - params: mintime={}, period={}, psize={}"
               .format(self.end, self._mintime, self._period, self._length))
     self.constantRatePaddingDistrib(self._period)
     WFPadTransport.onSessionStarts(self, sessId)
コード例 #8
0
ファイル: tamaraw.py プロジェクト: notem/walkietalkie-proto
 def onSessionStarts(self, sessId):
     WFPadTransport.onSessionStarts(self, sessId)
     self.constantRatePaddingDistrib(self._period)
     self.relayBatchPad(sessId, self._batch, self._period)
コード例 #9
0
 def onSessionStarts(self, sessId):
     log.debug(
         "[buflo {}] - params: mintime={}, period={}, psize={}".format(
             self.end, self._mintime, self._period, self._length))
     self.constantRatePaddingDistrib(self._period)
     WFPadTransport.onSessionStarts(self, sessId)
コード例 #10
0
ファイル: bwdiff.py プロジェクト: fowlslegs/wfpadtools
 def onEndPadding(self):
     WFPadTransport.onEndPadding(self)
     if self._early_termination and self.weAreClient:
         self.sendControlMessage(const.OP_END_PADDING)
         log.info("[bwdiff - client] - Padding stopped! Will notify server.")
コード例 #11
0
 def onEndPadding(self):
     WFPadTransport.onEndPadding(self)
     if self._early_termination and self.weAreClient:
         self.sendControlMessage(const.OP_END_PADDING)
         log.info(
             "[bwdiff - client] - Padding stopped! Will notify server.")
コード例 #12
0
ファイル: tamaraw.py プロジェクト: fowlslegs/wfpadtools
 def onSessionStarts(self, sessId):
     WFPadTransport.onSessionStarts(self, sessId)
     self.constantRatePaddingDistrib(self._period)
     self.relayBatchPad(sessId, self._batch, self._period)