In computer networking, a switch (a layer 2 broadcast domain) typically consists of several ports. The ports of the switch are important in determining the behavior of the switch in a number of applications (e.g., port isolation, quality of service (QoS), port security groups, etc.). Typically, physical network devices have provided such applications using 802.1PQ tags and DSCP fields in packet headers. Priority code point (PCP) field in the 802.1PQ tag of Ethernet headers are used to encode the priority of the traffic. The PCP field is 3 bits wide; thus, only 7 distinct values may be used in this field. Differentiated service code point (DSCP) uses 6 bits in the IP header to encode the per-hop-behavior of the traffic.
Network virtualization introduces logical forwarding elements and logical ports. Logical forwarding elements are virtualized switches that are implemented using physical switches (e.g., software or hardware switches). With network virtualization, 802.1PQ tags and DSCP fields are inadequate to provide the applications for the logical traffic belonging to several different tenants, because these fields can only classify a limited number of logical flows due to the small number of bits. With such a limited number of distinct values, providing such applications in the physical network devices is infeasible. The sheer number of logical networks belonging to different tenants makes it impossible to encode the logical port classification in the 802.1PQ tag or the DSCP field.
A logical forwarding element may contain far more logical ports than the number of physical ports a typical hardware switch contains. For example, in some embodiments, logical forwarding elements are implemented by software switches that are part of virtualization switches (e.g., hypervisors) in several host machines. The logical forwarding elements connect virtual machines (VMs) that are on the several host machines. The logical forwarding elements may belong to several different tenants that each maintain a set of logical forwarding elements in a logical network on the shared physical resources of the host machines. A single logical forwarding element can span hundreds or thousands of hypervisors that contain at least one physical interface attached to any logical port of the logical forwarding element. Traffic between any two logical ports may potentially traverse through many physical routers and physical switches.
In addition, since physical network devices carry traffic for all logical networks belonging to different tenants, implementing logical flow classification based applications (such as port isolation or QoS) in the physical network devices would not be readily scalable. The existing mechanisms to classify logical flows are inadequate because, as a logical network grows, the amount of network state that is required to implement the logical network increases at an unsustainable rate.