13.5. DiffServ with IPsec

The Differentiated Services (DiffServ) field in a packet can be used by network equipment to prioritize data traffic. The 8 bit DiffServ field consists of two parts: a 6 bit Differentiated Services Code Point (DSCP) and a 2 bit Explicit Congestion Notification (ECN). For IPsec, the DSCP bits related to a tunnel can be split into three types:

The administrator can alter the DSCP bits in the following ways:

Setting up the above two options is described next.

Specifying the DSCP Bits for IKE Traffic

By default, all IKE packets sent by cOS Stream during tunnel setup have their DSCP value set to zero. This can be changed to a fixed value for a tunnel by setting the IKEDSCP property of the IPsecTunnel object. For example:
System:/> set Interface IPsecTunnel my_tunnel IKEDSCP=44
The IKE DSCP bits cannot be copied from other traffic, which can be done with the IPsec tunnel following the IKE negotiation.

Setting the DSCP Bits in the Outer Tunnel

By default, all IPsec outer tunnel packets sent by cOS Stream have their DSCP value set to zero. This can be changed to either of the following two options:

Propagating ECN Information Across the Tunnel

There is a 2 bit Explicit Congestion Notification (ECN) portion in the DiffServ field that is used to communicate network congestion information. To enable the propagation of ECN information about congestion from routers on the public outer network to the protected inner network, the ECN property of the IPsecTunnel object should be set to Yes. For example:
System:/> set Interface IPsecTunnel my_tunnel ECN=Yes
cOS Stream will now combine the ECN fields of the outer and inner IP header according to standardized rules.