Hacker News new | ask | show | jobs
by toast0 17 days ago
Selectively allowing IPs is a reasonable way to do it. If you think about it, it's terrible, but it will get you going, and it's pretty easy do something like start with allow nothing, then allow all ips under 2.0.0.0, then 3.0.0.0, etc.

Distribution of users by /8 isn't very even and the order that customers will get online wouldn't be an order anyone would pick, but it should be reasonable to implement and synchronize (if needed) and it lets you make progress.

You could do similar in IPv6, start allowing IPs under 2001::, and bump it up little by little... probably each increment would be the 2nd byte, but you do need to increase the first byte too ... or you could be a terrible person and drop ipv6 while you modulate ipv4 and only let ipv6 in when ipv4 is at 100%.

Works better the earliest you can apply it... if your whole stack passes through requests and the origin is looking at X-Forwarded-For (or similar) headers to drop requests, your whole stack worked on it for nothing... Which could be ok, but your frontends might be much happier if they just dropped SYNs from IPs when the request will fail.

1 comments

I’m wondering if you’re preparing for cold start ahead of time you could create a better cold start IP range map that’s distributed more evenly for more predictable turn up, and also with better affinity so you can you report progress in a way people can understand ( eg state by state). It would be a pain to load and activate the map into edge routers in a hurry, but maybe be necessary. Some superscalers are deep into writing their own networking firmware, this could go into design requirements for text revision.

Another idea is to have different clients use different ports (enterprise customers on one port, SMB on another) and turn up in the order of SLA.

The issue with a better range map is when you're in overload, you don't want to spend a lot of compute on connections/requests you're dropping. Looking up an ip in a table can be a lot more work than checking if the ip is less than the current max value.

You probably could do work ahead of time to measure traffic proportions, so you could more accurately modulate and indicate the proportion of traffic allowed. It's nice to be able to increase traffic in measured steps, but it's hard to guess how much traffic will increase for each /8 you add, other than ones that should be zero.