This would be done with a combination of firewall filters on the ingress interface(s) and rewrite-rules. I strongly suggest checking out the "Day One: Deploying Basic QoS" PDF:
http://www.juniper.net/us/en/community/junos/training-certification/day-one/fundamentals-series/deploying-basic-qos/
There are a few different hierarchies that need to be configured here: firewall filters, interfaces, rewrite-rules, and class of service interfaces. One thing that is often overlooked is that Juniper rewrites packet headers on outbound, even though the filters are configured on inbound. However, once you have your packets rewritten at the edge, it's possible to perform BA (behavior aggregate) classification on links further upstream from your edge, so you can keep the configurations a bit cleaner and standardized in the core.