In accordance with an embodiment, a network device has an input port for receiving input packets, and an output port for sending output packets, where the input packets and output packets have context layer information. The network device also includes a processor configured to process the input packets and output packets using a network protocol having a context layer.