2026-04-26 | linux · networking | #vxlan #ipip #gre #wireguard #tunnel #overlay #ip-tunnel #metadata-dst #encapsulation #vtep #bpftrace
隧道是 overlay 网络的基础设施。本文从 Linux 6.6 内核源码拆解四类隧道协议的实现:ip_tunnel 通用框架与 struct ip_tunnel_key 元数据、IPIP 最小开销封装、GRE 可选头部与 ERSPAN 集成、VXLAN 的 UDP 封装路径与 FDB 转发表、metadata mode 流式隧道与 OVS/Cilium 集成、WireGuard 的 Noise 协议与加密路由模型,以及各协议的封装开销与硬件卸载能力对比。
2026-04-20 | linux · networking | #udp #linux-kernel #socket-lookup #reuseport #udp-gro #recvmmsg #early-demux #encapsulation #bpftrace
UDP 简单?在内核中它一点都不简单。双哈希表 socket 查找、SO_REUSEPORT 多核分发、Early Demux 路由缓存、UDP GRO 聚合、reader_queue 无锁读、forward allocation 内存管理、UDP 封装(ESP/L2TP/VXLAN)——本文从 Linux 6.6 内核源码拆解 UDP 的每一个优化细节。