The disclosed embodiments include a system and method for modifying network traffic. For example, in one embodiment, the method includes receiving a packet at an intermediate network node at a network layer. The method determines at the intermediate network node whether layer injection can be performed at the intermediate network node. If layer injection can be performed at the intermediate network node, the method identifies at least one application or protocol associated with the packet using deep packet inspection. The method determines a routing modification based on the identified application protocol. The method then performs the routing modification on the packet.