Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> fit the entire IP range in a single 32 bit value

… only if you pretend IPv6 does not exist, which isn't the case in the original blogpost.

But the idea can be extended to fit entire IP (both v4 and v6) subnets in an uint64, given that the minimal IPv6 prefix size to be globally routed is /48, you could use the first byte of the uint64 to mark the address type (e.g. 0x4 for IPv4 and 0x6 for IPv6), the remaining 3 (for IPv4) or 6 (for IPv6) bytes for actual prefix, and the last byte for prefix length.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: