Standalone Client (STA)

The Standalone Infrastructure Client (STA) application for CPU High implements a standard 802.11 infrastructure client. The STA design supports the standard association handshake and will associate with standard Wi-Fi APs.

The Standalone STA application can only on a node which is not running Linux. Nodes running Linux must use the linux_dev application in CPU High.

Typical STA Network

Fig. 4.2 Typical STA Network

The STA supports the Ethernet portal behaviors described in the 802.11-2012 standard Annex P. By connecting a device via Ethernet, it made use the STA design as an Ethernet bridge to whatever network is connected to the associated AP.

BSS Configuration

A STA and AP must agree on association state. The nodes typically establish this state with the standard 802.11 association handshake. The reference AP and STA applications in the Mango 802.11 design also support setting explicit association state without any wireless packet exchange. This configuration is useful when running experiments where nodes must start in a known-good state even when the wireless link is unreliable.

Parameters used to configure a BSS are defined in bss_config_t (see High MAC Framework BSS Configuration). STA-specific requirements for these fields are listed below:

Parameter Description
u8 bssid[6] Must not be a multicast address. A locally administered address is acceptable.

To change the current BSS configuration, the following function may be called:

u32 configure_bss(bss_config_t* bss_config, u32 update_mask);

The return value and function arguments are defined as follows:

Parameter Description
Return value (u32) 0 if the function executes without error. Otherwise, a bitmask of error flags.
bss_config_t* bss_config Pointer to bss_config_t that contains updated parameters.

Joining a network

Once a suitable network has been found via the High MAC Framework Network Scanner, the association handshake can be started by the transmission of an authentication frame.

The join state machine is parameterized by the elements in join_parameters_t:

Parameter Description
char* ssid Pointer to an SSID string
u8 bssid[6] (optional) pointer to a BSSID. Can be used to distinguish between multiple BSS that share the same SSID string. If set to all zero, the STA will join the first BSS it identifies with a matching SSID.
u8 channel (optional) WLAN channel number. If set to 0, STA will automatically start the High MAC Framework Network Scanner before searching for the BSS. Otherwise the STA will transmit its Authentication frame on the specified channel.

Example Usage

The following code snippet will start the join procedure to a network with the SSID “TEST-SSID” on any channel with any BSSID.

char ssid_str[] = "TEST-SSID";

// Get current join parameters
join_parameters = wlan_mac_sta_get_join_parameters();

// Set join parameters
//     - Set channel to zero to force an active scan
join_parameters->channel = 0;
//     - Set BSSID to zero to
bzero((void*)join_parameters->bssid, MAC_ADDR_LEN);

// Free existing allocated string

// Duplicate ssid_str into an allocated array in join_parameters
join_parameters->ssid = strndup(ssid_str, SSID_LEN_MAX);

// Search for and join the SSID

If a network is found matching the “TEST-SSID” string, the result of the above code snippet will be the transmission of an authentication frame to start the beginning of the association handshake.

Ethernet Rx

When an Ethernet frame is received, the High MAC Framework encapsulates the payload and passes it to the STA for further processing. Regardless of the Ethernet frame’s destination address, the encapsulated frame will be enqueued as a unicast transmission with a receive address equal to the associated AP. If the destination address is multicast, it is the responsibility of the AP to retransmit the frame to other associated STAs.

Wireless Rx

When the STA receives a wireless 802.11 frame that is successfully decoded, it first sets a number of internal boolean variables used later in the processing:

Parameter Description
unicast_to_me Received frame has an RA that matches the MAC address of this STA
to_multicast Received frame has an RA with the multicast bit set high
is_associated Received frame has a TA that matches the associated AP

Using the sequence number of the received frame, the STA skips further processing of duplicate packets. Next, the STA then examines the received 802.11 frame’s packet type and processes each differently:

QoS Data or Data

If is_associated is true and either unicast_to_me or to_multicast is true, the received data frame is handed off to the High MAC framework for de-encapsulation and Ethernet transmission.


If unicast_to_me is true and the authentication payload indicates a success, an association request is enqueued to the TA of the frame.

Association Response

If unicast_to_me is true, the TA is the AP that previously authenticated the STA, and the association request indicates a success, the STA configures its BSS to match the AP it just associated with.


If unicast_to_me is true and the TA is the AP that we are associated with, the STA configures a NULL BSS and reverts to an unassociated state.

Wireless Tx Queue Handling

The STA application uses the High MAC Framework’s queueing subsystem to implement multiple transmit queues. The STA uses the following queues:

  • Management: for all Management transmissions, such as Probe Requests and Association Requests
  • Unicast Data: for all non-management packets

The STA queue handling is simpler than that of the Access Point because the STA only addresses transmissions to its associated AP, independent of the ultimate destination for a packet.

The reference STA implementation uses a simple round-robin queue polling scheme, alternating between the Management queue and Unicast Data queue.