In an 802.11 data frame, how do the To DS and From DS bits decide what each of the four address fields holds?
answer
- air hop versus end points
- Address 1 always receives
- uplink, downlink, both bits
- where the BSSID moves
- bridges and mesh need four
basics
~20 sAddress 1 is always the receiver and Address 2 the transmitter; To DS and From DS place the BSSID and end points. Uplink: BSSID, source, destination. Downlink: destination, BSSID, source. Both bits set adds Address 4 for AP-to-AP or mesh.
solid answer
~50 sAn 802.11 frame has to name both the hop on the air and the end points of the payload, so the header has up to four address slots. **Address 1 is always the receiver (RA) and Address 2 the transmitter (TA)**; the `To DS` and `From DS` bits say what the rest hold. With `To DS=1` (client to AP), Address 1 is the BSSID, Address 2 the client and Address 3 the final destination, usually the gateway. With `From DS=1` (AP to client), Address 1 is the client, Address 2 the BSSID and Address 3 the original source. With both clear - management frames - Address 3 is the BSSID. Only with both set, between APs, mesh nodes or bridging stations, does `Address 4` appear, so the frame can carry RA, TA, DA and SA at once.
go deeper
Remember that 802.11 names the air hop and the end points separately, and that Address 1 always holds the receiver.
Rebuild the four-row table from the To DS and From DS bits and explain where the BSSID sits on uplink, downlink and in management frames.
Read addresses in a capture to find the right BSSID among several SSIDs, follow a packet across both hops, and spot four-address bridging.
Weigh where four-address bridging or mesh backhaul is acceptable in a design, given the extra wireless hop and the layer 2 domain it extends.
## Why an 802.11 frame needs more than two addresses An Ethernet frame names a destination and a source, and the cable delivers it. An 802.11 frame on an infrastructure network rarely goes straight to its final destination: a laptop's packet for the default gateway goes over the air to the access point (AP), which bridges it onto the wired distribution system (DS). The frame therefore has to name two different pairs: - the **hop on the air** - the **receiver address (RA)**, the station that must decode and acknowledge this transmission, and the **transmitter address (TA)**, the station sending it; - the **end points** - the **destination address (DA)** and **source address (SA)** of the payload, which may sit beyond the AP; - the **BSSID**, which identifies the basic service set; on an AP it is the MAC address the AP uses for that SSID on that radio. A generic 802.11 header has room for four 6-octet addresses: `Address 1`, `Address 2` and `Address 3` before the Sequence Control field, and `Address 4` after it, present only when it is needed. ## The To DS and From DS bits decide the layout Two flags in the Frame Control field, `To DS` and `From DS`, say which way a data frame travels relative to the distribution system, and that fixes what each slot holds. | To DS | From DS | Typical case | Address 1 | Address 2 | Address 3 | Address 4 | |---|---|---|---|---|---|---| | 0 | 0 | management frames; stations talking directly | DA (= RA) | SA (= TA) | BSSID | absent | | 1 | 0 | client to AP (uplink) | BSSID (= RA) | SA (= TA) | DA | absent | | 0 | 1 | AP to client (downlink) | DA (= RA) | BSSID (= TA) | SA | absent | | 1 | 1 | AP to AP, mesh, four-address bridging | RA | TA | DA | SA | Two rules make the table easy to rebuild from memory: 1. **Address 1 is always the receiver and Address 2 the transmitter** of this transmission. That is why an ACK or a CTS, which needs only one address, keeps just Address 1. 2. **The third (and fourth) slots carry whatever the first two could not**: on uplink the final destination, on downlink the original source, and in the four-address case both end points. The Linux kernel's helpers encode the same logic: the destination address is Address 3 when `To DS` is set and Address 1 otherwise; the source address is Address 4 when both bits are set, Address 3 when only `From DS` is set, and Address 2 otherwise. ## Worked example: a laptop reaching its gateway A laptop `02:00:00:00:00:01` on SSID `corp-example`, served by an AP radio whose BSSID is `02:00:00:00:0a:01`, sends a packet to the gateway `02:00:00:00:00:fe` on the wired side. 1. **Uplink (To DS 1, From DS 0):** Address 1 = `02:00:00:00:0a:01` (the BSSID, receiver), Address 2 = `02:00:00:00:00:01` (the laptop), Address 3 = `02:00:00:00:00:fe` (the gateway). 2. The AP acknowledges, strips the 802.11 header and bridges the payload onto the wire with the gateway as destination and the laptop as source. 3. **Downlink reply (To DS 0, From DS 1):** Address 1 = the laptop, Address 2 = the BSSID, Address 3 = the gateway as original source. Unless they use a direct-link feature such as TDLS, even two laptops on the same AP talk through it: each packet makes two hops, each with three addresses. ## Where the fourth address appears `Address 4` is present only with both bits set, when a frame crosses a wireless hop between two nodes that are both forwarding on behalf of others - AP-to-AP wireless bridges, 802.11s mesh (802.11s-2011), and stations bridging a wired segment behind them. hostapd's `wds_sta=1` setting, for example, lets associated stations use four-address frames so layer 2 bridging can be used behind them. Every other data frame - including QoS Data and encrypted frames - stays at three addresses. ## Reading addresses in a capture - Wireshark names the roles directly: `wlan.ra`, `wlan.ta`, `wlan.da`, `wlan.sa` and `wlan.bssid`, plus `wlan.addr` for any address slot and `wlan.fc.ds` for the two DS bits. - To find the AP's MAC in a client conversation, look at the BSSID: Address 1 on uplink, Address 2 on downlink, Address 3 in management frames. - An AP that serves several SSIDs on one radio usually uses a different BSSID for each, so "the AP's MAC" in a capture is the BSSID of the SSID in question, not necessarily the radio's base address. - The DA on uplink is the next layer-2 hop on the wire (usually the gateway), not the IP destination of the packet. How the wired side handles the bridged frame belongs with Ethernet switching; what matters here is that the 802.11 header carries both the air hop and the end points.
- Why does an 802.11 ACK frame carry only one address?An ACK is sent immediately after the frame it confirms, so the only thing it must say is who it is for: Address 1, the receiver, which is the station that just transmitted. The transmitter is implied by timing, and keeping the frame minimal keeps its airtime short.
- Two laptops on the same access point exchange traffic; how many 802.11 frames and which DS bits does one packet use?Two, on an ordinary infrastructure network. The sender transmits with `To DS=1` to the BSSID, Address 3 naming the other laptop; the AP then retransmits with `From DS=1`, Address 1 the receiving laptop and Address 3 the original sender. Each hop is a separate frame with its own acknowledgement.
A parcel passed between couriers carries two kinds of address: the label naming the original sender and final recipient, and the handover slip naming who passes it on and who signs for it this time. Address 1 is always the person signing for this handover.
- Says Address 1 is always the source because the sender writes it first.
- Thinks the BSSID is always in Address 3 regardless of direction.
- Believes QoS Data or encrypted frames need a fourth address.
- Assumes two clients on one AP normally exchange frames directly, bypassing the AP.
- Takes the uplink destination address to be the packet's IP destination host.