Structure of a WiFi frame (well, 802.11 specifically):

Address Fields

Address fields are interpreted differently based on the ToDS and FromDS bits in the frame’s Control field (above, it’s the very first field)

  • In ad-hoc mode (one node is sending directly to another), both DS bits are 0:
    1. Address 1 is target node
    2. Address 2 is source node
    3. BSS ID
  • When AP is sending to host in infrastructure mode, ToDS is 0 and FromDS is 1:
    1. Destination
    2. BSS ID
    3. Sender address
  • When host is sending to AP in infrastructure mode, ToDS is 1 and
  • When both DS bits are 1
    1. Ultimate destination
    2. Immediate sender
    3. Immediate destination
    4. Original source

TODO what's in the book doesn't match the slides!

A host H1 connected to an access point (AP) connected to a router R1

Case 1: Router R1 sends data to host H1

  1. R1 knows H1’s IP address, runs ARP to get MAC address
  2. R1 encapsulates the data in Ethernet frame
    • Source address: R1’s MAC address
    • Destination address: H1’s MAC address
  3. AP converts the Ethernet frame to WiFi frame
    • Address 1: H1’s MAC address
    • Address 2: AP’s MAC address
    • Address 3: R1’s MAC address
  4. H1 can determine that the frame has come from R1 by checking the Address 3 field

Case 2: Host H1 responds by sending packet to router R1

  1. H1 creates a WiFi frame
    • Address 1: AP’s MAC address
    • Address 2: H1’s MAC address
    • Address 3: R1’s MAC address
  2. AP can determine that the frame should be forwarded to R1 by checking Address 3 field
  3. AP converts the WiFi frame to Ethernet frame
    • Source address: H1’s MAC address
    • Destination address: R1’s MAC address