Guest-external networking: VirtioNet exists but is wired to nothing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Read crates/hv2-core/src/vm.rs around attach_vsock, then crates/hv2-core/src/devices/virtio.rs and its test_virtio_net_* tests. For the guest driver, follow crates/hv2-unikernel/src/vsock.rs; inspect crates/hv2-net/src/nat.rs and hv2-net::tap for the host path. Done means attaching the device, sending and receiving guest frames, and routing translated traffic through TAP; the issue lays out three substantial pieces with no single test named.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to the hv2_net::nat work (#94, closed) and to the Botnet arena-sandbox design that motivated it: a guest still cannot reach an external host-routable TCP endpoint end to end. Filed as a roadmap issue rather than a PR -- this is a three-piece gap, and I want to lay out what's actually there today (some of it further along than it looks) before anyone starts on it.
What already exists
crates/hv2-core/src/devices/virtio.rs: a full host-sideVirtioNetdevice model --VirtioNetHeader, queues, MAC/status config, aSharedVirtioNetwrapper -- with its own unit test suite (test_virtio_net_*, lines 730-893). This is not a stub.crates/hv2-net/src/nat.rs(added in #94's parent work,8f130b9/6e7df33): a tested, pure IPv4/TCP/UDP NAT translation table -- guest-egress source-port allocation + checksum recompute, static ingress port-forwards. Also not a stub, but it does no I/O of its own -- it expects something to hand it frames.crates/hv2-unikernel/src/vsock.rs: a working virtio-vsock guest driver, proving the pattern this repo already uses for a from-scratchno_stdvirtio driver: a fixed MMIO window (VM::attach_vsockputs it atSelf::VSOCK_MMIO_BASE, matching avirtio_mmio.device=4K@0xd0000000:5kernel-cmdline-style fixed address the driver hard-codes), a static guest-memory map for rings/buffers (no allocator dependency), and a polling (not interrupt-driven) receive loop.
What's missing -- three independent pieces, all required
VMhas noattach_net(or similarly named) method.crates/hv2-core/src/vm.rshasattach_vsock/attach_vsock_at/attach_vsock_pci(lines 1119-1344 area) but nothing that registers aVirtioNet/SharedVirtioNetas an MMIO (or PCI) transport the wayattach_vsockdoes for vsock. The device model exists; nothing connects it to a runningVM.hv2-unikernelhas no net driver. Itssrc/is exactlyboot.rs,interrupts.rs,mem.rs,vsock.rs(seemain.rs:68-71) -- nonet.rs.vsock.rsis the template to follow: same virtio-mmio v2 bring-up sequence, same fixed-address ring/buffer map style (see itsmod memblock), same polling model -- just againstVirtioNetHeader's framing and a different device ID instead of vsock's packet header/ops.- Nothing wires
hv2_net::nat's translation to a real interface. Even with (1) and (2) done, something host-side has to read frames off wherever the guest's virtio-net queue lands, run them throughNatTable::translate_outbound/translate_inbound, and hand the result to/from the host's actual network stack (a TAP device viahv2-net::tap, or a raw socket). None of that loop exists yet.
Suggested order
Mirrors how vsock was actually built here (driver proven under a minimal harness before it carried real traffic):
VM::attach_net, followingattach_vsock's shape -- register aVirtioNetat a fixed MMIO window, return a handle the host side can read/write.hv2-unikernel'snet.rs, followingvsock.rs's shape -- bring-up, static ring/buffer map, pollingrecv/send. Provable in isolation the same way vsock was: a guest that can send and receive a raw frame, before anything about IP is involved.- The glue loop: host reads a frame from the attached
VirtioNet, callshv2_net::nat, writes the translated frame to a TAP device (hv2-net::tap), and the reverse direction. This is whereNatTablegets its first real caller -- worth remembering the closed #94's note that neither8f130b9nor6e7df33"could affect a running HyperMachine:NatTablehas no callers outside this file" was still true as of that commit.
Not attempting any of this myself in code -- filing it so the shape of the remaining work is written down somewhere before someone (possibly me, in a later session) picks it up.
- Ngôn ngữ chính
- Rust
- Star
- 103
- Fork
- 3
- Merge trung bình
- 9 giờ 56 phút
- Pull request đã merge (30 ngày)
- 137
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nervosys/HyperMachine
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
nervosys/HyperMachine#96 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nervosys/HyperMachine
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
farion1231/cc-switch#8829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ci good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
longbridge/gpui-kit#3677 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
E-pr-welcome
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
seanmonstar/reqwest#3121 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
ilya-zlobintsev/LACT#1235 ·
Maintainer thường phản hồi trong vòng 1 ngày