Typorithm · medium

ICMP & ARP

icmp-arpnetworksicmparpping
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn ICMP & ARP

0%

L3 — Network Layer

ICMP is L3's control and error protocol: echo request/reply powers ping, time-exceeded drives traceroute, and destination-unreachable reports failures. ARP resolves an IP to a MAC on the local link — the L2/L3 bridge — and caches it in the neighbor table. The DF bit plus size probes do path-MTU discovery.

ICMP rides on top of IP to carry control and error messages. Echo request and echo reply are what ping uses to check reachability and round-trip time. Time-exceeded messages (sent when TTL hits 0) are how traceroute discovers each hop, and destination-unreachable reports that a host, network, or port could not be reached.

ARP solves a different problem: to deliver an IP packet on the local link, a host needs the target's MAC address. ARP broadcasts "who has this IP?" and caches the answer in the neighbor table (arp -a or ip neigh show), bridging L3 addressing to L2 delivery.

Path-MTU discovery sends packets with the Don't Fragment (DF) bit set at increasing sizes; a router that cannot forward without fragmenting returns an ICMP "fragmentation needed" message, revealing the largest packet the path accepts.

01

ICMP carries echo (ping), time-exceeded (traceroute), and unreachable.

02

ARP maps an IP to a MAC on the local link, cached in the neighbor table.

03

DF bit + size probes find the path MTU.

ping -c 4 8.8.8.8
arp -a
ip neigh show
traceroute -I 1.1.1.1
ping -s 1472 -M do 8.8.8.8

Read the implementation

Connect each part of the code to the concept before you type.

1. Echo request

ping sends ICMP echo requests; -c 4 stops after four replies.

ping -c 4 8.8.8.8

2. ARP cache

arp -a prints the cached IP-to-MAC mappings learned on the local link.

arp -a

3. Neighbor table

ip neigh show is the modern view of the same neighbor (ARP) cache.

ip neigh show

4. ICMP traceroute

-I makes traceroute use ICMP echo probes instead of UDP datagrams.

traceroute -I 1.1.1.1

5. Path MTU probe

-s sets payload size and -M do sets the Don't Fragment bit to test the path MTU.

ping -s 1472 -M do 8.8.8.8

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

ICMP & ARP: Lesson & Practice · Typorithm | ApplyDjinn