Changes between Version 14 and Version 15 of 802.11/PacketFlow


Ignore:
Timestamp:
Oct 14, 2014, 4:29:45 PM (10 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/PacketFlow

    v14 v15  
    2121The PHY cores divide each 32KB BRAM into 8 4KB buffers. The PHY numbers these buffers ![0:7]. The low-level MAC code provides the packet buffer index to the PHY for each Tx and Rx event.
    2222
    23 === Packet Buffer Contents ===
     23== Tx Packet Flow ==
     24
     25The flow of packets leading to wireless transmissions are illustrated below. All wireless transmissions pass through the upper-level MAC framework's [wiki:../MAC/Upper/MACHighFramework/TX_queue Tx queuing system]. The framework individually dequeues packets and copies them to a PHY packet buffer for processing and transmission by the lower-level MAC.
     26
     27[[Image(wiki:802.11/files:wlan_tx_pkt_flow.png)]]
     28
     29There are three sources of transmit packets in the 802.11 Reference Design:
     30 * '''Ethernet Rx''': data packets received on the ETH A interface may be [wiki:../MAC/Upper/MACHighFramework/EthEncap encapsulated] and enqueued for transmission if the address and packet types match filters implemented in the upper-level MAC code.
     31 * '''Local''': the upper-level MAC application can generate traffic internally. This includes management frames (beacons, probe request/response, etc) and arbitrary traffic generated by the framework's [wiki:../MAC/Upper/MACHighFramework/LTG LTG system].
     32 * '''Wireless Rx''': packets received from the wireless interface can be enqueued for transmission. This path is used by the AP to relay packets from one associated STA to another.
     33
     34== Rx Packet Flow ==
     35
     36The flow of packets received wirelessly is illustrated below. All wireless receptions are written to a receive packet buffer by the PHY. The lower-level MAC evaluates the received packet and may pass it up to the upper-level MAC for additional processing.
     37
     38[[Image(wiki:802.11/files:wlan_rx_pkt_flow.png)]]
     39
     40Received packets passed up to the upper-level MAC are routed to one of three sinks:
     41 * '''Ethernet Tx''': data packets may be [wiki:../MAC/Upper/MACHighFramework/EthEncap de-encapsulated] and transmitted via the ETH A interface
     42 * '''Local''': the upper-level MAC may directly consume a received packet. This includes management frames and arbitrary traffic generated by the [wiki:../MAC/Upper/MACHighFramework/LTG LTG system] at another node.
     43 * '''Wireless Tx''': as explained above, some MAC applications may re-transmit received packets via the wireless interface
     44
     45== Packet Buffer Contents ==
    2446
    2547Each 4KB packet buffer is used to store packet payloads and related metadata. The MAC can store arbitrary metadata in each packet buffer before the actual packet bytes. The PHY must be configured with the size of the metadata so it knows where to read (Tx) and write (Rx) packet payloads. This is done from [browser:/ReferenceDesigns/w3_802.11/c/wlan_mac_low_framework/wlan_mac_low.c wlan_mac_low.c]:
     
    108130The PHY begins writing received bytes immediately after the {{{rx_frame_info}}}. The received SIGNAL and SERVICE fields are written to the first 5 bytes following the {{{rx_frame_info}}}. The PHY then skips 3 bytes and writes the next received byte (the first byte of the MAC header) to 8 bytes past the rx_frame_info. This convention aligns received payloads to a 64-bit boundary, easing access by the MAC software and DMAs. Generally the MAC software ignores the SIGNAL and SERVICE fields in the Rx packet buffer, instead relying on the rate/length values provided by the MAC core.
    109131
    110 === Checksums ===
    111 
    112 The 802.11 standard requires Frame Check Sequence (FCS) be attached to all transmitted frames. The checksum is calculated using the standard CRC32 scheme and covers all bytes of the MAC payload. The 32-bit checksum is always transmitted as the last 4 bytes of the packet payload.
    113 
    114 The Tx PHY automatically calculates and inserts the 32-bit checksum in the transmitted packet. The MAC code must include the FCS bytes in the length value in the SIGNAL field, but the MAC code does not need to calculate the actual checksum. The FCS values calculated by the Tx PHY are not written to the Tx packet buffer.
    115 
    116 The Rx PHY automatically calculates the checksum of every received frame and provides an FCS_GOOD indication to the MAC hardware core immediately upon reception of the final byte of a packet. The received FCS bytes are written to the Rx packet buffer; these can be safely ignored by the MAC code.
    117 
    118132=== Tx Ping-Pong Buffers ===
    119133The lower-level MAC and PHY process a single Tx packet at any given time. While a packet is being transmitted the upper-level MAC prepares the next packet for transmission. Two buffers from the Tx packet buffer RAM are used for this ping-pong approach.
     
    127141
    128142[[Image(wiki:802.11/files:wlan_tx_ping_pong_msgs.png)]]
    129 
    130 === Mutexes ===
    131 
    132 A 32-entry mutex is used to avoid contention for Tx and Rx packet buffers between CPUs. One mutex entry corresponds to one packet buffer.
    133 
    134 CPU High locks a Tx packet buffer while it prepares a packet for transmission. It unlocks the buffer when it notifies CPU Low (via the mailbox) that the new packet is ready for transmission. CPU Low locks the Tx buffer while it awaits the PHY transmission, unlocking the buffer when it notifies CPU High of completion.
    135 
    136 CPU Low locks the Rx packet buffer into which the Rx PHY is writing received packets. When the PHY notifies the MAC a packet has been received without errors, CPU Low locks another Rx buffer and configures the Rx PHY to begin receiving new frames there. CPU Low unlocks the buffer containing the valid received frame and notifies CPU High. CPU High locks the packet buffer and processes the received packet. When its processing is finished, it unlocks the Rx packet buffer, allowing CPU Low to use it for a future reception.