IT131 · SESSION 06 · FIELD NOTES

The Network Layer & Address Resolution

Meet Logistics — the department that picks the route across town for every shipment. And today, the case file Session 4 sealed two weeks ago finally opens: how a device that only knows an IP address gets the MAC address it actually needs to send anything at all.

New material Module 8 — Network Layer New material Module 9 — Address Resolution

Overview

What Session 6 covers

Module 8 is the layer that makes internetworking possible in the first place — it hands every packet an address that means something end-to-end, no matter how many switches and routers it crosses. Module 9 is the missing piece from Sessions 4 and 5: a packet carries an IP address, but nothing physically moves without a MAC address too. Address resolution is how one gets translated into the other.

Where this goes next Module 10 (Week 7) picks up router configuration directly from the routing-table concepts introduced here. The IPv4 header's addressing scheme is the setup for Module 11's subnetting math (Week 8) — and TTL's role in this session previews Module 13's ICMP and traceroute (Week 9).

Case File

Meet Logistics

Front Desk formats the request. Logistics picks the route it travels. Every router on the network — and every routing table on it — is Logistics doing its one job, over and over, one packet at a time.

Cold open

Logistics doesn't care what's inside the envelope, and it doesn't hand-deliver anything itself. It just reads the destination address, checks it against a list of known routes, and points the packet toward whichever desk is the next best guess. Repeat that at every stop, and eventually it arrives.

Module 8

The IPv4 packet header

This is what Logistics actually reads. Every field earns its place — there's no padding in a header that gets processed at every single hop.

FieldPurpose
Version4 — identifies this as an IPv4 packet.
Header LengthHow long the header itself is, since IPv4 headers can carry optional fields.
DSCPRequests a priority/QoS treatment — e.g. marking voice traffic for lower latency.
Total LengthThe size of the whole packet, header plus data.
Identification, Flags, Fragment OffsetSupport fragmentation — splitting a packet that's too large for a link, and reassembling it at the destination.
Time to Live (TTL)A hop counter, decremented by one at every router. Reaches zero → the packet is dropped. Exists purely to stop a misrouted packet from looping forever.
ProtocolIdentifies what's riding inside — 6 for TCP, 17 for UDP, 1 for ICMP.
Header ChecksumError-checks the header only (not the payload) — recalculated at every hop, since TTL changes the header each time.
Source / Destination IPv4 Address32-bit addresses. Unlike the MAC addressing from Session 4, these stay the same the entire trip — end-to-end, not hop-to-hop.
Connectionless & best-effort The network layer doesn't set up a path before sending, and it doesn't guarantee delivery — no handshake, no acknowledgment, no retransmission. Every packet is routed independently, and it's entirely possible for packets from the same conversation to take different paths. Reliability, when it's needed, is Module 14's job (the transport layer), not this one.

Module 8

The IPv6 packet header

Same job, radically simplified. IPv6 dropped the rarely-used fields entirely rather than carrying them everywhere just in case.

FieldPurpose
Version6 — identifies this as an IPv6 packet.
Traffic ClassIPv6's version of DSCP — priority/QoS marking.
Flow LabelOptionally tags packets belonging to the same flow, so routers can treat them consistently without re-inspecting every packet.
Payload LengthThe size of the data following the header (the header itself is always a fixed 40 bytes).
Next HeaderIPv6's version of the Protocol field — identifies the next header or upper-layer protocol.
Hop LimitIPv6's version of TTL — decremented at every router, packet dropped at zero.
Source / Destination IPv6 Address128-bit addresses — the format from Session 4's hex teach-note, four hex digits per colon-separated group.
What IPv6 dropped, and why No Header Checksum — recalculating it at every hop was expensive, and it duplicated error-checking already happening at Layer 2 (FCS) and often at Layer 4. No fragmentation fields in the base header, either — IPv6 routers don't fragment packets in transit at all; the sending host is expected to discover the path's maximum size up front instead.

Module 8

Routing tables — host and router

Every IP-capable device keeps some version of a routing table. A host's is usually short; a router's is Logistics's entire personnel file.

What it holds
Host routing tableA route to its own local subnet, plus a default route — send anything else to the default gateway and let it figure out the rest.
Router routing tableDirectly connected networks, static routes an admin typed in by hand, and dynamic routes learned from other routers via a routing protocol (OSPF, BGP).
The forwarding decision A router compares a packet's destination address against every route it knows and forwards using the most specific match — the route describing the smallest, most exact slice of address space wins over a broader one. No match at all, and the packet follows the router's own default route if it has one; otherwise it's dropped, and an ICMP "destination unreachable" message goes back to the sender.
"Automatic" has two conditions A directly connected route isn't automatic the instant a cable is plugged in — it needs an IP address configured on the interface and the interface in up/up state (both the physical line protocol and the administrative status up). Forget no shutdown, or plug into a dead port, and that "automatic" route simply never appears. This is the single most common troubleshooting scenario in later routing labs — worth planting here.
Try it — host side Run route print (Windows) or ip route (Linux) or netstat -r (macOS/Linux) on your own machine. You'll see the same shape described above in miniature: a route to your local subnet, and a default route (destination 0.0.0.0) pointing at your gateway.

Module 9

Address resolution: from IP to MAC

A packet has a destination IP address. A frame needs a destination MAC address. ARP is the process that turns the first into the second — and it's the exact mechanism behind Session 4's ARP-table teach-note, finally explained in full.

StepWhat happens
1. Check the ARP tableBefore sending, a device checks its own ARP cache for an existing IP → MAC mapping. Found one? Skip straight to sending the frame.
2. ARP requestNo entry — broadcast an ARP request: "Who has this IP? Tell this MAC." Every device on the segment receives it; only the owner responds.
3. ARP replyThe device that owns the IP sends a unicast ARP reply straight back to the requester, carrying its own MAC address.
4. Cache itThe requester stores the new IP → MAC mapping in its ARP table, subject to its own aging timer — the exact same aging pattern as a switch's MAC address table from Session 5.
Off-subnet destinations If the destination IP isn't on the local subnet, a host ARPs for its default gateway's MAC address instead — never the final destination's. The packet's destination IP still points all the way to the real target (end-to-end); only the frame's destination MAC changes, hop by hop, exactly as Session 4 described.
Try it Open a terminal and run arp -a (Windows, macOS, and Linux all support it). Every row is a live IP → MAC mapping your own machine has already cached — the exact table this section just described, sitting on your own computer right now.

IPv6's version: NDP

IPv6 has no broadcast at all — so it can't reuse ARP's broadcast-request mechanism. NDP (Neighbor Discovery Protocol), built on ICMPv6, does the equivalent job differently.

IPv4 — ARPIPv6 — NDP
RequestARP request — broadcast to FF:FF:FF:FF:FF:FF, every device on the segmentNeighbor Solicitation — sent to a solicited-node multicast address, a small computed subset of devices, not everyone
ReplyARP reply — unicast back to the requesterNeighbor Advertisement — unicast back to the requester
ResultIP → MAC mapping cached in the ARP tableIP → MAC mapping cached in the neighbor cache

ARP is to IPv4 as NDP's Neighbor Solicitation/Advertisement is to IPv6 — same job, but IPv6 replaces "ask literally everyone" with a targeted multicast, since broadcast doesn't exist in IPv6 at all.

Wanted

Case File: IR-02, The Impersonator

Sealed since Session 4. Now that ARP is on the table, so is the incident that abuses it.

THREAT LEVEL: INTERMEDIATE

CROSS-REF LAYER 02 — LOCAL DISPATCH

The Impersonator

ARP has no built-in authentication — nothing stops a device from sending an ARP reply nobody asked for, claiming to own an IP address that isn't its own. Every device that believes it updates its ARP table with a lie, and starts sending that traffic straight to the impersonator instead.

Tell: two different IP addresses claiming the same MAC address in the ARP table.
Countermeasure: Dynamic ARP Inspection on managed switches, and static ARP entries on the handful of hosts where it matters most.

See also: Personnel Directory, LAYER 02 · Security Bulletin, IR-02 · Episode 02, "The Impersonator"

Debrief This is why ARP spoofing is usually step one of a bigger attack, not the whole thing — once traffic is quietly rerouted through the impersonator, everything downstream (sniffing, session hijacking) gets easier. Full mechanism, damage report, and repair checklist in Episode 02, linked above.

Study

Flashcards

Click to flip. Double-click to mark as known.

Check yourself

Sample questions

Pick an answer to see if you're right — same style as the module quiz.

Applied

Worked examples

Think it through before you expand the answer.

The canonical question

Four addresses, two hops

PC-A (192.168.1.10/24, gateway 192.168.1.1) sends a packet to a server at 10.0.0.5, off-subnet, reachable through Router-1. Give the source MAC, destination MAC, source IP, and destination IP of the frame as it leaves PC-A — and again as it leaves Router-1's far (10.0.0.0-side) interface.

Show answer

Leaving PC-A: Src MAC = PC-A's own MAC. Dst MAC = Router-1's MAC (PC-A ARPs for the gateway, never the far-off server, since 10.0.0.5 is off-subnet). Src IP = 192.168.1.10. Dst IP = 10.0.0.5.

Leaving Router-1's far interface: Src MAC = Router-1's far-interface MAC (a brand-new frame — the old one was discarded at the router). Dst MAC = the server's MAC (or the next router's, if there's another hop). Src IP = 192.168.1.10 — unchanged. Dst IP = 10.0.0.5 — unchanged.

This is the whole course's addressing story compressed into one question: MAC addressing is rebuilt hop-to-hop; IP addressing rides end-to-end untouched. If you can answer this cold, Sessions 4–6 have landed.

ARP, same subnet

The first message on a new segment

PC A wants to send data to PC B for the first time. Both are on the same subnet, and PC A's ARP table is empty. Walk through what happens before the first real frame can be sent.

Show answer

Answer: PC A checks its ARP table, finds nothing for PC B's IP, and broadcasts an ARP request ("Who has this IP? Tell this MAC") to every device on the segment. Only PC B recognizes the IP as its own and sends a unicast ARP reply back with its MAC address. PC A caches that mapping in its ARP table, and only now can it actually address and send the real frame to PC B.

ARP, off-subnet

Who does the ARP request actually target?

A laptop on Subnet A needs to reach a server on Subnet B, three routers away. Its ARP table is empty. Does it ARP for the server's IP address?

Show answer

No — it ARPs for its default gateway. A host only ever ARPs for something on its own local subnet, since ARP requests are broadcasts that never cross a router. The packet's destination IP still names the real server the whole way (end-to-end), but the frame's destination MAC is the local gateway's — Local Dispatch hands it to the next desk, which repeats this same process on the next subnet.

TTL

The packet that never arrives

A misconfigured router creates a routing loop. A packet enters the loop with a TTL of 5. What happens, and why doesn't it loop forever?

Show answer

Answer: Each router in the loop decrements the TTL by 1. After 5 hops through the loop, TTL reaches 0, and the router holding it at that moment drops the packet — and sends an ICMP Time Exceeded message back to the original sender. TTL exists exactly for this scenario: without it, a misrouted packet would circulate forever, consuming bandwidth indefinitely. (This same mechanism, incrementing TTL by one probe at a time, is how traceroute works — a preview of Module 13.)

Routing table

Which route wins?

A router's table has a route to 192.168.1.0/24 and a separate default route (0.0.0.0/0). A packet arrives addressed to 192.168.1.50. Which route does the router use, and why?

Show answer

The 192.168.1.0/24 route. A router always forwards using the most specific matching route available, not just the first one it finds. The default route matches everything, but 192.168.1.0/24 matches this destination far more precisely — so it wins. The default route only gets used when nothing more specific matches at all.

Reference

Glossary & index

Every term from this session, searchable and indexed A–Z.