1. A method to protect media flows against congestion losses, the method comprising: measuring congestion by delay samples; performing a dynamic FEC algorithm that uses convex hull clustering for loss-event classification, including determining an FEC rate according to the loss-event classification.