real routing hardware, and real traffic shaping hardware.
A cheap or old PC running Linux with the necessary cards in it will do both of those with no problems.
Is there free software that can do the traffic shaping even once the P2P users start using random ports and encrypted traffic ? (without bundling
all traffic not to/from well know ports into the same shaping profile)
Mmm.. without looking too hard, I'd say one could configure Linux to do that with a bit of thought. And perhaps add a runtime script or two to self-adjust it on the fly as needed.
As usual with Linux, all of the necessary tools are there. But they likely would need a bit of scripting glue to fit any given scenario.
Cheers