idnits 2.17.1 draft-ietf-babel-rfc6126bis-16.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 (December 30, 2019) is 1550 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 (-05) 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: July 2, 2020 December 30, 2019 8 The Babel Routing Protocol 9 draft-ietf-babel-rfc6126bis-16 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 July 2, 2020. 35 Copyright Notice 37 Copyright (c) 2019 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-14 . . . . . . 69 117 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 69 119 1. Introduction 121 Babel is a loop-avoiding distance-vector routing protocol that is 122 designed to be robust and efficient both in networks using prefix- 123 based routing and in networks using flat routing ("mesh networks"), 124 and both in relatively stable wired networks and in highly dynamic 125 wireless networks. This document describes the Babel routing 126 protocol, and obsoletes [RFC6126] and [RFC7557]. 128 1.1. Features 130 The main property that makes Babel suitable for unstable networks is 131 that, unlike naive distance-vector routing protocols [RIP], it 132 strongly limits the frequency and duration of routing pathologies 133 such as routing loops and black-holes during reconvergence. Even 134 after a mobility event is detected, a Babel network usually remains 135 loop-free. Babel then quickly reconverges to a configuration that 136 preserves the loop-freedom and connectedness of the network, but is 137 not necessarily optimal; in many cases, this operation requires no 138 packet exchanges at all. Babel then slowly converges, in a time on 139 the scale of minutes, to an optimal configuration. This is achieved 140 by using sequenced routes, a technique pioneered by Destination- 141 Sequenced Distance-Vector routing [DSDV]. 143 More precisely, Babel has the following properties: 145 o when every prefix is originated by at most one router, Babel never 146 suffers from routing loops; 148 o when a single prefix is originated by multiple routers, Babel may 149 occasionally create a transient routing loop for this particular 150 prefix; this loop disappears in time proportional to the loop's 151 diameter, and never again (up to an arbitrary garbage-collection 152 (GC) time) will the routers involved participate in a routing loop 153 for the same prefix; 155 o assuming bounded packet loss rates, any routing black-holes that 156 may appear after a mobility event are corrected in a time at most 157 proportional to the network's diameter. 159 Babel has provisions for link quality estimation and for fairly 160 arbitrary metrics. When configured suitably, Babel can implement 161 shortest-path routing, or it may use a metric based, for example, on 162 measured packet loss. 164 Babel nodes will successfully establish an association even when they 165 are configured with different parameters. For example, a mobile node 166 that is low on battery may choose to use larger time constants (hello 167 and update intervals, etc.) than a node that has access to wall 168 power. Conversely, a node that detects high levels of mobility may 169 choose to use smaller time constants. The ability to build such 170 heterogeneous networks makes Babel particularly adapted to the 171 unmanaged and wireless environment. 173 Finally, Babel is a hybrid routing protocol, in the sense that it can 174 carry routes for multiple network-layer protocols (IPv4 and IPv6), 175 regardless of which protocol the Babel packets are themselves being 176 carried over. 178 1.2. Limitations 180 Babel has two limitations that make it unsuitable for use in some 181 environments. First, Babel relies on periodic routing table updates 182 rather than using a reliable transport; hence, in large, stable 183 networks it generates more traffic than protocols that only send 184 updates when the network topology changes. In such networks, 185 protocols such as OSPF [OSPF], IS-IS [IS-IS], or the Enhanced 186 Interior Gateway Routing Protocol (EIGRP) [EIGRP] might be more 187 suitable. 189 Second, unless the second algorithm described in Section 3.5.4 is 190 implemented, Babel does impose a hold time when a prefix is 191 retracted. While this hold time does not apply to the exact prefix 192 being retracted, and hence does not prevent fast reconvergence should 193 it become available again, it does apply to any shorter prefix that 194 covers it. This may make those implementations of Babel that do not 195 implement the optional algorithm described in Section 3.5.4 196 unsuitable for use in networks that implement automatic prefix 197 aggregation. 199 1.3. Specification of Requirements 201 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 202 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 203 "OPTIONAL" in this document are to be interpreted as described in BCP 204 14 [RFC2119] [RFC8174] when, and only when, they appear in all 205 capitals, as shown here. 207 2. Conceptual Description of the Protocol 209 Babel is a loop-avoiding distance vector protocol: it is based on the 210 Bellman-Ford algorithm, just like the venerable RIP [RIP], but 211 includes a number of refinements that either prevent loop formation 212 altogether, or ensure that a loop disappears in a timely manner and 213 doesn't form again. 215 Conceptually, Bellman-Ford is executed in parallel for every source 216 of routing information (destination of data traffic). In the 217 following discussion, we fix a source S; the reader will recall that 218 the same algorithm is executed for all sources. 220 2.1. Costs, Metrics and Neighbourship 222 For every pair of neighbouring nodes A and B, Babel computes an 223 abstract value known as the cost of the link from A to B, written 224 C(A, B). Given a route between any two (not necessarily 225 neighbouring) nodes, the metric of the route is the sum of the costs 226 of all the links along the route. The goal of the routing algorithm 227 is to compute, for every source S, the tree of routes of lowest 228 metric to S. 230 Costs and metrics need not be integers. In general, they can be 231 values in any algebra that satisfies two fairly general conditions 232 (Section 3.5.2). 234 A Babel node periodically sends Hello messages to all of its 235 neighbours; it also periodically sends an IHU ("I Heard You") message 236 to every neighbour from which it has recently heard a Hello. From 237 the information derived from Hello and IHU messages received from its 238 neighbour B, a node A computes the cost C(A, B) of the link from A to 239 B. 241 2.2. The Bellman-Ford Algorithm 243 Every node A maintains two pieces of data: its estimated distance to 244 S, written D(A), and its next-hop router to S, written NH(A). 245 Initially, D(S) = 0, D(A) is infinite, and NH(A) is undefined. 247 Periodically, every node B sends to all of its neighbours a route 248 update, a message containing D(B). When a neighbour A of B receives 249 the route update, it checks whether B is its selected next hop; if 250 that is the case, then NH(A) is set to B, and D(A) is set to C(A, B) 251 + D(B). If that is not the case, then A compares C(A, B) + D(B) to 252 its current value of D(A). If that value is smaller, meaning that 253 the received update advertises a route that is better than the 254 currently selected route, then NH(A) is set to B, and D(A) is set to 255 C(A, B) + D(B). 257 A number of refinements to this algorithm are possible, and are used 258 by Babel. In particular, convergence speed may be increased by 259 sending unscheduled "triggered updates" whenever a major change in 260 the topology is detected, in addition to the regular, scheduled 261 updates. Additionally, a node may maintain a number of alternate 262 routes, which are being advertised by neighbours other than its 263 selected neighbour, and which can be used immediately if the selected 264 route were to fail. 266 2.3. Transient Loops in Bellman-Ford 268 It is well known that a naive application of Bellman-Ford to 269 distributed routing can cause transient loops after a topology 270 change. Consider for example the following topology: 272 B 273 1 /| 274 1 / | 275 S --- A |1 276 \ | 277 1 \| 278 C 280 After convergence, D(B) = D(C) = 2, with NH(B) = NH(C) = A. 282 Suppose now that the link between S and A fails: 284 B 285 1 /| 286 / | 287 S A |1 288 \ | 289 1 \| 290 C 292 When it detects the failure of the link, A switches its next hop to B 293 (which is still advertising a route to S with metric 2), and 294 advertises a metric equal to 3, and then advertises a new route with 295 metric 3. This process of nodes changing selected neighbours and 296 increasing their metric continues until the advertised metric reaches 297 "infinity", a value larger than all the metrics that the routing 298 protocol is able to carry. 300 2.4. Feasibility Conditions 302 Bellman-Ford is a very robust algorithm: its convergence properties 303 are preserved when routers delay route acquisition or when they 304 discard some updates. Babel routers discard received route 305 announcements unless they can prove that accepting them cannot 306 possibly cause a routing loop. 308 More formally, we define a condition over route announcements, known 309 as the "feasibility condition", that guarantees the absence of 310 routing loops whenever all routers ignore route updates that do not 311 satisfy the feasibility condition. In effect, this makes Bellman- 312 Ford into a family of routing algorithms, parameterised by the 313 feasibility condition. 315 Many different feasibility conditions are possible. For example, BGP 316 can be modelled as being a distance-vector protocol with a (rather 317 drastic) feasibility condition: a routing update is only accepted 318 when the receiving node's AS number is not included in the update's 319 AS-Path attribute (note that BGP's feasibility condition does not 320 ensure the absence of transient "micro-loops" during reconvergence). 322 Another simple feasibility condition, used in the Destination- 323 Sequenced Distance-Vector (DSDV) routing protocol [DSDV] and in the 324 Ad hoc On-Demand Distance Vector (AODV) protocol [RFC3561], stems 325 from the following observation: a routing loop can only arise after a 326 router has switched to a route with a larger metric than the route 327 that it had previously selected. Hence, one may define that a route 328 is feasible when its metric at the local node would be no larger than 329 the metric of the currently selected route, i.e., an announcement 330 carrying a metric D(B) is accepted by A when C(A, B) + D(B) <= D(A). 331 If all routers obey this constraint, then the metric at every router 332 is nonincreasing, and the following invariant is always preserved: if 333 A has selected B as its next hop, then D(B) < D(A), which implies 334 that the forwarding graph is loop-free. 336 Babel uses a slightly more refined feasibility condition, derived 337 from EIGRP [DUAL]. Given a router A, define the feasibility distance 338 of A, written FD(A), as the smallest metric that A has ever 339 advertised for S to any of its neighbours. An update sent by a 340 neighbour B of A is feasible when the metric D(B) advertised by B is 341 strictly smaller than A's feasibility distance, i.e., when D(B) < 342 FD(A). 344 It is easy to see that this latter condition is no more restrictive 345 than DSDV-feasibility. Suppose that node A obeys DSDV-feasibility; 346 then D(A) is nonincreasing, hence at all times D(A) <= FD(A). 347 Suppose now that A receives a DSDV-feasible update that advertises a 348 metric D(B). Since the update is DSDV-feasible, C(A, B) + D(B) <= 349 D(A), hence D(B) < D(A), and since D(A) <= FD(A), D(B) < FD(A). 351 To see that it is strictly less restrictive, consider the following 352 diagram, where A has selected the route through B, and D(A) = FD(A) = 353 2. Since D(C) = 1 < FD(A), the alternate route through C is feasible 354 for A, although its metric C(A, C) + D(C) = 5 is larger than that of 355 the currently selected route: 357 B 358 1 / \ 1 359 / \ 360 S A 361 \ / 362 1 \ / 4 363 C 365 To show that this feasibility condition still guarantees loop- 366 freedom, recall that at the time when A accepts an update from B, the 367 metric D(B) announced by B is no smaller than FD(B); since it is 368 smaller than FD(A), at that point in time FD(B) < FD(A). Since this 369 property is preserved both when A sends updates and when it picks a 370 different next hop, it remains true at all times, which ensures that 371 the forwarding graph has no loops. 373 2.5. Solving Starvation: Sequencing Routes 375 Obviously, the feasibility conditions defined above cause starvation 376 when a router runs out of feasible routes. Consider the following 377 diagram, where both A and B have selected the direct route to S: 379 A 380 1 /| D(A) = 1 381 / | FD(A) = 1 382 S |1 383 \ | D(B) = 2 384 2 \| FD(B) = 2 385 B 387 Suppose now that the link between A and S breaks: 389 A 390 | 391 | FD(A) = 1 392 S |1 393 \ | D(B) = 2 394 2 \| FD(B) = 2 395 B 397 The only route available from A to S, the one that goes through B, is 398 not feasible: A suffers from spurious starvation. At that point, the 399 whole subtree suffering from starvation must be reset, which is 400 essentially what EIGRP does when it performs a global synchronisation 401 of all the routers in the starving subtree (the "active" phase of 402 EIGRP). 404 Babel reacts to starvation in a less drastic manner, by using 405 sequenced routes, a technique introduced by DSDV and adopted by AODV. 406 In addition to a metric, every route carries a sequence number, a 407 nondecreasing integer that is propagated unchanged through the 408 network and is only ever incremented by the source; a pair (s, m), 409 where s is a sequence number and m a metric, is called a distance. 411 A received update is feasible when either it is more recent than the 412 feasibility distance maintained by the receiving node, or it is 413 equally recent and the metric is strictly smaller. More formally, if 414 FD(A) = (s, m), then an update carrying the distance (s', m') is 415 feasible when either s' > s, or s = s' and m' < m. 417 Assuming the sequence number of S is 137, the diagram above becomes: 419 A 420 | 421 | FD(A) = (137, 1) 422 S |1 423 \ | D(B) = (137, 2) 424 2 \| FD(B) = (137, 2) 425 B 427 After S increases its sequence number, and the new sequence number is 428 propagated to B, we have: 430 A 431 | 432 | FD(A) = (137, 1) 433 S |1 434 \ | D(B) = (138, 2) 435 2 \| FD(B) = (138, 2) 436 B 438 at which point the route through B becomes feasible again. 440 Note that while sequence numbers are used for determining 441 feasibility, they are not used in route selection: a node ignores the 442 sequence number when selecting the best route to a given destination 443 (Section 3.6). Doing otherwise would cause route oscillation while a 444 sequence number propagates through the network, and might even cause 445 persistent blackholes with some exotic metrics. 447 2.6. Requests 449 In DSDV, the sequence number of a source is increased periodically. 450 A route becomes feasible again after the source increases its 451 sequence number, and the new sequence number is propagated through 452 the network, which may, in general, require a significant amount of 453 time. 455 Babel takes a different approach. When a node detects that it is 456 suffering from a potentially spurious starvation, it sends an 457 explicit request to the source for a new sequence number. This 458 request is forwarded hop by hop to the source, with no regard to the 459 feasibility condition. Upon receiving the request, the source 460 increases its sequence number and broadcasts an update, which is 461 forwarded to the requesting node. 463 Note that after a change in network topology not all such requests 464 will, in general, reach the source, as some will be sent over links 465 that are now broken. However, if the network is still connected, 466 then at least one among the nodes suffering from spurious starvation 467 has an (unfeasible) route to the source; hence, in the absence of 468 packet loss, at least one such request will reach the source. 469 (Resending requests a small number of times compensates for packet 470 loss.) 472 Since requests are forwarded with no regard to the feasibility 473 condition, they may, in general, be caught in a forwarding loop; this 474 is avoided by having nodes perform duplicate detection for the 475 requests that they forward. 477 2.7. Multiple Routers 479 The above discussion assumes that each prefix is originated by a 480 single router. In real networks, however, it is often necessary to 481 have a single prefix originated by multiple routers: for example, the 482 default route will be originated by all of the edge routers of a 483 routing domain. 485 Since synchronising sequence numbers between distinct routers is 486 problematic, Babel treats routes for the same prefix as distinct 487 entities when they are originated by different routers: every route 488 announcement carries the router-id of its originating router, and 489 feasibility distances are not maintained per prefix, but per source, 490 where a source is a pair of a router-id and a prefix. In effect, 491 Babel guarantees loop-freedom for the forwarding graph to every 492 source; since the union of multiple acyclic graphs is not in general 493 acyclic, Babel does not in general guarantee loop-freedom when a 494 prefix is originated by multiple routers, but any loops will be 495 broken in a time at most proportional to the diameter of the loop -- 496 as soon as an update has "gone around" the routing loop. 498 Consider for example the following topology, where A has selected the 499 default route through S, and B has selected the one through S': 501 1 1 1 502 ::/0 -- S --- A --- B --- S' -- ::/0 504 Suppose that both default routes fail at the same time; then nothing 505 prevents A from switching to B, and B simultaneously switching to A. 506 However, as soon as A has successfully advertised the new route to B, 507 the route through A will become unfeasible for B. Conversely, as 508 soon as B will have advertised the route through A, the route through 509 B will become unfeasible for A. 511 In effect, the routing loop disappears at the latest when routing 512 information has gone around the loop. Since this process can be 513 delayed by lost packets, Babel makes certain efforts to ensure that 514 updates are sent reliably after a router-id change (Section 3.7.2). 516 Additionally, after the routers have advertised the two routes, both 517 sources will be in their source tables, which will prevent them from 518 ever again participating in a routing loop involving routes from S 519 and S' (up to the source GC time, which, available memory permitting, 520 can be set to arbitrarily large values). 522 2.8. Overlapping Prefixes 524 In the above discussion, we have assumed that all prefixes are 525 disjoint, as is the case in flat ("mesh") routing. In practice, 526 however, prefixes may overlap: for example, the default route 527 overlaps with all of the routes present in the network. 529 After a route fails, it is not correct in general to switch to a 530 route that subsumes the failed route. Consider for example the 531 following configuration: 533 1 1 534 ::/0 -- A --- B --- C 536 Suppose that node C fails. If B forwards packets destined to C by 537 following the default route, a routing loop will form, and persist 538 until A learns of B's retraction of the direct route to C. B avoids 539 this pitfall by installing an "unreachable" route after a route is 540 retracted; this route is maintained until it can be guaranteed that 541 the former route has been retracted by all of B's neighbours 542 (Section 3.5.4). 544 3. Protocol Operation 546 Every Babel speaker is assigned a router-id, which is an arbitrary 547 string of 8 octets that is assumed unique across the routing domain. 548 For example, router-ids could be assigned randomly, or they could be 549 derived from a link-layer address. (The protocol encoding is 550 slightly more compact when router-ids are assigned in the same manner 551 as the IPv6 layer assigns host IDs, see the definition of the "R" 552 flag in Section 4.6.9.) 554 3.1. Message Transmission and Reception 556 Babel protocol packets are sent in the body of a UDP datagram (as 557 described in Section 4 below). Each Babel packet consists of zero or 558 more TLVs. Most TLVs may contain sub-TLVs. 560 The protocol's control traffic can be carried indifferently over IPv6 561 or over IPv4, and prefixes of either address family can be announced 562 over either protocol. Thus, there are at least two natural 563 deployment models: using IPv6 exclusively for all control traffic, or 564 running two distinct protocol instances, one for each address family. 565 The exclusive use of IPv6 for all control traffic is RECOMMENDED, 566 since using both protocols at the same time doubles the amount of 567 traffic devoted to neighbour discovery and link quality estimation. 569 The source address of a Babel packet is always a unicast address, 570 link-local in the case of IPv6. Babel packets may be sent to a well- 571 known (link-local) multicast address or to a (link-local) unicast 572 address. In normal operation, a Babel speaker sends both multicast 573 and unicast packets to its neighbours. 575 With the exception of acknowledgments, all Babel TLVs can be sent to 576 either unicast or multicast addresses, and their semantics does not 577 depend on whether the destination is a unicast or a multicast 578 address. Hence, a Babel speaker does not need to determine the 579 destination address of a packet that it receives in order to 580 interpret it. 582 A moderate amount of jitter may be applied to packets sent by a Babel 583 speaker: outgoing TLVs are buffered and SHOULD be sent with a random 584 delay. This is done for two purposes: it avoids synchronisation of 585 multiple Babel speakers across a network [JITTER], and it allows for 586 the aggregation of multiple TLVs into a single packet. 588 The maximum amount of delay a TLV can be subjected to depends on the 589 TLV. When the protocol description specifies that a TLV is urgent 590 (as in Section 3.7.2 and Section 3.8.2), then the TLV MUST be sent 591 within a short time known as the urgent timeout (see Appendix B for 592 recommended values). When the TLV is governed by a timeout 593 explicitly included in a previous TLV, (such as in the case of 594 Acknowledgements Section 4.6.4), Updates (Section 3.7 and IHUs 595 (Section 3.4.2), then the TLV MUST be sent early enough to meet the 596 explicit deadline (with a small margin to allow for propagation 597 delays). In all other cases, the TLV SHOULD be sent out within one- 598 half of the Multicast Hello interval. 600 In order to avoid packet drops (either at the sender or at the 601 receiver), a delay SHOULD be introduced between successive packets 602 sent out on the same interface, within the constraints of the 603 previous paragraph. Note however that such packet pacing might 604 impair the ability of some link layers (e.g., IEEE 802.11) to perform 605 packet aggregation. 607 3.2. Data Structures 609 In this section, we give a description of the data structures that 610 every Babel speaker maintains. This description is conceptual: a 611 Babel speaker may use different data structures as long as the 612 resulting protocol is the same as the one described in this document. 613 For example, rather than maintaining a single table containing both 614 selected and unselected (fallback) routes, as described in 615 Section 3.2.6 below, an actual implementation would probably use two 616 tables, one with selected routes and one with fallback routes. 618 3.2.1. Sequence number arithmetic 620 Sequence numbers (seqnos) appear in a number of Babel data 621 structures, and they are interpreted as integers modulo 2^16. For 622 the purposes of this document, arithmetic on sequence numbers is 623 defined as follows. 625 Given a seqno s and a non-negative integer n, the sum of s and n is 626 defined by 628 s + n (modulo 2^16) = (s + n) MOD 2^16 630 or, equivalently, 632 s + n (modulo 2^16) = (s + n) AND 65535 634 where MOD is the modulo operation yielding a non-negative integer and 635 AND is the bitwise conjunction operation. 637 Given two sequence numbers s and s', the relation s is less than s' 638 (s < s') is defined by 640 s < s' (modulo 2^16) when 0 < ((s' - s) MOD 2^16) < 32768 642 or equivalently 644 s < s' (modulo 2^16) when s /= s' and ((s' - s) AND 32768) = 0. 646 3.2.2. Node Sequence Number 648 A node's sequence number is a 16-bit integer that is included in 649 route updates sent for routes originated by this node. 651 A node increments its sequence number (modulo 2^16) whenever it 652 receives a request for a new sequence number (Section 3.8.1.2). A 653 node SHOULD NOT increment its sequence number (seqno) spontaneously, 654 since increasing seqnos makes it less likely that other nodes will 655 have feasible alternate routes when their selected routes fail. 657 3.2.3. The Interface Table 659 The interface table contains the list of interfaces on which the node 660 speaks the Babel protocol. Every interface table entry contains the 661 interface's outgoing Multicast Hello seqno, a 16-bit integer that is 662 sent with each Multicast Hello TLV on this interface and is 663 incremented (modulo 2^16) whenever a Multicast Hello is sent. (Note 664 that an interface's Multicast Hello seqno is unrelated to the node's 665 seqno.) 666 There are two timers associated with each interface table entry. The 667 periodic Multicast Hello timer governs the sending of scheduled 668 Multicast Hello and IHU packets (Section 3.4. The periodic Update 669 timer governs the sending of periodic route updates (Section 3.7.1). 670 See Appendix B for suggested time constants. 672 3.2.4. The Neighbour Table 674 The neighbour table contains the list of all neighbouring interfaces 675 from which a Babel packet has been recently received. The neighbour 676 table is indexed by pairs of the form (interface, address), and every 677 neighbour table entry contains the following data: 679 o the local node's interface over which this neighbour is reachable; 681 o the address of the neighbouring interface; 683 o a history of recently received Multicast Hello packets from this 684 neighbour; this can, for example, be a sequence of n bits, for 685 some small value n, indicating which of the n hellos most recently 686 sent by this neighbour have been received by the local node; 688 o a history of recently received Unicast Hello packets from this 689 neighbour; 691 o the "transmission cost" value from the last IHU packet received 692 from this neighbour, or FFFF hexadecimal (infinity) if the IHU 693 hold timer for this neighbour has expired; 695 o the expected incoming Multicast Hello sequence number for this 696 neighbour, an integer modulo 2^16. 698 o the expected incoming Unicast Hello sequence number for this 699 neighbour, an integer modulo 2^16. 701 o the outgoing Unicast Hello sequence number for this neighbour, an 702 integer modulo 2^16 that is sent with each Unicast Hello TLV to 703 this neighbour and is incremented (modulo 2^16) whenever a Unicast 704 Hello is sent. (Note that the outgoing Unicast Hello seqno for a 705 neighbour is distinct from the interface's outgoing Multicast 706 Hello seqno.) 708 There are three timers associated with each neighbour entry -- the 709 multicast hello timer, which is set to the interval value carried by 710 scheduled Multicast Hello TLVs sent by this neighbour, the unicast 711 hello timer, which is set to the interval value carried by scheduled 712 Unicast Hello TLVs, and the IHU timer, which is set to a small 713 multiple of the interval carried in IHU TLVs (see "IHU Hold time" in 714 Appendix B for suggested values). 716 Note that the neighbour table is indexed by IP addresses, not by 717 router-ids: neighbourship is a relationship between interfaces, not 718 between nodes. Therefore, two nodes with multiple interfaces can 719 participate in multiple neighbourship relationships, a situation that 720 can notably arise when wireless nodes with multiple radios are 721 involved. 723 3.2.5. The Source Table 725 The source table is used to record feasibility distances. It is 726 indexed by triples of the form (prefix, plen, router-id), and every 727 source table entry contains the following data: 729 o the prefix (prefix, plen), where plen is the prefix length in 730 bits, that this entry applies to; 732 o the router-id of a router originating this prefix; 734 o a pair (seqno, metric), this source's feasibility distance. 736 There is one timer associated with each entry in the source table -- 737 the source garbage-collection timer. It is initialised to a time on 738 the order of minutes and reset as specified in Section 3.7.3. 740 3.2.6. The Route Table 742 The route table contains the routes known to this node. It is 743 indexed by triples of the form (prefix, plen, neighbour), and every 744 route table entry contains the following data: 746 o the source (prefix, plen, router-id) for which this route is 747 advertised; 749 o the neighbour (an entry in the neighbour table) that advertised 750 this route; 752 o the metric with which this route was advertised by the neighbour, 753 or FFFF hexadecimal (infinity) for a recently retracted route; 755 o the sequence number with which this route was advertised; 757 o the next-hop address of this route; 758 o a boolean flag indicating whether this route is selected, i.e., 759 whether it is currently being used for forwarding and is being 760 advertised. 762 There is one timer associated with each route table entry -- the 763 route expiry timer. It is initialised and reset as specified in 764 Section 3.5.3. 766 Note that there are two distinct (seqno, metric) pairs associated to 767 each route: the route's distance, which is stored in the route table, 768 and the feasibility distance, stored in the source table and shared 769 between all routes with the same source. 771 3.2.7. The Table of Pending Seqno Requests 773 The table of pending seqno requests contains a list of seqno requests 774 that the local node has sent (either because they have been 775 originated locally, or because they were forwarded) and to which no 776 reply has been received yet. This table is indexed by triples of the 777 form (prefix, plen, router-id), and every entry in this table 778 contains the following data: 780 o the prefix, plen, router-id, and seqno being requested; 782 o the neighbour, if any, on behalf of which we are forwarding this 783 request; 785 o a small integer indicating the number of times that this request 786 will be resent if it remains unsatisfied. 788 There is one timer associated with each pending seqno request; it 789 governs both the resending of requests and their expiry. 791 3.3. Acknowledgments and acknowledgment requests 793 A Babel speaker may request that a neighbour receiving a given packet 794 reply with an explicit acknowledgment within a given time. While the 795 use of acknowledgment requests is optional, every Babel speaker MUST 796 be able to reply to such a request. 798 An acknowledgment MUST be sent to a unicast destination. On the 799 other hand, acknowledgment requests may be sent to either unicast or 800 multicast destinations, in which case they request an acknowledgment 801 from all of the receiving nodes. 803 When to request acknowledgments is a matter of local policy; the 804 simplest strategy is to never request acknowledgments and to rely on 805 periodic updates to ensure that any reachable routes are eventually 806 propagated throughout the routing domain. In order to improve 807 convergence speed and reduce the amount of control traffic, 808 acknowledgment requests MAY be used in order to reliably send urgent 809 updates (Section 3.7.2) and retractions (Section 3.5.4), especially 810 when the number of neighbours on a given interface is small. Since 811 Babel is designed to deal gracefully with packet loss on unreliable 812 media, sending all packets with acknowledgment requests is not 813 necessary, and NOT RECOMMENDED, as the acknowledgments cause 814 additional traffic and may force additional Address Resolution 815 Protocol (ARP) or Neighbour Discovery (ND) exchanges. 817 3.4. Neighbour Acquisition 819 Neighbour acquisition is the process by which a Babel node discovers 820 the set of neighbours heard over each of its interfaces and 821 ascertains bidirectional reachability. On unreliable media, 822 neighbour acquisition additionally provides some statistics that may 823 be useful for link quality computation. 825 Before it can exchange routing information with a neighbour, a Babel 826 node MUST create an entry for that neighbour in the neighbour table. 827 When to do that is implementation-specific; suitable strategies 828 include creating an entry when any Babel packet is received, or 829 creating an entry when a Hello TLV is parsed. Similarly, in order to 830 conserve system resources, an implementation SHOULD discard an entry 831 when it has been unused for long enough; suitable strategies include 832 dropping the neighbour after a timeout, and dropping a neighbour when 833 the associated Hello histories become empty (see Appendix A.2). 835 3.4.1. Reverse Reachability Detection 837 Every Babel node sends Hello TLVs to its neighbours to indicate that 838 it is alive, at regular or irregular intervals. Each Hello TLV 839 carries an increasing (modulo 2^16) sequence number and an upper 840 bound on the time interval until the next Hello of the same type (see 841 below). If the time interval is set to 0, then the Hello TLV does 842 not establish a new promise: the deadline carried by the previous 843 Hello of the same type still applies to the next Hello (if the most 844 recent scheduled Hello of the right kind was received at time t0 and 845 carried interval i, then the previous promise of sending another 846 Hello before time t0 + i still holds). We say that a Hello is 847 "scheduled" if it carries a non-zero interval, and "unscheduled" 848 otherwise. 850 There are two kinds of Hellos: Multicast Hellos, which use a per- 851 interface Hello counter (the Multicast Hello seqno), and Unicast 852 Hellos, which use a per-neighbour counter (the Unicast Hello seqno). 853 A Multicast Hello with a given seqno MUST be sent to all neighbours 854 on a given interface, either by sending it to a multicast address or 855 by sending it to one unicast address per neighbour (hence, the term 856 "Multicast Hello" is a slight misnomer). A Unicast Hello carrying a 857 given seqno should normally be sent to just one neighbour (over 858 unicast), since the sequence numbers of different neighbours are not 859 in general synchronised. 861 Multicast Hellos sent over multicast can be used for neighbour 862 discovery; hence, a node SHOULD send periodic (scheduled) Multicast 863 Hellos unless neighbour discovery is performed by means outside of 864 the Babel protocol. A node MAY send Unicast Hellos or unscheduled 865 Hellos of either kind for any reason, such as reducing the amount of 866 multicast traffic or improving reliability on link technologies with 867 poor support for link-layer multicast. 869 A node MAY send a scheduled Hello ahead of time. A node MAY change 870 its scheduled Hello interval. The Hello interval MAY be decreased at 871 any time; it MAY be increased immediately before sending a Hello TLV, 872 but SHOULD NOT be increased at other times. (Equivalently, a node 873 SHOULD send a scheduled Hello immediately after increasing its Hello 874 interval.) 876 How to deal with received Hello TLVs and what statistics to maintain 877 are considered local implementation matters; typically, a node will 878 maintain some sort of history of recently received Hellos. An 879 example of a suitable algorithm is described in Appendix A.1. 881 After receiving a Hello, or determining that it has missed one, the 882 node recomputes the association's cost (Section 3.4.3) and runs the 883 route selection procedure (Section 3.6). 885 3.4.2. Bidirectional Reachability Detection 887 In order to establish bidirectional reachability, every node sends 888 periodic IHU ("I Heard You") TLVs to each of its neighbours. Since 889 IHUs carry an explicit interval value, they MAY be sent less often 890 than Hellos in order to reduce the amount of routing traffic in dense 891 networks; in particular, they SHOULD be sent less often than Hellos 892 over links with little packet loss. While IHUs are conceptually 893 unicast, they MAY be sent to a multicast address in order to avoid an 894 ARP or Neighbour Discovery exchange and to aggregate multiple IHUs 895 into a single packet. 897 In addition to the periodic IHUs, a node MAY, at any time, send an 898 unscheduled IHU packet. It MAY also, at any time, decrease its IHU 899 interval, and it MAY increase its IHU interval immediately before 900 sending an IHU, but SHOULD NOT increase it at any other time. 902 (Equivalently, a node SHOULD send an extra IHU immediately after 903 increasing its Hello interval.) 905 Every IHU TLV contains two pieces of data: the link's rxcost 906 (reception cost) from the sender's perspective, used by the neighbour 907 for computing link costs (Section 3.4.3), and the interval between 908 periodic IHU packets. A node receiving an IHU sets the value of the 909 txcost (transmission cost) maintained in the neighbour table to the 910 value contained in the IHU, and resets the IHU timer associated to 911 this neighbour to a small multiple of the interval value received in 912 the IHU (see "IHU Hold time" in Appendix B for suggested values). 913 When a neighbour's IHU timer expires, the neighbour's txcost is set 914 to infinity. 916 After updating a neighbour's txcost, the receiving node recomputes 917 the neighbour's cost (Section 3.4.3) and runs the route selection 918 procedure (Section 3.6). 920 3.4.3. Cost Computation 922 A neighbourship association's link cost is computed from the values 923 maintained in the neighbour table: the statistics kept in the 924 neighbour table about the reception of Hellos, and the txcost 925 computed from received IHU packets. 927 For every neighbour, a Babel node computes a value known as this 928 neighbour's rxcost. This value is usually derived from the Hello 929 history, which may be combined with other data, such as statistics 930 maintained by the link layer. The rxcost is sent to a neighbour in 931 each IHU. 933 Since nodes do not necessarily send periodic Unicast Hellos but do 934 usually send periodic Multicast Hellos (Section 3.4.1), a node SHOULD 935 use an algorithm that yields a finite rxcost when only Multicast 936 Hellos are received, unless interoperability with nodes that only 937 send Multicast Hellos is not required. 939 How the txcost and rxcost are combined in order to compute a link's 940 cost is a matter of local policy; as far as Babel's correctness is 941 concerned, only the following conditions MUST be satisfied: 943 o the cost is strictly positive; 945 o if no Hello TLVs of either kind were received recently, then the 946 cost is infinite; 948 o if the txcost is infinite, then the cost is infinite. 950 Note that while this document does not constrain cost computation any 951 further, not all cost computation strategies will give good results. 952 See Appendix A.2 for examples of strategies for computing a link's 953 cost that are known to work well in practice. 955 3.5. Routing Table Maintenance 957 Conceptually, a Babel update is a quintuple (prefix, plen, router-id, 958 seqno, metric), where (prefix, plen) is the prefix for which a route 959 is being advertised, router-id is the router-id of the router 960 originating this update, seqno is a nondecreasing (modulo 2^16) 961 integer that carries the originating router seqno, and metric is the 962 announced metric. 964 Before being accepted, an update is checked against the feasibility 965 condition (Section 3.5.1), which ensures that the route does not 966 create a routing loop. If the feasibility condition is not 967 satisfied, the update is either ignored or prevents the route from 968 being selected, as described in Section 3.5.3. If the feasibility 969 condition is satisfied, then the update cannot possibly cause a 970 routing loop. 972 3.5.1. The Feasibility Condition 974 The feasibility condition is applied to all received updates. The 975 feasibility condition compares the metric in the received update with 976 the metrics of the updates previously sent by the receiving node; 977 updates that fail the feasibility condition, and therefore have 978 metrics large enough to cause a routing loop, are either ignored or 979 prevent the resulting route from being selected. 981 A feasibility distance is a pair (seqno, metric), where seqno is an 982 integer modulo 2^16 and metric is a positive integer. Feasibility 983 distances are compared lexicographically, with the first component 984 inverted: we say that a distance (seqno, metric) is strictly better 985 than a distance (seqno', metric'), written 987 (seqno, metric) < (seqno', metric') 989 when 991 seqno > seqno' or (seqno = seqno' and metric < metric') 993 where sequence numbers are compared modulo 2^16. 995 Given a source (prefix, plen, router-id), a node's feasibility 996 distance for this source is the minimum, according to the ordering 997 defined above, of the distances of all the finite updates ever sent 998 by this particular node for the prefix (prefix, plen) and the given 999 router-id. Feasibility distances are maintained in the source table, 1000 the exact procedure is given in Section 3.7.3. 1002 A received update is feasible when either it is a retraction (its 1003 metric is FFFF hexadecimal), or the advertised distance is strictly 1004 better, in the sense defined above, than the feasibility distance for 1005 the corresponding source. More precisely, a route advertisement 1006 carrying the quintuple (prefix, plen, router-id, seqno, metric) is 1007 feasible if one of the following conditions holds: 1009 o metric is infinite; or 1011 o no entry exists in the source table indexed by (prefix, plen, 1012 router-id); or 1014 o an entry (prefix, plen, router-id, seqno', metric') exists in the 1015 source table, and either 1017 * seqno' < seqno or 1019 * seqno = seqno' and metric < metric'. 1021 Note that the feasibility condition considers the metric advertised 1022 by the neighbour, not the route's metric; hence, a fluctuation in a 1023 neighbour's cost cannot render a selected route unfeasible. Note 1024 further that retractions (updates with infinite metric) are always 1025 feasible, since they cannot possibly cause a routing loop. 1027 3.5.2. Metric Computation 1029 A route's metric is computed from the metric advertised by the 1030 neighbour and the neighbour's link cost. Just like cost computation, 1031 metric computation is considered a local policy matter; as far as 1032 Babel is concerned, the function M(c, m) used for computing a metric 1033 from a locally computed link cost c and the metric m advertised by a 1034 neighbour MUST only satisfy the following conditions: 1036 o if c is infinite, then M(c, m) is infinite; 1038 o M is strictly monotonic: M(c, m) > m. 1040 Additionally, the metric SHOULD satisfy the following condition: 1042 o M is left-distributive: if m <= m', then M(c, m) <= M(c, m'). 1044 Note that while strict monotonicity is essential to the integrity of 1045 the network (persistent routing loops may arise if it is not 1046 satisfied), left distributivity is not: if it is not satisfied, Babel 1047 will still converge to a loop-free configuration, but might not reach 1048 a global optimum (in fact, a global optimum may not even exist). 1050 As with cost computation, not all strategies for computing route 1051 metrics will give good results. In particular, some metrics are more 1052 likely than others to lead to routing instabilities (route flapping). 1053 In Appendix A.3, we give an number of examples of strictly monotonic, 1054 left-distributive routing metrics that are known to work well in 1055 practice. See also Appendix C, which describes a useful way to make 1056 the metric computation configurable by a network administrator. 1058 3.5.3. Route Acquisition 1060 When a Babel node receives an update (prefix, plen, router-id, seqno, 1061 metric) from a neighbour neigh, it checks whether it already has a 1062 route table entry indexed by (prefix, plen, neigh). 1064 If no such entry exists: 1066 o if the update is unfeasible, it MAY be ignored; 1068 o if the metric is infinite (the update is a retraction of a route 1069 we do not know about), the update is ignored; 1071 o otherwise, a new entry is created in the route table, indexed by 1072 (prefix, plen, neigh), with source equal to (prefix, plen, router- 1073 id), seqno equal to seqno and an advertised metric equal to the 1074 metric carried by the update. 1076 If such an entry exists: 1078 o if the entry is currently selected, the update is unfeasible, and 1079 the router-id of the update is equal to the router-id of the 1080 entry, then the update MAY be ignored; 1082 o otherwise, the entry's sequence number, advertised metric, metric, 1083 and router-id are updated and, if the advertised metric is not 1084 infinite, the route's expiry timer is reset to a small multiple of 1085 the Interval value included in the update (see "Route Hold time" 1086 in Appendix B for suggested values). If the update is unfeasible, 1087 then the (now unfeasible) entry MUST be immediately unselected. 1088 If the update caused the router-id of the entry to change, an 1089 update (possibly a retraction) MUST be sent in a timely manner as 1090 described in Section 3.7.2. 1092 Note that the route table may contain unfeasible routes, either 1093 because they were created by an unfeasible update or due to a metric 1094 fluctuation. Such routes are never selected, since they are not 1095 known to be loop-free; should all the feasible routes become 1096 unusable, however, the unfeasible routes can be made feasible and 1097 therefore possible to select by sending requests along them (see 1098 Section 3.8.2). 1100 When a route's expiry timer triggers, the behaviour depends on 1101 whether the route's metric is finite. If the metric is finite, it is 1102 set to infinity and the expiry timer is reset. If the metric is 1103 already infinite, the route is flushed from the route table. 1105 After the route table is updated, the route selection procedure 1106 (Section 3.6) is run. 1108 3.5.4. Hold Time 1110 When a prefix P is retracted, because all routes are unfeasible or 1111 have an infinite metric (whether due to the expiry timer or to other 1112 reasons), and a shorter prefix P' that covers P is reachable, P' 1113 cannot in general be used for routing packets destined to P without 1114 running the risk of creating a routing loop (Section 2.8). 1116 To avoid this issue, whenever a prefix P is retracted, a route table 1117 entry with infinite metric is maintained as described in 1118 Section 3.5.3 above. As long as this entry is maintained, packets 1119 destined to an address within P MUST NOT be forwarded by following a 1120 route for a shorter prefix. This entry is removed as soon as a 1121 finite-metric update for prefix P is received and the resulting route 1122 selected. If no such update is forthcoming, the infinite metric 1123 entry SHOULD be maintained at least until it is guaranteed that no 1124 neighbour has selected the current node as next-hop for prefix P. 1125 This can be achieved by either: 1127 o waiting until the route's expiry timer has expired 1128 (Section 3.5.3); 1130 o sending a retraction with an acknowledgment request (Section 3.3) 1131 to every reachable neighbour that has not explicitly retracted 1132 prefix P, and waiting for all acknowledgments. 1134 The former option is simpler and ensures that at that point, any 1135 routes for prefix P pointing at the current node have expired. 1136 However, since the expiry time can be as high as a few minutes, doing 1137 that prevents automatic aggregation by creating spurious black-holes 1138 for aggregated routes. The latter option is RECOMMENDED as it 1139 dramatically reduces the time for which a prefix is unreachable in 1140 the presence of aggregated routes. 1142 3.6. Route Selection 1144 Route selection is the process by which a single route for a given 1145 prefix is selected to be used for forwarding packets and to be re- 1146 advertised to a node's neighbours. 1148 Babel is designed to allow flexible route selection policies. As far 1149 as the algorithm's correctness is concerned, the route selection 1150 policy MUST only satisfy the following properties: 1152 o a route with infinite metric (a retracted route) is never 1153 selected; 1155 o an unfeasible route is never selected. 1157 Route selection MUST NOT take seqnos into account: a route MUST NOT 1158 be preferred just because it carries a higher (more recent) seqno. 1159 Doing otherwise would cause route oscillation while a new seqno 1160 propagates across the network, and might create persistent blackholes 1161 if the metric being used is not left-distributive (Section 3.5.2). 1163 The obvious route selection strategy is to choose for each 1164 destination the feasible route with lowest metric. However, with 1165 continuously varying costs and metrics this simple strategy will in 1166 some cases lead to route oscillations. See Appendix A.4 for a 1167 discussion of the issues and suggested strategies for dealing with 1168 them. 1170 After the route selection procedure is run, triggered updates 1171 (Section 3.7.2) and requests (Section 3.8.2) are sent. 1173 3.7. Sending Updates 1175 A Babel speaker advertises to its neighbours its set of selected 1176 routes. Normally, this is done by sending one or more multicast 1177 packets containing Update TLVs on all of its connected interfaces; 1178 however, on link technologies where multicast is significantly more 1179 expensive than unicast, a node MAY choose to send multiple copies of 1180 updates in unicast packets, especially when the number of neighbours 1181 is small. 1183 Additionally, in order to ensure that any black-holes are reliably 1184 cleared in a timely manner, a Babel node may send retractions 1185 (updates with an infinite metric) for any recently retracted 1186 prefixes. 1188 If an update is for a route injected into the Babel domain by the 1189 local node (e.g., it carries the address of a local interface, the 1190 prefix of a directly attached network, or a prefix redistributed from 1191 a different routing protocol), the router-id is set to the local 1192 node's router-id, the metric is set to some arbitrary finite value 1193 (typically 0), and the seqno is set to the local router's sequence 1194 number. 1196 If an update is for a route learned from another Babel speaker, the 1197 router-id and sequence number are copied from the route table entry, 1198 and the metric is computed as specified in Section 3.5.2. 1200 3.7.1. Periodic Updates 1202 Every Babel speaker MUST advertise each of its selected routes on 1203 every interface, at least once every Update interval. Since Babel 1204 doesn't suffer from routing loops (there is no "counting to 1205 infinity") and relies heavily on triggered updates (Section 3.7.2), 1206 this full dump only needs to happen infrequently (see Appendix B for 1207 suggested intervals). 1209 3.7.2. Triggered Updates 1211 In addition to periodic routing updates, a Babel speaker sends 1212 unscheduled, or triggered, updates in order to inform its neighbours 1213 of a significant change in the network topology. 1215 A change of router-id for the selected route to a given prefix may be 1216 indicative of a routing loop in formation; hence, whenever it changes 1217 the selected router-id for a given destination, a node MUST send an 1218 update as an urgent TLV (as defined in Section 3.1). Additionally, 1219 it SHOULD make a reasonable attempt at ensuring that all reachable 1220 neighbours receive this update. 1222 There are two strategies for ensuring that. If the number of 1223 neighbours is small, then it is reasonable to send the update 1224 together with an acknowledgment request; the update is resent until 1225 all neighbours have acknowledged the packet, up to some number of 1226 times. If the number of neighbours is large, however, requesting 1227 acknowledgments from all of them might cause a non-negligible amount 1228 of network traffic; in that case, it may be preferable to simply 1229 repeat the update some reasonable number of times (say, 3 for 1230 wireless and 2 for wired links). The number of copies MUST NOT 1231 exceed 5, and the copies SHOULD be separated by a small delay, as 1232 described in Section 3.1. 1234 A route retraction is somewhat less worrying: if the route retraction 1235 doesn't reach all neighbours, a black-hole might be created, which, 1236 unlike a routing loop, does not endanger the integrity of the 1237 network. When a route is retracted, a node SHOULD send a triggered 1238 update and SHOULD make a reasonable attempt at ensuring that all 1239 neighbours receive this retraction. 1241 Finally, a node MAY send a triggered update when the metric for a 1242 given prefix changes in a significant manner, due to a received 1243 update, because a link's cost has changed, or because a different 1244 next hop has been selected. A node SHOULD NOT send triggered updates 1245 for other reasons, such as when there is a minor fluctuation in a 1246 route's metric, when the selected next hop changes, or to propagate a 1247 new sequence number (except to satisfy a request, as specified in 1248 Section 3.8). 1250 3.7.3. Maintaining Feasibility Distances 1252 Before sending an update (prefix, plen, router-id, seqno, metric) 1253 with finite metric (i.e., not a route retraction), a Babel node 1254 updates the feasibility distance maintained in the source table. 1255 This is done as follows. 1257 If no entry indexed by (prefix, plen, router-id) exists in the source 1258 table, then one is created with value (prefix, plen, router-id, 1259 seqno, metric). 1261 If an entry (prefix, plen, router-id, seqno', metric') exists, then 1262 it is updated as follows: 1264 o if seqno > seqno', then seqno' := seqno, metric' := metric; 1266 o if seqno = seqno' and metric' > metric, then metric' := metric; 1268 o otherwise, nothing needs to be done. 1270 The garbage-collection timer for the entry is then reset. Note that 1271 the feasibility distance is not updated and the garbage-collection 1272 timer is not reset when a retraction (an update with infinite metric) 1273 is sent. 1275 When the garbage-collection timer expires, the entry is removed from 1276 the source table. 1278 3.7.4. Split Horizon 1280 When running over a transitive, symmetric link technology, e.g., a 1281 point-to-point link or a wired LAN technology such as Ethernet, a 1282 Babel node SHOULD use an optimisation known as split horizon. When 1283 split horizon is used on a given interface, a routing update for 1284 prefix P is not sent on the particular interface over which the 1285 selected route towards prefix P was learnt. 1287 Split horizon SHOULD NOT be applied to an interface unless the 1288 interface is known to be symmetric and transitive; in particular, 1289 split horizon is not applicable to decentralised wireless link 1290 technologies (e.g., IEEE 802.11 in ad hoc mode) when routing updates 1291 are sent over multicast. 1293 3.8. Explicit Requests 1295 In normal operation, a node's route table is populated by the regular 1296 and triggered updates sent by its neighbours. Under some 1297 circumstances, however, a node sends explicit requests in order to 1298 cause a resynchronisation with the source after a mobility event or 1299 to prevent a route from spuriously expiring. 1301 The Babel protocol provides two kinds of explicit requests: route 1302 requests, which simply request an update for a given prefix, and 1303 seqno requests, which request an update for a given prefix with a 1304 specific sequence number. The former are never forwarded; the latter 1305 are forwarded if they cannot be satisfied by the receiver. 1307 3.8.1. Handling Requests 1309 Upon receiving a request, a node either forwards the request or sends 1310 an update in reply to the request, as described in the following 1311 sections. If this causes an update to be sent, the update is either 1312 sent to a multicast address on the interface on which the request was 1313 received, or to the unicast address of the neighbour that sent the 1314 request. 1316 The exact behaviour is different for route requests and seqno 1317 requests. 1319 3.8.1.1. Route Requests 1321 When a node receives a route request for a given prefix, it checks 1322 its route table for a selected route to this exact prefix. If such a 1323 route exists, it MUST send an update (over unicast or over 1324 multicast); if such a route does not exist, it MUST send a retraction 1325 for that prefix. 1327 When a node receives a wildcard route request, it SHOULD send a full 1328 route table dump. Full route dumps SHOULD be rate-limited, 1329 especially if they are sent over multicast. 1331 3.8.1.2. Seqno Requests 1333 When a node receives a seqno request for a given router-id and 1334 sequence number, it checks whether its route table contains a 1335 selected entry for that prefix. If a selected route for the given 1336 prefix exists, it has finite metric, and either the router-ids are 1337 different or the router-ids are equal and the entry's sequence number 1338 is no smaller (modulo 2^16) than the requested sequence number, the 1339 node MUST send an update for the given prefix. If the router-ids 1340 match but the requested seqno is larger (modulo 2^16) than the route 1341 entry's, the node compares the router-id against its own router-id. 1342 If the router-id is its own, then it increases its sequence number by 1343 1 (modulo 2^16) and sends an update. A node MUST NOT increase its 1344 sequence number by more than 1 in reaction to a single seqno request. 1346 Otherwise, if the requested router-id is not its own, the received 1347 node consults the hop count field of the request. If the hop count 1348 is 2 or more, and the node is advertising the prefix to its 1349 neighbours, the node selects a neighbour to forward the request to as 1350 follows: 1352 o if the node has one or more feasible routes toward the requested 1353 prefix with a next hop that is not the requesting node, then the 1354 node MUST forward the request to the next hop of one such route; 1356 o otherwise, if the node has one or more (not feasible) routes to 1357 the requested prefix with a next hop that is not the requesting 1358 node, then the node SHOULD forward the request to the next hop of 1359 one such route. 1361 In order to actually forward the request, the node decrements the hop 1362 count and sends the request in a unicast packet destined to the 1363 selected neighbour. The forwarded request SHOULD be sent as an 1364 urgent TLV (as defined in Section 3.1). 1366 A node SHOULD maintain a list of recently forwarded seqno requests 1367 and forward the reply (an update with a seqno sufficiently large to 1368 satisfy the request) as an urgent TLV (as defined in Section 3.1). A 1369 node SHOULD compare every incoming seqno request against its list of 1370 recently forwarded seqno requests and avoid forwarding it if it is 1371 redundant (i.e., if it has recently sent a request with the same 1372 prefix, router-id and a seqno that is not smaller modulo 2^16). 1374 Since the request-forwarding mechanism does not necessarily obey the 1375 feasibility condition, it may get caught in routing loops; hence, 1376 requests carry a hop count to limit the time during which they remain 1377 in the network. However, since requests are only ever forwarded as 1378 unicast packets, the initial hop count need not be kept particularly 1379 low, and performing an expanding horizon search is not necessary. A 1380 single request MUST NOT be duplicated: it MUST NOT be forwarded to a 1381 multicast address, and it MUST NOT be forwarded to multiple 1382 neighbours. However, if a seqno request is resent by its originator, 1383 the subsequent copies may be forwarded to a different neighbour than 1384 the initial one. 1386 3.8.2. Sending Requests 1388 A Babel node MAY send a route or seqno request at any time, to a 1389 multicast or a unicast address; there is only one case when 1390 originating requests is required (Section 3.8.2.1). 1392 3.8.2.1. Avoiding Starvation 1394 When a route is retracted or expires, a Babel node usually switches 1395 to another feasible route for the same prefix. It may be the case, 1396 however, that no such routes are available. 1398 A node that has lost all feasible routes to a given destination but 1399 still has unexpired unfeasible routes to that destination MUST send a 1400 seqno request; if it doesn't have any such routes, it MAY still send 1401 a seqno request. The router-id of the request is set to the router- 1402 id of the route that it has just lost, and the requested seqno is the 1403 value contained in the source table plus 1. The request carries a 1404 hop count, which is used as a last-resort mechanism to ensure that it 1405 eventually vanishes from the network; it MAY be set to any value that 1406 is larger than the diameter of the network (64 is a suitable default 1407 value). 1409 If the node has any (unfeasible) routes to the requested destination, 1410 then it MUST send the request to at least one of the next-hop 1411 neighbours that advertised these routes, and SHOULD send it to all of 1412 them; in any case, it MAY send the request to any other neighbours, 1413 whether they advertise a route to the requested destination or not. 1414 A simple implementation strategy is therefore to unconditionally 1415 multicast the request over all interfaces. 1417 Similar requests will be sent by other nodes that are affected by the 1418 route's loss. If the network is still connected, and assuming no 1419 packet loss, then at least one of these requests will be forwarded to 1420 the source, resulting in a route being advertised with a new sequence 1421 number. (Due to duplicate suppression, only a small number of such 1422 requests are expected to actually reach the source.) 1424 In order to compensate for packet loss, a node SHOULD repeat such a 1425 request a small number of times if no route becomes feasible within a 1426 short time (see "Request Timeout" in Appendix B for suggested 1427 values). In the presence of heavy packet loss, however, all such 1428 requests might be lost; in that case, the mechanism in the next 1429 section will eventually ensure that a new seqno is received. 1431 3.8.2.2. Dealing with Unfeasible Updates 1433 When a route's metric increases, a node might receive an unfeasible 1434 update for a route that it has currently selected. As specified in 1435 Section 3.5.1, the receiving node will either ignore the update or 1436 unselect the route. 1438 In order to keep routes from spuriously expiring because they have 1439 become unfeasible, a node SHOULD send a unicast seqno request when it 1440 receives an unfeasible update for a route that is currently selected. 1441 The requested sequence number is computed from the source table as in 1442 Section 3.8.2.1 above. 1444 Additionally, since metric computation does not necessarily coincide 1445 with the delay in propagating updates, a node might receive an 1446 unfeasible update from a currently unselected neighbour that is 1447 preferable to the currently selected route (e.g., because it has a 1448 much smaller metric); in that case, the node SHOULD send a unicast 1449 seqno request to the neighbour that advertised the preferable update. 1451 3.8.2.3. Preventing Routes from Expiring 1453 In normal operation, a route's expiry timer never triggers: since a 1454 route's hold time is computed from an explicit interval included in 1455 Update TLVs, a new update (possibly a retraction) should arrive in 1456 time to prevent a route from expiring. 1458 In the presence of packet loss, however, it may be the case that no 1459 update is successfully received for an extended period of time, 1460 causing a route to expire. In order to avoid such spurious expiry, 1461 shortly before a selected route expires, a Babel node SHOULD send a 1462 unicast route request to the neighbour that advertised this route; 1463 since nodes always send either updates or retractions in response to 1464 non-wildcard route requests (Section 3.8.1.1), this will usually 1465 result in the route being either refreshed or retracted. 1467 4. Protocol Encoding 1469 A Babel packet MUST be sent as the body of a UDP datagram, with 1470 network-layer hop count set to 1, destined to a well-known multicast 1471 address or to a unicast address, over IPv4 or IPv6; in the case of 1472 IPv6, these addresses are link-local. Both the source and 1473 destination UDP port are set to a well-known port number. A Babel 1474 packet MUST be silently ignored unless its source address is either a 1475 link-local IPv6 address or an IPv4 address belonging to the local 1476 network, and its source port is the well-known Babel port. It MAY be 1477 silently ignored if its destination address is a global IPv6 address. 1479 In order to minimise the number of packets being sent while avoiding 1480 lower-layer fragmentation, a Babel node SHOULD maximise the size of 1481 the packets it sends, up to the outgoing interface's MTU adjusted for 1482 lower-layer headers (28 octets for UDP over IPv4, 48 octets for UDP 1483 over IPv6). It MUST NOT send packets larger than the attached 1484 interface's MTU adjusted for lower-layer headers or 512 octets, 1485 whichever is larger, but not exceeding 2^16 - 1 adjusted for lower- 1486 layer headers. Every Babel speaker MUST be able to receive packets 1487 that are as large as any attached interface's MTU adjusted for lower- 1488 layer headers or 512 octets, whichever is larger. Babel packets MUST 1489 NOT be sent in IPv6 Jumbograms. 1491 4.1. Data Types 1493 4.1.1. Interval 1495 Relative times are carried as 16-bit values specifying a number of 1496 centiseconds (hundredths of a second). This allows times up to 1497 roughly 11 minutes with a granularity of 10ms, which should cover all 1498 reasonable applications of Babel. 1500 4.1.2. Router-Id 1502 A router-id is an arbitrary 8-octet value. A router-id MUST NOT 1503 consist of either all binary zeroes (0000000000000000 hexadecimal) or 1504 all binary ones (FFFFFFFFFFFFFFFF hexadecimal). 1506 4.1.3. Address 1508 Since the bulk of the protocol is taken by addresses, multiple ways 1509 of encoding addresses are defined. Additionally, within Update TLVs 1510 a common subnet prefix may be omitted when multiple addresses are 1511 sent in a single packet -- this is known as address compression 1512 (Section 4.6.9). 1514 Address encodings: 1516 o AE 0: wildcard address. The value is 0 octets long. 1518 o AE 1: IPv4 address. Compression is allowed. 4 octets or less. 1520 o AE 2: IPv6 address. Compression is allowed. 16 octets or less. 1522 o AE 3: link-local IPv6 address. Compression is not allowed. The 1523 value is 8 octets long, a prefix of fe80::/64 is implied. 1525 The address family associated to an address encoding is either IPv4 1526 or IPv6; it is undefined for AE 0, IPv4 for AE 1, and IPv6 for AEs 2 1527 and 3. 1529 4.1.4. Prefixes 1531 A network prefix is encoded just like a network address, but it is 1532 stored in the smallest number of octets that are enough to hold the 1533 significant bits (up to the prefix length). 1535 4.2. Packet Format 1537 A Babel packet consists of a 4-octet header, followed by a sequence 1538 of TLVs (the packet body), optionally followed by a second sequence 1539 of TLVs (the packet trailer). The format is designed to be 1540 extensible; see Appendix D for extensibility considerations. 1542 0 1 2 3 1543 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 1544 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1545 | Magic | Version | Body length | 1546 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1547 | Packet Body ... 1548 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1549 | Packet Trailer... 1550 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1552 Fields : 1554 Magic The arbitrary but carefully chosen value 42 (decimal); 1555 packets with a first octet different from 42 MUST be 1556 silently ignored. 1558 Version This document specifies version 2 of the Babel protocol. 1559 Packets with a second octet different from 2 MUST be 1560 silently ignored. 1562 Body length The length in octets of the body following the packet 1563 header (excluding the Magic, Version and Body length 1564 fields, and excluding the packet trailer). 1566 Packet Body The packet body; a sequence of TLVs. 1568 Packet Trailer The packet trailer; another sequence of TLVs. 1570 The packet body and trailer are both sequences of TLVs. The packet 1571 body is the normal place to store TLVs; the packet trailer only 1572 contains specialised TLVs that do not need to be protected by 1573 cryptographic security mechanisms. When parsing the trailer, the 1574 receiver MUST ignore any TLV unless its definition explicitly states 1575 that it is allowed to appear there. Among the TLVs defined in this 1576 document, only Pad1 and PadN are allowed in the trailer; since these 1577 TLVs are ignored in any case, an implementation MAY silently ignore 1578 the packet trailer without even parsing it, unless it implements at 1579 least one protocol extension that defines TLVs that are allowed to 1580 appear in the trailer. 1582 4.3. TLV Format 1584 With the exception of Pad1, all TLVs have the following structure: 1586 0 1 2 3 1587 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 1588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1589 | Type | Length | Payload... 1590 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1592 Fields : 1594 Type The type of the TLV. 1596 Length The length of the body in octets, exclusive of the Type and 1597 Length fields. 1599 Payload The TLV payload, which consists of a body and, for selected 1600 TLV types, an optional list of sub-TLVs. 1602 TLVs with an unknown type value MUST be silently ignored. 1604 4.4. Sub-TLV Format 1606 Every TLV carries an explicit length in its header; however, most 1607 TLVs are self-terminating, in the sense that it is possible to 1608 determine the length of the body without reference to the explicit 1609 Length field. If a TLV has a self-terminating format, then the space 1610 between the natural size of the TLV and the size announced in the 1611 Length field may be used to store a sequence of sub-TLVs. 1613 Sub-TLVs have the same structure as TLVs. With the exception of 1614 Pad1, all TLVs have the following structure: 1616 0 1 2 3 1617 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 1618 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1619 | Type | Length | Body... 1620 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1622 Fields : 1624 Type The type of the sub-TLV. 1626 Length The length of the body in octets, exclusive of the Type and 1627 Length fields. 1629 Body The sub-TLV body, the interpretation of which depends on 1630 both the type of the sub-TLV and the type of the TLV within 1631 which it is embedded. 1633 The most-significant bit of the sub-TLV type (the bit with value 80 1634 hexadecimal), is called the mandatory bit; in other words, sub-TLV 1635 types 128 through 255 have the mandatory bit set. This bit indicates 1636 how to handle unknown sub-TLVs. If the mandatory bit is not set, 1637 then an unknown sub-TLV MUST be silently ignored, and the rest of the 1638 TLV is processed normally. If the mandatory bit is set, then the 1639 whole enclosing TLV MUST be silently ignored (except for updating the 1640 parser state by a Router-Id, Next-Hop or Update TLV, as described in 1641 the next section). 1643 4.5. Parser state and encoding of updates 1645 In a large network, the bulk of Babel traffic consists of route 1646 updates; hence, some care has been given to encoding them 1647 efficiently. The data conceptually contained in an update 1648 (Section 3.5) is split into three pieces: 1650 o the prefix, seqno and metric are contained in the Update TLV 1651 itself (Section 4.6.9); 1653 o the router-id is taken from Router-Id TLV that precedes the Update 1654 TLV, and may be shared among multiple Update TLVs (Section 4.6.7); 1656 o the next hop is taken either from the source-address of the 1657 network-layer packet that contains the Babel packet, or from an 1658 explicit Next-Hop TLV (Section 4.6.8). 1660 In addition to the above, an Update TLV can omit a prefix of the 1661 prefix being announced, which is then extracted from the preceding 1662 Update TLV in the same address family (IPv4 or IPv6). Finally, as a 1663 special optimisation for the case when a router-id coincides with the 1664 interface-id part of an IPv6 address, Router-ID TLV itself may be 1665 omitted and the router-id derived derived from the low-order bits of 1666 the advertised prefix (Section 4.6.9). 1668 In order to implement these compression techniques, Babel uses a 1669 stateful parser: a TLV may refer to data from a previous TLV. The 1670 parser state consists of the following pieces of data: 1672 o for each address encoding that allows compression, the current 1673 default prefix; this is undefined at the start of the packet, and 1674 is updated by each Update TLV with the Prefix flag set 1675 (Section 4.6.9); 1677 o for each address family (IPv4 or IPv6), the current next-hop; this 1678 is the source address of the enclosing packet for the matching 1679 address family at the start of a packet, and is updated by each 1680 Next-Hop TLV (Section 4.6.8); 1682 o the current router-id; this is undefined at the start of the 1683 packet, and is updated by each Router-ID TLV (Section 4.6.7) and 1684 by each Update TLV with Router-Id flag set. 1686 Since the parser state must be identical across implementations, it 1687 is updated before checking for mandatory sub-TLVs: parsing a TLV MUST 1688 update the parser state even if the TLV is otherwise ignored due to 1689 an unknown mandatory sub-TLV or for any other reason. 1691 None of the TLVs that modify the parser state are allowed in the 1692 packet trailer; hence, an implementation may choose to use a 1693 dedicated stateless parser to parse the packet trailer. 1695 4.6. Details of Specific TLVs 1697 4.6.1. Pad1 1699 0 1700 0 1 2 3 4 5 6 7 1701 +-+-+-+-+-+-+-+-+ 1702 | Type = 0 | 1703 +-+-+-+-+-+-+-+-+ 1705 Fields : 1707 Type Set to 0 to indicate a Pad1 TLV. 1709 This TLV is silently ignored on reception. It is allowed in the 1710 packet trailer. 1712 4.6.2. PadN 1714 0 1 2 3 1715 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 1716 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1717 | Type = 1 | Length | MBZ... 1718 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 1720 Fields : 1722 Type Set to 1 to indicate a PadN TLV. 1724 Length The length of the body in octets, exclusive of the Type and 1725 Length fields. 1727 MBZ Must be zero, set to 0 on transmission. 1729 This TLV is silently ignored on reception. It is allowed in the 1730 packet trailer. 1732 4.6.3. Acknowledgment Request 1734 0 1 2 3 1735 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 1736 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1737 | Type = 2 | Length | Reserved | 1738 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1739 | Opaque | Interval | 1740 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1742 This TLV requests that the receiver send an Acknowledgment TLV within 1743 the number of centiseconds specified by the Interval field. 1745 Fields : 1747 Type Set to 2 to indicate an Acknowledgment Request TLV. 1749 Length The length of the body in octets, exclusive of the Type and 1750 Length fields. 1752 Reserved Sent as 0 and MUST be ignored on reception. 1754 Opaque An arbitrary value that will be echoed in the receiver's 1755 Acknowledgment TLV. 1757 Interval A time interval in centiseconds after which the sender will 1758 assume that this packet has been lost. This MUST NOT be 0. 1759 The receiver MUST send an Acknowledgment TLV before this 1760 time has elapsed (with a margin allowing for propagation 1761 time). 1763 This TLV is self-terminating, and allows sub-TLVs. 1765 4.6.4. Acknowledgment 1767 0 1 2 3 1768 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 1769 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1770 | Type = 3 | Length | Opaque | 1771 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1773 This TLV is sent by a node upon receiving an Acknowledgment Request. 1775 Fields : 1777 Type Set to 3 to indicate an Acknowledgment TLV. 1779 Length The length of the body in octets, exclusive of the Type and 1780 Length fields. 1782 Opaque Set to the Opaque value of the Acknowledgment Request that 1783 prompted this Acknowledgment. 1785 Since Opaque values are not globally unique, this TLV MUST be sent to 1786 a unicast address. 1788 This TLV is self-terminating, and allows sub-TLVs. 1790 4.6.5. Hello 1792 0 1 2 3 1793 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 1794 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1795 | Type = 4 | Length | Flags | 1796 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1797 | Seqno | Interval | 1798 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1800 This TLV is used for neighbour discovery and for determining a 1801 neighbour's reception cost. 1803 Fields : 1805 Type Set to 4 to indicate a Hello TLV. 1807 Length The length of the body in octets, exclusive of the Type and 1808 Length fields. 1810 Flags The individual bits of this field specify special handling 1811 of this TLV (see below). 1813 Seqno If the Unicast flag is set, this is the value of the 1814 sending node's outgoing Unicast Hello seqno for this 1815 neighbour. Otherwise, it is the sending node's outgoing 1816 Multicast Hello seqno for this interface. 1818 Interval If non-zero, this is an upper bound, expressed in 1819 centiseconds, on the time after which the sending node will 1820 send a new scheduled Hello TLV with the same setting of the 1821 Unicast flag. If this is 0, then this Hello represents an 1822 unscheduled Hello, and doesn't carry any new information 1823 about times at which Hellos are sent. 1825 The Flags field is interpreted as follows: 1827 0 1 1828 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 1829 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1830 |U|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 1831 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1833 o U (Unicast) flag (8000 hexadecimal): if set, then this Hello 1834 represents a Unicast Hello, otherwise it represents a Multicast 1835 Hello; 1837 o X: all other bits MUST be sent as 0 and silently ignored on 1838 reception. 1840 Every time a Hello is sent, the corresponding seqno counter MUST be 1841 incremented. Since there is a single seqno counter for all the 1842 Multicast Hellos sent by a given node over a given interface, if the 1843 Unicast flag is not set, this TLV MUST be sent to all neighbors on 1844 this link, which can be achieved by sending to a multicast 1845 destination, or by sending multiple packets to the unicast addresses 1846 of all reachable neighbours. Conversely, if the Unicast flag is set, 1847 this TLV MUST be sent to a single neighbour, which can achieved by 1848 sending to a unicast destination. In order to avoid large 1849 discontinuities in link quality, multiple Hello TLVs SHOULD NOT be 1850 sent in the same packet. 1852 This TLV is self-terminating, and allows sub-TLVs. 1854 4.6.6. IHU 1856 0 1 2 3 1857 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 1858 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1859 | Type = 5 | Length | AE | Reserved | 1860 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1861 | Rxcost | Interval | 1862 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1863 | Address... 1864 +-+-+-+-+-+-+-+-+-+-+-+- 1866 An IHU ("I Heard You") TLV is used for confirming bidirectional 1867 reachability and carrying a link's transmission cost. 1869 Fields : 1871 Type Set to 5 to indicate an IHU TLV. 1873 Length The length of the body in octets, exclusive of the Type and 1874 Length fields. 1876 AE The encoding of the Address field. This should be 1 or 3 1877 in most cases. As an optimisation, it MAY be 0 if the TLV 1878 is sent to a unicast address, if the association is over a 1879 point-to-point link, or when bidirectional reachability is 1880 ascertained by means outside of the Babel protocol. 1882 Reserved Sent as 0 and MUST be ignored on reception. 1884 Rxcost The rxcost according to the sending node of the interface 1885 whose address is specified in the Address field. The value 1886 FFFF hexadecimal (infinity) indicates that this interface 1887 is unreachable. 1889 Interval An upper bound, expressed in centiseconds, on the time 1890 after which the sending node will send a new IHU; this MUST 1891 NOT be 0. The receiving node will use this value in order 1892 to compute a hold time for this symmetric association. 1894 Address The address of the destination node, in the format 1895 specified by the AE field. Address compression is not 1896 allowed. 1898 Conceptually, an IHU is destined to a single neighbour. However, IHU 1899 TLVs contain an explicit destination address, and MAY be sent to a 1900 multicast address, as this allows aggregation of IHUs destined to 1901 distinct neighbours into a single packet and avoids the need for an 1902 ARP or Neighbour Discovery exchange when a neighbour is not being 1903 used for data traffic. 1905 IHU TLVs with an unknown value in the AE field MUST be silently 1906 ignored. 1908 This TLV is self-terminating, and allows sub-TLVs. 1910 4.6.7. Router-Id 1912 0 1 2 3 1913 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 1914 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1915 | Type = 6 | Length | Reserved | 1916 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1917 | | 1918 + Router-Id + 1919 | | 1920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1922 A Router-Id TLV establishes a router-id that is implied by subsequent 1923 Update TLVs, as described in Section 4.5. This TLV sets the router- 1924 id even if it is otherwise ignored due to an unknown mandatory sub- 1925 TLV. 1927 Fields : 1929 Type Set to 6 to indicate a Router-Id TLV. 1931 Length The length of the body in octets, exclusive of the Type and 1932 Length fields. 1934 Reserved Sent as 0 and MUST be ignored on reception. 1936 Router-Id The router-id for routes advertised in subsequent Update 1937 TLVs. This MUST NOT consist of all zeroes or all ones. 1939 This TLV is self-terminating, and allows sub-TLVs. 1941 4.6.8. Next Hop 1943 0 1 2 3 1944 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 1945 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1946 | Type = 7 | Length | AE | Reserved | 1947 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1948 | Next hop... 1949 +-+-+-+-+-+-+-+-+-+-+-+- 1950 A Next Hop TLV establishes a next-hop address for a given address 1951 family (IPv4 or IPv6) that is implied in subsequent Update TLVs, as 1952 described in Section 4.5. This TLV sets up the next-hop for 1953 subsequent Update TLVs even if it is otherwise ignored due to an 1954 unknown mandatory sub-TLV. 1956 Fields : 1958 Type Set to 7 to indicate a Next Hop TLV. 1960 Length The length of the body in octets, exclusive of the Type and 1961 Length fields. 1963 AE The encoding of the Address field. This SHOULD be 1 (IPv4) 1964 or 3 (link-local IPv6), and MUST NOT be 0. 1966 Reserved Sent as 0 and MUST be ignored on reception. 1968 Next hop The next-hop address advertised by subsequent Update TLVs, 1969 for this address family. 1971 When the address family matches the network-layer protocol that this 1972 packet is transported over, a Next Hop TLV is not needed: in the 1973 absence of a Next Hop TLV in a given address family, the next hop 1974 address is taken to be the source address of the packet. 1976 Next Hop TLVs with an unknown value for the AE field MUST be silently 1977 ignored. 1979 This TLV is self-terminating, and allows sub-TLVs. 1981 4.6.9. Update 1983 0 1 2 3 1984 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 1985 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1986 | Type = 8 | Length | AE | Flags | 1987 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1988 | Plen | Omitted | Interval | 1989 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1990 | Seqno | Metric | 1991 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1992 | Prefix... 1993 +-+-+-+-+-+-+-+-+-+-+-+- 1995 An Update TLV advertises or retracts a route. As an optimisation, it 1996 can optionally have the side effect of establishing a new implied 1997 router-id and a new default prefix, as described in Section 4.5. 1999 Fields : 2001 Type Set to 8 to indicate an Update TLV. 2003 Length The length of the body in octets, exclusive of the Type and 2004 Length fields. 2006 AE The encoding of the Prefix field. 2008 Flags The individual bits of this field specify special handling 2009 of this TLV (see below). 2011 Plen The length in bits of the advertised prefix. If AE is 3 2012 (link-local IPv6), Omitted MUST be 0. 2014 Omitted The number of octets that have been omitted at the 2015 beginning of the advertised prefix and that should be taken 2016 from a preceding Update TLV in the same address family with 2017 the Prefix flag set. 2019 Interval An upper bound, expressed in centiseconds, on the time 2020 after which the sending node will send a new update for 2021 this prefix. This MUST NOT be 0. The receiving node will 2022 use this value to compute a hold time for the route table 2023 entry. The value FFFF hexadecimal (infinity) expresses 2024 that this announcement will not be repeated unless a 2025 request is received (Section 3.8.2.3). 2027 Seqno The originator's sequence number for this update. 2029 Metric The sender's metric for this route. The value FFFF 2030 hexadecimal (infinity) means that this is a route 2031 retraction. 2033 Prefix The prefix being advertised. This field's size is 2034 (Plen/8 - Omitted) rounded upwards. 2036 The Flags field is interpreted as follows: 2038 0 1 2 3 4 5 6 7 2039 +-+-+-+-+-+-+-+-+ 2040 |P|R|X|X|X|X|X|X| 2041 +-+-+-+-+-+-+-+-+ 2043 o P (Prefix) flag (80 hexadecimal): if set, then this Update 2044 establishes a new default prefix for subsequent Update TLVs with a 2045 matching address encoding within the same packet, even if this TLV 2046 is otherwise ignored due to an unknown mandatory sub-TLV; 2048 o R (Router-Id) flag (40 hexadecimal): if set, then this TLV 2049 establishes a new default router-id for this TLV and subsequent 2050 Update TLVs in the same packet, even if this TLV is otherwise 2051 ignored due to an unknown mandatory sub-TLV. This router-id is 2052 computed from the first address of the advertised prefix as 2053 follows: 2055 * if the length of the address is 8 octets or more, then the new 2056 router-id is taken from the 8 last octets of the address; 2058 * if the length of the address is smaller than 8 octets, then the 2059 new router-id consists of the required number of zero octets 2060 followed by the address, i.e., the address is stored on the 2061 right of the router-id. For example, for an IPv4 address, the 2062 router-id consists of 4 octets of zeroes followed by the IPv4 2063 address. 2065 o X: all other bits MUST be sent as 0 and silently ignored on 2066 reception. 2068 The prefix being advertised by an Update TLV is computed as follows: 2070 o the first Omitted octets of the prefix are taken from the previous 2071 Update TLV with the Prefix flag set and the same address encoding, 2072 even if it was ignored due to an unknown mandatory sub-TLV; if 2073 Omitted is not zero and there is no such TLV, then this Update 2074 MUST be ignored; 2076 o the next (Plen/8 - Omitted) rounded upwards octets are taken from 2077 the Prefix field; 2079 o if Plen is not a multiple of 8, then any bits beyond Plen (i.e., 2080 the low-order (8 - Plen MOD 8) bits of the last octet) are 2081 cleared; 2083 o the remaining octets are set to 0. 2085 If the Metric field is finite, the router-id of the originating node 2086 for this announcement is taken from the prefix advertised by this 2087 Update if the Router-Id flag is set, computed as described above. 2088 Otherwise, it is taken either from the preceding Router-Id TLV, or 2089 the preceding Update TLV with the Router-Id flag set, whichever comes 2090 last, even if that TLV is otherwise ignored due to an unknown 2091 mandatory sub-TLV; if there is no suitable TLV, then this update is 2092 ignored. 2094 The next-hop address for this update is taken from the last preceding 2095 Next Hop TLV with a matching address family (IPv4 or IPv6) in the 2096 same packet even if it was otherwise ignored due to an unknown 2097 mandatory sub-TLV; if no such TLV exists, it is taken from the 2098 network-layer source address of this packet if it belongs to the same 2099 address family as the prefix being announced; otherwise, this Update 2100 MUST be ignored. 2102 If the metric field is FFFF hexadecimal, this TLV specifies a 2103 retraction. In that case, the router-id, next-hop and seqno are not 2104 used. AE MAY then be 0, in which case this Update retracts all of 2105 the routes previously advertised by the sending interface. If the 2106 metric is finite, AE MUST NOT be 0; Update TLVs with finite metric 2107 and AE equal to 0 MUST be ignored. If the metric is infinite and AE 2108 is 0, Plen and Omitted MUST both be 0. 2110 Update TLVs with an unknown value in the AE field MUST be silently 2111 ignored. 2113 This TLV is self-terminating, and allows sub-TLVs. 2115 4.6.10. Route Request 2117 0 1 2 3 2118 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 2119 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2120 | Type = 9 | Length | AE | Plen | 2121 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2122 | Prefix... 2123 +-+-+-+-+-+-+-+-+-+-+-+- 2125 A Route Request TLV prompts the receiver to send an update for a 2126 given prefix, or a full route table dump. 2128 Fields : 2130 Type Set to 9 to indicate a Route Request TLV. 2132 Length The length of the body in octets, exclusive of the Type and 2133 Length fields. 2135 AE The encoding of the Prefix field. The value 0 specifies 2136 that this is a request for a full route table dump (a 2137 wildcard request). 2139 Plen The length in bits of the requested prefix. 2141 Prefix The prefix being requested. This field's size is Plen/8 2142 rounded upwards. 2144 A Request TLV prompts the receiver to send an update message 2145 (possibly a retraction) for the prefix specified by the AE, Plen, and 2146 Prefix fields, or a full dump of its route table if AE is 0 (in which 2147 case Plen must be 0 and Prefix is of length 0). 2149 This TLV is self-terminating, and allows sub-TLVs. 2151 4.6.11. Seqno Request 2153 0 1 2 3 2154 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 2155 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2156 | Type = 10 | Length | AE | Plen | 2157 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2158 | Seqno | Hop Count | Reserved | 2159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2160 | | 2161 + Router-Id + 2162 | | 2163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2164 | Prefix... 2165 +-+-+-+-+-+-+-+-+-+-+ 2167 A Seqno Request TLV prompts the receiver to send an Update for a 2168 given prefix with a given sequence number, or to forward the request 2169 further if it cannot be satisfied locally. 2171 Fields : 2173 Type Set to 10 to indicate a Seqno Request TLV. 2175 Length The length of the body in octets, exclusive of the Type and 2176 Length fields. 2178 AE The encoding of the Prefix field. This MUST NOT be 0. 2180 Plen The length in bits of the requested prefix. 2182 Seqno The sequence number that is being requested. 2184 Hop Count The maximum number of times that this TLV may be forwarded, 2185 plus 1. This MUST NOT be 0. 2187 Reserved Sent as 0 and MUST be ignored on reception. 2189 Router-Id The Router-Id that is being requested. This MUST NOT 2190 consist of all zeroes or all ones. 2192 Prefix The prefix being requested. This field's size is Plen/8 2193 rounded upwards. 2195 A Seqno Request TLV prompts the receiving node to send a finite- 2196 metric Update for the prefix specified by the AE, Plen, and Prefix 2197 fields, with either a router-id different from what is specified by 2198 the Router-Id field, or a Seqno no less (modulo 2^16) than what is 2199 specified by the Seqno field. If this request cannot be satisfied 2200 locally, then it is forwarded according to the rules set out in 2201 Section 3.8.1.2. 2203 While a Seqno Request MAY be sent to a multicast address, it MUST NOT 2204 be forwarded to a multicast address and MUST NOT be forwarded to more 2205 than one neighbour. A request MUST NOT be forwarded if its Hop Count 2206 field is 1. 2208 This TLV is self-terminating, and allows sub-TLVs. 2210 4.7. Details of specific sub-TLVs 2212 4.7.1. Pad1 2214 0 1 2 3 4 5 6 7 2215 +-+-+-+-+-+-+-+-+ 2216 | Type = 0 | 2217 +-+-+-+-+-+-+-+-+ 2219 Fields : 2221 Type Set to 0 to indicate a Pad1 sub-TLV. 2223 This sub-TLV is silently ignored on reception. It is allowed within 2224 any TLV that allows sub-TLVs. 2226 4.7.2. PadN 2228 0 1 2 3 2229 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 2230 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2231 | Type = 1 | Length | MBZ... 2232 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 2234 Fields : 2236 Type Set to 1 to indicate a PadN sub-TLV. 2238 Length The length of the body in octets, exclusive of the Type and 2239 Length fields. 2241 MBZ Must be zero, set to 0 on transmission. 2243 This sub-TLV is silently ignored on reception. It is allowed within 2244 any TLV that allows sub-TLVs. 2246 5. IANA Considerations 2248 IANA has registered the UDP port number 6696, called "babel", for use 2249 by the Babel protocol. 2251 IANA has registered the IPv6 multicast group ff02::1:6 and the IPv4 2252 multicast group 224.0.0.111 for use by the Babel protocol. 2254 IANA has created a registry called "Babel TLV Types". The allocation 2255 policy for this registry is Specification Required [RFC8126] for 2256 Types 0-223, and Experimental Use for Types 224-254. The values in 2257 this registry are as follows: 2259 +---------+-----------------------------------------+---------------+ 2260 | Type | Name | Reference | 2261 +---------+-----------------------------------------+---------------+ 2262 | 0 | Pad1 | this document | 2263 | | | | 2264 | 1 | PadN | this document | 2265 | | | | 2266 | 2 | Acknowledgment Request | this document | 2267 | | | | 2268 | 3 | Acknowledgment | this document | 2269 | | | | 2270 | 4 | Hello | this document | 2271 | | | | 2272 | 5 | IHU | this document | 2273 | | | | 2274 | 6 | Router-Id | this document | 2275 | | | | 2276 | 7 | Next Hop | this document | 2277 | | | | 2278 | 8 | Update | this document | 2279 | | | | 2280 | 9 | Route Request | this document | 2281 | | | | 2282 | 10 | Seqno Request | this document | 2283 | | | | 2284 | 11 | TS/PC | [RFC7298] | 2285 | | | | 2286 | 12 | HMAC | [RFC7298] | 2287 | | | | 2288 | 13 | Source-specific Update | [BABEL-SS] | 2289 | | | | 2290 | 14 | Source-specific Request | [BABEL-SS] | 2291 | | | | 2292 | 15 | Source-specific Seqno Request | [BABEL-SS] | 2293 | | | | 2294 | 16 | MAC | [BABEL-MAC] | 2295 | | | | 2296 | 17 | PC | [BABEL-MAC] | 2297 | | | | 2298 | 18 | Challenge Request | [BABEL-MAC] | 2299 | | | | 2300 | 19 | Challenge Reply | [BABEL-MAC] | 2301 | | | | 2302 | 20-223 | Unassigned | | 2303 | | | | 2304 | 224-254 | Reserved for Experimental Use | this document | 2305 | | | | 2306 | 255 | Reserved for expansion of the type | this document | 2307 | | space | | 2308 +---------+-----------------------------------------+---------------+ 2310 IANA has created a registry called "Babel sub-TLV Types". The 2311 allocation policy for this registry is Specification Required for 2312 Types 0-111 and 128-239, and Experimental Use for Types 112-126 and 2313 240-254. The values in this registry are as follows: 2315 +---------+-------------------------------------+-------------------+ 2316 | Type | Name | Reference | 2317 +---------+-------------------------------------+-------------------+ 2318 | 0 | Pad1 | this document | 2319 | | | | 2320 | 1 | PadN | this document | 2321 | | | | 2322 | 2 | Diversity | [BABEL-DIVERSITY] | 2323 | | | | 2324 | 3 | Timestamp | [BABEL-RTT] | 2325 | | | | 2326 | 4-111 | Unassigned | | 2327 | | | | 2328 | 112-126 | Reserved for Experimental Use | this document | 2329 | | | | 2330 | 127 | Reserved for expansion of the type | this document | 2331 | | space | | 2332 | | | | 2333 | 128 | Source Prefix | [BABEL-SS] | 2334 | | | | 2335 | 129-239 | Unassigned | | 2336 | | | | 2337 | 240-254 | Reserved for Experimental Use | this document | 2338 | | | | 2339 | 255 | Reserved for expansion of the type | this document | 2340 | | space | | 2341 +---------+-------------------------------------+-------------------+ 2343 IANA is instructed to create a registry called "Babel Address 2344 Encodings". The allocation policy for this registry is Specification 2345 Required. The values in this registry are as follows: 2347 +----+-------------------------+---------------+ 2348 | AE | Name | Reference | 2349 +----+-------------------------+---------------+ 2350 | 0 | Wildcard address | this document | 2351 | | | | 2352 | 1 | IPv4 address | this document | 2353 | | | | 2354 | 2 | IPv6 address | this document | 2355 | | | | 2356 | 3 | Link-local IPv6 address | this document | 2357 +----+-------------------------+---------------+ 2359 IANA has created a registry called "Babel Flags Values". The 2360 allocation policy for this registry is Specification Required. IANA 2361 is instructed to rename this registry to "Babel Update Flags Values". 2362 The values in this registry are as follows: 2364 +-----+-------------------+---------------+ 2365 | Bit | Name | Reference | 2366 +-----+-------------------+---------------+ 2367 | 0 | Default prefix | this document | 2368 | | | | 2369 | 1 | Default Router-ID | this document | 2370 | | | | 2371 | 2-7 | Unassigned | | 2372 +-----+-------------------+---------------+ 2374 IANA is instructed to create a new registry called "Babel Hello Flags 2375 Values". The allocation policy for this registry is Specification 2376 Required. The initial values in this registry are as follows: 2378 +------+------------+---------------+ 2379 | Bit | Name | Reference | 2380 +------+------------+---------------+ 2381 | 0 | Unicast | this document | 2382 | | | | 2383 | 1-15 | Unassigned | | 2384 +------+------------+---------------+ 2386 IANA is instructed to replace all references to RFCs 6126 and 7557 in 2387 all of the registries mentioned above by references to this document. 2389 6. Security Considerations 2391 As defined in this document, Babel is a completely insecure protocol. 2392 Without additional security mechanisms, Babel trusts any information 2393 it receives in plaintext UDP datagrams and acts on it. An attacker 2394 that is present on the local network can impact Babel operation in a 2395 variety of ways; for example they can: 2397 o spoof a Babel packet, and redirect traffic by announcing a route 2398 with a smaller metric, a larger sequence number, or a longer 2399 prefix; 2401 o spoof a malformed packet, which could cause an insufficiently 2402 robust implementation to crash or interfere with the rest of the 2403 network; 2405 o replay a previously captured Babel packet, which could cause 2406 traffic to be redirected, blackholed or otherwise interfere with 2407 the network. 2409 When carried over IPv6, Babel packets are ignored unless they are 2410 sent from a link-local IPv6 address; since routers don't forward 2411 link-local IPv6 packets, this mitigates the attacks outlined above by 2412 restricting them to on-link attackers. No such natural protection 2413 exists when Babel packets are carried over IPv4, which is one of the 2414 reasons why it is recommended to deploy Babel over IPv6 2415 (Section 3.1). 2417 It is usually difficult to ensure that packets arriving at a Babel 2418 node are trusted, even in the case where the local link is believed 2419 to be secure. For that reason, it is RECOMMENDED that all Babel 2420 traffic be protected by an application-layer cryptographic protocol. 2421 There are currently two suitable mechanisms, which implement 2422 different tradeoffs between implementation simplicity and security: 2424 o Babel over DTLS [BABEL-DTLS] runs the majority of Babel traffic 2425 over DTLS, and leverages DTLS to authenticate nodes and provide 2426 confidentiality and integrity protection; 2428 o MAC authentication [BABEL-MAC] appends a message authentication 2429 code (MAC) to every Babel packet to prove that it originated at a 2430 node that knows a shared secret, and includes sufficient 2431 additional information to prove that the packet is fresh (not 2432 replayed). 2434 Both mechanisms enable nodes to ignore packets generated by attackers 2435 without the proper credentials. They also ensure integrity of 2436 messages and prevent message replay. While Babel-DTLS supports 2437 asymmetric keying and ensures confidentiality, Babel-MAC has a much 2438 more limited scope (see Sections 1.1, 1.2 and 7 of [BABEL-MAC]). 2439 Since Babel-MAC is simpler and more lightweight, it is recommended in 2440 preference to Babel-DTLS in deployments where its limitations are 2441 acceptable, i.e., when symmetric keying is sufficient and where the 2442 routing information is not considered confidential. 2444 Every implementation of Babel SHOULD implement BABEL-MAC. 2446 One should be aware that the information that a mobile Babel node 2447 announces to the whole routing domain is sufficient to determine the 2448 mobile node's physical location with reasonable precision, which 2449 might cause privacy concerns even if the control traffic is protected 2450 from unauthenticated attackers by a cryptographic mechanism such as 2451 Babel-DTLS. This issue may be mitigated somewhat by using randomly 2452 chosen router-ids and randomly chosen IP addresses, and changing them 2453 often enough. 2455 7. Acknowledgments 2457 A number of people have contributed text and ideas to this 2458 specification. The authors are particularly indebted to Matthieu 2459 Boutier, Gwendoline Chouasne, Margaret Cullen, Donald Eastlake, Toke 2460 Hoiland-Jorgensen, Benjamin Kaduk, Joao Sobrinho and Martin 2461 Vigoureux. Earlier versions of this document greatly benefited from 2462 the input of Joel Halpern. The address compression technique was 2463 inspired by [PACKETBB]. 2465 8. References 2467 8.1. Normative References 2469 [BABEL-MAC] 2470 Do, C., Kolodziejak, W., and J. Chroboczek, "MAC 2471 authentication for the Babel routing protocol", Internet 2472 Draft draft-ietf-babel-hmac-10, August 2019. 2474 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2475 Requirement Levels", BCP 14, RFC 2119, 2476 DOI 10.17487/RFC2119, March 1997. 2478 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2479 Writing an IANA Considerations Section in RFCs", BCP 26, 2480 RFC 8126, June 2017. 2482 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2483 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2484 May 2017. 2486 8.2. Informative References 2488 [BABEL-DIVERSITY] 2489 Chroboczek, J., "Diversity Routing for the Babel Routing 2490 Protocol", draft-chroboczek-babel-diversity-routing-01 2491 (work in progress), February 2016. 2493 [BABEL-DTLS] 2494 Decimo, A., Schinazi, D., and J. Chroboczek, "Babel 2495 Routing Protocol over Datagram Transport Layer Security", 2496 Internet Draft draft-ietf-babel-dtls-09, August 2019. 2498 [BABEL-RTT] 2499 Jonglez, B. and J. Chroboczek, "Delay-based Metric 2500 Extension for the Babel Routing Protocol", draft-ietf- 2501 babel-rtt-extension-00 (work in progress), April 2019. 2503 [BABEL-SS] 2504 Boutier, M. and J. Chroboczek, "Source-Specific Routing in 2505 Babel", draft-ietf-babel-source-specific-05 (work in 2506 progress), April 2019. 2508 [DSDV] Perkins, C. and P. Bhagwat, "Highly Dynamic Destination- 2509 Sequenced Distance-Vector Routing (DSDV) for Mobile 2510 Computers", ACM SIGCOMM'94 Conference on Communications 2511 Architectures, Protocols and Applications 234-244, 1994. 2513 [DUAL] Garcia Luna Aceves, J., "Loop-Free Routing Using Diffusing 2514 Computations", IEEE/ACM Transactions on Networking 1:1, 2515 February 1993. 2517 [EIGRP] Albrightson, B., Garcia Luna Aceves, J., and J. Boyle, 2518 "EIGRP -- a Fast Routing Protocol Based on Distance 2519 Vectors", Proc. Interop 94, 1994. 2521 [ETX] De Couto, D., Aguayo, D., Bicket, J., and R. Morris, "A 2522 high-throughput path metric for multi-hop wireless 2523 networks", Proc. MobiCom 2003, 2003. 2525 [IS-IS] Standardization, I. O. F., "Information technology -- 2526 Telecommunications and information exchange between 2527 systems -- Intermediate System to Intermediate System 2528 intra-domain routeing information exchange protocol for 2529 use in conjunction with the protocol for providing the 2530 connectionless-mode network service (ISO 8473)", ISO/ 2531 IEC 10589:2002, 2002. 2533 [JITTER] Floyd, S. and V. Jacobson, "The synchronization of 2534 periodic routing messages", IEEE/ACM Transactions on 2535 Networking 2, 2, 122-136, April 1994. 2537 [OSPF] Moy, J., "OSPF Version 2", RFC 2328, April 1998. 2539 [PACKETBB] 2540 Clausen, T., Dearlove, C., Dean, J., and C. Adjih, 2541 "Generalized Mobile Ad Hoc Network (MANET) Packet/Message 2542 Format", RFC 5444, February 2009. 2544 [RFC3561] Perkins, C., Belding-Royer, E., and S. Das, "Ad hoc On- 2545 Demand Distance Vector (AODV) Routing", RFC 3561, 2546 DOI 10.17487/RFC3561, July 2003, 2547 . 2549 [RFC6126] Chroboczek, J., "The Babel Routing Protocol", RFC 6126, 2550 DOI 10.17487/RFC6126, April 2011. 2552 [RFC7298] Ovsienko, D., "Babel Hashed Message Authentication Code 2553 (HMAC) Cryptographic Authentication", RFC 7298, 2554 DOI 10.17487/RFC7298, July 2014. 2556 [RFC7557] Chroboczek, J., "Extension Mechanism for the Babel Routing 2557 Protocol", RFC 7557, DOI 10.17487/RFC7557, May 2015. 2559 [RIP] Malkin, G., "RIP Version 2", RFC 2453, November 1998. 2561 Appendix A. Cost and Metric Computation 2563 The strategy for computing link costs and route metrics is a local 2564 matter; Babel itself only requires that it comply with the conditions 2565 given in Section 3.4.3 and Section 3.5.2. Different nodes may use 2566 different strategies in a single network and may use different 2567 strategies on different interface types. This section describes a 2568 set of stragies that have been found to work well in actual networks. 2570 In summary, a node maintains per-neighbour statistics about the last 2571 16 received Hello TLVs of each kind (Appendix A.1), it computes costs 2572 by using the 2-out-of-3 strategy (Appendix A.2.1) on wired links, and 2573 ETX (Appendix A.2.2) on wireless links. It uses an additive algebra 2574 for metric computation (Appendix A.3). 2576 A.1. Maintaining Hello History 2578 For each neighbour, a node maintains two sets of Hello history, one 2579 for each kind of Hello, and an expected sequence number, one for 2580 Multicast and one for Unicast Hellos. Each Hello history is a vector 2581 of 16 bits, where a 1 value represents a received Hello, and a 0 2582 value a missed Hello. For each kind of Hello, the expected sequence 2583 number, written ne, is the sequence number that is expected to be 2584 carried by the next received Hello from this neighbour. 2586 Whenever it receives a Hello packet of a given kind from a neighbour, 2587 a node compares the received sequence number nr for that kind of 2588 Hello with its expected sequence number ne. Depending on the outcome 2589 of this comparison, one of the following actions is taken: 2591 o if the two differ by more than 16 (modulo 2^16), then the sending 2592 node has probably rebooted and lost its sequence number; the whole 2593 associated neighbour table entry is flushed and a new one is 2594 created; 2596 o otherwise, if the received nr is smaller (modulo 2^16) than the 2597 expected sequence number ne, then the sending node has increased 2598 its Hello interval without us noticing; the receiving node removes 2599 the last (ne - nr) entries from this neighbour's Hello history (we 2600 "undo history"); 2602 o otherwise, if nr is larger (modulo 2^16) than ne, then the sending 2603 node has decreased its Hello interval, and some Hellos were lost; 2604 the receiving node adds (nr - ne) 0 bits to the Hello history (we 2605 "fast-forward"). 2607 The receiving node then appends a 1 bit to the Hello history and sets 2608 ne to (nr + 1). If the Interval field of the received Hello is not 2609 zero, it resets the neighbour's hello timer to 1.5 times the 2610 advertised Interval (the extra margin allows for delay due to 2611 jitter). 2613 Whenever either Hello timer associated to a neighbour expires, the 2614 local node adds a 0 bit to the corresponding Hello history, and 2615 increments the expected Hello number. If both Hello histories are 2616 empty (they contain 0 bits only), the neighbour entry is flushed; 2617 otherwise, the relevant hello timer is reset to the value advertised 2618 in the last Hello of that kind received from this neighbour (no extra 2619 margin is necessary in this case, since jitter was already taken into 2620 account when computing the timeout that has just expired). 2622 A.2. Cost Computation 2624 This section discusses how to compute costs based on Hello history. 2626 A.2.1. k-out-of-j 2628 K-out-of-j link sensing is suitable for wired links that are either 2629 up, in which case they only occasionally drop a packet, or down, in 2630 which case they drop all packets. 2632 The k-out-of-j strategy is parameterised by two small integers k and 2633 j, such that 0 < k <= j, and the nominal link cost, a constant C >= 2634 1. A node keeps a history of the last j hellos; if k or more of 2635 those have been correctly received, the link is assumed to be up, and 2636 the rxcost is set to C; otherwise, the link is assumed to be down, 2637 and the rxcost is set to infinity. 2639 Since Babel supports two kinds of Hellos, a Babel node performs k- 2640 out-of-j twice for each neighbour, once on the Unicast and once on 2641 the Multicast Hello history. If either of the instances of k-out- 2642 of-j indicates that the link is up, then the link is assumed to be 2643 up, and the rxcost is set to K; if both instances indicate that the 2644 link is down, then the link is assumed to be down, and the rxcost is 2645 set to infinity. In other words, the resulting rxcost is the minimum 2646 of the rxcosts yielded by the two instances of k-out-of-j link 2647 sensing. 2649 The cost of a link performing k-out-of-j link sensing is defined as 2650 follows: 2652 o cost = FFFF hexadecimal if rxcost = FFFF hexadecimal; 2654 o cost = txcost otherwise. 2656 A.2.2. ETX 2658 Unlike wired links which are bimodal (either up or down), wireless 2659 links exhibit continuous variation of the link quality. Naive 2660 application of hop-count routing in networks that use wireless links 2661 for transit tends to select long, lossy links in preference to 2662 shorter, lossless links, which can dramatically reduce throughput. 2663 For that reason, a routing protocol designed to support wireless 2664 links must perform some form of link-quality estimation. 2666 ETX [ETX] is a simple link-quality estimation algorithm that is 2667 designed to work well with the IEEE 802.11 MAC. By default, the 2668 IEEE 802.11 MAC performs ARQ and rate adaptation on unicast frames, 2669 but not on multicast frames, which are sent at a fixed rate with no 2670 ARQ; therefore, measuring the loss rate of multicast frames yields a 2671 useful estimate of a link's quality. 2673 A node performing ETX link quality estimation uses a neighbour's 2674 Multicast Hello history to compute an estimate, written beta, of the 2675 probability that a Hello TLV is successfully received. Beta can be 2676 computed as the fraction of 1 bits within a small number (say, 6) of 2677 the most recent entries in the Multicast Hello history, or it can be 2678 an exponential average, or some combination of both approaches. Let 2679 rxcost be 256 / beta. 2681 Let alpha be MIN(1, 256/txcost), an estimate of the probability of 2682 successfully sending a Hello TLV. The cost is then computed by 2684 cost = 256/(alpha * beta) 2686 or, equivalently, 2688 cost = (MAX(txcost, 256) * rxcost) / 256. 2690 Since the IEEE 802.11 MAC performs ARQ on unicast frames, unicast 2691 frames do not provide a useful measure of link quality, and therefore 2692 ETX ignores the Unicast Hello history. Thus, a node performing ETX 2693 link-quality estimation will not route through neighbouring nodes 2694 unless they send periodic Multicast Hellos (possibly in addition to 2695 Unicast Hellos). 2697 A.3. Metric computation 2699 As described in Section 3.5.2, the metric advertised by a neighbour 2700 is combined with the link cost to yield a metric. 2702 The simplest approach for obtaining a monotonic, left-distributive 2703 metric is to define the metric of a route as the sum of the costs of 2704 the component links. More formally, if a neighbour advertises a 2705 route with metric m over a link with cost c, then the resulting route 2706 has metric M(c, m) = c + m. 2708 A multiplicative metric can be converted into an additive one by 2709 taking the logarithm (in some suitable base) of the link costs. 2711 A.4. Route selection 2713 Route selection (Section 3.6) is the process by which a node selects 2714 a single route among the routes that it has available towards a given 2715 destination. With Babel, any route selection procedure that only 2716 ever chooses feasible routes with a finite metric will yield a set of 2717 loop-free routes; however, not all route selection policies will 2718 yield good results. 2720 The obvious route selection procedure is to pick, for every 2721 destination, the feasible route with minimal metric. When all 2722 metrics are stable, this strategy ensures convergence to a tree of 2723 shortest paths (assuming that the metric is left-distributive). 2724 There are two reasons, however, why this strategy leads to 2725 instability in the presence of continously varying metrics such as 2726 ETX (Appendix A.2.2). First, if two parallel routes oscillate around 2727 a common value, then the smallest metric strategy will keep switching 2728 between the two. Second, when a route is selected, congestion along 2729 it increases, which might increase packet loss, which in turn could 2730 cause its metric to increase; this is a feedback loop, of the kind 2731 that is prone to causing persistent oscillations. 2733 A simple strategy to avoid this kind of instabilities is to only 2734 switch routes when the target route's metric is smaller by some 2735 constant margin than the currently selected metric. However, this 2736 approach is difficult to tune: if the constant is too small, then it 2737 doesn't avoid oscillations, and if it is too large, then it leads to 2738 sub-optimal routing; thus, a better strategy is to apply hysteresis 2739 (sensitivity to a route's history) to the route selection algorithm. 2740 The following hysteresis algorithm appears to yield good results with 2741 a variety of metrics. 2743 For every route R, in addition to the route's metric m(R), maintain a 2744 smoothed version of m(R) written ms(R) (we suggest computing ms(R) as 2745 an exponential average of m(R) with a time constant equal to a small 2746 multiple of the Hello interval). If no route to a given destination 2747 is selected, then select the route with the smallest metric, ignoring 2748 the smoothed metric. If a route R is selected, then switch to a 2749 route R' only when both m(R') < m(R) and ms(R') < ms(R). 2751 Intuitively, the smoothed metric is a long-term estimate of the 2752 quality of a route. The algorithm above works by only switching 2753 routes when both the instananeous and the long-term estimate of the 2754 route's quality indicate that switching is profitable. 2756 Appendix B. Protocol parameters 2758 The choice of time constants is a trade-off between fast detection of 2759 mobility events and protocol overhead. Two instances of Babel 2760 running with different time constants will interoperate, although the 2761 resulting worst-case convergence time will be dictated by the slower 2762 of the two. 2764 The Hello interval is the most important time constant: an outage or 2765 a mobility event is detected within 1.5 to 3.5 Hello intervals. Due 2766 to Babel's use of a redundant route table, and due to its reliance on 2767 triggered updates and explicit requests, the Update interval has 2768 little influence on the time needed to reconverge after an outage: in 2769 practice, it only has a significant effect on the time needed to 2770 acquire new routes after a mobility event. While the protocol allows 2771 intervals as low as 10ms, such low values would cause significant 2772 amounts of protocol traffic for little practical benefit. 2774 The following values are recommended in a network with little 2775 mobility, and where occasional outages of up to 14 seconds are 2776 acceptable: 2778 Multicast Hello Interval: 4 seconds. 2780 Unicast Hello Interval: infinite (no Unicast Hellos are sent). 2782 Link cost: estimated using ETX on wireless links; 2-out-of-3 with 2783 C=96 on wired links. 2785 IHU Interval: the advertised IHU interval is always 3 times the 2786 Multicast Hello interval. IHUs are actually sent with each Hello 2787 on lossy links (as determined from the Hello history), but only 2788 with every third Multicast Hello on lossless links. 2790 Update Interval: 4 times the Multicast Hello interval. 2792 IHU Hold Time: 3.5 times the advertised IHU interval. 2794 Route Expiry Time: 3.5 times the advertised update interval. 2796 Request timeout: initially 2 seconds, doubled every time a request 2797 is resent, up to a maximum of three times. 2799 Urgent timeout: 0.2 seconds. 2801 Source GC time: 3 minutes. 2803 The following values are recommended in a network where reconvergence 2804 within 2 seconds after a mobility event is desired: 2806 Multicast Hello Interval: 0.5 seconds. 2808 Unicast Hello Interval: infinite (no Unicast Hellos are sent). 2810 Link cost, IHU Interval, Update Interval, IHU Hold Time, and Route 2811 Expiry Time: computed as in the first case above. 2813 Request Timeout: initially 0.5 seconds, doubled every time a 2814 request is resent, up to a maximum of three times. 2816 Urgent timeout: 0.2 seconds. 2818 Source GC time: 3 minutes. 2820 Appendix C. Route filtering 2822 Route filtering is a procedure where an instance of a routing 2823 protocol either discards some of the routes announced by its 2824 neighbours, or learns them with a metric that is higher than what 2825 would be expected. Like all distance-vector protocols, Babel has the 2826 ability to apply arbitrary filtering to the routes it learns, and 2827 implementations of Babel that apply different sets of filtering rules 2828 will interoperate without causing routing loops. The protocol's 2829 ability to perform route filtering is a consequence of the latitude 2830 given in Section 3.5.2: Babel can use any metric that is strictly 2831 monotonic, including one that assigns an infinite metric to a 2832 selected subset of routes. (See also Section 3.8.1, where requests 2833 for nonexistent routes are treated in the same way as requests for 2834 routes with infinite metric.) 2836 It is not in general correct to learn a route with a metric smaller 2837 than the one it was announced with, or to replace a route's 2838 destination prefix with a more specific (longer) one. Doing either 2839 of these may cause persistent routing loops. 2841 Route filtering is a useful tool, since it allows fine-grained tuning 2842 of the routing decisions made by the routing protocol. Accordingly, 2843 some implementations of Babel implement a rich configuration language 2844 that allows applying filtering to sets of routes defined, for 2845 example, by incoming interface and destination prefix. 2847 In order to limit the consequences of misconfiguration, Babel 2848 implementations provide a reasonable set of default filtering rules 2849 even when they don't allow configuration of filtering by the user. 2850 At a minimum, they discard routes with a destination prefix in 2851 fe80::/64, ff00::/8, 127.0.0.1/32, 0.0.0.0/32 and 224.0.0.0/8. 2853 Appendix D. Considerations for protocol extensions 2855 Babel is an extensible protocol, and this document defines a number 2856 of mechanisms that can be used to extend the protocol in a backwards 2857 compatible manner: 2859 o increasing the version number in the packet header; 2861 o defining new TLVs; 2863 o defining new sub-TLVs (with or without the mandatory bit set); 2865 o defining new AEs; 2867 o using the packet trailer. 2869 This appendix is intended to guide designers of protocol extensions 2870 in chosing a particular encoding. 2872 The version number in the Babel header should only be increased if 2873 the new version is not backwards compatible with the original 2874 protocol. 2876 In many cases, an extension could be implemented either by defining a 2877 new TLV, or by adding a new sub-TLV to an existing TLV. For example, 2878 an extension whose purpose is to attach additional data to route 2879 updates can be implemented either by creating a new "enriched" Update 2880 TLV, by adding a non-mandatory sub-TLV to the Update TLV, or by 2881 adding a mandatory sub-TLV. 2883 The various encodings are treated differently by implementations that 2884 do not understand the extension. In the case of a new TLV or of a 2885 sub-TLV with the mandatory bit set, the whole TLV is ignored by 2886 implementations that do not implement the extension, while in the 2887 case of a non-mandatory sub-TLV, the TLV is parsed and acted upon, 2888 and only the unknown sub-TLV is silently ignored. Therefore, a non- 2889 mandatory sub-TLV should be used by extensions that extend the Update 2890 in a compatible manner (the extension data may be silently ignored), 2891 while a mandatory sub-TLV or a new TLV must be used by extensions 2892 that make incompatible extensions to the meaning of the TLV (the 2893 whole TLV must be thrown away if the extension data is not 2894 understood). 2896 Experience shows that the need for additional data tends to crop up 2897 in the most unexpected places. Hence, it is recommended that 2898 extensions that define new TLVs should make them self-terminating, 2899 and allow attaching sub-TLVs to them. 2901 Adding a new AE is essentially equivalent to adding a new TLV: Update 2902 TLVs with an unknown AE are ignored, just like unknown TLVs. 2903 However, adding a new AE is more involved than adding a new TLV, 2904 since it creates a new set of compression state. Additionally, since 2905 the Next Hop TLV creates state specific to a given address family, as 2906 opposed to a given AE, a new AE for a previously defined address 2907 family must not be used in the Next Hop TLV if backwards 2908 compatibility is required. A similar issue arises with Update TLVs 2909 with unknown AEs establishing a new router-id (due to the Router-Id 2910 flag being set). Therefore, defining new AEs must be done with care 2911 if compatibility with unextended implementations is required. 2913 The packet trailer is intended to carry cryptographic signatures that 2914 only cover the packet body; storing the cryptographic signatures in 2915 the packet trailer avoids clearing the signature before computing a 2916 hash of the packet body, and makes it possible to check a 2917 cryptographic signature before running the full, stateful TLV parser. 2918 Hence, only TLVs that don't need to be protected by cryptographic 2919 security protocols should be allowed in the packet trailer. Any such 2920 TLVs should be easy to parse, and in particular should not require 2921 stateful parsing. 2923 Appendix E. Stub Implementations 2925 Babel is a fairly economic protocol. Updates take between 12 and 40 2926 octets per destination, depending on the address family and how 2927 successful compression is; in a double-stack flat network, an average 2928 of less than 24 octets per update is typical. The route table 2929 occupies about 35 octets per IPv6 entry. To put these values into 2930 perspective, a single full-size Ethernet frame can carry some 65 2931 route updates, and a megabyte of memory can contain a 20000-entry 2932 route table and the associated source table. 2934 Babel is also a reasonably simple protocol. One complete 2935 implementation consists of less than 12 000 lines of C code, and it 2936 compiles to less than 120 kB of text on a 32-bit CISC architecture; 2937 about half of this figure is due to protocol extensions and user- 2938 interface code. 2940 Nonetheless, in some very constrained environments, such as PDAs, 2941 microwave ovens, or abacuses, it may be desirable to have subset 2942 implementations of the protocol. 2944 There are many different definitions of a stub router, but for the 2945 needs of this section a stub implementation of Babel is one that 2946 announces one or more directly attached prefixes into a Babel network 2947 but doesn't reannounce any routes that it has learnt from its 2948 neighbours, and always prefers the direct route to a directly 2949 attached prefix to a route learned over the Babel protocol, even when 2950 the prefixes are the same. It may either maintain a full routing 2951 table, or simply select a default gateway through any one of its 2952 neighbours that announces a default route. Since a stub 2953 implementation never forwards packets except from or to a directly 2954 attached link, it cannot possibly participate in a routing loop, and 2955 hence it need not evaluate the feasibility condition or maintain a 2956 source table. 2958 No matter how primitive, a stub implementation must parse sub-TLVs 2959 attached to any TLVs that it understands and check the mandatory bit. 2960 It must answer acknowledgment requests and must participate in the 2961 Hello/IHU protocol. It must also be able to reply to seqno requests 2962 for routes that it announces and, and it should be able to reply to 2963 route requests. 2965 Experience shows that an IPv6-only stub implementation of Babel can 2966 be written in less than 1000 lines of C code and compile to 13 kB of 2967 text on 32-bit CISC architecture. 2969 Appendix F. Compatibility with previous versions 2971 The protocol defined in this document is a successor to the protocol 2972 defined in [RFC6126] and [RFC7557]. While the two protocols are not 2973 entirely compatible, the new protocol has been designed so that it 2974 can be deployed in existing RFC 6126 networks without requiring a 2975 flag day. 2977 There are three optional features that make this protocol 2978 incompatible with its predecessor. First of all, RFC 6126 did not 2979 define Unicast hellos (Section 3.4.1), and an implementation of RFC 2980 6126 will mis-interpret a Unicast Hello for a Multicast one; since 2981 the sequence number space of Unicast Hellos is distinct from the 2982 sequence space of Multicast Hellos, sending a Unicast Hello to an 2983 implementation of RFC 6126 will confuse its link quality estimator. 2984 Second, RFC 6126 did not define unscheduled Hellos, and an 2985 implementation of RFC 6126 will mis-parse Hellos with an interval 2986 equal to 0. Finally, RFC 7557 did not define mandatory sub-TLVs 2987 (Section 4.4), and thus, an implementation of RFCs 6126 and 7557 will 2988 not correctly ignore a TLV that carries an unknown mandatory sub-TLV; 2989 depending on the sub-TLV, this might cause routing pathologies. 2991 An implementation of this specification that never sends Unicast or 2992 unscheduled Hellos and doesn't implement any extensions that use 2993 mandatory sub-TLVs is safe to deploy in a network in which some nodes 2994 implement the protocol described in RFCs 6126 and 7557. 2996 Two changes need to be made to an implementation of RFCs 6126 and 2997 7557 so that it can safely interoperate in all cases with 2998 implementations of this protocol. First, it needs to be modified to 2999 either ignore or process Unicast and unscheduled Hellos. Second, it 3000 needs to be modified to parse sub-TLVs of all the TLVs that it 3001 understands and that allow sub-TLVs, and to ignore the TLV if an 3002 unknown mandatory sub-TLV is found. It is not necessary to parse 3003 unknown TLVs, as these are ignored in any case. 3005 There are other changes, but these are not of a nature to prevent 3006 interoperability: 3008 o the conditions on route acquisition (Section 3.5.3) have been 3009 relaxed; 3011 o route selection should no longer use the route's sequence number 3012 (Section 3.6); 3014 o the format of the packet trailer has been defined (Section 4.2); 3016 o router-ids with a value of all-zeros or all-ones have been 3017 forbidden (Section 4.1.2); 3019 o the compression state is now specific to an address family rather 3020 than an address encoding (Section 4.5); 3022 o packet pacing is now recommended (Section 3.1). 3024 Appendix G. Changes from previous versions 3026 G.1. Changes since RFC 6126 3028 o Changed UDP port number to 6696. 3030 o Consistently use router-id rather than id. 3032 o Clarified that the source garbage collection timer is reset after 3033 sending an update even if the entry was not modified. 3035 o In section "Seqno Requests", fixed an erroneous "route request". 3037 o In the description of the Seqno Request TLV, added the description 3038 of the Router-Id field. 3040 o Made router-ids all-0 and all-1 forbidden. 3042 G.2. Changes since draft-ietf-babel-rfc6126bis-00 3044 o Added security considerations. 3046 G.3. Changes since draft-ietf-babel-rfc6126bis-01 3048 o Integrated the format of sub-TLVs. 3050 o Mentioned for each TLV whether it supports sub-TLVs. 3052 o Added Appendix D. 3054 o Added a mandatory bit in sub-TLVs. 3056 o Changed compression state to be per-AF rather than per-AE. 3058 o Added implementation hint for the routing table. 3060 o Clarified how router-ids are computed when bit 0x40 is set in 3061 Updates. 3063 o Relaxed the conditions for sending requests, and tightened the 3064 conditions for forwarding requests. 3066 o Clarified that neighbours should be acquired at some point, but it 3067 doesn't matter when. 3069 G.4. Changes since draft-ietf-babel-rfc6126bis-02 3071 o Added Unicast Hellos. 3073 o Added unscheduled (interval-less) Hellos. 3075 o Changed Appendix A to consider Unicast and unscheduled Hellos. 3077 o Changed Appendix B to agree with the reference implementation. 3079 o Added optional algorithm to avoid the hold time. 3081 o Changed the table of pending seqno requests to be indexed by 3082 router-id in addition to prefixes. 3084 o Relaxed the route acquisition algorithm. 3086 o Replaced minimal implementations by stub implementations. 3088 o Added acknowledgments section. 3090 G.5. Changes since draft-ietf-babel-rfc6126bis-03 3092 o Clarified that all the data structures are conceptual. 3094 o Made sending and receiving Multicast Hellos a SHOULD, avoids 3095 expressing any opinion about Unicast Hellos. 3097 o Removed opinion about Multicast vs. Unicast Hellos (Appendix A.4). 3099 o Made hold-time into a SHOULD rather than MUST. 3101 o Clarified that Seqno Requests are for a finite-metric Update. 3103 o Clarified that sub-TLVs Pad1 and PadN are allowed within any TLV 3104 that allows sub-TLVs. 3106 o Updated IANA Considerations. 3108 o Updated Security Considerations. 3110 o Renamed routing table back to route table. 3112 o Made buffering outgoing updates a SHOULD. 3114 o Weakened advice to use modified EUI-64 in router-ids. 3116 o Added information about sending requests to Appendix B. 3118 o A number of minor wording changes and clarifications. 3120 G.6. Changes since draft-ietf-babel-rfc6126bis-03 3122 Minor editorial changes. 3124 G.7. Changes since draft-ietf-babel-rfc6126bis-04 3126 o Renamed isotonicity to left-distributivity. 3128 o Minor clarifications to unicast hellos. 3130 o Updated requirements boilerplate to RFC 8174. 3132 o Minor editorial changes. 3134 G.8. Changes since draft-ietf-babel-rfc6126bis-05 3136 o Added information about the packet trailer, now that it is used by 3137 draft-ietf-babel-hmac. 3139 G.9. Changes since draft-ietf-babel-rfc6126bis-06 3141 o Added references to security documents. 3143 G.10. Changes since draft-ietf-babel-rfc6126bis-07 3145 o Added list of obsoleted drafts to the abstract. 3147 o Updated references. 3149 G.11. Changes since draft-ietf-babel-rfc6126bis-08 3151 o Added recommendation that route selection should not take seqnos 3152 into account. 3154 G.12. Changes since draft-ietf-babel-rfc6126bis-09 3156 o Editorial changes only. 3158 G.13. Changes since draft-ietf-babel-rfc6126bis-10 3160 o Editorial changes only. 3162 G.14. Changes since draft-ietf-babel-rfc6126bis-11 3164 o Added recommendation that control traffic should be carried over 3165 IPv6 only. 3167 G.15. Changes since draft-ietf-babel-rfc6126bis-12 3169 o Removed appendix about software availability. 3171 o Expanded appendix about recommended values and added more 3172 references to it in the body of the document. 3174 o Added appendix about route filtering. 3176 o Clarified definition of mandatory bit. 3178 o Added recommendations for packet pacing. 3180 o Made time limiting of full updates a SHOULD. 3182 o Normative language in a few more places. 3184 o Removed normative language from stub implementations. 3186 o Added requirement to clear the undefined bits in an Update. 3188 o Added error checking requirements. 3190 o Reworked security considerations. 3192 o Added "in octets" and "in bits" in random places. 3194 o Inserted full IANA registries. 3196 o Editorial changes. 3198 G.16. Changes since draft-ietf-babel-rfc6126bis-13 3200 o Added a section about compatibility with 6126. 3202 o Added AE registry to IANA considerations. 3204 o Replaced Babel-HMAC with Babel-MAC, consistent with the change in 3205 draft-ietf-babel-hmac. 3207 o Removed section about external sources of willingness; filtering 3208 is a better approach. 3210 o Added recommendation to use a cost of 96 on wired links. 3212 o Editorial changes. 3214 G.17. Changes since draft-ietf-babel-rfc6126bis-14 3216 o Added unscheduled Hellos to compatibility considerations. 3218 o Created new appendix about route selection. 3220 o Reworked security considerations. 3222 o Added some comments about packet pacing and low update intervals. 3224 G.18. Changes since draft-ietf-babel-rfc6126bis-14 3226 o Implementing Babel-MAC is now recommended. 3228 Authors' Addresses 3230 Juliusz Chroboczek 3231 IRIF, University of Paris-Diderot 3232 Case 7014 3233 75205 Paris Cedex 13 3234 France 3236 Email: jch@irif.fr 3238 David Schinazi 3239 Google LLC 3240 1600 Amphitheatre Parkway 3241 Mountain View, California 94043 3242 USA 3244 Email: dschinazi.ietf@gmail.com