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

Why can't there be an O(1) iptable? Just a hashmap?


For IPv4 it can be done, but it would take at least 512Mb of kernel memory. A hashmap would be inefficient in that case, just use a bit-array. For IPv6 however, you run out of memory with a bit-array. Using a dynamically allocated hashmap in the kernel in that would help the initial allocation, but then you can easily be DOS'ed by having a lot's of banned access and running out of kernel memory.




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

Search: