NOTE: This project has been renamed from netem to flakenet.
Breaking changes
Renamed module and package. The import path is now github.com/kasader/flakenet and the package is flakenet.
import "github.com/kasader/flakenet" // was github.com/kasader/netemTo migrate:
go mod edit -droprequire github.com/kasader/netem
go get github.com/kasader/flakenet@v0.1.1...then update your imports and any netem. qualifiers to flakenet..
IPMaximumMTU is now 65535 (was 65536). 65535 is the largest value the 16-bit IP total-length field can express; the old value described a Linux loopback default rather than an IP limit.
Fixed
-
L4 header overhead is now included in transmission time.
getHeaderSizepreviously counted only the IPv4/IPv6 header, so bandwidth-limited connections transmitted slightly faster than an equivalent real link. TCP and UDP addresses now add their transport header:*net.TCPAddr→ +20 bytes*net.UDPAddr→ +8 bytes*net.IPAddr→ unchanged (raw IP sockets carry the transport header in the payload)- Custom
net.Addrimplementations → resolved fromNetwork(), with unrecognized networks contributing no L4 overhead
Expect marginally longer transfer times under a
Bandwidthpolicy — most visible with small packets, where headers dominate.
Added
TCPHeaderSize(20) andUDPHeaderSize(8) constants.- Table-driven tests for header-size calculation, covering TCP/UDP over v4 and v6, raw IP, custom
net.Addrimplementations, and unparseable addresses.
Documentation
- Rewrote the README for readability.
- Removed the Go Report Card badge.
Full changelog: v0.1.0...v0.1.1