|
The basic idea of the TCP-friendly policer is to knock out a frame from the TCP stream before complete token depletion; just in time to let the sender detect the congestion and perform fast retransmit. During fast-retransmit the sending rate is reduced and congestion avoidance mode is maintained.
Of course, in practice multiple flows share a link, and consequently it is not sufficient to knock out just one frame when the token count crosses a threshold. A simple solution is then to emulate the well-known Random Early Detection (RED) algorithm, but instead of linking it to the queue depth, link RED to the inverse of the token count.
An equivalent method to the TCP-friendly policer above is proposed in RFC2859
Although the text introduces is rather differently, the two methods are quite equivalent, and solve the same issue based on the same principle. RFC 2859 calculates an estimated rate of the traffic and then sets colors based on a stochastic process, where the probability of marking increases with the estimated rate of the traffic stream.
A TCP-friendly policer should mark ECN-bits if the packet belongs to a stream that supports ECN, rather than discarding it. The sender would react the same way as if the packet would have been lost, except it could save the bandwidth for retransmitting the packet that was marked. The method is also faster than the loss-based 3-duplicate ack method of TCP, because the standard requires TCP clients to send an immediate ACK to the sender with the TCP option for congestion experienced set.
How to police TCP flows with a single token bucket?
Ok, so you do not have a TCP-friendly policer in your gear. What now?
First, the issue in reality is not that acute, as the phenomenon is much worse in the lab than in reality. The reason is that in reality round trip times are much larger, hence TCP ramp-ups are slower, and the goodput of a policed TCP flow is not much lower than that of a shaped one.
Furthermore, subscribers that only browse and do not use long-lived transfers will in fact see a better performance than those limited by shapers, because the RTT is not artificially inflated. Gamers will usually also benefit, as network games are built such that they can tolerate quite some loss, but an extra 50ms delay can ruin the experience of a real-time gamer.
A fairly good TCP goodput can be achieved with policer burst tolerances in the area of 96 - 128Kbytes. Such burst tolerances are suitable for today’s most common broadband access speeds of 3 to 10Mbps. In lab-tests performed, a 3-minute download from a fast public file-server took only 3 seconds longer with policing than with shaping, so for most practical purposes policing should be OK.
Shaping should be used when there are serious concerns about the negative effect of bursting micro-flows for other traffic. This however is seldom the case in data traffic classes in modern gigabit networks, and should occur at places when traffic enters the netowork, rather than where it exits towards the subscriber.
To summarize: long-lived TCP flows (e.g.: P2P file sharing) benefit from a shaped solution, to the expense of transactional services (browsing) and gaming, applications that would benefit more from a policer with a well-defined burst tolerance.
|