esp32-ethernet-tester
A bench tool for stress-testing and validating Ethernet switch ports
0
Project description
ESP32 Ethernet Tester β A Full L1βL3 Network Assessment Bench in Your Pocket, Powered by W5500 MACRAW
#W5500 #MACRAW #ESP32S3 #NetworkTesting #RFC2544 #802.1X #PenTest #RawEthernet #PoE #PortValidation
π Context: Professional bench tool β built and tuned against a real Aruba CX6300 enterprise switch. Verified: MACRAW socket-0 driver, raw-TX path, and a full custom ARP/IP/UDP/ICMP stack are all confirmed at code level.
01 β What is this project?
Validating and stress-testing enterprise Ethernet switch ports usually means a rack of expensive gear β a dedicated traffic generator for RFC 2544, a protocol analyzer for LLDP/CDP, a separate box for 802.1X supplicant testing, and yet another for security assessment. It is heavy, wired to a bench, and far out of reach for most field engineers.
ESP32 Ethernet Tester collapses all of that into a single PoE-powered board that fits in one hand. An ESP32-S3 drives a WIZnet W5500 in raw MAC (MACRAW) mode, giving the firmware complete control over every byte placed on the wire. On top of that raw layer sits a deliberately minimal, purpose-built IPv4 stack (ARP / IP / UDP / ICMP) β the W5500's hardware TCP/IP engine is intentionally bypassed so nothing filters or normalizes the frames.
The result is a genuinely comprehensive network bench: RFC 2544 throughput/latency/frame-loss benchmarking, LLDP/CDP discovery and advertisement, seven DHCP failure scenarios, a full 802.1X/EAP supplicant (MD5/TLS/PEAP/TTLS), SNMP recon, TCP SYN port scanning with banner grab for 30+ services, an L2 attack suite (VLAN hopping, STP root claim, CAM flood), FHRP hijack testing, DHCPv6, WireGuard VPN management, OTA updates, PCAP capture to SD, and a cron-driven scripting engine β all controllable over a serial CLI or a tabbed Wi-Fi web UI.
02 β Why raw-frame testing?
π· Full control of the wire
A conventional NIC (or a hardware-offloaded TCP/IP chip) silently handles addressing, checksums, retransmission and framing for you. That is exactly what you do not want in a network tester. To inject giant frames, PAUSE frames, malformed DHCP DISCOVERs, spoofed BPDUs or forged HSRP advertisements, the firmware needs to build the entire Ethernet frame itself and hand it to the PHY untouched. Raw MAC access is the only way to do this.
π· One PHY, every layer
Because the tester owns the raw frame, a single device can operate at L1 (PHY speed/duplex forcing), L2 (VLAN/STP/LLDP/CDP/ARP), and L3 (its own IP/UDP/ICMP stack) β no separate tools per layer. Discovery, injection, benchmarking and security assessment all run through the same raw pipe.
π· WIZnet ecosystem fit
Among WIZnet's line, the W5500's MACRAW mode is the natural choice for this class of tool. Its hardened SPI interface and the well-documented Sn_MR_MACRAW socket mode give a clean, deterministic raw-frame path over a short onboard PCB trace β far simpler and more robust than bit-banging a discrete PHY (e.g. an ENC28J60) or wrestling with the RMII timing of a LAN8742A. For a battery/PoE-powered handheld, that integration density is decisive.
03 β System architecture

Every functional module β from the RFC 2544 benchmark suite to the rogue 802.1X authenticator β ultimately calls a single primitive: W5500Raw::sendFrame(). That one code path is what makes the whole architecture coherent.
04 β Why W5500? β
π· The technical core: MACRAW gives raw L2 access with hardware reliability
The entire project is built on one capability: the ability to put an arbitrary Ethernet frame on the wire and to receive every frame back, unfiltered. The W5500 delivers exactly this through its MACRAW socket mode.
π· Mode used: MACRAW (Sn_MR_MACRAW, Sn_MR = 0x04) β verified in code
This is not inferred β it is confirmed directly in src/w5500_raw.cpp:
- Socket 0 is opened with
_writeReg8(Sn_MR, BSB_S0_REG, Sn_MR_MACRAW)and the code verifies the socket status register readsSOCK_MACRAW. - MAC filtering is deliberately disabled so the tester receives all frames on the segment (essential for passive recon, PCAP capture and protocol decode).
- On RX, the firmware correctly handles the 2-byte length prefix the W5500 prepends to each received MACRAW frame.
- On TX,
sendFrame()writes the frame into the socket TX buffer, advancesSn_TX_WR, and issuesSn_CR_SENDβ a textbook raw transmit path.
Crucially, the W5500's hardware TCP/IP engine is bypassed entirely. The custom IpStack (src/ip_stack.cpp) builds ARP, IPv4, UDP and ICMP by hand and pushes each one through _eth.sendFrame(). This is the defining design decision: it preserves total raw-frame control while still enabling L3/DHCP testing.
π· Advantage over alternatives
- vs. ENC28J60: the W5500 offers a far more robust, well-abstracted SPI register interface and reliable MACRAW behavior, avoiding the notorious errata and manual buffer bookkeeping of the ENC28J60.
- vs. RMII PHYs (LAN8742A etc.): no RMII clock/timing headaches, no dependence on the ESP32's EMAC β just a clean SPI bus, which frees the internal MAC and simplifies a PoE handheld design.
- vs. using the W5500's own TCP/IP offload: offload would defeat the purpose; MACRAW is precisely why W5500 fits a tester rather than a client.
π· Verified evidence β
- β
MACRAW socket-0 configuration confirmed in
w5500_raw.cpp. - β
Raw TX path (
Sn_TX_WR+Sn_CR_SEND) confirmed. - β
Custom IP stack routing all frames through
sendFrame()confirmed inip_stack.cpp. - β Built and tuned against a real Aruba CX6300 (per README).
- β Honest, hardware-accurate documentation of MACRAW limits (FCS auto-append prevents true CRC-error and runt injection) β a mark of an author who actually ran this on silicon.
05 β Key components
π WIZnet W5500 β MACRAW mode (raw L2 engine)
The heart of the tool. Runs on a Waveshare ESP32-S3-POE-ETH board where the W5500 is onboard and PoE-capable, connected over FSPI at 8 MHz (headroom to push toward 40 MHz on the short traces). All raw TX/RX, error injection, and the custom IP stack sit on top of it.
π§ ESP32-S3 (Waveshare ESP32-S3-POE-ETH)
16 MB flash, 8 MB PSRAM, USB-C. Hosts the CLI parser, the ESPAsyncWebServer tabbed UI, mbedTLS for EAP-TLS/PEAP/TTLS, NVS persistence, and a dual-OTA partition scheme.
π§ Custom minimal IPv4 stack
ARP (with cache) + IPv4 + UDP + ICMP, hand-built over MACRAW. Enables ping, DHCP DORA, DNS, SNMP and port scanning β without touching the W5500's hardware stack.
π‘ Protocol & security suites
RFC 2544, LLDP/CDP (decode + advertise), 802.1X supplicant + rogue authenticator (hashcat-5500 output), DHCP/DHCPv6 scenarios, FHRP (HSRP/VRRP) assessment, L2 attack suite, SNMP recon, TCP SYN scanner with 30+ service banner probes.
πΎ Field-ready infrastructure
Wi-Fi STA/AP web UI, HTTPS + basic-auth, WireGuard tunnel for remote management, SD-card PCAP/log/script storage, cron scheduler, TFTP/HTTP OTA.
06 β Application scenarios
01. Enterprise switch-port commissioning
Before handing a new switch to production, an engineer plugs in the tester, runs test all for RFC 2544 numbers, confirms LLDP neighbor data, verifies DHCP behavior, and validates 802.1X enforcement β all from one handheld.
02. Field troubleshooting without a laptop
PoE-powered and web-driven, the tester can be dropped on a remote port and reached over Wi-Fi (or WireGuard back to HQ), with results logged to SD and scheduled via cron for unattended overnight checks.
03. Authorized network security assessment
In armed mode, a pentester exercises ARP MITM, STP root claims, VLAN hopping, rogue DHCP/DHCPv6/DNS, FHRP hijack and a rogue 802.1X authenticator to validate that the network's hardening (DHCP snooping, Root Guard, DAI, 802.1X, FHRP auth) actually holds.
04. Protocol education & lab work
Because every frame is built by hand, the codebase is a living reference for how LLDP, CDP, HSRP, VRRP, EAP, DHCP and MS-CHAPv2 actually look on the wire β a genuinely instructive MACRAW project.
Conclusion
A single hand-sized, PoE-powered board turns the W5500's MACRAW mode into a full L1βL3 network test-and-assessment bench that was previously the domain of rack-mounted, five-figure instruments.
- β Complete raw-frame control via W5500 MACRAW (verified in source)
- β Custom ARP/IP/UDP/ICMP stack layered over raw L2 β hardware TCP/IP intentionally bypassed
- β RFC 2544 benchmark suite (throughput/latency/loss/back-to-back)
- β Full 802.1X/EAP supplicant + rogue authenticator with hashcat output
- β Deep L2/L3 security assessment toolkit (VLAN/STP/ARP/FHRP/DHCP/DNS/SNMP)
- β Tabbed Wi-Fi web UI + serial CLI + scripting/cron automation
- β Field-grade infra: PoE, HTTPS, WireGuard, SD PCAP/logs, OTA
- β Validated against real enterprise hardware (Aruba CX6300)
- β Honest documentation of MACRAW hardware limits β engineering integrity
Q&A
Q. Which W5500 socket mode does this use, and why not the hardware TCP/IP stack? It uses MACRAW (Sn_MR_MACRAW) on socket 0 with MAC filtering off. A network tester must control and observe every byte on the wire, so the hardware TCP/IP offload is deliberately bypassed and a custom lightweight IP stack is built on top of the raw frames instead.
Q. Why can't it inject true CRC-error or runt frames? In MACRAW mode the W5500 always computes and appends a valid 4-byte FCS and auto-pads short frames to the 60-byte minimum. So corrupted-CRC and sub-64-byte runt frames can't leave the wire β a genuine hardware behavior the author documents honestly rather than hiding.
Q. Is the raw-frame path actually implemented, or is it just claimed? Confirmed in src/w5500_raw.cpp: sendFrame() writes to the socket TX buffer, advances Sn_TX_WR, and issues Sn_CR_SEND; every higher-level module (RFC 2544, injection, IP stack) routes through this one primitive.
Q. What board does it run on? A Waveshare ESP32-S3-POE-ETH with an onboard, PoE-capable W5500 over FSPI at 8 MHz β no external Ethernet wiring required.
[νκΈ λ²μ ] ESP32 Ethernet Tester β W5500 MACRAWλ‘ κ΅¬νν, μλ°λ₯ μμ L1βL3 λ€νΈμν¬ μ§λ¨ λ²€μΉ
#W5500 #MACRAW #ESP32S3 #NetworkTesting #RFC2544 #802.1X #PenTest #RawEthernet #PoE #PortValidation
π 컨ν μ€νΈ: μ€μ Aruba CX6300 μν°νλΌμ΄μ¦ μ€μμΉλ₯Ό μλλ‘ μ μΒ·νλν μ λ¬Έκ°μ© λ²€μΉ ν΄. κ²μ¦λ¨: MACRAW μμΌ 0 λλΌμ΄λ², raw-TX κ²½λ‘, 컀μ€ν ARP/IP/UDP/ICMP μ€νμ λͺ¨λ μ½λ λ 벨μμ νμΈ.
01 β μ΄ νλ‘μ νΈλ 무μμΈκ°?
μν°νλΌμ΄μ¦ μ΄λλ· μ€μμΉ ν¬νΈλ₯Ό κ²μ¦νκ³ μ€νΈλ μ€ ν μ€νΈνλ €λ©΄ λ³΄ν΅ κ°λΉμΌ μ₯λΉ λμ΄ νμνλ€. RFC 2544μ© μ μ© νΈλν½ μ λλ μ΄ν°, LLDP/CDP λΆμμ© νλ‘ν μ½ μ λλΌμ΄μ , 802.1X μνλ¦¬μ»¨νΈ ν μ€νΈμ© λ³λ μ₯λΉ, 보μ νκ°μ© λ λ€λ₯Έ μ₯λΉκΉμ§. 무κ²κ³ , λ²€μΉμ λ¬Άμ¬ μκ³ , νμ₯ μμ§λμ΄μκ²λ μ¬μ€μ μμ΄ λΏμ§ μλλ€.
ESP32 Ethernet Testerλ μ΄ λͺ¨λ κ²μ PoEλ‘ κ΅¬λλλ μλ°λ₯λ§ ν 보λ νλλ‘ μμΆνλ€. ESP32-S3κ° WIZnet W5500μ raw MAC(MACRAW) λͺ¨λλ‘ κ΅¬λνμ¬, νμ¨μ΄κ° νμ μμ μ¬λΌκ°λ λͺ¨λ λ°μ΄νΈλ₯Ό μμ ν μ μ΄νλ€. κ·Έ raw λ μ΄μ΄ μμλ μλμ μΌλ‘ μ΅μνν μ μ© IPv4 μ€ν(ARP / IP / UDP / ICMP)μ΄ μΉν μλ€ β W5500μ νλμ¨μ΄ TCP/IP μμ§μ μΌλΆλ¬ μ°νν΄μ, νλ μμ νν°λ§νκ±°λ μ κ·ννλ μμκ° νλλ μλλ‘ λ§λ€μλ€.
κ·Έ κ²°κ³Όλ¬Όμ μ§μ ν μλ―Έμ μ’ ν© λ€νΈμν¬ λ²€μΉλ€. RFC 2544 μ²λ¦¬λ/μ§μ°/νλ μμμ€ λ²€μΉλ§νΉ, LLDP/CDP λμ€μ»€λ²λ¦¬ λ° κ΄κ³ , 7κ°μ§ DHCP μ€ν¨ μλ리μ€, μμ ν 802.1X/EAP μν리컨νΈ(MD5/TLS/PEAP/TTLS), SNMP μ μ°°, 30μ’ μ΄μ μλΉμ€ λ°°λ κ·Έλ©μ΄ κ°λ₯ν TCP SYN ν¬νΈ μ€μΊ, L2 곡격 μ€μνΈ(VLAN νν, STP λ£¨νΈ νμ·¨, CAM νλ¬λ©), FHRP νμ΄μ¬νΉ ν μ€νΈ, DHCPv6, WireGuard VPN κ΄λ¦¬, OTA μ λ°μ΄νΈ, SD μΉ΄λ PCAP μΊ‘μ², cron κΈ°λ° μ€ν¬λ¦½ν μμ§κΉμ§ β μ΄ μ λΆλ₯Ό μλ¦¬μΌ CLI λλ ν λ°©μ Wi-Fi μΉ UIλ‘ μ μ΄νλ€.
RFC2544 μ±λ₯ ν μ€νΈ β μ²λ¦¬λ(무μμ€ μ΅λ μ μ‘λ₯ ), μ§μ°(μ΅μ/μ΅λ/νκ· RTT), back-to-back(무μμ€ μ΅λ μ°μ λ²μ€νΈ)μ μΈ‘μ . μ€μμΉ ν¬νΈμ μμ μ±λ₯ μμΉλ₯Ό λ½λ νμ€ λ²€μΉλ§ν¬.
μλ¬ νλ μ μ£Όμ ν μ€νΈ β runt(64λ°μ΄νΈ λ―Έλ§), giant, jumbo, broadcast, multicast λ± λΉμ μΒ·λλ νλ μμ μ£Όμ ν΄ ν¬νΈκ° μ΄λ»κ² μ²λ¦¬νλμ§ μν.
LLDP/CDP λμ€μ»€λ²λ¦¬ β μ΄μ μ₯λΉκ° κ΄κ³ νλ μ 보(ν¬νΈ ID, VLAN, κ΄λ¦¬ IP λ±)λ₯Ό μμ Β·λμ½λ. λ°λλ‘ μμ μ μ 보λ₯Ό κ΄κ³ νλ ν μ€νΈλ κ°λ₯.
DHCP μλλ¦¬μ€ ν μ€νΈ β μ μ DORA νλλΏ μλλΌ μ¬λ¬ μ€ν¨/μ΄μ μλ리μ€λ₯Ό κ²μ¦. DHCPv6λ ν¬ν¨.
802.1X / EAP μΈμ¦ ν μ€νΈ β MD5, TLS, PEAP, TTLS λ°©μμ μνλ¦¬μ»¨νΈ μΈμ¦μ μλ. ν¬νΈμ 802.1X κ°μ μ¬λΆ κ²μ¦.
ν¬νΈ μ€μΊ & λ°°λ κ·Έλ© β TCP SYN μ€μΊμΌλ‘ μ΄λ¦° ν¬νΈλ₯Ό μ°Ύκ³ , 30μ’ μ΄μ μλΉμ€μ λ°°λ μ 보λ₯Ό μμ§.
SNMP μ μ°° β SNMPλ‘ λμ μ₯λΉμ μ 보λ₯Ό μμ§.
L2 곡격 ν μ€νΈ β VLAN νν, STP λ£¨νΈ ν΄λ μ, CAM ν μ΄λΈ νλ¬λ© λ± L2 κ³μΈ΅ 곡격μ ν΅ν΄ μ€μμΉμ λ°©μ΄ μ€μ μ΄ μ€μ λ‘ μλνλμ§ κ²μ¦.
FHRP νμ΄μ¬νΉ ν μ€νΈ β HSRP/VRRP κ°μ κ²μ΄νΈμ¨μ΄ μ΄μ€ν νλ‘ν μ½μ λν νμ·¨ μλ.
κΈ°λ³Έ L3 μ§λ¨ β ping(ICMP), DNS μ‘°ν λ± μ»€μ€ν IP μ€ν κΈ°λ°μ κΈ°λ³Έ λ€νΈμν¬ λλ¬μ± νμΈ.
ν¬κ² 보면 μ±λ₯ μΈ‘μ (RFC2544), μ€νΈλ μ€/μλ¬ μ£Όμ , νλ‘ν μ½ λμ€μ»€λ²λ¦¬(LLDP/CDP), μΈμ¦Β·DHCP κ²μ¦(802.1X/DHCP), 보μ νκ°(ν¬νΈμ€μΊΒ·L2곡격·FHRPΒ·SNMP) λ€μ― κ°λλ‘ λλλ€κ³ 보면 λΌ.
02 β μ raw-frame ν μ€ν μΈκ°?
π· νμ μ μμ ν μ μ΄κΆ
μΌλ°μ μΈ NIC(λλ νλμ¨μ΄ μ€νλ‘λ TCP/IP μΉ©)λ μ£Όμ μ²λ¦¬, 체ν¬μ¬, μ¬μ μ‘, νλ μ΄λ°μ μμμ μ²λ¦¬ν΄μ€λ€. κ·Έλ°λ° λ€νΈμν¬ ν μ€ν°μμλ λ°λ‘ κ·Έκ²μ΄ νλ©΄ μ λλ μΌμ΄λ€. μμ΄μΈνΈ νλ μ, PAUSE νλ μ, λ³νλ DHCP DISCOVER, μμ‘° BPDU, μ‘°μλ HSRP κ΄κ³ λ₯Ό μ£Όμ νλ €λ©΄, νμ¨μ΄κ° μ΄λλ· νλ μ μ 체λ₯Ό μ§μ λ§λ€μ΄ PHYμ μλμ§ μμ μ±λ‘ λκ²¨μΌ νλ€. Raw MAC μ κ·Όλ§μ΄ μ΄κ±Έ κ°λ₯νκ² νλ€.
π· νλμ PHY, λͺ¨λ κ³μΈ΅
ν μ€ν°κ° raw νλ μμ μμ νκΈ° λλ¬Έμ, λ¨μΌ μ₯λΉκ° L1(PHY μλ/λνλ μ€ κ°μ ), L2(VLAN/STP/LLDP/CDP/ARP), L3(μ체 IP/UDP/ICMP μ€ν)μμ λͺ¨λ λμνλ€ β κ³μΈ΅λ§λ€ λ³λ μ₯λΉκ° νμ μλ€. λμ€μ»€λ²λ¦¬, μΈμ μ , λ²€μΉλ§νΉ, 보μ νκ°κ° μ λΆ λμΌν raw νμ΄νλ₯Ό ν΅ν΄ λμκ°λ€.
π· WIZnet μνκ³ λ΄ μ ν©μ±
WIZnet λΌμΈμ
μ€μμ μ΄λ° μ’
λ₯μ ν΄μλ W5500μ MACRAW λͺ¨λκ° μμ°μ€λ¬μ΄ μ νμ΄λ€. κ²¬κ³ ν SPI μΈν°νμ΄μ€μ μ λ¬Έμνλ Sn_MR_MACRAW μμΌ λͺ¨λκ°, μ§§μ μ¨λ³΄λ PCB νΈλ μ΄μ€ μμμ κΉ¨λνκ³ κ²°μ λ‘ μ μΈ raw-frame κ²½λ‘λ₯Ό μ 곡νλ€ β κ°λ³ PHY(μ: ENC28J60)λ₯Ό λΉνΈλ±
μνκ±°λ LAN8742Aμ RMII νμ΄λ°κ³Ό μ¨λ¦νλ κ²λ³΄λ€ ν¨μ¬ λ¨μνκ³ μμ μ μ΄λ€. λ°°ν°λ¦¬/PoE ꡬλ νΈλν¬λμμλ μ΄ ν΅ν© λ°λκ° κ²°μ μ μ΄λ€.
03 β μμ€ν
μν€ν
μ²
RFC 2544 λ²€μΉλ§ν¬ μ€μνΈλΆν° λ‘κ·Έ(rogue) 802.1X μΈμ¦μκΉμ§, λͺ¨λ κΈ°λ₯ λͺ¨λμ κ²°κ΅ λ¨ νλμ ν리미ν°λΈ W5500Raw::sendFrame()μ νΈμΆνλ€. μ΄ λ¨μΌ μ½λ κ²½λ‘κ° μ 체 μν€ν
μ²λ₯Ό νλλ‘ λ¬Άλ νμ΄λ€.
04 β μ W5500μΈκ°? β
π· κΈ°μ μ ν΅μ¬: MACRAWκ° νλμ¨μ΄ μ λ’°μ±κ³Ό ν¨κ» raw L2 μ κ·Όμ μ 곡νλ€
μ΄ νλ‘μ νΈ μ 체λ λ¨ νλμ λ₯λ ₯ μμ μΈμμ Έ μλ€. μμμ μ΄λλ· νλ μμ νμ μμ μ¬λ¦¬κ³ , λλμμ€λ λͺ¨λ νλ μμ νν°λ§ μμ΄ μμ νλ λ₯λ ₯. W5500μ μ΄κ²μ MACRAW μμΌ λͺ¨λλ‘ μ νν μ 곡νλ€.
π· μ¬μ© λͺ¨λ: MACRAW (Sn_MR_MACRAW, Sn_MR = 0x04) β μ½λμμ κ²μ¦λ¨
μ΄κ±΄ μΆλ‘ μ΄ μλλΌ src/w5500_raw.cppμμ μ§μ νμΈλ μ¬μ€μ΄λ€.
- μμΌ 0μ
_writeReg8(Sn_MR, BSB_S0_REG, Sn_MR_MACRAW)λ‘ μ΄κ³ , μμΌ μν λ μ§μ€ν°κ°SOCK_MACRAWλ‘ μ½νλμ§ κ²μ¦νλ€. - MAC νν°λ§μ μλμ μΌλ‘ λΉνμ±ννμ¬ μΈκ·Έλ¨ΌνΈ μμ λͺ¨λ νλ μμ μμ νλ€ (ν¨μλΈ μ μ°°, PCAP μΊ‘μ², νλ‘ν μ½ λμ½λμ νμ).
- RX μ W5500μ΄ κ° μμ MACRAW νλ μ μμ λΆμ΄λ 2λ°μ΄νΈ κΈΈμ΄ ν리ν½μ€λ₯Ό μ¬λ°λ₯΄κ² μ²λ¦¬νλ€.
- TX μ
sendFrame()μ΄ νλ μμ μμΌ TX λ²νΌμ μ°κ³ ,Sn_TX_WRμ μ μ§μν¨ λ€Sn_CR_SENDλ₯Ό λ°ννλ€ β κ΅κ³Όμμ μΈ raw μ μ‘ κ²½λ‘.
무μ보λ€λ, W5500μ νλμ¨μ΄ TCP/IP μμ§μ μμ ν μ°νλλ€. 컀μ€ν
IpStack(src/ip_stack.cpp)μ΄ ARP, IPv4, UDP, ICMPλ₯Ό μμΌλ‘ μ§μ λ§λ€μ΄ κ°κ°μ _eth.sendFrame()μΌλ‘ λ°μ΄ λ£λλ€. μ΄κ²μ΄ μ΄ νλ‘μ νΈλ₯Ό μ μνλ μ€κ³ κ²°μ μ΄λ€. μμ ν raw-frame μ μ΄κΆμ μ μ§νλ©΄μλ L3/DHCP ν
μ€νΈλ₯Ό κ°λ₯νκ² νλ€.
π· λ체 μ루μ λλΉ μ°μ
- vs. ENC28J60: W5500μ ν¨μ¬ κ²¬κ³ νκ³ μ μΆμνλ SPI λ μ§μ€ν° μΈν°νμ΄μ€μ μ λ’°μ± μλ MACRAW λμμ μ 곡νμ¬, ENC28J60μ μ λͺ λμ errataμ μλ λ²νΌ κ΄λ¦¬ λΆλ΄μ νΌνλ€.
- vs. RMII PHY (LAN8742A λ±): RMII ν΄λ‘/νμ΄λ° κ³¨μΉ«κ±°λ¦¬κ° μκ³ ESP32μ λ΄μ₯ EMACμ μμ‘΄νμ§ μλλ€ β κΉ¨λν SPI λ²μ€λ§μΌλ‘ μΆ©λΆν΄, λ΄λΆ MACμ ν΄λ°©μν€κ³ PoE νΈλν¬λ μ€κ³λ₯Ό λ¨μννλ€.
- vs. W5500 μ체 TCP/IP μ€νλ‘λ: μ€νλ‘λλ λͺ©μ μ체λ₯Ό 무λλ¨λ¦°λ€. MACRAWμΌλ§λ‘ W5500μ΄ ν΄λΌμ΄μΈνΈκ° μλλΌ ν μ€ν°μ λ§λ μ΄μ λ€.
π· κ²μ¦λ μ¦κ±° β
- β
w5500_raw.cppμμ MACRAW μμΌ 0 μ€μ νμΈ. - β
raw TX κ²½λ‘(
Sn_TX_WR+Sn_CR_SEND) νμΈ. - β
ip_stack.cppμμ λͺ¨λ νλ μμsendFrame()μΌλ‘ λΌμ°ν νλ 컀μ€ν IP μ€ν νμΈ. - β μ€μ Aruba CX6300 μλλ‘ μ μΒ·νλ (README κΈ°μ¬).
- β MACRAW νλμ¨μ΄ νκ³(FCS μλ λΆμ°©μΌλ‘ μΈν μ§μ§ CRC-μλ¬/runt μ£Όμ λΆκ°)λ₯Ό μ μ§νκ² λ¬Έμν β μ€μ μ€λ¦¬μ½ μμμ λλ €λ³Έ μ μμ νμ .
05 β ν΅μ¬ κ΅¬μ± μμ
π WIZnet W5500 β MACRAW λͺ¨λ (raw L2 μμ§)
μ΄ ν΄μ μ¬μ₯. Waveshare ESP32-S3-POE-ETH 보λ μμμ λμνλ©°, W5500μ΄ μ¨λ³΄λ PoE μ§μμΌλ‘ ν΅ν©λμ΄ FSPI 8 MHzλ‘ μ°κ²°λλ€ (μ§§μ νΈλ μ΄μ€λΌ 40 MHzκΉμ§ μ¬λ¦΄ μ¬μ μμ). λͺ¨λ raw TX/RX, μλ¬ μΈμ μ , 컀μ€ν IP μ€νμ΄ μ΄ μμ μΉν μλ€.
π§ ESP32-S3 (Waveshare ESP32-S3-POE-ETH)
16 MB νλμ, 8 MB PSRAM, USB-C. CLI νμ, ESPAsyncWebServer ν UI, EAP-TLS/PEAP/TTLSμ© mbedTLS, NVS μμν, λμΌ OTA νν°μ μ€ν΄μ νΈμ€ν νλ€.
π§ 컀μ€ν μ΅μ IPv4 μ€ν
ARP(μΊμ ν¬ν¨) + IPv4 + UDP + ICMPλ₯Ό MACRAW μμ μμΌλ‘ ꡬν. W5500 νλμ¨μ΄ μ€νμ 건λλ¦¬μ§ μκ³ ping, DHCP DORA, DNS, SNMP, ν¬νΈ μ€μΊμ κ°λ₯νκ² νλ€.
π‘ νλ‘ν μ½ & 보μ μ€μνΈ
RFC 2544, LLDP/CDP(λμ½λ + κ΄κ³ ), 802.1X μνλ¦¬μ»¨νΈ + λ‘κ·Έ μΈμ¦μ(hashcat-5500 μΆλ ₯), DHCP/DHCPv6 μλ리μ€, FHRP(HSRP/VRRP) νκ°, L2 곡격 μ€μνΈ, SNMP μ μ°°, 30μ’ μ΄μ μλΉμ€ λ°°λ νλ‘λΈ TCP SYN μ€μΊλ.
πΎ νμ₯ λμ μΈνλΌ
Wi-Fi STA/AP μΉ UI, HTTPS + basic-auth, μ격 κ΄λ¦¬μ© WireGuard ν°λ, SD μΉ΄λ PCAP/λ‘κ·Έ/μ€ν¬λ¦½νΈ μ μ₯, cron μ€μΌμ€λ¬, TFTP/HTTP OTA.
06 β μμ© μλ리μ€
01. μν°νλΌμ΄μ¦ μ€μμΉ ν¬νΈ 컀미μ λ
μ μ€μμΉλ₯Ό νλ‘λμ
μ λκΈ°κΈ° μ , μμ§λμ΄κ° ν
μ€ν°λ₯Ό κ½κ³ test allλ‘ RFC 2544 μμΉλ₯Ό λ½κ³ , LLDP μ΄μ μ 보λ₯Ό νμΈνκ³ , DHCP λμμ κ²μ¦νκ³ , 802.1X κ°μ μ¬λΆλ₯Ό νμΈνλ€ β μ λΆ νΈλν¬λ νλλ‘.
02. λ ΈνΈλΆ μλ νμ₯ νΈλ¬λΈμν
PoE ꡬλμ μΉ κΈ°λ°μ΄λΌ, μ격 ν¬νΈμ λμ Έλκ³ Wi-Fi(λλ λ³Έμ¬λ‘ μ΄μ΄μ§λ WireGuard)λ‘ μ μν μ μλ€. κ²°κ³Όλ SDμ λ‘κΉ λκ³ cronμΌλ‘ μμ½ν΄ λ¬΄μΈ μΌκ° μ κ²κΉμ§ λλ¦°λ€.
03. μΈκ°λ λ€νΈμν¬ λ³΄μ νκ°
armed λͺ¨λμμ νν μ€ν°κ° ARP MITM, STP λ£¨νΈ νμ·¨, VLAN νν, λ‘κ·Έ DHCP/DHCPv6/DNS, FHRP νμ΄μ¬νΉ, λ‘κ·Έ 802.1X μΈμ¦μλ₯Ό μ€ννμ¬, λ€νΈμν¬μ νλλ(DHCP μ€λν, Root Guard, DAI, 802.1X, FHRP μΈμ¦)μ΄ μ€μ λ‘ λ²ν°λμ§ κ²μ¦νλ€.
04. νλ‘ν μ½ κ΅μ‘ & λ© μ€μ΅
λͺ¨λ νλ μμ μμΌλ‘ λ§λ€κΈ° λλ¬Έμ, μ΄ μ½λλ² μ΄μ€λ LLDP, CDP, HSRP, VRRP, EAP, DHCP, MS-CHAPv2κ° νμ μμμ μ€μ λ‘ μ΄λ»κ² μκ²Όλμ§ λ³΄μ¬μ£Όλ μ΄μμλ λ νΌλ°μ€λ€ β μ λ§λ‘ λ°°μΈ κ² λ§μ MACRAW νλ‘μ νΈ.
κ²°λ‘
μλ°λ₯λ§ ν PoE ꡬλ 보λ νλκ°, W5500μ MACRAW λͺ¨λλ₯Ό μμ μ λ λ§μ΄νΈ 5μ리 μ μ₯λΉμ μμμ΄μλ μμ ν L1βL3 λ€νΈμν¬ ν μ€νΈΒ·νκ° λ²€μΉλ‘ λ°κΏλμλ€.
- β W5500 MACRAWλ₯Ό ν΅ν μμ ν raw-frame μ μ΄ (μμ€μμ κ²μ¦)
- β raw L2 μμ μΉμ 컀μ€ν ARP/IP/UDP/ICMP μ€ν β νλμ¨μ΄ TCP/IP μλμ μ°ν
- β RFC 2544 λ²€μΉλ§ν¬ μ€μνΈ (μ²λ¦¬λ/μ§μ°/μμ€/back-to-back)
- β μμ ν 802.1X/EAP μνλ¦¬μ»¨νΈ + hashcat μΆλ ₯ λ‘κ·Έ μΈμ¦μ
- β κΉμ΄ μλ L2/L3 보μ νκ° ν΄ν· (VLAN/STP/ARP/FHRP/DHCP/DNS/SNMP)
- β ν λ°©μ Wi-Fi μΉ UI + μλ¦¬μΌ CLI + μ€ν¬λ¦½ν /cron μλν
- β νμ₯κΈ μΈνλΌ: PoE, HTTPS, WireGuard, SD PCAP/λ‘κ·Έ, OTA
- β μ€μ μν°νλΌμ΄μ¦ νλμ¨μ΄(Aruba CX6300)λ‘ κ²μ¦
- β MACRAW νλμ¨μ΄ νκ³λ₯Ό μ μ§νκ² λ¬Έμν β μμ§λμ΄λ§ μ§μ μ±
Q&A
Q. W5500μ μ΄λ€ μμΌ λͺ¨λλ₯Ό μ°λ©°, μ νλμ¨μ΄ TCP/IP μ€νμ μ μ°λ? μμΌ 0μ MACRAW(Sn_MR_MACRAW)λ‘, MAC νν°λ§μ λ μνλ‘ μ¬μ©νλ€. λ€νΈμν¬ ν
μ€ν°λ νμ μ λͺ¨λ λ°μ΄νΈλ₯Ό μ μ΄νκ³ κ΄μ°°ν΄μΌ νλ―λ‘, νλμ¨μ΄ TCP/IP μ€νλ‘λλ₯Ό μΌλΆλ¬ μ°ννκ³ raw νλ μ μμ 컀μ€ν
κ²½λ IP μ€νμ μ§μ μ¬λ Έλ€.
Q. μ μ§μ§ CRC-μλ¬λ runt νλ μμ μ£Όμ ν μ μλ? MACRAW λͺ¨λμμ W5500μ νμ μ ν¨ν 4λ°μ΄νΈ FCSλ₯Ό κ³μ°ν΄ λΆμ΄κ³ , μ§§μ νλ μμ 60λ°μ΄νΈ μ΅μκ°μΌλ‘ μλ ν¨λ©νλ€. κ·Έλμ CRCκ° κΉ¨μ§ νλ μκ³Ό 64λ°μ΄νΈ λ―Έλ§ runt νλ μμ νμ μΌλ‘ λκ° μ μλ€ β μ μκ° μ¨κΈ°μ§ μκ³ μ μ§νκ² λ¬Έμνν μ€μ νλμ¨μ΄ λμμ΄λ€.
Q. raw-frame κ²½λ‘κ° μ€μ λ‘ κ΅¬νλ 건κ°, μλλ©΄ μ£Όμ₯λΏμΈκ°? src/w5500_raw.cppμμ νμΈλ¨: sendFrame()μ΄ μμΌ TX λ²νΌμ μ°κ³ , Sn_TX_WRμ μ μ§μν€κ³ , Sn_CR_SENDλ₯Ό λ°ννλ€. μμ λͺ¨λ μ λΆ(RFC 2544, μΈμ μ
, IP μ€ν)κ° μ΄ λ¨μΌ ν리미ν°λΈλ₯Ό κ±°μΉλ€.
Q. μ΄λ€ 보λμμ λμκ°λ? μ¨λ³΄λ PoE μ§μ W5500μ FSPI 8 MHzλ‘ μΉμ Waveshare ESP32-S3-POE-ETH β μΈλΆ μ΄λλ· λ°°μ λΆνμ.
Original Link: https://github.com/micgresham/esp32-ethernet-tester