ONE ETHERNET LAN192.0.2.0/24

JavaScript is off, so there is no 3D view. Read every exchange in the journeys below.

A Laptop. Ready to find the gateway.

Paused. Ready.

The laptop already has a lease

Address 192.0.2.23 is usable. The ARP cache has no gateway MAC. Start there.

What this device knows now

Lease
Valid lease from an earlier exchange
Usable IPv4
192.0.2.23
ACK settings. Received evidence
/24, router 192.0.2.1. DNS 192.0.2.53. Lease 3600s.
Next hop
Route not selected
ARP cache. IPv4 to MAC
No next-hop mapping
Gateway ARP cache
No sender mapping yet
Last received
No messages yet in this run
Packet
First packet waiting
Choose an exact exchange
Destination to reach203.0.113.80Destination IPv4 address
Resolved next-hop MACNot resolvedWhich local device receives this frame

Goal: deliver one IPv4 packet to its local next hop.

The network before the request

ONE FIRST HOP.

The laptop already has an address. First, find the gateway. Then send one packet. Chapter 2 shows how the address arrived.

The laptop already has a lease. It still needs the gateway MAC. Then it can send one packet.

The model’s boundaries

One wired IPv4 LAN, one switch, one DHCP server, one subnet, and no relay. Addresses and MACs are synthetic. Timings are illustrative and compress real waits. All broadcast copies arrive together after the switch receives the source frame. On real links, the delays can differ.

This client sets the DHCP BROADCAST flag, so initial server replies are broadcast. Other clients can accept unicast replies. This run shows three probes, a wait, and two announcements. That is one way to check an address. It is not a rule that every host must use these counts. Real systems also renew leases, retry, expire caches, detect later conflicts, and can use static or link-local configuration. Those processes are outside this run.

The laptop ledger shows its lease and next-hop ARP mapping. The switch ledger shows source MAC learning. The gateway cache uses the same ARP receive rule as the workbench: a target stores the sender. Other hosts are not fully simulated. A warm run starts with retained state. It does not replay the exchange that created it. Ordinary ARP and DHCP here do not authenticate a device.

Success means the first IPv4 frame reached the peer or gateway. It does not establish Internet access, a reply, DNS resolution, TLS, or application success.

Readable journeys · every experiment

Use these complete sequences without animation, JavaScript, or WebGL. You can open a frame before it arrives. Receipt and address acceptance are separate events.

1. Find the gateway

The laptop already has a lease. It still needs the gateway MAC. Then it can send one packet.

  1. The laptop already has a lease. Address 192.0.2.23 is usable. The ARP cache has no gateway MAC. Start there.
  2. Remote IP. Use the gateway.. 203.0.113.80 is outside 192.0.2.0/24. The next hop is gateway 192.0.2.1. The packet IP destination stays 203.0.113.80.
  3. ARP. Who has 192.0.2.1?. The laptop broadcasts a request for gateway 192.0.2.1. The IPv4 packet stays queued. The gateway writes the sender mapping when it is the target, per the shared ARP receive rule. Stop: Where does this broadcast go, and what does the switch learn? The destination is the broadcast address. There is no single port for it. Every other port gets the same copy. The switch records the source MAC on the port where the frame arrived.
  4. ARP reply. Here is my MAC.. The gateway returns one unicast reply. The laptop writes the mapping when that reply arrives. The switch records the reply source on the arrival port. Stop: The reply names the gateway MAC. What is written, and in which table? The laptop writes the mapping when the reply arrives. That table is the ARP cache. The switch records the reply source on its arrival port. A lease is a different table.
  5. One frame. Two destinations.. The Ethernet destination is the gateway MAC. Inside, the IPv4 destination is still 203.0.113.80. Gateway receipt completes this first hop. Remote delivery is not simulated.

2. How the lease arrived

No lease yet. Watch DHCP, the address check, and why the announcements are sent.

  1. A link is not an address. The laptop has an Ethernet address, but no usable IPv4 configuration. This chapter gets the lease. Finding the gateway was chapter 1.
  2. DISCOVER. Is a server here?. The laptop broadcasts from 0.0.0.0. The switch sends the same copy out every other port. A router does not forward this broadcast.
  3. OFFER. You could use .23. The server proposes an address and settings. An offer is not permission for the laptop to start using that address.
  4. REQUEST. I choose this offer. The client broadcasts its requested address and selected server identifier. It still uses 0.0.0.0 as its source.
  5. ACK. Here is your lease. The server commits the lease before its ACK travels. Only receipt gives the laptop these settings. This client then checks for an address conflict.
  6. PROBE 1/3. Is .23 already in use?. ARP checks the proposed address before the laptop uses it. Sender IP is 0.0.0.0. Target IP is 192.0.2.23. The request is inside Ethernet, with no IP or UDP wrapper.
  7. PROBE 2/3. Is .23 already in use?. ARP checks the proposed address before the laptop uses it. Sender IP is 0.0.0.0. Target IP is 192.0.2.23. The request is inside Ethernet, with no IP or UDP wrapper.
  8. PROBE 3/3. Is .23 already in use?. ARP checks the proposed address before the laptop uses it. Sender IP is 0.0.0.0. Target IP is 192.0.2.23. The request is inside Ethernet, with no IP or UDP wrapper.
  9. No reply in the probe window. Listen through the final probe window. If no conflict appears, the laptop can announce the address. Playback compresses the randomized delays.
  10. ANNOUNCE 1/2. I am .23. The laptop sends this so the LAN can see which MAC uses 192.0.2.23. A host that already stored a different MAC for that IP updates its entry. A host with no entry does not have to create one. The switch records the laptop on the arrival port. The laptop may use the address after the first announcement.
  11. ANNOUNCE 2/2. I am .23. The laptop sends this so the LAN can see which MAC uses 192.0.2.23. A host that already stored a different MAC for that IP updates its entry. A host with no entry does not have to create one. The switch records the laptop on the arrival port. The laptop may use the address after the first announcement.
  12. The address is ready. The laptop may use 192.0.2.23. The announcements told the LAN which MAC uses it. Chapter 1 finds the gateway MAC.

Same lease, local peer

The laptop already has a lease. This time the destination is 192.0.2.42, on this LAN.

  1. The laptop already has a lease. Address 192.0.2.23 is usable. The ARP cache has no gateway MAC. Start there.
  2. Same subnet. Go directly.. 192.0.2.23 and 192.0.2.42 share the /24 subnet. The destination itself is the next hop.
  3. ARP. Who has 192.0.2.42?. The laptop broadcasts a request for peer 192.0.2.42. The IPv4 packet stays queued. The gateway writes the sender mapping when it is the target, per the shared ARP receive rule. Stop: Where does this broadcast go, and what does the switch learn? The destination is the broadcast address. There is no single port for it. Every other port gets the same copy. The switch records the source MAC on the port where the frame arrived.
  4. ARP reply. Here is my MAC.. The peer returns one unicast reply. The laptop writes the mapping when that reply arrives. The switch records the reply source on the arrival port. Stop: The reply names the peer MAC. What is written, and in which table? The laptop writes the mapping when the reply arrives. That table is the ARP cache. The switch records the reply source on its arrival port. A lease is a different table.
  5. One frame. Two destinations.. Ethernet and IPv4 both address the local peer, using different identifiers. Receipt at the peer completes this first hop.

Known MAC, empty switch table

The laptop already has the gateway MAC. The switch has not learned that port, so the unicast frame is flooded.

  1. The MAC is cached. The port is not.. The laptop ARP cache already has the gateway. The switch table is empty. The next frame is unicast, and the switch still floods it.
  2. Remote IP. Use the gateway.. 203.0.113.80 is outside 192.0.2.0/24. The next hop is gateway 192.0.2.1. The packet IP destination stays 203.0.113.80.
  3. The switch floods this frame.. The laptop sends one unicast frame to the gateway MAC. The IPv4 destination is still 203.0.113.80. The switch has no entry for that MAC, so it sends a copy of the frame out every port except the one where it arrived. Remote delivery is not simulated. Stop: The laptop knows the gateway MAC. The switch does not. Where does this frame go, and what does the switch learn? The switch has no port for that destination MAC. It floods the same copy out every other port. It still records the source MAC on the arrival port.

DHCP server does not answer

The link works, but the DHCP service sends no offer during this observation.

  1. A link is not an address. The laptop has an Ethernet address, but no usable IPv4 configuration. This chapter gets the lease. Finding the gateway was chapter 1.
  2. DISCOVER. Is a server here?. The laptop broadcasts from 0.0.0.0. The switch sends the same copy out every other port. A router does not forward this broadcast.
  3. No offer in this window. The physical link worked. No offer returned, so this new client has no DHCP lease. Real clients retry with backoff. This finite run stops before retries or another configuration.

Gateway does not answer ARP

The laptop has a lease. The gateway receives the query but sends no ARP reply.

  1. The laptop already has a lease. Address 192.0.2.23 is usable. The ARP cache has no gateway MAC. Start there.
  2. Remote IP. Use the gateway.. 203.0.113.80 is outside 192.0.2.0/24. The next hop is gateway 192.0.2.1. The packet IP destination stays 203.0.113.80.
  3. ARP. Who has 192.0.2.1?. The laptop broadcasts a request for gateway 192.0.2.1. The IPv4 packet stays queued. The gateway writes the sender mapping when it is the target, per the shared ARP receive rule. Stop: Where does this broadcast go, and what does the switch learn? The destination is the broadcast address. There is no single port for it. Every other port gets the same copy. The switch records the source MAC on the port where the frame arrived.
  4. A lease, but no next-hop MAC. The lease remains usable. No reply arrives in this window, so the laptop cache stays empty. The gateway can already have the laptop mapping from the request. Retries are outside this run.

Another device already uses .23

The peer already holds 192.0.2.23. The server offers that address to the laptop.

  1. A link is not an address. The laptop has an Ethernet address, but no usable IPv4 configuration. This chapter gets the lease. Finding the gateway was chapter 1.
  2. DISCOVER. Is a server here?. The laptop broadcasts from 0.0.0.0. The switch sends the same copy out every other port. A router does not forward this broadcast.
  3. OFFER. You could use .23. The server proposes an address and settings. An offer is not permission for the laptop to start using that address.
  4. REQUEST. I choose this offer. The client broadcasts its requested address and selected server identifier. It still uses 0.0.0.0 as its source.
  5. ACK. Here is your lease. The server commits the lease before its ACK travels. Only receipt gives the laptop these settings. This client then checks for an address conflict.
  6. PROBE 1/3. Is .23 already in use?. ARP checks the proposed address before the laptop uses it. Sender IP is 0.0.0.0. Target IP is 192.0.2.23. The request is inside Ethernet, with no IP or UDP wrapper.
  7. A reply exposes the collision. The peer says it already uses 192.0.2.23. On receipt, the laptop rejects the proposed address and cancels the remaining probes. Its first IPv4 packet stays unsent.
  8. DECLINE. Do not give me .23. The client reports the conflict. The server marks the address unavailable only when this message arrives. RFC 2131 says the client SHOULD wait a minimum of ten seconds before another start. This run stops here.

Send again with lease, cache, and ports

Start with a valid lease, the gateway ARP mapping, and learned switch ports.

  1. A second packet, less work. This laptop already has a valid lease, a gateway mapping, and learned switch ports. Predict which exchanges disappear.
  2. Remote IP. Use the gateway.. 203.0.113.80 is outside 192.0.2.0/24. The next hop is gateway 192.0.2.1. The packet IP destination stays 203.0.113.80.
  3. One frame. Two destinations.. The Ethernet destination is the gateway MAC. Inside, the IPv4 destination is still 203.0.113.80. Gateway receipt completes this first hop. Remote delivery is not simulated.

Try an unfamiliar case

You kept the lease, but the gateway’s ARP entry expired. What needs to happen again?

Compare your explanation

The laptop still has valid IPv4 settings. For an off-link destination it needs to resolve the gateway’s MAC again. That calls for ARP, without a new DHCP discovery. A switch’s learned port cannot fill the laptop’s missing ARP entry.

Read the lesson, check your judgment, and explore sources

Helpful first: Networks in one request: DNS, TCP, TLS, and HTTP

Key points

  • Distinguish an offered address, a server-committed lease, and a client address that has passed its initial conflict check.
  • Choose the ARP target for a local or remote IPv4 destination and explain the different Ethernet and IP destination fields.
  • Use a lease record, ARP cache, and switch forwarding table as separate evidence when diagnosing a stalled first packet.

Resolve the next hop, then wrap the packet.

The laptop already has a usable lease for 192.0.2.23/24. The subnet mask lets it distinguish an on-link destination from an off-link destination. For 192.0.2.42 on the same /24 network, the next hop is the peer itself. For remote 203.0.113.80, this example chooses the default gateway at 192.0.2.1. The laptop asks ARP for the chosen next hop, not for a MAC address somewhere across the Internet.

When the gateway replies, the laptop stores 192.0.2.1 at 02:00:00:00:00:01 in its ARP cache. The first IPv4 packet is then enclosed in an Ethernet frame addressed to that MAC. Inside the frame, its IP destination remains 203.0.113.80. Later router forwarding would create another link-layer frame. This run stops at first-hop receipt.

The switch maps each source MAC to its ingress port from frames it receives. Its forwarding table does not configure the client and does not fill the client’s ARP cache. In the guided ARP run, broadcast copies go to every other LAN port. The switch sends a later unicast frame only to the port where it learned the destination MAC. If the switch has no entry for the destination MAC, it floods the frame, even when the sender knows that MAC. The ARP workbench explores unknown unicast and independent host caches in more depth.

With a valid lease and a current ARP cache entry for the next hop, the laptop sends a later packet without repeating DISCOVER, OFFER, REQUEST, ACK, or ARP. Lease renewal is a separate exchange later in the lease. A valid lease with an expired ARP entry needs resolution again. If the gateway stays silent, the client can retain valid IPv4 settings while its packet remains queued.

A cable gives you a link. DHCP supplies configuration.

Before that lease existed, the laptop had an Ethernet MAC address and no usable IPv4 configuration. It broadcasts DHCPDISCOVER from 0.0.0.0, using UDP source port 68 and destination port 67. A server proposes 192.0.2.23 in DHCPOFFER. The client selects that offer with DHCPREQUEST. The server commits the lease and returns DHCPACK. The acronym DORA names those four message types.

An offer is a proposal. An ACK has different evidence boundaries: the server knows the lease it committed before the laptop receives the message. This example supplies a /24 subnet mask, gateway 192.0.2.1, DNS server 192.0.2.53, and a 3600-second lease. Receiving those settings does not prove that the gateway or DNS server is reachable.

The client in this example sets the DHCP BROADCAST flag, so the initial offers and ACKs also use Ethernet and IPv4 broadcast destinations. Clients able to receive unicast before configuration can use a different reply path. This lesson models one server on one Ethernet LAN, without a DHCP relay.

Check an address before using it.

This client follows RFC 5227 address conflict detection. It broadcasts three ARP probes with sender IPv4 address 0.0.0.0 and target IPv4 address 192.0.2.23. The zero sender address avoids claiming the proposed address prematurely. ARP travels directly in an Ethernet frame with EtherType 0x0806. It has no enclosing IPv4 or UDP header.

If a conflicting ARP response arrives, the laptop rejects the address and reports it with DHCPDECLINE. The server marks it unavailable when the report arrives. In the successful run, the probe window stays quiet. The laptop then sends two ARP announcements with sender and target IPv4 addresses both 192.0.2.23. It may use the address immediately after sending the first announcement.

The animation compresses randomized probe delays and the wait before announcement. Initial silence is a bounded check, not proof that a conflict can never occur. Real hosts also detect conflicts while using an address. Ordinary DHCP and ARP here provide no authenticated proof of device identity.

CHECK YOUR JUDGMENT

A laptop has a valid 192.0.2.23/24 lease and wants to send to 203.0.113.80. Its gateway is 192.0.2.1, but its ARP cache is empty. What must it resolve before sending the first Ethernet frame?

Put your learning to work ↗

Find your next idea.

Tip: press / to open search. Escape closes this window.