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