idnits 2.17.1 draft-ietf-babel-rfc6126bis-18.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with multicast IPv4 addresses in the document. If these are generic example addresses, they should be changed to use the 233.252.0.x range defined in RFC 5771 -- The draft header indicates that this document obsoletes RFC7557, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (August 2, 2020) is 1363 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-12) exists of draft-ietf-babel-hmac-10 ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) == Outdated reference: A later version (-10) exists of draft-ietf-babel-dtls-09 == Outdated reference: A later version (-07) exists of draft-ietf-babel-rtt-extension-00 == Outdated reference: A later version (-08) exists of draft-ietf-babel-source-specific-05 -- Obsolete informational reference (is this intentional?): RFC 6126 (Obsoleted by RFC 8966) -- Obsolete informational reference (is this intentional?): RFC 7298 (Obsoleted by RFC 8967) -- Obsolete informational reference (is this intentional?): RFC 7557 (Obsoleted by RFC 8966) Summary: 1 error (**), 0 flaws (~~), 7 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Chroboczek 3 Internet-Draft IRIF, University of Paris-Diderot 4 Obsoletes: 6126,7557 (if approved) D. Schinazi 5 Intended status: Standards Track Google LLC 6 Expires: February 3, 2021 August 2, 2020 8 The Babel Routing Protocol 9 draft-ietf-babel-rfc6126bis-18 11 Abstract 13 Babel is a loop-avoiding distance-vector routing protocol that is 14 robust and efficient both in ordinary wired networks and in wireless 15 mesh networks. This document describes the Babel routing protocol, 16 and obsoletes RFCs 6126 and 7557. 18 Status of This Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at https://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on February 3, 2021. 35 Copyright Notice 37 Copyright (c) 2020 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (https://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 53 1.1. Features . . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.2. Limitations . . . . . . . . . . . . . . . . . . . . . . . 4 55 1.3. Specification of Requirements . . . . . . . . . . . . . . 5 56 2. Conceptual Description of the Protocol . . . . . . . . . . . 5 57 2.1. Costs, Metrics and Neighbourship . . . . . . . . . . . . 5 58 2.2. The Bellman-Ford Algorithm . . . . . . . . . . . . . . . 6 59 2.3. Transient Loops in Bellman-Ford . . . . . . . . . . . . . 6 60 2.4. Feasibility Conditions . . . . . . . . . . . . . . . . . 7 61 2.5. Solving Starvation: Sequencing Routes . . . . . . . . . . 8 62 2.6. Requests . . . . . . . . . . . . . . . . . . . . . . . . 10 63 2.7. Multiple Routers . . . . . . . . . . . . . . . . . . . . 11 64 2.8. Overlapping Prefixes . . . . . . . . . . . . . . . . . . 12 65 3. Protocol Operation . . . . . . . . . . . . . . . . . . . . . 12 66 3.1. Message Transmission and Reception . . . . . . . . . . . 12 67 3.2. Data Structures . . . . . . . . . . . . . . . . . . . . . 13 68 3.3. Acknowledgments and acknowledgment requests . . . . . . . 17 69 3.4. Neighbour Acquisition . . . . . . . . . . . . . . . . . . 18 70 3.5. Routing Table Maintenance . . . . . . . . . . . . . . . . 21 71 3.6. Route Selection . . . . . . . . . . . . . . . . . . . . . 25 72 3.7. Sending Updates . . . . . . . . . . . . . . . . . . . . . 26 73 3.8. Explicit Requests . . . . . . . . . . . . . . . . . . . . 28 74 4. Protocol Encoding . . . . . . . . . . . . . . . . . . . . . . 32 75 4.1. Data Types . . . . . . . . . . . . . . . . . . . . . . . 32 76 4.2. Packet Format . . . . . . . . . . . . . . . . . . . . . . 33 77 4.3. TLV Format . . . . . . . . . . . . . . . . . . . . . . . 34 78 4.4. Sub-TLV Format . . . . . . . . . . . . . . . . . . . . . 35 79 4.5. Parser state and encoding of updates . . . . . . . . . . 35 80 4.6. Details of Specific TLVs . . . . . . . . . . . . . . . . 37 81 4.7. Details of specific sub-TLVs . . . . . . . . . . . . . . 48 82 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 49 83 6. Security Considerations . . . . . . . . . . . . . . . . . . . 52 84 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 53 85 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 53 86 8.1. Normative References . . . . . . . . . . . . . . . . . . 53 87 8.2. Informative References . . . . . . . . . . . . . . . . . 54 88 Appendix A. Cost and Metric Computation . . . . . . . . . . . . 56 89 A.1. Maintaining Hello History . . . . . . . . . . . . . . . . 56 90 A.2. Cost Computation . . . . . . . . . . . . . . . . . . . . 57 91 A.3. Route selection and hysteresis . . . . . . . . . . . . . 59 92 Appendix B. Protocol parameters . . . . . . . . . . . . . . . . 59 93 Appendix C. Route filtering . . . . . . . . . . . . . . . . . . 60 94 Appendix D. Considerations for protocol extensions . . . . . . . 61 95 Appendix E. Stub Implementations . . . . . . . . . . . . . . . . 62 96 Appendix F. Compatibility with previous versions . . . . . . . . 63 97 Appendix G. Changes from previous versions . . . . . . . . . . . 64 98 G.1. Changes since RFC 6126 . . . . . . . . . . . . . . . . . 64 99 G.2. Changes since draft-ietf-babel-rfc6126bis-00 . . . . . . 65 100 G.3. Changes since draft-ietf-babel-rfc6126bis-01 . . . . . . 65 101 G.4. Changes since draft-ietf-babel-rfc6126bis-02 . . . . . . 65 102 G.5. Changes since draft-ietf-babel-rfc6126bis-03 . . . . . . 66 103 G.6. Changes since draft-ietf-babel-rfc6126bis-03 . . . . . . 66 104 G.7. Changes since draft-ietf-babel-rfc6126bis-04 . . . . . . 66 105 G.8. Changes since draft-ietf-babel-rfc6126bis-05 . . . . . . 67 106 G.9. Changes since draft-ietf-babel-rfc6126bis-06 . . . . . . 67 107 G.10. Changes since draft-ietf-babel-rfc6126bis-07 . . . . . . 67 108 G.11. Changes since draft-ietf-babel-rfc6126bis-08 . . . . . . 67 109 G.12. Changes since draft-ietf-babel-rfc6126bis-09 . . . . . . 67 110 G.13. Changes since draft-ietf-babel-rfc6126bis-10 . . . . . . 67 111 G.14. Changes since draft-ietf-babel-rfc6126bis-11 . . . . . . 67 112 G.15. Changes since draft-ietf-babel-rfc6126bis-12 . . . . . . 67 113 G.16. Changes since draft-ietf-babel-rfc6126bis-13 . . . . . . 68 114 G.17. Changes since draft-ietf-babel-rfc6126bis-14 . . . . . . 68 115 G.18. Changes since draft-ietf-babel-rfc6126bis-15 . . . . . . 69 116 G.19. Changes since draft-ietf-babel-rfc6126bis-16 . . . . . . 69 117 G.20. Changes since draft-ietf-babel-rfc6126bis-17 . . . . . . 69 118 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 69 120 1. Introduction 122 Babel is a loop-avoiding distance-vector routing protocol that is 123 designed to be robust and efficient both in networks using prefix- 124 based routing and in networks using flat routing ("mesh networks"), 125 and both in relatively stable wired networks and in highly dynamic 126 wireless networks. This document describes the Babel routing 127 protocol, and obsoletes [RFC6126] and [RFC7557]. 129 1.1. Features 131 The main property that makes Babel suitable for unstable networks is 132 that, unlike naive distance-vector routing protocols [RIP], it 133 strongly limits the frequency and duration of routing pathologies 134 such as routing loops and black-holes during reconvergence. Even 135 after a mobility event is detected, a Babel network usually remains 136 loop-free. Babel then quickly reconverges to a configuration that 137 preserves the loop-freedom and connectedness of the network, but is 138 not necessarily optimal; in many cases, this operation requires no 139 packet exchanges at all. Babel then slowly converges, in a time on 140 the scale of minutes, to an optimal configuration. This is achieved 141 by using sequenced routes, a technique pioneered by Destination- 142 Sequenced Distance-Vector routing [DSDV]. 144 More precisely, Babel has the following properties: 146 o when every prefix is originated by at most one router, Babel never 147 suffers from routing loops; 149 o when a single prefix is originated by multiple routers, Babel may 150 occasionally create a transient routing loop for this particular 151 prefix; this loop disappears in time proportional to the loop's 152 diameter, and never again (up to an arbitrary garbage-collection 153 (GC) time) will the routers involved participate in a routing loop 154 for the same prefix; 156 o assuming bounded packet loss rates, any routing black-holes that 157 may appear after a mobility event are corrected in a time at most 158 proportional to the network's diameter. 160 Babel has provisions for link quality estimation and for fairly 161 arbitrary metrics. When configured suitably, Babel can implement 162 shortest-path routing, or it may use a metric based, for example, on 163 measured packet loss. 165 Babel nodes will successfully establish an association even when they 166 are configured with different parameters. For example, a mobile node 167 that is low on battery may choose to use larger time constants (hello 168 and update intervals, etc.) than a node that has access to wall 169 power. Conversely, a node that detects high levels of mobility may 170 choose to use smaller time constants. The ability to build such 171 heterogeneous networks makes Babel particularly adapted to the 172 unmanaged or wireless environment. 174 Finally, Babel is a hybrid routing protocol, in the sense that it can 175 carry routes for multiple network-layer protocols (IPv4 and IPv6), 176 regardless of which protocol the Babel packets are themselves being 177 carried over. 179 1.2. Limitations 181 Babel has two limitations that make it unsuitable for use in some 182 environments. First, Babel relies on periodic routing table updates 183 rather than using a reliable transport; hence, in large, stable 184 networks it generates more traffic than protocols that only send 185 updates when the network topology changes. In such networks, 186 protocols such as OSPF [OSPF], IS-IS [IS-IS], or the Enhanced 187 Interior Gateway Routing Protocol (EIGRP) [EIGRP] might be more 188 suitable. 190 Second, unless the second algorithm described in Section 3.5.4 is 191 implemented, Babel does impose a hold time when a prefix is 192 retracted. While this hold time does not apply to the exact prefix 193 being retracted, and hence does not prevent fast reconvergence should 194 it become available again, it does apply to any shorter prefix that 195 covers it. This may make those implementations of Babel that do not 196 implement the optional algorithm described in Section 3.5.4 197 unsuitable for use in networks that implement automatic prefix 198 aggregation. 200 1.3. Specification of Requirements 202 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 203 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 204 "OPTIONAL" in this document are to be interpreted as described in BCP 205 14 [RFC2119] [RFC8174] when, and only when, they appear in all 206 capitals, as shown here. 208 2. Conceptual Description of the Protocol 210 Babel is a loop-avoiding distance vector protocol: it is based on the 211 Bellman-Ford algorithm, just like the venerable RIP [RIP], but 212 includes a number of refinements that either prevent loop formation 213 altogether, or ensure that a loop disappears in a timely manner and 214 doesn't form again. 216 Conceptually, Bellman-Ford is executed in parallel for every source 217 of routing information (destination of data traffic). In the 218 following discussion, we fix a source S; the reader will recall that 219 the same algorithm is executed for all sources. 221 2.1. Costs, Metrics and Neighbourship 223 For every pair of neighbouring nodes A and B, Babel computes an 224 abstract value known as the cost of the link from A to B, written 225 C(A, B). Given a route between any two (not necessarily 226 neighbouring) nodes, the metric of the route is the sum of the costs 227 of all the links along the route. The goal of the routing algorithm 228 is to compute, for every source S, the tree of routes of lowest 229 metric to S. 231 Costs and metrics need not be integers. In general, they can be 232 values in any algebra that satisfies two fairly general conditions 233 (Section 3.5.2). 235 A Babel node periodically sends Hello messages to all of its 236 neighbours; it also periodically sends an IHU ("I Heard You") message 237 to every neighbour from which it has recently heard a Hello. From 238 the information derived from Hello and IHU messages received from its 239 neighbour B, a node A computes the cost C(A, B) of the link from A to 240 B. 242 2.2. The Bellman-Ford Algorithm 244 Every node A maintains two pieces of data: its estimated distance to 245 S, written D(A), and its next-hop router to S, written NH(A). 246 Initially, D(S) = 0, D(A) is infinite, and NH(A) is undefined. 248 Periodically, every node B sends to all of its neighbours a route 249 update, a message containing D(B). When a neighbour A of B receives 250 the route update, it checks whether B is its selected next hop; if 251 that is the case, then NH(A) is set to B, and D(A) is set to C(A, B) 252 + D(B). If that is not the case, then A compares C(A, B) + D(B) to 253 its current value of D(A). If that value is smaller, meaning that 254 the received update advertises a route that is better than the 255 currently selected route, then NH(A) is set to B, and D(A) is set to 256 C(A, B) + D(B). 258 A number of refinements to this algorithm are possible, and are used 259 by Babel. In particular, convergence speed may be increased by 260 sending unscheduled "triggered updates" whenever a major change in 261 the topology is detected, in addition to the regular, scheduled 262 updates. Additionally, a node may maintain a number of alternate 263 routes, which are being advertised by neighbours other than its 264 selected neighbour, and which can be used immediately if the selected 265 route were to fail. 267 2.3. Transient Loops in Bellman-Ford 269 It is well known that a naive application of Bellman-Ford to 270 distributed routing can cause transient loops after a topology 271 change. Consider for example the following topology: 273 B 274 1 /| 275 1 / | 276 S --- A |1 277 \ | 278 1 \| 279 C 281 After convergence, D(B) = D(C) = 2, with NH(B) = NH(C) = A. 283 Suppose now that the link between S and A fails: 285 B 286 1 /| 287 / | 288 S A |1 289 \ | 290 1 \| 291 C 293 When it detects the failure of the link, A switches its next hop to B 294 (which is still advertising a route to S with metric 2), and 295 advertises a metric equal to 3, and then advertises a new route with 296 metric 3. This process of nodes changing selected neighbours and 297 increasing their metric continues until the advertised metric reaches 298 "infinity", a value larger than all the metrics that the routing 299 protocol is able to carry. 301 2.4. Feasibility Conditions 303 Bellman-Ford is a very robust algorithm: its convergence properties 304 are preserved when routers delay route acquisition or when they 305 discard some updates. Babel routers discard received route 306 announcements unless they can prove that accepting them cannot 307 possibly cause a routing loop. 309 More formally, we define a condition over route announcements, known 310 as the "feasibility condition", that guarantees the absence of 311 routing loops whenever all routers ignore route updates that do not 312 satisfy the feasibility condition. In effect, this makes Bellman- 313 Ford into a family of routing algorithms, parameterised by the 314 feasibility condition. 316 Many different feasibility conditions are possible. For example, BGP 317 can be modelled as being a distance-vector protocol with a (rather 318 drastic) feasibility condition: a routing update is only accepted 319 when the receiving node's AS number is not included in the update's 320 AS-Path attribute (note that BGP's feasibility condition does not 321 ensure the absence of transient "micro-loops" during reconvergence). 323 Another simple feasibility condition, used in the Destination- 324 Sequenced Distance-Vector (DSDV) routing protocol [DSDV] and in the 325 Ad hoc On-Demand Distance Vector (AODV) protocol [RFC3561], stems 326 from the following observation: a routing loop can only arise after a 327 router has switched to a route with a larger metric than the route 328 that it had previously selected. Hence, one may define that a route 329 is feasible when its metric at the local node would be no larger than 330 the metric of the currently selected route, i.e., an announcement 331 carrying a metric D(B) is accepted by A when C(A, B) + D(B) <= D(A). 332 If all routers obey this constraint, then the metric at every router 333 is nonincreasing, and the following invariant is always preserved: if 334 A has selected B as its next hop, then D(B) < D(A), which implies 335 that the forwarding graph is loop-free. 337 Babel uses a slightly more refined feasibility condition, derived 338 from EIGRP [DUAL]. Given a router A, define the feasibility distance 339 of A, written FD(A), as the smallest metric that A has ever 340 advertised for S to any of its neighbours. An update sent by a 341 neighbour B of A is feasible when the metric D(B) advertised by B is 342 strictly smaller than A's feasibility distance, i.e., when D(B) < 343 FD(A). 345 It is easy to see that this latter condition is no more restrictive 346 than DSDV-feasibility. Suppose that node A obeys DSDV-feasibility; 347 then D(A) is nonincreasing, hence at all times D(A) <= FD(A). 348 Suppose now that A receives a DSDV-feasible update that advertises a 349 metric D(B). Since the update is DSDV-feasible, C(A, B) + D(B) <= 350 D(A), hence D(B) < D(A), and since D(A) <= FD(A), D(B) < FD(A). 352 To see that it is strictly less restrictive, consider the following 353 diagram, where A has selected the route through B, and D(A) = FD(A) = 354 2. Since D(C) = 1 < FD(A), the alternate route through C is feasible 355 for A, although its metric C(A, C) + D(C) = 5 is larger than that of 356 the currently selected route: 358 B 359 1 / \ 1 360 / \ 361 S A 362 \ / 363 1 \ / 4 364 C 366 To show that this feasibility condition still guarantees loop- 367 freedom, recall that at the time when A accepts an update from B, the 368 metric D(B) announced by B is no smaller than FD(B); since it is 369 smaller than FD(A), at that point in time FD(B) < FD(A). Since this 370 property is preserved both when A sends updates and when it picks a 371 different next hop, it remains true at all times, which ensures that 372 the forwarding graph has no loops. 374 2.5. Solving Starvation: Sequencing Routes 376 Obviously, the feasibility conditions defined above cause starvation 377 when a router runs out of feasible routes. Consider the following 378 diagram, where both A and B have selected the direct route to S: 380 A 381 1 /| D(A) = 1 382 / | FD(A) = 1 383 S |1 384 \ | D(B) = 2 385 2 \| FD(B) = 2 386 B 388 Suppose now that the link between A and S breaks: 390 A 391 | 392 | FD(A) = 1 393 S |1 394 \ | D(B) = 2 395 2 \| FD(B) = 2 396 B 398 The only route available from A to S, the one that goes through B, is 399 not feasible: A suffers from spurious starvation. At that point, the 400 whole subtree suffering from starvation must be reset, which is 401 essentially what EIGRP does when it performs a global synchronisation 402 of all the routers in the starving subtree (the "active" phase of 403 EIGRP). 405 Babel reacts to starvation in a less drastic manner, by using 406 sequenced routes, a technique introduced by DSDV and adopted by AODV. 407 In addition to a metric, every route carries a sequence number, a 408 nondecreasing integer that is propagated unchanged through the 409 network and is only ever incremented by the source; a pair (s, m), 410 where s is a sequence number and m a metric, is called a distance. 412 A received update is feasible when either it is more recent than the 413 feasibility distance maintained by the receiving node, or it is 414 equally recent and the metric is strictly smaller. More formally, if 415 FD(A) = (s, m), then an update carrying the distance (s', m') is 416 feasible when either s' > s, or s = s' and m' < m. 418 Assuming the sequence number of S is 137, the diagram above becomes: 420 A 421 | 422 | FD(A) = (137, 1) 423 S |1 424 \ | D(B) = (137, 2) 425 2 \| FD(B) = (137, 2) 426 B 428 After S increases its sequence number, and the new sequence number is 429 propagated to B, we have: 431 A 432 | 433 | FD(A) = (137, 1) 434 S |1 435 \ | D(B) = (138, 2) 436 2 \| FD(B) = (138, 2) 437 B 439 at which point the route through B becomes feasible again. 441 Note that while sequence numbers are used for determining 442 feasibility, they are not used in route selection: a node ignores the 443 sequence number when selecting the best route to a given destination 444 (Section 3.6). Doing otherwise would cause route oscillation while a 445 sequence number propagates through the network, and might even cause 446 persistent blackholes with some exotic metrics. 448 2.6. Requests 450 In DSDV, the sequence number of a source is increased periodically. 451 A route becomes feasible again after the source increases its 452 sequence number, and the new sequence number is propagated through 453 the network, which may, in general, require a significant amount of 454 time. 456 Babel takes a different approach. When a node detects that it is 457 suffering from a potentially spurious starvation, it sends an 458 explicit request to the source for a new sequence number. This 459 request is forwarded hop by hop to the source, with no regard to the 460 feasibility condition. Upon receiving the request, the source 461 increases its sequence number and broadcasts an update, which is 462 forwarded to the requesting node. 464 Note that after a change in network topology not all such requests 465 will, in general, reach the source, as some will be sent over links 466 that are now broken. However, if the network is still connected, 467 then at least one among the nodes suffering from spurious starvation 468 has an (unfeasible) route to the source; hence, in the absence of 469 packet loss, at least one such request will reach the source. 470 (Resending requests a small number of times compensates for packet 471 loss.) 473 Since requests are forwarded with no regard to the feasibility 474 condition, they may, in general, be caught in a forwarding loop; this 475 is avoided by having nodes perform duplicate detection for the 476 requests that they forward. 478 2.7. Multiple Routers 480 The above discussion assumes that each prefix is originated by a 481 single router. In real networks, however, it is often necessary to 482 have a single prefix originated by multiple routers: for example, the 483 default route will be originated by all of the edge routers of a 484 routing domain. 486 Since synchronising sequence numbers between distinct routers is 487 problematic, Babel treats routes for the same prefix as distinct 488 entities when they are originated by different routers: every route 489 announcement carries the router-id of its originating router, and 490 feasibility distances are not maintained per prefix, but per source, 491 where a source is a pair of a router-id and a prefix. In effect, 492 Babel guarantees loop-freedom for the forwarding graph to every 493 source; since the union of multiple acyclic graphs is not in general 494 acyclic, Babel does not in general guarantee loop-freedom when a 495 prefix is originated by multiple routers, but any loops will be 496 broken in a time at most proportional to the diameter of the loop -- 497 as soon as an update has "gone around" the routing loop. 499 Consider for example the following topology, where A has selected the 500 default route through S, and B has selected the one through S': 502 1 1 1 503 ::/0 -- S --- A --- B --- S' -- ::/0 505 Suppose that both default routes fail at the same time; then nothing 506 prevents A from switching to B, and B simultaneously switching to A. 507 However, as soon as A has successfully advertised the new route to B, 508 the route through A will become unfeasible for B. Conversely, as 509 soon as B will have advertised the route through A, the route through 510 B will become unfeasible for A. 512 In effect, the routing loop disappears at the latest when routing 513 information has gone around the loop. Since this process can be 514 delayed by lost packets, Babel makes certain efforts to ensure that 515 updates are sent reliably after a router-id change (Section 3.7.2). 517 Additionally, after the routers have advertised the two routes, both 518 sources will be in their source tables, which will prevent them from 519 ever again participating in a routing loop involving routes from S 520 and S' (up to the source GC time, which, available memory permitting, 521 can be set to arbitrarily large values). 523 2.8. Overlapping Prefixes 525 In the above discussion, we have assumed that all prefixes are 526 disjoint, as is the case in flat ("mesh") routing. In practice, 527 however, prefixes may overlap: for example, the default route 528 overlaps with all of the routes present in the network. 530 After a route fails, it is not correct in general to switch to a 531 route that subsumes the failed route. Consider for example the 532 following configuration: 534 1 1 535 ::/0 -- A --- B --- C 537 Suppose that node C fails. If B forwards packets destined to C by 538 following the default route, a routing loop will form, and persist 539 until A learns of B's retraction of the direct route to C. B avoids 540 this pitfall by installing an "unreachable" route after a route is 541 retracted; this route is maintained until it can be guaranteed that 542 the former route has been retracted by all of B's neighbours 543 (Section 3.5.4). 545 3. Protocol Operation 547 Every Babel speaker is assigned a router-id, which is an arbitrary 548 string of 8 octets that is assumed unique across the routing domain. 549 For example, router-ids could be assigned randomly, or they could be 550 derived from a link-layer address. (The protocol encoding is 551 slightly more compact when router-ids are assigned in the same manner 552 as the IPv6 layer assigns host IDs; see the definition of the "R" 553 flag in Section 4.6.9.) 555 3.1. Message Transmission and Reception 557 Babel protocol packets are sent in the body of a UDP datagram (as 558 described in Section 4 below). Each Babel packet consists of zero or 559 more TLVs. Most TLVs may contain sub-TLVs. 561 The protocol's control traffic can be carried indifferently over IPv6 562 or over IPv4, and prefixes of either address family can be announced 563 over either protocol. Thus, there are at least two natural 564 deployment models: using IPv6 exclusively for all control traffic, or 565 running two distinct protocol instances, one for each address family. 566 The exclusive use of IPv6 for all control traffic is RECOMMENDED, 567 since using both protocols at the same time doubles the amount of 568 traffic devoted to neighbour discovery and link quality estimation. 570 The source address of a Babel packet is always a unicast address, 571 link-local in the case of IPv6. Babel packets may be sent to a well- 572 known (link-local) multicast address or to a (link-local) unicast 573 address. In normal operation, a Babel speaker sends both multicast 574 and unicast packets to its neighbours. 576 With the exception of acknowledgments, all Babel TLVs can be sent to 577 either unicast or multicast addresses, and their semantics does not 578 depend on whether the destination is a unicast or a multicast 579 address. Hence, a Babel speaker does not need to determine the 580 destination address of a packet that it receives in order to 581 interpret it. 583 A moderate amount of jitter may be applied to packets sent by a Babel 584 speaker: outgoing TLVs are buffered and SHOULD be sent with a random 585 delay. This is done for two purposes: it avoids synchronisation of 586 multiple Babel speakers across a network [JITTER], and it allows for 587 the aggregation of multiple TLVs into a single packet. 589 The maximum amount of delay a TLV can be subjected to depends on the 590 TLV. When the protocol description specifies that a TLV is urgent 591 (as in Section 3.7.2 and Section 3.8.2), then the TLV MUST be sent 592 within a short time known as the urgent timeout (see Appendix B for 593 recommended values). When the TLV is governed by a timeout 594 explicitly included in a previous TLV, such as in the case of 595 Acknowledgements (Section 4.6.4), Updates (Section 3.7) and IHUs 596 (Section 3.4.2), then the TLV MUST be sent early enough to meet the 597 explicit deadline (with a small margin to allow for propagation 598 delays). In all other cases, the TLV SHOULD be sent out within one- 599 half of the Multicast Hello interval. 601 In order to avoid packet drops (either at the sender or at the 602 receiver), a delay SHOULD be introduced between successive packets 603 sent out on the same interface, within the constraints of the 604 previous paragraph. Note however that such packet pacing might 605 impair the ability of some link layers (e.g., IEEE 802.11 606 [IEEE802.11]) to perform packet aggregation. 608 3.2. Data Structures 610 In this section, we give a description of the data structures that 611 every Babel speaker maintains. This description is conceptual: a 612 Babel speaker may use different data structures as long as the 613 resulting protocol is the same as the one described in this document. 614 For example, rather than maintaining a single table containing both 615 selected and unselected (fallback) routes, as described in 616 Section 3.2.6 below, an actual implementation would probably use two 617 tables, one with selected routes and one with fallback routes. 619 3.2.1. Sequence number arithmetic 621 Sequence numbers (seqnos) appear in a number of Babel data 622 structures, and they are interpreted as integers modulo 2^16. For 623 the purposes of this document, arithmetic on sequence numbers is 624 defined as follows. 626 Given a seqno s and a non-negative integer n, the sum of s and n is 627 defined by 629 s + n (modulo 2^16) = (s + n) MOD 2^16 631 or, equivalently, 633 s + n (modulo 2^16) = (s + n) AND 65535 635 where MOD is the modulo operation yielding a non-negative integer and 636 AND is the bitwise conjunction operation. 638 Given two sequence numbers s and s', the relation s is less than s' 639 (s < s') is defined by 641 s < s' (modulo 2^16) when 0 < ((s' - s) MOD 2^16) < 32768 643 or equivalently 645 s < s' (modulo 2^16) when s /= s' and ((s' - s) AND 32768) = 0. 647 3.2.2. Node Sequence Number 649 A node's sequence number is a 16-bit integer that is included in 650 route updates sent for routes originated by this node. 652 A node increments its sequence number (modulo 2^16) whenever it 653 receives a request for a new sequence number (Section 3.8.1.2). A 654 node SHOULD NOT increment its sequence number (seqno) spontaneously, 655 since increasing seqnos makes it less likely that other nodes will 656 have feasible alternate routes when their selected routes fail. 658 3.2.3. The Interface Table 660 The interface table contains the list of interfaces on which the node 661 speaks the Babel protocol. Every interface table entry contains the 662 interface's outgoing Multicast Hello seqno, a 16-bit integer that is 663 sent with each Multicast Hello TLV on this interface and is 664 incremented (modulo 2^16) whenever a Multicast Hello is sent. (Note 665 that an interface's Multicast Hello seqno is unrelated to the node's 666 seqno.) 667 There are two timers associated with each interface table entry. The 668 periodic Multicast Hello timer governs the sending of scheduled 669 Multicast Hello and IHU packets (Section 3.4. The periodic Update 670 timer governs the sending of periodic route updates (Section 3.7.1). 671 See Appendix B for suggested time constants. 673 3.2.4. The Neighbour Table 675 The neighbour table contains the list of all neighbouring interfaces 676 from which a Babel packet has been recently received. The neighbour 677 table is indexed by pairs of the form (interface, address), and every 678 neighbour table entry contains the following data: 680 o the local node's interface over which this neighbour is reachable; 682 o the address of the neighbouring interface; 684 o a history of recently received Multicast Hello packets from this 685 neighbour; this can, for example, be a sequence of n bits, for 686 some small value n, indicating which of the n hellos most recently 687 sent by this neighbour have been received by the local node; 689 o a history of recently received Unicast Hello packets from this 690 neighbour; 692 o the "transmission cost" value from the last IHU packet received 693 from this neighbour, or FFFF hexadecimal (infinity) if the IHU 694 hold timer for this neighbour has expired; 696 o the expected incoming Multicast Hello sequence number for this 697 neighbour, an integer modulo 2^16. 699 o the expected incoming Unicast Hello sequence number for this 700 neighbour, an integer modulo 2^16. 702 o the outgoing Unicast Hello sequence number for this neighbour, an 703 integer modulo 2^16 that is sent with each Unicast Hello TLV to 704 this neighbour and is incremented (modulo 2^16) whenever a Unicast 705 Hello is sent. (Note that the outgoing Unicast Hello seqno for a 706 neighbour is distinct from the interface's outgoing Multicast 707 Hello seqno.) 709 There are three timers associated with each neighbour entry -- the 710 multicast hello timer, which is set to the interval value carried by 711 scheduled Multicast Hello TLVs sent by this neighbour, the unicast 712 hello timer, which is set to the interval value carried by scheduled 713 Unicast Hello TLVs, and the IHU timer, which is set to a small 714 multiple of the interval carried in IHU TLVs (see "IHU Hold time" in 715 Appendix B for suggested values). 717 Note that the neighbour table is indexed by IP addresses, not by 718 router-ids: neighbourship is a relationship between interfaces, not 719 between nodes. Therefore, two nodes with multiple interfaces can 720 participate in multiple neighbourship relationships, a situation that 721 can notably arise when wireless nodes with multiple radios are 722 involved. 724 3.2.5. The Source Table 726 The source table is used to record feasibility distances. It is 727 indexed by triples of the form (prefix, plen, router-id), and every 728 source table entry contains the following data: 730 o the prefix (prefix, plen), where plen is the prefix length in 731 bits, that this entry applies to; 733 o the router-id of a router originating this prefix; 735 o a pair (seqno, metric), this source's feasibility distance. 737 There is one timer associated with each entry in the source table -- 738 the source garbage-collection timer. It is initialised to a time on 739 the order of minutes and reset as specified in Section 3.7.3. 741 3.2.6. The Route Table 743 The route table contains the routes known to this node. It is 744 indexed by triples of the form (prefix, plen, neighbour), and every 745 route table entry contains the following data: 747 o the source (prefix, plen, router-id) for which this route is 748 advertised; 750 o the neighbour (an entry in the neighbour table) that advertised 751 this route; 753 o the metric with which this route was advertised by the neighbour, 754 or FFFF hexadecimal (infinity) for a recently retracted route; 756 o the sequence number with which this route was advertised; 758 o the next-hop address of this route; 759 o a boolean flag indicating whether this route is selected, i.e., 760 whether it is currently being used for forwarding and is being 761 advertised. 763 There is one timer associated with each route table entry -- the 764 route expiry timer. It is initialised and reset as specified in 765 Section 3.5.3. 767 Note that there are two distinct (seqno, metric) pairs associated to 768 each route: the route's distance, which is stored in the route table, 769 and the feasibility distance, stored in the source table and shared 770 between all routes with the same source. 772 3.2.7. The Table of Pending Seqno Requests 774 The table of pending seqno requests contains a list of seqno requests 775 that the local node has sent (either because they have been 776 originated locally, or because they were forwarded) and to which no 777 reply has been received yet. This table is indexed by triples of the 778 form (prefix, plen, router-id), and every entry in this table 779 contains the following data: 781 o the prefix, plen, router-id, and seqno being requested; 783 o the neighbour, if any, on behalf of which we are forwarding this 784 request; 786 o a small integer indicating the number of times that this request 787 will be resent if it remains unsatisfied. 789 There is one timer associated with each pending seqno request; it 790 governs both the resending of requests and their expiry. 792 3.3. Acknowledgments and acknowledgment requests 794 A Babel speaker may request that a neighbour receiving a given packet 795 reply with an explicit acknowledgment within a given time. While the 796 use of acknowledgment requests is optional, every Babel speaker MUST 797 be able to reply to such a request. 799 An acknowledgment MUST be sent to a unicast destination. On the 800 other hand, acknowledgment requests may be sent to either unicast or 801 multicast destinations, in which case they request an acknowledgment 802 from all of the receiving nodes. 804 When to request acknowledgments is a matter of local policy; the 805 simplest strategy is to never request acknowledgments and to rely on 806 periodic updates to ensure that any reachable routes are eventually 807 propagated throughout the routing domain. In order to improve 808 convergence speed and reduce the amount of control traffic, 809 acknowledgment requests MAY be used in order to reliably send urgent 810 updates (Section 3.7.2) and retractions (Section 3.5.4), especially 811 when the number of neighbours on a given interface is small. Since 812 Babel is designed to deal gracefully with packet loss on unreliable 813 media, sending all packets with acknowledgment requests is not 814 necessary, and NOT RECOMMENDED, as the acknowledgments cause 815 additional traffic and may force additional Address Resolution 816 Protocol (ARP) or Neighbour Discovery (ND) exchanges. 818 3.4. Neighbour Acquisition 820 Neighbour acquisition is the process by which a Babel node discovers 821 the set of neighbours heard over each of its interfaces and 822 ascertains bidirectional reachability. On unreliable media, 823 neighbour acquisition additionally provides some statistics that may 824 be useful for link quality computation. 826 Before it can exchange routing information with a neighbour, a Babel 827 node MUST create an entry for that neighbour in the neighbour table. 828 When to do that is implementation-specific; suitable strategies 829 include creating an entry when any Babel packet is received, or 830 creating an entry when a Hello TLV is parsed. Similarly, in order to 831 conserve system resources, an implementation SHOULD discard an entry 832 when it has been unused for long enough; suitable strategies include 833 dropping the neighbour after a timeout, and dropping a neighbour when 834 the associated Hello histories become empty (see Appendix A.2). 836 3.4.1. Reverse Reachability Detection 838 Every Babel node sends Hello TLVs to its neighbours to indicate that 839 it is alive, at regular or irregular intervals. Each Hello TLV 840 carries an increasing (modulo 2^16) sequence number and an upper 841 bound on the time interval until the next Hello of the same type (see 842 below). If the time interval is set to 0, then the Hello TLV does 843 not establish a new promise: the deadline carried by the previous 844 Hello of the same type still applies to the next Hello (if the most 845 recent scheduled Hello of the right kind was received at time t0 and 846 carried interval i, then the previous promise of sending another 847 Hello before time t0 + i still holds). We say that a Hello is 848 "scheduled" if it carries a non-zero interval, and "unscheduled" 849 otherwise. 851 There are two kinds of Hellos: Multicast Hellos, which use a per- 852 interface Hello counter (the Multicast Hello seqno), and Unicast 853 Hellos, which use a per-neighbour counter (the Unicast Hello seqno). 854 A Multicast Hello with a given seqno MUST be sent to all neighbours 855 on a given interface, either by sending it to a multicast address or 856 by sending it to one unicast address per neighbour (hence, the term 857 "Multicast Hello" is a slight misnomer). A Unicast Hello carrying a 858 given seqno should normally be sent to just one neighbour (over 859 unicast), since the sequence numbers of different neighbours are not 860 in general synchronised. 862 Multicast Hellos sent over multicast can be used for neighbour 863 discovery; hence, a node SHOULD send periodic (scheduled) Multicast 864 Hellos unless neighbour discovery is performed by means outside of 865 the Babel protocol. A node MAY send Unicast Hellos or unscheduled 866 Hellos of either kind for any reason, such as reducing the amount of 867 multicast traffic or improving reliability on link technologies with 868 poor support for link-layer multicast. 870 A node MAY send a scheduled Hello ahead of time. A node MAY change 871 its scheduled Hello interval. The Hello interval MAY be decreased at 872 any time; it MAY be increased immediately before sending a Hello TLV, 873 but SHOULD NOT be increased at other times. (Equivalently, a node 874 SHOULD send a scheduled Hello immediately after increasing its Hello 875 interval.) 877 How to deal with received Hello TLVs and what statistics to maintain 878 are considered local implementation matters; typically, a node will 879 maintain some sort of history of recently received Hellos. An 880 example of a suitable algorithm is described in Appendix A.1. 882 After receiving a Hello, or determining that it has missed one, the 883 node recomputes the association's cost (Section 3.4.3) and runs the 884 route selection procedure (Section 3.6). 886 3.4.2. Bidirectional Reachability Detection 888 In order to establish bidirectional reachability, every node sends 889 periodic IHU ("I Heard You") TLVs to each of its neighbours. Since 890 IHUs carry an explicit interval value, they MAY be sent less often 891 than Hellos in order to reduce the amount of routing traffic in dense 892 networks; in particular, they SHOULD be sent less often than Hellos 893 over links with little packet loss. While IHUs are conceptually 894 unicast, they MAY be sent to a multicast address in order to avoid an 895 ARP or Neighbour Discovery exchange and to aggregate multiple IHUs 896 into a single packet. 898 In addition to the periodic IHUs, a node MAY, at any time, send an 899 unscheduled IHU packet. It MAY also, at any time, decrease its IHU 900 interval, and it MAY increase its IHU interval immediately before 901 sending an IHU, but SHOULD NOT increase it at any other time. 903 (Equivalently, a node SHOULD send an extra IHU immediately after 904 increasing its Hello interval.) 906 Every IHU TLV contains two pieces of data: the link's rxcost 907 (reception cost) from the sender's perspective, used by the neighbour 908 for computing link costs (Section 3.4.3), and the interval between 909 periodic IHU packets. A node receiving an IHU sets the value of the 910 txcost (transmission cost) maintained in the neighbour table to the 911 value contained in the IHU, and resets the IHU timer associated to 912 this neighbour to a small multiple of the interval value received in 913 the IHU (see "IHU Hold time" in Appendix B for suggested values). 914 When a neighbour's IHU timer expires, the neighbour's txcost is set 915 to infinity. 917 After updating a neighbour's txcost, the receiving node recomputes 918 the neighbour's cost (Section 3.4.3) and runs the route selection 919 procedure (Section 3.6). 921 3.4.3. Cost Computation 923 A neighbourship association's link cost is computed from the values 924 maintained in the neighbour table: the statistics kept in the 925 neighbour table about the reception of Hellos, and the txcost 926 computed from received IHU packets. 928 For every neighbour, a Babel node computes a value known as this 929 neighbour's rxcost. This value is usually derived from the Hello 930 history, which may be combined with other data, such as statistics 931 maintained by the link layer. The rxcost is sent to a neighbour in 932 each IHU. 934 Since nodes do not necessarily send periodic Unicast Hellos but do 935 usually send periodic Multicast Hellos (Section 3.4.1), a node SHOULD 936 use an algorithm that yields a finite rxcost when only Multicast 937 Hellos are received, unless interoperability with nodes that only 938 send Multicast Hellos is not required. 940 How the txcost and rxcost are combined in order to compute a link's 941 cost is a matter of local policy; as far as Babel's correctness is 942 concerned, only the following conditions MUST be satisfied: 944 o the cost is strictly positive; 946 o if no Hello TLVs of either kind were received recently, then the 947 cost is infinite; 949 o if the txcost is infinite, then the cost is infinite. 951 See Appendix A.2 for RECOMMENDED strategies for computing a link's 952 cost. 954 3.5. Routing Table Maintenance 956 Conceptually, a Babel update is a quintuple (prefix, plen, router-id, 957 seqno, metric), where (prefix, plen) is the prefix for which a route 958 is being advertised, router-id is the router-id of the router 959 originating this update, seqno is a nondecreasing (modulo 2^16) 960 integer that carries the originating router seqno, and metric is the 961 announced metric. 963 Before being accepted, an update is checked against the feasibility 964 condition (Section 3.5.1), which ensures that the route does not 965 create a routing loop. If the feasibility condition is not 966 satisfied, the update is either ignored or prevents the route from 967 being selected, as described in Section 3.5.3. If the feasibility 968 condition is satisfied, then the update cannot possibly cause a 969 routing loop. 971 3.5.1. The Feasibility Condition 973 The feasibility condition is applied to all received updates. The 974 feasibility condition compares the metric in the received update with 975 the metrics of the updates previously sent by the receiving node; 976 updates that fail the feasibility condition, and therefore have 977 metrics large enough to cause a routing loop, are either ignored or 978 prevent the resulting route from being selected. 980 A feasibility distance is a pair (seqno, metric), where seqno is an 981 integer modulo 2^16 and metric is a positive integer. Feasibility 982 distances are compared lexicographically, with the first component 983 inverted: we say that a distance (seqno, metric) is strictly better 984 than a distance (seqno', metric'), written 986 (seqno, metric) < (seqno', metric') 988 when 990 seqno > seqno' or (seqno = seqno' and metric < metric') 992 where sequence numbers are compared modulo 2^16. 994 Given a source (prefix, plen, router-id), a node's feasibility 995 distance for this source is the minimum, according to the ordering 996 defined above, of the distances of all the finite updates ever sent 997 by this particular node for the prefix (prefix, plen) and the given 998 router-id. Feasibility distances are maintained in the source table, 999 the exact procedure is given in Section 3.7.3. 1001 A received update is feasible when either it is a retraction (its 1002 metric is FFFF hexadecimal), or the advertised distance is strictly 1003 better, in the sense defined above, than the feasibility distance for 1004 the corresponding source. More precisely, a route advertisement 1005 carrying the quintuple (prefix, plen, router-id, seqno, metric) is 1006 feasible if one of the following conditions holds: 1008 o metric is infinite; or 1010 o no entry exists in the source table indexed by (prefix, plen, 1011 router-id); or 1013 o an entry (prefix, plen, router-id, seqno', metric') exists in the 1014 source table, and either 1016 * seqno' < seqno or 1018 * seqno = seqno' and metric < metric'. 1020 Note that the feasibility condition considers the metric advertised 1021 by the neighbour, not the route's metric; hence, a fluctuation in a 1022 neighbour's cost cannot render a selected route unfeasible. Note 1023 further that retractions (updates with infinite metric) are always 1024 feasible, since they cannot possibly cause a routing loop. 1026 3.5.2. Metric Computation 1028 A route's metric is computed from the metric advertised by the 1029 neighbour and the neighbour's link cost. Just like cost computation, 1030 metric computation is considered a local policy matter; as far as 1031 Babel is concerned, the function M(c, m) used for computing a metric 1032 from a locally computed link cost c and the metric m advertised by a 1033 neighbour MUST only satisfy the following conditions: 1035 o if c is infinite, then M(c, m) is infinite; 1037 o M is strictly monotonic: M(c, m) > m. 1039 Additionally, the metric SHOULD satisfy the following condition: 1041 o M is left-distributive: if m <= m', then M(c, m) <= M(c, m'). 1043 While strict monotonicity is essential to the integrity of the 1044 network (persistent routing loops may arise if it is not satisfied), 1045 left distributivity is not: if it is not satisfied, Babel will still 1046 converge to a loop-free configuration, but might not reach a global 1047 optimum (in fact, a global optimum may not even exist). 1049 The conditions above are easily satisfied by using the additive 1050 metric, i.e., by defining M(c, m) = c + m. Since the additive metric 1051 is useful with a large range of cost computation strategies, it is 1052 the RECOMMENDED default. See also Appendix C, which describes a 1053 technique that makes it possible to tweak the values of individual 1054 metrics without running the risk of creating routing loops. 1056 3.5.3. Route Acquisition 1058 When a Babel node receives an update (prefix, plen, router-id, seqno, 1059 metric) from a neighbour neigh, it checks whether it already has a 1060 route table entry indexed by (prefix, plen, neigh). 1062 If no such entry exists: 1064 o if the update is unfeasible, it MAY be ignored; 1066 o if the metric is infinite (the update is a retraction of a route 1067 we do not know about), the update is ignored; 1069 o otherwise, a new entry is created in the route table, indexed by 1070 (prefix, plen, neigh), with source equal to (prefix, plen, router- 1071 id), seqno equal to seqno and an advertised metric equal to the 1072 metric carried by the update. 1074 If such an entry exists: 1076 o if the entry is currently selected, the update is unfeasible, and 1077 the router-id of the update is equal to the router-id of the 1078 entry, then the update MAY be ignored; 1080 o otherwise, the entry's sequence number, advertised metric, metric, 1081 and router-id are updated and, if the advertised metric is not 1082 infinite, the route's expiry timer is reset to a small multiple of 1083 the Interval value included in the update (see "Route Hold time" 1084 in Appendix B for suggested values). If the update is unfeasible, 1085 then the (now unfeasible) entry MUST be immediately unselected. 1086 If the update caused the router-id of the entry to change, an 1087 update (possibly a retraction) MUST be sent in a timely manner as 1088 described in Section 3.7.2. 1090 Note that the route table may contain unfeasible routes, either 1091 because they were created by an unfeasible update or due to a metric 1092 fluctuation. Such routes are never selected, since they are not 1093 known to be loop-free; should all the feasible routes become 1094 unusable, however, the unfeasible routes can be made feasible and 1095 therefore possible to select by sending requests along them (see 1096 Section 3.8.2). 1098 When a route's expiry timer triggers, the behaviour depends on 1099 whether the route's metric is finite. If the metric is finite, it is 1100 set to infinity and the expiry timer is reset. If the metric is 1101 already infinite, the route is flushed from the route table. 1103 After the route table is updated, the route selection procedure 1104 (Section 3.6) is run. 1106 3.5.4. Hold Time 1108 When a prefix P is retracted, because all routes are unfeasible or 1109 have an infinite metric (whether due to the expiry timer or to other 1110 reasons), and a shorter prefix P' that covers P is reachable, P' 1111 cannot in general be used for routing packets destined to P without 1112 running the risk of creating a routing loop (Section 2.8). 1114 To avoid this issue, whenever a prefix P is retracted, a route table 1115 entry with infinite metric is maintained as described in 1116 Section 3.5.3 above. As long as this entry is maintained, packets 1117 destined to an address within P MUST NOT be forwarded by following a 1118 route for a shorter prefix. This entry is removed as soon as a 1119 finite-metric update for prefix P is received and the resulting route 1120 selected. If no such update is forthcoming, the infinite metric 1121 entry SHOULD be maintained at least until it is guaranteed that no 1122 neighbour has selected the current node as next-hop for prefix P. 1123 This can be achieved by either: 1125 o waiting until the route's expiry timer has expired 1126 (Section 3.5.3); 1128 o sending a retraction with an acknowledgment request (Section 3.3) 1129 to every reachable neighbour that has not explicitly retracted 1130 prefix P, and waiting for all acknowledgments. 1132 The former option is simpler and ensures that at that point, any 1133 routes for prefix P pointing at the current node have expired. 1134 However, since the expiry time can be as high as a few minutes, doing 1135 that prevents automatic aggregation by creating spurious black-holes 1136 for aggregated routes. The latter option is RECOMMENDED as it 1137 dramatically reduces the time for which a prefix is unreachable in 1138 the presence of aggregated routes. 1140 3.6. Route Selection 1142 Route selection is the process by which a single route for a given 1143 prefix is selected to be used for forwarding packets and to be re- 1144 advertised to a node's neighbours. 1146 Babel is designed to allow flexible route selection policies. As far 1147 as the algorithm's correctness is concerned, the route selection 1148 policy MUST only satisfy the following properties: 1150 o a route with infinite metric (a retracted route) is never 1151 selected; 1153 o an unfeasible route is never selected. 1155 Babel nodes using different route selection strategies will 1156 interoperate and not create routing loops as long as these two 1157 properties hold. 1159 Route selection MUST NOT take seqnos into account: a route MUST NOT 1160 be preferred just because it carries a higher (more recent) seqno. 1161 Doing otherwise would cause route oscillation while a new seqno 1162 propagates across the network, and might create persistent blackholes 1163 if the metric being used is not left-distributive (Section 3.5.2). 1165 The obvious route selection strategy is to pick, for every 1166 destination, the feasible route with minimal metric. When all 1167 metrics are stable, this approach ensures convergence to a tree of 1168 shortest paths (assuming that the metric is left-distributive, see 1169 Section 3.5.2). There are two reasons, however, why this strategy 1170 may lead to instability in the presence of continuously varying 1171 metrics. First, if two parallel routes oscillate around a common 1172 value, then the smallest metric strategy will keep switching between 1173 the two. Second, when a route is selected, congestion along it 1174 increases, which might increase packet loss, which in turn could 1175 cause its metric to increase; this is a feedback loop, of the kind 1176 that is prone to causing persistent oscillations. 1178 In order to limit this kind of instabilities, a route selection 1179 strategy SHOULD include some form of hysteresis, i.e., be sensitive 1180 to a route's history: if a route is currently selected, then the 1181 strategy should only switch to a different route if the latter has 1182 been consistently good for some period of time. A RECOMMENDED 1183 hysteresis algorithm is given in Appendix A.3. 1185 After the route selection procedure is run, triggered updates 1186 (Section 3.7.2) and requests (Section 3.8.2) are sent. 1188 3.7. Sending Updates 1190 A Babel speaker advertises to its neighbours its set of selected 1191 routes. Normally, this is done by sending one or more multicast 1192 packets containing Update TLVs on all of its connected interfaces; 1193 however, on link technologies where multicast is significantly more 1194 expensive than unicast, a node MAY choose to send multiple copies of 1195 updates in unicast packets, especially when the number of neighbours 1196 is small. 1198 Additionally, in order to ensure that any black-holes are reliably 1199 cleared in a timely manner, a Babel node may send retractions 1200 (updates with an infinite metric) for any recently retracted 1201 prefixes. 1203 If an update is for a route injected into the Babel domain by the 1204 local node (e.g., it carries the address of a local interface, the 1205 prefix of a directly attached network, or a prefix redistributed from 1206 a different routing protocol), the router-id is set to the local 1207 node's router-id, the metric is set to some arbitrary finite value 1208 (typically 0), and the seqno is set to the local router's sequence 1209 number. 1211 If an update is for a route learned from another Babel speaker, the 1212 router-id and sequence number are copied from the route table entry, 1213 and the metric is computed as specified in Section 3.5.2. 1215 3.7.1. Periodic Updates 1217 Every Babel speaker MUST advertise each of its selected routes on 1218 every interface, at least once every Update interval. Since Babel 1219 doesn't suffer from routing loops (there is no "counting to 1220 infinity") and relies heavily on triggered updates (Section 3.7.2), 1221 this full dump only needs to happen infrequently (see Appendix B for 1222 suggested intervals). 1224 3.7.2. Triggered Updates 1226 In addition to periodic routing updates, a Babel speaker sends 1227 unscheduled, or triggered, updates in order to inform its neighbours 1228 of a significant change in the network topology. 1230 A change of router-id for the selected route to a given prefix may be 1231 indicative of a routing loop in formation; hence, whenever it changes 1232 the selected router-id for a given destination, a node MUST send an 1233 update as an urgent TLV (as defined in Section 3.1). Additionally, 1234 it SHOULD make a reasonable attempt at ensuring that all reachable 1235 neighbours receive this update. 1237 There are two strategies for ensuring that. If the number of 1238 neighbours is small, then it is reasonable to send the update 1239 together with an acknowledgment request; the update is resent until 1240 all neighbours have acknowledged the packet, up to some number of 1241 times. If the number of neighbours is large, however, requesting 1242 acknowledgments from all of them might cause a non-negligible amount 1243 of network traffic; in that case, it may be preferable to simply 1244 repeat the update some reasonable number of times (say, 3 for 1245 wireless and 2 for wired links). The number of copies MUST NOT 1246 exceed 5, and the copies SHOULD be separated by a small delay, as 1247 described in Section 3.1. 1249 A route retraction is somewhat less worrying: if the route retraction 1250 doesn't reach all neighbours, a black-hole might be created, which, 1251 unlike a routing loop, does not endanger the integrity of the 1252 network. When a route is retracted, a node SHOULD send a triggered 1253 update and SHOULD make a reasonable attempt at ensuring that all 1254 neighbours receive this retraction. 1256 Finally, a node MAY send a triggered update when the metric for a 1257 given prefix changes in a significant manner, due to a received 1258 update, because a link's cost has changed, or because a different 1259 next hop has been selected. A node SHOULD NOT send triggered updates 1260 for other reasons, such as when there is a minor fluctuation in a 1261 route's metric, when the selected next hop changes, or to propagate a 1262 new sequence number (except to satisfy a request, as specified in 1263 Section 3.8). 1265 3.7.3. Maintaining Feasibility Distances 1267 Before sending an update (prefix, plen, router-id, seqno, metric) 1268 with finite metric (i.e., not a route retraction), a Babel node 1269 updates the feasibility distance maintained in the source table. 1270 This is done as follows. 1272 If no entry indexed by (prefix, plen, router-id) exists in the source 1273 table, then one is created with value (prefix, plen, router-id, 1274 seqno, metric). 1276 If an entry (prefix, plen, router-id, seqno', metric') exists, then 1277 it is updated as follows: 1279 o if seqno > seqno', then seqno' := seqno, metric' := metric; 1281 o if seqno = seqno' and metric' > metric, then metric' := metric; 1283 o otherwise, nothing needs to be done. 1285 The garbage-collection timer for the entry is then reset. Note that 1286 the feasibility distance is not updated and the garbage-collection 1287 timer is not reset when a retraction (an update with infinite metric) 1288 is sent. 1290 When the garbage-collection timer expires, the entry is removed from 1291 the source table. 1293 3.7.4. Split Horizon 1295 When running over a transitive, symmetric link technology, e.g., a 1296 point-to-point link or a wired LAN technology such as Ethernet, a 1297 Babel node SHOULD use an optimisation known as split horizon. When 1298 split horizon is used on a given interface, a routing update for 1299 prefix P is not sent on the particular interface over which the 1300 selected route towards prefix P was learnt. 1302 Split horizon SHOULD NOT be applied to an interface unless the 1303 interface is known to be symmetric and transitive; in particular, 1304 split horizon is not applicable to decentralised wireless link 1305 technologies (e.g., IEEE 802.11 in ad hoc mode) when routing updates 1306 are sent over multicast. 1308 3.8. Explicit Requests 1310 In normal operation, a node's route table is populated by the regular 1311 and triggered updates sent by its neighbours. Under some 1312 circumstances, however, a node sends explicit requests in order to 1313 cause a resynchronisation with the source after a mobility event or 1314 to prevent a route from spuriously expiring. 1316 The Babel protocol provides two kinds of explicit requests: route 1317 requests, which simply request an update for a given prefix, and 1318 seqno requests, which request an update for a given prefix with a 1319 specific sequence number. The former are never forwarded; the latter 1320 are forwarded if they cannot be satisfied by the receiver. 1322 3.8.1. Handling Requests 1324 Upon receiving a request, a node either forwards the request or sends 1325 an update in reply to the request, as described in the following 1326 sections. If this causes an update to be sent, the update is either 1327 sent to a multicast address on the interface on which the request was 1328 received, or to the unicast address of the neighbour that sent the 1329 request. 1331 The exact behaviour is different for route requests and seqno 1332 requests. 1334 3.8.1.1. Route Requests 1336 When a node receives a route request for a given prefix, it checks 1337 its route table for a selected route to this exact prefix. If such a 1338 route exists, it MUST send an update (over unicast or over 1339 multicast); if such a route does not exist, it MUST send a retraction 1340 for that prefix. 1342 When a node receives a wildcard route request, it SHOULD send a full 1343 route table dump. Full route dumps SHOULD be rate-limited, 1344 especially if they are sent over multicast. 1346 3.8.1.2. Seqno Requests 1348 When a node receives a seqno request for a given router-id and 1349 sequence number, it checks whether its route table contains a 1350 selected entry for that prefix. If a selected route for the given 1351 prefix exists, it has finite metric, and either the router-ids are 1352 different or the router-ids are equal and the entry's sequence number 1353 is no smaller (modulo 2^16) than the requested sequence number, the 1354 node MUST send an update for the given prefix. If the router-ids 1355 match but the requested seqno is larger (modulo 2^16) than the route 1356 entry's, the node compares the router-id against its own router-id. 1357 If the router-id is its own, then it increases its sequence number by 1358 1 (modulo 2^16) and sends an update. A node MUST NOT increase its 1359 sequence number by more than 1 in reaction to a single seqno request. 1361 Otherwise, if the requested router-id is not its own, the received 1362 node consults the hop count field of the request. If the hop count 1363 is 2 or more, and the node is advertising the prefix to its 1364 neighbours, the node selects a neighbour to forward the request to as 1365 follows: 1367 o if the node has one or more feasible routes toward the requested 1368 prefix with a next hop that is not the requesting node, then the 1369 node MUST forward the request to the next hop of one such route; 1371 o otherwise, if the node has one or more (not feasible) routes to 1372 the requested prefix with a next hop that is not the requesting 1373 node, then the node SHOULD forward the request to the next hop of 1374 one such route. 1376 In order to actually forward the request, the node decrements the hop 1377 count and sends the request in a unicast packet destined to the 1378 selected neighbour. The forwarded request SHOULD be sent as an 1379 urgent TLV (as defined in Section 3.1). 1381 A node SHOULD maintain a list of recently forwarded seqno requests 1382 and forward the reply (an update with a seqno sufficiently large to 1383 satisfy the request) as an urgent TLV (as defined in Section 3.1). A 1384 node SHOULD compare every incoming seqno request against its list of 1385 recently forwarded seqno requests and avoid forwarding it if it is 1386 redundant (i.e., if it has recently sent a request with the same 1387 prefix, router-id and a seqno that is not smaller modulo 2^16). 1389 Since the request-forwarding mechanism does not necessarily obey the 1390 feasibility condition, it may get caught in routing loops; hence, 1391 requests carry a hop count to limit the time during which they remain 1392 in the network. However, since requests are only ever forwarded as 1393 unicast packets, the initial hop count need not be kept particularly 1394 low, and performing an expanding horizon search is not necessary. A 1395 single request MUST NOT be duplicated: it MUST NOT be forwarded to a 1396 multicast address, and it MUST NOT be forwarded to multiple 1397 neighbours. However, if a seqno request is resent by its originator, 1398 the subsequent copies may be forwarded to a different neighbour than 1399 the initial one. 1401 3.8.2. Sending Requests 1403 A Babel node MAY send a route or seqno request at any time, to a 1404 multicast or a unicast address; there is only one case when 1405 originating requests is required (Section 3.8.2.1). 1407 3.8.2.1. Avoiding Starvation 1409 When a route is retracted or expires, a Babel node usually switches 1410 to another feasible route for the same prefix. It may be the case, 1411 however, that no such routes are available. 1413 A node that has lost all feasible routes to a given destination but 1414 still has unexpired unfeasible routes to that destination MUST send a 1415 seqno request; if it doesn't have any such routes, it MAY still send 1416 a seqno request. The router-id of the request is set to the router- 1417 id of the route that it has just lost, and the requested seqno is the 1418 value contained in the source table plus 1. The request carries a 1419 hop count, which is used as a last-resort mechanism to ensure that it 1420 eventually vanishes from the network; it MAY be set to any value that 1421 is larger than the diameter of the network (64 is a suitable default 1422 value). 1424 If the node has any (unfeasible) routes to the requested destination, 1425 then it MUST send the request to at least one of the next-hop 1426 neighbours that advertised these routes, and SHOULD send it to all of 1427 them; in any case, it MAY send the request to any other neighbours, 1428 whether they advertise a route to the requested destination or not. 1430 A simple implementation strategy is therefore to unconditionally 1431 multicast the request over all interfaces. 1433 Similar requests will be sent by other nodes that are affected by the 1434 route's loss. If the network is still connected, and assuming no 1435 packet loss, then at least one of these requests will be forwarded to 1436 the source, resulting in a route being advertised with a new sequence 1437 number. (Due to duplicate suppression, only a small number of such 1438 requests are expected to actually reach the source.) 1440 In order to compensate for packet loss, a node SHOULD repeat such a 1441 request a small number of times if no route becomes feasible within a 1442 short time (see "Request Timeout" in Appendix B for suggested 1443 values). In the presence of heavy packet loss, however, all such 1444 requests might be lost; in that case, the mechanism in the next 1445 section will eventually ensure that a new seqno is received. 1447 3.8.2.2. Dealing with Unfeasible Updates 1449 When a route's metric increases, a node might receive an unfeasible 1450 update for a route that it has currently selected. As specified in 1451 Section 3.5.1, the receiving node will either ignore the update or 1452 unselect the route. 1454 In order to keep routes from spuriously expiring because they have 1455 become unfeasible, a node SHOULD send a unicast seqno request when it 1456 receives an unfeasible update for a route that is currently selected. 1457 The requested sequence number is computed from the source table as in 1458 Section 3.8.2.1 above. 1460 Additionally, since metric computation does not necessarily coincide 1461 with the delay in propagating updates, a node might receive an 1462 unfeasible update from a currently unselected neighbour that is 1463 preferable to the currently selected route (e.g., because it has a 1464 much smaller metric); in that case, the node SHOULD send a unicast 1465 seqno request to the neighbour that advertised the preferable update. 1467 3.8.2.3. Preventing Routes from Expiring 1469 In normal operation, a route's expiry timer never triggers: since a 1470 route's hold time is computed from an explicit interval included in 1471 Update TLVs, a new update (possibly a retraction) should arrive in 1472 time to prevent a route from expiring. 1474 In the presence of packet loss, however, it may be the case that no 1475 update is successfully received for an extended period of time, 1476 causing a route to expire. In order to avoid such spurious expiry, 1477 shortly before a selected route expires, a Babel node SHOULD send a 1478 unicast route request to the neighbour that advertised this route; 1479 since nodes always send either updates or retractions in response to 1480 non-wildcard route requests (Section 3.8.1.1), this will usually 1481 result in the route being either refreshed or retracted. 1483 4. Protocol Encoding 1485 A Babel packet MUST be sent as the body of a UDP datagram, with 1486 network-layer hop count set to 1, destined to a well-known multicast 1487 address or to a unicast address, over IPv4 or IPv6; in the case of 1488 IPv6, these addresses are link-local. Both the source and 1489 destination UDP port are set to a well-known port number. A Babel 1490 packet MUST be silently ignored unless its source address is either a 1491 link-local IPv6 address or an IPv4 address belonging to the local 1492 network, and its source port is the well-known Babel port. It MAY be 1493 silently ignored if its destination address is a global IPv6 address. 1495 In order to minimise the number of packets being sent while avoiding 1496 lower-layer fragmentation, a Babel node SHOULD maximise the size of 1497 the packets it sends, up to the outgoing interface's MTU adjusted for 1498 lower-layer headers (28 octets for UDP over IPv4, 48 octets for UDP 1499 over IPv6). It MUST NOT send packets larger than the attached 1500 interface's MTU adjusted for lower-layer headers or 512 octets, 1501 whichever is larger, but not exceeding 2^16 - 1 adjusted for lower- 1502 layer headers. Every Babel speaker MUST be able to receive packets 1503 that are as large as any attached interface's MTU adjusted for lower- 1504 layer headers or 512 octets, whichever is larger. Babel packets MUST 1505 NOT be sent in IPv6 Jumbograms [RFC2675]. 1507 4.1. Data Types 1509 4.1.1. Interval 1511 Relative times are carried as 16-bit values specifying a number of 1512 centiseconds (hundredths of a second). This allows times up to 1513 roughly 11 minutes with a granularity of 10ms, which should cover all 1514 reasonable applications of Babel (see also Appendix B). 1516 4.1.2. Router-Id 1518 A router-id is an arbitrary 8-octet value. A router-id MUST NOT 1519 consist of either all binary zeroes (0000000000000000 hexadecimal) or 1520 all binary ones (FFFFFFFFFFFFFFFF hexadecimal). 1522 4.1.3. Address 1524 Since the bulk of the protocol is taken by addresses, multiple ways 1525 of encoding addresses are defined. Additionally, within Update TLVs 1526 a common subnet prefix may be omitted when multiple addresses are 1527 sent in a single packet -- this is known as address compression 1528 (Section 4.6.9). 1530 Address encodings: 1532 o AE 0: wildcard address. The value is 0 octets long. 1534 o AE 1: IPv4 address. Compression is allowed. 4 octets or less. 1536 o AE 2: IPv6 address. Compression is allowed. 16 octets or less. 1538 o AE 3: link-local IPv6 address. Compression is not allowed. The 1539 value is 8 octets long, a prefix of fe80::/64 is implied. 1541 The address family associated to an address encoding is either IPv4 1542 or IPv6; it is undefined for AE 0, IPv4 for AE 1, and IPv6 for AEs 2 1543 and 3. 1545 4.1.4. Prefixes 1547 A network prefix is encoded just like a network address, but it is 1548 stored in the smallest number of octets that are enough to hold the 1549 significant bits (up to the prefix length). 1551 4.2. Packet Format 1553 A Babel packet consists of a 4-octet header, followed by a sequence 1554 of TLVs (the packet body), optionally followed by a second sequence 1555 of TLVs (the packet trailer). The format is designed to be 1556 extensible; see Appendix D for extensibility considerations. 1558 0 1 2 3 1559 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 1560 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1561 | Magic | Version | Body length | 1562 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1563 | Packet Body ... 1564 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1565 | Packet Trailer... 1566 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1568 Fields : 1570 Magic The arbitrary but carefully chosen value 42 (decimal); 1571 packets with a first octet different from 42 MUST be 1572 silently ignored. 1574 Version This document specifies version 2 of the Babel protocol. 1575 Packets with a second octet different from 2 MUST be 1576 silently ignored. 1578 Body length The length in octets of the body following the packet 1579 header (excluding the Magic, Version and Body length 1580 fields, and excluding the packet trailer). 1582 Packet Body The packet body; a sequence of TLVs. 1584 Packet Trailer The packet trailer; another sequence of TLVs. 1586 The packet body and trailer are both sequences of TLVs. The packet 1587 body is the normal place to store TLVs; the packet trailer only 1588 contains specialised TLVs that do not need to be protected by 1589 cryptographic security mechanisms. When parsing the trailer, the 1590 receiver MUST ignore any TLV unless its definition explicitly states 1591 that it is allowed to appear there. Among the TLVs defined in this 1592 document, only Pad1 and PadN are allowed in the trailer; since these 1593 TLVs are ignored in any case, an implementation MAY silently ignore 1594 the packet trailer without even parsing it, unless it implements at 1595 least one protocol extension that defines TLVs that are allowed to 1596 appear in the trailer. 1598 4.3. TLV Format 1600 With the exception of Pad1, all TLVs have the following structure: 1602 0 1 2 3 1603 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 1604 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1605 | Type | Length | Payload... 1606 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1608 Fields : 1610 Type The type of the TLV. 1612 Length The length of the body in octets, exclusive of the Type and 1613 Length fields. 1615 Payload The TLV payload, which consists of a body and, for selected 1616 TLV types, an optional list of sub-TLVs. 1618 TLVs with an unknown type value MUST be silently ignored. 1620 4.4. Sub-TLV Format 1622 Every TLV carries an explicit length in its header; however, most 1623 TLVs are self-terminating, in the sense that it is possible to 1624 determine the length of the body without reference to the explicit 1625 Length field. If a TLV has a self-terminating format, then the space 1626 between the natural size of the TLV and the size announced in the 1627 Length field may be used to store a sequence of sub-TLVs. 1629 Sub-TLVs have the same structure as TLVs. With the exception of 1630 Pad1, all TLVs have the following structure: 1632 0 1 2 3 1633 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 1634 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1635 | Type | Length | Body... 1636 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1638 Fields : 1640 Type The type of the sub-TLV. 1642 Length The length of the body in octets, exclusive of the Type and 1643 Length fields. 1645 Body The sub-TLV body, the interpretation of which depends on 1646 both the type of the sub-TLV and the type of the TLV within 1647 which it is embedded. 1649 The most-significant bit of the sub-TLV type (the bit with value 80 1650 hexadecimal), is called the mandatory bit; in other words, sub-TLV 1651 types 128 through 255 have the mandatory bit set. This bit indicates 1652 how to handle unknown sub-TLVs. If the mandatory bit is not set, 1653 then an unknown sub-TLV MUST be silently ignored, and the rest of the 1654 TLV is processed normally. If the mandatory bit is set, then the 1655 whole enclosing TLV MUST be silently ignored (except for updating the 1656 parser state by a Router-Id, Next-Hop or Update TLV, as described in 1657 the next section). 1659 4.5. Parser state and encoding of updates 1661 In a large network, the bulk of Babel traffic consists of route 1662 updates; hence, some care has been given to encoding them 1663 efficiently. The data conceptually contained in an update 1664 (Section 3.5) is split into three pieces: 1666 o the prefix, seqno and metric are contained in the Update TLV 1667 itself (Section 4.6.9); 1669 o the router-id is taken from Router-Id TLV that precedes the Update 1670 TLV, and may be shared among multiple Update TLVs (Section 4.6.7); 1672 o the next hop is taken either from the source-address of the 1673 network-layer packet that contains the Babel packet, or from an 1674 explicit Next-Hop TLV (Section 4.6.8). 1676 In addition to the above, an Update TLV can omit a prefix of the 1677 prefix being announced, which is then extracted from the preceding 1678 Update TLV in the same address family (IPv4 or IPv6). Finally, as a 1679 special optimisation for the case when a router-id coincides with the 1680 interface-id part of an IPv6 address, Router-ID TLV itself may be 1681 omitted and the router-id derived derived from the low-order bits of 1682 the advertised prefix (Section 4.6.9). 1684 In order to implement these compression techniques, Babel uses a 1685 stateful parser: a TLV may refer to data from a previous TLV. The 1686 parser state consists of the following pieces of data: 1688 o for each address encoding that allows compression, the current 1689 default prefix; this is undefined at the start of the packet, and 1690 is updated by each Update TLV with the Prefix flag set 1691 (Section 4.6.9); 1693 o for each address family (IPv4 or IPv6), the current next-hop; this 1694 is the source address of the enclosing packet for the matching 1695 address family at the start of a packet, and is updated by each 1696 Next-Hop TLV (Section 4.6.8); 1698 o the current router-id; this is undefined at the start of the 1699 packet, and is updated by each Router-ID TLV (Section 4.6.7) and 1700 by each Update TLV with Router-Id flag set. 1702 Since the parser state must be identical across implementations, it 1703 is updated before checking for mandatory sub-TLVs: parsing a TLV MUST 1704 update the parser state even if the TLV is otherwise ignored due to 1705 an unknown mandatory sub-TLV or for any other reason. 1707 None of the TLVs that modify the parser state are allowed in the 1708 packet trailer; hence, an implementation may choose to use a 1709 dedicated stateless parser to parse the packet trailer. 1711 4.6. Details of Specific TLVs 1713 4.6.1. Pad1 1715 0 1716 0 1 2 3 4 5 6 7 1717 +-+-+-+-+-+-+-+-+ 1718 | Type = 0 | 1719 +-+-+-+-+-+-+-+-+ 1721 Fields : 1723 Type Set to 0 to indicate a Pad1 TLV. 1725 This TLV is silently ignored on reception. It is allowed in the 1726 packet trailer. 1728 4.6.2. PadN 1730 0 1 2 3 1731 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 1732 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1733 | Type = 1 | Length | MBZ... 1734 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1736 Fields : 1738 Type Set to 1 to indicate a PadN TLV. 1740 Length The length of the body in octets, exclusive of the Type and 1741 Length fields. 1743 MBZ Must be zero, set to 0 on transmission. 1745 This TLV is silently ignored on reception. It is allowed in the 1746 packet trailer. 1748 4.6.3. Acknowledgment Request 1750 0 1 2 3 1751 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 1752 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1753 | Type = 2 | Length | Reserved | 1754 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1755 | Opaque | Interval | 1756 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1757 This TLV requests that the receiver send an Acknowledgment TLV within 1758 the number of centiseconds specified by the Interval field. 1760 Fields : 1762 Type Set to 2 to indicate an Acknowledgment Request TLV. 1764 Length The length of the body in octets, exclusive of the Type and 1765 Length fields. 1767 Reserved Sent as 0 and MUST be ignored on reception. 1769 Opaque An arbitrary value that will be echoed in the receiver's 1770 Acknowledgment TLV. 1772 Interval A time interval in centiseconds after which the sender will 1773 assume that this packet has been lost. This MUST NOT be 0. 1774 The receiver MUST send an Acknowledgment TLV before this 1775 time has elapsed (with a margin allowing for propagation 1776 time). 1778 This TLV is self-terminating, and allows sub-TLVs. 1780 4.6.4. Acknowledgment 1782 0 1 2 3 1783 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 1784 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1785 | Type = 3 | Length | Opaque | 1786 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1788 This TLV is sent by a node upon receiving an Acknowledgment Request. 1790 Fields : 1792 Type Set to 3 to indicate an Acknowledgment TLV. 1794 Length The length of the body in octets, exclusive of the Type and 1795 Length fields. 1797 Opaque Set to the Opaque value of the Acknowledgment Request that 1798 prompted this Acknowledgment. 1800 Since Opaque values are not globally unique, this TLV MUST be sent to 1801 a unicast address. 1803 This TLV is self-terminating, and allows sub-TLVs. 1805 4.6.5. Hello 1807 0 1 2 3 1808 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 1809 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1810 | Type = 4 | Length | Flags | 1811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1812 | Seqno | Interval | 1813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1815 This TLV is used for neighbour discovery and for determining a 1816 neighbour's reception cost. 1818 Fields : 1820 Type Set to 4 to indicate a Hello TLV. 1822 Length The length of the body in octets, exclusive of the Type and 1823 Length fields. 1825 Flags The individual bits of this field specify special handling 1826 of this TLV (see below). 1828 Seqno If the Unicast flag is set, this is the value of the 1829 sending node's outgoing Unicast Hello seqno for this 1830 neighbour. Otherwise, it is the sending node's outgoing 1831 Multicast Hello seqno for this interface. 1833 Interval If non-zero, this is an upper bound, expressed in 1834 centiseconds, on the time after which the sending node will 1835 send a new scheduled Hello TLV with the same setting of the 1836 Unicast flag. If this is 0, then this Hello represents an 1837 unscheduled Hello, and doesn't carry any new information 1838 about times at which Hellos are sent. 1840 The Flags field is interpreted as follows: 1842 0 1 1843 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1844 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1845 |U|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 1846 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1848 o U (Unicast) flag (8000 hexadecimal): if set, then this Hello 1849 represents a Unicast Hello, otherwise it represents a Multicast 1850 Hello; 1852 o X: all other bits MUST be sent as 0 and silently ignored on 1853 reception. 1855 Every time a Hello is sent, the corresponding seqno counter MUST be 1856 incremented. Since there is a single seqno counter for all the 1857 Multicast Hellos sent by a given node over a given interface, if the 1858 Unicast flag is not set, this TLV MUST be sent to all neighbors on 1859 this link, which can be achieved by sending to a multicast 1860 destination, or by sending multiple packets to the unicast addresses 1861 of all reachable neighbours. Conversely, if the Unicast flag is set, 1862 this TLV MUST be sent to a single neighbour, which can achieved by 1863 sending to a unicast destination. In order to avoid large 1864 discontinuities in link quality, multiple Hello TLVs SHOULD NOT be 1865 sent in the same packet. 1867 This TLV is self-terminating, and allows sub-TLVs. 1869 4.6.6. IHU 1871 0 1 2 3 1872 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 1873 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1874 | Type = 5 | Length | AE | Reserved | 1875 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1876 | Rxcost | Interval | 1877 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1878 | Address... 1879 +-+-+-+-+-+-+-+-+-+-+-+- 1881 An IHU ("I Heard You") TLV is used for confirming bidirectional 1882 reachability and carrying a link's transmission cost. 1884 Fields : 1886 Type Set to 5 to indicate an IHU TLV. 1888 Length The length of the body in octets, exclusive of the Type and 1889 Length fields. 1891 AE The encoding of the Address field. This should be 1 or 3 1892 in most cases. As an optimisation, it MAY be 0 if the TLV 1893 is sent to a unicast address, if the association is over a 1894 point-to-point link, or when bidirectional reachability is 1895 ascertained by means outside of the Babel protocol. 1897 Reserved Sent as 0 and MUST be ignored on reception. 1899 Rxcost The rxcost according to the sending node of the interface 1900 whose address is specified in the Address field. The value 1901 FFFF hexadecimal (infinity) indicates that this interface 1902 is unreachable. 1904 Interval An upper bound, expressed in centiseconds, on the time 1905 after which the sending node will send a new IHU; this MUST 1906 NOT be 0. The receiving node will use this value in order 1907 to compute a hold time for this symmetric association. 1909 Address The address of the destination node, in the format 1910 specified by the AE field. Address compression is not 1911 allowed. 1913 Conceptually, an IHU is destined to a single neighbour. However, IHU 1914 TLVs contain an explicit destination address, and MAY be sent to a 1915 multicast address, as this allows aggregation of IHUs destined to 1916 distinct neighbours into a single packet and avoids the need for an 1917 ARP or Neighbour Discovery exchange when a neighbour is not being 1918 used for data traffic. 1920 IHU TLVs with an unknown value in the AE field MUST be silently 1921 ignored. 1923 This TLV is self-terminating, and allows sub-TLVs. 1925 4.6.7. Router-Id 1927 0 1 2 3 1928 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 1929 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1930 | Type = 6 | Length | Reserved | 1931 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1932 | | 1933 + Router-Id + 1934 | | 1935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1937 A Router-Id TLV establishes a router-id that is implied by subsequent 1938 Update TLVs, as described in Section 4.5. This TLV sets the router- 1939 id even if it is otherwise ignored due to an unknown mandatory sub- 1940 TLV. 1942 Fields : 1944 Type Set to 6 to indicate a Router-Id TLV. 1946 Length The length of the body in octets, exclusive of the Type and 1947 Length fields. 1949 Reserved Sent as 0 and MUST be ignored on reception. 1951 Router-Id The router-id for routes advertised in subsequent Update 1952 TLVs. This MUST NOT consist of all zeroes or all ones. 1954 This TLV is self-terminating, and allows sub-TLVs. 1956 4.6.8. Next Hop 1958 0 1 2 3 1959 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 1960 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1961 | Type = 7 | Length | AE | Reserved | 1962 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1963 | Next hop... 1964 +-+-+-+-+-+-+-+-+-+-+-+- 1966 A Next Hop TLV establishes a next-hop address for a given address 1967 family (IPv4 or IPv6) that is implied in subsequent Update TLVs, as 1968 described in Section 4.5. This TLV sets up the next-hop for 1969 subsequent Update TLVs even if it is otherwise ignored due to an 1970 unknown mandatory sub-TLV. 1972 Fields : 1974 Type Set to 7 to indicate a Next Hop TLV. 1976 Length The length of the body in octets, exclusive of the Type and 1977 Length fields. 1979 AE The encoding of the Address field. This SHOULD be 1 (IPv4) 1980 or 3 (link-local IPv6), and MUST NOT be 0. 1982 Reserved Sent as 0 and MUST be ignored on reception. 1984 Next hop The next-hop address advertised by subsequent Update TLVs, 1985 for this address family. 1987 When the address family matches the network-layer protocol that this 1988 packet is transported over, a Next Hop TLV is not needed: in the 1989 absence of a Next Hop TLV in a given address family, the next hop 1990 address is taken to be the source address of the packet. 1992 Next Hop TLVs with an unknown value for the AE field MUST be silently 1993 ignored. 1995 This TLV is self-terminating, and allows sub-TLVs. 1997 4.6.9. Update 1999 0 1 2 3 2000 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 2001 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2002 | Type = 8 | Length | AE | Flags | 2003 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2004 | Plen | Omitted | Interval | 2005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2006 | Seqno | Metric | 2007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2008 | Prefix... 2009 +-+-+-+-+-+-+-+-+-+-+-+- 2011 An Update TLV advertises or retracts a route. As an optimisation, it 2012 can optionally have the side effect of establishing a new implied 2013 router-id and a new default prefix, as described in Section 4.5. 2015 Fields : 2017 Type Set to 8 to indicate an Update TLV. 2019 Length The length of the body in octets, exclusive of the Type and 2020 Length fields. 2022 AE The encoding of the Prefix field. 2024 Flags The individual bits of this field specify special handling 2025 of this TLV (see below). 2027 Plen The length in bits of the advertised prefix. If AE is 3 2028 (link-local IPv6), Omitted MUST be 0. 2030 Omitted The number of octets that have been omitted at the 2031 beginning of the advertised prefix and that should be taken 2032 from a preceding Update TLV in the same address family with 2033 the Prefix flag set. 2035 Interval An upper bound, expressed in centiseconds, on the time 2036 after which the sending node will send a new update for 2037 this prefix. This MUST NOT be 0. The receiving node will 2038 use this value to compute a hold time for the route table 2039 entry. The value FFFF hexadecimal (infinity) expresses 2040 that this announcement will not be repeated unless a 2041 request is received (Section 3.8.2.3). 2043 Seqno The originator's sequence number for this update. 2045 Metric The sender's metric for this route. The value FFFF 2046 hexadecimal (infinity) means that this is a route 2047 retraction. 2049 Prefix The prefix being advertised. This field's size is 2050 (Plen/8 - Omitted) rounded upwards. 2052 The Flags field is interpreted as follows: 2054 0 1 2 3 4 5 6 7 2055 +-+-+-+-+-+-+-+-+ 2056 |P|R|X|X|X|X|X|X| 2057 +-+-+-+-+-+-+-+-+ 2059 o P (Prefix) flag (80 hexadecimal): if set, then this Update 2060 establishes a new default prefix for subsequent Update TLVs with a 2061 matching address encoding within the same packet, even if this TLV 2062 is otherwise ignored due to an unknown mandatory sub-TLV; 2064 o R (Router-Id) flag (40 hexadecimal): if set, then this TLV 2065 establishes a new default router-id for this TLV and subsequent 2066 Update TLVs in the same packet, even if this TLV is otherwise 2067 ignored due to an unknown mandatory sub-TLV. This router-id is 2068 computed from the first address of the advertised prefix as 2069 follows: 2071 * if the length of the address is 8 octets or more, then the new 2072 router-id is taken from the 8 last octets of the address; 2074 * if the length of the address is smaller than 8 octets, then the 2075 new router-id consists of the required number of zero octets 2076 followed by the address, i.e., the address is stored on the 2077 right of the router-id. For example, for an IPv4 address, the 2078 router-id consists of 4 octets of zeroes followed by the IPv4 2079 address. 2081 o X: all other bits MUST be sent as 0 and silently ignored on 2082 reception. 2084 The prefix being advertised by an Update TLV is computed as follows: 2086 o the first Omitted octets of the prefix are taken from the previous 2087 Update TLV with the Prefix flag set and the same address encoding, 2088 even if it was ignored due to an unknown mandatory sub-TLV; if 2089 Omitted is not zero and there is no such TLV, then this Update 2090 MUST be ignored; 2092 o the next (Plen/8 - Omitted) rounded upwards octets are taken from 2093 the Prefix field; 2095 o if Plen is not a multiple of 8, then any bits beyond Plen (i.e., 2096 the low-order (8 - Plen MOD 8) bits of the last octet) are 2097 cleared; 2099 o the remaining octets are set to 0. 2101 If the Metric field is finite, the router-id of the originating node 2102 for this announcement is taken from the prefix advertised by this 2103 Update if the Router-Id flag is set, computed as described above. 2104 Otherwise, it is taken either from the preceding Router-Id TLV, or 2105 the preceding Update TLV with the Router-Id flag set, whichever comes 2106 last, even if that TLV is otherwise ignored due to an unknown 2107 mandatory sub-TLV; if there is no suitable TLV, then this update is 2108 ignored. 2110 The next-hop address for this update is taken from the last preceding 2111 Next Hop TLV with a matching address family (IPv4 or IPv6) in the 2112 same packet even if it was otherwise ignored due to an unknown 2113 mandatory sub-TLV; if no such TLV exists, it is taken from the 2114 network-layer source address of this packet if it belongs to the same 2115 address family as the prefix being announced; otherwise, this Update 2116 MUST be ignored. 2118 If the metric field is FFFF hexadecimal, this TLV specifies a 2119 retraction. In that case, the router-id, next-hop and seqno are not 2120 used. AE MAY then be 0, in which case this Update retracts all of 2121 the routes previously advertised by the sending interface. If the 2122 metric is finite, AE MUST NOT be 0; Update TLVs with finite metric 2123 and AE equal to 0 MUST be ignored. If the metric is infinite and AE 2124 is 0, Plen and Omitted MUST both be 0; Update TLVs that do not 2125 satisfy this requirement MUST be ignored. 2127 Update TLVs with an unknown value in the AE field MUST be silently 2128 ignored. 2130 This TLV is self-terminating, and allows sub-TLVs. 2132 4.6.10. Route Request 2133 0 1 2 3 2134 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 2135 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2136 | Type = 9 | Length | AE | Plen | 2137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2138 | Prefix... 2139 +-+-+-+-+-+-+-+-+-+-+-+- 2141 A Route Request TLV prompts the receiver to send an update for a 2142 given prefix, or a full route table dump. 2144 Fields : 2146 Type Set to 9 to indicate a Route Request TLV. 2148 Length The length of the body in octets, exclusive of the Type and 2149 Length fields. 2151 AE The encoding of the Prefix field. The value 0 specifies 2152 that this is a request for a full route table dump (a 2153 wildcard request). 2155 Plen The length in bits of the requested prefix. 2157 Prefix The prefix being requested. This field's size is Plen/8 2158 rounded upwards. 2160 A Request TLV prompts the receiver to send an update message 2161 (possibly a retraction) for the prefix specified by the AE, Plen, and 2162 Prefix fields, or a full dump of its route table if AE is 0 (in which 2163 case Plen must be 0 and Prefix is of length 0). A Request TLV with 2164 AE set to 0 and Plen not set to 0 MUST be ignored. 2166 This TLV is self-terminating, and allows sub-TLVs. 2168 4.6.11. Seqno Request 2169 0 1 2 3 2170 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 2171 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2172 | Type = 10 | Length | AE | Plen | 2173 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2174 | Seqno | Hop Count | Reserved | 2175 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2176 | | 2177 + Router-Id + 2178 | | 2179 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2180 | Prefix... 2181 +-+-+-+-+-+-+-+-+-+-+ 2183 A Seqno Request TLV prompts the receiver to send an Update for a 2184 given prefix with a given sequence number, or to forward the request 2185 further if it cannot be satisfied locally. 2187 Fields : 2189 Type Set to 10 to indicate a Seqno Request TLV. 2191 Length The length of the body in octets, exclusive of the Type and 2192 Length fields. 2194 AE The encoding of the Prefix field. This MUST NOT be 0. 2196 Plen The length in bits of the requested prefix. 2198 Seqno The sequence number that is being requested. 2200 Hop Count The maximum number of times that this TLV may be forwarded, 2201 plus 1. This MUST NOT be 0. 2203 Reserved Sent as 0 and MUST be ignored on reception. 2205 Router-Id The Router-Id that is being requested. This MUST NOT 2206 consist of all zeroes or all ones. 2208 Prefix The prefix being requested. This field's size is Plen/8 2209 rounded upwards. 2211 A Seqno Request TLV prompts the receiving node to send a finite- 2212 metric Update for the prefix specified by the AE, Plen, and Prefix 2213 fields, with either a router-id different from what is specified by 2214 the Router-Id field, or a Seqno no less (modulo 2^16) than what is 2215 specified by the Seqno field. If this request cannot be satisfied 2216 locally, then it is forwarded according to the rules set out in 2217 Section 3.8.1.2. 2219 While a Seqno Request MAY be sent to a multicast address, it MUST NOT 2220 be forwarded to a multicast address and MUST NOT be forwarded to more 2221 than one neighbour. A request MUST NOT be forwarded if its Hop Count 2222 field is 1. 2224 This TLV is self-terminating, and allows sub-TLVs. 2226 4.7. Details of specific sub-TLVs 2228 4.7.1. Pad1 2230 0 1 2 3 4 5 6 7 2231 +-+-+-+-+-+-+-+-+ 2232 | Type = 0 | 2233 +-+-+-+-+-+-+-+-+ 2235 Fields : 2237 Type Set to 0 to indicate a Pad1 sub-TLV. 2239 This sub-TLV is silently ignored on reception. It is allowed within 2240 any TLV that allows sub-TLVs. 2242 4.7.2. PadN 2244 0 1 2 3 2245 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 2246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2247 | Type = 1 | Length | MBZ... 2248 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 2250 Fields : 2252 Type Set to 1 to indicate a PadN sub-TLV. 2254 Length The length of the body in octets, exclusive of the Type and 2255 Length fields. 2257 MBZ Must be zero, set to 0 on transmission. 2259 This sub-TLV is silently ignored on reception. It is allowed within 2260 any TLV that allows sub-TLVs. 2262 5. IANA Considerations 2264 IANA has registered the UDP port number 6696, called "babel", for use 2265 by the Babel protocol. 2267 IANA has registered the IPv6 multicast group ff02::1:6 and the IPv4 2268 multicast group 224.0.0.111 for use by the Babel protocol. 2270 IANA has created a registry called "Babel TLV Types". The allocation 2271 policy for this registry is Specification Required [RFC8126] for 2272 Types 0-223, and Experimental Use for Types 224-254. The values in 2273 this registry are as follows: 2275 +---------+-----------------------------------------+---------------+ 2276 | Type | Name | Reference | 2277 +---------+-----------------------------------------+---------------+ 2278 | 0 | Pad1 | this document | 2279 | | | | 2280 | 1 | PadN | this document | 2281 | | | | 2282 | 2 | Acknowledgment Request | this document | 2283 | | | | 2284 | 3 | Acknowledgment | this document | 2285 | | | | 2286 | 4 | Hello | this document | 2287 | | | | 2288 | 5 | IHU | this document | 2289 | | | | 2290 | 6 | Router-Id | this document | 2291 | | | | 2292 | 7 | Next Hop | this document | 2293 | | | | 2294 | 8 | Update | this document | 2295 | | | | 2296 | 9 | Route Request | this document | 2297 | | | | 2298 | 10 | Seqno Request | this document | 2299 | | | | 2300 | 11 | TS/PC | [RFC7298] | 2301 | | | | 2302 | 12 | HMAC | [RFC7298] | 2303 | | | | 2304 | 13 | Source-specific Update | [BABEL-SS] | 2305 | | | | 2306 | 14 | Source-specific Request | [BABEL-SS] | 2307 | | | | 2308 | 15 | Source-specific Seqno Request | [BABEL-SS] | 2309 | | | | 2310 | 16 | MAC | [BABEL-MAC] | 2311 | | | | 2312 | 17 | PC | [BABEL-MAC] | 2313 | | | | 2314 | 18 | Challenge Request | [BABEL-MAC] | 2315 | | | | 2316 | 19 | Challenge Reply | [BABEL-MAC] | 2317 | | | | 2318 | 20-223 | Unassigned | | 2319 | | | | 2320 | 224-254 | Reserved for Experimental Use | this document | 2321 | | | | 2322 | 255 | Reserved for expansion of the type | this document | 2323 | | space | | 2324 +---------+-----------------------------------------+---------------+ 2326 IANA has created a registry called "Babel sub-TLV Types". The 2327 allocation policy for this registry is Specification Required for 2328 Types 0-111 and 128-239, and Experimental Use for Types 112-126 and 2329 240-254. The values in this registry are as follows: 2331 +---------+-------------------------------------+-------------------+ 2332 | Type | Name | Reference | 2333 +---------+-------------------------------------+-------------------+ 2334 | 0 | Pad1 | this document | 2335 | | | | 2336 | 1 | PadN | this document | 2337 | | | | 2338 | 2 | Diversity | [BABEL-DIVERSITY] | 2339 | | | | 2340 | 3 | Timestamp | [BABEL-RTT] | 2341 | | | | 2342 | 4-111 | Unassigned | | 2343 | | | | 2344 | 112-126 | Reserved for Experimental Use | this document | 2345 | | | | 2346 | 127 | Reserved for expansion of the type | this document | 2347 | | space | | 2348 | | | | 2349 | 128 | Source Prefix | [BABEL-SS] | 2350 | | | | 2351 | 129-239 | Unassigned | | 2352 | | | | 2353 | 240-254 | Reserved for Experimental Use | this document | 2354 | | | | 2355 | 255 | Reserved for expansion of the type | this document | 2356 | | space | | 2357 +---------+-------------------------------------+-------------------+ 2358 IANA is instructed to create a registry called "Babel Address 2359 Encodings". The allocation policy for this registry is Specification 2360 Required. The values in this registry are as follows: 2362 +----+-------------------------+---------------+ 2363 | AE | Name | Reference | 2364 +----+-------------------------+---------------+ 2365 | 0 | Wildcard address | this document | 2366 | | | | 2367 | 1 | IPv4 address | this document | 2368 | | | | 2369 | 2 | IPv6 address | this document | 2370 | | | | 2371 | 3 | Link-local IPv6 address | this document | 2372 +----+-------------------------+---------------+ 2374 IANA has created a registry called "Babel Flags Values". The 2375 allocation policy for this registry is Specification Required. IANA 2376 is instructed to rename this registry to "Babel Update Flags Values". 2377 The values in this registry are as follows: 2379 +-----+-------------------+---------------+ 2380 | Bit | Name | Reference | 2381 +-----+-------------------+---------------+ 2382 | 0 | Default prefix | this document | 2383 | | | | 2384 | 1 | Default Router-ID | this document | 2385 | | | | 2386 | 2-7 | Unassigned | | 2387 +-----+-------------------+---------------+ 2389 IANA is instructed to create a new registry called "Babel Hello Flags 2390 Values". The allocation policy for this registry is Specification 2391 Required. The initial values in this registry are as follows: 2393 +------+------------+---------------+ 2394 | Bit | Name | Reference | 2395 +------+------------+---------------+ 2396 | 0 | Unicast | this document | 2397 | | | | 2398 | 1-15 | Unassigned | | 2399 +------+------------+---------------+ 2401 IANA is instructed to replace all references to RFCs 6126 and 7557 in 2402 all of the registries mentioned above by references to this document. 2404 6. Security Considerations 2406 As defined in this document, Babel is a completely insecure protocol. 2407 Without additional security mechanisms, Babel trusts any information 2408 it receives in plaintext UDP datagrams and acts on it. An attacker 2409 that is present on the local network can impact Babel operation in a 2410 variety of ways; for example they can: 2412 o spoof a Babel packet, and redirect traffic by announcing a route 2413 with a smaller metric, a larger sequence number, or a longer 2414 prefix; 2416 o spoof a malformed packet, which could cause an insufficiently 2417 robust implementation to crash or interfere with the rest of the 2418 network; 2420 o replay a previously captured Babel packet, which could cause 2421 traffic to be redirected, blackholed or otherwise interfere with 2422 the network. 2424 When carried over IPv6, Babel packets are ignored unless they are 2425 sent from a link-local IPv6 address; since routers don't forward 2426 link-local IPv6 packets, this mitigates the attacks outlined above by 2427 restricting them to on-link attackers. No such natural protection 2428 exists when Babel packets are carried over IPv4, which is one of the 2429 reasons why it is recommended to deploy Babel over IPv6 2430 (Section 3.1). 2432 It is usually difficult to ensure that packets arriving at a Babel 2433 node are trusted, even in the case where the local link is believed 2434 to be secure. For that reason, it is RECOMMENDED that all Babel 2435 traffic be protected by an application-layer cryptographic protocol. 2436 There are currently two suitable mechanisms, which implement 2437 different tradeoffs between implementation simplicity and security: 2439 o Babel over DTLS [BABEL-DTLS] runs the majority of Babel traffic 2440 over DTLS, and leverages DTLS to authenticate nodes and provide 2441 confidentiality and integrity protection; 2443 o MAC authentication [BABEL-MAC] appends a message authentication 2444 code (MAC) to every Babel packet to prove that it originated at a 2445 node that knows a shared secret, and includes sufficient 2446 additional information to prove that the packet is fresh (not 2447 replayed). 2449 Both mechanisms enable nodes to ignore packets generated by attackers 2450 without the proper credentials. They also ensure integrity of 2451 messages and prevent message replay. While Babel-DTLS supports 2452 asymmetric keying and ensures confidentiality, Babel-MAC has a much 2453 more limited scope (see Sections 1.1, 1.2 and 7 of [BABEL-MAC]). 2454 Since Babel-MAC is simpler and more lightweight, it is recommended in 2455 preference to Babel-DTLS in deployments where its limitations are 2456 acceptable, i.e., when symmetric keying is sufficient and where the 2457 routing information is not considered confidential. 2459 Every implementation of Babel SHOULD implement BABEL-MAC. 2461 One should be aware that the information that a mobile Babel node 2462 announces to the whole routing domain is sufficient to determine the 2463 mobile node's physical location with reasonable precision, which 2464 might cause privacy concerns even if the control traffic is protected 2465 from unauthenticated attackers by a cryptographic mechanism such as 2466 Babel-DTLS. This issue may be mitigated somewhat by using randomly 2467 chosen router-ids and randomly chosen IP addresses, and changing them 2468 often enough. 2470 7. Acknowledgments 2472 A number of people have contributed text and ideas to this 2473 specification. The authors are particularly indebted to Matthieu 2474 Boutier, Gwendoline Chouasne, Margaret Cullen, Donald Eastlake, Toke 2475 Hoiland-Jorgensen, Benjamin Kaduk, Joao Sobrinho and Martin 2476 Vigoureux. Earlier versions of this document greatly benefited from 2477 the input of Joel Halpern. The address compression technique was 2478 inspired by [PACKETBB]. 2480 8. References 2482 8.1. Normative References 2484 [BABEL-MAC] 2485 Do, C., Kolodziejak, W., and J. Chroboczek, "MAC 2486 authentication for the Babel routing protocol", Internet 2487 Draft draft-ietf-babel-hmac-10, August 2019. 2489 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2490 Requirement Levels", BCP 14, RFC 2119, 2491 DOI 10.17487/RFC2119, March 1997. 2493 [RFC793] Postel, J., "Transmission Control Protocol", RFC 793, 2494 DOI 10.17487/RFC0793, September 1981, 2495 . 2497 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2498 Writing an IANA Considerations Section in RFCs", BCP 26, 2499 RFC 8126, June 2017. 2501 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2502 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2503 May 2017. 2505 8.2. Informative References 2507 [BABEL-DIVERSITY] 2508 Chroboczek, J., "Diversity Routing for the Babel Routing 2509 Protocol", draft-chroboczek-babel-diversity-routing-01 2510 (work in progress), February 2016. 2512 [BABEL-DTLS] 2513 Decimo, A., Schinazi, D., and J. Chroboczek, "Babel 2514 Routing Protocol over Datagram Transport Layer Security", 2515 Internet Draft draft-ietf-babel-dtls-09, August 2019. 2517 [BABEL-RTT] 2518 Jonglez, B. and J. Chroboczek, "Delay-based Metric 2519 Extension for the Babel Routing Protocol", draft-ietf- 2520 babel-rtt-extension-00 (work in progress), April 2019. 2522 [BABEL-SS] 2523 Boutier, M. and J. Chroboczek, "Source-Specific Routing in 2524 Babel", draft-ietf-babel-source-specific-05 (work in 2525 progress), April 2019. 2527 [DSDV] Perkins, C. and P. Bhagwat, "Highly Dynamic Destination- 2528 Sequenced Distance-Vector Routing (DSDV) for Mobile 2529 Computers", ACM SIGCOMM'94 Conference on Communications 2530 Architectures, Protocols and Applications 234-244, 1994. 2532 [DUAL] Garcia Luna Aceves, J., "Loop-Free Routing Using Diffusing 2533 Computations", IEEE/ACM Transactions on Networking 1:1, 2534 February 1993. 2536 [EIGRP] Albrightson, B., Garcia Luna Aceves, J., and J. Boyle, 2537 "EIGRP -- a Fast Routing Protocol Based on Distance 2538 Vectors", Proc. Interop 94, 1994. 2540 [ETX] De Couto, D., Aguayo, D., Bicket, J., and R. Morris, "A 2541 high-throughput path metric for multi-hop wireless 2542 networks", Proc. MobiCom 2003, 2003. 2544 [IEEE802.11] 2545 IEEE, "IEEE Standard for Information technology-- 2546 Telecommunications and information exchange between 2547 systems Local and metropolitan area networks--Specific 2548 requirements Part 11: Wireless LAN Medium Access Control 2549 (MAC) and Physical Layer (PHY) Specifications", 2550 IEEE 802.11-2012, DOI 10.1109/ieeestd.2012.6178212, April 2551 2012. 2553 [IS-IS] Standardization, I. O. F., "Information technology -- 2554 Telecommunications and information exchange between 2555 systems -- Intermediate System to Intermediate System 2556 intra-domain routeing information exchange protocol for 2557 use in conjunction with the protocol for providing the 2558 connectionless-mode network service (ISO 8473)", ISO/ 2559 IEC 10589:2002, 2002. 2561 [JITTER] Floyd, S. and V. Jacobson, "The synchronization of 2562 periodic routing messages", IEEE/ACM Transactions on 2563 Networking 2, 2, 122-136, April 1994. 2565 [OSPF] Moy, J., "OSPF Version 2", RFC 2328, April 1998. 2567 [PACKETBB] 2568 Clausen, T., Dearlove, C., Dean, J., and C. Adjih, 2569 "Generalized Mobile Ad Hoc Network (MANET) Packet/Message 2570 Format", RFC 5444, February 2009. 2572 [RFC2675] Borman, D., Deering, S., and R. Hinden, "IPv6 Jumbograms", 2573 RFC 2675, DOI 10.17487/RFC2675, August 1999. 2575 [RFC3561] Perkins, C., Belding-Royer, E., and S. Das, "Ad hoc On- 2576 Demand Distance Vector (AODV) Routing", RFC 3561, 2577 DOI 10.17487/RFC3561, July 2003, 2578 . 2580 [RFC6126] Chroboczek, J., "The Babel Routing Protocol", RFC 6126, 2581 DOI 10.17487/RFC6126, April 2011. 2583 [RFC7298] Ovsienko, D., "Babel Hashed Message Authentication Code 2584 (HMAC) Cryptographic Authentication", RFC 7298, 2585 DOI 10.17487/RFC7298, July 2014. 2587 [RFC7557] Chroboczek, J., "Extension Mechanism for the Babel Routing 2588 Protocol", RFC 7557, DOI 10.17487/RFC7557, May 2015. 2590 [RIP] Malkin, G., "RIP Version 2", RFC 2453, November 1998. 2592 Appendix A. Cost and Metric Computation 2594 The strategy for computing link costs and route metrics is a local 2595 matter; Babel itself only requires that it comply with the conditions 2596 given in Section 3.4.3 and Section 3.5.2. Different nodes may use 2597 different strategies in a single network and may use different 2598 strategies on different interface types. This section describes a 2599 set of strategies that have been found to work well in actual 2600 networks. 2602 In summary, a node maintains per-neighbour statistics about the last 2603 16 received Hello TLVs of each kind (Appendix A.1), it computes costs 2604 by using the 2-out-of-3 strategy (Appendix A.2.1) on wired links, and 2605 ETX (Appendix A.2.2) on wireless links. It uses an additive algebra 2606 for metric computation (Section 3.5.2). 2608 A.1. Maintaining Hello History 2610 For each neighbour, a node maintains two sets of Hello history, one 2611 for each kind of Hello, and an expected sequence number, one for 2612 Multicast and one for Unicast Hellos. Each Hello history is a vector 2613 of 16 bits, where a 1 value represents a received Hello, and a 0 2614 value a missed Hello. For each kind of Hello, the expected sequence 2615 number, written ne, is the sequence number that is expected to be 2616 carried by the next received Hello from this neighbour. 2618 Whenever it receives a Hello packet of a given kind from a neighbour, 2619 a node compares the received sequence number nr for that kind of 2620 Hello with its expected sequence number ne. Depending on the outcome 2621 of this comparison, one of the following actions is taken: 2623 o if the two differ by more than 16 (modulo 2^16), then the sending 2624 node has probably rebooted and lost its sequence number; the whole 2625 associated neighbour table entry is flushed and a new one is 2626 created; 2628 o otherwise, if the received nr is smaller (modulo 2^16) than the 2629 expected sequence number ne, then the sending node has increased 2630 its Hello interval without us noticing; the receiving node removes 2631 the last (ne - nr) entries from this neighbour's Hello history (we 2632 "undo history"); 2634 o otherwise, if nr is larger (modulo 2^16) than ne, then the sending 2635 node has decreased its Hello interval, and some Hellos were lost; 2636 the receiving node adds (nr - ne) 0 bits to the Hello history (we 2637 "fast-forward"). 2639 The receiving node then appends a 1 bit to the Hello history and sets 2640 ne to (nr + 1). If the Interval field of the received Hello is not 2641 zero, it resets the neighbour's hello timer to 1.5 times the 2642 advertised Interval (the extra margin allows for delay due to 2643 jitter). 2645 Whenever either Hello timer associated to a neighbour expires, the 2646 local node adds a 0 bit to the corresponding Hello history, and 2647 increments the expected Hello number. If both Hello histories are 2648 empty (they contain 0 bits only), the neighbour entry is flushed; 2649 otherwise, the relevant hello timer is reset to the value advertised 2650 in the last Hello of that kind received from this neighbour (no extra 2651 margin is necessary in this case, since jitter was already taken into 2652 account when computing the timeout that has just expired). 2654 A.2. Cost Computation 2656 This section describes two algorithms suitable for computing costs 2657 (Section 3.4.3) based on Hello history. Appendix A.2.1 applies to 2658 wired links, and Appendix A.2.2 to wireless links. RECOMMENDED 2659 default values of the parameters that appear in these algorithms are 2660 given in Appendix B. 2662 A.2.1. k-out-of-j 2664 K-out-of-j link sensing is suitable for wired links that are either 2665 up, in which case they only occasionally drop a packet, or down, in 2666 which case they drop all packets. 2668 The k-out-of-j strategy is parameterised by two small integers k and 2669 j, such that 0 < k <= j, and the nominal link cost, a constant C >= 2670 1. A node keeps a history of the last j hellos; if k or more of 2671 those have been correctly received, the link is assumed to be up, and 2672 the rxcost is set to C; otherwise, the link is assumed to be down, 2673 and the rxcost is set to infinity. 2675 Since Babel supports two kinds of Hellos, a Babel node performs k- 2676 out-of-j twice for each neighbour, once on the Unicast and once on 2677 the Multicast Hello history. If either of the instances of k-out- 2678 of-j indicates that the link is up, then the link is assumed to be 2679 up, and the rxcost is set to C; if both instances indicate that the 2680 link is down, then the link is assumed to be down, and the rxcost is 2681 set to infinity. In other words, the resulting rxcost is the minimum 2682 of the rxcosts yielded by the two instances of k-out-of-j link 2683 sensing. 2685 The cost of a link performing k-out-of-j link sensing is defined as 2686 follows: 2688 o cost = FFFF hexadecimal if rxcost = FFFF hexadecimal; 2690 o cost = txcost otherwise. 2692 A.2.2. ETX 2694 Unlike wired links which are bimodal (either up or down), wireless 2695 links exhibit continuous variation of the link quality. Naive 2696 application of hop-count routing in networks that use wireless links 2697 for transit tends to select long, lossy links in preference to 2698 shorter, lossless links, which can dramatically reduce throughput. 2699 For that reason, a routing protocol designed to support wireless 2700 links must perform some form of link-quality estimation. 2702 The Expected Transmission Cost algorithm, or ETX [ETX], is a simple 2703 link-quality estimation algorithm that is designed to work well with 2704 the IEEE 802.11 MAC [IEEE802.11]. By default, the IEEE 802.11 MAC 2705 performs Automatic Repeat Query (ARQ) and rate adaptation on unicast 2706 frames, but not on multicast frames, which are sent at a fixed rate 2707 with no ARQ; therefore, measuring the loss rate of multicast frames 2708 yields a useful estimate of a link's quality. 2710 A node performing ETX link quality estimation uses a neighbour's 2711 Multicast Hello history to compute an estimate, written beta, of the 2712 probability that a Hello TLV is successfully received. Beta can be 2713 computed as the fraction of 1 bits within a small number (say, 6) of 2714 the most recent entries in the Multicast Hello history, or it can be 2715 an exponential average, or some combination of both approaches. Let 2716 rxcost be 256 / beta. 2718 Let alpha be MIN(1, 256/txcost), an estimate of the probability of 2719 successfully sending a Hello TLV. The cost is then computed by 2721 cost = 256/(alpha * beta) 2723 or, equivalently, 2725 cost = (MAX(txcost, 256) * rxcost) / 256. 2727 Since the IEEE 802.11 MAC performs ARQ on unicast frames, unicast 2728 frames do not provide a useful measure of link quality, and therefore 2729 ETX ignores the Unicast Hello history. Thus, a node performing ETX 2730 link-quality estimation will not route through neighbouring nodes 2731 unless they send periodic Multicast Hellos (possibly in addition to 2732 Unicast Hellos). 2734 A.3. Route selection and hysteresis 2736 Route selection (Section 3.6) is the process by which a node selects 2737 a single route among the routes that it has available towards a given 2738 destination. With Babel, any route selection procedure that only 2739 ever chooses feasible routes with a finite metric will yield a set of 2740 loop-free routes; however, in the presence of continuously variable 2741 metrics such as ETX (Appendix A.2.2), a naive route selection 2742 procedure might lead to persistent oscillations. Such oscillations 2743 can be limited or avoided altogether by implementing hysteresis 2744 within the route selection algorithm, i.e., by making the route 2745 selection algorithm sensitive to a route's history. Any reasonable 2746 hysteresis algorithm should yield good results ; the following 2747 algorithm is simple to implement and has been successfully deployed 2748 in a variety of environments. 2750 For every route R, in addition to the route's metric m(R), maintain a 2751 smoothed version of m(R) written ms(R) (we RECOMMEND computing ms(R) 2752 as an exponentially smoothed average (see Section 3.7 of [RFC793]) of 2753 m(R) with a time constant equal to the Hello interval multiplied by a 2754 small number such as 3). If no route to a given destination is 2755 selected, then select the route with the smallest metric, ignoring 2756 the smoothed metric. If a route R is selected, then switch to a 2757 route R' only when both m(R') < m(R) and ms(R') < ms(R). 2759 Intuitively, the smoothed metric is a long-term estimate of the 2760 quality of a route. The algorithm above works by only switching 2761 routes when both the instantaneous and the long-term estimate of the 2762 route's quality indicate that switching is profitable. 2764 Appendix B. Protocol parameters 2766 The choice of time constants is a trade-off between fast detection of 2767 mobility events and protocol overhead. Two instances of Babel 2768 running with different time constants will interoperate, although the 2769 resulting worst-case convergence time will be dictated by the slower 2770 of the two. 2772 The Hello interval is the most important time constant: an outage or 2773 a mobility event is detected within 1.5 to 3.5 Hello intervals. Due 2774 to Babel's use of a redundant route table, and due to its reliance on 2775 triggered updates and explicit requests, the Update interval has 2776 little influence on the time needed to reconverge after an outage: in 2777 practice, it only has a significant effect on the time needed to 2778 acquire new routes after a mobility event. While the protocol allows 2779 intervals as low as 10ms, such low values would cause significant 2780 amounts of protocol traffic for little practical benefit. 2782 The following values have been found to work well in a variety of 2783 environments, and are therefore RECOMMENDED default values: 2785 Multicast Hello Interval: 4 seconds. 2787 Unicast Hello Interval: infinite (no Unicast Hellos are sent). 2789 Link cost: estimated using ETX on wireless links; 2-out-of-3 with 2790 C=96 on wired links. 2792 IHU Interval: the advertised IHU interval is always 3 times the 2793 Multicast Hello interval. IHUs are actually sent with each Hello 2794 on lossy links (as determined from the Hello history), but only 2795 with every third Multicast Hello on lossless links. 2797 Update Interval: 4 times the Multicast Hello interval. 2799 IHU Hold Time: 3.5 times the advertised IHU interval. 2801 Route Expiry Time: 3.5 times the advertised update interval. 2803 Request timeout: initially 2 seconds, doubled every time a request 2804 is resent, up to a maximum of three times. 2806 Urgent timeout: 0.2 seconds. 2808 Source GC time: 3 minutes. 2810 Appendix C. Route filtering 2812 Route filtering is a procedure where an instance of a routing 2813 protocol either discards some of the routes announced by its 2814 neighbours, or learns them with a metric that is higher than what 2815 would be expected. Like all distance-vector protocols, Babel has the 2816 ability to apply arbitrary filtering to the routes it learns, and 2817 implementations of Babel that apply different sets of filtering rules 2818 will interoperate without causing routing loops. The protocol's 2819 ability to perform route filtering is a consequence of the latitude 2820 given in Section 3.5.2: Babel can use any metric that is strictly 2821 monotonic, including one that assigns an infinite metric to a 2822 selected subset of routes. (See also Section 3.8.1, where requests 2823 for nonexistent routes are treated in the same way as requests for 2824 routes with infinite metric.) 2826 It is not in general correct to learn a route with a metric smaller 2827 than the one it was announced with, or to replace a route's 2828 destination prefix with a more specific (longer) one. Doing either 2829 of these may cause persistent routing loops. 2831 Route filtering is a useful tool, since it allows fine-grained tuning 2832 of the routing decisions made by the routing protocol. Accordingly, 2833 some implementations of Babel implement a rich configuration language 2834 that allows applying filtering to sets of routes defined, for 2835 example, by incoming interface and destination prefix. 2837 In order to limit the consequences of misconfiguration, Babel 2838 implementations provide a reasonable set of default filtering rules 2839 even when they don't allow configuration of filtering by the user. 2840 At a minimum, they discard routes with a destination prefix in 2841 fe80::/64, ff00::/8, 127.0.0.1/32, 0.0.0.0/32 and 224.0.0.0/8. 2843 Appendix D. Considerations for protocol extensions 2845 Babel is an extensible protocol, and this document defines a number 2846 of mechanisms that can be used to extend the protocol in a backwards 2847 compatible manner: 2849 o increasing the version number in the packet header; 2851 o defining new TLVs; 2853 o defining new sub-TLVs (with or without the mandatory bit set); 2855 o defining new AEs; 2857 o using the packet trailer. 2859 This appendix is intended to guide designers of protocol extensions 2860 in choosing a particular encoding. 2862 The version number in the Babel header should only be increased if 2863 the new version is not backwards compatible with the original 2864 protocol. 2866 In many cases, an extension could be implemented either by defining a 2867 new TLV, or by adding a new sub-TLV to an existing TLV. For example, 2868 an extension whose purpose is to attach additional data to route 2869 updates can be implemented either by creating a new "enriched" Update 2870 TLV, by adding a non-mandatory sub-TLV to the Update TLV, or by 2871 adding a mandatory sub-TLV. 2873 The various encodings are treated differently by implementations that 2874 do not understand the extension. In the case of a new TLV or of a 2875 sub-TLV with the mandatory bit set, the whole TLV is ignored by 2876 implementations that do not implement the extension, while in the 2877 case of a non-mandatory sub-TLV, the TLV is parsed and acted upon, 2878 and only the unknown sub-TLV is silently ignored. Therefore, a non- 2879 mandatory sub-TLV should be used by extensions that extend the Update 2880 in a compatible manner (the extension data may be silently ignored), 2881 while a mandatory sub-TLV or a new TLV must be used by extensions 2882 that make incompatible extensions to the meaning of the TLV (the 2883 whole TLV must be thrown away if the extension data is not 2884 understood). 2886 Experience shows that the need for additional data tends to crop up 2887 in the most unexpected places. Hence, it is recommended that 2888 extensions that define new TLVs should make them self-terminating, 2889 and allow attaching sub-TLVs to them. 2891 Adding a new AE is essentially equivalent to adding a new TLV: Update 2892 TLVs with an unknown AE are ignored, just like unknown TLVs. 2893 However, adding a new AE is more involved than adding a new TLV, 2894 since it creates a new set of compression state. Additionally, since 2895 the Next Hop TLV creates state specific to a given address family, as 2896 opposed to a given AE, a new AE for a previously defined address 2897 family must not be used in the Next Hop TLV if backwards 2898 compatibility is required. A similar issue arises with Update TLVs 2899 with unknown AEs establishing a new router-id (due to the Router-Id 2900 flag being set). Therefore, defining new AEs must be done with care 2901 if compatibility with unextended implementations is required. 2903 The packet trailer is intended to carry cryptographic signatures that 2904 only cover the packet body; storing the cryptographic signatures in 2905 the packet trailer avoids clearing the signature before computing a 2906 hash of the packet body, and makes it possible to check a 2907 cryptographic signature before running the full, stateful TLV parser. 2908 Hence, only TLVs that don't need to be protected by cryptographic 2909 security protocols should be allowed in the packet trailer. Any such 2910 TLVs should be easy to parse, and in particular should not require 2911 stateful parsing. 2913 Appendix E. Stub Implementations 2915 Babel is a fairly economic protocol. Updates take between 12 and 40 2916 octets per destination, depending on the address family and how 2917 successful compression is; in a double-stack flat network, an average 2918 of less than 24 octets per update is typical. The route table 2919 occupies about 35 octets per IPv6 entry. To put these values into 2920 perspective, a single full-size Ethernet frame can carry some 65 2921 route updates, and a megabyte of memory can contain a 20000-entry 2922 route table and the associated source table. 2924 Babel is also a reasonably simple protocol. One complete 2925 implementation consists of less than 12 000 lines of C code, and it 2926 compiles to less than 120 kB of text on a 32-bit CISC architecture; 2927 about half of this figure is due to protocol extensions and user- 2928 interface code. 2930 Nonetheless, in some very constrained environments, such as PDAs, 2931 microwave ovens, or abacuses, it may be desirable to have subset 2932 implementations of the protocol. 2934 There are many different definitions of a stub router, but for the 2935 needs of this section a stub implementation of Babel is one that 2936 announces one or more directly attached prefixes into a Babel network 2937 but doesn't reannounce any routes that it has learnt from its 2938 neighbours, and always prefers the direct route to a directly 2939 attached prefix to a route learned over the Babel protocol, even when 2940 the prefixes are the same. It may either maintain a full routing 2941 table, or simply select a default gateway through any one of its 2942 neighbours that announces a default route. Since a stub 2943 implementation never forwards packets except from or to a directly 2944 attached link, it cannot possibly participate in a routing loop, and 2945 hence it need not evaluate the feasibility condition or maintain a 2946 source table. 2948 No matter how primitive, a stub implementation must parse sub-TLVs 2949 attached to any TLVs that it understands and check the mandatory bit. 2950 It must answer acknowledgment requests and must participate in the 2951 Hello/IHU protocol. It must also be able to reply to seqno requests 2952 for routes that it announces and, and it should be able to reply to 2953 route requests. 2955 Experience shows that an IPv6-only stub implementation of Babel can 2956 be written in less than 1000 lines of C code and compile to 13 kB of 2957 text on 32-bit CISC architecture. 2959 Appendix F. Compatibility with previous versions 2961 The protocol defined in this document is a successor to the protocol 2962 defined in [RFC6126] and [RFC7557]. While the two protocols are not 2963 entirely compatible, the new protocol has been designed so that it 2964 can be deployed in existing RFC 6126 networks without requiring a 2965 flag day. 2967 There are three optional features that make this protocol 2968 incompatible with its predecessor. First of all, RFC 6126 did not 2969 define Unicast hellos (Section 3.4.1), and an implementation of RFC 2970 6126 will mis-interpret a Unicast Hello for a Multicast one; since 2971 the sequence number space of Unicast Hellos is distinct from the 2972 sequence space of Multicast Hellos, sending a Unicast Hello to an 2973 implementation of RFC 6126 will confuse its link quality estimator. 2974 Second, RFC 6126 did not define unscheduled Hellos, and an 2975 implementation of RFC 6126 will mis-parse Hellos with an interval 2976 equal to 0. Finally, RFC 7557 did not define mandatory sub-TLVs 2977 (Section 4.4), and thus, an implementation of RFCs 6126 and 7557 will 2978 not correctly ignore a TLV that carries an unknown mandatory sub-TLV; 2979 depending on the sub-TLV, this might cause routing pathologies. 2981 An implementation of this specification that never sends Unicast or 2982 unscheduled Hellos and doesn't implement any extensions that use 2983 mandatory sub-TLVs is safe to deploy in a network in which some nodes 2984 implement the protocol described in RFCs 6126 and 7557. 2986 Two changes need to be made to an implementation of RFCs 6126 and 2987 7557 so that it can safely interoperate in all cases with 2988 implementations of this protocol. First, it needs to be modified to 2989 either ignore or process Unicast and unscheduled Hellos. Second, it 2990 needs to be modified to parse sub-TLVs of all the TLVs that it 2991 understands and that allow sub-TLVs, and to ignore the TLV if an 2992 unknown mandatory sub-TLV is found. It is not necessary to parse 2993 unknown TLVs, as these are ignored in any case. 2995 There are other changes, but these are not of a nature to prevent 2996 interoperability: 2998 o the conditions on route acquisition (Section 3.5.3) have been 2999 relaxed; 3001 o route selection should no longer use the route's sequence number 3002 (Section 3.6); 3004 o the format of the packet trailer has been defined (Section 4.2); 3006 o router-ids with a value of all-zeros or all-ones have been 3007 forbidden (Section 4.1.2); 3009 o the compression state is now specific to an address family rather 3010 than an address encoding (Section 4.5); 3012 o packet pacing is now recommended (Section 3.1). 3014 Appendix G. Changes from previous versions 3016 [RFC Editor: Please delete this section before publication.] 3018 G.1. Changes since RFC 6126 3020 o Changed UDP port number to 6696. 3022 o Consistently use router-id rather than id. 3024 o Clarified that the source garbage collection timer is reset after 3025 sending an update even if the entry was not modified. 3027 o In section "Seqno Requests", fixed an erroneous "route request". 3029 o In the description of the Seqno Request TLV, added the description 3030 of the Router-Id field. 3032 o Made router-ids all-0 and all-1 forbidden. 3034 G.2. Changes since draft-ietf-babel-rfc6126bis-00 3036 o Added security considerations. 3038 G.3. Changes since draft-ietf-babel-rfc6126bis-01 3040 o Integrated the format of sub-TLVs. 3042 o Mentioned for each TLV whether it supports sub-TLVs. 3044 o Added Appendix D. 3046 o Added a mandatory bit in sub-TLVs. 3048 o Changed compression state to be per-AF rather than per-AE. 3050 o Added implementation hint for the routing table. 3052 o Clarified how router-ids are computed when bit 0x40 is set in 3053 Updates. 3055 o Relaxed the conditions for sending requests, and tightened the 3056 conditions for forwarding requests. 3058 o Clarified that neighbours should be acquired at some point, but it 3059 doesn't matter when. 3061 G.4. Changes since draft-ietf-babel-rfc6126bis-02 3063 o Added Unicast Hellos. 3065 o Added unscheduled (interval-less) Hellos. 3067 o Changed Appendix A to consider Unicast and unscheduled Hellos. 3069 o Changed Appendix B to agree with the reference implementation. 3071 o Added optional algorithm to avoid the hold time. 3073 o Changed the table of pending seqno requests to be indexed by 3074 router-id in addition to prefixes. 3076 o Relaxed the route acquisition algorithm. 3078 o Replaced minimal implementations by stub implementations. 3080 o Added acknowledgments section. 3082 G.5. Changes since draft-ietf-babel-rfc6126bis-03 3084 o Clarified that all the data structures are conceptual. 3086 o Made sending and receiving Multicast Hellos a SHOULD, avoids 3087 expressing any opinion about Unicast Hellos. 3089 o Removed opinion about Multicast vs. Unicast Hellos (Appendix A.4). 3091 o Made hold-time into a SHOULD rather than MUST. 3093 o Clarified that Seqno Requests are for a finite-metric Update. 3095 o Clarified that sub-TLVs Pad1 and PadN are allowed within any TLV 3096 that allows sub-TLVs. 3098 o Updated IANA Considerations. 3100 o Updated Security Considerations. 3102 o Renamed routing table back to route table. 3104 o Made buffering outgoing updates a SHOULD. 3106 o Weakened advice to use modified EUI-64 in router-ids. 3108 o Added information about sending requests to Appendix B. 3110 o A number of minor wording changes and clarifications. 3112 G.6. Changes since draft-ietf-babel-rfc6126bis-03 3114 Minor editorial changes. 3116 G.7. Changes since draft-ietf-babel-rfc6126bis-04 3118 o Renamed isotonicity to left-distributivity. 3120 o Minor clarifications to unicast hellos. 3122 o Updated requirements boilerplate to RFC 8174. 3124 o Minor editorial changes. 3126 G.8. Changes since draft-ietf-babel-rfc6126bis-05 3128 o Added information about the packet trailer, now that it is used by 3129 draft-ietf-babel-hmac. 3131 G.9. Changes since draft-ietf-babel-rfc6126bis-06 3133 o Added references to security documents. 3135 G.10. Changes since draft-ietf-babel-rfc6126bis-07 3137 o Added list of obsoleted drafts to the abstract. 3139 o Updated references. 3141 G.11. Changes since draft-ietf-babel-rfc6126bis-08 3143 o Added recommendation that route selection should not take seqnos 3144 into account. 3146 G.12. Changes since draft-ietf-babel-rfc6126bis-09 3148 o Editorial changes only. 3150 G.13. Changes since draft-ietf-babel-rfc6126bis-10 3152 o Editorial changes only. 3154 G.14. Changes since draft-ietf-babel-rfc6126bis-11 3156 o Added recommendation that control traffic should be carried over 3157 IPv6 only. 3159 G.15. Changes since draft-ietf-babel-rfc6126bis-12 3161 o Removed appendix about software availability. 3163 o Expanded appendix about recommended values and added more 3164 references to it in the body of the document. 3166 o Added appendix about route filtering. 3168 o Clarified definition of mandatory bit. 3170 o Added recommendations for packet pacing. 3172 o Made time limiting of full updates a SHOULD. 3174 o Normative language in a few more places. 3176 o Removed normative language from stub implementations. 3178 o Added requirement to clear the undefined bits in an Update. 3180 o Added error checking requirements. 3182 o Reworked security considerations. 3184 o Added "in octets" and "in bits" in random places. 3186 o Inserted full IANA registries. 3188 o Editorial changes. 3190 G.16. Changes since draft-ietf-babel-rfc6126bis-13 3192 o Added a section about compatibility with 6126. 3194 o Added AE registry to IANA considerations. 3196 o Replaced Babel-HMAC with Babel-MAC, consistent with the change in 3197 draft-ietf-babel-hmac. 3199 o Removed section about external sources of willingness; filtering 3200 is a better approach. 3202 o Added recommendation to use a cost of 96 on wired links. 3204 o Editorial changes. 3206 G.17. Changes since draft-ietf-babel-rfc6126bis-14 3208 o Added unscheduled Hellos to compatibility considerations. 3210 o Created new appendix about route selection. 3212 o Reworked security considerations. 3214 o Added some comments about packet pacing and low update intervals. 3216 G.18. Changes since draft-ietf-babel-rfc6126bis-15 3218 o Implementing Babel-MAC is now recommended. 3220 G.19. Changes since draft-ietf-babel-rfc6126bis-16 3222 o Make the values in Appendix B normatively recommended defaults. 3224 G.20. Changes since draft-ietf-babel-rfc6126bis-17 3226 o Hysteresis in route selection is now RECOMMENDED. 3228 o Additive metric algebra is now RECOMMENDED default. 3230 o 2-out-of-3 cost computation is now RECOMMENDED on LANs. 3232 o Reference to RFC 793 Section 3.7 added as exponential smoothing 3233 example. 3235 Authors' Addresses 3237 Juliusz Chroboczek 3238 IRIF, University of Paris-Diderot 3239 Case 7014 3240 75205 Paris Cedex 13 3241 France 3243 Email: jch@irif.fr 3245 David Schinazi 3246 Google LLC 3247 1600 Amphitheatre Parkway 3248 Mountain View, California 94043 3249 USA 3251 Email: dschinazi.ietf@gmail.com