193 | | The Tx Controller B is simpler than Tx Controller A. After a transmission is complete, the controller is done and does not need to start any kind of post-Tx timeout interval. Optionally, Tx Controller B can condition its transmission on medium idleness. The DCF implementation uses this controller for two purposes: |
194 | | |
195 | | 1. Transmission of CTS frames |
196 | | 1. Transmission of ACK frames |
197 | | |
198 | | Both of the above transmissions have the common trait of being "fire and forget." They are slightly different from one another in that ACK frames must be transmitted regardless of perceived medium busyness. This is not the case for CTS frames, which are only sent when the medium is deemed idle. |
| 191 | Tx Controller B is a simpler state machine that can schedule its transmission relative to post Tx/Rx timers. The reference DCF implementation uses Tx Controller B for two transmissions: |
| 192 | |
| 193 | 1. Transmission of CTS frames a SIFS after an RTS Rx |
| 194 | 1. Transmission of ACK frames a SIFS after a DATA Rx |
| 195 | |
| 196 | This controller is unique in being able to cancel its transmission based on the node's NAV value. This behavior is required when transmitting a CTS frame. When the DCF receives an RTS it schedules a CTS transmission a SIFS interval later. However if the NAV is non-zero at the end of the SIFS, the CTS frame is not transmitted. |
201 | | |
202 | | [[Image(tx_core_b.png, width=1000)]] |
203 | | |
204 | | Like Tx Controller A, the green section of the above state machine forces the controller to wait for a deterministic amount of time prior to a transmission. The DCF uses this to schedule CTS and ACK transmissions a SIFS interval after the previous reception. The CTS case additionally instructs the controller to condition transmission on medium idleness. |
| 199 | The Tx Controller B state machine is illustrated below. Each box is a state. Each arrow is a state transition, with the arrow's label specifying the input conditions that trigger the transition. The conditions for the color-coded arrows from the {{{IDLE}}} state are described in the table below. |
| 200 | |
| 201 | [[Image(tx_fsm_b.png)]] |
| 202 | |
| 203 | {{{#!th colspan=2 align=center |
| 204 | '''Tx Controller B FSM - Transitions from {{{IDLE}}}''' |
| 205 | }}} |
| 206 | |----------------------------------- |
| 207 | {{{#!td |
| 208 | }}} |
| 209 | {{{#!td align=left |
| 210 | |
| 211 | {{{#!c |
| 212 | if(new_tx) { |
| 213 | }}} |
| 214 | |
| 215 | }}} |
| 216 | |----------------------------------- |
| 217 | {{{#!td |
| 218 | [[Image(tx_fsm_transition_1.png)]] |
| 219 | }}} |
| 220 | {{{#!td |
| 221 | {{{#!c |
| 222 | if(pre_wait_for_postRxTimer1 | pre_wait_for_postRxTimer2 | pre_wait_for_postTxTimer1 ) { |
| 223 | //Tx fixed interval after previous Tx/Rx |
| 224 | // Ignore medium and backoff states |
| 225 | st_next = ST_PRE_TX_WAIT; |
| 226 | }}} |
| 227 | }}} |
| 228 | |----------------------------------- |
| 229 | {{{#!td |
| 230 | [[Image(tx_fsm_transition_2.png)]] |
| 231 | }}} |
| 232 | {{{#!td |
| 233 | |
| 234 | {{{#!c |
| 235 | } else { |
| 236 | // Transmit immediately |
| 237 | st_next = ST_DO_TX; |
| 238 | }}} |
| 239 | }}} |
| 240 | |----------------------------------- |
| 241 | {{{#!td |
| 242 | |
| 243 | }}} |
| 244 | {{{#!td |
| 245 | |
| 246 | {{{#!c |
| 247 | } else { |
| 248 | //No new Tx this cycle; keep waiting in IDLE |
| 249 | st_next = ST_IDLE; |
| 250 | } |
| 251 | }}} |
| 252 | |
| 253 | }}} |
| 254 | |
| 255 | Notice that the state transitions depend on the postRx_Timer1 (SIFS timer). The state machine can also be conditioned on postRx_Timer2 and postTx_Timer1 for other MAC protocol extensions. |
| 256 | |
| 257 | Inputs from software: |
| 258 | * reset: Forces FSM back to {{{IDLE}}} state |
| 259 | * new_tx: Triggers new execution of FSM |
| 260 | * req_nav_zero: Require NAV be zero at time of Tx, cancel Tx otherwise |
| 261 | * pre_wait_for_postRxTimer1: Wait before Tx until postRx Timer 1 is done |
| 262 | * pre_wait_for_postRxTimer2: Wait before Tx until postRx Timer 2 is done |
| 263 | * pre_wait_for_postTxTimer1: Wait before Tx until postTx Timer 1 is done |
| 264 | |
| 265 | Inputs from MAC hardware: |
| 266 | * nav_nonzero: NAV is nonzero |
| 267 | * postRxTimer1_done: postRx Timer 1 is done |
| 268 | * postRxTimer2_done: postRx Timer 2 is done |
| 269 | * postTxTimer1_done: postTx Timer 1 is done |
| 270 | * phy_tx_done: PHY Tx has completed |
| 271 | |
| 272 | The lower MAC framework provides macros for configuring the software parameters above: |
| 273 | {{{#!c |
| 274 | // Configure Tx Controller B |
| 275 | // pktBuf: Tx packet buffer index (passed directly to PHY at TX_START) |
| 276 | // antMask: antenna selection mask (passed directly to PHY at TX_START) |
| 277 | // req_zeroNAV: require NAV=0 at Tx time, must be 0 or 1 |
| 278 | // preWait_postRxTimer1: param for FSM, must be 0 or 1 |
| 279 | // preWait_postRxTimer2: param for FSM, must be 0 or 1 |
| 280 | // preWait_postTxTimer1: param for FSM, must be 0 or 1 |
| 281 | wlan_mac_tx_ctrl_B_params(pktBuf, antMask, req_zeroNAV, preWait_postRxTimer1, preWait_postRxTimer2, preWait_postTxTimer1); |
| 282 | }}} |
| 283 | |
| 284 | The Tx Controller B state machine is started by toggling its enable bit in the MAC support core's register bank: |
| 285 | {{{#!c |
| 286 | // Start Tx Controller B |
| 287 | wlan_mac_tx_ctrl_B_start(1); |
| 288 | wlan_mac_tx_ctrl_B_start(0); |
| 289 | }}} |
| 290 | |
| 291 | The Tx Controller B state machine is implemented as an m-code block in the {{{wlan_mac_hw}}} core. The m source code is in the repository at [browser:/ReferenceDesigns/w3_802.11/sysgen/wlan_mac_hw/mcode_blocks/mac_tx_ctrl_b_fsm.m mac_tx_ctrl_b_fsm.m] |