#Why this matters
In the OSI and TCP/IP models, IP addresses identify hosts across networks at Layer 3. However, a network interface card (NIC) cannot transmit a packet across a physical link using an IP address alone; it needs a Layer 2 frame addressed to a hardware MAC address.
For digital forensics (raqamli-izquarlik) and blue-team analysts, Ethernet headers and Address Resolution Protocol (ARP) traffic in a packet capture (PCAP) show which hardware interfaces communicated locally and whether an attacker redirected traffic.
#Ethernet frames and MAC addresses
A MAC (Media Access Control) address is a 48-bit (6-byte) hardware identifier written as six hexadecimal pairs, such as 02:11:22:33:44:55. The first three bytes form the Organizationally Unique Identifier (OUI), and the last three bytes identify the interface. The special address ff:ff:ff:ff:ff:ff is the Layer 2 broadcast address, accepted by every NIC on the subnet.
Wired LANs use the Ethernet II frame format:
| Field | Size | Purpose |
|---|---|---|
| Destination MAC | 6 bytes | Target NIC, or ff:ff:ff:ff:ff:ff for broadcast |
| Source MAC | 6 bytes | Sending NIC hardware address |
| EtherType | 2 bytes | Encapsulated protocol (0x0800 IPv4, 0x0806 ARP, 0x86DD IPv6) |
| Payload | 46-1500 bytes | Layer 3 packet |
| FCS | 4 bytes | Frame Check Sequence (CRC-32) for error detection |
Wireshark usually shows Destination MAC, Source MAC, EtherType, and Payload because the NIC strips the preamble and FCS before passing frames to the OS.
#How a switch forwards frames
Unlike legacy hubs that repeated signals to every port, a Layer 2 switch reads Ethernet headers and maintains a MAC address table:
- Learn: Record the Source MAC and incoming port in the table.
- Forward or flood: Look up the Destination MAC. If found, forward only to that port. If unknown or
ff:ff:ff:ff:ff:ff, flood the frame out all other ports in the same LAN.
- Frame arrives on Port 1Record Source MAC on Port 1
- Lookup Destination MACSearch MAC address table
- Known unicastForward only to matching port
- Broadcast or unknownFlood to all other ports
Because unicast frames go only to the target port, a host on Port 3 does not normally see unicast traffic between Ports 1 and 2. Attackers on a LAN abuse ARP to bypass that isolation.
#Address Resolution Protocol (ARP)
Suppose 10.10.10.15 wants to send an IPv4 packet to its default gateway 10.10.10.1 but lacks the gateway's MAC address. ARP resolves that IPv4-to-MAC mapping on the local subnet.
An ARP Request (opcode 1) is sent as a broadcast frame. Only 10.10.10.1 replies with a unicast ARP Reply (opcode 2), and Host A caches the mapping. Remember that ARP works only on the local subnet: when contacting a remote server like 198.51.100.20, a host resolves its default gateway (10.10.10.1), not the remote IP.
On Linux, arp -n shows the ARP cache without DNS lookups:
$ arp -n
Address HWtype HWaddress Flags Mask Iface
10.10.10.1 ether 02:00:00:00:00:01 C eth0
10.10.10.25 ether 02:00:00:00:00:25 C eth0In Wireshark, useful display filters include arp, arp.opcode == 1, arp.opcode == 2, and eth.addr == 02:00:00:00:00:01.
#Defending and common mistakes
ARP has no authentication: hosts usually accept unsolicited ARP replies and overwrite cached entries. Attackers exploit this via ARP spoofing (cache poisoning) to intercept local traffic.
Core defences:
- Dynamic ARP Inspection (DAI): Switches verify ARP frames against a trusted DHCP snooping table and drop forged replies.
- Port security: Limiting MAC addresses per port blocks MAC flooding.
- Static ARP entries: Fixed IP-to-MAC bindings protect critical gateways and servers on sensitive segments.
- Monitoring: Alert when one MAC claims multiple IPs or when the gateway MAC changes.
Common mistakes:
- Running
arpwithout-n: Hostname resolution slows triage and creates DNS noise. - Looking for a remote server's MAC in a local PCAP: Frames only carry the next Layer 2 hop (the gateway).
- Assuming TLS stops ARP spoofing: TLS hides payloads, but an attacker can still drop packets, log metadata, and sniff plain DNS or HTTP.
#Summary
- Ethernet II frames carry 48-bit MAC addresses and an EtherType (
0x0800IPv4,0x0806ARP) for local delivery. - Switches learn source MACs dynamically, forward known unicast frames to one port, and flood broadcasts (
ff:ff:ff:ff:ff:ff) and unknown destinations. - ARP resolves local IPv4 addresses (or the default gateway) using broadcast requests and unicast replies.
- Defenders detect and prevent ARP spoofing with
arp -n, Wireshark (arp.opcode == 2), DAI, and port security.