idnits 2.17.1 draft-ietf-babel-rfc6126bis-17.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 (February 05, 2020) is 1541 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 == 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: 0 errors (**), 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: August 8, 2020 February 05, 2020 8 The Babel Routing Protocol 9 draft-ietf-babel-rfc6126bis-17 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 August 8, 2020. 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 . . . . . . . . . . . . . . . . . . . . . 25 73 3.8. Explicit Requests . . . . . . . . . . . . . . . . . . . . 28 74 4. Protocol Encoding . . . . . . . . . . . . . . . . . . . . . . 31 75 4.1. Data Types . . . . . . . . . . . . . . . . . . . . . . . 32 76 4.2. Packet Format . . . . . . . . . . . . . . . . . . . . . . 33 77 4.3. TLV Format . . . . . . . . . . . . . . . . . . . . . . . 34 78 4.4. Sub-TLV Format . . . . . . . . . . . . . . . . . . . . . 34 79 4.5. Parser state and encoding of updates . . . . . . . . . . 35 80 4.6. Details of Specific TLVs . . . . . . . . . . . . . . . . 36 81 4.7. Details of specific sub-TLVs . . . . . . . . . . . . . . 47 82 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 48 83 6. Security Considerations . . . . . . . . . . . . . . . . . . . 51 84 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 52 85 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 53 86 8.1. Normative References . . . . . . . . . . . . . . . . . . 53 87 8.2. Informative References . . . . . . . . . . . . . . . . . 53 88 Appendix A. Cost and Metric Computation . . . . . . . . . . . . 55 89 A.1. Maintaining Hello History . . . . . . . . . . . . . . . . 55 90 A.2. Cost Computation . . . . . . . . . . . . . . . . . . . . 56 91 A.3. Metric computation . . . . . . . . . . . . . . . . . . . 58 92 A.4. Route selection . . . . . . . . . . . . . . . . . . . . . 58 93 Appendix B. Protocol parameters . . . . . . . . . . . . . . . . 59 94 Appendix C. Route filtering . . . . . . . . . . . . . . . . . . 60 95 Appendix D. Considerations for protocol extensions . . . . . . . 61 96 Appendix E. Stub Implementations . . . . . . . . . . . . . . . . 62 97 Appendix F. Compatibility with previous versions . . . . . . . . 63 98 Appendix G. Changes from previous versions . . . . . . . . . . . 64 99 G.1. Changes since RFC 6126 . . . . . . . . . . . . . . . . . 64 100 G.2. Changes since draft-ietf-babel-rfc6126bis-00 . . . . . . 65 101 G.3. Changes since draft-ietf-babel-rfc6126bis-01 . . . . . . 65 102 G.4. Changes since draft-ietf-babel-rfc6126bis-02 . . . . . . 65 103 G.5. Changes since draft-ietf-babel-rfc6126bis-03 . . . . . . 66 104 G.6. Changes since draft-ietf-babel-rfc6126bis-03 . . . . . . 66 105 G.7. Changes since draft-ietf-babel-rfc6126bis-04 . . . . . . 66 106 G.8. Changes since draft-ietf-babel-rfc6126bis-05 . . . . . . 67 107 G.9. Changes since draft-ietf-babel-rfc6126bis-06 . . . . . . 67 108 G.10. Changes since draft-ietf-babel-rfc6126bis-07 . . . . . . 67 109 G.11. Changes since draft-ietf-babel-rfc6126bis-08 . . . . . . 67 110 G.12. Changes since draft-ietf-babel-rfc6126bis-09 . . . . . . 67 111 G.13. Changes since draft-ietf-babel-rfc6126bis-10 . . . . . . 67 112 G.14. Changes since draft-ietf-babel-rfc6126bis-11 . . . . . . 67 113 G.15. Changes since draft-ietf-babel-rfc6126bis-12 . . . . . . 67 114 G.16. Changes since draft-ietf-babel-rfc6126bis-13 . . . . . . 68 115 G.17. Changes since draft-ietf-babel-rfc6126bis-14 . . . . . . 68 116 G.18. Changes since draft-ietf-babel-rfc6126bis-15 . . . . . . 68 117 G.19. Changes since draft-ietf-babel-rfc6126bis-16 . . . . . . 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 and 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 Note that while this document does not constrain cost computation any 952 further, not all cost computation strategies will give good results. 953 See Appendix A.2 for examples of strategies for computing a link's 954 cost that are known to work well in practice. 956 3.5. Routing Table Maintenance 958 Conceptually, a Babel update is a quintuple (prefix, plen, router-id, 959 seqno, metric), where (prefix, plen) is the prefix for which a route 960 is being advertised, router-id is the router-id of the router 961 originating this update, seqno is a nondecreasing (modulo 2^16) 962 integer that carries the originating router seqno, and metric is the 963 announced metric. 965 Before being accepted, an update is checked against the feasibility 966 condition (Section 3.5.1), which ensures that the route does not 967 create a routing loop. If the feasibility condition is not 968 satisfied, the update is either ignored or prevents the route from 969 being selected, as described in Section 3.5.3. If the feasibility 970 condition is satisfied, then the update cannot possibly cause a 971 routing loop. 973 3.5.1. The Feasibility Condition 975 The feasibility condition is applied to all received updates. The 976 feasibility condition compares the metric in the received update with 977 the metrics of the updates previously sent by the receiving node; 978 updates that fail the feasibility condition, and therefore have 979 metrics large enough to cause a routing loop, are either ignored or 980 prevent the resulting route from being selected. 982 A feasibility distance is a pair (seqno, metric), where seqno is an 983 integer modulo 2^16 and metric is a positive integer. Feasibility 984 distances are compared lexicographically, with the first component 985 inverted: we say that a distance (seqno, metric) is strictly better 986 than a distance (seqno', metric'), written 988 (seqno, metric) < (seqno', metric') 990 when 992 seqno > seqno' or (seqno = seqno' and metric < metric') 994 where sequence numbers are compared modulo 2^16. 996 Given a source (prefix, plen, router-id), a node's feasibility 997 distance for this source is the minimum, according to the ordering 998 defined above, of the distances of all the finite updates ever sent 999 by this particular node for the prefix (prefix, plen) and the given 1000 router-id. Feasibility distances are maintained in the source table, 1001 the exact procedure is given in Section 3.7.3. 1003 A received update is feasible when either it is a retraction (its 1004 metric is FFFF hexadecimal), or the advertised distance is strictly 1005 better, in the sense defined above, than the feasibility distance for 1006 the corresponding source. More precisely, a route advertisement 1007 carrying the quintuple (prefix, plen, router-id, seqno, metric) is 1008 feasible if one of the following conditions holds: 1010 o metric is infinite; or 1012 o no entry exists in the source table indexed by (prefix, plen, 1013 router-id); or 1015 o an entry (prefix, plen, router-id, seqno', metric') exists in the 1016 source table, and either 1018 * seqno' < seqno or 1020 * seqno = seqno' and metric < metric'. 1022 Note that the feasibility condition considers the metric advertised 1023 by the neighbour, not the route's metric; hence, a fluctuation in a 1024 neighbour's cost cannot render a selected route unfeasible. Note 1025 further that retractions (updates with infinite metric) are always 1026 feasible, since they cannot possibly cause a routing loop. 1028 3.5.2. Metric Computation 1030 A route's metric is computed from the metric advertised by the 1031 neighbour and the neighbour's link cost. Just like cost computation, 1032 metric computation is considered a local policy matter; as far as 1033 Babel is concerned, the function M(c, m) used for computing a metric 1034 from a locally computed link cost c and the metric m advertised by a 1035 neighbour MUST only satisfy the following conditions: 1037 o if c is infinite, then M(c, m) is infinite; 1039 o M is strictly monotonic: M(c, m) > m. 1041 Additionally, the metric SHOULD satisfy the following condition: 1043 o M is left-distributive: if m <= m', then M(c, m) <= M(c, m'). 1045 Note that while strict monotonicity is essential to the integrity of 1046 the network (persistent routing loops may arise if it is not 1047 satisfied), left distributivity is not: if it is not satisfied, Babel 1048 will still converge to a loop-free configuration, but might not reach 1049 a global optimum (in fact, a global optimum may not even exist). 1051 As with cost computation, not all strategies for computing route 1052 metrics will give good results. In particular, some metrics are more 1053 likely than others to lead to routing instabilities (route flapping). 1054 In Appendix A.3, we give an number of examples of strictly monotonic, 1055 left-distributive routing metrics that are known to work well in 1056 practice. See also Appendix C, which describes a useful way to make 1057 the metric computation configurable by a network administrator. 1059 3.5.3. Route Acquisition 1061 When a Babel node receives an update (prefix, plen, router-id, seqno, 1062 metric) from a neighbour neigh, it checks whether it already has a 1063 route table entry indexed by (prefix, plen, neigh). 1065 If no such entry exists: 1067 o if the update is unfeasible, it MAY be ignored; 1069 o if the metric is infinite (the update is a retraction of a route 1070 we do not know about), the update is ignored; 1072 o otherwise, a new entry is created in the route table, indexed by 1073 (prefix, plen, neigh), with source equal to (prefix, plen, router- 1074 id), seqno equal to seqno and an advertised metric equal to the 1075 metric carried by the update. 1077 If such an entry exists: 1079 o if the entry is currently selected, the update is unfeasible, and 1080 the router-id of the update is equal to the router-id of the 1081 entry, then the update MAY be ignored; 1083 o otherwise, the entry's sequence number, advertised metric, metric, 1084 and router-id are updated and, if the advertised metric is not 1085 infinite, the route's expiry timer is reset to a small multiple of 1086 the Interval value included in the update (see "Route Hold time" 1087 in Appendix B for suggested values). If the update is unfeasible, 1088 then the (now unfeasible) entry MUST be immediately unselected. 1089 If the update caused the router-id of the entry to change, an 1090 update (possibly a retraction) MUST be sent in a timely manner as 1091 described in Section 3.7.2. 1093 Note that the route table may contain unfeasible routes, either 1094 because they were created by an unfeasible update or due to a metric 1095 fluctuation. Such routes are never selected, since they are not 1096 known to be loop-free; should all the feasible routes become 1097 unusable, however, the unfeasible routes can be made feasible and 1098 therefore possible to select by sending requests along them (see 1099 Section 3.8.2). 1101 When a route's expiry timer triggers, the behaviour depends on 1102 whether the route's metric is finite. If the metric is finite, it is 1103 set to infinity and the expiry timer is reset. If the metric is 1104 already infinite, the route is flushed from the route table. 1106 After the route table is updated, the route selection procedure 1107 (Section 3.6) is run. 1109 3.5.4. Hold Time 1111 When a prefix P is retracted, because all routes are unfeasible or 1112 have an infinite metric (whether due to the expiry timer or to other 1113 reasons), and a shorter prefix P' that covers P is reachable, P' 1114 cannot in general be used for routing packets destined to P without 1115 running the risk of creating a routing loop (Section 2.8). 1117 To avoid this issue, whenever a prefix P is retracted, a route table 1118 entry with infinite metric is maintained as described in 1119 Section 3.5.3 above. As long as this entry is maintained, packets 1120 destined to an address within P MUST NOT be forwarded by following a 1121 route for a shorter prefix. This entry is removed as soon as a 1122 finite-metric update for prefix P is received and the resulting route 1123 selected. If no such update is forthcoming, the infinite metric 1124 entry SHOULD be maintained at least until it is guaranteed that no 1125 neighbour has selected the current node as next-hop for prefix P. 1126 This can be achieved by either: 1128 o waiting until the route's expiry timer has expired 1129 (Section 3.5.3); 1131 o sending a retraction with an acknowledgment request (Section 3.3) 1132 to every reachable neighbour that has not explicitly retracted 1133 prefix P, and waiting for all acknowledgments. 1135 The former option is simpler and ensures that at that point, any 1136 routes for prefix P pointing at the current node have expired. 1137 However, since the expiry time can be as high as a few minutes, doing 1138 that prevents automatic aggregation by creating spurious black-holes 1139 for aggregated routes. The latter option is RECOMMENDED as it 1140 dramatically reduces the time for which a prefix is unreachable in 1141 the presence of aggregated routes. 1143 3.6. Route Selection 1145 Route selection is the process by which a single route for a given 1146 prefix is selected to be used for forwarding packets and to be re- 1147 advertised to a node's neighbours. 1149 Babel is designed to allow flexible route selection policies. As far 1150 as the algorithm's correctness is concerned, the route selection 1151 policy MUST only satisfy the following properties: 1153 o a route with infinite metric (a retracted route) is never 1154 selected; 1156 o an unfeasible route is never selected. 1158 Route selection MUST NOT take seqnos into account: a route MUST NOT 1159 be preferred just because it carries a higher (more recent) seqno. 1160 Doing otherwise would cause route oscillation while a new seqno 1161 propagates across the network, and might create persistent blackholes 1162 if the metric being used is not left-distributive (Section 3.5.2). 1164 The obvious route selection strategy is to choose for each 1165 destination the feasible route with lowest metric. However, with 1166 continuously varying costs and metrics this simple strategy will in 1167 some cases lead to route oscillations. See Appendix A.4 for a 1168 discussion of the issues and suggested strategies for dealing with 1169 them. 1171 After the route selection procedure is run, triggered updates 1172 (Section 3.7.2) and requests (Section 3.8.2) are sent. 1174 3.7. Sending Updates 1176 A Babel speaker advertises to its neighbours its set of selected 1177 routes. Normally, this is done by sending one or more multicast 1178 packets containing Update TLVs on all of its connected interfaces; 1179 however, on link technologies where multicast is significantly more 1180 expensive than unicast, a node MAY choose to send multiple copies of 1181 updates in unicast packets, especially when the number of neighbours 1182 is small. 1184 Additionally, in order to ensure that any black-holes are reliably 1185 cleared in a timely manner, a Babel node may send retractions 1186 (updates with an infinite metric) for any recently retracted 1187 prefixes. 1189 If an update is for a route injected into the Babel domain by the 1190 local node (e.g., it carries the address of a local interface, the 1191 prefix of a directly attached network, or a prefix redistributed from 1192 a different routing protocol), the router-id is set to the local 1193 node's router-id, the metric is set to some arbitrary finite value 1194 (typically 0), and the seqno is set to the local router's sequence 1195 number. 1197 If an update is for a route learned from another Babel speaker, the 1198 router-id and sequence number are copied from the route table entry, 1199 and the metric is computed as specified in Section 3.5.2. 1201 3.7.1. Periodic Updates 1203 Every Babel speaker MUST advertise each of its selected routes on 1204 every interface, at least once every Update interval. Since Babel 1205 doesn't suffer from routing loops (there is no "counting to 1206 infinity") and relies heavily on triggered updates (Section 3.7.2), 1207 this full dump only needs to happen infrequently (see Appendix B for 1208 suggested intervals). 1210 3.7.2. Triggered Updates 1212 In addition to periodic routing updates, a Babel speaker sends 1213 unscheduled, or triggered, updates in order to inform its neighbours 1214 of a significant change in the network topology. 1216 A change of router-id for the selected route to a given prefix may be 1217 indicative of a routing loop in formation; hence, whenever it changes 1218 the selected router-id for a given destination, a node MUST send an 1219 update as an urgent TLV (as defined in Section 3.1). Additionally, 1220 it SHOULD make a reasonable attempt at ensuring that all reachable 1221 neighbours receive this update. 1223 There are two strategies for ensuring that. If the number of 1224 neighbours is small, then it is reasonable to send the update 1225 together with an acknowledgment request; the update is resent until 1226 all neighbours have acknowledged the packet, up to some number of 1227 times. If the number of neighbours is large, however, requesting 1228 acknowledgments from all of them might cause a non-negligible amount 1229 of network traffic; in that case, it may be preferable to simply 1230 repeat the update some reasonable number of times (say, 3 for 1231 wireless and 2 for wired links). The number of copies MUST NOT 1232 exceed 5, and the copies SHOULD be separated by a small delay, as 1233 described in Section 3.1. 1235 A route retraction is somewhat less worrying: if the route retraction 1236 doesn't reach all neighbours, a black-hole might be created, which, 1237 unlike a routing loop, does not endanger the integrity of the 1238 network. When a route is retracted, a node SHOULD send a triggered 1239 update and SHOULD make a reasonable attempt at ensuring that all 1240 neighbours receive this retraction. 1242 Finally, a node MAY send a triggered update when the metric for a 1243 given prefix changes in a significant manner, due to a received 1244 update, because a link's cost has changed, or because a different 1245 next hop has been selected. A node SHOULD NOT send triggered updates 1246 for other reasons, such as when there is a minor fluctuation in a 1247 route's metric, when the selected next hop changes, or to propagate a 1248 new sequence number (except to satisfy a request, as specified in 1249 Section 3.8). 1251 3.7.3. Maintaining Feasibility Distances 1253 Before sending an update (prefix, plen, router-id, seqno, metric) 1254 with finite metric (i.e., not a route retraction), a Babel node 1255 updates the feasibility distance maintained in the source table. 1256 This is done as follows. 1258 If no entry indexed by (prefix, plen, router-id) exists in the source 1259 table, then one is created with value (prefix, plen, router-id, 1260 seqno, metric). 1262 If an entry (prefix, plen, router-id, seqno', metric') exists, then 1263 it is updated as follows: 1265 o if seqno > seqno', then seqno' := seqno, metric' := metric; 1267 o if seqno = seqno' and metric' > metric, then metric' := metric; 1269 o otherwise, nothing needs to be done. 1271 The garbage-collection timer for the entry is then reset. Note that 1272 the feasibility distance is not updated and the garbage-collection 1273 timer is not reset when a retraction (an update with infinite metric) 1274 is sent. 1276 When the garbage-collection timer expires, the entry is removed from 1277 the source table. 1279 3.7.4. Split Horizon 1281 When running over a transitive, symmetric link technology, e.g., a 1282 point-to-point link or a wired LAN technology such as Ethernet, a 1283 Babel node SHOULD use an optimisation known as split horizon. When 1284 split horizon is used on a given interface, a routing update for 1285 prefix P is not sent on the particular interface over which the 1286 selected route towards prefix P was learnt. 1288 Split horizon SHOULD NOT be applied to an interface unless the 1289 interface is known to be symmetric and transitive; in particular, 1290 split horizon is not applicable to decentralised wireless link 1291 technologies (e.g., IEEE 802.11 in ad hoc mode) when routing updates 1292 are sent over multicast. 1294 3.8. Explicit Requests 1296 In normal operation, a node's route table is populated by the regular 1297 and triggered updates sent by its neighbours. Under some 1298 circumstances, however, a node sends explicit requests in order to 1299 cause a resynchronisation with the source after a mobility event or 1300 to prevent a route from spuriously expiring. 1302 The Babel protocol provides two kinds of explicit requests: route 1303 requests, which simply request an update for a given prefix, and 1304 seqno requests, which request an update for a given prefix with a 1305 specific sequence number. The former are never forwarded; the latter 1306 are forwarded if they cannot be satisfied by the receiver. 1308 3.8.1. Handling Requests 1310 Upon receiving a request, a node either forwards the request or sends 1311 an update in reply to the request, as described in the following 1312 sections. If this causes an update to be sent, the update is either 1313 sent to a multicast address on the interface on which the request was 1314 received, or to the unicast address of the neighbour that sent the 1315 request. 1317 The exact behaviour is different for route requests and seqno 1318 requests. 1320 3.8.1.1. Route Requests 1322 When a node receives a route request for a given prefix, it checks 1323 its route table for a selected route to this exact prefix. If such a 1324 route exists, it MUST send an update (over unicast or over 1325 multicast); if such a route does not exist, it MUST send a retraction 1326 for that prefix. 1328 When a node receives a wildcard route request, it SHOULD send a full 1329 route table dump. Full route dumps SHOULD be rate-limited, 1330 especially if they are sent over multicast. 1332 3.8.1.2. Seqno Requests 1334 When a node receives a seqno request for a given router-id and 1335 sequence number, it checks whether its route table contains a 1336 selected entry for that prefix. If a selected route for the given 1337 prefix exists, it has finite metric, and either the router-ids are 1338 different or the router-ids are equal and the entry's sequence number 1339 is no smaller (modulo 2^16) than the requested sequence number, the 1340 node MUST send an update for the given prefix. If the router-ids 1341 match but the requested seqno is larger (modulo 2^16) than the route 1342 entry's, the node compares the router-id against its own router-id. 1343 If the router-id is its own, then it increases its sequence number by 1344 1 (modulo 2^16) and sends an update. A node MUST NOT increase its 1345 sequence number by more than 1 in reaction to a single seqno request. 1347 Otherwise, if the requested router-id is not its own, the received 1348 node consults the hop count field of the request. If the hop count 1349 is 2 or more, and the node is advertising the prefix to its 1350 neighbours, the node selects a neighbour to forward the request to as 1351 follows: 1353 o if the node has one or more feasible routes toward the requested 1354 prefix with a next hop that is not the requesting node, then the 1355 node MUST forward the request to the next hop of one such route; 1357 o otherwise, if the node has one or more (not feasible) routes to 1358 the requested prefix with a next hop that is not the requesting 1359 node, then the node SHOULD forward the request to the next hop of 1360 one such route. 1362 In order to actually forward the request, the node decrements the hop 1363 count and sends the request in a unicast packet destined to the 1364 selected neighbour. The forwarded request SHOULD be sent as an 1365 urgent TLV (as defined in Section 3.1). 1367 A node SHOULD maintain a list of recently forwarded seqno requests 1368 and forward the reply (an update with a seqno sufficiently large to 1369 satisfy the request) as an urgent TLV (as defined in Section 3.1). A 1370 node SHOULD compare every incoming seqno request against its list of 1371 recently forwarded seqno requests and avoid forwarding it if it is 1372 redundant (i.e., if it has recently sent a request with the same 1373 prefix, router-id and a seqno that is not smaller modulo 2^16). 1375 Since the request-forwarding mechanism does not necessarily obey the 1376 feasibility condition, it may get caught in routing loops; hence, 1377 requests carry a hop count to limit the time during which they remain 1378 in the network. However, since requests are only ever forwarded as 1379 unicast packets, the initial hop count need not be kept particularly 1380 low, and performing an expanding horizon search is not necessary. A 1381 single request MUST NOT be duplicated: it MUST NOT be forwarded to a 1382 multicast address, and it MUST NOT be forwarded to multiple 1383 neighbours. However, if a seqno request is resent by its originator, 1384 the subsequent copies may be forwarded to a different neighbour than 1385 the initial one. 1387 3.8.2. Sending Requests 1389 A Babel node MAY send a route or seqno request at any time, to a 1390 multicast or a unicast address; there is only one case when 1391 originating requests is required (Section 3.8.2.1). 1393 3.8.2.1. Avoiding Starvation 1395 When a route is retracted or expires, a Babel node usually switches 1396 to another feasible route for the same prefix. It may be the case, 1397 however, that no such routes are available. 1399 A node that has lost all feasible routes to a given destination but 1400 still has unexpired unfeasible routes to that destination MUST send a 1401 seqno request; if it doesn't have any such routes, it MAY still send 1402 a seqno request. The router-id of the request is set to the router- 1403 id of the route that it has just lost, and the requested seqno is the 1404 value contained in the source table plus 1. The request carries a 1405 hop count, which is used as a last-resort mechanism to ensure that it 1406 eventually vanishes from the network; it MAY be set to any value that 1407 is larger than the diameter of the network (64 is a suitable default 1408 value). 1410 If the node has any (unfeasible) routes to the requested destination, 1411 then it MUST send the request to at least one of the next-hop 1412 neighbours that advertised these routes, and SHOULD send it to all of 1413 them; in any case, it MAY send the request to any other neighbours, 1414 whether they advertise a route to the requested destination or not. 1415 A simple implementation strategy is therefore to unconditionally 1416 multicast the request over all interfaces. 1418 Similar requests will be sent by other nodes that are affected by the 1419 route's loss. If the network is still connected, and assuming no 1420 packet loss, then at least one of these requests will be forwarded to 1421 the source, resulting in a route being advertised with a new sequence 1422 number. (Due to duplicate suppression, only a small number of such 1423 requests are expected to actually reach the source.) 1425 In order to compensate for packet loss, a node SHOULD repeat such a 1426 request a small number of times if no route becomes feasible within a 1427 short time (see "Request Timeout" in Appendix B for suggested 1428 values). In the presence of heavy packet loss, however, all such 1429 requests might be lost; in that case, the mechanism in the next 1430 section will eventually ensure that a new seqno is received. 1432 3.8.2.2. Dealing with Unfeasible Updates 1434 When a route's metric increases, a node might receive an unfeasible 1435 update for a route that it has currently selected. As specified in 1436 Section 3.5.1, the receiving node will either ignore the update or 1437 unselect the route. 1439 In order to keep routes from spuriously expiring because they have 1440 become unfeasible, a node SHOULD send a unicast seqno request when it 1441 receives an unfeasible update for a route that is currently selected. 1442 The requested sequence number is computed from the source table as in 1443 Section 3.8.2.1 above. 1445 Additionally, since metric computation does not necessarily coincide 1446 with the delay in propagating updates, a node might receive an 1447 unfeasible update from a currently unselected neighbour that is 1448 preferable to the currently selected route (e.g., because it has a 1449 much smaller metric); in that case, the node SHOULD send a unicast 1450 seqno request to the neighbour that advertised the preferable update. 1452 3.8.2.3. Preventing Routes from Expiring 1454 In normal operation, a route's expiry timer never triggers: since a 1455 route's hold time is computed from an explicit interval included in 1456 Update TLVs, a new update (possibly a retraction) should arrive in 1457 time to prevent a route from expiring. 1459 In the presence of packet loss, however, it may be the case that no 1460 update is successfully received for an extended period of time, 1461 causing a route to expire. In order to avoid such spurious expiry, 1462 shortly before a selected route expires, a Babel node SHOULD send a 1463 unicast route request to the neighbour that advertised this route; 1464 since nodes always send either updates or retractions in response to 1465 non-wildcard route requests (Section 3.8.1.1), this will usually 1466 result in the route being either refreshed or retracted. 1468 4. Protocol Encoding 1470 A Babel packet MUST be sent as the body of a UDP datagram, with 1471 network-layer hop count set to 1, destined to a well-known multicast 1472 address or to a unicast address, over IPv4 or IPv6; in the case of 1473 IPv6, these addresses are link-local. Both the source and 1474 destination UDP port are set to a well-known port number. A Babel 1475 packet MUST be silently ignored unless its source address is either a 1476 link-local IPv6 address or an IPv4 address belonging to the local 1477 network, and its source port is the well-known Babel port. It MAY be 1478 silently ignored if its destination address is a global IPv6 address. 1480 In order to minimise the number of packets being sent while avoiding 1481 lower-layer fragmentation, a Babel node SHOULD maximise the size of 1482 the packets it sends, up to the outgoing interface's MTU adjusted for 1483 lower-layer headers (28 octets for UDP over IPv4, 48 octets for UDP 1484 over IPv6). It MUST NOT send packets larger than the attached 1485 interface's MTU adjusted for lower-layer headers or 512 octets, 1486 whichever is larger, but not exceeding 2^16 - 1 adjusted for lower- 1487 layer headers. Every Babel speaker MUST be able to receive packets 1488 that are as large as any attached interface's MTU adjusted for lower- 1489 layer headers or 512 octets, whichever is larger. Babel packets MUST 1490 NOT be sent in IPv6 Jumbograms. 1492 4.1. Data Types 1494 4.1.1. Interval 1496 Relative times are carried as 16-bit values specifying a number of 1497 centiseconds (hundredths of a second). This allows times up to 1498 roughly 11 minutes with a granularity of 10ms, which should cover all 1499 reasonable applications of Babel. 1501 4.1.2. Router-Id 1503 A router-id is an arbitrary 8-octet value. A router-id MUST NOT 1504 consist of either all binary zeroes (0000000000000000 hexadecimal) or 1505 all binary ones (FFFFFFFFFFFFFFFF hexadecimal). 1507 4.1.3. Address 1509 Since the bulk of the protocol is taken by addresses, multiple ways 1510 of encoding addresses are defined. Additionally, within Update TLVs 1511 a common subnet prefix may be omitted when multiple addresses are 1512 sent in a single packet -- this is known as address compression 1513 (Section 4.6.9). 1515 Address encodings: 1517 o AE 0: wildcard address. The value is 0 octets long. 1519 o AE 1: IPv4 address. Compression is allowed. 4 octets or less. 1521 o AE 2: IPv6 address. Compression is allowed. 16 octets or less. 1523 o AE 3: link-local IPv6 address. Compression is not allowed. The 1524 value is 8 octets long, a prefix of fe80::/64 is implied. 1526 The address family associated to an address encoding is either IPv4 1527 or IPv6; it is undefined for AE 0, IPv4 for AE 1, and IPv6 for AEs 2 1528 and 3. 1530 4.1.4. Prefixes 1532 A network prefix is encoded just like a network address, but it is 1533 stored in the smallest number of octets that are enough to hold the 1534 significant bits (up to the prefix length). 1536 4.2. Packet Format 1538 A Babel packet consists of a 4-octet header, followed by a sequence 1539 of TLVs (the packet body), optionally followed by a second sequence 1540 of TLVs (the packet trailer). The format is designed to be 1541 extensible; see Appendix D for extensibility considerations. 1543 0 1 2 3 1544 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 1545 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1546 | Magic | Version | Body length | 1547 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1548 | Packet Body ... 1549 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1550 | Packet Trailer... 1551 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1553 Fields : 1555 Magic The arbitrary but carefully chosen value 42 (decimal); 1556 packets with a first octet different from 42 MUST be 1557 silently ignored. 1559 Version This document specifies version 2 of the Babel protocol. 1560 Packets with a second octet different from 2 MUST be 1561 silently ignored. 1563 Body length The length in octets of the body following the packet 1564 header (excluding the Magic, Version and Body length 1565 fields, and excluding the packet trailer). 1567 Packet Body The packet body; a sequence of TLVs. 1569 Packet Trailer The packet trailer; another sequence of TLVs. 1571 The packet body and trailer are both sequences of TLVs. The packet 1572 body is the normal place to store TLVs; the packet trailer only 1573 contains specialised TLVs that do not need to be protected by 1574 cryptographic security mechanisms. When parsing the trailer, the 1575 receiver MUST ignore any TLV unless its definition explicitly states 1576 that it is allowed to appear there. Among the TLVs defined in this 1577 document, only Pad1 and PadN are allowed in the trailer; since these 1578 TLVs are ignored in any case, an implementation MAY silently ignore 1579 the packet trailer without even parsing it, unless it implements at 1580 least one protocol extension that defines TLVs that are allowed to 1581 appear in the trailer. 1583 4.3. TLV Format 1585 With the exception of Pad1, all TLVs have the following structure: 1587 0 1 2 3 1588 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 1589 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1590 | Type | Length | Payload... 1591 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1593 Fields : 1595 Type The type of the TLV. 1597 Length The length of the body in octets, exclusive of the Type and 1598 Length fields. 1600 Payload The TLV payload, which consists of a body and, for selected 1601 TLV types, an optional list of sub-TLVs. 1603 TLVs with an unknown type value MUST be silently ignored. 1605 4.4. Sub-TLV Format 1607 Every TLV carries an explicit length in its header; however, most 1608 TLVs are self-terminating, in the sense that it is possible to 1609 determine the length of the body without reference to the explicit 1610 Length field. If a TLV has a self-terminating format, then the space 1611 between the natural size of the TLV and the size announced in the 1612 Length field may be used to store a sequence of sub-TLVs. 1614 Sub-TLVs have the same structure as TLVs. With the exception of 1615 Pad1, all TLVs have the following structure: 1617 0 1 2 3 1618 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 1619 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1620 | Type | Length | Body... 1621 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1623 Fields : 1625 Type The type of the sub-TLV. 1627 Length The length of the body in octets, exclusive of the Type and 1628 Length fields. 1630 Body The sub-TLV body, the interpretation of which depends on 1631 both the type of the sub-TLV and the type of the TLV within 1632 which it is embedded. 1634 The most-significant bit of the sub-TLV type (the bit with value 80 1635 hexadecimal), is called the mandatory bit; in other words, sub-TLV 1636 types 128 through 255 have the mandatory bit set. This bit indicates 1637 how to handle unknown sub-TLVs. If the mandatory bit is not set, 1638 then an unknown sub-TLV MUST be silently ignored, and the rest of the 1639 TLV is processed normally. If the mandatory bit is set, then the 1640 whole enclosing TLV MUST be silently ignored (except for updating the 1641 parser state by a Router-Id, Next-Hop or Update TLV, as described in 1642 the next section). 1644 4.5. Parser state and encoding of updates 1646 In a large network, the bulk of Babel traffic consists of route 1647 updates; hence, some care has been given to encoding them 1648 efficiently. The data conceptually contained in an update 1649 (Section 3.5) is split into three pieces: 1651 o the prefix, seqno and metric are contained in the Update TLV 1652 itself (Section 4.6.9); 1654 o the router-id is taken from Router-Id TLV that precedes the Update 1655 TLV, and may be shared among multiple Update TLVs (Section 4.6.7); 1657 o the next hop is taken either from the source-address of the 1658 network-layer packet that contains the Babel packet, or from an 1659 explicit Next-Hop TLV (Section 4.6.8). 1661 In addition to the above, an Update TLV can omit a prefix of the 1662 prefix being announced, which is then extracted from the preceding 1663 Update TLV in the same address family (IPv4 or IPv6). Finally, as a 1664 special optimisation for the case when a router-id coincides with the 1665 interface-id part of an IPv6 address, Router-ID TLV itself may be 1666 omitted and the router-id derived derived from the low-order bits of 1667 the advertised prefix (Section 4.6.9). 1669 In order to implement these compression techniques, Babel uses a 1670 stateful parser: a TLV may refer to data from a previous TLV. The 1671 parser state consists of the following pieces of data: 1673 o for each address encoding that allows compression, the current 1674 default prefix; this is undefined at the start of the packet, and 1675 is updated by each Update TLV with the Prefix flag set 1676 (Section 4.6.9); 1678 o for each address family (IPv4 or IPv6), the current next-hop; this 1679 is the source address of the enclosing packet for the matching 1680 address family at the start of a packet, and is updated by each 1681 Next-Hop TLV (Section 4.6.8); 1683 o the current router-id; this is undefined at the start of the 1684 packet, and is updated by each Router-ID TLV (Section 4.6.7) and 1685 by each Update TLV with Router-Id flag set. 1687 Since the parser state must be identical across implementations, it 1688 is updated before checking for mandatory sub-TLVs: parsing a TLV MUST 1689 update the parser state even if the TLV is otherwise ignored due to 1690 an unknown mandatory sub-TLV or for any other reason. 1692 None of the TLVs that modify the parser state are allowed in the 1693 packet trailer; hence, an implementation may choose to use a 1694 dedicated stateless parser to parse the packet trailer. 1696 4.6. Details of Specific TLVs 1698 4.6.1. Pad1 1700 0 1701 0 1 2 3 4 5 6 7 1702 +-+-+-+-+-+-+-+-+ 1703 | Type = 0 | 1704 +-+-+-+-+-+-+-+-+ 1706 Fields : 1708 Type Set to 0 to indicate a Pad1 TLV. 1710 This TLV is silently ignored on reception. It is allowed in the 1711 packet trailer. 1713 4.6.2. PadN 1715 0 1 2 3 1716 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 1717 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1718 | Type = 1 | Length | MBZ... 1719 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1721 Fields : 1723 Type Set to 1 to indicate a PadN TLV. 1725 Length The length of the body in octets, exclusive of the Type and 1726 Length fields. 1728 MBZ Must be zero, set to 0 on transmission. 1730 This TLV is silently ignored on reception. It is allowed in the 1731 packet trailer. 1733 4.6.3. Acknowledgment Request 1735 0 1 2 3 1736 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 1737 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1738 | Type = 2 | Length | Reserved | 1739 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1740 | Opaque | Interval | 1741 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1743 This TLV requests that the receiver send an Acknowledgment TLV within 1744 the number of centiseconds specified by the Interval field. 1746 Fields : 1748 Type Set to 2 to indicate an Acknowledgment Request TLV. 1750 Length The length of the body in octets, exclusive of the Type and 1751 Length fields. 1753 Reserved Sent as 0 and MUST be ignored on reception. 1755 Opaque An arbitrary value that will be echoed in the receiver's 1756 Acknowledgment TLV. 1758 Interval A time interval in centiseconds after which the sender will 1759 assume that this packet has been lost. This MUST NOT be 0. 1760 The receiver MUST send an Acknowledgment TLV before this 1761 time has elapsed (with a margin allowing for propagation 1762 time). 1764 This TLV is self-terminating, and allows sub-TLVs. 1766 4.6.4. Acknowledgment 1768 0 1 2 3 1769 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 1770 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1771 | Type = 3 | Length | Opaque | 1772 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1774 This TLV is sent by a node upon receiving an Acknowledgment Request. 1776 Fields : 1778 Type Set to 3 to indicate an Acknowledgment TLV. 1780 Length The length of the body in octets, exclusive of the Type and 1781 Length fields. 1783 Opaque Set to the Opaque value of the Acknowledgment Request that 1784 prompted this Acknowledgment. 1786 Since Opaque values are not globally unique, this TLV MUST be sent to 1787 a unicast address. 1789 This TLV is self-terminating, and allows sub-TLVs. 1791 4.6.5. Hello 1793 0 1 2 3 1794 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 1795 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1796 | Type = 4 | Length | Flags | 1797 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1798 | Seqno | Interval | 1799 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1801 This TLV is used for neighbour discovery and for determining a 1802 neighbour's reception cost. 1804 Fields : 1806 Type Set to 4 to indicate a Hello TLV. 1808 Length The length of the body in octets, exclusive of the Type and 1809 Length fields. 1811 Flags The individual bits of this field specify special handling 1812 of this TLV (see below). 1814 Seqno If the Unicast flag is set, this is the value of the 1815 sending node's outgoing Unicast Hello seqno for this 1816 neighbour. Otherwise, it is the sending node's outgoing 1817 Multicast Hello seqno for this interface. 1819 Interval If non-zero, this is an upper bound, expressed in 1820 centiseconds, on the time after which the sending node will 1821 send a new scheduled Hello TLV with the same setting of the 1822 Unicast flag. If this is 0, then this Hello represents an 1823 unscheduled Hello, and doesn't carry any new information 1824 about times at which Hellos are sent. 1826 The Flags field is interpreted as follows: 1828 0 1 1829 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1830 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1831 |U|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 1832 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1834 o U (Unicast) flag (8000 hexadecimal): if set, then this Hello 1835 represents a Unicast Hello, otherwise it represents a Multicast 1836 Hello; 1838 o X: all other bits MUST be sent as 0 and silently ignored on 1839 reception. 1841 Every time a Hello is sent, the corresponding seqno counter MUST be 1842 incremented. Since there is a single seqno counter for all the 1843 Multicast Hellos sent by a given node over a given interface, if the 1844 Unicast flag is not set, this TLV MUST be sent to all neighbors on 1845 this link, which can be achieved by sending to a multicast 1846 destination, or by sending multiple packets to the unicast addresses 1847 of all reachable neighbours. Conversely, if the Unicast flag is set, 1848 this TLV MUST be sent to a single neighbour, which can achieved by 1849 sending to a unicast destination. In order to avoid large 1850 discontinuities in link quality, multiple Hello TLVs SHOULD NOT be 1851 sent in the same packet. 1853 This TLV is self-terminating, and allows sub-TLVs. 1855 4.6.6. IHU 1857 0 1 2 3 1858 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 1859 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1860 | Type = 5 | Length | AE | Reserved | 1861 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1862 | Rxcost | Interval | 1863 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1864 | Address... 1865 +-+-+-+-+-+-+-+-+-+-+-+- 1867 An IHU ("I Heard You") TLV is used for confirming bidirectional 1868 reachability and carrying a link's transmission cost. 1870 Fields : 1872 Type Set to 5 to indicate an IHU TLV. 1874 Length The length of the body in octets, exclusive of the Type and 1875 Length fields. 1877 AE The encoding of the Address field. This should be 1 or 3 1878 in most cases. As an optimisation, it MAY be 0 if the TLV 1879 is sent to a unicast address, if the association is over a 1880 point-to-point link, or when bidirectional reachability is 1881 ascertained by means outside of the Babel protocol. 1883 Reserved Sent as 0 and MUST be ignored on reception. 1885 Rxcost The rxcost according to the sending node of the interface 1886 whose address is specified in the Address field. The value 1887 FFFF hexadecimal (infinity) indicates that this interface 1888 is unreachable. 1890 Interval An upper bound, expressed in centiseconds, on the time 1891 after which the sending node will send a new IHU; this MUST 1892 NOT be 0. The receiving node will use this value in order 1893 to compute a hold time for this symmetric association. 1895 Address The address of the destination node, in the format 1896 specified by the AE field. Address compression is not 1897 allowed. 1899 Conceptually, an IHU is destined to a single neighbour. However, IHU 1900 TLVs contain an explicit destination address, and MAY be sent to a 1901 multicast address, as this allows aggregation of IHUs destined to 1902 distinct neighbours into a single packet and avoids the need for an 1903 ARP or Neighbour Discovery exchange when a neighbour is not being 1904 used for data traffic. 1906 IHU TLVs with an unknown value in the AE field MUST be silently 1907 ignored. 1909 This TLV is self-terminating, and allows sub-TLVs. 1911 4.6.7. Router-Id 1913 0 1 2 3 1914 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 1915 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1916 | Type = 6 | Length | Reserved | 1917 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1918 | | 1919 + Router-Id + 1920 | | 1921 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1923 A Router-Id TLV establishes a router-id that is implied by subsequent 1924 Update TLVs, as described in Section 4.5. This TLV sets the router- 1925 id even if it is otherwise ignored due to an unknown mandatory sub- 1926 TLV. 1928 Fields : 1930 Type Set to 6 to indicate a Router-Id TLV. 1932 Length The length of the body in octets, exclusive of the Type and 1933 Length fields. 1935 Reserved Sent as 0 and MUST be ignored on reception. 1937 Router-Id The router-id for routes advertised in subsequent Update 1938 TLVs. This MUST NOT consist of all zeroes or all ones. 1940 This TLV is self-terminating, and allows sub-TLVs. 1942 4.6.8. Next Hop 1944 0 1 2 3 1945 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 1946 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1947 | Type = 7 | Length | AE | Reserved | 1948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1949 | Next hop... 1950 +-+-+-+-+-+-+-+-+-+-+-+- 1951 A Next Hop TLV establishes a next-hop address for a given address 1952 family (IPv4 or IPv6) that is implied in subsequent Update TLVs, as 1953 described in Section 4.5. This TLV sets up the next-hop for 1954 subsequent Update TLVs even if it is otherwise ignored due to an 1955 unknown mandatory sub-TLV. 1957 Fields : 1959 Type Set to 7 to indicate a Next Hop TLV. 1961 Length The length of the body in octets, exclusive of the Type and 1962 Length fields. 1964 AE The encoding of the Address field. This SHOULD be 1 (IPv4) 1965 or 3 (link-local IPv6), and MUST NOT be 0. 1967 Reserved Sent as 0 and MUST be ignored on reception. 1969 Next hop The next-hop address advertised by subsequent Update TLVs, 1970 for this address family. 1972 When the address family matches the network-layer protocol that this 1973 packet is transported over, a Next Hop TLV is not needed: in the 1974 absence of a Next Hop TLV in a given address family, the next hop 1975 address is taken to be the source address of the packet. 1977 Next Hop TLVs with an unknown value for the AE field MUST be silently 1978 ignored. 1980 This TLV is self-terminating, and allows sub-TLVs. 1982 4.6.9. Update 1984 0 1 2 3 1985 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 1986 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1987 | Type = 8 | Length | AE | Flags | 1988 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1989 | Plen | Omitted | Interval | 1990 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1991 | Seqno | Metric | 1992 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1993 | Prefix... 1994 +-+-+-+-+-+-+-+-+-+-+-+- 1996 An Update TLV advertises or retracts a route. As an optimisation, it 1997 can optionally have the side effect of establishing a new implied 1998 router-id and a new default prefix, as described in Section 4.5. 2000 Fields : 2002 Type Set to 8 to indicate an Update TLV. 2004 Length The length of the body in octets, exclusive of the Type and 2005 Length fields. 2007 AE The encoding of the Prefix field. 2009 Flags The individual bits of this field specify special handling 2010 of this TLV (see below). 2012 Plen The length in bits of the advertised prefix. If AE is 3 2013 (link-local IPv6), Omitted MUST be 0. 2015 Omitted The number of octets that have been omitted at the 2016 beginning of the advertised prefix and that should be taken 2017 from a preceding Update TLV in the same address family with 2018 the Prefix flag set. 2020 Interval An upper bound, expressed in centiseconds, on the time 2021 after which the sending node will send a new update for 2022 this prefix. This MUST NOT be 0. The receiving node will 2023 use this value to compute a hold time for the route table 2024 entry. The value FFFF hexadecimal (infinity) expresses 2025 that this announcement will not be repeated unless a 2026 request is received (Section 3.8.2.3). 2028 Seqno The originator's sequence number for this update. 2030 Metric The sender's metric for this route. The value FFFF 2031 hexadecimal (infinity) means that this is a route 2032 retraction. 2034 Prefix The prefix being advertised. This field's size is 2035 (Plen/8 - Omitted) rounded upwards. 2037 The Flags field is interpreted as follows: 2039 0 1 2 3 4 5 6 7 2040 +-+-+-+-+-+-+-+-+ 2041 |P|R|X|X|X|X|X|X| 2042 +-+-+-+-+-+-+-+-+ 2044 o P (Prefix) flag (80 hexadecimal): if set, then this Update 2045 establishes a new default prefix for subsequent Update TLVs with a 2046 matching address encoding within the same packet, even if this TLV 2047 is otherwise ignored due to an unknown mandatory sub-TLV; 2049 o R (Router-Id) flag (40 hexadecimal): if set, then this TLV 2050 establishes a new default router-id for this TLV and subsequent 2051 Update TLVs in the same packet, even if this TLV is otherwise 2052 ignored due to an unknown mandatory sub-TLV. This router-id is 2053 computed from the first address of the advertised prefix as 2054 follows: 2056 * if the length of the address is 8 octets or more, then the new 2057 router-id is taken from the 8 last octets of the address; 2059 * if the length of the address is smaller than 8 octets, then the 2060 new router-id consists of the required number of zero octets 2061 followed by the address, i.e., the address is stored on the 2062 right of the router-id. For example, for an IPv4 address, the 2063 router-id consists of 4 octets of zeroes followed by the IPv4 2064 address. 2066 o X: all other bits MUST be sent as 0 and silently ignored on 2067 reception. 2069 The prefix being advertised by an Update TLV is computed as follows: 2071 o the first Omitted octets of the prefix are taken from the previous 2072 Update TLV with the Prefix flag set and the same address encoding, 2073 even if it was ignored due to an unknown mandatory sub-TLV; if 2074 Omitted is not zero and there is no such TLV, then this Update 2075 MUST be ignored; 2077 o the next (Plen/8 - Omitted) rounded upwards octets are taken from 2078 the Prefix field; 2080 o if Plen is not a multiple of 8, then any bits beyond Plen (i.e., 2081 the low-order (8 - Plen MOD 8) bits of the last octet) are 2082 cleared; 2084 o the remaining octets are set to 0. 2086 If the Metric field is finite, the router-id of the originating node 2087 for this announcement is taken from the prefix advertised by this 2088 Update if the Router-Id flag is set, computed as described above. 2089 Otherwise, it is taken either from the preceding Router-Id TLV, or 2090 the preceding Update TLV with the Router-Id flag set, whichever comes 2091 last, even if that TLV is otherwise ignored due to an unknown 2092 mandatory sub-TLV; if there is no suitable TLV, then this update is 2093 ignored. 2095 The next-hop address for this update is taken from the last preceding 2096 Next Hop TLV with a matching address family (IPv4 or IPv6) in the 2097 same packet even if it was otherwise ignored due to an unknown 2098 mandatory sub-TLV; if no such TLV exists, it is taken from the 2099 network-layer source address of this packet if it belongs to the same 2100 address family as the prefix being announced; otherwise, this Update 2101 MUST be ignored. 2103 If the metric field is FFFF hexadecimal, this TLV specifies a 2104 retraction. In that case, the router-id, next-hop and seqno are not 2105 used. AE MAY then be 0, in which case this Update retracts all of 2106 the routes previously advertised by the sending interface. If the 2107 metric is finite, AE MUST NOT be 0; Update TLVs with finite metric 2108 and AE equal to 0 MUST be ignored. If the metric is infinite and AE 2109 is 0, Plen and Omitted MUST both be 0. 2111 Update TLVs with an unknown value in the AE field MUST be silently 2112 ignored. 2114 This TLV is self-terminating, and allows sub-TLVs. 2116 4.6.10. Route Request 2118 0 1 2 3 2119 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 2120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2121 | Type = 9 | Length | AE | Plen | 2122 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2123 | Prefix... 2124 +-+-+-+-+-+-+-+-+-+-+-+- 2126 A Route Request TLV prompts the receiver to send an update for a 2127 given prefix, or a full route table dump. 2129 Fields : 2131 Type Set to 9 to indicate a Route Request TLV. 2133 Length The length of the body in octets, exclusive of the Type and 2134 Length fields. 2136 AE The encoding of the Prefix field. The value 0 specifies 2137 that this is a request for a full route table dump (a 2138 wildcard request). 2140 Plen The length in bits of the requested prefix. 2142 Prefix The prefix being requested. This field's size is Plen/8 2143 rounded upwards. 2145 A Request TLV prompts the receiver to send an update message 2146 (possibly a retraction) for the prefix specified by the AE, Plen, and 2147 Prefix fields, or a full dump of its route table if AE is 0 (in which 2148 case Plen must be 0 and Prefix is of length 0). 2150 This TLV is self-terminating, and allows sub-TLVs. 2152 4.6.11. Seqno Request 2154 0 1 2 3 2155 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 2156 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2157 | Type = 10 | Length | AE | Plen | 2158 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2159 | Seqno | Hop Count | Reserved | 2160 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2161 | | 2162 + Router-Id + 2163 | | 2164 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2165 | Prefix... 2166 +-+-+-+-+-+-+-+-+-+-+ 2168 A Seqno Request TLV prompts the receiver to send an Update for a 2169 given prefix with a given sequence number, or to forward the request 2170 further if it cannot be satisfied locally. 2172 Fields : 2174 Type Set to 10 to indicate a Seqno Request TLV. 2176 Length The length of the body in octets, exclusive of the Type and 2177 Length fields. 2179 AE The encoding of the Prefix field. This MUST NOT be 0. 2181 Plen The length in bits of the requested prefix. 2183 Seqno The sequence number that is being requested. 2185 Hop Count The maximum number of times that this TLV may be forwarded, 2186 plus 1. This MUST NOT be 0. 2188 Reserved Sent as 0 and MUST be ignored on reception. 2190 Router-Id The Router-Id that is being requested. This MUST NOT 2191 consist of all zeroes or all ones. 2193 Prefix The prefix being requested. This field's size is Plen/8 2194 rounded upwards. 2196 A Seqno Request TLV prompts the receiving node to send a finite- 2197 metric Update for the prefix specified by the AE, Plen, and Prefix 2198 fields, with either a router-id different from what is specified by 2199 the Router-Id field, or a Seqno no less (modulo 2^16) than what is 2200 specified by the Seqno field. If this request cannot be satisfied 2201 locally, then it is forwarded according to the rules set out in 2202 Section 3.8.1.2. 2204 While a Seqno Request MAY be sent to a multicast address, it MUST NOT 2205 be forwarded to a multicast address and MUST NOT be forwarded to more 2206 than one neighbour. A request MUST NOT be forwarded if its Hop Count 2207 field is 1. 2209 This TLV is self-terminating, and allows sub-TLVs. 2211 4.7. Details of specific sub-TLVs 2213 4.7.1. Pad1 2215 0 1 2 3 4 5 6 7 2216 +-+-+-+-+-+-+-+-+ 2217 | Type = 0 | 2218 +-+-+-+-+-+-+-+-+ 2220 Fields : 2222 Type Set to 0 to indicate a Pad1 sub-TLV. 2224 This sub-TLV is silently ignored on reception. It is allowed within 2225 any TLV that allows sub-TLVs. 2227 4.7.2. PadN 2229 0 1 2 3 2230 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 2231 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2232 | Type = 1 | Length | MBZ... 2233 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 2235 Fields : 2237 Type Set to 1 to indicate a PadN sub-TLV. 2239 Length The length of the body in octets, exclusive of the Type and 2240 Length fields. 2242 MBZ Must be zero, set to 0 on transmission. 2244 This sub-TLV is silently ignored on reception. It is allowed within 2245 any TLV that allows sub-TLVs. 2247 5. IANA Considerations 2249 IANA has registered the UDP port number 6696, called "babel", for use 2250 by the Babel protocol. 2252 IANA has registered the IPv6 multicast group ff02::1:6 and the IPv4 2253 multicast group 224.0.0.111 for use by the Babel protocol. 2255 IANA has created a registry called "Babel TLV Types". The allocation 2256 policy for this registry is Specification Required [RFC8126] for 2257 Types 0-223, and Experimental Use for Types 224-254. The values in 2258 this registry are as follows: 2260 +---------+-----------------------------------------+---------------+ 2261 | Type | Name | Reference | 2262 +---------+-----------------------------------------+---------------+ 2263 | 0 | Pad1 | this document | 2264 | | | | 2265 | 1 | PadN | this document | 2266 | | | | 2267 | 2 | Acknowledgment Request | this document | 2268 | | | | 2269 | 3 | Acknowledgment | this document | 2270 | | | | 2271 | 4 | Hello | this document | 2272 | | | | 2273 | 5 | IHU | this document | 2274 | | | | 2275 | 6 | Router-Id | this document | 2276 | | | | 2277 | 7 | Next Hop | this document | 2278 | | | | 2279 | 8 | Update | this document | 2280 | | | | 2281 | 9 | Route Request | this document | 2282 | | | | 2283 | 10 | Seqno Request | this document | 2284 | | | | 2285 | 11 | TS/PC | [RFC7298] | 2286 | | | | 2287 | 12 | HMAC | [RFC7298] | 2288 | | | | 2289 | 13 | Source-specific Update | [BABEL-SS] | 2290 | | | | 2291 | 14 | Source-specific Request | [BABEL-SS] | 2292 | | | | 2293 | 15 | Source-specific Seqno Request | [BABEL-SS] | 2294 | | | | 2295 | 16 | MAC | [BABEL-MAC] | 2296 | | | | 2297 | 17 | PC | [BABEL-MAC] | 2298 | | | | 2299 | 18 | Challenge Request | [BABEL-MAC] | 2300 | | | | 2301 | 19 | Challenge Reply | [BABEL-MAC] | 2302 | | | | 2303 | 20-223 | Unassigned | | 2304 | | | | 2305 | 224-254 | Reserved for Experimental Use | this document | 2306 | | | | 2307 | 255 | Reserved for expansion of the type | this document | 2308 | | space | | 2309 +---------+-----------------------------------------+---------------+ 2311 IANA has created a registry called "Babel sub-TLV Types". The 2312 allocation policy for this registry is Specification Required for 2313 Types 0-111 and 128-239, and Experimental Use for Types 112-126 and 2314 240-254. The values in this registry are as follows: 2316 +---------+-------------------------------------+-------------------+ 2317 | Type | Name | Reference | 2318 +---------+-------------------------------------+-------------------+ 2319 | 0 | Pad1 | this document | 2320 | | | | 2321 | 1 | PadN | this document | 2322 | | | | 2323 | 2 | Diversity | [BABEL-DIVERSITY] | 2324 | | | | 2325 | 3 | Timestamp | [BABEL-RTT] | 2326 | | | | 2327 | 4-111 | Unassigned | | 2328 | | | | 2329 | 112-126 | Reserved for Experimental Use | this document | 2330 | | | | 2331 | 127 | Reserved for expansion of the type | this document | 2332 | | space | | 2333 | | | | 2334 | 128 | Source Prefix | [BABEL-SS] | 2335 | | | | 2336 | 129-239 | Unassigned | | 2337 | | | | 2338 | 240-254 | Reserved for Experimental Use | this document | 2339 | | | | 2340 | 255 | Reserved for expansion of the type | this document | 2341 | | space | | 2342 +---------+-------------------------------------+-------------------+ 2344 IANA is instructed to create a registry called "Babel Address 2345 Encodings". The allocation policy for this registry is Specification 2346 Required. The values in this registry are as follows: 2348 +----+-------------------------+---------------+ 2349 | AE | Name | Reference | 2350 +----+-------------------------+---------------+ 2351 | 0 | Wildcard address | this document | 2352 | | | | 2353 | 1 | IPv4 address | this document | 2354 | | | | 2355 | 2 | IPv6 address | this document | 2356 | | | | 2357 | 3 | Link-local IPv6 address | this document | 2358 +----+-------------------------+---------------+ 2360 IANA has created a registry called "Babel Flags Values". The 2361 allocation policy for this registry is Specification Required. IANA 2362 is instructed to rename this registry to "Babel Update Flags Values". 2363 The values in this registry are as follows: 2365 +-----+-------------------+---------------+ 2366 | Bit | Name | Reference | 2367 +-----+-------------------+---------------+ 2368 | 0 | Default prefix | this document | 2369 | | | | 2370 | 1 | Default Router-ID | this document | 2371 | | | | 2372 | 2-7 | Unassigned | | 2373 +-----+-------------------+---------------+ 2375 IANA is instructed to create a new registry called "Babel Hello Flags 2376 Values". The allocation policy for this registry is Specification 2377 Required. The initial values in this registry are as follows: 2379 +------+------------+---------------+ 2380 | Bit | Name | Reference | 2381 +------+------------+---------------+ 2382 | 0 | Unicast | this document | 2383 | | | | 2384 | 1-15 | Unassigned | | 2385 +------+------------+---------------+ 2387 IANA is instructed to replace all references to RFCs 6126 and 7557 in 2388 all of the registries mentioned above by references to this document. 2390 6. Security Considerations 2392 As defined in this document, Babel is a completely insecure protocol. 2393 Without additional security mechanisms, Babel trusts any information 2394 it receives in plaintext UDP datagrams and acts on it. An attacker 2395 that is present on the local network can impact Babel operation in a 2396 variety of ways; for example they can: 2398 o spoof a Babel packet, and redirect traffic by announcing a route 2399 with a smaller metric, a larger sequence number, or a longer 2400 prefix; 2402 o spoof a malformed packet, which could cause an insufficiently 2403 robust implementation to crash or interfere with the rest of the 2404 network; 2406 o replay a previously captured Babel packet, which could cause 2407 traffic to be redirected, blackholed or otherwise interfere with 2408 the network. 2410 When carried over IPv6, Babel packets are ignored unless they are 2411 sent from a link-local IPv6 address; since routers don't forward 2412 link-local IPv6 packets, this mitigates the attacks outlined above by 2413 restricting them to on-link attackers. No such natural protection 2414 exists when Babel packets are carried over IPv4, which is one of the 2415 reasons why it is recommended to deploy Babel over IPv6 2416 (Section 3.1). 2418 It is usually difficult to ensure that packets arriving at a Babel 2419 node are trusted, even in the case where the local link is believed 2420 to be secure. For that reason, it is RECOMMENDED that all Babel 2421 traffic be protected by an application-layer cryptographic protocol. 2422 There are currently two suitable mechanisms, which implement 2423 different tradeoffs between implementation simplicity and security: 2425 o Babel over DTLS [BABEL-DTLS] runs the majority of Babel traffic 2426 over DTLS, and leverages DTLS to authenticate nodes and provide 2427 confidentiality and integrity protection; 2429 o MAC authentication [BABEL-MAC] appends a message authentication 2430 code (MAC) to every Babel packet to prove that it originated at a 2431 node that knows a shared secret, and includes sufficient 2432 additional information to prove that the packet is fresh (not 2433 replayed). 2435 Both mechanisms enable nodes to ignore packets generated by attackers 2436 without the proper credentials. They also ensure integrity of 2437 messages and prevent message replay. While Babel-DTLS supports 2438 asymmetric keying and ensures confidentiality, Babel-MAC has a much 2439 more limited scope (see Sections 1.1, 1.2 and 7 of [BABEL-MAC]). 2440 Since Babel-MAC is simpler and more lightweight, it is recommended in 2441 preference to Babel-DTLS in deployments where its limitations are 2442 acceptable, i.e., when symmetric keying is sufficient and where the 2443 routing information is not considered confidential. 2445 Every implementation of Babel SHOULD implement BABEL-MAC. 2447 One should be aware that the information that a mobile Babel node 2448 announces to the whole routing domain is sufficient to determine the 2449 mobile node's physical location with reasonable precision, which 2450 might cause privacy concerns even if the control traffic is protected 2451 from unauthenticated attackers by a cryptographic mechanism such as 2452 Babel-DTLS. This issue may be mitigated somewhat by using randomly 2453 chosen router-ids and randomly chosen IP addresses, and changing them 2454 often enough. 2456 7. Acknowledgments 2458 A number of people have contributed text and ideas to this 2459 specification. The authors are particularly indebted to Matthieu 2460 Boutier, Gwendoline Chouasne, Margaret Cullen, Donald Eastlake, Toke 2461 Hoiland-Jorgensen, Benjamin Kaduk, Joao Sobrinho and Martin 2462 Vigoureux. Earlier versions of this document greatly benefited from 2463 the input of Joel Halpern. The address compression technique was 2464 inspired by [PACKETBB]. 2466 8. References 2468 8.1. Normative References 2470 [BABEL-MAC] 2471 Do, C., Kolodziejak, W., and J. Chroboczek, "MAC 2472 authentication for the Babel routing protocol", Internet 2473 Draft draft-ietf-babel-hmac-10, August 2019. 2475 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2476 Requirement Levels", BCP 14, RFC 2119, 2477 DOI 10.17487/RFC2119, March 1997. 2479 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2480 Writing an IANA Considerations Section in RFCs", BCP 26, 2481 RFC 8126, June 2017. 2483 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2484 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2485 May 2017. 2487 8.2. Informative References 2489 [BABEL-DIVERSITY] 2490 Chroboczek, J., "Diversity Routing for the Babel Routing 2491 Protocol", draft-chroboczek-babel-diversity-routing-01 2492 (work in progress), February 2016. 2494 [BABEL-DTLS] 2495 Decimo, A., Schinazi, D., and J. Chroboczek, "Babel 2496 Routing Protocol over Datagram Transport Layer Security", 2497 Internet Draft draft-ietf-babel-dtls-09, August 2019. 2499 [BABEL-RTT] 2500 Jonglez, B. and J. Chroboczek, "Delay-based Metric 2501 Extension for the Babel Routing Protocol", draft-ietf- 2502 babel-rtt-extension-00 (work in progress), April 2019. 2504 [BABEL-SS] 2505 Boutier, M. and J. Chroboczek, "Source-Specific Routing in 2506 Babel", draft-ietf-babel-source-specific-05 (work in 2507 progress), April 2019. 2509 [DSDV] Perkins, C. and P. Bhagwat, "Highly Dynamic Destination- 2510 Sequenced Distance-Vector Routing (DSDV) for Mobile 2511 Computers", ACM SIGCOMM'94 Conference on Communications 2512 Architectures, Protocols and Applications 234-244, 1994. 2514 [DUAL] Garcia Luna Aceves, J., "Loop-Free Routing Using Diffusing 2515 Computations", IEEE/ACM Transactions on Networking 1:1, 2516 February 1993. 2518 [EIGRP] Albrightson, B., Garcia Luna Aceves, J., and J. Boyle, 2519 "EIGRP -- a Fast Routing Protocol Based on Distance 2520 Vectors", Proc. Interop 94, 1994. 2522 [ETX] De Couto, D., Aguayo, D., Bicket, J., and R. Morris, "A 2523 high-throughput path metric for multi-hop wireless 2524 networks", Proc. MobiCom 2003, 2003. 2526 [IEEE802.11] 2527 IEEE, "IEEE Standard for Information technology-- 2528 Telecommunications and information exchange between 2529 systems Local and metropolitan area networks--Specific 2530 requirements Part 11: Wireless LAN Medium Access Control 2531 (MAC) and Physical Layer (PHY) Specifications", 2532 IEEE 802.11-2012, DOI 10.1109/ieeestd.2012.6178212, April 2533 2012. 2535 [IS-IS] Standardization, I. O. F., "Information technology -- 2536 Telecommunications and information exchange between 2537 systems -- Intermediate System to Intermediate System 2538 intra-domain routeing information exchange protocol for 2539 use in conjunction with the protocol for providing the 2540 connectionless-mode network service (ISO 8473)", ISO/ 2541 IEC 10589:2002, 2002. 2543 [JITTER] Floyd, S. and V. Jacobson, "The synchronization of 2544 periodic routing messages", IEEE/ACM Transactions on 2545 Networking 2, 2, 122-136, April 1994. 2547 [OSPF] Moy, J., "OSPF Version 2", RFC 2328, April 1998. 2549 [PACKETBB] 2550 Clausen, T., Dearlove, C., Dean, J., and C. Adjih, 2551 "Generalized Mobile Ad Hoc Network (MANET) Packet/Message 2552 Format", RFC 5444, February 2009. 2554 [RFC3561] Perkins, C., Belding-Royer, E., and S. Das, "Ad hoc On- 2555 Demand Distance Vector (AODV) Routing", RFC 3561, 2556 DOI 10.17487/RFC3561, July 2003, 2557 . 2559 [RFC6126] Chroboczek, J., "The Babel Routing Protocol", RFC 6126, 2560 DOI 10.17487/RFC6126, April 2011. 2562 [RFC7298] Ovsienko, D., "Babel Hashed Message Authentication Code 2563 (HMAC) Cryptographic Authentication", RFC 7298, 2564 DOI 10.17487/RFC7298, July 2014. 2566 [RFC7557] Chroboczek, J., "Extension Mechanism for the Babel Routing 2567 Protocol", RFC 7557, DOI 10.17487/RFC7557, May 2015. 2569 [RIP] Malkin, G., "RIP Version 2", RFC 2453, November 1998. 2571 Appendix A. Cost and Metric Computation 2573 The strategy for computing link costs and route metrics is a local 2574 matter; Babel itself only requires that it comply with the conditions 2575 given in Section 3.4.3 and Section 3.5.2. Different nodes may use 2576 different strategies in a single network and may use different 2577 strategies on different interface types. This section describes a 2578 set of stragies that have been found to work well in actual networks. 2580 In summary, a node maintains per-neighbour statistics about the last 2581 16 received Hello TLVs of each kind (Appendix A.1), it computes costs 2582 by using the 2-out-of-3 strategy (Appendix A.2.1) on wired links, and 2583 ETX (Appendix A.2.2) on wireless links. It uses an additive algebra 2584 for metric computation (Appendix A.3). 2586 A.1. Maintaining Hello History 2588 For each neighbour, a node maintains two sets of Hello history, one 2589 for each kind of Hello, and an expected sequence number, one for 2590 Multicast and one for Unicast Hellos. Each Hello history is a vector 2591 of 16 bits, where a 1 value represents a received Hello, and a 0 2592 value a missed Hello. For each kind of Hello, the expected sequence 2593 number, written ne, is the sequence number that is expected to be 2594 carried by the next received Hello from this neighbour. 2596 Whenever it receives a Hello packet of a given kind from a neighbour, 2597 a node compares the received sequence number nr for that kind of 2598 Hello with its expected sequence number ne. Depending on the outcome 2599 of this comparison, one of the following actions is taken: 2601 o if the two differ by more than 16 (modulo 2^16), then the sending 2602 node has probably rebooted and lost its sequence number; the whole 2603 associated neighbour table entry is flushed and a new one is 2604 created; 2606 o otherwise, if the received nr is smaller (modulo 2^16) than the 2607 expected sequence number ne, then the sending node has increased 2608 its Hello interval without us noticing; the receiving node removes 2609 the last (ne - nr) entries from this neighbour's Hello history (we 2610 "undo history"); 2612 o otherwise, if nr is larger (modulo 2^16) than ne, then the sending 2613 node has decreased its Hello interval, and some Hellos were lost; 2614 the receiving node adds (nr - ne) 0 bits to the Hello history (we 2615 "fast-forward"). 2617 The receiving node then appends a 1 bit to the Hello history and sets 2618 ne to (nr + 1). If the Interval field of the received Hello is not 2619 zero, it resets the neighbour's hello timer to 1.5 times the 2620 advertised Interval (the extra margin allows for delay due to 2621 jitter). 2623 Whenever either Hello timer associated to a neighbour expires, the 2624 local node adds a 0 bit to the corresponding Hello history, and 2625 increments the expected Hello number. If both Hello histories are 2626 empty (they contain 0 bits only), the neighbour entry is flushed; 2627 otherwise, the relevant hello timer is reset to the value advertised 2628 in the last Hello of that kind received from this neighbour (no extra 2629 margin is necessary in this case, since jitter was already taken into 2630 account when computing the timeout that has just expired). 2632 A.2. Cost Computation 2634 This section discusses how to compute costs based on Hello history. 2636 A.2.1. k-out-of-j 2638 K-out-of-j link sensing is suitable for wired links that are either 2639 up, in which case they only occasionally drop a packet, or down, in 2640 which case they drop all packets. 2642 The k-out-of-j strategy is parameterised by two small integers k and 2643 j, such that 0 < k <= j, and the nominal link cost, a constant C >= 2644 1. A node keeps a history of the last j hellos; if k or more of 2645 those have been correctly received, the link is assumed to be up, and 2646 the rxcost is set to C; otherwise, the link is assumed to be down, 2647 and the rxcost is set to infinity. 2649 Since Babel supports two kinds of Hellos, a Babel node performs k- 2650 out-of-j twice for each neighbour, once on the Unicast and once on 2651 the Multicast Hello history. If either of the instances of k-out- 2652 of-j indicates that the link is up, then the link is assumed to be 2653 up, and the rxcost is set to C; if both instances indicate that the 2654 link is down, then the link is assumed to be down, and the rxcost is 2655 set to infinity. In other words, the resulting rxcost is the minimum 2656 of the rxcosts yielded by the two instances of k-out-of-j link 2657 sensing. 2659 The cost of a link performing k-out-of-j link sensing is defined as 2660 follows: 2662 o cost = FFFF hexadecimal if rxcost = FFFF hexadecimal; 2664 o cost = txcost otherwise. 2666 A.2.2. ETX 2668 Unlike wired links which are bimodal (either up or down), wireless 2669 links exhibit continuous variation of the link quality. Naive 2670 application of hop-count routing in networks that use wireless links 2671 for transit tends to select long, lossy links in preference to 2672 shorter, lossless links, which can dramatically reduce throughput. 2673 For that reason, a routing protocol designed to support wireless 2674 links must perform some form of link-quality estimation. 2676 The Expected Transmission Cost algorithm, or ETX [ETX], is a simple 2677 link-quality estimation algorithm that is designed to work well with 2678 the IEEE 802.11 MAC [IEEE802.11]. By default, the IEEE 802.11 MAC 2679 performs Automatic Repeat Query (ARQ) and rate adaptation on unicast 2680 frames, but not on multicast frames, which are sent at a fixed rate 2681 with no ARQ; therefore, measuring the loss rate of multicast frames 2682 yields a useful estimate of a link's quality. 2684 A node performing ETX link quality estimation uses a neighbour's 2685 Multicast Hello history to compute an estimate, written beta, of the 2686 probability that a Hello TLV is successfully received. Beta can be 2687 computed as the fraction of 1 bits within a small number (say, 6) of 2688 the most recent entries in the Multicast Hello history, or it can be 2689 an exponential average, or some combination of both approaches. Let 2690 rxcost be 256 / beta. 2692 Let alpha be MIN(1, 256/txcost), an estimate of the probability of 2693 successfully sending a Hello TLV. The cost is then computed by 2695 cost = 256/(alpha * beta) 2697 or, equivalently, 2699 cost = (MAX(txcost, 256) * rxcost) / 256. 2701 Since the IEEE 802.11 MAC performs ARQ on unicast frames, unicast 2702 frames do not provide a useful measure of link quality, and therefore 2703 ETX ignores the Unicast Hello history. Thus, a node performing ETX 2704 link-quality estimation will not route through neighbouring nodes 2705 unless they send periodic Multicast Hellos (possibly in addition to 2706 Unicast Hellos). 2708 A.3. Metric computation 2710 As described in Section 3.5.2, the metric advertised by a neighbour 2711 is combined with the link cost to yield a metric. 2713 The simplest approach for obtaining a monotonic, left-distributive 2714 metric is to define the metric of a route as the sum of the costs of 2715 the component links. More formally, if a neighbour advertises a 2716 route with metric m over a link with cost c, then the resulting route 2717 has metric M(c, m) = c + m. 2719 A multiplicative metric can be converted into an additive one by 2720 taking the logarithm (in some suitable base) of the link costs. 2722 A.4. Route selection 2724 Route selection (Section 3.6) is the process by which a node selects 2725 a single route among the routes that it has available towards a given 2726 destination. With Babel, any route selection procedure that only 2727 ever chooses feasible routes with a finite metric will yield a set of 2728 loop-free routes; however, not all route selection policies will 2729 yield good results. 2731 The obvious route selection procedure is to pick, for every 2732 destination, the feasible route with minimal metric. When all 2733 metrics are stable, this strategy ensures convergence to a tree of 2734 shortest paths (assuming that the metric is left-distributive). 2735 There are two reasons, however, why this strategy leads to 2736 instability in the presence of continously varying metrics such as 2737 ETX (Appendix A.2.2). First, if two parallel routes oscillate around 2738 a common value, then the smallest metric strategy will keep switching 2739 between the two. Second, when a route is selected, congestion along 2740 it increases, which might increase packet loss, which in turn could 2741 cause its metric to increase; this is a feedback loop, of the kind 2742 that is prone to causing persistent oscillations. 2744 A simple strategy to avoid this kind of instabilities is to only 2745 switch routes when the target route's metric is smaller by some 2746 constant margin than the currently selected metric. However, this 2747 approach is difficult to tune: if the constant is too small, then it 2748 doesn't avoid oscillations, and if it is too large, then it leads to 2749 sub-optimal routing; thus, a better strategy is to apply hysteresis 2750 (sensitivity to a route's history) to the route selection algorithm. 2751 The following hysteresis algorithm appears to yield good results with 2752 a variety of metrics. 2754 For every route R, in addition to the route's metric m(R), maintain a 2755 smoothed version of m(R) written ms(R) (we suggest computing ms(R) as 2756 an exponential average of m(R) with a time constant equal to a small 2757 multiple of the Hello interval). If no route to a given destination 2758 is selected, then select the route with the smallest metric, ignoring 2759 the smoothed metric. If a route R is selected, then switch to a 2760 route R' only when both m(R') < m(R) and ms(R') < ms(R). 2762 Intuitively, the smoothed metric is a long-term estimate of the 2763 quality of a route. The algorithm above works by only switching 2764 routes when both the instananeous and the long-term estimate of the 2765 route's quality indicate that switching is profitable. 2767 Appendix B. Protocol parameters 2769 The choice of time constants is a trade-off between fast detection of 2770 mobility events and protocol overhead. Two instances of Babel 2771 running with different time constants will interoperate, although the 2772 resulting worst-case convergence time will be dictated by the slower 2773 of the two. 2775 The Hello interval is the most important time constant: an outage or 2776 a mobility event is detected within 1.5 to 3.5 Hello intervals. Due 2777 to Babel's use of a redundant route table, and due to its reliance on 2778 triggered updates and explicit requests, the Update interval has 2779 little influence on the time needed to reconverge after an outage: in 2780 practice, it only has a significant effect on the time needed to 2781 acquire new routes after a mobility event. While the protocol allows 2782 intervals as low as 10ms, such low values would cause significant 2783 amounts of protocol traffic for little practical benefit. 2785 The following values have been found to work well in a variety of 2786 environments, and are therefore RECOMMENDED default values: 2788 Multicast Hello Interval: 4 seconds. 2790 Unicast Hello Interval: infinite (no Unicast Hellos are sent). 2792 Link cost: estimated using ETX on wireless links; 2-out-of-3 with 2793 C=96 on wired links. 2795 IHU Interval: the advertised IHU interval is always 3 times the 2796 Multicast Hello interval. IHUs are actually sent with each Hello 2797 on lossy links (as determined from the Hello history), but only 2798 with every third Multicast Hello on lossless links. 2800 Update Interval: 4 times the Multicast Hello interval. 2802 IHU Hold Time: 3.5 times the advertised IHU interval. 2804 Route Expiry Time: 3.5 times the advertised update interval. 2806 Request timeout: initially 2 seconds, doubled every time a request 2807 is resent, up to a maximum of three times. 2809 Urgent timeout: 0.2 seconds. 2811 Source GC time: 3 minutes. 2813 Appendix C. Route filtering 2815 Route filtering is a procedure where an instance of a routing 2816 protocol either discards some of the routes announced by its 2817 neighbours, or learns them with a metric that is higher than what 2818 would be expected. Like all distance-vector protocols, Babel has the 2819 ability to apply arbitrary filtering to the routes it learns, and 2820 implementations of Babel that apply different sets of filtering rules 2821 will interoperate without causing routing loops. The protocol's 2822 ability to perform route filtering is a consequence of the latitude 2823 given in Section 3.5.2: Babel can use any metric that is strictly 2824 monotonic, including one that assigns an infinite metric to a 2825 selected subset of routes. (See also Section 3.8.1, where requests 2826 for nonexistent routes are treated in the same way as requests for 2827 routes with infinite metric.) 2829 It is not in general correct to learn a route with a metric smaller 2830 than the one it was announced with, or to replace a route's 2831 destination prefix with a more specific (longer) one. Doing either 2832 of these may cause persistent routing loops. 2834 Route filtering is a useful tool, since it allows fine-grained tuning 2835 of the routing decisions made by the routing protocol. Accordingly, 2836 some implementations of Babel implement a rich configuration language 2837 that allows applying filtering to sets of routes defined, for 2838 example, by incoming interface and destination prefix. 2840 In order to limit the consequences of misconfiguration, Babel 2841 implementations provide a reasonable set of default filtering rules 2842 even when they don't allow configuration of filtering by the user. 2843 At a minimum, they discard routes with a destination prefix in 2844 fe80::/64, ff00::/8, 127.0.0.1/32, 0.0.0.0/32 and 224.0.0.0/8. 2846 Appendix D. Considerations for protocol extensions 2848 Babel is an extensible protocol, and this document defines a number 2849 of mechanisms that can be used to extend the protocol in a backwards 2850 compatible manner: 2852 o increasing the version number in the packet header; 2854 o defining new TLVs; 2856 o defining new sub-TLVs (with or without the mandatory bit set); 2858 o defining new AEs; 2860 o using the packet trailer. 2862 This appendix is intended to guide designers of protocol extensions 2863 in chosing a particular encoding. 2865 The version number in the Babel header should only be increased if 2866 the new version is not backwards compatible with the original 2867 protocol. 2869 In many cases, an extension could be implemented either by defining a 2870 new TLV, or by adding a new sub-TLV to an existing TLV. For example, 2871 an extension whose purpose is to attach additional data to route 2872 updates can be implemented either by creating a new "enriched" Update 2873 TLV, by adding a non-mandatory sub-TLV to the Update TLV, or by 2874 adding a mandatory sub-TLV. 2876 The various encodings are treated differently by implementations that 2877 do not understand the extension. In the case of a new TLV or of a 2878 sub-TLV with the mandatory bit set, the whole TLV is ignored by 2879 implementations that do not implement the extension, while in the 2880 case of a non-mandatory sub-TLV, the TLV is parsed and acted upon, 2881 and only the unknown sub-TLV is silently ignored. Therefore, a non- 2882 mandatory sub-TLV should be used by extensions that extend the Update 2883 in a compatible manner (the extension data may be silently ignored), 2884 while a mandatory sub-TLV or a new TLV must be used by extensions 2885 that make incompatible extensions to the meaning of the TLV (the 2886 whole TLV must be thrown away if the extension data is not 2887 understood). 2889 Experience shows that the need for additional data tends to crop up 2890 in the most unexpected places. Hence, it is recommended that 2891 extensions that define new TLVs should make them self-terminating, 2892 and allow attaching sub-TLVs to them. 2894 Adding a new AE is essentially equivalent to adding a new TLV: Update 2895 TLVs with an unknown AE are ignored, just like unknown TLVs. 2896 However, adding a new AE is more involved than adding a new TLV, 2897 since it creates a new set of compression state. Additionally, since 2898 the Next Hop TLV creates state specific to a given address family, as 2899 opposed to a given AE, a new AE for a previously defined address 2900 family must not be used in the Next Hop TLV if backwards 2901 compatibility is required. A similar issue arises with Update TLVs 2902 with unknown AEs establishing a new router-id (due to the Router-Id 2903 flag being set). Therefore, defining new AEs must be done with care 2904 if compatibility with unextended implementations is required. 2906 The packet trailer is intended to carry cryptographic signatures that 2907 only cover the packet body; storing the cryptographic signatures in 2908 the packet trailer avoids clearing the signature before computing a 2909 hash of the packet body, and makes it possible to check a 2910 cryptographic signature before running the full, stateful TLV parser. 2911 Hence, only TLVs that don't need to be protected by cryptographic 2912 security protocols should be allowed in the packet trailer. Any such 2913 TLVs should be easy to parse, and in particular should not require 2914 stateful parsing. 2916 Appendix E. Stub Implementations 2918 Babel is a fairly economic protocol. Updates take between 12 and 40 2919 octets per destination, depending on the address family and how 2920 successful compression is; in a double-stack flat network, an average 2921 of less than 24 octets per update is typical. The route table 2922 occupies about 35 octets per IPv6 entry. To put these values into 2923 perspective, a single full-size Ethernet frame can carry some 65 2924 route updates, and a megabyte of memory can contain a 20000-entry 2925 route table and the associated source table. 2927 Babel is also a reasonably simple protocol. One complete 2928 implementation consists of less than 12 000 lines of C code, and it 2929 compiles to less than 120 kB of text on a 32-bit CISC architecture; 2930 about half of this figure is due to protocol extensions and user- 2931 interface code. 2933 Nonetheless, in some very constrained environments, such as PDAs, 2934 microwave ovens, or abacuses, it may be desirable to have subset 2935 implementations of the protocol. 2937 There are many different definitions of a stub router, but for the 2938 needs of this section a stub implementation of Babel is one that 2939 announces one or more directly attached prefixes into a Babel network 2940 but doesn't reannounce any routes that it has learnt from its 2941 neighbours, and always prefers the direct route to a directly 2942 attached prefix to a route learned over the Babel protocol, even when 2943 the prefixes are the same. It may either maintain a full routing 2944 table, or simply select a default gateway through any one of its 2945 neighbours that announces a default route. Since a stub 2946 implementation never forwards packets except from or to a directly 2947 attached link, it cannot possibly participate in a routing loop, and 2948 hence it need not evaluate the feasibility condition or maintain a 2949 source table. 2951 No matter how primitive, a stub implementation must parse sub-TLVs 2952 attached to any TLVs that it understands and check the mandatory bit. 2953 It must answer acknowledgment requests and must participate in the 2954 Hello/IHU protocol. It must also be able to reply to seqno requests 2955 for routes that it announces and, and it should be able to reply to 2956 route requests. 2958 Experience shows that an IPv6-only stub implementation of Babel can 2959 be written in less than 1000 lines of C code and compile to 13 kB of 2960 text on 32-bit CISC architecture. 2962 Appendix F. Compatibility with previous versions 2964 The protocol defined in this document is a successor to the protocol 2965 defined in [RFC6126] and [RFC7557]. While the two protocols are not 2966 entirely compatible, the new protocol has been designed so that it 2967 can be deployed in existing RFC 6126 networks without requiring a 2968 flag day. 2970 There are three optional features that make this protocol 2971 incompatible with its predecessor. First of all, RFC 6126 did not 2972 define Unicast hellos (Section 3.4.1), and an implementation of RFC 2973 6126 will mis-interpret a Unicast Hello for a Multicast one; since 2974 the sequence number space of Unicast Hellos is distinct from the 2975 sequence space of Multicast Hellos, sending a Unicast Hello to an 2976 implementation of RFC 6126 will confuse its link quality estimator. 2977 Second, RFC 6126 did not define unscheduled Hellos, and an 2978 implementation of RFC 6126 will mis-parse Hellos with an interval 2979 equal to 0. Finally, RFC 7557 did not define mandatory sub-TLVs 2980 (Section 4.4), and thus, an implementation of RFCs 6126 and 7557 will 2981 not correctly ignore a TLV that carries an unknown mandatory sub-TLV; 2982 depending on the sub-TLV, this might cause routing pathologies. 2984 An implementation of this specification that never sends Unicast or 2985 unscheduled Hellos and doesn't implement any extensions that use 2986 mandatory sub-TLVs is safe to deploy in a network in which some nodes 2987 implement the protocol described in RFCs 6126 and 7557. 2989 Two changes need to be made to an implementation of RFCs 6126 and 2990 7557 so that it can safely interoperate in all cases with 2991 implementations of this protocol. First, it needs to be modified to 2992 either ignore or process Unicast and unscheduled Hellos. Second, it 2993 needs to be modified to parse sub-TLVs of all the TLVs that it 2994 understands and that allow sub-TLVs, and to ignore the TLV if an 2995 unknown mandatory sub-TLV is found. It is not necessary to parse 2996 unknown TLVs, as these are ignored in any case. 2998 There are other changes, but these are not of a nature to prevent 2999 interoperability: 3001 o the conditions on route acquisition (Section 3.5.3) have been 3002 relaxed; 3004 o route selection should no longer use the route's sequence number 3005 (Section 3.6); 3007 o the format of the packet trailer has been defined (Section 4.2); 3009 o router-ids with a value of all-zeros or all-ones have been 3010 forbidden (Section 4.1.2); 3012 o the compression state is now specific to an address family rather 3013 than an address encoding (Section 4.5); 3015 o packet pacing is now recommended (Section 3.1). 3017 Appendix G. Changes from previous versions 3019 G.1. Changes since RFC 6126 3021 o Changed UDP port number to 6696. 3023 o Consistently use router-id rather than id. 3025 o Clarified that the source garbage collection timer is reset after 3026 sending an update even if the entry was not modified. 3028 o In section "Seqno Requests", fixed an erroneous "route request". 3030 o In the description of the Seqno Request TLV, added the description 3031 of the Router-Id field. 3033 o Made router-ids all-0 and all-1 forbidden. 3035 G.2. Changes since draft-ietf-babel-rfc6126bis-00 3037 o Added security considerations. 3039 G.3. Changes since draft-ietf-babel-rfc6126bis-01 3041 o Integrated the format of sub-TLVs. 3043 o Mentioned for each TLV whether it supports sub-TLVs. 3045 o Added Appendix D. 3047 o Added a mandatory bit in sub-TLVs. 3049 o Changed compression state to be per-AF rather than per-AE. 3051 o Added implementation hint for the routing table. 3053 o Clarified how router-ids are computed when bit 0x40 is set in 3054 Updates. 3056 o Relaxed the conditions for sending requests, and tightened the 3057 conditions for forwarding requests. 3059 o Clarified that neighbours should be acquired at some point, but it 3060 doesn't matter when. 3062 G.4. Changes since draft-ietf-babel-rfc6126bis-02 3064 o Added Unicast Hellos. 3066 o Added unscheduled (interval-less) Hellos. 3068 o Changed Appendix A to consider Unicast and unscheduled Hellos. 3070 o Changed Appendix B to agree with the reference implementation. 3072 o Added optional algorithm to avoid the hold time. 3074 o Changed the table of pending seqno requests to be indexed by 3075 router-id in addition to prefixes. 3077 o Relaxed the route acquisition algorithm. 3079 o Replaced minimal implementations by stub implementations. 3081 o Added acknowledgments section. 3083 G.5. Changes since draft-ietf-babel-rfc6126bis-03 3085 o Clarified that all the data structures are conceptual. 3087 o Made sending and receiving Multicast Hellos a SHOULD, avoids 3088 expressing any opinion about Unicast Hellos. 3090 o Removed opinion about Multicast vs. Unicast Hellos (Appendix A.4). 3092 o Made hold-time into a SHOULD rather than MUST. 3094 o Clarified that Seqno Requests are for a finite-metric Update. 3096 o Clarified that sub-TLVs Pad1 and PadN are allowed within any TLV 3097 that allows sub-TLVs. 3099 o Updated IANA Considerations. 3101 o Updated Security Considerations. 3103 o Renamed routing table back to route table. 3105 o Made buffering outgoing updates a SHOULD. 3107 o Weakened advice to use modified EUI-64 in router-ids. 3109 o Added information about sending requests to Appendix B. 3111 o A number of minor wording changes and clarifications. 3113 G.6. Changes since draft-ietf-babel-rfc6126bis-03 3115 Minor editorial changes. 3117 G.7. Changes since draft-ietf-babel-rfc6126bis-04 3119 o Renamed isotonicity to left-distributivity. 3121 o Minor clarifications to unicast hellos. 3123 o Updated requirements boilerplate to RFC 8174. 3125 o Minor editorial changes. 3127 G.8. Changes since draft-ietf-babel-rfc6126bis-05 3129 o Added information about the packet trailer, now that it is used by 3130 draft-ietf-babel-hmac. 3132 G.9. Changes since draft-ietf-babel-rfc6126bis-06 3134 o Added references to security documents. 3136 G.10. Changes since draft-ietf-babel-rfc6126bis-07 3138 o Added list of obsoleted drafts to the abstract. 3140 o Updated references. 3142 G.11. Changes since draft-ietf-babel-rfc6126bis-08 3144 o Added recommendation that route selection should not take seqnos 3145 into account. 3147 G.12. Changes since draft-ietf-babel-rfc6126bis-09 3149 o Editorial changes only. 3151 G.13. Changes since draft-ietf-babel-rfc6126bis-10 3153 o Editorial changes only. 3155 G.14. Changes since draft-ietf-babel-rfc6126bis-11 3157 o Added recommendation that control traffic should be carried over 3158 IPv6 only. 3160 G.15. Changes since draft-ietf-babel-rfc6126bis-12 3162 o Removed appendix about software availability. 3164 o Expanded appendix about recommended values and added more 3165 references to it in the body of the document. 3167 o Added appendix about route filtering. 3169 o Clarified definition of mandatory bit. 3171 o Added recommendations for packet pacing. 3173 o Made time limiting of full updates a SHOULD. 3175 o Normative language in a few more places. 3177 o Removed normative language from stub implementations. 3179 o Added requirement to clear the undefined bits in an Update. 3181 o Added error checking requirements. 3183 o Reworked security considerations. 3185 o Added "in octets" and "in bits" in random places. 3187 o Inserted full IANA registries. 3189 o Editorial changes. 3191 G.16. Changes since draft-ietf-babel-rfc6126bis-13 3193 o Added a section about compatibility with 6126. 3195 o Added AE registry to IANA considerations. 3197 o Replaced Babel-HMAC with Babel-MAC, consistent with the change in 3198 draft-ietf-babel-hmac. 3200 o Removed section about external sources of willingness; filtering 3201 is a better approach. 3203 o Added recommendation to use a cost of 96 on wired links. 3205 o Editorial changes. 3207 G.17. Changes since draft-ietf-babel-rfc6126bis-14 3209 o Added unscheduled Hellos to compatibility considerations. 3211 o Created new appendix about route selection. 3213 o Reworked security considerations. 3215 o Added some comments about packet pacing and low update intervals. 3217 G.18. Changes since draft-ietf-babel-rfc6126bis-15 3219 o Implementing Babel-MAC is now recommended. 3221 G.19. Changes since draft-ietf-babel-rfc6126bis-16 3223 o Make the values in Appendix B normatively recommended defaults. 3225 Authors' Addresses 3227 Juliusz Chroboczek 3228 IRIF, University of Paris-Diderot 3229 Case 7014 3230 75205 Paris Cedex 13 3231 France 3233 Email: jch@irif.fr 3235 David Schinazi 3236 Google LLC 3237 1600 Amphitheatre Parkway 3238 Mountain View, California 94043 3239 USA 3241 Email: dschinazi.ietf@gmail.com