MAC Addressing
MAC or Physical Addresses are permanent addresses that is unique for every device unlike IPs.
- It is a 12 digit hex code that consists of 6 pairs of characters.
- Each pair is 1 byte, so Total MAC address size is 6 bytes (48 bits)
It has two parts:
- Organizational Unique Identifier(OUI) : Identifies the [Manufacturer]
- Network Interface Controller(NIC) : Unique identifier for each [NIC]
Ethernet Frame (L2)
Frame Header
- [Destination(MAC)]: When unknown -> find via ARP
- [Length:]
- Total length of frame (Header + Data + Trailer) should be ≥ 64 bytes,
- Where 18 bytes consists of the header and trailer, rest is packet.
- A “padding” is added to the frame if the total length ≤ 64 bytes. i.e streams of 0s at the end of the frame.
Frame Switching
-
When frames have to go from source to destination, they are provided the three following things: [1. Source IP | 2. Source MAC | 3. Destination IP] Here, goal is to find the machine with [IP = Destination IP], and once that is found we store that found device’s MAC as Destination MAC.
-
[Store & Forward Switching:] Frames are moved forward, and as switches forward these frames, they store the MAC addresses of all the encountered devices. This is later on used for Frame forwarding & ARP.
Frames travelling pathway can be divided into two modes:
-
- Frame Flooding (Broadcast) —> When Unknown: When device with matched IP is not yet found, frame is broadcasted to all devices except the source at all nodes.
[CASE 1]: Frame is received by the destination IP → Return an “ARP Reply” as an indicator [CASE 2]: Frame is NOT yet received to dest. → Ignore the frame, move it forward.
-
- Frame Forwarding (Unicast) —> When Known: When device with matched IP is known(already found). Then frame is moved along the path from source to destination easily.
Reference for ARP