idnits 2.17.1 draft-ietf-i2rs-rib-data-model-15.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 is 1 instance of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 14, 2018) is 2174 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) == Unused Reference: 'RFC8344' is defined on line 3184, but no explicit reference was found in the text == Unused Reference: 'RFC2784' is defined on line 3195, but no explicit reference was found in the text == Unused Reference: 'RFC7348' is defined on line 3200, but no explicit reference was found in the text == Unused Reference: 'RFC7637' is defined on line 3207, but no explicit reference was found in the text ** Downref: Normative reference to an Informational draft: draft-ietf-i2rs-rib-info-model (ref. 'I-D.ietf-i2rs-rib-info-model') ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 5 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group L. Wang 3 Internet-Draft Individual 4 Intended status: Standards Track M. Chen 5 Expires: November 15, 2018 Huawei 6 A. Dass 7 Ericsson 8 H. Ananthakrishnan 9 Packet Design 10 S. Kini 11 Individual 12 N. Bahadur 13 Bracket Computing 14 May 14, 2018 16 A YANG Data Model for Routing Information Base (RIB) 17 draft-ietf-i2rs-rib-data-model-15 19 Abstract 21 This document defines a YANG data model for the Routing Information 22 Base (RIB) that aligns with the I2RS RIB information model. 24 Requirements Language 26 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 27 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 28 "OPTIONAL" in this document are to be interpreted as described in BCP 29 14 [RFC2119] [RFC8174] when, and only when, they appear in all 30 capitals, as shown here. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on November 15, 2018. 49 Copyright Notice 51 Copyright (c) 2018 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents 56 (https://trustee.ietf.org/license-info) in effect on the date of 57 publication of this document. Please review these documents 58 carefully, as they describe your rights and restrictions with respect 59 to this document. Code Components extracted from this document must 60 include Simplified BSD License text as described in Section 4.e of 61 the Trust Legal Provisions and are provided without warranty as 62 described in the Simplified BSD License. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 67 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 68 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 69 2. Model Structure . . . . . . . . . . . . . . . . . . . . . . . 3 70 2.1. RIB Capability . . . . . . . . . . . . . . . . . . . . . 7 71 2.2. Routing Instance and Rib . . . . . . . . . . . . . . . . 7 72 2.3. Route . . . . . . . . . . . . . . . . . . . . . . . . . . 8 73 2.4. Nexthop . . . . . . . . . . . . . . . . . . . . . . . . . 9 74 2.5. RPC Operations . . . . . . . . . . . . . . . . . . . . . 14 75 2.6. Notifications . . . . . . . . . . . . . . . . . . . . . . 18 76 3. YANG Modules . . . . . . . . . . . . . . . . . . . . . . . . 20 77 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 64 78 5. Security Considerations . . . . . . . . . . . . . . . . . . . 65 79 6. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 66 80 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 66 81 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 66 82 8.1. Normative References . . . . . . . . . . . . . . . . . . 66 83 8.2. Informative References . . . . . . . . . . . . . . . . . 67 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 68 86 1. Introduction 88 The Interface to the Routing System (I2RS) [RFC7921] provides read 89 and write access to the information and state within the routing 90 process that exists inside the routing elements, this is achieved via 91 protocol message exchange between I2RS clients and I2RS agents 92 associated with the routing system. One of the functions of I2RS is 93 to read and write data of the Routing Information Base (RIB). 94 [I-D.ietf-i2rs-usecase-reqs-summary] introduces a set of RIB use 95 cases. The RIB information model is defined in 96 [I-D.ietf-i2rs-rib-info-model]. 98 This document defines a YANG [RFC7950][RFC6991] data model for the 99 RIB that satisfies the RIB use cases and aligns with the RIB 100 information model. 102 1.1. Definitions and Acronyms 104 RIB: Routing Information Base 106 FIB: Forwarding Information Base 108 RPC: Remote Procedure Call 110 Information Model (IM): An abstract model of a conceptual domain, 111 independent of a specific implementation or data representation. 113 1.2. Tree Diagrams 115 Tree diagrams used in this document follow the notation defined in 116 [RFC8340]. 118 2. Model Structure 120 The following figure shows an overview of structure tree of the ietf- 121 i2rs-rib module. To give a whole view of the structure tree, some 122 details of the tree are omitted. The relevant details are introduced 123 in the subsequent sub-sections. 125 module: ietf-i2rs-rib 126 +--rw routing-instance 127 +--rw name string 128 +--rw interface-list* [name] 129 | +--rw name if:interface-ref 130 +--rw router-id? yang:dotted-quad 131 +--rw lookup-limit? uint8 132 +--rw rib-list* [name] 133 +--rw name string 134 +--rw address-family address-family-definition 135 +--rw ip-rpf-check? boolean 136 +--rw route-list* [route-index] 137 | +--rw route-index uint64 138 | +--rw match 139 | | +--rw (route-type)? 140 | | +--:(ipv4) 141 | | | ... 142 | | +--:(ipv6) 143 | | | ... 144 | | +--:(mpls-route) 145 | | | ... 147 | | +--:(mac-route) 148 | | | ... 149 | | +--:(interface-route) 150 | | ... 151 | +--rw nexthop 152 | | +--rw nexthop-id? uint32 153 | | +--rw sharing-flag? boolean 154 | | +--rw (nexthop-type)? 155 | | +--:(nexthop-base) 156 | | | ... 157 | | +--:(nexthop-chain) {nexthop-chain}? 158 | | | ... 159 | | +--:(nexthop-replicates) {nexthop-replicates}? 160 | | | ... 161 | | +--:(nexthop-protection) {nexthop-protection}? 162 | | | ... 163 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 164 | | ... 165 | +--rw route-status 166 | | ... 167 | +--rw route-attributes 168 | | ... 169 | +--rw route-vendor-attributes 170 +--rw nexthop-list* [nexthop-member-id] 171 +--rw nexthop-member-id uint32 172 rpcs: 173 +---x rib-add 174 | +---w input 175 | | +---w name string 176 | | +---w address-family address-family-definition 177 | | +---w ip-rpf-check? boolean 178 | +--ro output 179 | +--ro result uint32 180 | +--ro reason? string 181 +---x rib-delete 182 | +---w input 183 | | +---w name string 184 | +--ro output 185 | +--ro result uint32 186 | +--ro reason? string 187 +---x route-add 188 | +---w input 189 | | +---w return-failure-detail? boolean 190 | | +---w rib-name string 191 | | +---w routes 192 | | +---w route-list* [route-index] 193 | | ... 194 | +--ro output 195 | +--ro success-count uint32 196 | +--ro failed-count uint32 197 | +--ro failure-detail 198 | +--ro failed-routes* [route-index] 199 | +--ro route-index uint32 200 | +--ro error-code? uint32 201 +---x route-delete 202 | +---w input 203 | | +---w return-failure-detail? boolean 204 | | +---w rib-name string 205 | | +---w routes 206 | | +---w route-list* [route-index] 207 | | ... 208 | +--ro output 209 | +--ro success-count uint32 210 | +--ro failed-count uint32 211 | +--ro failure-detail 212 | +--ro failed-routes* [route-index] 213 | +--ro route-index uint32 214 | +--ro error-code? uint32 215 +---x route-update 216 | +---w input 217 | | +---w return-failure-detail? boolean 218 | | +---w rib-name string 219 | | +---w (match-options)? 220 | | +--:(match-route-prefix) 221 | | | ... 222 | | +--:(match-route-attributes) 223 | | | ... 224 | | +--:(match-route-vendor-attributes) {...}? 225 | | | ... 226 | | +--:(match-nexthop) 227 | | ... 228 | +--ro output 229 | +--ro success-count uint32 230 | +--ro failed-count uint32 231 | +--ro failure-detail 232 | +--ro failed-routes* [route-index] 233 | +--ro route-index uint32 234 | +--ro error-code? uint32 235 +---x nh-add 236 | +---w input 237 | | +---w rib-name string 238 | | +---w nexthop-id? uint32 239 | | +---w sharing-flag? boolean 240 | | +---w (nexthop-type)? 241 | | +--:(nexthop-base) 242 | | | ... 244 | | +--:(nexthop-chain) {nexthop-chain}? 245 | | | ... 246 | | +--:(nexthop-replicates) {nexthop-replicates}? 247 | | | ... 248 | | +--:(nexthop-protection) {nexthop-protection}? 249 | | | ... 250 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 251 | | ... 252 | +--ro output 253 | +--ro result uint32 254 | +--ro reason? string 255 | +--ro nexthop-id? uint32 256 +---x nh-delete 257 +---w input 258 | +---w rib-name string 259 | +---w nexthop-id? uint32 260 | +---w sharing-flag? boolean 261 | +---w (nexthop-type)? 262 | +--:(nexthop-base) 263 | | ... 264 | +--:(nexthop-chain) {nexthop-chain}? 265 | | ... 266 | +--:(nexthop-replicates) {nexthop-replicates}? 267 | | ... 268 | +--:(nexthop-protection) {nexthop-protection}? 269 | | ... 270 | +--:(nexthop-load-balance) {nexthop-load-balance}? 271 | ... 272 +--ro output 273 +--ro result uint32 274 +--ro reason? string 275 notifications: 276 +---n nexthop-resolution-status-change 277 | +--ro nexthop 278 | | +--ro nexthop-id? uint32 279 | | +--ro sharing-flag? boolean 280 | | +--ro (nexthop-type)? 281 | | +--:(nexthop-base) 282 | | | ... 283 | | +--:(nexthop-chain) {nexthop-chain}? 284 | | | ... 285 | | +--:(nexthop-replicates) {nexthop-replicates}? 286 | | | ... 287 | | +--:(nexthop-protection) {nexthop-protection}? 288 | | | ... 289 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 290 | | ... 291 | +--ro nexthop-state nexthop-state-definition 292 +---n route-change 293 +--ro rib-name string 294 +--ro address-family address-family-definition 295 +--ro route-index uint64 296 +--ro match 297 | +--ro (route-type)? 298 | +--:(ipv4) 299 | | ... 300 | +--:(ipv6) 301 | | ... 302 | +--:(mpls-route) 303 | | ... 304 | +--:(mac-route) 305 | | ... 306 | +--:(interface-route) 307 | ... 308 +--ro route-installed-state route-installed-state-definition 309 +--ro route-state route-state-definition 310 +--ro route-change-reason route-change-reason-definition 312 Figure 1: Overview of I2RS RIB Module Structure 314 2.1. RIB Capability 316 RIB capability negotiation is very important because not all of the 317 hardware will be able to support all kinds of nexthops and there 318 might be a limitation on how many levels of lookup can be practically 319 performed. Therefore, a RIB data model needs to specify a way for an 320 external entity to learn about the functional capabilities of a 321 network device. 323 At the same time, nexthop chains can be used to specify multiple 324 headers over a packet, before that particular packet is forwarded. 325 Not every network device will be able to support all kinds of nexthop 326 chains along with the arbitrary number of headers which are chained 327 together. The RIB data model needs a way to expose the nexthop 328 chaining capability supported by a given network device. 330 This module uses the feature and if-feature statements to achieve 331 above capability advertisement. 333 2.2. Routing Instance and Rib 335 A routing instance, in the context of the RIB information model, is a 336 collection of RIBs, interfaces, and routing protocol parameters. A 337 routing instance creates a logical slice of the router and can allow 338 multiple different logical slices, across a set of routers, to 339 communicate with each other. The routing protocol parameters control 340 the information available in the RIBs. More details about routing 341 instance can be found in Section 2.2 of 342 [I-D.ietf-i2rs-rib-info-model]. 344 For a routing instance, there can be multiple RIBs. Therefore, this 345 model uses "list" to express the RIBs. The structure tree is shown 346 below: 348 +--rw routing-instance 349 +--rw name string 350 +--rw interface-list* [name] 351 | +--rw name if:interface-ref 352 +--rw router-id? yang:dotted-quad 353 +--rw lookup-limit? uint8 354 +--rw rib-list* [name] 355 +--rw name string 356 +--rw address-family address-family-definition 357 +--rw ip-rpf-check? boolean 358 +--rw route-list* [route-index] 359 ... (refer to Section 2.3) 361 Figure 2: Routing Instance Structure 363 2.3. Route 365 A route is essentially a match condition and an action following that 366 match. The match condition specifies the kind of route (e.g., IPv4, 367 MPLS, MAC, Interface etc.) and the set of fields to match on. 369 According to the definition in [I-D.ietf-i2rs-rib-info-model], a 370 route MUST associate with the following attributes: 372 o ROUTE_PREFERENCE: See Section 2.3 of 373 [I-D.ietf-i2rs-rib-info-model]. 375 o ACTIVE: Indicates whether a route has at least one fully resolved 376 nexthop and is therefore eligible for installation in the FIB. 378 o INSTALLED: Indicates whether the route got installed in the FIB. 380 o REASON - Indicates the specific reason that caused the failure, 381 E.g. Not authorized. 383 In addition, a route can be associated with one or more optional 384 route attributes (e.g., route-vendor-attributes). 386 A RIB will have a number of routes, so the routes are expressed as a 387 list under a specific RIB. Each RIB has its own route list. 389 +--rw route-list* [route-index] 390 +--rw route-index uint64 391 +--rw match 392 | +--rw (route-type)? 393 | +--:(ipv4) 394 | | +--rw ipv4 395 | | +--rw (ip-route-match-type)? 396 | | +--:(dest-ipv4-address) 397 | | | ... 398 | | +--:(src-ipv4-address) 399 | | | ... 400 | | +--:(dest-src-ipv4-address) 401 | | ... 402 | +--:(ipv6) 403 | | +--rw ipv6 404 | | +--rw (ip-route-match-type)? 405 | | +--:(dest-ipv6-address) 406 | | | ... 407 | | +--:(src-ipv6-address) 408 | | | ... 409 | | +--:(dest-src-ipv6-address) 410 | | ... 411 | +--:(mpls-route) 412 | | +--rw mpls-label uint32 413 | +--:(mac-route) 414 | | +--rw mac-address uint32 415 | +--:(interface-route) 416 | +--rw interface-identifier if:interface-ref 417 +--rw nexthop 418 | ...(refer to Section 2.4) 420 Figure 3: Routes Structure 422 2.4. Nexthop 424 A nexthop represents an object resulting from a route lookup. As 425 illustrated in Section 2.4 of [I-D.ietf-i2rs-rib-info-model], to 426 support various use cases (e.g., load balancing, protection, 427 multicast or a combination of them), the nexthop is modeled as a 428 multi-level structure and supports recursion. The first level of the 429 nexthop includes the following four types: 431 o Base: The "base" nexthop is the foundation of all other nexthop 432 types. It includes the follow basic nexthops: 434 * nexthop-id 436 * IPv4 address 437 * IPv6 address 439 * egress-interface 441 * egress-interface with IPv4 address 443 * egress-interface with IPv6 address 445 * egress-interface with MAC address 447 * logical-tunnel 449 * tunnel-encapsulation 451 * tunnel-decapsulation 453 * rib-name 455 o Chain: Provide a way to perform multiple operations on a packet by 456 logically combining them. 458 o Load-balance: Designed for load-balance case where it normally 459 will have multiple weighted nexthops. 461 o Protection: Designed for protection scenario where it normally 462 will have primary and standby nexthop. 464 o Replicate: Designed for multiple destinations forwarding. 466 The structure tree of nexthop is shown in the following figures. 468 +--rw nexthop 469 | +--rw nexthop-id? uint32 470 | +--rw sharing-flag? boolean 471 | +--rw (nexthop-type)? 472 | +--:(nexthop-base) 473 | | ...(refer to Figure 5) 474 | +--:(nexthop-chain) {nexthop-chain}? 475 | | +--rw nexthop-chain 476 | | +--rw nexthop-list* [nexthop-member-id] 477 | | +--rw nexthop-member-id uint32 478 | +--:(nexthop-replicates) {nexthop-replicates}? 479 | | +--rw nexthop-replicates 480 | | +--rw nexthop-list* [nexthop-member-id] 481 | | +--rw nexthop-member-id uint32 482 | +--:(nexthop-protection) {nexthop-protection}? 483 | | +--rw nexthop-protection 484 | | +--rw nexthop-list* [nexthop-member-id] 485 | | +--rw nexthop-member-id uint32 486 | | +--rw nexthop-preference nexthop-preference-definition 487 | +--:(nexthop-load-balance) {nexthop-load-balance}? 488 | +--rw nexthop-lb 489 | +--rw nexthop-list* [nexthop-member-id] 490 | +--rw nexthop-member-id uint32 491 | +--rw nexthop-lb-weight nexthop-lb-weight-definition 493 Figure 4: Nexthop Structure 495 Figure 5 (as shown below) is a sub-tree of nexthop, it's under the 496 nexthop base node and shows that structure of the "base" nexthop. 498 +--:(nexthop-base) 499 | +--rw nexthop-base 500 | +--rw (nexthop-base-type)? 501 | +--:(special-nexthop) 502 | | +--rw special? special-nexthop-definition 503 | +--:(egress-interface-nexthop) 504 | | +--rw outgoing-interface if:interface-ref 505 | +--:(ipv4-address-nexthop) 506 | | +--rw ipv4-address inet:ipv4-address 507 | +--:(ipv6-address-nexthop) 508 | | +--rw ipv6-address inet:ipv6-address 509 | +--:(egress-interface-ipv4-nexthop) 510 | | +--rw egress-interface-ipv4-address 511 | | +--rw outgoing-interface if:interface-ref 512 | | +--rw ipv4-address inet:ipv4-address 513 | +--:(egress-interface-ipv6-nexthop) 514 | | +--rw egress-interface-ipv6-address 515 | | +--rw outgoing-interface if:interface-ref 516 | | +--rw ipv6-address inet:ipv6-address 517 | +--:(egress-interface-mac-nexthop) 518 | | +--rw egress-interface-mac-address 519 | | +--rw outgoing-interface if:interface-ref 520 | | +--rw ieee-mac-address yang:mac-address 521 | +--:(tunnel-encap-nexthop) {nexthop-tunnel}? 522 | | +--rw tunnel-encap 523 | | +--rw (tunnel-type)? 524 | | +--:(ipv4) {ipv4-tunnel}? 525 | | | +--rw ipv4-header 526 | | | +--rw src-ipv4-address inet:ipv4-address 527 | | | +--rw dest-ipv4-address inet:ipv4-address 528 | | | +--rw protocol uint8 529 | | | +--rw ttl? uint8 530 | | | +--rw dscp? uint8 531 | | +--:(ipv6) {ipv6-tunnel}? 532 | | | +--rw ipv6-header 533 | | | +--rw src-ipv6-address inet:ipv6-address 534 | | | +--rw dest-ipv6-address inet:ipv6-address 535 | | | +--rw next-header uint8 536 | | | +--rw traffic-class? uint8 537 | | | +--rw flow-label? inet:ipv6-flow-label 538 | | | +--rw hop-limit? uint8 539 | | +--:(mpls) {mpls-tunnel}? 540 | | | +--rw mpls-header 541 | | | +--rw label-operations* [label-oper-id] 542 | | | +--rw label-oper-id uint32 543 | | | +--rw (label-actions)? 544 | | | +--:(label-push) 545 | | | | +--rw label-push 546 | | | | +--rw label uint32 547 | | | | +--rw s-bit? boolean 548 | | | | +--rw tc-value? uint8 549 | | | | +--rw ttl-value? uint8 550 | | | +--:(label-swap) 551 | | | +--rw label-swap 552 | | | +--rw out-label uint32 553 | | | +--rw ttl-action? ttl-action- 554 definition 555 | | +--:(gre) {gre-tunnel}? 556 | | | +--rw gre-header 557 | | | +--rw (dest-address-type)? 558 | | | | +--:(ipv4) 559 | | | | | +--rw ipv4-dest inet:ipv4-address 560 | | | | +--:(ipv6) 561 | | | | +--rw ipv6-dest inet:ipv6-address 562 | | | +--rw protocol-type uint16 563 | | | +--rw key? uint64 564 | | +--:(nvgre) {nvgre-tunnel}? 565 | | | +--rw nvgre-header 566 | | | +--rw (nvgre-type)? 567 | | | | +--:(ipv4) 568 | | | | | +--rw src-ipv4-address inet:ipv4-address 569 | | | | | +--rw dest-ipv4-address inet:ipv4-address 570 | | | | | +--rw protocol uint8 571 | | | | | +--rw ttl? uint8 572 | | | | | +--rw dscp? uint8 573 | | | | +--:(ipv6) 574 | | | | +--rw src-ipv6-address inet:ipv6-address 575 | | | | +--rw dest-ipv6-address inet:ipv6-address 576 | | | | +--rw next-header uint8 577 | | | | +--rw traffic-class? uint8 578 | | | | +--rw flow-label? inet:ipv6-flow-label 579 | | | | +--rw hop-limit? uint8 580 | | | +--rw virtual-subnet-id uint32 581 | | | +--rw flow-id? uint8 582 | | +--:(vxlan) {vxlan-tunnel}? 583 | | +--rw vxlan-header 584 | | +--rw (vxlan-type)? 585 | | | +--:(ipv4) 586 | | | | +--rw src-ipv4-address inet:ipv4-address 587 | | | | +--rw dest-ipv4-address inet:ipv4-address 588 | | | | +--rw protocol uint8 589 | | | | +--rw ttl? uint8 590 | | | | +--rw dscp? uint8 591 | | | +--:(ipv6) 592 | | | +--rw src-ipv6-address inet:ipv6-address 593 | | | +--rw dest-ipv6-address inet:ipv6-address 594 | | | +--rw next-header uint8 595 | | | +--rw traffic-class? uint8 596 | | | +--rw flow-label? inet:ipv6-flow-label 597 | | | +--rw hop-limit? uint8 598 | | +--rw vxlan-identifier uint32 599 | +--:(tunnel-decapsulation-nexthop) {nexthop-tunnel}? 600 | | +--rw tunnel-decapsulation 601 | | +--rw (tunnel-type)? 602 | | +--:(ipv4) {ipv4-tunnel}? 603 | | | +--rw ipv4-decapsulation 604 | | | +--rw ipv4-decapsulation tunnel-decapsulation- 605 action-definition 606 | | | +--rw ttl-action? ttl-action-definition 607 | | +--:(ipv6) {ipv6-tunnel}? 608 | | | +--rw ipv6-decapsulation 609 | | | +--rw ipv6-decapsulation tunnel-decapsulation- 610 action-definition 611 | | | +--rw hop-limit-action? hop-limit-action- 612 definition 613 | | +--:(mpls) {mpls-tunnel}? 614 | | +--rw label-pop 615 | | +--rw label-pop mpls-label-action-definition 616 | | +--rw ttl-action? ttl-action-definition 617 | +--:(logical-tunnel-nexthop) {nexthop-tunnel}? 618 | | +--rw logical-tunnel 619 | | +--rw tunnel-type tunnel-type-definition 620 | | +--rw tunnel-name string 621 | +--:(rib-name-nexthop) 622 | | +--rw rib-name? string 623 | +--:(nexthop-identifier) 624 | +--rw nexthop-ref nexthop-ref 626 Figure 5: Nexthop Base Structure 628 2.5. RPC Operations 630 This module defines the following RPC operations: 632 o rib-add: Add a RIB to a routing instance. A name of the RIB, 633 address family of the RIB and (optionally) whether the RPF check 634 is enabled are passed as the input parameters. The output is the 635 result of the add operation: 637 * true - success; 639 * false - failed; when failed, the i2rs agent may return the 640 specific reason that caused the failure. 642 o rib-delete: Delete a RIB from a routing instance. When a RIB is 643 deleted, all routes installed in the RIB will be deleted. A name 644 of the RIB is passed as the input parameter. The output is the 645 result of the delete operation: 647 * true - success; 649 * false - failed; when failed, the i2rs agent may return the 650 specific reason that caused the failure. 652 o route-add: Add a route or a set of routes to a RIB. A RIB name, 653 the route prefix(es), route attributes, route vendor attributes, 654 nexthop and whether return failure details are passed as the input 655 parameters. Before calling the route-add rpc, it is required to 656 call the nh-add rpc to create and/or return the nexthop 657 identifier. However, in situations when the nexthop already 658 exists and the nexthop-id is known, this action is not expected. 660 The output is a combination of the route operation states while 661 querying the appropriate node in the data tree that include: 663 * success-count: the number of routes that were successfully 664 added; 666 * failed-count: the number of the routes that failed to be added; 668 * failure-detail: shows the specific routes that failed to be 669 added. 671 o route-delete: Delete a route or a set of routes from a RIB. A 672 name of the RIB, the route prefix(es) and whether to return 673 failure details are passed as the input parameters. The output is 674 a combination of route operation states that include: 676 * success-count: the number of routes that were successfully 677 deleted; 679 * failed-count: the number of the routes that failed to be 680 deleted; 682 * failure-detail: shows the specific routes that failed to be 683 deleted. 685 o route-update: Update a route or a set of routes. A RIB name, the 686 route prefix(es), or route attributes, or route vendor attributes, 687 or nexthop are passed as the input parameters. The match 688 conditions can be either route prefix(es), or route attributes, or 689 route vendor attributes, or nexthop. The update actions include: 690 update the nexthop, update the route attributes, update the route 691 vendor attributes. The output is combination of the route 692 operation states that include: 694 * success-count: the number of routes that were successfully 695 updated; 697 * failed-count: the number of the routes that failed to be 698 updated; 700 * failure-detail: shows the specific routes that failed to be 701 updated. 703 o nh-add: Add a nexthop to a RIB. A name of the RIB and a nexthop 704 are passed as the input parameters. The network node is required 705 to allocate a nexthop identifier to the nexthop. The outputs 706 include the result of the nexthop add operation. 708 * true - success; when success, a nexthop identifier will be 709 returned to the i2rs client. 711 * false - failed; when failed, the i2rs agent may return the 712 specific reason that caused the failure. 714 o nh-delete: Delete a nexthop from a RIB. A name of a RIB and a 715 nexthop or nexthop identifier are passed as the input parameters. 716 The output is the result of the delete operation: 718 * true - success; 720 * false - failed; when failed, the i2rs agent may return the 721 specific reason that caused the failure. 723 The structure tree of rpcs is shown in following figure. 725 rpcs: 726 +---x rib-add 727 | +---w input 728 | | +---w rib-name string 729 | | +---w address-family address-family-definition 730 | | +---w ip-rpf-check? boolean 731 | +--ro output 732 | +--ro result uint32 733 | +--ro reason? string 734 +---x rib-delete 735 | +---w input 736 | | +---w rib-name string 737 | +--ro output 738 | +--ro result uint32 739 | +--ro reason? string 740 +---x route-add 741 | +---w input 742 | | +---w return-failure-detail? boolean 743 | | +---w rib-name string 744 | | +---w routes 745 | | +---w route-list* [route-index] 746 | | ... 747 | +--ro output 748 | +--ro success-count uint32 749 | +--ro failed-count uint32 750 | +--ro failure-detail 751 | +--ro failed-routes* [route-index] 752 | +--ro route-index uint32 753 | +--ro error-code? uint32 754 +---x route-delete 755 | +---w input 756 | | +---w return-failure-detail? boolean 757 | | +---w rib-name string 758 | | +---w routes 759 | | +---w route-list* [route-index] 760 | | ... 761 | +--ro output 762 | +--ro success-count uint32 763 | +--ro failed-count uint32 764 | +--ro failure-detail 765 | +--ro failed-routes* [route-index] 766 | +--ro route-index uint32 767 | +--ro error-code? uint32 768 +---x route-update 769 | +---w input 770 | | +---w return-failure-detail? boolean 771 | | +---w rib-name string 772 | | +---w (match-options)? 773 | | +--:(match-route-prefix) 774 | | | ... 775 | | +--:(match-route-attributes) 776 | | | ... 777 | | +--:(match-route-vendor-attributes) {...}? 778 | | | ... 779 | | +--:(match-nexthop) 780 | | ... 781 | +--ro output 782 | +--ro success-count uint32 783 | +--ro failed-count uint32 784 | +--ro failure-detail 785 | +--ro failed-routes* [route-index] 786 | +--ro route-index uint32 787 | +--ro error-code? uint32 788 +---x nh-add 789 | +---w input 790 | | +---w rib-name string 791 | | +---w nexthop-id? uint32 792 | | +---w sharing-flag? boolean 793 | | +---w (nexthop-type)? 794 | | ... 795 | +--ro output 796 | +--ro result uint32 797 | +--ro reason? string 798 | +--ro nexthop-id? uint32 799 +---x nh-delete 800 +---w input 801 | +---w rib-name string 802 | +---w nexthop-id? uint32 803 | +---w sharing-flag? boolean 804 | +---w (nexthop-type)? 805 | ... 806 +--ro output 807 +--ro result uint32 808 +--ro reason? string 810 Figure 6: RPCs Structure 812 2.6. Notifications 814 Asynchronous notifications are sent by the RIB manager of a network 815 device to an external entity when some event triggers on the network 816 device. An implementation of this RIB data model MUST support 817 sending two kinds of asynchronous notifications. 819 1. Route change notification: 821 o Installed (Indicates whether the route got installed in the FIB) ; 823 o Active (Indicates whether a route has at least one fully resolved 824 nexthop and is therefore eligible for installation in the FIB) ; 826 o Reason - E.g. Not authorized 828 2. Nexthop resolution status notification 830 Nexthops can be fully resolved or unresolved. 832 A resolved nexthop has an adequate level of information to send the 833 outgoing packet towards the destination by forwarding it on an 834 interface to a directly connected neighbor. 836 An unresolved nexthop is something that requires the RIB manager to 837 determine the final resolved nexthop. In one example, a nexthop 838 could be an IP address. The RIB manager would resolve how to reach 839 that IP address, e.g. by checking if that particular IP address is 840 reachable by regular IP forwarding or by a MPLS tunnel or by both. 841 If the RIB manager cannot resolve the nexthop, then the nexthop 842 remains in an unresolved state and is NOT a suitable candidate for 843 installation in the FIB. 845 An implementation of this RIB data model MUST support sending route- 846 change notifications whenever a route transitions between the 847 following states: 849 o from the active state to the inactive state 851 o from the inactive state to the active state 852 o from the installed state to the uninstalled state 854 o from the uninstalled state to the installed state 856 A single notification MAY be used when a route transitions from 857 inactive/uninstalled to active/installed or in the other direction. 859 The structure tree of notifications is shown in the following figure. 861 notifications: 862 +---n nexthop-resolution-status-change 863 | +--ro nexthop 864 | | +--ro nexthop-id uint32 865 | | +--ro sharing-flag boolean 866 | | +--ro (nexthop-type)? 867 | | +--:(nexthop-base) 868 | | | ... 869 | | +--:(nexthop-chain) {nexthop-chain}? 870 | | | ... 871 | | +--:(nexthop-replicate) {nexthop-replicate}? 872 | | | ... 873 | | +--:(nexthop-protection) {nexthop-protection}? 874 | | | ... 875 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 876 | | ... 877 | +--ro nexthop-state nexthop-state-definition 878 +---n route-change 879 +--ro rib-name string 880 +--ro address-family address-family-definition 881 +--ro route-index uint64 882 +--ro match 883 | +--ro (route-type)? 884 | +--:(ipv4) 885 | | ... 886 | +--:(ipv6) 887 | | ... 888 | +--:(mpls-route) 889 | | ... 890 | +--:(mac-route) 891 | | ... 892 | +--:(interface-route) 893 | ... 894 +--ro route-installed-state route-installed-state-definition 895 +--ro route-state route-state-definition 896 +--ro route-change-reason route-change-reason-definition 898 Figure 7: Notifications Structure 900 3. YANG Modules 902 file "ietf-i2rs-rib@2018-04-23.yang" 904 module ietf-i2rs-rib { 905 yang-version 1.1; 906 namespace "urn:ietf:params:xml:ns:yang:ietf-i2rs-rib"; 907 prefix "iir"; 909 import ietf-inet-types { 910 prefix inet; 911 reference "RFC 6991"; 912 } 914 import ietf-interfaces { 915 prefix if; 916 reference "RFC 8344"; 917 } 919 import ietf-yang-types { 920 prefix yang; 921 reference "RFC 6991"; 922 } 924 organization 925 "IETF I2RS (Interface to Routing System) Working Group"; 926 contact 927 "WG Web: 928 WG List: 930 Editor: Lixing Wang 931 933 Editor: Mach(Guoyi) Chen 934 936 Editor: Amit Dass 937 939 Editor: Hariharan Ananthakrishnan 940 942 Editor: Sriganesh Kini 943 945 Editor: Nitin Bahadur 946 "; 947 description 948 "This module defines a YANG data model for 949 Routing Information Base (RIB) that aligns 950 with the I2RS RIB information model. 951 Copyright (c) <2018> IETF Trust and the persons 952 identified as authors of the code. All rights reserved."; 953 revision "2018-04-23" { 954 description "initial revision"; 955 reference "RFC XXXX: draft-ietf-i2rs-data-model-10"; 956 // RFC Ed.: replace XXXX with actual RFC number and remove 957 // this note 958 } 960 //Features 961 feature nexthop-tunnel { 962 description 963 "This feature means that a node supports 964 tunnel nexthop capability."; 965 } 967 feature nexthop-chain { 968 description 969 "This feature means that a node supports 970 chain nexthop capability."; 971 } 973 feature nexthop-protection { 974 description 975 "This feature means that a node supports 976 protection nexthop capability."; 977 } 979 feature nexthop-replicate { 980 description 981 "This feature means that a node supports 982 replicates nexthop capability."; 983 } 985 feature nexthop-load-balance { 986 description 987 "This feature means that a node supports 988 load balance nexthop capability."; 989 } 991 feature ipv4-tunnel { 992 description 993 "This feature means that a node supports 994 IPv4 tunnel encapsulation capability."; 995 } 996 feature ipv6-tunnel { 997 description 998 "This feature means that a node supports 999 IPv6 tunnel encapsulation capability."; 1000 } 1002 feature mpls-tunnel { 1003 description 1004 "This feature means that a node supports 1005 MPLS tunnel encapsulation capability."; 1006 } 1008 feature vxlan-tunnel { 1009 description 1010 "This feature means that a node supports 1011 VXLAN tunnel encapsulation capability."; 1012 reference "RFC7348"; 1013 } 1015 feature gre-tunnel { 1016 description 1017 "This feature means that a node supports 1018 GRE tunnel encapsulation capability."; 1019 reference "RFC2784"; 1020 } 1022 feature nvgre-tunnel { 1023 description 1024 "This feature means that a node supports 1025 NvGRE tunnel encapsulation capability."; 1026 reference "RFC7637"; 1027 } 1029 feature route-vendor-attributes { 1030 description 1031 "This feature means that a node supports 1032 route vendor attributes."; 1033 } 1035 //Identities and Type Definitions 1036 identity mpls-label-action { 1037 description 1038 "Base identity from which all MPLS label 1039 operations are derived. 1040 The MPLS label stack operations include: 1041 push - to add a new label to a label stack, 1042 pop - to pop the top label from a label stack, 1043 swap - to exchange the top label of a label 1044 stack with new label."; 1045 } 1047 identity label-push { 1048 base "mpls-label-action"; 1049 description 1050 "MPLS label stack operation: push."; 1051 } 1053 identity label-pop { 1054 base "mpls-label-action"; 1055 description 1056 "MPLS label stack operation: pop."; 1057 } 1059 identity label-swap { 1060 base "mpls-label-action"; 1061 description 1062 "MPLS label stack operation: swap."; 1063 } 1065 typedef mpls-label-action-definition { 1066 type identityref { 1067 base "mpls-label-action"; 1068 } 1069 description 1070 "MPLS label action definition."; 1071 } 1073 identity tunnel-decapsulation-action { 1074 description 1075 "Base identity from which all tunnel decapsulation 1076 actions are derived. 1077 Tunnel decapsulation actions include: 1078 ipv4-decapsulation - to decapsulate an IPv4 tunnel, 1079 ipv6-decapsulation - to decapsulate an IPv6 tunnel."; 1080 } 1082 identity ipv4-decapsulation { 1083 base "tunnel-decapsulation-action"; 1084 description 1085 "IPv4 tunnel decapsulation."; 1086 } 1088 identity ipv6-decapsulation { 1089 base "tunnel-decapsulation-action"; 1090 description 1091 "IPv6 tunnel decapsulation."; 1093 } 1095 typedef tunnel-decapsulation-action-definition { 1096 type identityref { 1097 base "tunnel-decapsulation-action"; 1098 } 1099 description 1100 "Tunnel decapsulation definition."; 1101 } 1103 identity ttl-action { 1104 description 1105 "Base identity from which all TTL 1106 actions are derived."; 1107 } 1109 identity no-action { 1110 base "ttl-action"; 1111 description 1112 "Do nothing regarding the TTL."; 1113 } 1115 identity copy-to-inner { 1116 base "ttl-action"; 1117 description 1118 "Copy the TTL of the outer header 1119 to the inner header."; 1120 } 1122 identity decrease-and-copy-to-inner { 1123 base "ttl-action"; 1124 description 1125 "Decrease TTL by one and copy the TTL 1126 to the inner header."; 1127 } 1129 identity decrease-and-copy-to-next { 1130 base "ttl-action"; 1131 description 1132 "Decrease TTL by one and copy the TTL 1133 to the next header. For example: when 1134 MPLS label swapping, decrease the TTL 1135 of the in_label and copy it to the 1136 out_label."; 1137 } 1139 typedef ttl-action-definition { 1140 type identityref { 1141 base "ttl-action"; 1142 } 1143 description 1144 "TTL action definition."; 1145 } 1147 identity hop-limit-action { 1148 description 1149 "Base identity from which all hop limit 1150 actions are derived."; 1151 } 1153 identity hop-limit-no-action { 1154 base "hop-limit-action"; 1155 description 1156 "Do nothing regarding the hop limit."; 1157 } 1159 identity hop-limit-copy-to-inner { 1160 base "hop-limit-action"; 1161 description 1162 "Copy the hop limit of the outer header 1163 to the inner header."; 1164 } 1166 typedef hop-limit-action-definition { 1167 type identityref { 1168 base "hop-limit-action"; 1169 } 1170 description 1171 "IPv6 hop limit action definition."; 1172 } 1174 identity special-nexthop { 1175 description 1176 "Base identity from which all special 1177 nexthops are derived."; 1178 } 1180 identity discard { 1181 base "special-nexthop"; 1182 description 1183 "This indicates that the network 1184 device should drop the packet and 1185 increment a drop counter."; 1186 } 1188 identity discard-with-error { 1189 base "special-nexthop"; 1190 description 1191 "This indicates that the network 1192 device should drop the packet, 1193 increment a drop counter and send 1194 back an appropriate error message 1195 (like ICMP error)."; 1196 } 1198 identity receive { 1199 base "special-nexthop"; 1200 description 1201 "This indicates that the traffic is 1202 destined for the network device. For 1203 example, protocol packets or OAM packets. 1204 All locally destined traffic SHOULD be 1205 throttled to avoid a denial of service 1206 attack on the router's control plane. An 1207 optional rate-limiter can be specified 1208 to indicate how to throttle traffic 1209 destined for the control plane."; 1210 } 1212 identity cos-value { 1213 base "special-nexthop"; 1214 description 1215 "Cos-value special nexthop."; 1216 } 1218 typedef special-nexthop-definition { 1219 type identityref { 1220 base "special-nexthop"; 1221 } 1222 description 1223 "Special nexthop definition."; 1224 } 1226 identity ip-route-match-type { 1227 description 1228 "Base identity from which all route 1229 match types are derived. 1230 Route match type could be: 1231 match source, or 1232 match destination, or 1233 match source and destination."; 1234 } 1236 identity match-ip-src { 1237 base "ip-route-match-type"; 1238 description 1239 "Source route match type."; 1240 } 1241 identity match-ip-dest { 1242 base "ip-route-match-type"; 1243 description 1244 "Destination route match type"; 1245 } 1246 identity match-ip-src-dest { 1247 base "ip-route-match-type"; 1248 description 1249 "Source and Destination route match type"; 1250 } 1252 typedef ip-route-match-type-definition { 1253 type identityref { 1254 base "ip-route-match-type"; 1255 } 1256 description 1257 "IP route match type definition."; 1258 } 1260 identity address-family { 1261 description 1262 "Base identity from which all RIB 1263 address families are derived."; 1264 } 1266 identity ipv4-address-family { 1267 base "address-family"; 1268 description 1269 "IPv4 RIB address family."; 1270 } 1272 identity ipv6-address-family { 1273 base "address-family"; 1274 description 1275 "IPv6 RIB address family."; 1276 } 1278 identity mpls-address-family { 1279 base "address-family"; 1280 description 1281 "MPLS RIB address family."; 1282 } 1284 identity ieee-mac-address-family { 1285 base "address-family"; 1286 description 1287 "MAC RIB address family."; 1288 } 1290 typedef address-family-definition { 1291 type identityref { 1292 base "address-family"; 1293 } 1294 description 1295 "RIB address family definition."; 1296 } 1298 identity route-type { 1299 description 1300 "Base identity from which all route types 1301 are derived."; 1302 } 1304 identity ipv4-route { 1305 base "route-type"; 1306 description 1307 "IPv4 route type."; 1308 } 1310 identity ipv6-route { 1311 base "route-type"; 1312 description 1313 "IPv6 route type."; 1314 } 1316 identity mpls-route { 1317 base "route-type"; 1318 description 1319 "MPLS route type."; 1320 } 1322 identity ieee-mac { 1323 base "route-type"; 1324 description 1325 "MAC route type."; 1326 } 1328 identity interface { 1329 base "route-type"; 1330 description 1331 "Interface route type."; 1332 } 1333 typedef route-type-definition { 1334 type identityref { 1335 base "route-type"; 1336 } 1337 description 1338 "Route type definition."; 1339 } 1341 identity tunnel-type { 1342 description 1343 "Base identity from which all tunnel 1344 types are derived."; 1345 } 1347 identity ipv4-tunnel { 1348 base "tunnel-type"; 1349 description 1350 "IPv4 tunnel type"; 1351 } 1353 identity ipv6-tunnel { 1354 base "tunnel-type"; 1355 description 1356 "IPv6 Tunnel type"; 1357 } 1359 identity mpls-tunnel { 1360 base "tunnel-type"; 1361 description 1362 "MPLS tunnel type"; 1363 } 1365 identity gre-tunnel { 1366 base "tunnel-type"; 1367 description 1368 "GRE tunnel type"; 1369 } 1371 identity vxlan-tunnel { 1372 base "tunnel-type"; 1373 description 1374 "VXLAN tunnel type"; 1375 } 1377 identity nvgre-tunnel { 1378 base "tunnel-type"; 1379 description 1380 "NVGRE tunnel type"; 1382 } 1384 typedef tunnel-type-definition { 1385 type identityref { 1386 base "tunnel-type"; 1387 } 1388 description 1389 "Tunnel type definition."; 1390 } 1392 identity route-state { 1393 description 1394 "Base identity from which all route 1395 states are derived."; 1396 } 1398 identity active { 1399 base "route-state"; 1400 description 1401 "Active state."; 1402 } 1404 identity inactive { 1405 base "route-state"; 1406 description 1407 "Inactive state."; 1408 } 1410 typedef route-state-definition { 1411 type identityref { 1412 base "route-state"; 1413 } 1414 description 1415 "Route state definition."; 1416 } 1418 identity nexthop-state { 1419 description 1420 "Base identity from which all nexthop 1421 states are derived."; 1422 } 1424 identity resolved { 1425 base "nexthop-state"; 1426 description 1427 "Resolved nexthop state."; 1428 } 1429 identity unresolved { 1430 base "nexthop-state"; 1431 description 1432 "Unresolved nexthop state."; 1433 } 1435 typedef nexthop-state-definition { 1436 type identityref { 1437 base "nexthop-state"; 1438 } 1439 description 1440 "Nexthop state definition."; 1441 } 1443 identity route-installed-state { 1444 description 1445 "Base identity from which all route 1446 installed states are derived."; 1447 } 1449 identity uninstalled { 1450 base "route-installed-state"; 1451 description 1452 "Uninstalled state."; 1453 } 1455 identity installed { 1456 base "route-installed-state"; 1457 description 1458 "Installed state."; 1459 } 1461 typedef route-installed-state-definition { 1462 type identityref { 1463 base "route-installed-state"; 1464 } 1465 description 1466 "Route installed state definition."; 1467 } 1469 //Route change reason identities 1471 identity route-change-reason { 1472 description 1473 "Base identity from which all route change 1474 reasons are derived."; 1475 } 1476 identity lower-route-preference { 1477 base "route-change-reason"; 1478 description 1479 "This route was installed in the FIB because it had 1480 a lower route preference value (and thus was more 1481 preferred) than the route it replaced."; 1482 } 1484 identity higher-route-preference { 1485 base "route-change-reason"; 1486 description 1487 "This route was uninstalled from the FIB because it had 1488 a higher route preference value (and thus was less 1489 preferred) than the route that replaced it."; 1490 } 1492 identity resolved-nexthop { 1493 base "route-change-reason"; 1494 description 1495 "This route was made active because at least 1496 one of its nexthops was resolved."; 1497 } 1499 identity unresolved-nexthop { 1500 base "route-change-reason"; 1501 description 1502 "This route was made inactive because all of 1503 its nexthops are unresolved."; 1504 } 1506 typedef route-change-reason-definition { 1507 type identityref { 1508 base "route-change-reason"; 1509 } 1510 description 1511 "Route change reason definition."; 1512 } 1514 typedef nexthop-preference-definition { 1515 type uint8 { 1516 range "1..99"; 1517 } 1518 description 1519 "Nexthop-preference is used for protection schemes. 1520 It is an integer value between 1 and 99. Lower 1521 values are more preferred. To download N 1522 nexthops to the FIB, the N nexthops with the lowest 1523 value are selected. If there are more than N 1524 nexthops that have the same preference, an 1525 implementation of i2rs client should select N 1526 nexthops and download them, as for how to select 1527 the nexthops is left to the implementations."; 1528 } 1530 typedef nexthop-lb-weight-definition { 1531 type uint8 { 1532 range "1..99"; 1533 } 1534 description 1535 "Nexthop-lb-weight is used for load-balancing. 1536 Each list member SHOULD be assigned a weight 1537 between 1 and 99. The weight determines the 1538 proportion of traffic to be sent over a nexthop 1539 used for forwarding as a ratio of the weight of 1540 this nexthop divided by the sum of the weights 1541 of all the nexthops of this route that are used 1542 for forwarding. To perform equal load-balancing, 1543 one MAY specify a weight of 0 for all the member 1544 nexthops. The value 0 is reserved for equal 1545 load-balancing and if applied, MUST be applied 1546 to all member nexthops. 1547 Note: The weight of 0 is specially because of 1548 historical reasons. It's typically used in 1549 hardware devices to signify ECMP"; 1550 } 1552 typedef nexthop-ref { 1553 type leafref { 1554 path "/iir:routing-instance" + 1555 "/iir:rib-list" + 1556 "/iir:route-list" + 1557 "/iir:nexthop" + 1558 "/iir:nexthop-id"; 1559 } 1560 description 1561 "A nexthop reference that provides 1562 an indirection reference to a nexthop."; 1563 } 1565 //Groupings 1566 grouping route-prefix { 1567 description 1568 "The common attributes used for all types of route prefix."; 1569 leaf route-index { 1570 type uint64 ; 1571 mandatory true; 1572 description 1573 "Route index."; 1574 } 1575 container match { 1576 description 1577 "The match condition specifies the 1578 kind of route (IPv4, MPLS, etc.) 1579 and the set of fields to match on."; 1580 choice route-type { 1581 description 1582 "Route types: IPv4, IPv6, MPLS, MAC etc."; 1583 case ipv4 { 1584 description 1585 "IPv4 route case."; 1586 container ipv4 { 1587 description 1588 "IPv4 route match."; 1589 choice ip-route-match-type { 1590 description 1591 "IP route match type options: 1592 match source, or 1593 match destination, or 1594 match source and destination."; 1595 case dest-ipv4-address { 1596 leaf dest-ipv4-prefix { 1597 type inet:ipv4-prefix; 1598 mandatory true; 1599 description 1600 "An IPv4 destination address as the match."; 1601 } 1602 } 1603 case src-ipv4-address { 1604 leaf src-ipv4-prefix { 1605 type inet:ipv4-prefix; 1606 mandatory true; 1607 description 1608 "An IPv4 source address as the match."; 1609 } 1610 } 1611 case dest-src-ipv4-address { 1612 container dest-src-ipv4-address { 1613 description 1614 "A combination of an IPv4 source and 1615 an IPv4 destination address as the match."; 1616 leaf dest-ipv4-prefix { 1617 type inet:ipv4-prefix; 1618 mandatory true; 1619 description 1620 "The IPv4 destination address of the match."; 1621 } 1622 leaf src-ipv4-prefix { 1623 type inet:ipv4-prefix; 1624 mandatory true; 1625 description 1626 "The IPv4 source address of the match"; 1627 } 1628 } 1629 } 1630 } 1631 } 1632 } 1633 case ipv6 { 1634 description 1635 "IPv6 route case."; 1636 container ipv6 { 1637 description 1638 "IPv6 route match."; 1639 choice ip-route-match-type { 1640 description 1641 "IP route match type options: 1642 match source, or 1643 match destination, or 1644 match source and destination."; 1645 case dest-ipv6-address { 1646 leaf dest-ipv6-prefix { 1647 type inet:ipv6-prefix; 1648 mandatory true; 1649 description 1650 "An IPv6 destination address as the match."; 1651 } 1652 } 1653 case src-ipv6-address { 1654 leaf src-ipv6-prefix { 1655 type inet:ipv6-prefix; 1656 mandatory true; 1657 description 1658 "An IPv6 source address as the match."; 1659 } 1660 } 1661 case dest-src-ipv6-address { 1662 container dest-src-ipv6-address { 1663 description 1664 "A combination of an IPv6 source and 1665 an IPv6 destination address as the match."; 1666 leaf dest-ipv6-prefix { 1667 type inet:ipv6-prefix; 1668 mandatory true; 1669 description 1670 "The IPv6 destination address of the match"; 1671 } 1672 leaf src-ipv6-prefix { 1673 type inet:ipv6-prefix; 1674 mandatory true; 1675 description 1676 "The IPv6 source address of the match."; 1677 } 1678 } 1679 } 1680 } 1681 } 1682 } 1683 case mpls-route { 1684 description 1685 "MPLS route case."; 1686 leaf mpls-label { 1687 type uint32 ; 1688 mandatory true; 1689 description 1690 "The label used for matching."; 1691 } 1692 } 1693 case mac-route { 1694 description 1695 "MAC route case."; 1696 leaf mac-address { 1697 type yang:mac-address; 1698 mandatory true; 1699 description 1700 "The MAC address used for matching."; 1701 } 1702 } 1703 case interface-route { 1704 description 1705 "Interface route case."; 1706 leaf interface-identifier { 1707 type if:interface-ref; 1708 mandatory true; 1709 description 1710 "The interface used for matching."; 1711 } 1712 } 1713 } 1714 } 1716 } 1718 grouping route { 1719 description 1720 "The common attributes used for all types of routes."; 1721 uses route-prefix; 1722 container nexthop { 1723 description 1724 "The nexthop of the route."; 1725 uses nexthop; 1726 } 1727 //In the information model, it is called route-statistic 1728 container route-status { 1729 description 1730 "The status information of the route."; 1731 leaf route-state { 1732 type route-state-definition; 1733 config false; 1734 description 1735 "Indicate a route's state: Active or Inactive."; 1736 } 1737 leaf route-installed-state { 1738 type route-installed-state-definition; 1739 config false; 1740 description 1741 "Indicate that a route's installed states: 1742 Installed or uninstalled."; 1743 } 1744 leaf route-reason { 1745 type route-change-reason-definition; 1746 config false; 1747 description 1748 "Indicate the reason that caused the route change."; 1749 } 1750 } 1751 container route-attributes { 1752 description 1753 "Route attributes."; 1754 uses route-attributes; 1755 } 1756 container route-vendor-attributes { 1757 description 1758 "Route vendor attributes."; 1759 uses route-vendor-attributes; 1760 } 1761 } 1763 grouping nexthop-list { 1764 description 1765 "A generic nexthop list."; 1766 list nexthop-list { 1767 key "nexthop-member-id"; 1768 description 1769 "A list of nexthops."; 1770 leaf nexthop-member-id { 1771 type uint32; 1772 mandatory true; 1773 description 1774 "A nexthop identifier that points 1775 to a nexthop list member. 1776 A nexthop list member is a nexthop."; 1777 } 1778 } 1779 } 1781 grouping nexthop-list-p { 1782 description 1783 "A nexthop list with preference parameter."; 1784 list nexthop-list { 1785 key "nexthop-member-id"; 1786 description 1787 "A list of nexthop."; 1788 leaf nexthop-member-id { 1789 type uint32; 1790 mandatory true; 1791 description 1792 "A nexthop identifier that points 1793 to a nexthop list member. 1794 A nexthop list member is a nexthop."; 1795 } 1796 leaf nexthop-preference { 1797 type nexthop-preference-definition; 1798 mandatory true; 1799 description 1800 "Nexthop-preference is used for protection schemes. 1801 It is an integer value between 1 and 99. Lower 1802 values are more preferred. To download a 1803 primary/standby/tertiary group to the FIB, the 1804 nexthops that are resolved and are most preferred 1805 are selected."; 1806 } 1807 } 1808 } 1810 grouping nexthop-list-w { 1811 description 1812 "A nexthop list with weight parameter."; 1813 list nexthop-list { 1814 key "nexthop-member-id"; 1815 description 1816 "A list of nexthop."; 1817 leaf nexthop-member-id { 1818 type uint32; 1819 mandatory true; 1820 description 1821 "A nexthop identifier that points 1822 to a nexthop list member. 1823 A nexthop list member is a nexthop."; 1824 } 1825 leaf nexthop-lb-weight { 1826 type nexthop-lb-weight-definition; 1827 mandatory true; 1828 description 1829 "The weight of a nexthop of 1830 the load balance nexthops."; 1831 } 1832 } 1833 } 1835 grouping nexthop { 1836 description 1837 "The nexthop structure."; 1838 leaf nexthop-id { 1839 type uint32; 1840 description 1841 "An identifier that refers to a nexthop."; 1842 } 1843 leaf sharing-flag { 1844 type boolean; 1845 description 1846 "To indicate whether a nexthop is sharable 1847 or non-sharable. 1848 true - sharable, means the nexthop can be shared 1849 with other routes 1850 false - non-sharable, means the nexthop can not 1851 be shared with other routes."; 1852 } 1853 choice nexthop-type { 1854 description 1855 "Nexthop type options."; 1856 case nexthop-base { 1857 container nexthop-base { 1858 description 1859 "The base nexthop."; 1861 uses nexthop-base; 1862 } 1863 } 1864 case nexthop-chain { 1865 if-feature nexthop-chain; 1866 container nexthop-chain { 1867 description 1868 "A chain nexthop."; 1869 uses nexthop-list; 1870 } 1871 } 1872 case nexthop-replicate { 1873 if-feature nexthop-replicate; 1874 container nexthop-replicate { 1875 description 1876 "A replicates nexthop."; 1877 uses nexthop-list; 1878 } 1879 } 1880 case nexthop-protection { 1881 if-feature nexthop-protection; 1882 container nexthop-protection { 1883 description 1884 "A protection nexthop."; 1885 uses nexthop-list-p; 1886 } 1887 } 1888 case nexthop-load-balance { 1889 if-feature nexthop-load-balance; 1890 container nexthop-lb { 1891 description 1892 "A load balance nexthop."; 1893 uses nexthop-list-w; 1894 } 1895 } 1896 } 1897 } 1899 grouping nexthop-base { 1900 description 1901 "The base nexthop."; 1902 choice nexthop-base-type { 1903 description 1904 "Nexthop base type options."; 1905 case special-nexthop { 1906 leaf special { 1907 type special-nexthop-definition; 1908 description 1909 "A special nexthop."; 1910 } 1911 } 1912 case egress-interface-nexthop { 1913 leaf outgoing-interface { 1914 type if:interface-ref; 1915 mandatory true; 1916 description 1917 "The nexthop is an outgoing interface."; 1918 } 1919 } 1920 case ipv4-address-nexthop { 1921 leaf ipv4-address { 1922 type inet:ipv4-address; 1923 mandatory true; 1924 description 1925 "The nexthop is an IPv4 address."; 1926 } 1927 } 1928 case ipv6-address-nexthop { 1929 leaf ipv6-address { 1930 type inet:ipv6-address; 1931 mandatory true; 1932 description 1933 "The nexthop is an IPv6 address."; 1934 } 1935 } 1936 case egress-interface-ipv4-nexthop { 1937 container egress-interface-ipv4-address{ 1938 leaf outgoing-interface { 1939 type if:interface-ref; 1940 mandatory true; 1941 description 1942 "Name of the outgoing interface."; 1943 } 1944 leaf ipv4-address { 1945 type inet:ipv4-address; 1946 mandatory true; 1947 description 1948 "The nexthop points to an interface with 1949 an IPv4 address."; 1950 } 1951 description 1952 "The nexthop is an egress-interface and an IP 1953 address. This can be used in cases e.g. where 1954 the IP address is a link-local address."; 1955 } 1956 } 1957 case egress-interface-ipv6-nexthop { 1958 container egress-interface-ipv6-address { 1959 leaf outgoing-interface { 1960 type if:interface-ref; 1961 mandatory true; 1962 description 1963 "Name of the outgoing interface."; 1964 } 1965 leaf ipv6-address { 1966 type inet:ipv6-address; 1967 mandatory true; 1968 description 1969 "The nexthop points to an interface with 1970 an IPv6 address."; 1971 } 1972 description 1973 "The nexthop is an egress-interface and an IP 1974 address. This can be used in cases e.g. where 1975 the IP address is a link-local address."; 1976 } 1977 } 1978 case egress-interface-mac-nexthop { 1979 container egress-interface-mac-address { 1980 leaf outgoing-interface { 1981 type if:interface-ref; 1982 mandatory true; 1983 description 1984 "Name of the outgoing interface."; 1985 } 1986 leaf ieee-mac-address { 1987 type yang:mac-address; 1988 mandatory true; 1989 description 1990 "The nexthop points to an interface with 1991 a specific mac-address."; 1992 } 1993 description 1994 "The egress interface must be an Ethernet 1995 interface. Address resolution is not required 1996 for this nexthop."; 1997 } 1998 } 1999 case tunnel-encap-nexthop { 2000 if-feature nexthop-tunnel; 2001 container tunnel-encap { 2002 uses tunnel-encap; 2003 description 2004 "This can be an encapsulation representing an IP 2005 tunnel or MPLS tunnel or others as defined in info 2006 model. An optional egress interface can be chained 2007 to the tunnel encapsulation to indicate which 2008 interface to send the packet out on. The egress 2009 interface is useful when the network device 2010 contains Ethernet interfaces and one needs to 2011 perform address resolution for the IP packet."; 2012 } 2013 } 2014 case tunnel-decapsulation-nexthop { 2015 if-feature nexthop-tunnel; 2016 container tunnel-decapsulation { 2017 uses tunnel-decapsulation; 2018 description 2019 "This is to specify the decapsulation of a tunnel header."; 2020 } 2021 } 2022 case logical-tunnel-nexthop { 2023 if-feature nexthop-tunnel; 2024 container logical-tunnel { 2025 uses logical-tunnel; 2026 description 2027 "This can be a MPLS LSP or a GRE tunnel (or others 2028 as defined in this document), that is represented 2029 by a unique identifier (e.g. name)."; 2030 } 2031 } 2032 case rib-name-nexthop { 2033 leaf rib-name { 2034 type string; 2035 description 2036 "A nexthop pointing to a RIB indicates that the 2037 route lookup needs to continue in the specified 2038 RIB. This is a way to perform chained lookups."; 2039 } 2040 } 2041 case nexthop-identifier { 2042 leaf nexthop-ref { 2043 type nexthop-ref; 2044 mandatory true; 2045 description 2046 "A nexthop reference that points to a nexthop."; 2047 } 2048 } 2049 } 2050 } 2052 grouping route-vendor-attributes { 2053 description 2054 "Route vendor attributes."; 2055 } 2057 grouping logical-tunnel { 2058 description 2059 "A logical tunnel that is identified 2060 by a type and a tunnel name."; 2061 leaf tunnel-type { 2062 type tunnel-type-definition; 2063 mandatory true; 2064 description 2065 "A tunnel type."; 2066 } 2067 leaf tunnel-name { 2068 type string; 2069 mandatory true; 2070 description 2071 "A tunnel name that points to a logical tunnel."; 2072 } 2073 } 2075 grouping ipv4-header { 2076 description 2077 "The IPv4 header encapsulation information."; 2078 leaf src-ipv4-address { 2079 type inet:ipv4-address; 2080 mandatory true; 2081 description 2082 "The source IP address of the header."; 2083 } 2084 leaf dest-ipv4-address { 2085 type inet:ipv4-address; 2086 mandatory true; 2087 description 2088 "The destination IP address of the header."; 2089 } 2090 leaf protocol { 2091 type uint8; 2092 mandatory true; 2093 description 2094 "The protocol id of the header."; 2095 } 2096 leaf ttl { 2097 type uint8; 2098 description 2099 "The TTL of the header."; 2100 } 2101 leaf dscp { 2102 type uint8; 2103 description 2104 "The DSCP field of the header."; 2105 } 2106 } 2108 grouping ipv6-header { 2109 description 2110 "The IPv6 header encapsulation information."; 2111 leaf src-ipv6-address { 2112 type inet:ipv6-address; 2113 mandatory true; 2114 description 2115 "The source IP address of the header."; 2116 } 2117 leaf dest-ipv6-address { 2118 type inet:ipv6-address; 2119 mandatory true; 2120 description 2121 "The destination IP address of the header."; 2122 } 2123 leaf next-header { 2124 type uint8; 2125 mandatory true; 2126 description 2127 "The next header of the IPv6 header."; 2128 } 2129 leaf traffic-class { 2130 type uint8; 2131 description 2132 "The traffic class value of the header."; 2133 } 2134 leaf flow-label { 2135 type inet:ipv6-flow-label; 2136 description 2137 "The flow label of the header."; 2138 } 2139 leaf hop-limit { 2140 type uint8 { 2141 range "1..255"; 2142 } 2143 description 2144 "The hop limit of the header."; 2145 } 2146 } 2148 grouping nvgre-header { 2149 description 2150 "The NvGRE header encapsulation information."; 2151 choice nvgre-type { 2152 description 2153 "NvGRE can use either IPv4 2154 or IPv6 header for encapsulation."; 2155 case ipv4 { 2156 uses ipv4-header; 2157 } 2158 case ipv6 { 2159 uses ipv6-header; 2160 } 2161 } 2162 leaf virtual-subnet-id { 2163 type uint32; 2164 mandatory true; 2165 description 2166 "The subnet identifier of the NvGRE header."; 2167 } 2168 leaf flow-id { 2169 type uint8; 2170 description 2171 "The flow identifier of the NvGRE header."; 2172 } 2173 } 2175 grouping vxlan-header { 2176 description 2177 "The VXLAN encapsulation header information."; 2178 choice vxlan-type { 2179 description 2180 "NvGRE can use either IPv4 2181 or IPv6 header for encapsulation."; 2182 case ipv4 { 2183 uses ipv4-header; 2184 } 2185 case ipv6 { 2186 uses ipv6-header; 2187 } 2188 } 2189 leaf vxlan-identifier { 2190 type uint32; 2191 mandatory true; 2192 description 2193 "The VXLAN identifier of the VXLAN header."; 2194 } 2195 } 2196 grouping gre-header { 2197 description 2198 "The GRE encapsulation header information."; 2199 choice dest-address-type { 2200 description 2201 "GRE options: IPv4 and IPv6"; 2202 case ipv4 { 2203 leaf ipv4-dest { 2204 type inet:ipv4-address; 2205 mandatory true; 2206 description 2207 "The destination IP address of the GRE header."; 2208 } 2209 } 2210 case ipv6 { 2211 leaf ipv6-dest { 2212 type inet:ipv6-address; 2213 mandatory true; 2214 description 2215 "The destination IP address of the GRE header."; 2216 } 2217 } 2218 } 2219 leaf protocol-type { 2220 type uint16; 2221 mandatory true; 2222 description 2223 "The protocol type of the GRE header."; 2224 } 2225 leaf key { 2226 type uint64; 2227 description 2228 "The GRE key of the GRE header."; 2229 } 2230 } 2232 grouping mpls-header { 2233 description 2234 "The MPLS encapsulation header information."; 2235 list label-operations { 2236 key "label-oper-id"; 2237 description 2238 "Label operations."; 2239 leaf label-oper-id { 2240 type uint32; 2241 description 2242 "An optional identifier that points 2243 to a label operation."; 2245 } 2246 choice label-actions { 2247 description 2248 "Label action options."; 2249 case label-push { 2250 container label-push { 2251 description 2252 "Label push operation."; 2253 leaf label { 2254 type uint32; 2255 mandatory true; 2256 description 2257 "The label to be pushed."; 2258 } 2259 leaf s-bit { 2260 type boolean; 2261 description 2262 "The s-bit of the label to be pushed. "; 2263 } 2264 leaf tc-value { 2265 type uint8; 2266 description 2267 "The traffic class value of the label to be pushed."; 2268 } 2269 leaf ttl-value { 2270 type uint8; 2271 description 2272 "The TTL value of the label to be pushed."; 2273 } 2274 } 2275 } 2276 case label-swap { 2277 container label-swap { 2278 description 2279 "Label swap operation."; 2280 leaf in-label { 2281 type uint32; 2282 mandatory true; 2283 description 2284 "The label to be swapped."; 2285 } 2286 leaf out-label { 2287 type uint32; 2288 mandatory true; 2289 description 2290 "The out MPLS label."; 2291 } 2292 leaf ttl-action { 2293 type ttl-action-definition; 2294 description 2295 "The label ttl actions: 2296 - No-action, or 2297 - Copy to inner label,or 2298 - Decrease (the in-label) by 1 and 2299 copy to the out-label."; 2300 } 2301 } 2302 } 2303 } 2304 } 2305 } 2307 grouping tunnel-encap{ 2308 description 2309 "Tunnel encapsulation information."; 2310 choice tunnel-type { 2311 description 2312 "Tunnel options for next-hops."; 2313 case ipv4 { 2314 if-feature ipv4-tunnel; 2315 container ipv4-header { 2316 uses ipv4-header; 2317 description 2318 "IPv4 header."; 2319 } 2320 } 2321 case ipv6 { 2322 if-feature ipv6-tunnel; 2323 container ipv6-header { 2324 uses ipv6-header; 2325 description 2326 "IPv6 header."; 2327 } 2328 } 2329 case mpls { 2330 if-feature mpls-tunnel; 2331 container mpls-header { 2332 uses mpls-header; 2333 description 2334 "MPLS header."; 2335 } 2336 } 2337 case gre { 2338 if-feature gre-tunnel; 2339 container gre-header { 2340 uses gre-header; 2341 description 2342 "GRE header."; 2343 } 2344 } 2345 case nvgre { 2346 if-feature nvgre-tunnel; 2347 container nvgre-header { 2348 uses nvgre-header; 2349 description 2350 "NvGRE header."; 2351 } 2352 } 2353 case vxlan { 2354 if-feature vxlan-tunnel; 2355 container vxlan-header { 2356 uses vxlan-header; 2357 description 2358 "VXLAN header."; 2359 } 2360 } 2361 } 2362 } 2364 grouping tunnel-decapsulation { 2365 description 2366 "Tunnel decapsulation information."; 2367 choice tunnel-type { 2368 description 2369 "Nexthop tunnel type options."; 2370 case ipv4 { 2371 if-feature ipv4-tunnel; 2372 container ipv4-decapsulation { 2373 description 2374 "IPv4 decapsulation."; 2375 leaf ipv4-decapsulation { 2376 type tunnel-decapsulation-action-definition; 2377 mandatory true; 2378 description 2379 "IPv4 decapsulation operations."; 2380 } 2381 leaf ttl-action { 2382 type ttl-action-definition; 2383 description 2384 "The ttl actions: 2385 no-action or copy to inner header."; 2386 } 2387 } 2388 } 2389 case ipv6 { 2390 if-feature ipv6-tunnel; 2391 container ipv6-decapsulation { 2392 description 2393 "IPv6 decapsulation."; 2394 leaf ipv6-decapsulation { 2395 type tunnel-decapsulation-action-definition; 2396 mandatory true; 2397 description 2398 "IPv6 decapsulation operations."; 2399 } 2400 leaf hop-limit-action { 2401 type hop-limit-action-definition; 2402 description 2403 "The hop limit actions: 2404 no-action or copy to inner header."; 2405 } 2406 } 2407 } 2408 case mpls { 2409 if-feature mpls-tunnel; 2410 container label-pop { 2411 description 2412 "MPLS decapsulation."; 2413 leaf label-pop { 2414 type mpls-label-action-definition; 2415 mandatory true; 2416 description 2417 "Pop a label from the label stack."; 2418 } 2419 leaf ttl-action { 2420 type ttl-action-definition; 2421 description 2422 "The label ttl action."; 2423 } 2424 } 2425 } 2426 } 2427 } 2429 grouping route-attributes { 2430 description 2431 "Route attributes."; 2432 leaf route-preference { 2433 type uint32; 2434 mandatory true; 2435 description 2436 "ROUTE_PREFERENCE: This is a numerical value that 2437 allows for comparing routes from different 2438 protocols. Static configuration is also 2439 considered a protocol for the purpose of this 2440 field. It is also known as administrative-distance. 2441 The lower the value, the higher the preference."; 2442 } 2443 leaf local-only { 2444 type boolean ; 2445 mandatory true; 2446 description 2447 "Indicate whether the attributes is local only."; 2448 } 2449 container address-family-route-attributes{ 2450 description 2451 "Address family related route attributes."; 2452 choice route-type { 2453 description 2454 "Address family related route attributes."; 2455 case ip-route-attributes { 2456 } 2457 case mpls-route-attributes { 2458 } 2459 case ethernet-route-attributes { 2460 } 2461 } 2462 } 2463 } 2465 container routing-instance { 2466 description 2467 "A routing instance, in the context of 2468 the RIB information model, is a collection 2469 of RIBs, interfaces, and routing parameters"; 2470 leaf name { 2471 type string; 2472 description 2473 "The name of the routing instance. This MUST 2474 be unique across all routing instances in 2475 a given network device."; 2476 } 2477 list interface-list { 2478 key "name"; 2479 description 2480 "This represents the list of interfaces associated 2481 with this routing instance. The interface list helps 2482 constrain the boundaries of packet forwarding. 2483 Packets coming on these interfaces are directly 2484 associated with the given routing instance. The 2485 interface list contains a list of identifiers, with 2486 each identifier uniquely identifying an interface."; 2487 leaf name { 2488 type if:interface-ref; 2489 description 2490 "A reference to the name of a network layer interface."; 2491 } 2492 } 2493 leaf router-id { 2494 type yang:dotted-quad; 2495 description 2496 "Router ID - 32-bit number in the form of a dotted quad."; 2497 } 2498 leaf lookup-limit { 2499 type uint8; 2500 description 2501 "A limit on how many levels of a lookup can be performed."; 2502 } 2503 list rib-list { 2504 key "name"; 2505 description 2506 "A list of RIBs that are associated with the routing 2507 instance."; 2508 leaf name { 2509 type string; 2510 mandatory true; 2511 description 2512 "A reference to the name of each RIB."; 2513 } 2514 leaf address-family { 2515 type address-family-definition; 2516 mandatory true; 2517 description 2518 "The address family of a RIB."; 2519 } 2520 leaf ip-rpf-check { 2521 type boolean; 2522 description 2523 "Each RIB can be optionally associated with a 2524 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2525 path forwarding (RPF) checks on all IP routes in that 2526 RIB. Reverse path forwarding (RPF) check is used to 2527 prevent spoofing and limit malicious traffic."; 2528 } 2529 list route-list { 2530 key "route-index"; 2531 description 2532 "A list of routes of a RIB."; 2534 uses route; 2535 } 2536 // This is a list that maintains the nexthops added to the RIB. 2537 uses nexthop-list; 2538 } 2539 } 2541 //RPC Operations 2542 rpc rib-add { 2543 description 2544 "To add a RIB to a instance"; 2545 input { 2546 leaf name { 2547 type string; 2548 mandatory true; 2549 description 2550 "A reference to the name of the RIB 2551 that is to be added."; 2552 } 2553 leaf address-family { 2554 type address-family-definition; 2555 mandatory true; 2556 description 2557 "The address family of the RIB."; 2558 } 2559 leaf ip-rpf-check { 2560 type boolean; 2561 description 2562 "Each RIB can be optionally associated with a 2563 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2564 path forwarding (RPF) checks on all IP routes in that 2565 RIB. Reverse path forwarding (RPF) check is used to 2566 prevent spoofing and limit malicious traffic."; 2567 } 2568 } 2569 output { 2570 leaf result { 2571 type boolean; 2572 mandatory true; 2573 description 2574 "Return the result of the rib-add operation. 2575 true - success; 2576 false - failed"; 2577 } 2578 leaf reason { 2579 type string; 2580 description 2581 "The specific reason that caused the failure."; 2583 } 2584 } 2585 } 2587 rpc rib-delete { 2588 description 2589 "To delete a RIB from a routing instance. 2590 After deleting the RIB, all routes installed 2591 in the RIB will be deleted as well."; 2592 input { 2593 leaf name { 2594 type string; 2595 mandatory true; 2596 description 2597 "A reference to the name of the RIB 2598 that is to be deleted."; 2599 } 2600 } 2601 output { 2602 leaf result { 2603 type boolean; 2604 mandatory true; 2605 description 2606 "Return the result of the rib-delete operation. 2607 true - success; 2608 false - failed"; 2609 } 2610 leaf reason { 2611 type string; 2612 description 2613 "The specific reason that caused failure."; 2614 } 2615 } 2616 } 2618 grouping route-operation-state { 2619 description 2620 "Route operation state."; 2621 leaf success-count { 2622 type uint32; 2623 mandatory true; 2624 description 2625 "The numbers of routes that are successfully 2626 added/deleted/updated."; 2627 } 2628 leaf failed-count { 2629 type uint32; 2630 mandatory true; 2631 description 2632 "The numbers of the routes that are failed 2633 to be added/deleted/updated."; 2634 } 2635 container failure-detail { 2636 description 2637 "The failure detail reflects the reason why a route 2638 operation fails. It is a array that includes the route 2639 index and error code of the failed route."; 2640 list failed-routes { 2641 key "route-index"; 2642 description 2643 "The list of failed routes."; 2644 leaf route-index { 2645 type uint32; 2646 description 2647 "The route index of the failed route."; 2648 } 2649 leaf error-code { 2650 type uint32; 2651 description 2652 "The error code that reflects the failure reason. 2653 0 - Reserved. 2654 1 - Trying to add a repeat route; 2655 2 - Trying to delete or update a route that is not exist; 2656 3 - Malformed route attribute; 2657 "; 2658 } 2659 } 2660 } 2661 } 2663 rpc route-add { 2664 description 2665 "To add a route or a list of route to a RIB"; 2666 input { 2667 leaf return-failure-detail { 2668 type boolean; 2669 default false; 2670 description 2671 "Whether return the failure detail. 2672 true - return the failure detail; 2673 false - do not return the failure detail; 2674 the default is false."; 2675 } 2676 leaf rib-name { 2677 type string; 2678 mandatory true; 2679 description 2680 "A reference to the name of a RIB."; 2681 } 2682 container routes { 2683 description 2684 "The routes to be added to the RIB."; 2685 list route-list { 2686 key "route-index"; 2687 description 2688 "The list of routes to be added."; 2689 uses route-prefix; 2690 container route-attributes { 2691 uses route-attributes; 2692 description 2693 "The route attributes."; 2694 } 2695 container route-vendor-attributes { 2696 if-feature route-vendor-attributes; 2697 uses route-vendor-attributes; 2698 description 2699 "The route vendor attributes."; 2700 } 2701 container nexthop { 2702 uses nexthop; 2703 description 2704 "The nexthop of the added route."; 2705 } 2706 } 2707 } 2708 } 2709 output { 2710 uses route-operation-state; 2711 } 2712 } 2714 rpc route-delete { 2715 description 2716 "To delete a route or a list of route from a RIB"; 2717 input { 2718 leaf return-failure-detail { 2719 type boolean; 2720 default false; 2721 description 2722 "Whether return the failure detail. 2723 true - return the failure detail; 2724 false - do not return the failure detail; 2725 the default is false."; 2726 } 2727 leaf rib-name { 2728 type string; 2729 mandatory true; 2730 description 2731 "A reference to the name of a RIB."; 2732 } 2733 container routes { 2734 description 2735 "The routes to be added to the RIB."; 2736 list route-list{ 2737 key "route-index"; 2738 description 2739 "The list of routes to be deleted."; 2740 uses route-prefix; 2741 } 2742 } 2743 } 2744 output { 2745 uses route-operation-state; 2746 } 2747 } 2749 grouping route-update-options { 2750 description 2751 "Update options: 2752 1. update the nexthop 2753 2. update the route attributes 2754 3. update the route-vendor-attributes."; 2755 choice update-options { 2756 description 2757 "Update options: 2758 1. update the nexthop 2759 2. update the route attributes 2760 3. update the route-vendor-attributes."; 2761 case update-nexthop { 2762 container updated-nexthop { 2763 uses nexthop; 2764 description 2765 "The nexthop used for updating."; 2766 } 2767 } 2768 case update-route-attributes { 2769 container updated-route-attr { 2770 uses route-attributes; 2771 description 2772 "The route attributes used for updating."; 2773 } 2774 } 2775 case update-route-vendor-attributes { 2776 container updated-route-vendor-attr { 2777 uses route-vendor-attributes; 2778 description 2779 "The vendor route attributes used for updating."; 2780 } 2781 } 2782 } 2783 } 2785 rpc route-update { 2786 description 2787 "To update a route or a list of route of a RIB. 2788 The inputs: 2789 1. The match conditions, could be: 2790 a. route prefix, or 2791 b. route attributes, or 2792 c. nexthop; 2793 2. The update parameters to be used: 2794 a. new nexthop; 2795 b. new route attributes;nexthop 2796 Actions: 2797 1. update the nexthop 2798 2. update the route attributes 2799 The outputs: 2800 success-count - the number of routes updated; 2801 failed-count - the number of routes fail to update 2802 failure-detail - the detail failure info. 2803 "; 2804 input { 2805 leaf return-failure-detail { 2806 type boolean; 2807 default false; 2808 description 2809 "Whether return the failure detail. 2810 true - return the failure detail; 2811 false - do not return the failure detail; 2812 the default is false."; 2813 } 2814 leaf rib-name { 2815 type string; 2816 mandatory true; 2817 description 2818 "A reference to the name of a RIB."; 2819 } 2820 choice match-options { 2821 description 2822 "Match options."; 2824 case match-route-prefix { 2825 description 2826 "Update the routes that match route 2827 prefix(es) condition."; 2828 container input-routes { 2829 description 2830 "The matched routes to be updated."; 2831 list route-list { 2832 key "route-index"; 2833 description 2834 "The list of routes to be updated."; 2835 uses route-prefix; 2836 uses route-update-options; 2837 } 2838 } 2839 } 2840 case match-route-attributes { 2841 description 2842 "Update the routes that match the 2843 route attributes condition."; 2844 container input-route-attributes { 2845 description 2846 "The route attributes are used for matching."; 2847 uses route-attributes; 2848 } 2849 container update-parametors { 2850 description 2851 "Update options: 2852 1. update the nexthop 2853 2. update the route attributes 2854 3. update the route-vendor-attributes."; 2855 uses route-update-options; 2856 } 2857 } 2858 case match-route-vendor-attributes { 2859 if-feature route-vendor-attributes; 2860 description 2861 "Update the routes that match the 2862 vendor attributes condition"; 2863 container input-route-vendor-attributes { 2864 description 2865 "The vendor route attributes are used for matching."; 2866 uses route-vendor-attributes; 2867 } 2868 container update-parameters-vendor { 2869 description 2870 "Update options: 2871 1. update the nexthop 2872 2. update the route attributes 2873 3. update the route-vendor-attributes."; 2874 uses route-update-options; 2875 } 2876 } 2877 case match-nexthop { 2878 description 2879 "Update the routes that match the nexthop."; 2880 container input-nexthop { 2881 description 2882 "The nexthop used for matching."; 2883 uses nexthop; 2884 } 2885 container update-parameters-nexthop { 2886 description 2887 "Update options: 2888 1. update the nexthop 2889 2. update the route attributes 2890 3. update the route-vendor-attributes."; 2891 uses route-update-options; 2892 } 2893 } 2894 } 2895 } 2896 output { 2897 uses route-operation-state; 2898 } 2899 } 2901 rpc nh-add { 2902 description 2903 "To add a nexthop to a RIB. 2904 Inputs parameters: 2905 1. RIB name 2906 2. nexthop; 2907 Actions: 2908 Add the nexthop to the RIB 2909 Outputs: 2910 1.Operation result: 2911 true - success 2912 false - failed; 2913 2. nexthop identifier."; 2914 input { 2915 leaf rib-name { 2916 type string; 2917 mandatory true; 2918 description 2919 "A reference to the name of a RIB."; 2921 } 2922 uses nexthop; 2923 } 2924 output { 2925 leaf result { 2926 type boolean; 2927 mandatory true; 2928 description 2929 "Return the result of the rib-add operation. 2930 true - success; 2931 false - failed;"; 2932 } 2933 leaf reason { 2934 type string; 2935 description 2936 "The specific reason that caused the failure."; 2937 } 2938 leaf nexthop-id { 2939 type uint32; 2940 description 2941 "A nexthop identifier that is allocated to the nexthop."; 2942 } 2943 } 2944 } 2946 rpc nh-delete { 2947 description 2948 "To delete a nexthop from a RIB"; 2949 input { 2950 leaf rib-name { 2951 type string; 2952 mandatory true; 2953 description 2954 "A reference to the name of a RIB."; 2955 } 2956 uses nexthop; 2957 } 2958 output { 2959 leaf result { 2960 type boolean; 2961 mandatory true; 2962 description 2963 "Return the result of the rib-add operation. 2964 true - success; 2965 false - failed."; 2966 } 2967 leaf reason { 2968 type string; 2969 description 2970 "The specific reason that caused the failure."; 2971 } 2972 } 2973 } 2975 /*Notifications*/ 2976 notification nexthop-resolution-status-change { 2977 description 2978 "Nexthop resolution status (resolved/unresolved) 2979 notification."; 2980 container nexthop{ 2981 description 2982 "The nexthop."; 2983 uses nexthop; 2984 } 2985 leaf nexthop-state { 2986 type nexthop-state-definition; 2987 mandatory true; 2988 description 2989 "Nexthop resolution status (resolved/unresolved) 2990 notification."; 2991 } 2992 } 2994 notification route-change { 2995 description 2996 "Route change notification."; 2997 leaf rib-name { 2998 type string; 2999 mandatory true; 3000 description 3001 "A reference to the name of a RIB."; 3002 } 3003 leaf address-family { 3004 type address-family-definition; 3005 mandatory true; 3006 description 3007 "The address family of a RIB."; 3008 } 3009 uses route-prefix; 3010 leaf route-installed-state { 3011 type route-installed-state-definition; 3012 mandatory true; 3013 description 3014 "Indicates whether the route got installed in the FIB."; 3015 } 3016 leaf route-state { 3017 type route-state-definition; 3018 mandatory true; 3019 description 3020 "Indicates whether a route is active or inactive."; 3021 } 3022 list route-change-reasons { 3023 key "route-change-reason"; 3024 description 3025 "The reasons that cause the route change. A route 3026 change that may result from several reasons. For 3027 example, a nexthop becoming resolved will make a 3028 route A active which is of better preference than 3029 a currently active route B, which results in the 3030 route A being installed"; 3031 leaf route-change-reason { 3032 type route-change-reason-definition; 3033 mandatory true; 3034 description 3035 "The reason that caused the route change."; 3036 } 3037 } 3038 } 3039 } 3041 3043 4. IANA Considerations 3045 This document registers a URI in the "ns" registry with the "IETF XML 3046 registry" [RFC3688]: 3048 -------------------------------------------------------------------- 3049 URI: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3050 Registrant Contact: The IESG. 3051 XML: N/A, the requested URI is an XML namespace. 3052 -------------------------------------------------------------------- 3054 This document requests to register a YANG module in the "YANG Module 3055 Names registry" [RFC7950]: 3057 -------------------------------------------------------------------- 3058 name: ietf-i2rs-rib 3059 namespace: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3060 prefix: iir 3061 reference: RFC XXXX 3062 -------------------------------------------------------------------- 3064 5. Security Considerations 3066 The YANG module specified in this document defines a schema for data 3067 that is designed to be accessed via network management protocols such 3068 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 3069 is the secure transport layer, and the mandatory-to-implement secure 3070 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 3071 is HTTPS, and the mandatory-to-implement secure transport is TLS 3072 [RFC5246]. 3074 The NETCONF access control model [RFC8341] provides the means to 3075 restrict access for particular NETCONF or RESTCONF users to a 3076 preconfigured subset of all available NETCONF or RESTCONF protocol 3077 operations and content. 3079 The YANG modules define information that can be configurable in 3080 certain instances, for example, a RIB, a route, a nexthop can be 3081 created or deleted by client applications, the YANG modules also 3082 define RPCs that can be used by client applications to add/delete 3083 RIBs, routes and nexthops. In such cases, a malicious client could 3084 attempt to remove, add or update a RIB, a route, a nexthop, by 3085 creating or deleting corresponding elements in the RIB, route and 3086 nexthop lists, respectively. Removing a RIB or a route could lead to 3087 disruption or impact in performance of a service, updating a route 3088 may lead to suboptimal path and degradation of service levels as well 3089 as possibly disruption of service. For those reasons, it is 3090 important that the NETCONF access control model is vigorously applied 3091 to prevent misconfiguration by unauthorized clients. 3093 There are a number of data nodes defined in this YANG module that are 3094 writable/creatable/deletable (i.e., config true, which is the 3095 default). These data nodes may be considered sensitive or vulnerable 3096 in some network environments. Write operations (e.g., edit-config) 3097 to these data nodes without proper protection can have a negative 3098 effect on network operations. These are the subtrees and data nodes 3099 and their sensitivity/vulnerability in the ietf-i2rs-rib module: 3101 o RIB: A malicious client could attempt to remove a RIB from a 3102 routing instance, for example in order to sabotage the services 3103 provided by the RIB, or to add a RIB to a routing instance, hence 3104 to inject unauthorized traffic into the nexthop. 3106 o route:A malicious client could attempt to remove or add a route 3107 from/to a RIB, for example in order to sabotage the services 3108 provided by the RIB. 3110 o nexthop: A malicious client could attempt to remove or add a 3111 nexthop from/to RIB, which may lead to suboptimal path and 3112 degradation of service levels as well as possibly disruption of 3113 service. 3115 6. Contributors 3117 The following individuals also contribute to this document. 3119 o Zekun He, Tencent Holdings Ltd 3121 o Sujian Lu, Tencent Holdings Ltd 3123 o Jeffery Zhang, Juniper Networks 3125 7. Acknowledgements 3127 The authors would like to thank Chris Bowers, John Scudder, Tom 3128 Petch, Mike McBride and Ebben Aries for his review, suggestion and 3129 comments to this document. 3131 8. References 3133 8.1. Normative References 3135 [I-D.ietf-i2rs-rib-info-model] 3136 Bahadur, N., Kini, S., and J. Medved, "Routing Information 3137 Base Info Model", draft-ietf-i2rs-rib-info-model-17 (work 3138 in progress), May 2018. 3140 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3141 Requirement Levels", BCP 14, RFC 2119, 3142 DOI 10.17487/RFC2119, March 1997, 3143 . 3145 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3146 DOI 10.17487/RFC3688, January 2004, 3147 . 3149 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3150 (TLS) Protocol Version 1.2", RFC 5246, 3151 DOI 10.17487/RFC5246, August 2008, 3152 . 3154 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 3155 and A. Bierman, Ed., "Network Configuration Protocol 3156 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 3157 . 3159 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 3160 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 3161 . 3163 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3164 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3165 . 3167 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 3168 RFC 7950, DOI 10.17487/RFC7950, August 2016, 3169 . 3171 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 3172 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 3173 . 3175 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 3176 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 3177 May 2017, . 3179 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 3180 Access Control Model", STD 91, RFC 8341, 3181 DOI 10.17487/RFC8341, March 2018, 3182 . 3184 [RFC8344] Bjorklund, M., "A YANG Data Model for IP Management", 3185 RFC 8344, DOI 10.17487/RFC8344, March 2018, 3186 . 3188 8.2. Informative References 3190 [I-D.ietf-i2rs-usecase-reqs-summary] 3191 Hares, S. and M. Chen, "Summary of I2RS Use Case 3192 Requirements", draft-ietf-i2rs-usecase-reqs-summary-03 3193 (work in progress), November 2016. 3195 [RFC2784] Farinacci, D., Li, T., Hanks, S., Meyer, D., and P. 3196 Traina, "Generic Routing Encapsulation (GRE)", RFC 2784, 3197 DOI 10.17487/RFC2784, March 2000, 3198 . 3200 [RFC7348] Mahalingam, M., Dutt, D., Duda, K., Agarwal, P., Kreeger, 3201 L., Sridhar, T., Bursell, M., and C. Wright, "Virtual 3202 eXtensible Local Area Network (VXLAN): A Framework for 3203 Overlaying Virtualized Layer 2 Networks over Layer 3 3204 Networks", RFC 7348, DOI 10.17487/RFC7348, August 2014, 3205 . 3207 [RFC7637] Garg, P., Ed. and Y. Wang, Ed., "NVGRE: Network 3208 Virtualization Using Generic Routing Encapsulation", 3209 RFC 7637, DOI 10.17487/RFC7637, September 2015, 3210 . 3212 [RFC7921] Atlas, A., Halpern, J., Hares, S., Ward, D., and T. 3213 Nadeau, "An Architecture for the Interface to the Routing 3214 System", RFC 7921, DOI 10.17487/RFC7921, June 2016, 3215 . 3217 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 3218 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 3219 . 3221 Authors' Addresses 3223 Lixing Wang 3224 Individual 3226 Email: wang_little_star@sina.com 3228 Mach(Guoyi) Chen 3229 Huawei 3231 Email: mach.chen@huawei.com 3233 Amit Dass 3234 Ericsson 3236 Email: amit.dass@ericsson.com 3238 Hariharan Ananthakrishnan 3239 Packet Design 3241 Email: hari@packetdesign.com 3243 Sriganesh Kini 3244 Individual 3246 Email: sriganeshkini@gmail.com 3247 Nitin Bahadur 3248 Bracket Computing 3250 Email: nitin_bahadur@yahoo.com