{
    "content": [
        {
            "type": "text",
            "text": "# tc-sfb (man)\n\n## NAME\n\nsfb - Stochastic Fair Blue\n\n## SYNOPSIS\n\ntc  qdisc ... blue rehash milliseconds db milliseconds limit packets max packets target pack‐\nets increment float decrement float penaltyrate packets per second penaltyburst packets\n\n## DESCRIPTION\n\nStochastic Fair Blue is a classless qdisc to manage congestion based on packet loss and  link\nutilization  history while trying to prevent non-responsive flows (i.e. flows that do not re‐\nact to congestion marking or dropped packets) from impacting performance of responsive flows.\nUnlike  RED,  where the marking probability has to be configured, BLUE tries to determine the\nideal marking probability automatically.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **ALGORITHM**\n- **LIMITATIONS**\n- **PARAMETERS**\n- **STATISTICS**\n- **NOTES** (1 subsections)\n- **SEE ALSO**\n- **SOURCES**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "tc-sfb",
        "section": "",
        "mode": "man",
        "summary": "sfb - Stochastic Fair Blue",
        "synopsis": "tc  qdisc ... blue rehash milliseconds db milliseconds limit packets max packets target pack‐\nets increment float decrement float penaltyrate packets 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": 19,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "PARAMETERS",
                "lines": 44,
                "subsections": []
            },
            {
                "name": "STATISTICS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 8,
                "subsections": [
                    {
                        "name": "EXAMPLE & USAGE",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SOURCES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "sfb - Stochastic Fair Blue\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "tc  qdisc ... blue rehash milliseconds db milliseconds limit packets max packets target pack‐\nets increment float decrement float penaltyrate packets per second penaltyburst packets\n\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Stochastic Fair Blue is a classless qdisc to manage congestion based on packet loss and  link\nutilization  history while trying to prevent non-responsive flows (i.e. flows that do not re‐\nact to congestion marking or dropped packets) from impacting performance of responsive flows.\nUnlike  RED,  where the marking probability has to be configured, BLUE tries to determine the\nideal marking probability automatically.\n\n",
                "subsections": []
            },
            "ALGORITHM": {
                "content": "The BLUE algorithm maintains a probability which is used to mark or drop packets that are  to\nbe  queued.  If the queue overflows, the mark/drop probability is increased. If the queue be‐\ncomes empty, the probability is decreased. The Stochastic Fair Blue (SFB)  algorithm  is  de‐\nsigned to protect TCP flows against non-responsive flows.\n\nThis  SFB  implementation  maintains  8  levels of 16 bins each for accounting.  Each flow is\nmapped into a bin of each level using a per-level hash value.\n\nEvery bin maintains a marking probability, which gets increased or decreased based on bin oc‐\ncupancy.  If  the  number of packets exceeds the size of that bin, the marking probability is\nincreased. If the number drops to zero, it is decreased.\n\nThe marking probability is based on the minimum value of all bins  a  flow  is  mapped  into,\nthus,  when a flow does not respond to marking or gradual packet drops, the marking probabil‐\nity quickly reaches one.\n\nIn this case, the flow is rate-limited to penaltyrate packets per second.\n\n",
                "subsections": []
            },
            "LIMITATIONS": {
                "content": "Due to SFBs nature, it is possible for responsive flows to share all of its bins with a  non-\nresponsive flow, causing the responsive flow to be misidentified as being non-responsive.\n\nThe  probability  of a responsive flow to be misidentified is dependent on the number of non-\nresponsive flows, M. It is (1 - (1 - (1 / 16.0))  M) 8, so for example  with  10  non-re‐\nsponsive flows approximately 0.2% of responsive flows will be misidentified.\n\nTo  mitigate  this,  SFB performs performs periodic re-hashing to avoid misclassification for\nprolonged periods of time.\n\nThe default hashing method will use source and destination ip addresses and port  numbers  if\npossible,  and  also supports tunneling protocols.  Alternatively, an external classifier can\nbe configured, too.\n\n",
                "subsections": []
            },
            "PARAMETERS": {
                "content": "rehash Time interval in milliseconds when queue perturbation occurs to avoid erroneously  de‐\ntecting  unrelated,  responsive  flows as being part of a non-responsive flow for pro‐\nlonged periods of time.  Defaults to 10 minutes.\n\ndb     Double buffering warmup wait time, in milliseconds.  To avoid destroying the probabil‐\nity history when rehashing is performed, this implementation maintains a second set of\nlevels/bins as described in section 4.4 of the SFB reference.  While one set  is  used\nto  manage the queue, a second set is warmed up: Whenever a flow is then determined to\nbe non-responsive, the marking probabilities in the second set are updated.  When  the\nrehashing  happens, these bins will be used to manage the queue and all non-responsive\nflows can be rate-limited immediately.  This value determines how  much  time  has  to\npass before the 2nd set will start to be warmed up.  Defaults to one minute, should be\nlower than rehash.\n\nlimit  Hard limit on the real (not average) total queue size in packets.  Further packets are\ndropped. Defaults to the transmit queue length of the device the qdisc is attached to.\n\nmax    Maximum  length  of  a  buckets queue, in packets, before packets start being dropped.\nShould be slightly larger than target , but should not be set to values exceeding  1.5\ntimes that of target .  Defaults to 25.\n\ntarget The  desired average bin length. If the bin queue length reaches this value, the mark‐\ning probability is increased by increment.  The default value depends on the max  set‐\nting, with max set to 25 target will default to 20.\n\nincrement\nA  value  used  to increase the marking probability when the queue appears to be over-\nused. Must be between 0 and 1.0. Defaults to 0.00050.\n\ndecrement\nValue used to decrease the marking probability when the queue is found  to  be  empty.\nMust be between 0 and 1.0.  Defaults to 0.00005.\n\npenaltyrate\nThe  maximum  number  of packets belonging to flows identified as being non-responsive\nthat can be enqueued per second. Once this number has been reached, further packets of\nsuch  non-responsive flows are dropped.  Set this to a reasonable fraction of your up‐\nlink throughput; the default value of 10 packets is probably too small.\n\npenaltyburst\nThe number of packets a flow is permitted to exceed the penalty  rate  before  packets\nstart being dropped.  Defaults to 20 packets.\n\n",
                "subsections": []
            },
            "STATISTICS": {
                "content": "This qdisc exposes additional statistics via 'tc -s qdisc' output.  These 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 value is high, there\nare many non-reactive flows being sent through sfb. In such cases, it might be  better\nto  embed  sfb within a classful qdisc to better control such flows using a different,\nshaping qdisc.\n\nbucketdrop\nThe number of packets dropped because a per-flow queue was full.  High bucketdrop  may\npoint to a high number of aggressive, short-lived flows.\n\nqueuedrop\nThe number of packets dropped due to reaching limit. This should normally 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 have been detected as\nnon-reactive.\n\n",
                "subsections": []
            },
            "NOTES": {
                "content": "SFB automatically enables use of Explicit Congestion Notification (ECN).  Also, this SFB  im‐\nplementation  does not queue packets itself.  Rather, packets are enqueued to the inner qdisc\n(defaults to pfifo).  Because sfb maintains virtual queue states, the inner  qdisc  must  not\ndrop  a  packet  previously  queued.  Furthermore, if a buckets queue has a very high marking\nrate, this implementation will start dropping packets instead of marking them, as such a sit‐\nuation points to either bad congestion, or an unresponsive flow.\n\n",
                "subsections": [
                    {
                        "name": "EXAMPLE & USAGE",
                        "content": "To 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, perturbing hash results ev‐\nery 10 minutes:\n\n# tc filter add dev $DEV parent 1: handle 1 flow hash keys dst perturb 600\n\n"
                    }
                ]
            },
            "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  Active  Queue  Management\nAlgorithms, U. Michigan CSE-TR-387-99, April 1999.\n\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "This SFB implementation was contributed by Juliusz Chroboczek and Eric Dumazet.\n\n\n\niproute2                                     August 2011                                      SFB(8)",
                "subsections": []
            }
        }
    }
}