◉ETESALWI-FI × MOBILE CORE
Offline edition received ✓A learning notebook · Moallemفارسی ↗
NETWORK NOTEBOOK / 06

UNDERSTAND THE PROBLEM FIRST

From AP to tunnel: DHCP, routing, NAT and MTU along the packet path

Foundations first · Bilingual · Examples and practice

Course map · Authentication · فارسی

1. Why return to IP after authentication?

A handset shows Wi-Fi connectivity, yet operator service fails. The previous lesson explained how credentials constrain authentication methods. Now ask how those method messages reach a gateway at all. Correct subscription secrets cannot repair a missing IP route or failed DNS.

Objective: identify a packet's IP destination, local next hop, NAT changes and tunnel encapsulation, then request evidence appropriate to a failure. This lesson prepares for ePDG/N3IWF procedures rather than covering every WLAN mode.

Diagnostic: must the AP be the default gateway? Does DHCPACK prove mobile subscription authentication? Whose MAC is needed for an off-subnet destination? If unsure, work through the example without skipping steps.

2. One home appliance, several roles

An Access Point (AP) provides a station's 802.11 access to the distribution system. In this lesson's example it bridges user traffic into a LAN; it need not make IP routing decisions. A bridge forwards layer-2 frames using MAC/VLAN information. A router forwards packets between IP networks using routes. One home appliance may combine those roles with DHCP server, DNS forwarder and NAT. Physical co-location does not merge their responsibilities.

A MAC address addresses an interface at layer 2; an SSID names the advertised Wi-Fi network. A VLAN logically separates a layer-2 network. Sharing an SSID does not guarantee sharing a VLAN: policy may determine assignment. An Ethernet VLAN tag is not necessarily visible in the same form over the radio link. See the official IEEE 802.1Q-2022 overview for bridges/VLANs. This role model does not specify all 802.11 frame formats.

Underlying IP path through AP and router, with a separate inner service packet carried to the operator gateway

Original diagram. The upper path provides underlying connectivity; the lower path shows a service packet carried through it. AP, router and operator gateway are separate roles.

3. What does DHCP provide?

Basic IPv4 startup needs an address, prefix, route and resolver settings. A prefix identifies the network portion: /24 specifies 24 leading network bits. Section 5 explains the resolver. DHCP automates configuration distribution; a lease is an address assignment for a period. Receiving DHCP configuration does not itself verify a mobile subscription.

A fresh allocation commonly follows:

Client                  DHCP server (possibly through a relay)
  DHCPDISCOVER  ────────▶   find configuration service
                ◀──────  DHCPOFFER
  DHCPREQUEST   ────────▶   select/request offered configuration
                ◀──────  DHCPACK

A relay transfers DHCP messages between the client subnet and server, so the server need not reside beside the AP. These four messages are not every DHCP case: lease reuse and renewal can follow other paths. See RFC 2131 §§3.1, 4.4 for messages/states.

Our invented example accepts:

Wi-Fi IPv4:     192.168.50.23/24
Default router: 192.168.50.1
DNS resolver:   192.168.50.1

Router and DNS options are specified in RFC 2132 §§3.5, 3.8. An address without an appropriate route is insufficient. A route does not guarantee a correct DNS answer or an available operator gateway.

Secure enterprise WLAN normally authorizes its port and establishes link security before ordinary user IP traffic. Home Wi-Fi may provide local Internet before separate operator authentication. Do not combine those authentication stages. A retained lease also means a new capture need not contain the full four-message exchange.

4. The destination is remote: why resolve the router?

Suppose an application targets 203.0.113.80. This and all public-looking example addresses come from the documentation ranges in RFC 5737, not real test destinations. A route lookup determines that it is outside 192.168.50.0/24, so the host chooses its default route.

The next hop is the next forwarding participant, here 192.168.50.1. The host reads the router's IPv4-to-MAC mapping from its cache (temporarily retained mappings) or resolves it with ARP, then hands the remote-destination IP packet to that next hop through the appropriate link framing. Infrastructure Wi-Fi also involves the AP in radio delivery; do not equate all 802.11 address fields with a two-address Ethernet frame.

The IP destination remains 203.0.113.80, while the layer-2 neighbor for this route is the router. The host does not ARP for the remote server on its LAN. A valid cached mapping can eliminate a fresh ARP exchange, so missing ARP traffic alone is not failure evidence. RFC 826 defines address resolution; routing, not ARP itself, chooses the next hop. See RFC 1122 §3.3.1 for local-versus-gateway delivery decisions.

5. From local Internet to the operator tunnel

A DNS resolver obtains connection information such as destination addresses from names. DNS resolution does not establish a tunnel; RFC 1034 §5 explains resolvers. Operator gateway discovery depends on the mobile profile and is reserved for the ePDG lesson. Here assume the gateway address 203.0.113.10 has been obtained appropriately.

The underlay is the underlying IP connectivity reaching the gateway. An inner packet is the service packet carried through a tunnel. In this educational IPv4/IPsec tunnel-mode case, successful procedures can give the device another, inner address. Keep it separate from its Wi-Fi address:

Wi-Fi address: 192.168.50.23        reaches the gateway through the LAN
Inner address: 10.60.0.7           belongs to the selected service session

Inner IP: 10.60.0.7 → 198.51.100.80
          placed inside ESP protection
Outer IP: 192.168.50.23 → 203.0.113.10
          may be translated by access NAT

With ESP, IPsec's data-protection protocol, the outer header delivers the packet to the tunnel peer while the inner packet receives SA-selected protection. An IPsec Security Association (SA) contains security parameters and keys for one direction. See RFC 4303 §3.1.2 for tunnel-mode processing.

The home router forwards toward the outer destination without needing to verify a USIM identity. Following valid processing, the tunnel gateway recovers the inner packet for onward forwarding. Core-side delivery still needs the architecture's session and policy; ESP decapsulation alone does not establish an entire service.

6. What changes at NAT?

NAPT maps addresses and ports so multiple hosts can share an external address. Follow this invented NAT-T mapping:

Observation point Outer source Outer destination
Before NAT 192.168.50.23:4500 203.0.113.10:4500
After NAT 198.51.100.20:62000 203.0.113.10:4500
Reply arriving at NAT 203.0.113.10:4500 198.51.100.20:62000
Reply delivered to handset 203.0.113.10:4500 192.168.50.23:4500

Port 62000 is illustrative, not mandated. Return mapping state can expire or be lost and disrupt delivery. The encrypted inner packet in this example is not rewritten to the NAT's public address. The traditional NAPT description in RFC 3022 §2.2 is Informational, not a mobile identity standard.

IKE negotiates and manages IPsec security associations. NAT-T supports IPsec carriage through NAT. In this common path, UDP encapsulates ESP; IKE over UDP 4500 has a four-zero-byte prefix distinguishing it from ESP. Seeing UDP 4500 alone does not identify an IKE message versus ESP data. Read the format in RFC 3948 §2 and NAT detection/IKE rules in RFC 7296 §2.23. Successful web access over TCP 443 does not demonstrate this path works.

7. Why do small packets work while large transfers stall?

MTU is a link's maximum packet size; Path MTU is the smallest limit along a path. A tunnel adds headers and protection overhead, leaving less room for the inner packet.

Illustrative arithmetic only: an outer Path MTU of 1500 bytes and total encapsulation cost of 80 bytes gives an inner limit of 1500 − 80 = 1420 bytes. Under those assumptions, a 1400-byte inner packet fits; a 1450-byte one does not. Eighty bytes is not a universal IPsec constant: IP version, algorithm, padding and UDP encapsulation matter. Determine actual overhead from the selected profile and capture.

In IPv6, ICMPv6 Packet Too Big feedback helps the sender adjust size; intermediate routers do not fragment IPv6 packets. Blocking feedback can disrupt discovery. See RFC 8201 §§3–4. Small/large differences are clues, not definitive proof of an MTU fault. This lesson does not prescribe a production MTU for any product.

8. IPv6 is not IPv4 with ARP renamed

IPv6 Neighbor Discovery uses ICMPv6, including NS/NA for neighbors and RS/RA for router discovery. It is not ARP carried over IPv6. Router Advertisements supply default-router discovery; an IPv6 address alone does not prove a default route exists. See RFC 4861 §§4, 6. IPv6 address and DNS provisioning have separate branches; do not copy the DHCPv4 sequence unchanged.

9. Worked diagnosis with explicit evidence boundaries

Here a CHILD_SA is a pair of unidirectional data SAs managed by IKE; an initial IKE response alone does not establish it. A tuple is a set of flow-identifying fields such as endpoint addresses and ports.

Invented observations: the handset has a lease; gateway DNS resolution returned; a router-egress capture shows IKE_SA_INIT; no reply appears in the handset capture.

  1. DHCP/DNS evidence supports configuration and resolution, not successful AKA or tunnel establishment.
  2. Router egress does not prove arrival at the ePDG. Record capture locations and time coverage.
  3. Next request a gateway-side capture and firewall/NAT counters in both directions. A WAN reply missing on the LAN prioritizes return forwarding and local mapping checks.
  4. Replacing USIM secrets is not justified by these observations: the exchange may not have reached authentication at all.

Contrast: an established CHILD_SA and successful small packets, with stalled large transfers, calls for size/ICMP/MTU evidence. It is a different failure from receiving no IKE response.

Plan capture questions rather than relying only on a protocol-name filter:

Question Evidence needed
Which VLAN has the configuration? Lease, prefix, VLAN and capture location
Is the next hop reachable? Route/neighbor tables, ARP or ND if needed
Is the right name resolved? Query, answer, resolver and response lifetime
Where do tunnel requests/replies disappear? Tuples before/after NAT and captures at both ends
Does size matter? Packet lengths, overhead, MTU feedback and bidirectional capture

10. Practice and continuation criterion

  1. The AP only bridges; the router is 192.168.50.1. Why not obtain the remote server's MAC from this LAN?
  2. DHCPACK arrives but the default route is wrong. What succeeded and what remains broken?
  3. Where does the NAT-table reply go from the Internet's perspective? From the handset's perspective?
  4. Must a changed NAT external address also change inner address 10.60.0.7? Explain.
  5. With outer Path MTU 1492 and assumed overhead 72 bytes, what is the inner limit? Does a 1430-byte packet fit?
  6. IPv6 has an address but no valid RA. Why might Internet access still be unavailable?
  7. You see UDP 4500. What distinguishes IKE from ESP in this carriage?
  8. Web works, but IKE receives no response. Choose two next observations; why not yet blame subscription secrets?
Reveal answers after your attempt
  1. The destination is off-subnet, so routing chooses the router as next hop. Layer-2 resolution is for that hop, not the remote server. If you treated ARP as a way to find any Internet destination, redo §4 with a different subnet.
  2. The configuration-allocation exchange completed, but correct route installation/selection did not. DHCPACK proves neither end-to-end delivery nor operator authentication.
  3. The Internet reply targets 198.51.100.20:62000; NAT delivers it to 192.168.50.23:4500. The reply source remains gateway 203.0.113.10:4500 in this example.
  4. No; outer and inner addresses belong to different contexts. A mapping/path change can disrupt the tunnel, so do not promise continuity without appropriate procedures. NAT does not logically require an inner-address change.
  5. 1492 − 72 = 1420 bytes; a 1430-byte inner packet is ten bytes too large. This result depends on the assumed overhead and Path MTU.
  6. Having an address does not create a default router. Inspect RA and route/neighbor state. Static configuration can supply a route, so missing RA alone is not a universal diagnosis.
  7. In this common carriage, IKE has a four-zero-byte Non-ESP Marker before its header; ESP starts with a nonzero SPI. Do not automatically classify truncated captures or other payloads as IKE.
  8. Compare requests/replies at WAN egress and the gateway, together with NAT mapping and firewall counters. TCP web success does not prove UDP/IKE delivery; nothing yet proves the server reached credential verification.

Repair task: change the host to 192.168.70.12/24 and router to 192.168.70.1. Write the remote destination and post-NAT outer tuple separately. Explain which addresses might change during Wi-Fi movement and what additional evidence would establish tunnel continuity.

Continue to detailed ePDG procedures when you can separate destination from next hop, reconstruct NAT tuples and explain MTU arithmetic with its assumptions without looking. If addresses become mixed, repeat §§4–6 with new values. After a day, redraw the inner/outer packet structure from memory.

References and scope

Sources checked 2026-10-17. Scenarios, addresses and arithmetic are original educational examples, not real-network execution or product conformance evidence. Linked RFCs establish the mechanisms discussed; they are not a complete deployment profile or collection of all updates. Read normative requirements in each protocol document rather than interpreting instructional choices as requirements.

Next we build on this foundation with ePDG discovery, IKE_SA_INIT, IKE_AUTH and CHILD_SA establishment. Revisit the message lab for observation versus inference.