COS

From Juniper JSRX Wiki

Jump to: navigation, search

When a network experiences congestion and delay, some packets must be dropped. JUNOS Software Class of Service (COS), or also known as Quality of Serivce (QOS) to Cisco, allows you to divide traffic into classes and offer various levels of throughput and packet loss when congestion occurs. This allows packet loss to happen according to the rules you configure.

Terminology

assured forwarding (AF): CoS packet forwarding class that provides a group of values you can define and includes four subclasses, AF1, AF2, AF3, and AF4, each with three drop probabilities, low, medium, and high.

behavior aggregate (BA) classifier: Feature that can be used to determine the forwarding treatment for each packet. The behavior aggregate classifier maps a code point to a forwarding class and loss priority. The loss priority is used later in the work flow to select one of the two drop profiles used by random early detection (RED).

best effort (BE): CoS packet forwarding class that provides no service profile. For the BE forwarding class, loss priority is typically not carried in a code point, and random early detection (RED) drop profiles are more aggressive.

class of service (CoS): Method of classifying traffic on a packet-by-packet basis, using information in the type-of-service (ToS) byte to assign traffic flows to different service levels.

Differentiated Services (DiffServ): Services based on RFC 2474, Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers. The DiffServ method of CoS uses the type-of-service (TOS) byte to identify different packet flows on a packet-by-packet basis. DiffServ adds a Class Selector code point (CSCP) and a DiffServ code point (DSCP).

DiffServ code point (DSCP) values: Values for a 6-bit field defined in IP packet headers that can be used to enforce class-of-service (CoS) distinctions.

drop profile: Drop probabilities for different levels of buffer fullness that are used by random early detection (RED) to determine when to drop packets from a given J Series or SRX Series device scheduling queue.

expedited forwarding (EF): CoS packet forwarding class that provides end-to-end service with low loss, low latency, low jitter, and assured bandwidth.

multifield (MF) classifier: Firewall filter that scans through a variety of packet fields to determine the forwarding class and loss priority for a packet and polices traffic to a specific bandwidth and burst size. Typically, a classifier performs matching operations on the selected fields against a configured value.

network control (NC): CoS packet forwarding class that is typically high priority because it supports protocol control.

PLP bit: Packet loss priority bit. Used to identify packets that have experienced congestion or are from a transmission that exceeded a service provider's customer service license agreement. A J Series or SRX Series device can use the PLP bit as part of a congestion control strategy. The bit can be configured on an interface or in a filter.

policer: Feature that limits the amount of traffic passing into or out of an interface. It is an essential component of firewall filters that is designed to thwart denial-of-service (DoS) attacks. A policer applies rate limits on bandwidth and burst size for traffic on a particular J Series device interface.

policing: Applying rate and burst size limits to traffic on an interface.

random early detection (RED): Gradual drop profile for a given class, used for congestion avoidance. RED attempts to anticipate congestion and reacts by dropping a small percentage of packets from the tail of the queue to prevent congestion.

rule: Guide that the device follows when applying services. A rule consists of a match direction and one or more terms.

Sample Configs

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                filter {
                    input ingress-1;
                }
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family inet {
                filter {
                    input ingress-2;
                }
            }
        }
    }
    ge-0/0/2 {
        unit 0 {    
            family inet {
                filter {
                    input ingress-3;
                }
            }
        }
    }
}
class-of-service {
    forwarding-classes {
        queue 0 assured-forwarding;
        queue 1 best-effort;
        queue 2 expedited-forwarding;
    }
    interfaces {
        ge-0/0/3 {
            unit 0 {
                scheduler-map 1st;
                shaping-rate 100m;
            }
        }
    }
    scheduler-maps {
        1st {
            forwarding-class assured-forwarding scheduler test1;
            forwarding-class best-effort scheduler test2;
            forwarding-class expedited-forwarding scheduler test3;
        }
    }
    schedulers {
        test1 {
            transmit-rate 45m;
            buffer-size percent 45;
            priority low;
        }
        test2 {
            transmit-rate 45m;
            buffer-size percent 45;
            priority low;
        }
        test3 {
            transmit-rate 10m;
            buffer-size percent 10;
            priority low;
        }
    }               
}
firewall {
    filter ingress-1 {
        term 1 {
            then forwarding-class assured-forwarding;
        }
    }
    filter ingress-2 {
        term 1 {
            then forwarding-class best-effort;
        }
    }
    filter ingress-3 {
        term 1 {
            then forwarding-class expedited-forwarding;
        }
    }
}

SRX

By default, the SRX Series devices support 4 queues. You can use the following CLI statement to change that setting to eight queues:

[edit]
chassis {
  fpc 1 {
    pic 1 {
    max-queue-per-interface 8;
    }
  }
}

The new setting will take effect when the FPC is restarted.

Personal tools