When Internet Protocol (IP) packets or Layer-2 MAC Protocol packets are
encapsulated in a MultiProtocol Label Switching (MPLS) packet, one or
more labels are assigned to identify the routers of the MPLS network
through which the packet has passed. From this information, the
underlying protocol (e.g., IP, MAC) can be inferred. In one embodiment,
the value assigned to the one or more labels is selected to identify the
underlying protocol. In one embodiment, IP packets have label values in a
first range and MAC packets have label values in a second range. When the
MPLS-encapsulated packets are switched within a load sharing environment,
the ranges of the label values indicate the underlying protocol of the
packet being switched. Knowing the underlying protocol enables a hash
function to be selected that will both preserve packet ordering and
effectively load share traffic received from a higher-speed source link
across multiple lower-speed links.