I thought you needed 2 per possible chunk? One for the base port and another to get the port difference? Though maybe that's where I was going wrong...?
https://gist.github.com/38c0430b5084f8442858 for my entire implementation.
Edit: saw the answers above - it's 2400 average case, not worst case.