Target Wake Time#
Target Wake Time (TWT) allows an AP to manage activity in the BSS, minimize contention between STAs, and reduce the required amount of time that an STA utilizing a power management mode needs to be awake. This is achieved by allocating STAs to operate at nonoverlapping times and/or frequencies and concentrate the frame exchanges in predefined service periods.
TWT (Target Wake Time) setup is only supported in 11ax (HE) connectivity. Follow the steps below to enable TWT.
TWT Setup/Teardown#
Follow the steps below for TWT setup and teardown.
Enable CONFIG_TWT_SUPPORT define, which is included in both driver Makefile and apps Makefile (apps/Makefile).
Compile the driver, as desribed in the Compilation Steps section.
#make clean;make
Navigate to the release folder and insert the driver.
# cd release # insmod rsi_91x.ko driver_mode_value=1 rsi_zone_enabled=<val> ... # insmod rsi_sdio.ko
To connect to the third access point (AP), run the following command:
# wpa_supplicant -i <interface_name> -D nl80211 -c <sta_settings.conf> -ddddt > log1 &
To start or stop the TWT session, run the following command. This will trigger the TWT Setup/Teardown frame.
# ./onebox_util rpine0 twt_config <wake_duration> <wake_duration_tolerance> <wake_int_exp> <wake_int_exp_tolerance> <wake_int_mantissa> <wake_int_mantissa_tolerance> <implicit_twt> <unannounced_twt> <triggered_twt> <negotiation_type> <twt_channel> <twt_protection> <twt_flow_id> <restrict_twt_outside_tsp> <twt_retry_limit> <twt_retry_interval> <twt_req_type> <twt_enable> <wake_duration_unit>
Example:
# ./onebox_util rpine0 twt_config 255 255 15 15 650 10 1 1 0 0 0 0 1 1 6 10 1 1 0
wake_duration: This is the nominal minimum wake duration of TWT. This is the time for which DUT will be in wake state for Transmission or reception of data. Allowed values range is 0-255.
wake_duration_tol: This is the tolerance allowed for wake duration in case of suggest TWT. Received TWT wake duration from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Allowed values are 0-255.
wake_int_exp: TWT Wake interval exponent. It is exponent to base 2. Allowed values are 0 - 31.
wake_int_exp_tol: This is the allowed tolerance for wake_int_exp in case of suggest TWT request. Received TWT wake interval exponent from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Allowed values are 0 - 31.
wake_int_mantissa: This is the TWT wake interval mantissa. Allowed values are 0-65535.
wake_int_mantissa_tol: This is tolerance allowed for wake_int_mantissa in case of suggest TWT. Received TWT wake interval mantissa from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Allowed values are 0-65535.
implicit_twt: If enabled (1), the TWT requesting STA calculates the Next TWT by adding a fixed value to the current TWT value. Explicit TWT is currently not allowed.
un_announced_twt: If enabled (1), TWT requesting STA does not announce its wake up to AP through PS Poll's or U-APSD trigger frames.
triggered_twt: If enabled(1), atleast one trigger frame is included in the TWT Service Period(TSP).
negotiation_type: If disabled(0), the TWT requesting STA supports individual TWT. Broadcast TWT is currently not supported.
twt_channel: Currently this configuration is not supported. Allowed values are 0-7.
twt_protection: If enabled (1), TSP is protected. This is negotiable with AP. Currently not supported. Only zero is allowed.
twt_flow_id: This is TWT flow ID.
Range: 0-7 ( should be same for setup and teardown, otherwise error will be triggered).
0xff: To teardown all active sessions. This is valid only in Teardown TWT case.
restrict_tx_outside_tsp: If enabled (1), any Tx outside the TSP is restricted. Else, TX can happen outside the TSP also.
twt_retry_limit: This is the maximum number of retries allowed, if the TWT response frame is not recieved for the sent TWT request frame. Allowed values are 0 - 15.
twt_retry_interval: The interval, in seconds, between two twt request retries. Allowed values are 5 - 255.
req_type: This is the TWT request type.
0 - Request TWT
1 - Suggest TWT
2 - Demand TWT
twt_enable: If enabled, TWT setup frame is triggered or if disabled, TWT Teardown frame is triggered.
0 - Disable
1 - Enable
wake_duration_unit: This parameter defines unit for wake_duration. Allowed values are 0 (256 uS) and 1 (1024 uS).
The following command provides the status of the ongoing TWT session:
# ./onebox_util rpine0 twt_status
TWT Command status
Sr.No | STATUS | DESCRIPTION |
---|---|---|
1. | TWT_DEVICE_NOT_IN_CONNECTED_STATE | Occurs when device is not connected to AP. |
2. | TWT_SETUP_ERR_SESSION_ACTIVE | Occurs when users try to give TWT setup command when there is an already active TWT session. |
3. | TWT_TEARDOWN_ERR_FLOWID_NOT_MATCHED | Occurs when TWT teardown command is given with a flow ID that does not match existing session flow ID. |
4. | TWT_TEARDOWN_ERR_NOACTIVE_SESS | Occurs when teardown command is given while there is no active session. |
5. | TWT_SETUP_SESSION_IN_PROGRESS | Occurs when users try to give TWT setup command when there is an already TWT session in progress. |
6. | TWT_SESSION_SUCC | TWT session setup success. TWT session is active. |
7. | TWT_UNSOL_SESSION_SUCC | Unsolicited TWT setup response from AP accepted. TWT session is active. |
8. | TWT_SETUP_AP_REJECTED | TWT Reject frame recieved in response for the sent TWT setup frame. |
9. | TWT_SETUP_RSP_OUTOF_TOL | TWT response parameters from AP for TWT Suggest request is not within tolerance set by User. |
10. | TWT_SETUP_RSP_NOT_MATCHED | TWT response parameters from AP for TWT Demand request does not match parameters given by User. |
11. | TWT_SETUP_UNSUPPORTED_RSP | Unsupported TWT response from AP. |
12. | TWT_TEARDOWN_SUCC | TWT session teardown success. |
13. | TWT_AP_TEARDOWN_SUCC | TWT session teardown from AP success. |
14. | TWT_SETUP_FAIL_MAX_RETRIES_REACHED | TWT setup request retried maximum number of times as configured by user. |
15. | TWT_INACTIVE_DUETO_ROAMING | TWT session inactive due to roaming. |
16. | TWT_INACTIVE_DUETO_DISCONNECT | TWT session inactive due to disconnect. |
17. | TWT_INACTIVE_NO_AP_SUPPORT | TWT session inactive as connected AP does not support TWT. |
Reschedule TWT#
To suspend and resume the current TWT session dynamically, follow the steps below to reschedule TWT.
To check whether the TWT session is active or not, run the following command:
# ./onebox_util rpine0 twt_status
If the TWT session is active, run the following command to reschedule TWT:
#./onebox_util rpine0 reschedule_twt twt_flow_id twt_action suspend_duration
twt_flow_id: Active twt-session flow ID.
twt_action: This are type for twt_action
0 - Suspend indefinitely
1 - Suspend for duration
2 - Resume immediately
suspend_duration: Suspend TWT for a given interval. The value should be non-zero only when twt_action is 1. Otherwise, it should be zero.
To check the reschedule_twt session status, run the following command:
# ./onebox_util rpine0 twt_status