At layer 2, frames are encoded and decoded into bits ready to be placed into a physical wire. Depending on the protocol there can be error detection and correction. The most common protocol used at Layer 2 is Ethernet, normally used on Local Area Networks.

The Ethernet Header

Note that in destination and source address, because each byte is 8 bits, 6x8 = 48, which is the length of a MAC address

The Preamble section is used to help both devices on the network to synchronize.

The Ethertype will be what type of data is to follow - commonly IPv4.

At the end we have the FCS, or Frame Check Sequence, which is used to ensure that data has not been corrupted during transit.

MAC addresses

Stands for Media Access Control.

Ethernet uses 48-bit hexadecimal MAC addresses. They are composed of two parts:

  1. First 24-bits is the OUI (Organizationally Unique Identifier).
    1. This is assigned by the IEEE, and it uniquely identifies the manufacturer of the Ethernet port
  2. The last 24-its are assigned by the specific vendor

Note that these burned in MAC addresses on any NIC port is globally unique.

Note

Although MAC addresses might be global, they are not logical.The entire address space is flat and follows no particular organization.

Finding MAC Addresses

On Linux: ifconfig On Windows: ipconfig /all On IOS: show interface