4 - Layer 2 in Detail
4 - Layer 2 in Detail
Data link layer responsible for makes sure Data is formatted the correct way, reliably frame delivery
within local area network using MAC address and error detection using trailer. Ethernet lives here.
Ethernet switch (layer-2) works at this layer.
Ethernet- Ethernet is protocol lives at layer 1, and layer 2 of the OSI model. At data link layer
ethernet known MAC address (media access control address). Each device has globally unique MAC
address on NIC card (Network interface card). This address stored in permanent read only memory
(ROM) on NIC.
MAC address
- Check your Pc MAC address uses this command- Ipconfig /all in CLI (command line interface)
Ethernet Frame- A frame contain layer-2 header and payload (data).
Layer 2- header has 7 fields, each fields define data flow at layer 2.
Preamble- this files size is 7 bytes. This field inform the receiving system that a frame is starting and
enable synchronization.
SFD (start frame delimiter)- this field size is 1 byte, indicates that the destination MAC address field
start with next byte.
(DMAC) Destination MAC address- This field size is 6 bytes, indicates destination device’s MAC
address.
SMAC (Source MAC address)- This field size is 6 bytes, indicates source device’s MAC address.
Ether Type- This field size is 2 bytes, defines the layer-3 protocol inside the frame, for example IPv4
and IPv6.
0x0800 IPv4
0x0806 ARP (Address resolution protocol)
0x8100 VLAN-tagged 802.1Q
0x86DD IPv6
Payload- This field contain data that generated by sender. Payload size can be 46 bytes to 1500
bytes.
Trailer- This field size is 4 bytes. This field detect errors in frame during communication using FCS
(frame check sequence)