idnits 2.17.1 draft-ietf-i2rs-rib-data-model-12.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 4 instances of too long lines in the document, the longest one being 15 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 (April 21, 2018) is 2187 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 3167, but no explicit reference was found in the text == Unused Reference: 'RFC2784' is defined on line 3183, but no explicit reference was found in the text == Unused Reference: 'RFC7348' is defined on line 3188, but no explicit reference was found in the text == Unused Reference: 'RFC7637' is defined on line 3195, but no explicit reference was found in the text ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-17) exists of draft-ietf-i2rs-rib-info-model-15 Summary: 2 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: October 23, 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 April 21, 2018 16 A YANG Data Model for Routing Information Base (RIB) 17 draft-ietf-i2rs-rib-data-model-12 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 October 23, 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 rib-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 rib-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 rib-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 rib-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 uint32 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? uint16 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-definition 552 | | +--:(gre) {gre-tunnel}? 553 | | | +--rw gre-header 554 | | | +--rw (dest-address-type)? 555 | | | | +--:(ipv4) 556 | | | | | +--rw ipv4-dest inet:ipv4-address 557 | | | | +--:(ipv6) 558 | | | | +--rw ipv6-dest inet:ipv6-address 559 | | | +--rw protocol-type uint16 560 | | | +--rw key? uint64 561 | | +--:(nvgre) {nvgre-tunnel}? 562 | | | +--rw nvgre-header 563 | | | +--rw (nvgre-type)? 564 | | | | +--:(ipv4) 565 | | | | | +--rw src-ipv4-address inet:ipv4-address 566 | | | | | +--rw dest-ipv4-address inet:ipv4-address 567 | | | | | +--rw protocol uint8 568 | | | | | +--rw ttl? uint8 569 | | | | | +--rw dscp? uint8 570 | | | | +--:(ipv6) 571 | | | | +--rw src-ipv6-address inet:ipv6-address 572 | | | | +--rw dest-ipv6-address inet:ipv6-address 573 | | | | +--rw next-header uint8 574 | | | | +--rw traffic-class? uint8 575 | | | | +--rw flow-label? uint16 576 | | | | +--rw hop-limit? uint8 577 | | | +--rw virtual-subnet-id uint32 578 | | | +--rw flow-id? uint16 579 | | +--:(vxlan) {vxlan-tunnel}? 580 | | +--rw vxlan-header 581 | | +--rw (vxlan-type)? 582 | | | +--:(ipv4) 583 | | | | +--rw src-ipv4-address inet:ipv4-address 584 | | | | +--rw dest-ipv4-address inet:ipv4-address 585 | | | | +--rw protocol uint8 586 | | | | +--rw ttl? uint8 587 | | | | +--rw dscp? uint8 588 | | | +--:(ipv6) 589 | | | +--rw src-ipv6-address inet:ipv6-address 590 | | | +--rw dest-ipv6-address inet:ipv6-address 591 | | | +--rw next-header uint8 592 | | | +--rw traffic-class? uint8 593 | | | +--rw flow-label? uint16 594 | | | +--rw hop-limit? uint8 595 | | +--rw vxlan-identifier uint32 596 | +--:(tunnel-decapsulation-nexthop) {nexthop-tunnel}? 597 | | +--rw tunnel-decapsulation 598 | | +--rw (tunnel-type)? 599 | | +--:(ipv4) {ipv4-tunnel}? 600 | | | +--rw ipv4-decapsulation 601 | | | +--rw ipv4-decapsulation tunnel-decapsulation-action-definition 602 | | | +--rw ttl-action? ttl-action-definition 603 | | +--:(ipv6) {ipv6-tunnel}? 604 | | | +--rw ipv6-decapsulation 605 | | | +--rw ipv6-decapsulation tunnel-decapsulation-action-definition 606 | | | +--rw hop-limit-action? hop-limit-action-definition 607 | | +--:(mpls) {mpls-tunnel}? 608 | | +--rw label-pop 609 | | +--rw label-pop mpls-label-action-definition 610 | | +--rw ttl-action? ttl-action-definition 611 | +--:(logical-tunnel-nexthop) {nexthop-tunnel}? 612 | | +--rw logical-tunnel 613 | | +--rw tunnel-type tunnel-type-definition 614 | | +--rw tunnel-name string 615 | +--:(rib-name-nexthop) 616 | | +--rw rib-name? string 617 | +--:(nexthop-identifier) 618 | +--rw nexthop-ref nexthop-ref 620 Figure 5: Nexthop Base Structure 622 2.5. RPC Operations 624 This module defines the following RPC operations: 626 o rib-add: Add a RIB to a routing instance. A name of the RIB, 627 address family of the RIB and (optionally) whether the RPF check 628 is enabled are passed as the input parameters. The output is the 629 result of the add operation: 631 * true - success; 633 * false - failed; when failed, the i2rs agent may return the 634 specific reason that caused the failure. 636 o rib-delete: Delete a RIB from a routing instance. When a RIB is 637 deleted, all routes installed in the RIB will be deleted. A name 638 of the RIB is passed as the input parameter. The output is the 639 result of the delete operation: 641 * true - success; 643 * false - failed; when failed, the i2rs agent may return the 644 specific reason that caused the failure. 646 o route-add: Add a route or a set of routes to a RIB. A RIB name, 647 the route prefix(es), route attributes, route vendor attributes, 648 nexthop and whether return failure details are passed as the input 649 parameters. Before calling the route-add rpc, it is required to 650 call the nh-add rpc to create and/or return the nexthop 651 identifier. However, in situations when the nexthop already 652 exists and the nexthop-id is known, this action is not expected. 653 The output is a combination of the route operation states while 654 querying the appropriate node in the data tree that include: 656 * success-count: the number of routes that were successfully 657 added; 659 * failed-count: the number of the routes that failed to be added; 661 * failure-detail: shows the specific routes that failed to be 662 added. 664 o route-delete: Delete a route or a set of routes from a RIB. A 665 name of the RIB, the route prefix(es) and whether to return 666 failure details are passed as the input parameters. The output is 667 a combination of route operation states that include: 669 * success-count: the number of routes that were successfully 670 deleted; 672 * failed-count: the number of the routes that failed to be 673 deleted; 675 * failure-detail: shows the specific routes that failed to be 676 deleted. 678 o route-update: Update a route or a set of routes. A RIB name, the 679 route prefix(es), or route attributes, or route vendor attributes, 680 or nexthop are passed as the input parameters. The match 681 conditions can be either route prefix(es), or route attributes, or 682 route vendor attributes, or nexthop. The update actions include: 683 update the nexthop, update the route attributes, update the route 684 vendor attributes. The output is combination of the route 685 operation states that include: 687 * success-count: the number of routes that were successfully 688 updated; 690 * failed-count: the number of the routes that failed to be 691 updated; 693 * failure-detail: shows the specific routes that failed to be 694 updated. 696 o nh-add: Add a nexthop to a RIB. A name of the RIB and a nexthop 697 are passed as the input parameters. The network node is required 698 to allocate a nexthop identifier to the nexthop. The outputs 699 include the result of the nexthop add operation. 701 * true - success; when success, a nexthop identifier will be 702 returned to the i2rs client. 704 * false - failed; when failed, the i2rs agent may return the 705 specific reason that caused the failure. 707 o nh-delete: Delete a nexthop from a RIB. A name of a RIB and a 708 nexthop or nexthop identifier are passed as the input parameters. 709 The output is the result of the delete operation: 711 * true - success; 713 * false - failed; when failed, the i2rs agent may return the 714 specific reason that caused the failure. 716 The structure tree of rpcs is shown in following figure. 718 rpcs: 719 +---x rib-add 720 | +---w input 721 | | +---w rib-name string 722 | | +---w address-family rib-family-definition 723 | | +---w ip-rpf-check? boolean 724 | +--ro output 725 | +--ro result uint32 726 | +--ro reason? string 727 +---x rib-delete 728 | +---w input 729 | | +---w rib-name string 730 | +--ro output 731 | +--ro result uint32 732 | +--ro reason? string 733 +---x route-add 734 | +---w input 735 | | +---w return-failure-detail? boolean 736 | | +---w rib-name string 737 | | +---w routes 738 | | +---w route-list* [route-index] 739 | | ... 740 | +--ro output 741 | +--ro success-count uint32 742 | +--ro failed-count uint32 743 | +--ro failure-detail 744 | +--ro failed-routes* [route-index] 745 | +--ro route-index uint32 746 | +--ro error-code? uint32 747 +---x route-delete 748 | +---w input 749 | | +---w return-failure-detail? boolean 750 | | +---w rib-name string 751 | | +---w routes 752 | | +---w route-list* [route-index] 753 | | ... 754 | +--ro output 755 | +--ro success-count uint32 756 | +--ro failed-count uint32 757 | +--ro failure-detail 758 | +--ro failed-routes* [route-index] 759 | +--ro route-index uint32 760 | +--ro error-code? uint32 761 +---x route-update 762 | +---w input 763 | | +---w return-failure-detail? boolean 764 | | +---w rib-name string 765 | | +---w (match-options)? 766 | | +--:(match-route-prefix) 767 | | | ... 768 | | +--:(match-route-attributes) 769 | | | ... 770 | | +--:(match-route-vendor-attributes) {...}? 771 | | | ... 772 | | +--:(match-nexthop) 773 | | ... 774 | +--ro output 775 | +--ro success-count uint32 776 | +--ro failed-count uint32 777 | +--ro failure-detail 778 | +--ro failed-routes* [route-index] 779 | +--ro route-index uint32 780 | +--ro error-code? uint32 781 +---x nh-add 782 | +---w input 783 | | +---w rib-name string 784 | | +---w nexthop-id? uint32 785 | | +---w sharing-flag? boolean 786 | | +---w (nexthop-type)? 787 | | ... 788 | +--ro output 789 | +--ro result uint32 790 | +--ro reason? string 791 | +--ro nexthop-id? uint32 792 +---x nh-delete 793 +---w input 794 | +---w rib-name string 795 | +---w nexthop-id? uint32 796 | +---w sharing-flag? boolean 797 | +---w (nexthop-type)? 798 | ... 799 +--ro output 800 +--ro result uint32 801 +--ro reason? string 802 Figure 6: RPCs Structure 804 2.6. Notifications 806 Asynchronous notifications are sent by the RIB manager of a network 807 device to an external entity when some event triggers on the network 808 device. An implementation of this RIB data model MUST support 809 sending two kinds of asynchronous notifications. 811 1. Route change notification: 813 o Installed (Indicates whether the route got installed in the FIB) ; 815 o Active (Indicates whether a route has at least one fully resolved 816 nexthop and is therefore eligible for installation in the FIB) ; 818 o Reason - E.g. Not authorized 820 2. Nexthop resolution status notification 822 Nexthops can be fully resolved or unresolved. 824 A resolved nexthop has an adequate level of information to send the 825 outgoing packet towards the destination by forwarding it on an 826 interface to a directly connected neighbor. 828 An unresolved nexthop is something that requires the RIB manager to 829 determine the final resolved nexthop. In one example, a nexthop 830 could be an IP address. The RIB manager would resolve how to reach 831 that IP address, e.g. by checking if that particular IP address is 832 reachable by regular IP forwarding or by a MPLS tunnel or by both. 833 If the RIB manager cannot resolve the nexthop, then the nexthop 834 remains in an unresolved state and is NOT a suitable candidate for 835 installation in the FIB. 837 An implementation of this RIB data model MUST support sending route- 838 change notifications whenever a route transitions between the 839 following states: 841 o from the active state to the inactive state 843 o from the inactive state to the active state 845 o from the installed state to the uninstalled state 847 o from the uninstalled state to the installed state 848 A single notification MAY be used when a route transitions from 849 inactive/uninstalled to active/installed or in the other direction. 851 The structure tree of notifications is shown in the following figure. 853 notifications: 854 +---n nexthop-resolution-status-change 855 | +--ro nexthop 856 | | +--ro nexthop-id uint32 857 | | +--ro sharing-flag boolean 858 | | +--ro (nexthop-type)? 859 | | +--:(nexthop-base) 860 | | | ... 861 | | +--:(nexthop-chain) {nexthop-chain}? 862 | | | ... 863 | | +--:(nexthop-replicate) {nexthop-replicate}? 864 | | | ... 865 | | +--:(nexthop-protection) {nexthop-protection}? 866 | | | ... 867 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 868 | | ... 869 | +--ro nexthop-state nexthop-state-definition 870 +---n route-change 871 +--ro rib-name string 872 +--ro address-family rib-family-definition 873 +--ro route-index uint64 874 +--ro match 875 | +--ro (route-type)? 876 | +--:(ipv4) 877 | | ... 878 | +--:(ipv6) 879 | | ... 880 | +--:(mpls-route) 881 | | ... 882 | +--:(mac-route) 883 | | ... 884 | +--:(interface-route) 885 | ... 886 +--ro route-installed-state route-installed-state-definition 887 +--ro route-state route-state-definition 888 +--ro route-change-reason route-change-reason-definition 890 Figure 7: Notifications Structure 892 3. YANG Modules 894 file "ietf-i2rs-rib@2018-04-21.yang" 896 module ietf-i2rs-rib { 897 yang-version 1.1; 898 namespace "urn:ietf:params:xml:ns:yang:ietf-i2rs-rib"; 899 prefix "iir"; 901 import ietf-inet-types { 902 prefix inet; 903 reference "RFC 6991"; 904 } 906 import ietf-interfaces { 907 prefix if; 908 reference "RFC 8344"; 909 } 911 import ietf-yang-types { 912 prefix yang; 913 reference "RFC 6991"; 914 } 916 organization 917 "IETF I2RS (Interface to Routing System) Working Group"; 918 contact 919 "WG Web: 920 WG List: 922 Editor: Lixing Wang 923 925 Editor: Mach(Guoyi) Chen 926 928 Editor: Amit Dass 929 931 Editor: Hariharan Ananthakrishnan 932 934 Editor: Sriganesh Kini 935 937 Editor: Nitin Bahadur 938 "; 939 description 940 "This module defines a YANG data model for 941 Routing Information Base (RIB) that aligns 942 with the I2RS RIB information model. 943 Copyright (c) <2018> IETF Trust and the persons 944 identified as authors of the code. All rights reserved."; 945 revision "2018-02-21" { 946 description "initial revision"; 947 reference "RFC XXXX: draft-ietf-i2rs-data-model-10"; 948 // RFC Ed.: replace XXXX with actual RFC number and remove 949 // this note 950 } 952 //Features 953 feature nexthop-tunnel { 954 description 955 "This feature means that a node supports 956 tunnel nexthop capability."; 957 } 959 feature nexthop-chain { 960 description 961 "This feature means that a node supports 962 chain nexthop capability."; 963 } 965 feature nexthop-protection { 966 description 967 "This feature means that a node supports 968 protection nexthop capability."; 969 } 971 feature nexthop-replicate { 972 description 973 "This feature means that a node supports 974 replicates nexthop capability."; 975 } 977 feature nexthop-load-balance { 978 description 979 "This feature means that a node supports 980 load balance nexthop capability."; 981 } 983 feature ipv4-tunnel { 984 description 985 "This feature means that a node supports 986 IPv4 tunnel encapsulation capability."; 987 } 988 feature ipv6-tunnel { 989 description 990 "This feature means that a node supports 991 IPv6 tunnel encapsulation capability."; 992 } 994 feature mpls-tunnel { 995 description 996 "This feature means that a node supports 997 MPLS tunnel encapsulation capability."; 998 } 1000 feature vxlan-tunnel { 1001 description 1002 "This feature means that a node supports 1003 VXLAN tunnel encapsulation capability."; 1004 reference "RFC7348"; 1005 } 1007 feature gre-tunnel { 1008 description 1009 "This feature means that a node supports 1010 GRE tunnel encapsulation capability."; 1011 reference "RFC2784"; 1012 } 1014 feature nvgre-tunnel { 1015 description 1016 "This feature means that a node supports 1017 NvGRE tunnel encapsulation capability."; 1018 reference "RFC7637"; 1019 } 1021 feature route-vendor-attributes { 1022 description 1023 "This feature means that a node supports 1024 route vendor attributes."; 1025 } 1027 //Identities and Type Definitions 1028 identity mpls-label-action { 1029 description 1030 "Base identity from which all MPLS label 1031 operations are derived. 1032 The MPLS label stack operations include: 1033 push - to add a new label to a label stack, 1034 pop - to pop the top label from a label stack, 1035 swap - to exchange the top label of a label 1036 stack with new label."; 1037 } 1039 identity label-push { 1040 base "mpls-label-action"; 1041 description 1042 "MPLS label stack operation: push."; 1043 } 1045 identity label-pop { 1046 base "mpls-label-action"; 1047 description 1048 "MPLS label stack operation: pop."; 1049 } 1051 identity label-swap { 1052 base "mpls-label-action"; 1053 description 1054 "MPLS label stack operation: swap."; 1055 } 1057 typedef mpls-label-action-definition { 1058 type identityref { 1059 base "mpls-label-action"; 1060 } 1061 description 1062 "MPLS label action definition."; 1063 } 1065 identity tunnel-decapsulation-action { 1066 description 1067 "Base identity from which all tunnel decapsulation 1068 actions are derived. 1069 Tunnel decapsulation actions include: 1070 ipv4-decapsulation - to decapsulate an IPv4 tunnel, 1071 ipv6-decapsulation - to decapsulate an IPv6 tunnel."; 1072 } 1074 identity ipv4-decapsulation { 1075 base "tunnel-decapsulation-action"; 1076 description 1077 "IPv4 tunnel decapsulation."; 1078 } 1080 identity ipv6-decapsulation { 1081 base "tunnel-decapsulation-action"; 1082 description 1083 "IPv6 tunnel decapsulation."; 1085 } 1087 typedef tunnel-decapsulation-action-definition { 1088 type identityref { 1089 base "tunnel-decapsulation-action"; 1090 } 1091 description 1092 "Tunnel decapsulation definition."; 1093 } 1095 identity ttl-action { 1096 description 1097 "Base identity from which all TTL 1098 actions are derived."; 1099 } 1101 identity no-action { 1102 base "ttl-action"; 1103 description 1104 "Do nothing regarding the TTL."; 1105 } 1107 identity copy-to-inner { 1108 base "ttl-action"; 1109 description 1110 "Copy the TTL of the outer header 1111 to the inner header."; 1112 } 1114 identity decrease-and-copy-to-inner { 1115 base "ttl-action"; 1116 description 1117 "Decrease TTL by one and copy the TTL 1118 to the inner header."; 1119 } 1121 identity decrease-and-copy-to-next { 1122 base "ttl-action"; 1123 description 1124 "Decrease TTL by one and copy the TTL 1125 to the next header. For example: when 1126 MPLS label swapping, decrease the TTL 1127 of the in_label and copy it to the 1128 out_label."; 1129 } 1131 typedef ttl-action-definition { 1132 type identityref { 1133 base "ttl-action"; 1134 } 1135 description 1136 "TTL action definition."; 1137 } 1139 identity hop-limit-action { 1140 description 1141 "Base identity from which all hop limit 1142 actions are derived."; 1143 } 1145 identity hop-limit-no-action { 1146 base "hop-limit-action"; 1147 description 1148 "Do nothing regarding the hop limit."; 1149 } 1151 identity hop-limit-copy-to-inner { 1152 base "hop-limit-action"; 1153 description 1154 "Copy the hop limit of the outer header 1155 to the inner header."; 1156 } 1158 typedef hop-limit-action-definition { 1159 type identityref { 1160 base "hop-limit-action"; 1161 } 1162 description 1163 "IPv6 hop limit action definition."; 1164 } 1166 identity special-nexthop { 1167 description 1168 "Base identity from which all special 1169 nexthops are derived."; 1170 } 1172 identity discard { 1173 base "special-nexthop"; 1174 description 1175 "This indicates that the network 1176 device should drop the packet and 1177 increment a drop counter."; 1178 } 1180 identity discard-with-error { 1181 base "special-nexthop"; 1182 description 1183 "This indicates that the network 1184 device should drop the packet, 1185 increment a drop counter and send 1186 back an appropriate error message 1187 (like ICMP error)."; 1188 } 1190 identity receive { 1191 base "special-nexthop"; 1192 description 1193 "This indicates that the traffic is 1194 destined for the network device. For 1195 example, protocol packets or OAM packets. 1196 All locally destined traffic SHOULD be 1197 throttled to avoid a denial of service 1198 attack on the router's control plane. An 1199 optional rate-limiter can be specified 1200 to indicate how to throttle traffic 1201 destined for the control plane."; 1202 } 1204 identity cos-value { 1205 base "special-nexthop"; 1206 description 1207 "Cos-value special nexthop."; 1208 } 1210 typedef special-nexthop-definition { 1211 type identityref { 1212 base "special-nexthop"; 1213 } 1214 description 1215 "Special nexthop definition."; 1216 } 1218 identity ip-route-match-type { 1219 description 1220 "Base identity from which all route 1221 match types are derived. 1222 Route match type could be: 1223 match source, or 1224 match destination, or 1225 match source and destination."; 1226 } 1228 identity match-ip-src { 1229 base "ip-route-match-type"; 1230 description 1231 "Source route match type."; 1232 } 1233 identity match-ip-dest { 1234 base "ip-route-match-type"; 1235 description 1236 "Destination route match type"; 1237 } 1238 identity match-ip-src-dest { 1239 base "ip-route-match-type"; 1240 description 1241 "Source and Destination route match type"; 1242 } 1244 typedef ip-route-match-type-definition { 1245 type identityref { 1246 base "ip-route-match-type"; 1247 } 1248 description 1249 "IP route match type definition."; 1250 } 1252 identity rib-family { 1253 description 1254 "Base identity from which all RIB 1255 address families are derived."; 1256 } 1258 identity ipv4-rib-family { 1259 base "rib-family"; 1260 description 1261 "IPv4 RIB address family."; 1262 } 1264 identity ipv6-rib-family { 1265 base "rib-family"; 1266 description 1267 "IPv6 RIB address family."; 1268 } 1270 identity mpls-rib-family { 1271 base "rib-family"; 1272 description 1273 "MPLS RIB address family."; 1274 } 1276 identity ieee-mac-rib-family { 1277 base "rib-family"; 1278 description 1279 "MAC RIB address family."; 1280 } 1282 typedef rib-family-definition { 1283 type identityref { 1284 base "rib-family"; 1285 } 1286 description 1287 "RIB address family definition."; 1288 } 1290 identity route-type { 1291 description 1292 "Base identity from which all route types 1293 are derived."; 1294 } 1296 identity ipv4-route { 1297 base "route-type"; 1298 description 1299 "IPv4 route type."; 1300 } 1302 identity ipv6-route { 1303 base "route-type"; 1304 description 1305 "IPv6 route type."; 1306 } 1308 identity mpls-route { 1309 base "route-type"; 1310 description 1311 "MPLS route type."; 1312 } 1314 identity ieee-mac { 1315 base "route-type"; 1316 description 1317 "MAC route type."; 1318 } 1320 identity interface { 1321 base "route-type"; 1322 description 1323 "Interface route type."; 1324 } 1325 typedef route-type-definition { 1326 type identityref { 1327 base "route-type"; 1328 } 1329 description 1330 "Route type definition."; 1331 } 1333 identity tunnel-type { 1334 description 1335 "Base identity from which all tunnel 1336 types are derived."; 1337 } 1339 identity ipv4-tunnel { 1340 base "tunnel-type"; 1341 description 1342 "IPv4 tunnel type"; 1343 } 1345 identity ipv6-tunnel { 1346 base "tunnel-type"; 1347 description 1348 "IPv6 Tunnel type"; 1349 } 1351 identity mpls-tunnel { 1352 base "tunnel-type"; 1353 description 1354 "MPLS tunnel type"; 1355 } 1357 identity gre-tunnel { 1358 base "tunnel-type"; 1359 description 1360 "GRE tunnel type"; 1361 } 1363 identity vxlan-tunnel { 1364 base "tunnel-type"; 1365 description 1366 "VXLAN tunnel type"; 1367 } 1369 identity nvgre-tunnel { 1370 base "tunnel-type"; 1371 description 1372 "NVGRE tunnel type"; 1374 } 1376 typedef tunnel-type-definition { 1377 type identityref { 1378 base "tunnel-type"; 1379 } 1380 description 1381 "Tunnel type definition."; 1382 } 1384 identity route-state { 1385 description 1386 "Base identity from which all route 1387 states are derived."; 1388 } 1390 identity active { 1391 base "route-state"; 1392 description 1393 "Active state."; 1394 } 1396 identity inactive { 1397 base "route-state"; 1398 description 1399 "Inactive state."; 1400 } 1402 typedef route-state-definition { 1403 type identityref { 1404 base "route-state"; 1405 } 1406 description 1407 "Route state definition."; 1408 } 1410 identity nexthop-state { 1411 description 1412 "Base identity from which all nexthop 1413 states are derived."; 1414 } 1416 identity resolved { 1417 base "nexthop-state"; 1418 description 1419 "Resolved nexthop state."; 1420 } 1421 identity unresolved { 1422 base "nexthop-state"; 1423 description 1424 "Unresolved nexthop state."; 1425 } 1427 typedef nexthop-state-definition { 1428 type identityref { 1429 base "nexthop-state"; 1430 } 1431 description 1432 "Nexthop state definition."; 1433 } 1435 identity route-installed-state { 1436 description 1437 "Base identity from which all route 1438 installed states are derived."; 1439 } 1441 identity uninstalled { 1442 base "route-installed-state"; 1443 description 1444 "Uninstalled state."; 1445 } 1447 identity installed { 1448 base "route-installed-state"; 1449 description 1450 "Installed state."; 1451 } 1453 typedef route-installed-state-definition { 1454 type identityref { 1455 base "route-installed-state"; 1456 } 1457 description 1458 "Route installed state definition."; 1459 } 1461 //Route change reason identities 1463 identity route-change-reason { 1464 description 1465 "Base identity from which all route change 1466 reasons are derived."; 1467 } 1468 identity lower-route-preference { 1469 base "route-change-reason"; 1470 description 1471 "This route was installed in the FIB because it had 1472 a lower route preference value (and thus was more 1473 preferred) than the route it replaced."; 1474 } 1476 identity higher-route-preference { 1477 base "route-change-reason"; 1478 description 1479 "This route was uninstalled from the FIB because it had 1480 a higher route preference value (and thus was less 1481 preferred) than the route that replaced it."; 1482 } 1484 identity resolved-nexthop { 1485 base "route-change-reason"; 1486 description 1487 "This route was made active because at least 1488 one of its nexthops was resolved."; 1489 } 1491 identity unresolved-nexthop { 1492 base "route-change-reason"; 1493 description 1494 "This route was made inactive because all of 1495 its nexthops are unresolved."; 1496 } 1498 typedef route-change-reason-definition { 1499 type identityref { 1500 base "route-change-reason"; 1501 } 1502 description 1503 "Route change reason definition."; 1504 } 1506 typedef nexthop-preference-definition { 1507 type uint8 { 1508 range "1..99"; 1509 } 1510 description 1511 "Nexthop-preference is used for protection schemes. 1512 It is an integer value between 1 and 99. Lower 1513 values are more preferred. To download N 1514 nexthops to the FIB, the N nexthops with the lowest 1515 value are selected. If there are more than N 1516 nexthops that have the same preference, an 1517 implementation of i2rs client should select N 1518 nexthops and download them, as for how to select 1519 the nexthops is left to the implementations."; 1520 } 1522 typedef nexthop-lb-weight-definition { 1523 type uint8 { 1524 range "1..99"; 1525 } 1526 description 1527 "Nexthop-lb-weight is used for load-balancing. 1528 Each list member SHOULD be assigned a weight 1529 between 1 and 99. The weight determines the 1530 proportion of traffic to be sent over a nexthop 1531 used for forwarding as a ratio of the weight of 1532 this nexthop divided by the sum of the weights 1533 of all the nexthops of this route that are used 1534 for forwarding. To perform equal load-balancing, 1535 one MAY specify a weight of 0 for all the member 1536 nexthops. The value 0 is reserved for equal 1537 load-balancing and if applied, MUST be applied 1538 to all member nexthops. 1539 Note: The weight of 0 is specially because of 1540 historical reasons. It's typically used in 1541 hardware devices to signify ECMP"; 1542 } 1544 typedef nexthop-ref { 1545 type leafref { 1546 path "/iir:routing-instance" + 1547 "/iir:rib-list" + 1548 "/iir:route-list" + 1549 "/iir:nexthop" + 1550 "/iir:nexthop-id"; 1551 } 1552 description 1553 "A nexthop reference that provides 1554 an indirection reference to a nexthop."; 1555 } 1557 //Groupings 1558 grouping route-prefix { 1559 description 1560 "The common attributes used for all types of route prefix."; 1561 leaf route-index { 1562 type uint64 ; 1563 mandatory true; 1564 description 1565 "Route index."; 1566 } 1567 container match { 1568 description 1569 "The match condition specifies the 1570 kind of route (IPv4, MPLS, etc.) 1571 and the set of fields to match on."; 1572 choice route-type { 1573 description 1574 "Route types: IPv4, IPv6, MPLS, MAC etc."; 1575 case ipv4 { 1576 description 1577 "IPv4 route case."; 1578 container ipv4 { 1579 description 1580 "IPv4 route match."; 1581 choice ip-route-match-type { 1582 description 1583 "IP route match type options: 1584 match source, or 1585 match destination, or 1586 match source and destination."; 1587 case dest-ipv4-address { 1588 leaf dest-ipv4-prefix { 1589 type inet:ipv4-prefix; 1590 mandatory true; 1591 description 1592 "An IPv4 destination address as the match."; 1593 } 1594 } 1595 case src-ipv4-address { 1596 leaf src-ipv4-prefix { 1597 type inet:ipv4-prefix; 1598 mandatory true; 1599 description 1600 "An IPv4 source address as the match."; 1601 } 1602 } 1603 case dest-src-ipv4-address { 1604 container dest-src-ipv4-address { 1605 description 1606 "A combination of an IPv4 source and 1607 an IPv4 destination address as the match."; 1608 leaf dest-ipv4-prefix { 1609 type inet:ipv4-prefix; 1610 mandatory true; 1611 description 1612 "The IPv4 destination address of the match."; 1613 } 1614 leaf src-ipv4-prefix { 1615 type inet:ipv4-prefix; 1616 mandatory true; 1617 description 1618 "The IPv4 source address of the match"; 1619 } 1620 } 1621 } 1622 } 1623 } 1624 } 1625 case ipv6 { 1626 description 1627 "IPv6 route case."; 1628 container ipv6 { 1629 description 1630 "IPv6 route match."; 1631 choice ip-route-match-type { 1632 description 1633 "IP route match type options: 1634 match source, or 1635 match destination, or 1636 match source and destination."; 1637 case dest-ipv6-address { 1638 leaf dest-ipv6-prefix { 1639 type inet:ipv6-prefix; 1640 mandatory true; 1641 description 1642 "An IPv6 destination address as the match."; 1643 } 1644 } 1645 case src-ipv6-address { 1646 leaf src-ipv6-prefix { 1647 type inet:ipv6-prefix; 1648 mandatory true; 1649 description 1650 "An IPv6 source address as the match."; 1651 } 1652 } 1653 case dest-src-ipv6-address { 1654 container dest-src-ipv6-address { 1655 description 1656 "A combination of an IPv6 source and 1657 an IPv6 destination address as the match."; 1658 leaf dest-ipv6-prefix { 1659 type inet:ipv6-prefix; 1660 mandatory true; 1661 description 1662 "The IPv6 destination address of the match"; 1663 } 1664 leaf src-ipv6-prefix { 1665 type inet:ipv6-prefix; 1666 mandatory true; 1667 description 1668 "The IPv6 source address of the match."; 1669 } 1670 } 1671 } 1672 } 1673 } 1674 } 1675 case mpls-route { 1676 description 1677 "MPLS route case."; 1678 leaf mpls-label { 1679 type uint32 ; 1680 mandatory true; 1681 description 1682 "The label used for matching."; 1683 } 1684 } 1685 case mac-route { 1686 description 1687 "MAC route case."; 1688 leaf mac-address { 1689 type yang:mac-address; 1690 mandatory true; 1691 description 1692 "The MAC address used for matching."; 1693 } 1694 } 1695 case interface-route { 1696 description 1697 "Interface route case."; 1698 leaf interface-identifier { 1699 type if:interface-ref; 1700 mandatory true; 1701 description 1702 "The interface used for matching."; 1703 } 1704 } 1705 } 1706 } 1708 } 1710 grouping route { 1711 description 1712 "The common attributes used for all types of routes."; 1713 uses route-prefix; 1714 container nexthop { 1715 description 1716 "The nexthop of the route."; 1717 uses nexthop; 1718 } 1719 //In the information model, it is called route-statistic 1720 container route-status { 1721 description 1722 "The status information of the route."; 1723 leaf route-state { 1724 type route-state-definition; 1725 config false; 1726 description 1727 "Indicate a route's state: Active or Inactive."; 1728 } 1729 leaf route-installed-state { 1730 type route-installed-state-definition; 1731 config false; 1732 description 1733 "Indicate that a route's installed states: 1734 Installed or uninstalled."; 1735 } 1736 leaf route-reason { 1737 type route-change-reason-definition; 1738 config false; 1739 description 1740 "Indicate the reason that caused the route change."; 1741 } 1742 } 1743 container route-attributes { 1744 description 1745 "Route attributes."; 1746 uses route-attributes; 1747 } 1748 container route-vendor-attributes { 1749 description 1750 "Route vendor attributes."; 1751 uses route-vendor-attributes; 1752 } 1753 } 1755 grouping nexthop-list { 1756 description 1757 "A generic nexthop list."; 1758 list nexthop-list { 1759 key "nexthop-member-id"; 1760 description 1761 "A list of nexthops."; 1762 leaf nexthop-member-id { 1763 type uint32; 1764 mandatory true; 1765 description 1766 "A nexthop identifier that points 1767 to a nexthop list member. 1768 A nexthop list member is a nexthop."; 1769 } 1770 } 1771 } 1773 grouping nexthop-list-p { 1774 description 1775 "A nexthop list with preference parameter."; 1776 list nexthop-list { 1777 key "nexthop-member-id"; 1778 description 1779 "A list of nexthop."; 1780 leaf nexthop-member-id { 1781 type uint32; 1782 mandatory true; 1783 description 1784 "A nexthop identifier that points 1785 to a nexthop list member. 1786 A nexthop list member is a nexthop."; 1787 } 1788 leaf nexthop-preference { 1789 type nexthop-preference-definition; 1790 mandatory true; 1791 description 1792 "Nexthop-preference is used for protection schemes. 1793 It is an integer value between 1 and 99. Lower 1794 values are more preferred. To download a 1795 primary/standby/tertiary group to the FIB, the 1796 nexthops that are resolved and are most preferred 1797 are selected."; 1798 } 1799 } 1800 } 1802 grouping nexthop-list-w { 1803 description 1804 "A nexthop list with weight parameter."; 1805 list nexthop-list { 1806 key "nexthop-member-id"; 1807 description 1808 "A list of nexthop."; 1809 leaf nexthop-member-id { 1810 type uint32; 1811 mandatory true; 1812 description 1813 "A nexthop identifier that points 1814 to a nexthop list member. 1815 A nexthop list member is a nexthop."; 1816 } 1817 leaf nexthop-lb-weight { 1818 type nexthop-lb-weight-definition; 1819 mandatory true; 1820 description 1821 "The weight of a nexthop of 1822 the load balance nexthops."; 1823 } 1824 } 1825 } 1827 grouping nexthop { 1828 description 1829 "The nexthop structure."; 1830 leaf nexthop-id { 1831 type uint32; 1832 description 1833 "An identifier that refers to a nexthop."; 1834 } 1835 leaf sharing-flag { 1836 type boolean; 1837 description 1838 "To indicate whether a nexthop is sharable 1839 or non-sharable. 1840 true - sharable, means the nexthop can be shared 1841 with other routes 1842 false - non-sharable, means the nexthop can not 1843 be shared with other routes."; 1844 } 1845 choice nexthop-type { 1846 description 1847 "Nexthop type options."; 1848 case nexthop-base { 1849 container nexthop-base { 1850 description 1851 "The base nexthop."; 1853 uses nexthop-base; 1854 } 1855 } 1856 case nexthop-chain { 1857 if-feature nexthop-chain; 1858 container nexthop-chain { 1859 description 1860 "A chain nexthop."; 1861 uses nexthop-list; 1862 } 1863 } 1864 case nexthop-replicate { 1865 if-feature nexthop-replicate; 1866 container nexthop-replicate { 1867 description 1868 "A replicates nexthop."; 1869 uses nexthop-list; 1870 } 1871 } 1872 case nexthop-protection { 1873 if-feature nexthop-protection; 1874 container nexthop-protection { 1875 description 1876 "A protection nexthop."; 1877 uses nexthop-list-p; 1878 } 1879 } 1880 case nexthop-load-balance { 1881 if-feature nexthop-load-balance; 1882 container nexthop-lb { 1883 description 1884 "A load balance nexthop."; 1885 uses nexthop-list-w; 1886 } 1887 } 1888 } 1889 } 1891 grouping nexthop-base { 1892 description 1893 "The base nexthop."; 1894 choice nexthop-base-type { 1895 description 1896 "Nexthop base type options."; 1897 case special-nexthop { 1898 leaf special { 1899 type special-nexthop-definition; 1900 description 1901 "A special nexthop."; 1902 } 1903 } 1904 case egress-interface-nexthop { 1905 leaf outgoing-interface { 1906 type if:interface-ref; 1907 mandatory true; 1908 description 1909 "The nexthop is an outgoing interface."; 1910 } 1911 } 1912 case ipv4-address-nexthop { 1913 leaf ipv4-address { 1914 type inet:ipv4-address; 1915 mandatory true; 1916 description 1917 "The nexthop is an IPv4 address."; 1918 } 1919 } 1920 case ipv6-address-nexthop { 1921 leaf ipv6-address { 1922 type inet:ipv6-address; 1923 mandatory true; 1924 description 1925 "The nexthop is an IPv6 address."; 1926 } 1927 } 1928 case egress-interface-ipv4-nexthop { 1929 container egress-interface-ipv4-address{ 1930 leaf outgoing-interface { 1931 type if:interface-ref; 1932 mandatory true; 1933 description 1934 "Name of the outgoing interface."; 1935 } 1936 leaf ipv4-address { 1937 type inet:ipv4-address; 1938 mandatory true; 1939 description 1940 "The nexthop points to an interface with 1941 an IPv4 address."; 1942 } 1943 description 1944 "The nexthop is an egress-interface and an IP 1945 address. This can be used in cases e.g. where 1946 the IP address is a link-local address."; 1947 } 1948 } 1949 case egress-interface-ipv6-nexthop { 1950 container egress-interface-ipv6-address { 1951 leaf outgoing-interface { 1952 type if:interface-ref; 1953 mandatory true; 1954 description 1955 "Name of the outgoing interface."; 1956 } 1957 leaf ipv6-address { 1958 type inet:ipv6-address; 1959 mandatory true; 1960 description 1961 "The nexthop points to an interface with 1962 an IPv6 address."; 1963 } 1964 description 1965 "The nexthop is an egress-interface and an IP 1966 address. This can be used in cases e.g. where 1967 the IP address is a link-local address."; 1968 } 1969 } 1970 case egress-interface-mac-nexthop { 1971 container egress-interface-mac-address { 1972 leaf outgoing-interface { 1973 type if:interface-ref; 1974 mandatory true; 1975 description 1976 "Name of the outgoing interface."; 1977 } 1978 leaf ieee-mac-address { 1979 type yang:mac-address; 1980 mandatory true; 1981 description 1982 "The nexthop points to an interface with 1983 a specific mac-address."; 1984 } 1985 description 1986 "The egress interface must be an Ethernet 1987 interface. Address resolution is not required 1988 for this nexthop."; 1989 } 1990 } 1991 case tunnel-encap-nexthop { 1992 if-feature nexthop-tunnel; 1993 container tunnel-encap { 1994 uses tunnel-encap; 1995 description 1996 "This can be an encapsulation representing an IP 1997 tunnel or MPLS tunnel or others as defined in info 1998 model. An optional egress interface can be chained 1999 to the tunnel encapsulation to indicate which 2000 interface to send the packet out on. The egress 2001 interface is useful when the network device 2002 contains Ethernet interfaces and one needs to 2003 perform address resolution for the IP packet."; 2004 } 2005 } 2006 case tunnel-decapsulation-nexthop { 2007 if-feature nexthop-tunnel; 2008 container tunnel-decapsulation { 2009 uses tunnel-decapsulation; 2010 description 2011 "This is to specify the decapsulation of a tunnel header."; 2012 } 2013 } 2014 case logical-tunnel-nexthop { 2015 if-feature nexthop-tunnel; 2016 container logical-tunnel { 2017 uses logical-tunnel; 2018 description 2019 "This can be a MPLS LSP or a GRE tunnel (or others 2020 as defined in this document), that is represented 2021 by a unique identifier (e.g. name)."; 2022 } 2023 } 2024 case rib-name-nexthop { 2025 leaf rib-name { 2026 type string; 2027 description 2028 "A nexthop pointing to a RIB indicates that the 2029 route lookup needs to continue in the specified 2030 RIB. This is a way to perform chained lookups."; 2031 } 2032 } 2033 case nexthop-identifier { 2034 leaf nexthop-ref { 2035 type nexthop-ref; 2036 mandatory true; 2037 description 2038 "A nexthop reference that points to a nexthop."; 2039 } 2040 } 2041 } 2042 } 2044 grouping route-vendor-attributes { 2045 description 2046 "Route vendor attributes."; 2047 } 2049 grouping logical-tunnel { 2050 description 2051 "A logical tunnel that is identified 2052 by a type and a tunnel name."; 2053 leaf tunnel-type { 2054 type tunnel-type-definition; 2055 mandatory true; 2056 description 2057 "A tunnel type."; 2058 } 2059 leaf tunnel-name { 2060 type string; 2061 mandatory true; 2062 description 2063 "A tunnel name that points to a logical tunnel."; 2064 } 2065 } 2067 grouping ipv4-header { 2068 description 2069 "The IPv4 header encapsulation information."; 2070 leaf src-ipv4-address { 2071 type inet:ipv4-address; 2072 mandatory true; 2073 description 2074 "The source IP address of the header."; 2075 } 2076 leaf dest-ipv4-address { 2077 type inet:ipv4-address; 2078 mandatory true; 2079 description 2080 "The destination IP address of the header."; 2081 } 2082 leaf protocol { 2083 type uint8; 2084 mandatory true; 2085 description 2086 "The protocol id of the header."; 2087 } 2088 leaf ttl { 2089 type uint8; 2090 description 2091 "The TTL of the header."; 2092 } 2093 leaf dscp { 2094 type uint8; 2095 description 2096 "The DSCP field of the header."; 2097 } 2098 } 2100 grouping ipv6-header { 2101 description 2102 "The IPv6 header encapsulation information."; 2103 leaf src-ipv6-address { 2104 type inet:ipv6-address; 2105 mandatory true; 2106 description 2107 "The source IP address of the header."; 2108 } 2109 leaf dest-ipv6-address { 2110 type inet:ipv6-address; 2111 mandatory true; 2112 description 2113 "The destination IP address of the header."; 2114 } 2115 leaf next-header { 2116 type uint8; 2117 mandatory true; 2118 description 2119 "The next header of the IPv6 header."; 2120 } 2121 leaf traffic-class { 2122 type uint8; 2123 description 2124 "The traffic class value of the header."; 2125 } 2126 leaf flow-label { 2127 type inet:ipv6-flow-label; 2128 description 2129 "The flow label of the header."; 2130 } 2131 leaf hop-limit { 2132 type uint8 { 2133 range "1..255"; 2134 } 2135 description 2136 "The hop limit of the header."; 2137 } 2138 } 2140 grouping nvgre-header { 2141 description 2142 "The NvGRE header encapsulation information."; 2143 choice nvgre-type { 2144 description 2145 "NvGRE can use either IPv4 2146 or IPv6 header for encapsulation."; 2147 case ipv4 { 2148 uses ipv4-header; 2149 } 2150 case ipv6 { 2151 uses ipv6-header; 2152 } 2153 } 2154 leaf virtual-subnet-id { 2155 type uint32; 2156 mandatory true; 2157 description 2158 "The subnet identifier of the NvGRE header."; 2159 } 2160 leaf flow-id { 2161 type uint8; 2162 description 2163 "The flow identifier of the NvGRE header."; 2164 } 2165 } 2167 grouping vxlan-header { 2168 description 2169 "The VXLAN encapsulation header information."; 2170 choice vxlan-type { 2171 description 2172 "NvGRE can use either IPv4 2173 or IPv6 header for encapsulation."; 2174 case ipv4 { 2175 uses ipv4-header; 2176 } 2177 case ipv6 { 2178 uses ipv6-header; 2179 } 2180 } 2181 leaf vxlan-identifier { 2182 type uint32; 2183 mandatory true; 2184 description 2185 "The VXLAN identifier of the VXLAN header."; 2186 } 2187 } 2188 grouping gre-header { 2189 description 2190 "The GRE encapsulation header information."; 2191 choice dest-address-type { 2192 description 2193 "GRE options: IPv4 and IPv6"; 2194 case ipv4 { 2195 leaf ipv4-dest { 2196 type inet:ipv4-address; 2197 mandatory true; 2198 description 2199 "The destination IP address of the GRE header."; 2200 } 2201 } 2202 case ipv6 { 2203 leaf ipv6-dest { 2204 type inet:ipv6-address; 2205 mandatory true; 2206 description 2207 "The destination IP address of the GRE header."; 2208 } 2209 } 2210 } 2211 leaf protocol-type { 2212 type uint16; 2213 mandatory true; 2214 description 2215 "The protocol type of the GRE header."; 2216 } 2217 leaf key { 2218 type uint64; 2219 description 2220 "The GRE key of the GRE header."; 2221 } 2222 } 2224 grouping mpls-header { 2225 description 2226 "The MPLS encapsulation header information."; 2227 list label-operations { 2228 key "label-oper-id"; 2229 description 2230 "Label operations."; 2231 leaf label-oper-id { 2232 type uint32; 2233 description 2234 "An optional identifier that points 2235 to a label operation."; 2237 } 2238 choice label-actions { 2239 description 2240 "Label action options."; 2241 case label-push { 2242 container label-push { 2243 description 2244 "Label push operation."; 2245 leaf label { 2246 type uint32; 2247 mandatory true; 2248 description 2249 "The label to be pushed."; 2250 } 2251 leaf s-bit { 2252 type boolean; 2253 description 2254 "The s-bit of the label to be pushed. "; 2255 } 2256 leaf tc-value { 2257 type uint8; 2258 description 2259 "The traffic class value of the label to be pushed."; 2260 } 2261 leaf ttl-value { 2262 type uint8; 2263 description 2264 "The TTL value of the label to be pushed."; 2265 } 2266 } 2267 } 2268 case label-swap { 2269 container label-swap { 2270 description 2271 "Label swap operation."; 2272 leaf in-label { 2273 type uint32; 2274 mandatory true; 2275 description 2276 "The label to be swapped."; 2277 } 2278 leaf out-label { 2279 type uint32; 2280 mandatory true; 2281 description 2282 "The out MPLS label."; 2283 } 2284 leaf ttl-action { 2285 type ttl-action-definition; 2286 description 2287 "The label ttl actions: 2288 - No-action, or 2289 - Copy to inner label,or 2290 - Decrease (the in-label) by 1 and 2291 copy to the out-label."; 2292 } 2293 } 2294 } 2295 } 2296 } 2297 } 2299 grouping tunnel-encap{ 2300 description 2301 "Tunnel encapsulation information."; 2302 choice tunnel-type { 2303 description 2304 "Tunnel options for next-hops."; 2305 case ipv4 { 2306 if-feature ipv4-tunnel; 2307 container ipv4-header { 2308 uses ipv4-header; 2309 description 2310 "IPv4 header."; 2311 } 2312 } 2313 case ipv6 { 2314 if-feature ipv6-tunnel; 2315 container ipv6-header { 2316 uses ipv6-header; 2317 description 2318 "IPv6 header."; 2319 } 2320 } 2321 case mpls { 2322 if-feature mpls-tunnel; 2323 container mpls-header { 2324 uses mpls-header; 2325 description 2326 "MPLS header."; 2327 } 2328 } 2329 case gre { 2330 if-feature gre-tunnel; 2331 container gre-header { 2332 uses gre-header; 2333 description 2334 "GRE header."; 2335 } 2336 } 2337 case nvgre { 2338 if-feature nvgre-tunnel; 2339 container nvgre-header { 2340 uses nvgre-header; 2341 description 2342 "NvGRE header."; 2343 } 2344 } 2345 case vxlan { 2346 if-feature vxlan-tunnel; 2347 container vxlan-header { 2348 uses vxlan-header; 2349 description 2350 "VXLAN header."; 2351 } 2352 } 2353 } 2354 } 2356 grouping tunnel-decapsulation { 2357 description 2358 "Tunnel decapsulation information."; 2359 choice tunnel-type { 2360 description 2361 "Nexthop tunnel type options."; 2362 case ipv4 { 2363 if-feature ipv4-tunnel; 2364 container ipv4-decapsulation { 2365 description 2366 "IPv4 decapsulation."; 2367 leaf ipv4-decapsulation { 2368 type tunnel-decapsulation-action-definition; 2369 mandatory true; 2370 description 2371 "IPv4 decapsulation operations."; 2372 } 2373 leaf ttl-action { 2374 type ttl-action-definition; 2375 description 2376 "The ttl actions: 2377 no-action or copy to inner header."; 2378 } 2379 } 2380 } 2381 case ipv6 { 2382 if-feature ipv6-tunnel; 2383 container ipv6-decapsulation { 2384 description 2385 "IPv6 decapsulation."; 2386 leaf ipv6-decapsulation { 2387 type tunnel-decapsulation-action-definition; 2388 mandatory true; 2389 description 2390 "IPv6 decapsulation operations."; 2391 } 2392 leaf hop-limit-action { 2393 type hop-limit-action-definition; 2394 description 2395 "The hop limit actions: 2396 no-action or copy to inner header."; 2397 } 2398 } 2399 } 2400 case mpls { 2401 if-feature mpls-tunnel; 2402 container label-pop { 2403 description 2404 "MPLS decapsulation."; 2405 leaf label-pop { 2406 type mpls-label-action-definition; 2407 mandatory true; 2408 description 2409 "Pop a label from the label stack."; 2410 } 2411 leaf ttl-action { 2412 type ttl-action-definition; 2413 description 2414 "The label ttl action."; 2415 } 2416 } 2417 } 2418 } 2419 } 2421 grouping route-attributes { 2422 description 2423 "Route attributes."; 2424 leaf route-preference { 2425 type uint32; 2426 mandatory true; 2427 description 2428 "ROUTE_PREFERENCE: This is a numerical value that 2429 allows for comparing routes from different 2430 protocols. Static configuration is also 2431 considered a protocol for the purpose of this 2432 field. It is also known as administrative-distance. 2433 The lower the value, the higher the preference."; 2434 } 2435 leaf local-only { 2436 type boolean ; 2437 mandatory true; 2438 description 2439 "Indicate whether the attributes is local only."; 2440 } 2441 container address-family-route-attributes{ 2442 description 2443 "Address family related route attributes."; 2444 choice route-type { 2445 description 2446 "Address family related route attributes."; 2447 case ip-route-attributes { 2448 } 2449 case mpls-route-attributes { 2450 } 2451 case ethernet-route-attributes { 2452 } 2453 } 2454 } 2455 } 2457 container routing-instance { 2458 description 2459 "A routing instance, in the context of 2460 the RIB information model, is a collection 2461 of RIBs, interfaces, and routing parameters"; 2462 leaf name { 2463 type string; 2464 description 2465 "The name of the routing instance. This MUST 2466 be unique across all routing instances in 2467 a given network device."; 2468 } 2469 list interface-list { 2470 key "name"; 2471 description 2472 "This represents the list of interfaces associated 2473 with this routing instance. The interface list helps 2474 constrain the boundaries of packet forwarding. 2475 Packets coming on these interfaces are directly 2476 associated with the given routing instance. The 2477 interface list contains a list of identifiers, with 2478 each identifier uniquely identifying an interface."; 2479 leaf name { 2480 type if:interface-ref; 2481 description 2482 "A reference to the name of a network layer interface."; 2483 } 2484 } 2485 leaf router-id { 2486 type yang:dotted-quad; 2487 description 2488 "Router ID - 32-bit number in the form of a dotted quad."; 2489 } 2490 leaf lookup-limit { 2491 type uint8; 2492 description 2493 "A limit on how many levels of a lookup can be performed."; 2494 } 2495 list rib-list { 2496 key "name"; 2497 description 2498 "A list of RIBs that are associated with the routing 2499 instance."; 2500 leaf name { 2501 type string; 2502 mandatory true; 2503 description 2504 "A reference to the name of each RIB."; 2505 } 2506 leaf address-family { 2507 type rib-family-definition; 2508 mandatory true; 2509 description 2510 "The address family of a RIB."; 2511 } 2512 leaf ip-rpf-check { 2513 type boolean; 2514 description 2515 "Each RIB can be optionally associated with a 2516 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2517 path forwarding (RPF) checks on all IP routes in that 2518 RIB. Reverse path forwarding (RPF) check is used to 2519 prevent spoofing and limit malicious traffic."; 2520 } 2521 list route-list { 2522 key "route-index"; 2523 description 2524 "A list of routes of a RIB."; 2526 uses route; 2527 } 2528 // This is a list that maintains the nexthops added to the RIB. 2529 uses nexthop-list; 2530 } 2531 } 2533 //RPC Operations 2534 rpc rib-add { 2535 description 2536 "To add a RIB to a instance"; 2537 input { 2538 leaf name { 2539 type string; 2540 mandatory true; 2541 description 2542 "A reference to the name of the RIB 2543 that is to be added."; 2544 } 2545 leaf address-family { 2546 type rib-family-definition; 2547 mandatory true; 2548 description 2549 "The address family of the RIB."; 2550 } 2551 leaf ip-rpf-check { 2552 type boolean; 2553 description 2554 "Each RIB can be optionally associated with a 2555 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2556 path forwarding (RPF) checks on all IP routes in that 2557 RIB. Reverse path forwarding (RPF) check is used to 2558 prevent spoofing and limit malicious traffic."; 2559 } 2560 } 2561 output { 2562 leaf result { 2563 type boolean; 2564 mandatory true; 2565 description 2566 "Return the result of the rib-add operation. 2567 true - success; 2568 false - failed"; 2569 } 2570 leaf reason { 2571 type string; 2572 description 2573 "The specific reason that caused the failure."; 2575 } 2576 } 2577 } 2579 rpc rib-delete { 2580 description 2581 "To delete a RIB from a routing instance. 2582 After deleting the RIB, all routes installed 2583 in the RIB will be deleted as well."; 2584 input { 2585 leaf name { 2586 type string; 2587 mandatory true; 2588 description 2589 "A reference to the name of the RIB 2590 that is to be deleted."; 2591 } 2592 } 2593 output { 2594 leaf result { 2595 type boolean; 2596 mandatory true; 2597 description 2598 "Return the result of the rib-delete operation. 2599 true - success; 2600 false - failed"; 2601 } 2602 leaf reason { 2603 type string; 2604 description 2605 "The specific reason that caused failure."; 2606 } 2607 } 2608 } 2610 grouping route-operation-state { 2611 description 2612 "Route operation state."; 2613 leaf success-count { 2614 type uint32; 2615 mandatory true; 2616 description 2617 "The numbers of routes that are successfully 2618 added/deleted/updated."; 2619 } 2620 leaf failed-count { 2621 type uint32; 2622 mandatory true; 2623 description 2624 "The numbers of the routes that are failed 2625 to be added/deleted/updated."; 2626 } 2627 container failure-detail { 2628 description 2629 "The failure detail reflects the reason why a route 2630 operation fails. It is a array that includes the route 2631 index and error code of the failed route."; 2632 list failed-routes { 2633 key "route-index"; 2634 description 2635 "The list of failed routes."; 2636 leaf route-index { 2637 type uint32; 2638 description 2639 "The route index of the failed route."; 2640 } 2641 leaf error-code { 2642 type uint32; 2643 description 2644 "The error code that reflects the failure reason. 2645 0 - Reserved. 2646 1 - Trying to add a repeat route; 2647 2 - Trying to delete or update a route that is not exist; 2648 3 - Malformed route attribute; 2649 "; 2650 } 2651 } 2652 } 2653 } 2655 rpc route-add { 2656 description 2657 "To add a route or a list of route to a RIB"; 2658 input { 2659 leaf return-failure-detail { 2660 type boolean; 2661 default false; 2662 description 2663 "Whether return the failure detail. 2664 true - return the failure detail; 2665 false - do not return the failure detail; 2666 the default is false."; 2667 } 2668 leaf rib-name { 2669 type string; 2670 mandatory true; 2671 description 2672 "A reference to the name of a RIB."; 2673 } 2674 container routes { 2675 description 2676 "The routes to be added to the RIB."; 2677 list route-list { 2678 key "route-index"; 2679 description 2680 "The list of routes to be added."; 2681 uses route-prefix; 2682 container route-attributes { 2683 uses route-attributes; 2684 description 2685 "The route attributes."; 2686 } 2687 container route-vendor-attributes { 2688 if-feature route-vendor-attributes; 2689 uses route-vendor-attributes; 2690 description 2691 "The route vendor attributes."; 2692 } 2693 container nexthop { 2694 uses nexthop; 2695 description 2696 "The nexthop of the added route."; 2697 } 2698 } 2699 } 2700 } 2701 output { 2702 uses route-operation-state; 2703 } 2704 } 2706 rpc route-delete { 2707 description 2708 "To delete a route or a list of route from a RIB"; 2709 input { 2710 leaf return-failure-detail { 2711 type boolean; 2712 default false; 2713 description 2714 "Whether return the failure detail. 2715 true - return the failure detail; 2716 false - do not return the failure detail; 2717 the default is false."; 2718 } 2719 leaf rib-name { 2720 type string; 2721 mandatory true; 2722 description 2723 "A reference to the name of a RIB."; 2724 } 2725 container routes { 2726 description 2727 "The routes to be added to the RIB."; 2728 list route-list{ 2729 key "route-index"; 2730 description 2731 "The list of routes to be deleted."; 2732 uses route-prefix; 2733 } 2734 } 2735 } 2736 output { 2737 uses route-operation-state; 2738 } 2739 } 2741 grouping route-update-options { 2742 description 2743 "Update options: 2744 1. update the nexthop 2745 2. update the route attributes 2746 3. update the route-vendor-attributes."; 2747 choice 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 case update-nexthop { 2754 container updated-nexthop { 2755 uses nexthop; 2756 description 2757 "The nexthop used for updating."; 2758 } 2759 } 2760 case update-route-attributes { 2761 container updated-route-attr { 2762 uses route-attributes; 2763 description 2764 "The route attributes used for updating."; 2765 } 2766 } 2767 case update-route-vendor-attributes { 2768 container updated-route-vendor-attr { 2769 uses route-vendor-attributes; 2770 description 2771 "The vendor route attributes used for updating."; 2772 } 2773 } 2774 } 2775 } 2777 rpc route-update { 2778 description 2779 "To update a route or a list of route of a RIB. 2780 The inputs: 2781 1. The match conditions, could be: 2782 a. route prefix, or 2783 b. route attributes, or 2784 c. nexthop; 2785 2. The update parameters to be used: 2786 a. new nexthop; 2787 b. new route attributes;nexthop 2788 Actions: 2789 1. update the nexthop 2790 2. update the route attributes 2791 The outputs: 2792 success-count - the number of routes updated; 2793 failed-count - the number of routes fail to update 2794 failure-detail - the detail failure info. 2795 "; 2796 input { 2797 leaf return-failure-detail { 2798 type boolean; 2799 default false; 2800 description 2801 "Whether return the failure detail. 2802 true - return the failure detail; 2803 false - do not return the failure detail; 2804 the default is false."; 2805 } 2806 leaf rib-name { 2807 type string; 2808 mandatory true; 2809 description 2810 "A reference to the name of a RIB."; 2811 } 2812 choice match-options { 2813 description 2814 "Match options."; 2816 case match-route-prefix { 2817 description 2818 "Update the routes that match route 2819 prefix(es) condition."; 2820 container input-routes { 2821 description 2822 "The matched routes to be updated."; 2823 list route-list { 2824 key "route-index"; 2825 description 2826 "The list of routes to be updated."; 2827 uses route-prefix; 2828 uses route-update-options; 2829 } 2830 } 2831 } 2832 case match-route-attributes { 2833 description 2834 "Update the routes that match the 2835 route attributes condition."; 2836 container input-route-attributes { 2837 description 2838 "The route attributes are used for matching."; 2839 uses route-attributes; 2840 } 2841 container update-parametors { 2842 description 2843 "Update options: 2844 1. update the nexthop 2845 2. update the route attributes 2846 3. update the route-vendor-attributes."; 2847 uses route-update-options; 2848 } 2849 } 2850 case match-route-vendor-attributes { 2851 if-feature route-vendor-attributes; 2852 description 2853 "Update the routes that match the 2854 vendor attributes condition"; 2855 container input-route-vendor-attributes { 2856 description 2857 "The vendor route attributes are used for matching."; 2858 uses route-vendor-attributes; 2859 } 2860 container update-parameters-vendor { 2861 description 2862 "Update options: 2863 1. update the nexthop 2864 2. update the route attributes 2865 3. update the route-vendor-attributes."; 2866 uses route-update-options; 2867 } 2868 } 2869 case match-nexthop { 2870 description 2871 "Update the routes that match the nexthop."; 2872 container input-nexthop { 2873 description 2874 "The nexthop used for matching."; 2875 uses nexthop; 2876 } 2877 container update-parameters-nexthop { 2878 description 2879 "Update options: 2880 1. update the nexthop 2881 2. update the route attributes 2882 3. update the route-vendor-attributes."; 2883 uses route-update-options; 2884 } 2885 } 2886 } 2887 } 2888 output { 2889 uses route-operation-state; 2890 } 2891 } 2893 rpc nh-add { 2894 description 2895 "To add a nexthop to a RIB. 2896 Inputs parameters: 2897 1. RIB name 2898 2. nexthop; 2899 Actions: 2900 Add the nexthop to the RIB 2901 Outputs: 2902 1.Operation result: 2903 true - success 2904 false - failed; 2905 2. nexthop identifier."; 2906 input { 2907 leaf rib-name { 2908 type string; 2909 mandatory true; 2910 description 2911 "A reference to the name of a RIB."; 2913 } 2914 uses nexthop; 2915 } 2916 output { 2917 leaf result { 2918 type boolean; 2919 mandatory true; 2920 description 2921 "Return the result of the rib-add operation. 2922 true - success; 2923 false - failed;"; 2924 } 2925 leaf reason { 2926 type string; 2927 description 2928 "The specific reason that caused the failure."; 2929 } 2930 leaf nexthop-id { 2931 type uint32; 2932 description 2933 "A nexthop identifier that is allocated to the nexthop."; 2934 } 2935 } 2936 } 2938 rpc nh-delete { 2939 description 2940 "To delete a nexthop from a RIB"; 2941 input { 2942 leaf rib-name { 2943 type string; 2944 mandatory true; 2945 description 2946 "A reference to the name of a RIB."; 2947 } 2948 uses nexthop; 2949 } 2950 output { 2951 leaf result { 2952 type boolean; 2953 mandatory true; 2954 description 2955 "Return the result of the rib-add operation. 2956 true - success; 2957 false - failed."; 2958 } 2959 leaf reason { 2960 type string; 2961 description 2962 "The specific reason that caused the failure."; 2963 } 2964 } 2965 } 2967 /*Notifications*/ 2968 notification nexthop-resolution-status-change { 2969 description 2970 "Nexthop resolution status (resolved/unresolved) 2971 notification."; 2972 container nexthop{ 2973 description 2974 "The nexthop."; 2975 uses nexthop; 2976 } 2977 leaf nexthop-state { 2978 type nexthop-state-definition; 2979 mandatory true; 2980 description 2981 "Nexthop resolution status (resolved/unresolved) 2982 notification."; 2983 } 2984 } 2986 notification route-change { 2987 description 2988 "Route change notification."; 2989 leaf rib-name { 2990 type string; 2991 mandatory true; 2992 description 2993 "A reference to the name of a RIB."; 2994 } 2995 leaf address-family { 2996 type rib-family-definition; 2997 mandatory true; 2998 description 2999 "The address family of a RIB."; 3000 } 3001 uses route-prefix; 3002 leaf route-installed-state { 3003 type route-installed-state-definition; 3004 mandatory true; 3005 description 3006 "Indicates whether the route got installed in the FIB."; 3007 } 3008 leaf route-state { 3009 type route-state-definition; 3010 mandatory true; 3011 description 3012 "Indicates whether a route is active or inactive."; 3013 } 3014 list route-change-reasons { 3015 key "route-change-reason"; 3016 description 3017 "The reasons that cause the route change. A route 3018 change that may result from several reasons. For 3019 example, a nexthop becoming resolved will make a 3020 route A active which is of better preference than 3021 a currently active route B, which results in the 3022 route A being installed"; 3023 leaf route-change-reason { 3024 type route-change-reason-definition; 3025 mandatory true; 3026 description 3027 "The reason that caused the route change."; 3028 } 3029 } 3030 } 3031 } 3033 3035 4. IANA Considerations 3037 This document registers a URI in the "ns" registry with the "IETF XML 3038 registry" [RFC3688]: 3040 -------------------------------------------------------------------- 3041 URI: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3042 Registrant Contact: The IESG. 3043 XML: N/A, the requested URI is an XML namespace. 3044 -------------------------------------------------------------------- 3046 This document requests to register a YANG module in the "YANG Module 3047 Names registry" [RFC7950]: 3049 -------------------------------------------------------------------- 3050 name: ietf-i2rs-rib 3051 namespace: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3052 prefix: iir 3053 reference: RFC XXXX 3054 -------------------------------------------------------------------- 3056 5. Security Considerations 3058 The YANG module specified in this document defines a schema for data 3059 that is designed to be accessed via network management protocols such 3060 as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer 3061 is the secure transport layer, and the mandatory-to-implement secure 3062 transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer 3063 is HTTPS, and the mandatory-to-implement secure transport is TLS 3064 [RFC5246]. 3066 The NETCONF access control model [RFC8341] provides the means to 3067 restrict access for particular NETCONF or RESTCONF users to a 3068 preconfigured subset of all available NETCONF or RESTCONF protocol 3069 operations and content. 3071 The YANG modules define information that can be configurable in 3072 certain instances, for example, a RIB, a route, a nexthop can be 3073 created or deleted by client applications, the YANG modules also 3074 define RPCs that can be used by client applications to add/delete 3075 RIBs, routes and nexthops. In such cases, a malicious client could 3076 attempt to remove, add or update a RIB, a route, a nexthop, by 3077 creating or deleting corresponding elements in the RIB, route and 3078 nexthop lists, respectively. Removing a RIB or a route could lead to 3079 disruption or impact in performance of a service, updating a route 3080 may lead to suboptimal path and degradation of service levels as well 3081 as possibly disruption of service. For those reasons, it is 3082 important that the NETCONF access control model is vigorously applied 3083 to prevent misconfiguration by unauthorized clients. 3085 There are a number of data nodes defined in this YANG module that are 3086 writable/creatable/deletable (i.e., config true, which is the 3087 default). These data nodes may be considered sensitive or vulnerable 3088 in some network environments. Write operations (e.g., edit-config) 3089 to these data nodes without proper protection can have a negative 3090 effect on network operations. These are the subtrees and data nodes 3091 and their sensitivity/vulnerability in the ietf-i2rs-rib module: 3093 o RIB: A malicious client could attempt to remove a RIB from a 3094 routing instance, for example in order to sabotage the services 3095 provided by the RIB, or to add a RIB to a routing instance, hence 3096 to inject unauthorized traffic into the nexthop. 3098 o route:A malicious client could attempt to remove or add a route 3099 from/to a RIB, for example in order to sabotage the services 3100 provided by the RIB. 3102 o nexthop: A malicious client could attempt to remove or add a 3103 nexthop from/to RIB, which may lead to suboptimal path and 3104 degradation of service levels as well as possibly disruption of 3105 service. 3107 6. Contributors 3109 The following individuals also contribute to this document. 3111 o Zekun He, Tencent Holdings Ltd 3113 o Sujian Lu, Tencent Holdings Ltd 3115 o Jeffery Zhang, Juniper Networks 3117 7. Acknowledgements 3119 The authors would like to thank Chris Bowers, John Scudder, Tom 3120 Petch, Mike McBride and Ebben Aries for his review, suggestion and 3121 comments to this document. 3123 8. References 3125 8.1. Normative References 3127 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3128 Requirement Levels", BCP 14, RFC 2119, 3129 DOI 10.17487/RFC2119, March 1997, 3130 . 3132 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3133 DOI 10.17487/RFC3688, January 2004, 3134 . 3136 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 3137 (TLS) Protocol Version 1.2", RFC 5246, 3138 DOI 10.17487/RFC5246, August 2008, 3139 . 3141 [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., 3142 and A. Bierman, Ed., "Network Configuration Protocol 3143 (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, 3144 . 3146 [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure 3147 Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, 3148 . 3150 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3151 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3152 . 3154 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 3155 RFC 7950, DOI 10.17487/RFC7950, August 2016, 3156 . 3158 [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF 3159 Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, 3160 . 3162 [RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration 3163 Access Control Model", STD 91, RFC 8341, 3164 DOI 10.17487/RFC8341, March 2018, 3165 . 3167 [RFC8344] Bjorklund, M., "A YANG Data Model for IP Management", 3168 RFC 8344, DOI 10.17487/RFC8344, March 2018, 3169 . 3171 8.2. Informative References 3173 [I-D.ietf-i2rs-rib-info-model] 3174 Bahadur, N., Kini, S., and J. Medved, "Routing Information 3175 Base Info Model", draft-ietf-i2rs-rib-info-model-15 (work 3176 in progress), March 2018. 3178 [I-D.ietf-i2rs-usecase-reqs-summary] 3179 Hares, S. and M. Chen, "Summary of I2RS Use Case 3180 Requirements", draft-ietf-i2rs-usecase-reqs-summary-03 3181 (work in progress), November 2016. 3183 [RFC2784] Farinacci, D., Li, T., Hanks, S., Meyer, D., and P. 3184 Traina, "Generic Routing Encapsulation (GRE)", RFC 2784, 3185 DOI 10.17487/RFC2784, March 2000, 3186 . 3188 [RFC7348] Mahalingam, M., Dutt, D., Duda, K., Agarwal, P., Kreeger, 3189 L., Sridhar, T., Bursell, M., and C. Wright, "Virtual 3190 eXtensible Local Area Network (VXLAN): A Framework for 3191 Overlaying Virtualized Layer 2 Networks over Layer 3 3192 Networks", RFC 7348, DOI 10.17487/RFC7348, August 2014, 3193 . 3195 [RFC7637] Garg, P., Ed. and Y. Wang, Ed., "NVGRE: Network 3196 Virtualization Using Generic Routing Encapsulation", 3197 RFC 7637, DOI 10.17487/RFC7637, September 2015, 3198 . 3200 [RFC7921] Atlas, A., Halpern, J., Hares, S., Ward, D., and T. 3201 Nadeau, "An Architecture for the Interface to the Routing 3202 System", RFC 7921, DOI 10.17487/RFC7921, June 2016, 3203 . 3205 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 3206 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 3207 . 3209 Authors' Addresses 3211 Lixing Wang 3212 Individual 3214 Email: wang_little_star@sina.com 3216 Mach(Guoyi) Chen 3217 Huawei 3219 Email: mach.chen@huawei.com 3221 Amit Dass 3222 Ericsson 3224 Email: amit.dass@ericsson.com 3226 Hariharan Ananthakrishnan 3227 Packet Design 3229 Email: hari@packetdesign.com 3231 Sriganesh Kini 3232 Individual 3234 Email: sriganeshkini@gmail.com 3235 Nitin Bahadur 3236 Bracket Computing 3238 Email: nitin_bahadur@yahoo.com