Where does 802.11 fit in the OSI Model?

802.11 is a set of data link and physical layer protocols.

Data Link Layer (MAC):

Responsible for reliable link-to-link data transfer.

  • Channel access (CSMA/CA)
  • Addressing
  • Frame validation (management, data, control frames)
  • Error detection
  • Security mechanisms

Physical (PHY) Layer:

Responsible for putting bits "on the air".

OSI.png
Click image to enlarge.

For 802.11-based applications, the following functionality isnot defined by 802.11 and must be implemented by the Application Layer (i.e., your code):

  • Choosing a Radio Frequency (RF) channel to start/join a network
  • Choosing which network to join
  • When to start/join a network
  • When to (re-)associate with a network