Example #1
0
def combaination(draw):
    from wifi.config import Config
    packets = draw(integers(min_value=0, max_value=64))
    rate = draw(sampled_from([6, 9, 12, 18, 24, 36, 48, 54]))
    conf = Config.from_data_rate(rate)
    lim = packets * conf.coded_bits_per_ofdm_symbol
    data = draw(binary(min_size=lim, max_size=lim))
    data = bitstr.from_bytes(data)
    return data, conf.coded_bits_per_ofdm_symbol, conf.coded_bits_per_carrier_symbol
Example #2
0
from wifi import transceiver, bits, bitstr

data = b'\n17. Orthogonal frequency division multiplexing (OFDM) PHY specification\n17.1 Introduction\n17.1.1 General\nThis clause specifies the PHY entity for an orthogonal frequency division multiplexing (OFDM) system.\nThe OFDM system provides a WLAN with data payload communication capabilities of 6, 9, 12, 18, 24, 36,\n48, and 54 Mb/s. The support of transmitting and receiving at data rates of 6, 12, and 24 Mb/s is mandatory.\nThe system uses 52 subcarriers that are modulated using binary or quadrature phase shift keying (BPSK or\nQPSK) or using 16- or 64-quadrature amplitude modulation (16-QAM or 64-QAM). Forward error\ncorrection coding (convolutional coding) is used with a coding rate of 1/2, 2/3, or 3/4.\nThe OFDM system also provides a "half-clocked" operation using 10 MHz channel spacings with data\ncommunications capabilities of 3, 4.5, 6, 9, 12, 18, 24, and 27 Mb/s. The support of transmitting and\nreceiving at data rates of 3, 6, and 12 Mb/s is mandatory when using 10 MHz channel spacing. The half-\nclocked operation doubles symbol times and clear channel assessment (CCA) times when using 10 MHz\nchannel spacing. The regulatory requirements and information regarding use of this OFDM PHY are in\nAnnex D and Annex E.\nThe OFDM system also provides a "quarter-clocked" operation using 5 MHz channel spacing with data\ncommunication capabilities of 1.5, 2.25, 3, 4.5, 6, 9, 12, and 13.5 Mb/s. The support of transmitting and\nreceiving at data rates of 1.5, 3, and 6 Mb/s is mandatory when using 5 MHz channel spacing. The quarter-\nclocked operation quadruples symbol times and CCA times when using 5 MHz channel spacing. The\nregulatory requirements and information regarding use of this OFDM PHY are in Annex D and Annex E.\n17.1.2 Scope\nSubclause 17.1 describes the PHY services provided to the IEEE 802.11 WLAN MAC by the OFDM PHY.\nThe OFDM PHY consists of the following protocol functions:\na) A function that defines a method of mapping the IEEE 802.11 PSDUs into a framing format suitable\nfor sending and receiving user data and management information between two or more STAs.\nb) A function that defines the characteristics and method of transmitting and receiving data through a\nWM between two or more STAs, each using the OFDM system.\n17.1.3 OFDM PHY functions\n17.1.3.1 General\nThe OFDM PHY architecture is depicted in the reference model shown in Figure 4-19 (in 4.9). The OFDM\nPHY contains two functional entities: the PHY function and the layer management function. Each of these\nfunctions is described in detail in 17.3 and 17.4.\nThe OFDM PHY service is provided to the MAC through the PHY service primitives described in Clause 8.\n17.1.3.2 PLME\nThe PLME performs management of the local PHY functions in conjunction with the MLME.\n2277\nCopyright  2016 IEEE. All rights reserved.\nAuthorized licensed use limited to: Vadis Slaav. Downloaded on September 30,2018 at 13:57:05 UTC from IEEE Xplore. Restrictions apply.IEEE Std 802.11-2016\nIEEE Standard for Information Technology-Local and Metropolitan Area Networks-Specific Requirements\nPart 11: Wireless LAN MAC and PHY Specifications\n17.1.3.3 Service specification method\nThe models represented by figures and state diagrams are intended to be illustrations of the functions\nprovided. It is important to distinguish between a model and a real implementation. The models are\noptimized for simplicity and clarity of presentation, but do not necessarily reflect any particular\nimplementation.\nThe service of a layer or sublayer is the set of capabilities that it offers to a user in the next higher layer (or\nsublayer). Abstract services are specified here by describing the service primitives and parameters that\ncharacterize each service. This definition is independent of any particular implementation.\n17.2 OFDM PHY specific service parameter list\n17.2.1 Introduction\nThe architecture of the IEEE 802.11 MAC is intended to be PHY independent. Some PHY implementations\nrequire medium management state machines running in the MAC sublayer in order to meet certain PHY\nrequirements. These PHY-dependent MAC state machines reside in a '
data = bitstr.from_bytes(data)

iq = transceiver.do(data, 24)
un = transceiver.undo(iq)
Example #3
0
def test_hypothesis(data):
    data = bitstr.from_bytes(data)
    assert undo(do(data)) == data
Example #4
0
def random_packet(draw):
    elements = draw(integers(min_value=0, max_value=(2**12) - 1))
    data = draw(binary(min_size=elements, max_size=elements))
    data = bitstr.from_bytes(data)
    rate = draw(sampled_from([6, 9, 12, 18, 24, 36, 48, 54]))
    return data, rate
Example #5
0
def test_hypothesis(data, data_bits_per_ofdm_symbol):
    data = bitstr.from_bytes(data)

    done_data, n_pad = do(data, data_bits_per_ofdm_symbol)
    assert undo(done_data, len(data) // 8) == data
Example #6
0
def test_hypothesis(data, bits_per_symbol):
    data = bitstr.from_bytes(data)
    assert undo(do(data, bits_per_symbol), bits_per_symbol) == data
Example #7
0
def test_hypothesis(bytes):
    s = bitstr.from_bytes(bytes)
    assert undo(do(s)) == s