Exemple #1
0
    def send_cts(self, cts, rts):
        """Additional processing for outgoing CTS.

        :param cts: Outgoing CTS packet.
        :param rts: Received RTS packet.

        This method uses the 'phy-sinr' annotation to apply the rate adaptation
        algorithm used by `RBAR`.
        """
        DCF.send_cts(self, cts, rts)
        errmsg = "[RBAR]: Invalid RTS! No RAI found in send_cts()!"
        assert rts.haslayer(RAI), errmsg
        errmsg = "[RBAR]: Invalid CTS! No RAI found in send_cts()!"
        assert cts.haslayer(RAI), errmsg
        errmsg = "[RBAR]: Cannot find 'phy-sinr' annotation in send_cts()!"
        assert rts.hasanno('phy-sinr'), errmsg
        # extract info from RTS+RAI
        sinr = rts.getanno('phy-sinr')
        newrate = self.calcrate(sinr)
        cts[RAI].rate = newrate
        cts[RAI].length = rts[RAI].length