Friday, April 18, 2014

11n Block Acknowledgement

Every unicast frame in the initial 802.11 standard required a positive acknowledgement. 802.11e introduced the concept of "Block Acknowledgement": Single acknowledgement for multiple frames. Block Ack along with A-MPDU Aggregation is used in 11n to achieve significant improvement in application throughput.

Lets understand the 11n Block Ack by answering some basic questions.
"BA" in the below text means "Block Acknowledgement".

Q: Is it necessary to setup a BA before it can be used?
A: Yes. A BA session must be setup in each direction (Tx and Rx)The session needs to be setup by the device that intends to receive the BA. The session is setup using ADDBA request/response. A DELBA can be used to tear down the session. ADDBA and DELBA are BA action frames.

title "BA Setup"
note over dev1,dev2: "Connected"
opt Dev1 decides to enable BA (for it Tx Data)
dev1->dev2: ADDBA Request (BA Params)
note over dev2: Dev2 can accept or reject the request.\n It can also change the BA parameters.
dev2->dev1: ADDBA Response (Status, BA Params)
note over dev1:"Can now send A-MPDU"
end

opt Dev2 decides to enable BA (for it Tx Data)
note over dev2:"I want to enable BA (for my Tx Data)"
dev2->dev1: ADDBA Request(BA Params)

note over dev1: Dev1 can accept or reject the request.\n It can also change the BA parameters.
dev1->dev2: ADDBA Response(Status, BA Params)
note over dev2:"Can now send A-MPDU"
end

The following parameters are exchanged in ADDBA messages:
  • A-MSDU supported in MPDU or not
  • BA policy (Immediate or Delayed)
  • Traffic Identifier
  • Number of MPDUS  that can be acknowledged in one BA
    • The response may indicate a value lower than the request
  • Starting Sequence Number (only in ADDBA request). This is the sequence number of the first packet that would be acknowledged using the BA.

Q: What are the different types of BA?
A: There are two different types of BA: Immediate BA and Delayed BA, which are explained in the below diagrams.
title "Delayed vs Immediate Block Ack"
dev1->dev2: Data Frame (A-MPDU with multiple MPDUs)
alt Delayed Block Ack
dev1->dev2: BA Request
dev2->dev1: Ack
dev2->dev1: Block Ack
dev1->dev2: Ack
else Immediate Block Ack
dev1->dev2: BA Request
dev2->dev1: Block Ack
end


Q: I've captured a 11n air-trace and can see a BA even without BA Request. Why is it different from Immediate and Delayed BA?
A: That is true. You would usually find that a BA is sent event without a BA Request. That is because the BA request is implicit. What you have seen is an "Immediate BA with implicit BA request". 
title Immediate BA with Implicit BA Request
dev1->dev2: Data Frame (A-MPDU with multiple MPDUs)\nAck Policy=Implicit BA
dev2->dev1: Block Ack


Q: What is a BA bitmap?
A: A BA bitmap along with the starting sequence number indicates the packets that are being acknowledged.  Each bit acknowledges one packet and sequence number of the packet is equal to starting sequence number + bit number. For e.g., the BA shown in the below diagram acknowledges packets 3 and 4.


Q: What is a compressed BA?
A: BA as defined originally in 802.11e allowed individual MSDUs to be acknowledged and the bitmap was 128 bytes long. 11n only allows MPDUs to be acknowledged and the bitmap is 8 bytes in long. The BA with 8 byte bitmap is known as compressed BA.

Q: Why does my device send some BA request frames even when there is no frame to be acknowledged?
A: A BA request is also used to change the starting sequence number. One example when this would be happen is if the transmitter has sent some frames without using aggregation (and hence acknowledged using normal Ack) and later wants to send some aggregated data. The transmitter can update the receiver with the new starting sequence number by sending a BA request. The receiver would respond with a zero bitmap BA in response to such a request.

11 comments:

  1. A very good and useful article Sumanth!
    Some minor comments:
    - BA policy (can add delayed along with immediate)
    - Also is the implicit BA also mentioned as part of the Block Ack Policy in the ADDBA?

    ReplyDelete
    Replies
    1. Thanks Krishna.
      Implicit BA request is not mentioned in ADDBA. ADDBA specifies when the BlockACK would be sent: immediate or delayed and Ack Policy specifies whether a "BA Request" would be sent or not.
      So for Implicit BA request:
      - ADDBA : "Immediate BA"
      - Ack Policy in data frame: "Implicit BA"

      Delete
    2. Hi Sumanth,

      Very good explanation. Please explain the following topics too
      1. Block Ack Req frame with significance of each field
      2. Block Ack Response frame with significance of each field
      3. Block Ack Req/Response Variants

      Delete
  2. great post. i may copy this article on my blog (wirelessonthego.postach.io) and credit you..

    i am analyzing a packet capture where i see implicit BA from the AP to the client but the client qos data prior to that shows ACK policy as normal ACK

    ReplyDelete
  3. Dear sir,

    In your post, you answered" what are the different types of BA. I wonder about why we need two types of BA? I hope can hear your comment. Thank you so much

    ReplyDelete
    Replies
    1. One reason that I can think of: All STAs may not be able to respond to an immediate/implicit Block ACK request.

      An STA needs to perform the below operations before sending a block ACK
      - Deaggregate the AMPDU
      - Compute FCS for each MPDU
      A "Soft" MAC based STA may not be able perform the above operations in time to respond to an immediate BAR.

      Note: This is my view and there could be more reasons for having two types of BAs.

      Regards,
      Sumanth

      Delete
  4. How can one sent ADDBA request to an AP on TID0

    ReplyDelete
  5. How does the STA know when to send the BA in an implicit BA scenario. I you say the last packet is the trigger, then what if the last packet is lost.
    Thank you

    ReplyDelete
  6. Good points. Was fun to read and learn this way. Nowadays all the laptops are with wifi and even desktops are with wifi. Thanks for sharing your input and keep writing more on other laptop service issues.

    ReplyDelete