)]}'
{
  "log": [
    {
      "commit": "d9ab53ab40dcba66f34ca75695dc930e6093f789",
      "tree": "552f537b8f5decf1b74d8fc98b96ef3e65a01051",
      "parents": [
        "5bcd754ff8d7947978acb44e77dcab323973fb1e"
      ],
      "author": {
        "name": "Dinesh Dutt",
        "email": "ddutt@cumulusnetworks.com",
        "time": "Tue May 19 17:47:21 2015 -0700"
      },
      "committer": {
        "name": "Paul Jakma",
        "email": "paul.jakma@hpe.com",
        "time": "Tue Oct 04 13:07:52 2016 +0100"
      },
      "message": "bgpd, zebra: Use next hop tracking for connected routes too\n\nAllow next hop tracking to work with connected routes\nAnd cleanup obsolete code in bgp_scan and bgp_import.\n\nSigned-off-by: Dinesh Dutt \u003cddutt@cumulusnetworks.com\u003e\nSigned-off-by: Donald Sharp \u003csharpd@cumulusnetworks.com\u003e\nEdits: Paul Jakma \u003cpaul.jakma@hpe.com\u003e Rebase re-ordering conflicts with\n       NHT route-map, potential errors.\n"
    },
    {
      "commit": "60cc95921ae663de325ca3e76e8c05d8224986ab",
      "tree": "7d78102aa9650da4bba1355b2a6601135d687b37",
      "parents": [
        "4feb0d02c029e2e4f229f6283f579b8673b0ac11"
      ],
      "author": {
        "name": "Pradosh Mohapatra",
        "email": "pmohapat@cumulusnetworks.com",
        "time": "Mon Nov 09 20:21:41 2015 -0500"
      },
      "committer": {
        "name": "Paul Jakma",
        "email": "paul.jakma@hpe.com",
        "time": "Tue Sep 13 10:36:44 2016 +0100"
      },
      "message": "bgpd, doc, lib, zebra: nexthop-tracking in zebra\n\n0. Introduction\n\nThis is the design specification for next hop tracking feature in\nQuagga.\n\n1. Background\n\nRecursive routes are of the form:\n\n   p/m --\u003e n\n  [Ex: 1.1.0.0/16 --\u003e 2.2.2.2]\n\nwhere \u0027n\u0027 itself is resolved through another route as follows:\n\n   p2/m --\u003e h, interface\n  [Ex: 2.2.2.0/24 --\u003e 3.3.3.3, eth0]\n\nUsually, BGP routes are recursive in nature and BGP nexthops get\nresolved through an IGP route. IGP usually adds its routes pointing to\nan interface (these are called non-recursive routes).\n\nWhen BGP receives a recursive route from a peer, it needs to validate\nthe nexthop. The path is marked valid or invalid based on the\nreachability status of the nexthop.  Nexthop validation is also\nimportant for BGP decision process as the metric to reach the nexthop\nis a parameter to best path selection process.\n\nAs it goes with routing, this is a dynamic process. Route to the\nnexthop can change. The nexthop can become unreachable or\nreachable. In the current BGP implementation, the nexthop validation\nis done periodically in the scanner run. The default scanner run\ninterval is one minute. Every minute, the scanner task walks the\nentire BGP table. It checks the validity of each nexthop with Zebra\n(the routing table manager) through a request and response message\nexchange between BGP and Zebra process. BGP process is blocked for\nthat duration. The mechanism has two major drawbacks:\n\n(1) The scanner task runs to completion. That can potentially starve\n    the other tasks for long periods of time, based on the BGP table\n    size and number of nexthops.\n\n(2) Convergence around routing changes that affect the nexthops can be\n    long (around a minute with the default intervals). The interval\n    can be shortened to achieve faster reaction time, but it makes the\n    first problem worse, with the scanner task consuming most of the\n    CPU resources.\n\n\"Next hop tracking\" feature makes this process event-driven. It\neliminates periodic nexthop validation and introduces an asynchronous\ncommunication path between BGP and Zebra for route change notifications\nthat can then be acted upon.\n\n2. Goal\n\nStating the obvious, the main goal is to remove the two limitations we\ndiscussed in the previous section. The goals, in a constructive tone,\nare the following:\n\n- fairness: the scanner run should not consume an unjustly high amount\n  of CPU time. This should give an overall good performance and\n  response time to other events (route changes, session events,\n  IO/user interface).\n\n- convergence: BGP must react to nexthop changes instantly and provide\n  sub-second convergence. This may involve diverting the routes from\n  one nexthop to another.\n\n3. Overview of the changes\n\nThe changes are in both BGP and Zebra modules.  The short summary is\nthe following:\n\n- Zebra implements a registration mechanism by which clients can\n   register for next hop notification. Consequently, it maintains a\n   separate table, per (VRF, AF) pair, of next hops and interested\n   client-list per next hop.\n\n- When the main routing table changes in Zebra, it evaluates the next\n   hop table: for each next hop, it checks if the route table\n   modifications have changed its state. If so, it notifies the\n   interested clients.\n\n- BGP is one such client. It registers the next hops corresponding to\n   all of its received routes/paths. It also threads the paths against\n   each nexthop structure.\n\n- When BGP receives a next hop notification from Zebra, it walks the\n   corresponding path list. It makes them valid or invalid depending\n   on the next hop notification. It then re-computes best path for the\n   corresponding destination. This may result in re-announcing those\n   destinations to peers.\n\n4. Design\n\n4.1. Modules\n\nThe core design introduces an \"nht\" (next hop tracking) module in BGP\nand \"rnh\" (recursive nexthop) module in Zebra. The \"nht\" module\nprovides the following APIs:\n\nbgp_find_or_add_nexthop() : find or add a nexthop in BGP nexthop table\nbgp_find_nexthop() : find a nexthop in BGP nexthop table\nbgp_parse_nexthop_update() : parse a nexthop update message coming\n                              from zebra\n\nThe \"rnh\" module provides the following APIs:\n\nzebra_add_rnh() : add a recursive nexthop\nzebra_delete_rnh() : delete a recursive nexthop\nzebra_lookup_rnh() : lookup a recursive nexthop\n\nzebra_add_rnh_client() : register a client for nexthop notifications\n                         against a recursive nexthop\n\nzebra_remove_rnh_client(): remove the client registration for a\n                            recursive nexthop\n\nzebra_evaluate_rnh_table(): (re)evaluate the recursive nexthop table\n                            (most probably because the main routing\n                            table has changed).\n\nzebra_cleanup_rnh_client(): Cleanup a client from the \"rnh\" module\n                            data structures (most probably because the\n                            client is going away).\n\n4.2. Control flow\n\nThe next hop registration control flow is the following:\n\n\u003c\u003d\u003d\u003d\u003d      BGP Process       \u003d\u003d\u003d\u003d\u003e|\u003c\u003d\u003d\u003d\u003d      Zebra Process      \u003d\u003d\u003d\u003d\u003e\n                                  |\nreceive module     nht module     |  zserv module        rnh module\n----------------------------------------------------------------------\n              |                   |                  |\nbgp_update_   |                   |                  |\n      main()  | bgp_find_or_add_  |                  |\n              |        nexthop()  |                  |\n              |                   |                  |\n              |                   | zserv_nexthop_   |\n              |                   |       register() |\n              |                   |                  | zebra_add_rnh()\n              |                   |                  |\n\nThe next hop notification control flow is the following:\n\n\u003c\u003d\u003d\u003d\u003d     Zebra Process    \u003d\u003d\u003d\u003d\u003e|\u003c\u003d\u003d\u003d\u003d      BGP Process       \u003d\u003d\u003d\u003d\u003e\n                                |\nrib module         rnh module   |     zebra module        nht module\n----------------------------------------------------------------------\n              |                 |                   |\nmeta_queue_   |                 |                   |\n    process() | zebra_evaluate_ |                   |\n              |     rnh_table() |                   |\n              |                 |                   |\n              |                 | bgp_read_nexthop_ |\n              |                 |          update() |\n              |                 |                   | bgp_parse_\n              |                 |                   | nexthop_update()\n              |                 |                   |\n\n4.3. zclient message format\n\nZEBRA_NEXTHOP_REGISTER and ZEBRA_NEXTHOP_UNREGISTER messages are\nencoded in the following way:\n\n/*\n *     0                   1                   2                   3\n *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * |     AF                        |  prefix len   |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .      Nexthop prefix                                           .\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .                                                               .\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * |     AF                        |  prefix len   |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .      Nexthop prefix                                           .\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n */\n\nZEBRA_NEXTHOP_UPDATE message is encoded as follows:\n\n/*\n *     0                   1                   2                   3\n *  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * |     AF                        |  prefix len   |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .      Nexthop prefix getting resolved                          .\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * |        metric                                                 |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * |  #nexthops    |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * | nexthop type  |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .      resolving Nexthop details                                .\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .                                                               .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * | nexthop type  |\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n * .      resolving Nexthop details                                .\n * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n */\n\n4.4. BGP data structure\n\nLegend:\n\n/\\   struct bgp_node: a BGP destination/route/prefix\n\\/\n\n[ ]  struct bgp_info: a BGP path (e.g. route received from a peer)\n\n _\n(_)  struct bgp_nexthop_cache: a BGP nexthop\n\n   /\\         NULL\n   \\/--+        ^\n       |        :\n       +--[ ]--[ ]--[ ]--\u003e NULL\n   /\\           :\n   \\/--+        :\n       |        :\n       +--[ ]--[ ]--\u003e NULL\n                :\n  _             :\n (_).............\n\n4.5. Zebra data structure\n\nrnh table:\n\n           O\n          / \\\n         O   O\n            / \\\n           O   O\n\n        struct rnh\n        {\n          u_char flags;\n          struct rib *state;\n          struct list *client_list;\n          struct route_node *node;\n        };\n\n5. User interface changes\n\nquagga# show ip nht\n3.3.3.3\n resolved via kernel\n via 11.0.0.6, swp1\n Client list: bgp(fd 12)\n11.0.0.10\n resolved via connected\n is directly connected, swp2\n Client list: bgp(fd 12)\n11.0.0.18\n resolved via connected\n is directly connected, swp4\n Client list: bgp(fd 12)\n11.11.11.11\n resolved via kernel\n via 10.0.1.2, eth0\n Client list: bgp(fd 12)\n\nquagga# show ip bgp nexthop\nCurrent BGP nexthop cache:\n 3.3.3.3 valid [IGP metric 0], #paths 3\n  Last update: Wed Oct 16 04:43:49 2013\n\n 11.0.0.10 valid [IGP metric 1], #paths 1\n  Last update: Wed Oct 16 04:43:51 2013\n\n 11.0.0.18 valid [IGP metric 1], #paths 2\n  Last update: Wed Oct 16 04:43:47 2013\n\n 11.11.11.11 valid [IGP metric 0], #paths 1\n  Last update: Wed Oct 16 04:43:47 2013\n\nquagga# show ipv6 nht\nquagga# show ip bgp nexthop detail\n\nquagga# debug bgp nht\nquagga# debug zebra nht\n\n6. Sample test cases\n\n     r2----r3\n    /  \\  /\n  r1----r4\n\n- Verify that a change in IGP cost triggers NHT\n  + shutdown the r1-r4 and r2-r4 links\n  + no shut the r1-r4 and r2-r4 links and wait for OSPF to come back\n    up\n  + We should be back to the original nexthop via r4 now\n- Verify that a NH becoming unreachable triggers NHT\n  + Shutdown all links to r4\n- Verify that a NH becoming reachable triggers NHT\n  + no shut all links to r4\n\n7. Future work\n\n- route-policy for next hop validation (e.g. ignore default route)\n- damping for rapid next hop changes\n- prioritized handling of nexthop changes ((un)reachability vs. metric\n  changes)\n- handling recursion loop, e.g.\n   11.11.11.11/32 -\u003e 12.12.12.12\n   12.12.12.12/32 -\u003e 11.11.11.11\n   11.0.0.0/8 -\u003e \u003cinterface\u003e\n- better statistics\nAddresses upstream comments.\n\n\"show ip bgp nexthop detail\" couldn\u0027t display multiple NHs due to a bug.\nFix that.\n\nFix reference counts for the nexthop cache entries\n\nSigned-off-by: Pradosh Mohapatra \u003cpmohapat@cumulusnetworks.com\u003e\nSigned-off-by: Daniel Walton \u003cdwalton@cumulusnetworks.com\u003e\nSigned-off-by: Dinesh Dutt \u003cddutt@cumulusnetworks.com\u003e\nSigned-off-by: Donald Sharp \u003csharpd@cumulusnetworks.com\u003e\nSigned-off-by: Vivek Venkatraman \u003cvivek@cumulusnetworks.com\u003e\n\nFix reference counts for the nexthop cache entries.\n\nSigned-off-by: Vivek Venkatraman \u003cvivek@cumulusnetworks.com\u003e\n\nEdited-by: Paul Jakma \u003cpaul.jakma@hpe.com\u003e\n- Fix nexthop_ipv6_add defs in rib.h not having been modified with rib_ prefix.\n- Remove rib_lookup_and_pushup, appears not to be used except for\n  !HAVE_NETLINK \u0026\u0026 HAVE_STRUCT_IFALIASREQ case of ioctl.c::if_set_prefix,\n  so it\u0027s not being used at all on platform with most testing of RIB.\n"
    }
  ]
}
