wlan

Beacon Frame

commwlan80211Beacon:

[mpduHeader, mpduBody] = getBeaconMPDU(TSF, p80211);

关于getBeaconMPDU函数说明:

getBeaconMPDU Form a beacon frame MPDU
    [H,B] = getBeaconMPDU(T,P) returns a beacon frame MPDU for the 802.11
    WLAN Beacon Frame example. T represents the simulation time in
    milliseconds and P represents the parameter structure for the 802.11
    system. H and B are structures that contain the beacon frame header and
    body.
 
    Reference: IEEE Std 802.11-2007, Section 7.2.3.1 Beacon frame format

 首先看下p80211结构:

p80211 = 

  包含以下字段的 struct:

                   SymbolRate: 1000000
                BitsPerSymbol: 1
               SamplesPerChip: 4
                  FilterOrder: 8
                SpreadingCode: [11×1 double]
                SpreadingRate: 11
                     ChipRate: 11000000
        SynchronizationSignal: [5632×1 double]
         CorrelationThreshold: 281.6000
                         SYNC: [128×1 logical]
                          SFD: [16×1 logical]
                       SIGNAL: [8×1 logical]
                      SERVICE: [8×1 logical]
                       LENGTH: [1×16 logical]
                    CRCLength: 16
          ScramblerPolynomial: [1×8 double]
           ScramblerAmbiguity: 128
    ScramblerAmbiguitySamples: 5632
               NumSYNCSamples: 5632
           PLCPPreambleLength: 144
       NumPLCPPreambleSamples: 6336
             PLCPHeaderLength: 48
         NumPLCPHeaderSamples: 2112
                   PLCPLength: 192
               NumPLCPSamples: 8448
            MaximumPPDULength: 1024
            MaximumMPDULength: 832
       SymbolsPerChannelFrame: 128
          BitsPerChannelFrame: 128
       SamplesPerChannelFrame: 5632
        MaximumPayloadSymbols: 3000
        MaximumPayloadSamples: 132000
          PayloadBufferLength: 3256
               BeaconInterval: 2
                         SSID: [1×9 uint8]
               SupportedRates: [1 2]
                ChannelNumber: 11
             SendCFParameters: 1
                     CFPCount: 2
                    CFPPeriod: 20
               CFPMaxDuration: 10
              CFPDurRemaining: 5
                NumMPDUOctets: 62

再看看mpduHeader:

mpduHeader = 

  包含以下字段的 struct:

          FrameCtrl: [1×1 struct]
         DurationID: [61 9]
           Address1: [180 156 233 168 94 246]
           Address2: [19 39 221 39 76 35]
           Address3: [176 172 79 142 6 73]
    SequenceControl: [179 1]
           Address4: [0 0 0 0 0 0]

打开FrameCtrl:

包含以下字段的 struct:

    ProtocolVersion: 0
               Type: 0
            Subtype: 8
               ToDS: 0
             FromDS: 0
      MoreFragments: 0
              Retry: 0
    PowerManagement: 1
           MoreData: 0
     ProtectedFrame: 0
              Order: 1

再看看body部分:

mpduBody = 

  包含以下字段的 struct:

          TimeStamp: [0 0 0 0 0 0 0 0]
     BeaconInterval: [2 0]
         Capability: [1×1 struct]
       InfoElements: [1×25 struct]
    NumInfoElements: 4

打开Capability:

mpduBody.Capability

ans = 

  包含以下字段的 struct:

                   ESS: 1
                  IBSS: 0
            CFPollable: 0
         CFPollRequest: 1
               Privacy: 0
         ShortPreamble: 1
                  PBCC: 1
        ChannelAgility: 0
    SpectrumManagement: 0
                   QoS: 0
         ShortSlotTime: 1
                  APSD: 0
              Reserved: 0
               DSSOFDM: 1
       DelayedBlockAck: 0
     ImmediateBlockAck: 1

payload:

payload =

  832×1 uint8 列矢量

   128
   144
    61
     9
   180
   156
   233
   168
    94
   246
    19
    39
   221
    39
    76
    35
   176
   172
    79
   142
     6
    73
   179
     1  //mpduHeader到这里结束,下面是mpduBody开始
     0
     0
     0
     0
     0
     0
     0
     0 //上述8个0位置记录timestamp
     2
     0 //上述2个为BeaconInterval
   105 
   164 //上述2个为mpduBody.Capability的封装
     0 //id
     9 //下面内容长度包含9个位置
    87 
   108
    97
   110
    32
   116
   101
   115
   116 //第一部分结束------这部分记录的是wlan的SSID
     1
     2
   130
   132 //第二部分结束------这部分记录的是Supported Rates
     3
     1
     1 //第三部分结束------这部分记录的是DS Parameters
     4
     6
     2
    20
    10
     0
     5
     0 //第四部分结束------这部分记录的是CF Parameters
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0
     0