This article is mainly for understanding DEI bit and how to use this bit in JUNOS.
Understand how to use DEI bit
Understand DEI bit
DEI stands for Drop Eligible Indicator. it is a part of 802.1Q encapslution, it has value range of 0(default) and 1, when packet marked with DEI bit(bit value set to 1), it will be more likely to be dropped when consgestion happens.
following is an example of standard 802.1Q encapslution, from the figure you can see DEI bit:
Tag protocol identifier (TPID): a 16-bit field set to a value of 0x8100 in order to identify the frame as an IEEE 802.1Q-tagged frame. This field is located at the same position as the EtherType/length field in untagged frames, and is thus used to distinguish the frame from untagged frames.
Tag control information (TCI)
Priority code point (PCP): a 3-bit field which refers to the IEEE 802.1p priority. It indicates the frame priority level. Values are from 0 (best effort) to 7 (highest); 1 represents the lowest priority. These values can be used to prioritize different classes of traffic (voice, video, data, etc.). See also Class of Service or CoS.
Drop eligible indicator (DEI): a 1-bit field. (formerly CFI[note 1][2]) May be used separately or in conjunction with PCP to indicate frames eligible to be dropped in the presence of congestion.[3]
VLAN identifier (VID): a 12-bit field specifying the VLAN to which the frame belongs. The hexadecimal values of 0x000 and 0xFFF are reserved. All other values may be used as VLAN identifiers, allowing up to 4,094 VLANs. The reserved value 0x000 indicates that the frame does not belong to any VLAN; in this case, the 802.1Q tag specifies only a priority and is referred to as a priority tag. On bridges, VLAN 1 (the default VLAN ID) is often reserved for a management VLAN; this is vendor-specific.
How to use DEI bit:
Use DEI bit as in BA classifier to classify packets:
Defining Custom IEEE 802.1ad Maps
You can customize the default IEEE 802.1ad map by defining values for IEEE 802.1ad code points.
lab@router# show class-of-service classifiers { ieee-802.1ad dot1p_dei_class { forwarding-class best-effort { loss-priority low code-points 1101; } } }
Applying Custom IEEE 802.1ad Maps
You then apply the classifier map to the logical interface:
lab@router# show class-of-service interfaces ge-0/0/2 unit 0 { classifiers { ieee-802.1ad dot1p_dei_class; } } } use DEI in MF
Define firewall filter
lab@router# show firewall family bridge filter dei term 1 { from { learn-vlan-dei 0; } then forwarding-class REAL-TIME; }
apply filter to interface
set interfaces <interface> family bridge filter input dei
use rewrite rule to modify the DEI bit when send packet out
Create rewrite rules:
lab@router# show class-of-service rewrite-rules ieee-802.1ad dei forwarding-class REAL-TIME { loss-priority low code-point 1001; //here last bit 1 means dei = 1 }
apply rewrite rules:
yifengzhou@opera-re0# show class-of-service interfaces ge-0/0/2 unit 0 { classifiers { ieee-802.1ad dot1p_dei_class; } rewrite-rules { ieee-802.1ad dei; } }