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.

17 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
    3. Hi Sumanth,

      Thanks for explanation.

      I have one doubt like, In what scenarios the individual MPDU's can miss in one aggregated packet, and how recipient will reply with Block Ack bitmap field.

      Thanks in advance.

      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
  7. Good post on wifi issue. Sometimes internet connection also gives trouble and we think it is the wifi of the pc which might be fault. Good blog and keep writing more on other issues also. We provide computer and electronic name board service and this post was very useful for us to upgrade ourselves.

    ReplyDelete
  8. Wifi problems are very irritating. Your post regarding wifi problem solution is good. Keep writing on other problems of laptop service and desktops also. Will be happy to ready. Thanks.

    ReplyDelete
  9. Very good points and details regarding the wifi issue. We are into laptop and printer service and blogs like these has helped us a lot in upgrading ourselves.

    ReplyDelete
  10. Hello, first thanks for sharing so valuable knowledge.

    I have some questions about ADDBA, don't know if you could do me a favor to answer it.

    I am solving a bug about ADDBA of my android board. My board uses wl12xx as wifi moudule. wl12xx can only handle 3 BA sessions.

    If AP requests more than 3 BA sessions, wl12xx driver will print log: "wl12xx: ERROR exceeded max RX BA sessions".

    So the first question is: how does AP decide the number of BA sessons(also the number of TIDs)?
    I cannot find any code to negociate the BA session number. How did the AP know it should only use 3 TIDs?
    I didn't see the message in normal case: "wl12xx: ERROR exceeded max RX BA sessions". Only occasionally, I can see this message.

    I have trid on 2 different APs:

    the 1st AP use TID values: 0, 1, 2
    the 2nd AP use TID values: 0, 2, 3

    so the second question: How does AP decide TID values?

    Thanks!

    ReplyDelete
  11. Simple yet effective article !!!!
    Does block ACK works only with AMPDU enabled only, Can it work with AMPDU disabled and AMSDU enabled?

    ReplyDelete