# Reproduce Full 802.1X NAC, RADIUS, DHCP DORA & DNS Onboarding

> **FrameAssembly v3.2.2** · Operational Playbook (IPv6, DDI & Campus NAC) · Canonical URL: https://frameassembly-lang.dev/use-cases/dhcp-dns-radius-nac-pcap

Trace every packet from plug-in to working network—EAPOL 0x888e, RADIUS UDP 1812, 4-step DHCPv4 DORA, DNS, and Stratum-1 NTP.

- **Category:** IPv6, DDI & Campus NAC
- **Capture Filename:** `campus_nac_dora.frasm` (12 Ethernet frames)
- **Protocols Exercised:** `eapol`, `vlan`, `radius`, `dhcp`, `dns`, `ntp`

## Operational Problem

"Branch laptops take 90 seconds to get on Wi-Fi/wired" spans four different teams—802.1X switch ports, RADIUS NAC servers, DHCP relays, and DNS/NTP—and nobody has a clean baseline capture showing the whole chain end to end.

Capturing a clean plug-in sequence on a live laptop is surprisingly messy: the OS blasts mDNS, LLMNR, WPAD, and cached TLS retries before DHCP even finishes, burying the 12 packets you actually care about.

With FrameAssembly, you can model the pre-IP `0.0.0.0` supplicant, the IEEE `01:80:c2:00:00:03` PAE multicast EAPOL handshake, the switch-to-ISE/ClearPass RADIUS exchange, all four DHCPv4 DORA frames (`68 <-> 67`), DNS resolution, and NTP clock sync in one crystal-clear capture.

## Scenario & Topology: Branch Port Gi1/0/8 Plug-In -> 802.1X Auth -> VLAN 30 DHCP Lease -> DNS + NTP

- **Topology:** `Supplicant PC (0.0.0.0 -> 10.30.0.142) <-> Access Switch (10.30.0.2) <-> Core DDI / RADIUS (10.30.0.10)`

Twelve surgical frames capture the textbook campus boot sequence: (1) `eapol start` + EAP-Identity `"corp\\jdoe"` (`0x888e`); (2) switch-to-AAA `radius accessrequest` <-> `accessaccept` on UDP 1812; (3) full 4-packet DHCPv4 `discover -> offer -> request -> ack` assigning `10.30.0.142/24` with Option 3 router and Option 6 DNS; and (4) internal `dns` A-record lookup + `ntp` Stratum-1 time sync.

## FrameAssembly Workflow

Builds 12 campus onboarding frames: 802.1X EAPOL Start/Identity, RADIUS Access-Request/Accept, 4-step DHCPv4 DORA, DNS, and NTP.

### Adapt It for Your Network

1. Adjust boot_pc MAC (`chaddr`), offered lease IP (`yiaddr 10.30.0.142`), `router`, and `dnsserver` to match your branch scope.
2. To test DHCP Snooping untrusted-port drops, replay the `dhcp offer` frame into an access port.
3. Compile -> inspect BOOTP magic cookie + options 1/3/6/12/51/53 in Wireshark -> use as a training or DDI test fixture.

## Runnable Capture Specification (`campus_nac_dora.frasm`)

```frameassembly
host boot_pc     { ip 0.0.0.0     mac 00:1b:21:30:01:42 }
host leased_pc   { ip 10.30.0.142 mac 00:1b:21:30:01:42 }
host access_sw   { ip 10.30.0.2   mac 00:1c:73:30:00:02 }
host ddi_aaa_srv { ip 10.30.0.10  mac 00:50:56:30:00:10 }

flow dot1x_and_radius_auth(supplicant, sw, aaa) {
    // 1. IEEE 802.1X EAPOL Start + EAP Identity Response on PAE group MAC
    supplicant -> sw eapol start version 2 wait 2ms
    supplicant -> sw eapol eappacket version 2 eapcode 2 eapid 1 eapmethod 1 identity "corp\\jdoe" wait 3ms

    // 2. Switch relays credentials to RADIUS server (UDP 1812)
    sw -> aaa vlan 30 radius accessrequest id 77 user "corp\\jdoe" nasip 10.30.0.2 wait 4ms
    sw <- aaa vlan 30 radius accessaccept id 77 wait 2ms
}

flow dhcp_dora_dns_and_ntp(unconf_pc, ready_pc, infra) {
    // 3. Full 4-packet DHCPv4 DORA lease negotiation (UDP 68 <-> 67)
    unconf_pc -> infra vlan 30 dhcp discover xid 0x30014200 chaddr 00:1b:21:30:01:42 hostname "branch-lt-42" wait 2ms
    unconf_pc <- infra vlan 30 dhcp offer xid 0x30014200 yiaddr 10.30.0.142 siaddr 10.30.0.10 chaddr 00:1b:21:30:01:42 subnetmask 255.255.255.0 router 10.30.0.1 dnsserver 10.30.0.10 leasetime 28800 wait 2ms
    unconf_pc -> infra vlan 30 dhcp request xid 0x30014200 chaddr 00:1b:21:30:01:42 hostname "branch-lt-42" wait 1ms
    unconf_pc <- infra vlan 30 dhcp ack xid 0x30014200 yiaddr 10.30.0.142 siaddr 10.30.0.10 chaddr 00:1b:21:30:01:42 subnetmask 255.255.255.0 router 10.30.0.1 dnsserver 10.30.0.10 leasetime 28800 wait 5ms

    // 4. Post-lease split-horizon DNS lookup + Stratum-1 NTP clock sync
    ready_pc -> infra vlan 30 dns query txid 0x8801 qname "intranet.corp.example" qtype "A" wait 2ms
    ready_pc <- infra vlan 30 dns response txid 0x8801 qname "intranet.corp.example" qtype "A" rdata "10.30.20.80" wait 3ms
    ready_pc -> infra vlan 30 ntp vn 4 mode 3 poll 6 wait 2ms
    ready_pc <- infra vlan 30 ntp li 0 vn 4 mode 4 stratum 1 poll 6 refid "GPS" wait 1ms
}

compile {
    dot1x_and_radius_auth(boot_pc, access_sw, ddi_aaa_srv)
    dhcp_dora_dns_and_ntp(boot_pc, leased_pc, ddi_aaa_srv)
}
```

## Equivalent CLI Commands

```bash
# 1. Preview the 12-step 802.1X -> RADIUS -> DHCP DORA -> DNS -> NTP ladder
frameassembly show campus_nac_dora.frasm

# 2. Compile to .pcap and inspect EAPOL, RADIUS, DHCP options, DNS, and NTP in tshark
frameassembly campus_nac_dora.frasm campus_nac_dora.pcap
tshark -r campus_nac_dora.pcap

# 3. Replay into DDI / NAC lab interfaces or Wireshark training sessions
sudo tcpreplay -i eth0 campus_nac_dora.pcap
```

## Protocol Reference Links

- [`eapol` — IEEE 802.1X Port-Based Network Access Control (EAP over LAN)](https://frameassembly-lang.dev/docs/protocols/eapol) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/eapol.md))
- [`vlan` — IEEE 802.1Q Virtual LAN Tagging & 802.1p QoS](https://frameassembly-lang.dev/docs/protocols/vlan) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/vlan.md))
- [`radius` — Remote Authentication Dial-In User Service (Auth & Accounting)](https://frameassembly-lang.dev/docs/protocols/radius) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/radius.md))
- [`dhcp` — Dynamic Host Configuration Protocol — DHCPv4 & DHCPv6](https://frameassembly-lang.dev/docs/protocols/dhcp) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/dhcp.md))
- [`dns` — Domain Name System over UDP or TCP](https://frameassembly-lang.dev/docs/protocols/dns) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/dns.md))
- [`ntp` — Network Time Protocol v1–v4](https://frameassembly-lang.dev/docs/protocols/ntp) ([Raw .md](https://frameassembly-lang.dev/docs/protocols/ntp.md))
