Layer 2 is the Data Link layer. This layer uses a Media Access Controller (MAC) to generate the frames that will be transmitted. As the name suggests, the MAC controls the physical transmission media. The wireless transmission media used for WiFi or 802.11 has different requirements from the wired transmission media used for Ethernet or 802.3, and therefore needs a different MAC and PHY. Note the upper layer software is not aware of or affected by the physical interface.

Click image to enlarge.

When transmitting data, this layer adds a header containing the source and destination MAC addresses to the packet received from the Network layer. The frame it creates will then be forwarded to the Physical layer.

When receiving data, this layer is used to determine if the Frame received by the host contains the host’s MAC address. If it does, the data is forwarded up to the Network layer.

Every host on the network has at least one MAC address. Laptops typically have two: one for the wired LAN and one for the wireless LAN. Home routers also typically have two MACs: one for the local network and one for the Internet.

​

Most switches are referred to as “layer 2” devices because they route frames based on their MAC addresses.

Ethernet and WiFi Frame Format

As you probably guessed, the Data Link layer adds more than just the source and destination MAC addresses to the packet. Note the Media Access Controller for Ethernet and WiFi are different and generate different frames.

Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.

Click here to edit contents of this page.

Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.

Append content without editing the whole page source.

Check out how this page has evolved in the past.

If you want to discuss contents of this page - this is the easiest way to do it.

View and manage file attachments for this page.

A few useful tools to manage this Site.

See pages that link to and include this page.

Change the name (also URL address, possibly the category) of the page.