{
    "content": [
        {
            "type": "text",
            "text": "# SFB (info)\n\n## NAME\n\nsfb - Stochastic Fair Blue\n\n## SYNOPSIS\n\ntc qdisc ... blue rehash milliseconds db milliseconds limit packets max\npackets target packets increment  float  decrement  float  penaltyrate\npackets per second penaltyburst packets\n\n## DESCRIPTION\n\nStochastic Fair Blue is a classless qdisc to manage congestion based on\npacket loss and link utilization history while trying to  prevent  non-\nresponsive flows (i.e. flows that do not react to congestion marking or\ndropped packets) from impacting performance of responsive  flows.   Un-\nlike  RED,  where  the  marking  probability has to be configured, BLUE\ntries to determine the ideal marking probability automatically.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ALGORITHM**\n- **LIMITATIONS**\n- **PARAMETERS**\n- **STATISTICS**\n- **NOTES**\n- **SEE ALSO**\n- **SOURCES**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SFB",
        "section": "",
        "mode": "info",
        "summary": "sfb - Stochastic Fair Blue",
        "synopsis": "tc qdisc ... blue rehash milliseconds db milliseconds limit packets max\npackets target packets increment  float  decrement  float  penaltyrate\npackets per second penaltyburst packets",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "tc",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tc/8/json"
            },
            {
                "name": "tc-red",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tc-red/8/json"
            },
            {
                "name": "tc-sfq",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tc-sfq/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "ALGORITHM",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 55,
                "subsections": []
            },
            {
                "name": "STATISTICS",
                "lines": 31,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SOURCES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "sfb - Stochastic Fair Blue\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tc qdisc ... blue rehash milliseconds db milliseconds limit packets max\npackets target packets increment  float  decrement  float  penaltyrate\npackets per second penaltyburst packets\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Stochastic Fair Blue is a classless qdisc to manage congestion based on\npacket loss and link utilization history while trying to  prevent  non-\nresponsive flows (i.e. flows that do not react to congestion marking or\ndropped packets) from impacting performance of responsive  flows.   Un-\nlike  RED,  where  the  marking  probability has to be configured, BLUE\ntries to determine the ideal marking probability automatically.\n",
                "subsections": []
            },
            "ALGORITHM": {
                "content": "The BLUE algorithm maintains a probability which is  used  to  mark  or\ndrop  packets  that  are  to  be  queued.  If  the queue overflows, the\nmark/drop probability is increased. If the  queue  becomes  empty,  the\nprobability  is  decreased. The Stochastic Fair Blue (SFB) algorithm is\ndesigned to protect TCP flows against non-responsive flows.\n\nThis SFB implementation maintains 8 levels of 16 bins each for account-\ning.   Each  flow  is mapped into a bin of each level using a per-level\nhash value.\n\nEvery bin maintains a marking probability, which gets increased or  de-\ncreased  based  on  bin occupancy. If the number of packets exceeds the\nsize of that bin, the marking probability is increased. If  the  number\ndrops to zero, it is decreased.\n\nThe  marking  probability  is  based on the minimum value of all bins a\nflow is mapped into, thus, when a flow does not respond to  marking  or\ngradual packet drops, the marking probability quickly reaches one.\n\nIn this case, the flow is rate-limited to penaltyrate packets per sec-\nond.\n",
                "subsections": []
            },
            "LIMITATIONS": {
                "content": "Due to SFBs nature, it is possible for responsive flows to share all of\nits  bins with a non-responsive flow, causing the responsive flow to be\nmisidentified as being non-responsive.\n\nThe probability of a responsive flow to be misidentified  is  dependent\non  the  number of non-responsive flows, M. It is (1 - (1 - (1 / 16.0))\nM) 8, so for example with 10  non-responsive  flows  approximately\n0.2% of responsive flows will be misidentified.\n\nTo  mitigate  this,  SFB performs performs periodic re-hashing to avoid\nmisclassification for prolonged periods of time.\n\nThe default hashing method will use source and destination ip addresses\nand  port  numbers  if possible, and also supports tunneling protocols.\nAlternatively, an external classifier can be configured, too.\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "rehash Time interval in milliseconds when queue perturbation occurs  to\navoid erroneously detecting unrelated, responsive flows as being\npart of a non-responsive flow for  prolonged  periods  of  time.\nDefaults to 10 minutes.\n\ndb     Double  buffering  warmup  wait time, in milliseconds.  To avoid\ndestroying the probability history when rehashing is  performed,\nthis implementation maintains a second set of levels/bins as de-\nscribed in section 4.4 of the SFB reference.  While one  set  is\nused  to manage the queue, a second set is warmed up: Whenever a\nflow is then determined to be non-responsive, the marking proba-\nbilities  in the second set are updated. When the rehashing hap-\npens, these bins will be used to manage the queue and  all  non-\nresponsive  flows  can  be rate-limited immediately.  This value\ndetermines how much time has to pass before  the  2nd  set  will\nstart  to be warmed up.  Defaults to one minute, should be lower\nthan rehash.\n\nlimit  Hard limit on the real (not average) total queue size  in  pack-\nets.   Further  packets  are  dropped.  Defaults to the transmit\nqueue length of the device the qdisc is attached to.\n\nmax    Maximum length of a buckets queue, in  packets,  before  packets\nstart being dropped. Should be slightly larger than target , but\nshould not be set to values exceeding 1.5 times that of target .\nDefaults to 25.\n\ntarget The  desired average bin length. If the bin queue length reaches\nthis value, the marking probability is increased  by  increment.\nThe default value depends on the max setting, with max set to 25\ntarget will default to 20.\n\nincrement\nA value used to increase the marking probability when the  queue\nappears  to be over-used. Must be between 0 and 1.0. Defaults to\n0.00050.\n\ndecrement\nValue used to decrease the marking probability when the queue is\nfound  to  be  empty.  Must  be  between 0 and 1.0.  Defaults to\n0.00005.\n\npenaltyrate\nThe maximum number of packets belonging to flows  identified  as\nbeing  non-responsive that can be enqueued per second. Once this\nnumber has been reached, further packets of such  non-responsive\nflows  are  dropped.   Set this to a reasonable fraction of your\nuplink throughput; the default value of 10 packets  is  probably\ntoo small.\n\npenaltyburst\nThe  number of packets a flow is permitted to exceed the penalty\nrate before packets start being dropped.  Defaults to  20  pack-\nets.\n",
                "subsections": []
            },
            "STATISTICS": {
                "content": "This  qdisc  exposes  additional  statistics  via 'tc -s qdisc' output.\nThese are:\n\nearlydrop\nThe number of packets dropped before a per-flow queue was full.\n\nratedrop\nThe number of packets dropped because of rate-limiting.  If this\nvalue  is  high,  there  are  many non-reactive flows being sent\nthrough sfb. In such cases, it might  be  better  to  embed  sfb\nwithin  a  classful  qdisc  to better control such flows using a\ndifferent, shaping qdisc.\n\nbucketdrop\nThe number of packets dropped because a per-flow queue was full.\nHigh bucketdrop may point to a high number of aggressive, short-\nlived flows.\n\nqueuedrop\nThe number of packets dropped due to reaching limit. This should\nnormally be 0.\n\nmarked The number of packets marked with ECN.\n\nmaxqlen\nThe length of the current longest per-flow (virtual) queue.\n\nmaxprob\nThe  maximum  per-flow drop probability. 1 means that some flows\nhave been detected as non-reactive.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "SFB automatically  enables  use  of  Explicit  Congestion  Notification\n(ECN).   Also,  this  SFB implementation does not queue packets itself.\nRather, packets are enqueued to the inner qdisc  (defaults  to  pfifo).\nBecause  sfb  maintains  virtual queue states, the inner qdisc must not\ndrop a packet previously queued.  Furthermore, if a buckets queue has a\nvery high marking rate, this implementation will start dropping packets\ninstead of marking them, as such a situation points to either bad  con-\ngestion, or an unresponsive flow.\n\nEXAMPLE & USAGE\nTo attach to interface $DEV, using default options:\n\n# tc qdisc add dev $DEV handle 1: root sfb\n\nOnly  use  destination ip addresses for assigning packets to bins, per-\nturbing hash results every 10 minutes:\n\n# tc filter add dev $DEV parent 1: handle 1 flow hash keys dst  perturb\n600\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "tc(8), tc-red(8), tc-sfq(8)\n",
                "subsections": []
            },
            "SOURCES": {
                "content": "o      W.  Feng, D. Kandlur, D. Saha, K. Shin, BLUE: A New Class of Ac-\ntive Queue Management  Algorithms,  U.  Michigan  CSE-TR-387-99,\nApril 1999.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "This  SFB implementation was contributed by Juliusz Chroboczek and Eric\nDumazet.\n\niproute2                          August 2011                           SFB(8)",
                "subsections": []
            }
        }
    }
}