tcp: create a helper to model exponential backoff