Patent ID: 8923294

Claim:
A computer-implemented method comprising: receiving, by an agent included in a computer system including one or more computers in a network, a data packet having a payload and a packet header including at least an Ethernet header identifying a source address and a destination address in the network; determining, with the agent and using at least one of the packet header and the payload, a traffic type of the data packet; selecting, with the agent and based on the traffic type determined, layer-2 forwarding information which encodes a set of one or more service provider middle boxes in the network to be traversed by the data packet, the service provider middle boxes providing non-forwarding network services, wherein the layer-2 forwarding information identifies a sequence of one or more middle box services to be applied to the data packet; inserting, with the agent, the layer-2 forwarding information into the Ethernet header to generate a modified Ethernet header; and forwarding, with the agent and using the layer-2 forwarding information, the data packet having the modified Ethernet header to the network, such that the data packet will then traverse the set of one or more middle boxes, wherein a non-forwarding network service will be provided by each of the one or more middle boxes on the data packet in a sequence, wherein the layer-2 forwarding information is either: (A) a label identifying a sequence of the one or more non-forwarding network service provider middle boxes to be traversed by the data packet, wherein if the layer-2 forwarding information is the label, the act of inserting the layer-2 information into the Ethernet header comprises inserting the label into the Ethernet header ahead of a type field in the Ethernet header; or (B) a bitmap identifying a sequence of the one or more middle box services to be applied to the data packet.