---
title: "sunset"
url: "https://maker.wiznet.io/Lihan__/projects/sunset/"
markdown_url: "https://maker.wiznet.io/Lihan__/projects/sunset/md"
type: "UCC: User Created Content"
author: "mkj"
author_url: "https://github.com/mkj/sunset"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "mkj"
original_url: "https://github.com/mkj/sunset"
published: "2026-06-08"
language: "en"
likes: 0
views: 310
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# sunset

> SSH for Rust, no_std and elsewhere

Original author: mkj (source: https://github.com/mkj/sunset)

## Article

## Sunset SSH — A Full SSH Stack That Fits on a Microcontroller, Wired Over W5500

`#SSH` `#RustEmbedded` `#no_std` `#W5500` `#MACRAW` `#Embassy` `#smoltcp` `#RP2040` `#PostQuantum` `#WiredEthernet`

> 📚 Context: Open-source systems library by Matt Johnston — the author of Dropbear SSH, the SSH server that runs on millions of routers and embedded devices. Implementation status: Working SSH client and server, `no_std` + no-alloc, with a Raspberry Pi Pico demo that runs over wired Ethernet through a WIZnet W5500 on the W5500-EVB-Pico.

---

### 01 — What is this project?

Running SSH on a small embedded device has always meant a painful trade-off. The classic answer is Dropbear — a wonderfully compact SSH daemon — but it assumes a full operating system underneath: a heap allocator, a POSIX-like sockets API, and a multi-megabyte Linux. The moment you drop down to a bare microcontroller with a few hundred kilobytes of RAM and no OS, that option disappears.

**Sunset** rethinks the problem from the silicon up. It is a clean-room SSH client *and* server implementation written in Rust that runs with `no_std` **and no heap allocation at all**. The core protocol engine doesn't even assume an async runtime — it exposes a synchronous API that you drive yourself, so it can be embedded "pretty much anywhere."

The result is striking: a complete, modern SSH endpoint — password and ed25519 public-key auth, curve25519 key exchange, chacha20-poly1305 and aes256-ctr ciphers, and even **post-quantum hybrid key exchange (ML-KEM 768 × x25519)** — that fits in roughly **150 kB of flash and ~13 kB of RAM per concurrent session** on a Raspberry Pi Pico. The same codebase scales up to a perfectly usable day-to-day desktop SSH client (`sunsetc`) on Linux.

To prove the embedded story end-to-end, the project ships a Pico demo that can take its network connection one of two ways: over Wi-Fi (the Pico W's cyw43 radio) **or over wired Ethernet through a WIZnet W5500** on the W5500-EVB-Pico board. This curation focuses on the wired path — because that is where a $6 microcontroller quietly becomes a hardened, network-attached SSH server with a real RJ45 jack.

### 02 — Why SSH on bare metal — and why Rust?

#### 🔷 SSH is the universal remote-management protocol

Every serious piece of network infrastructure speaks SSH. Bringing it down to the microcontroller level means a sensor node, a PLC gateway, or an industrial controller can be administered, scripted, and updated using the exact same tooling engineers already trust — no bespoke web UI, no insecure telnet, no cloud dependency.

#### 🔷 `no_std`, no-alloc, `forbid(unsafe)`

Sunset is built for environments where a heap is a liability and a single `unsafe` block is a security review item. The core crate compiles with `#![forbid(unsafe)]`, avoids dynamic allocation entirely, and is designed so release builds don't panic — errors are returned as values. For a security protocol that sits directly on the network, this is exactly the discipline you want.

#### 🔷 The Embassy async ecosystem

The async variant (`sunset-async`) and the demo are built on **Embassy**, the async embedded-Rust framework, with **smoltcp** (via `embassy-net`) providing the TCP/IP stack. This matters enormously for the WIZnet integration, as Section 04 explains: it lets the SSH code treat Wi-Fi and wired Ethernet as interchangeable link layers behind one uniform async network interface.

#### 🔷 Where WIZnet fits in the Rust embedded networking landscape

In embedded Rust there are broadly two ways to get a device onto a wired network: a software TCP/IP stack (smoltcp) fed by a raw-Ethernet MAC, or a hardware-offload chip that does TCP/IP for you. The W5500 can do *either*. Sunset deliberately uses the W5500 as a clean SPI-attached Ethernet MAC+PHY and lets smoltcp do TCP/IP — gaining a single, modern, async stack shared with the Wi-Fi path, with no external PHY, no MAC IP block on the MCU, and no Wi-Fi firmware blob to ship.

### 03 — System architecture

![](https://maker.wiznet.io/upload/ckeditor5/627351472%5F1780915058%2Epng)

The same `embassy-net::Stack` is constructed whether the link layer is cyw43 Wi-Fi or the W5500 — only the device driver underneath changes. Everything above the dashed line in the code is identical.

### 04 — Why WIZnet W5500? ⭐

#### 🔷 The technical core: a wired RJ45 for a chip that has none

The RP2040 has no Ethernet MAC and no PHY. The cleanest way to give it a wired network port is a single SPI peripheral that contains both — and that is precisely the W5500: a MAC + 10/100 PHY behind an SPI bus. Sunset drives it at **SPI0, 50 MHz** with dedicated reset and interrupt lines, on the WIZnet **W5500-EVB-Pico** board where the RP2040 and W5500 already share one PCB.

#### 🔷 Mode in use: **MACRAW** (raw Ethernet), *not* hardware TOE

This is the defining architectural choice. The W5500 is famous for its hardwired TCP/IP offload (TOE) with eight hardware sockets. Sunset uses **none of that**. Instead it runs the W5500 in **MACRAW mode**, where the chip simply hands raw Ethernet frames up to the host, and **smoltcp / **`**embassy-net**` implements the entire TCP/IP stack in software (note the `medium-ethernet` feature and the `embassy-net-wiznet` Ethernet-`Device` driver).

Why give up the hardware offload? Because SSH wants something the fixed-function TOE can't offer:

- **One stack, two radios.** The Wi-Fi (cyw43) path and the wired (W5500) path expose the *identical* `embassy-net` interface. The SSH code never learns which one it's on. Swapping wired for wireless is a one-line cargo feature flag — `--features w5500` vs the default `cyw43`.

- **Async-native sockets.** smoltcp integrates with the Embassy executor, so SSH sessions are `.await`-ed cleanly. The W5500's 8 hardwired sockets and fixed TCP behaviour don't map as neatly onto a modern async, multi-session SSH server.

- **Full control of the TCP/IP edge.** A software stack lets the project tune buffering, DHCP, and connection handling to SSH's needs, and keeps the security-relevant networking in audited Rust.

In short: the W5500 is used as the *perfect link-layer citizen* — it solves the "RP2040 has no Ethernet" problem completely, while the software stack above it keeps the architecture uniform and flexible.

#### 🔷 Advantages over the alternatives

Versus a Wi-Fi-only design: a W5500 wired link needs **no ~200 kB firmware blob** (the cyw43 path carries one), gives deterministic latency, and is the right call for industrial or fixed installations. Versus a discrete MAC + external PHY (e.g. an MII/RMII PHY hung off a bigger MCU): the W5500 collapses MAC and PHY into one SPI-attached part, so even an RP2040 with zero networking peripherals gets a clean RJ45. Versus an ENC28J60 (the other common SPI Ethernet part): the W5500 is a newer 10/100 device with a better-supported Rust driver (`embassy-net-wiznet`) and the *option* to switch to TOE later if a future use case wants it.

#### 🔷 Verified evidence ✅

- The W5500 backend is a first-class, selectable build target in the demo: `cargo` feature `w5500` pulls in `embassy-net-wiznet = "0.3.0"`, and `main.rs` `compile_error!`s if neither (or both) of `cyw43`/`w5500` is selected — the integration is wired in, not aspirational.

- Full hardware bring-up lives in the repo (`demo/picow/src/w5500.rs`): SPI configuration, chip reset, interrupt input, MAC assignment, and stack construction with DHCP-or-static IPv4.

- The on-device footprint is real and documented: ~150 kB flash, ~13 kB RAM per SSH session on the Pico class of device.

- The board is named explicitly in `Cargo.toml`: *"for wiznet w5500-evb-pico board."*

### 05 — Key components

#### 🌐 WIZnet W5500 — MACRAW mode, SPI-attached MAC + PHY

The single chip that turns an RP2040 into a wired network node. Driven over SPI0 at 50 MHz with INT/RESET lines, operated as a raw-Ethernet device so the host stack owns TCP/IP. On the W5500-EVB-Pico it sits on the same board as the MCU.

#### ⚙️ embassy-net-wiznet 0.3 — the driver bridge

Presents the W5500 to `embassy-net` as a standard Ethernet `Device`. This is the seam that makes the wired path drop-in compatible with the Wi-Fi path.

#### 🌐 embassy-net / smoltcp — software TCP/IP

The pure-Rust TCP/IP stack carrying SSH. Handles DHCP, static IPv4, and the TCP sockets the SSH listener binds to.

#### 🔐 Sunset core — the SSH engine

`no_std`, no-alloc, `forbid(unsafe)` SSH client/server: ed25519, curve25519, chacha20-poly1305, aes256-ctr, hmac-sha256, and ML-KEM768×x25519 post-quantum hybrid key exchange.

#### 🦀 Embassy executor + RP2040

The async runtime and the dual-core Cortex-M0+ host that ties flash config, USB console, serial, and the network listener tasks together.

### 06 — Application scenarios

#### 01. Industrial wired remote management

A controller on a factory floor exposes a real SSH server over a deterministic, EMI-resistant RJ45 link — no Wi-Fi, no cloud — administered with standard `ssh`/`scp` tooling.

#### 02. Secure serial-console server

The demo bridges UART pipes to SSH sessions: a W5500-EVB-Pico becomes a tiny networked serial console / jump box for lab equipment, reachable over Ethernet.

#### 03. Future-proofed edge devices

With ML-KEM hybrid key exchange, an embedded node deployed today resists "harvest-now-decrypt-later" attacks — post-quantum SSH on a sub-$10 board with a wired port.

#### 04. Reference design for embedded-Rust networking

The clean cyw43-vs-W5500 swap is a textbook example for any team learning how to put `embassy-net` over a WIZnet chip, with full SPI bring-up to copy from.

### Conclusion

> **Sunset proves that a complete, modern, post-quantum-ready SSH server fits on a microcontroller — and the WIZnet W5500 is what gives that microcontroller a real wired network port.**

- ✅ Full SSH client + server in `no_std`, no-alloc Rust, `forbid(unsafe)`

- ✅ ~150 kB flash, ~13 kB RAM per session on Pico-class hardware

- ✅ Post-quantum hybrid key exchange (ML-KEM768 × x25519)

- ✅ Wired Ethernet via WIZnet W5500 on the W5500-EVB-Pico

- ✅ W5500 run in MACRAW mode under smoltcp/embassy-net for a uniform Wi-Fi/wired stack

- ✅ One-flag swap (`--features w5500`) between wireless and wired

- ✅ Full SPI hardware bring-up included; selectable, compile-checked build target

- ✅ Authored by the creator of Dropbear SSH

### Q&A

**Q. Does Sunset use the W5500's hardware TCP/IP offload (TOE)?** No. It uses the W5500 in **MACRAW mode** — the chip moves raw Ethernet frames and smoltcp/`embassy-net` does TCP/IP in software. This is deliberate: it lets the wired path and the Wi-Fi (cyw43) path share one identical async network stack, which suits a multi-session SSH server better than the W5500's fixed eight-socket TOE.

**Q. Why a W5500 instead of just using the Pico W's Wi-Fi?** Wired Ethernet gives deterministic latency, no RF interference, no ~200 kB Wi-Fi firmware blob, and is the right fit for industrial/fixed installs. The W5500 also adds a real RJ45 to a plain RP2040 that has no Ethernet hardware at all.

**Q. Could it switch to the W5500's TOE later?** In principle yes — the W5500 supports TCP/UDP socket modes too. But it would lose the uniform smoltcp interface shared with the Wi-Fi path, so for this architecture MACRAW is the better fit.

**Q. Is the W5500 path production-ready?** The integration is real and compile-checked, with full hardware bring-up in the repo. As with the rest of this fast-moving library, anyone deploying it should pin versions and do their own on-hardware validation.

---

## Sunset SSH — 마이크로컨트롤러에 통째로 들어가는 SSH 스택, W5500으로 유선 연결

`#SSH` `#RustEmbedded` `#no_std` `#W5500` `#MACRAW` `#Embassy` `#smoltcp` `#RP2040` `#PostQuantum` `#WiredEthernet`

> 📚 컨텍스트: Dropbear SSH(수많은 공유기·임베디드 장비에 들어가는 그 SSH 서버)의 저자 Matt Johnston이 만든 오픈소스 시스템 라이브러리. 구현 상태: 동작하는 SSH 클라이언트 + 서버, `no_std` + no-alloc, W5500-EVB-Pico에서 WIZnet W5500을 통해 유선 이더넷으로 도는 Raspberry Pi Pico 데모 포함.

---

### 01 — 이 프로젝트는 무엇인가?

작은 임베디드 장비에서 SSH를 돌리는 일은 늘 괴로운 타협을 동반했다. 고전적인 답은 Dropbear — 훌륭하게 작은 SSH 데몬 — 이지만, 그 밑에 완전한 운영체제가 깔려 있다고 가정한다. 힙 할당기, POSIX 비슷한 소켓 API, 그리고 수 MB짜리 리눅스 말이다. RAM 수백 KB에 OS도 없는 맨 마이크로컨트롤러로 내려오는 순간 그 선택지는 사라진다.

-> 일반적으로 SSH를 사용하기 위한 기본조건 = 완전한 운영체제

**Sunset**은 이 문제를 실리콘 레벨에서부터 다시 설계한다. Rust로 작성된 클린룸 SSH 클라이언트 *겸* 서버 구현으로, `**no_std**`**인 데다 힙 할당을 전혀 하지 않는다.** 코어 프로토콜 엔진은 async 런타임조차 가정하지 않는다 — 직접 구동하는 동기 API를 노출해서 "사실상 어디에든" 임베드할 수 있게 했다.

#### 🔷사용된 보안기법

**1. 비밀번호 인증**

일반적인 `ssh user@ip` 접속 후 password를 입력하는 방식.
MCU 장비에 접속할 때도 가장 단순한 인증 수단으로 쓸 수 있음.

**2. ed25519 공개키 인증**

비밀번호 대신 SSH key로 로그인하는 방식.
리눅스에서 `~/.ssh/id_ed25519` 같은 키를 쓰는 방식과 동일함.
비밀번호 입력 없이 접속할 수 있어 자동화와 보안 측면에서 더 적합함.
생산 장비나 테스트 장비에 엔지니어 공개키를 등록해두는 식으로 활용 가능함.

**3. curve25519 키 교환**

SSH 접속 초기에 양쪽이 안전한 세션 키를 만들기 위한 알고리즘.
네트워크 중간에서 누가 패킷을 보더라도 실제 암호화 키를 알아낼 수 없게 하는 과정임.
MCU 입장에서는 SSH 보안 채널을 시작할 때 필요한 핵심 절차임.

**4. chacha20-poly1305 / aes256-ctr 암호**

SSH 접속 후 실제로 주고받는 데이터를 암호화하는 방식.
명령, 응답, 로그, 상태 정보가 네트워크 위에서 평문으로 노출되지 않게 해줌.
MCU 원격 제어나 진단 정보를 안전하게 주고받는 데 사용됨.

**5. ML-KEM768 × x25519 포스트 퀀텀 하이브리드 KEX**

기존 x25519 키 교환에 양자컴퓨터 시대를 대비한 ML-KEM768을 함께 사용하는 방식.
현재 널리 쓰이는 키 교환 방식과 포스트 퀀텀 방식을 결합해 장기적인 보안성을 높이는 구조임.
작은 MCU에서 이런 수준의 키 교환을 지원한다는 점이 Sunset SSH의 특징임.

### 02 — 왜 베어메탈 SSH인가, 그리고 왜 Rust인가?

#### 🔷 SSH는 보편적인 원격 관리 프로토콜이다

제대로 된 네트워크 인프라는 전부 SSH를 말한다. 이걸 마이크로컨트롤러 레벨까지 끌어내리면, 센서 노드·PLC 게이트웨이·산업용 컨트롤러를 엔지니어가 이미 신뢰하는 바로 그 도구로 관리·스크립팅·업데이트할 수 있다. 별도 웹 UI도, 위험한 telnet도, 클라우드 의존도 필요 없다.

#### 🔷 OS는 없지만 OS처럼 — `no_std` + Embassy async

Pico에는 운영체제가 전혀 없지만(`no_std`, 힙 없음), OS처럼 동작한다: **Embassy**의 async executor가 여러 SSH 세션, 네트워크 태스크, W5500/Wi-Fi 드라이버를 협력형 `.await` 태스크로 스케줄링한다. OS 없이도 OS급 멀티태스킹을 얻고 — WIZnet 통합을 깔끔하게 만드는 통일된 async 네트워크 인터페이스(04 참고)까지 — OS의 무게 없이 가진다.

#### 🔷 네트워크 경계에서의 메모리 안전성

SSH 엔드포인트는 신뢰할 수 없는 바이트를 회선에서 곧바로 파싱한다 — 역사적으로 버퍼 오버플로우 CVE가 가장 많이 나온 지점이다. Rust는 그 버그 부류를 가비지 컬렉터 없이 컴파일 타임에 제거하고, 코어는 `#![forbid(unsafe)]`로 컴파일된다. 어울리게도 Sunset은 **Dropbear(C SSH 데몬)의 저자 Matt Johnston**이 만들었다 — 같은 전문성을, C의 메모리 안전 함정을 없앤 언어로 다시 지은 것이다.

#### 🔷 Rust 임베디드 네트워킹 지형에서 WIZnet의 위치

임베디드 Rust에서 장비를 유선 네트워크에 올리는 길은 크게 둘이다. 생 이더넷 MAC이 먹여주는 소프트웨어 TCP/IP 스택(smoltcp), 아니면 TCP/IP를 대신 처리해주는 하드웨어 오프로드 칩. W5500은 *둘 다* 가능하다. Sunset은 의도적으로 W5500을 깔끔한 SPI 부착 이더넷 MAC+PHY로 쓰고 TCP/IP는 smoltcp에 맡긴다 — Wi-Fi 경로와 공유하는 단일·현대식 async 스택을 얻으면서, 외부 PHY도, MCU 내 MAC IP 블록도, 함께 배포할 Wi-Fi 펌웨어 블롭도 없이.

### 03 — 시스템 아키텍처

![](https://maker.wiznet.io/upload/ckeditor5/627351472%5F1780915076%2Epng)

링크 계층이 cyw43 Wi-Fi든 W5500이든 동일한 `embassy-net::Stack`이 구성된다 — 바뀌는 건 그 아래 디바이스 드라이버뿐이다. 코드에서 점선 위쪽은 전부 동일하다.

### 04 — 왜 WIZnet W5500인가? ⭐

#### 🔷 기술적 핵심: 이더넷이 없는 칩에 RJ45를 달다

RP2040에는 이더넷 MAC도 PHY도 없다. 여기에 유선 포트를 다는 가장 깔끔한 방법은 둘 다 품고 있는 SPI 주변장치 하나 — 그게 바로 W5500이다. SPI 버스 뒤에 MAC + 10/100 PHY가 들어 있다. Sunset은 이를 **SPI0, 50 MHz** 로, 전용 reset·interrupt 라인과 함께 구동하며, RP2040과 W5500이 한 PCB에 올라간 WIZnet **W5500-EVB-Pico** 보드를 쓴다.

#### 🔷 사용 모드: **MACRAW**(생 이더넷), 하드웨어 TOE 아님

이것이 이 프로젝트를 규정하는 아키텍처 선택이다. W5500은 8개 하드웨어 소켓을 가진 하드와이어드 TCP/IP 오프로드(TOE)로 유명하다. Sunset은 **그걸 하나도 쓰지 않는다.** 대신 W5500을 **MACRAW 모드**로 돌려, 칩이 생 이더넷 프레임을 호스트로 그대로 올려보내게 하고, **smoltcp / **`**embassy-net**` 가 TCP/IP 스택 전체를 소프트웨어로 구현한다(`medium-ethernet` feature와 `embassy-net-wiznet`의 이더넷 `Device` 드라이버가 그 근거).

왜 하드웨어 오프로드를 포기할까? SSH가 고정 기능 TOE로는 줄 수 없는 것을 원하기 때문이다.

- **스택 하나, 라디오 둘.** Wi-Fi(cyw43) 경로와 유선(W5500) 경로가 *동일한* `embassy-net` 인터페이스를 노출한다. SSH 코드는 자기가 어느 쪽에 올라가 있는지 영영 모른다. 유선↔무선 전환은 cargo feature 한 줄 — 기본값 `cyw43` 대신 `--features w5500`.

- **Async 네이티브 소켓.** smoltcp는 Embassy executor와 통합되어 SSH 세션을 깔끔하게 `.await` 한다. W5500의 8개 하드와이어드 소켓과 고정된 TCP 동작은 현대식 async·다중 세션 SSH 서버에 그만큼 깔끔히 들어맞지 않는다.

- **TCP/IP 경계의 완전한 제어.** 소프트웨어 스택이면 버퍼링·DHCP·연결 처리를 SSH 요구에 맞게 튜닝할 수 있고, 보안과 직결된 네트워킹을 감사 가능한 Rust 안에 둘 수 있다.

요약하면: W5500은 *완벽한 링크 계층 시민*으로 쓰인다 — "RP2040엔 이더넷이 없다"는 문제를 완전히 해결하면서, 그 위 소프트웨어 스택이 아키텍처를 통일되고 유연하게 유지한다.

#### 🔷 대체 솔루션 대비 우위

Wi-Fi 전용 설계 대비: W5500 유선 링크는 **~200 kB 펌웨어 블롭이 필요 없고**(cyw43 경로는 이를 싣는다), 지연 시간이 결정적이며, 산업·고정 설치에 맞는 선택이다. 별도 MAC + 외부 PHY(예: 더 큰 MCU에 MII/RMII PHY를 붙이는 방식) 대비: W5500은 MAC과 PHY를 SPI 부착 부품 하나로 합쳐서, 네트워킹 주변장치가 전무한 RP2040조차 깔끔한 RJ45를 얻는다. ENC28J60(또 다른 흔한 SPI 이더넷 부품) 대비: W5500은 더 새로운 10/100 장치이고, Rust 드라이버(`embassy-net-wiznet`) 지원이 더 좋으며, 훗날 필요해지면 TOE로 *전환할 선택지*까지 남겨둔다.

#### 🔷 검증된 증거 ✅

- W5500 백엔드는 데모의 일급 선택 가능 빌드 타깃이다. cargo feature `w5500`이 `embassy-net-wiznet = "0.3.0"`을 끌어오고, `main.rs`는 `cyw43`/`w5500` 중 어느 것도 (혹은 둘 다) 선택되지 않으면 `compile_error!`를 낸다 — 통합이 구호가 아니라 실제로 배선돼 있다.

- 하드웨어 초기화 전체가 레포 안에 있다(`demo/picow/src/w5500.rs`): SPI 설정, 칩 리셋, 인터럽트 입력, MAC 할당, DHCP-혹은-static IPv4 스택 구성.

- 온디바이스 풋프린트가 실측·문서화돼 있다: Pico급 장비에서 ~150 kB 플래시, SSH 세션당 ~13 kB RAM.

- 보드가 `Cargo.toml`에 명시돼 있다: *"for wiznet w5500-evb-pico board."*

### 05 — 핵심 컴포넌트

#### 🌐 WIZnet W5500 — MACRAW 모드, SPI 부착 MAC + PHY

RP2040을 유선 네트워크 노드로 만들어주는 단일 칩. INT/RESET 라인과 함께 SPI0 50 MHz로 구동되며, 생 이더넷 디바이스로 동작해 TCP/IP는 호스트 스택이 소유한다. W5500-EVB-Pico에서는 MCU와 같은 보드에 올라가 있다.

#### ⚙️ embassy-net-wiznet 0.3 — 드라이버 브리지

W5500을 `embassy-net`에 표준 이더넷 `Device`로 노출한다. 유선 경로를 Wi-Fi 경로와 드롭인 호환으로 만드는 이음새다.

#### 🌐 embassy-net / smoltcp — 소프트웨어 TCP/IP

SSH를 실어 나르는 순수 Rust TCP/IP 스택. DHCP, static IPv4, 그리고 SSH 리스너가 bind 하는 TCP 소켓을 처리한다.

#### 🔐 Sunset 코어 — SSH 엔진

`no_std`, no-alloc, `forbid(unsafe)` SSH 클라이언트/서버: ed25519, curve25519, chacha20-poly1305, aes256-ctr, hmac-sha256, 그리고 ML-KEM768×x25519 포스트 퀀텀 하이브리드 키 교환.

#### 🦀 Embassy executor + RP2040

플래시 설정·USB 콘솔·시리얼·네트워크 리스너 태스크를 묶는 async 런타임과 듀얼코어 Cortex-M0+ 호스트.

### 06 — 활용 시나리오

#### 01. 산업용 유선 원격 관리

공장 현장의 컨트롤러가 결정적이고 EMI에 강한 RJ45 링크 위로 진짜 SSH 서버를 노출한다 — Wi-Fi도, 클라우드도 없이, 표준 `ssh`/`scp` 도구로 관리.

#### 02. 보안 시리얼 콘솔 서버

데모는 UART 파이프를 SSH 세션에 연결한다. W5500-EVB-Pico가 실험 장비용의 작은 네트워크 시리얼 콘솔 / 점프 박스가 되어 이더넷으로 접근 가능해진다.

#### 03. 미래 대비 엣지 장비

ML-KEM 하이브리드 키 교환 덕에, 오늘 배치한 임베디드 노드가 "지금 수집하고 나중에 복호화" 공격에 견딘다 — 1만 원 이하 유선 포트 보드 위의 포스트 퀀텀 SSH.

#### 04. 임베디드 Rust 네트워킹 레퍼런스 디자인

깔끔한 cyw43↔W5500 교체는 `embassy-net`을 WIZnet 칩 위에 올리는 법을 배우는 팀에게 교과서적 예시다. 베껴 쓸 수 있는 완전한 SPI 초기화 코드까지 포함.

### 결론

> **Sunset은 완전하고 현대적이며 포스트 퀀텀까지 준비된 SSH 서버가 마이크로컨트롤러에 들어간다는 것을 증명한다 — 그리고 그 마이크로컨트롤러에 진짜 유선 네트워크 포트를 주는 것이 WIZnet W5500이다.**

- ✅ `no_std`, no-alloc, `forbid(unsafe)` Rust로 만든 완전한 SSH 클라이언트 + 서버

- ✅ Pico급 하드웨어에서 ~150 kB 플래시, 세션당 ~13 kB RAM

- ✅ 포스트 퀀텀 하이브리드 키 교환(ML-KEM768 × x25519)

- ✅ W5500-EVB-Pico에서 WIZnet W5500을 통한 유선 이더넷

- ✅ 통일된 Wi-Fi/유선 스택을 위해 W5500을 smoltcp/embassy-net 아래 MACRAW 모드로 운용

- ✅ 무선↔유선 한 줄 전환(`--features w5500`)

- ✅ 완전한 SPI 하드웨어 초기화 포함; 선택 가능하고 컴파일 단계에서 검증되는 빌드 타깃

- ✅ Dropbear SSH의 저자가 만든 프로젝트

### Q&A

**Q. Sunset은 W5500의 하드웨어 TCP/IP 오프로드(TOE)를 쓰나요?** 아니요. W5500을 **MACRAW 모드**로 씁니다 — 칩은 생 이더넷 프레임을 옮기고, TCP/IP는 smoltcp/`embassy-net`가 소프트웨어로 처리합니다. 이는 의도적입니다: 유선 경로와 Wi-Fi(cyw43) 경로가 동일한 async 네트워크 스택을 공유하게 해주는데, 이쪽이 W5500의 고정 8소켓 TOE보다 다중 세션 SSH 서버에 더 잘 맞습니다.

**Q. 그냥 Pico W의 Wi-Fi를 쓰면 되지 왜 W5500인가요?** 유선 이더넷은 결정적 지연, RF 간섭 없음, ~200 kB Wi-Fi 펌웨어 블롭 불필요를 주고, 산업·고정 설치에 맞습니다. 또 이더넷 하드웨어가 전무한 맨 RP2040에 진짜 RJ45를 달아줍니다.

**Q. 나중에 W5500의 TOE로 전환할 수 있나요?** 원리상 가능합니다 — W5500은 TCP/UDP 소켓 모드도 지원합니다. 다만 Wi-Fi 경로와 공유하던 통일된 smoltcp 인터페이스를 잃게 되므로, 이 아키텍처에서는 MACRAW가 더 나은 선택입니다.

**Q. W5500 경로는 양산 준비가 됐나요?** 통합은 실제로 존재하고 컴파일 단계에서 검증되며, 하드웨어 초기화 전체가 레포에 있습니다. 다만 빠르게 발전 중인 라이브러리인 만큼, 배치하는 쪽에서 버전을 고정하고 실제 하드웨어 검증을 직접 수행하는 것이 좋습니다.

---

Source: https://maker.wiznet.io/Lihan__/projects/sunset/
