idnits 2.17.1 draft-ietf-i2rs-rib-data-model-06.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 140 has weird spacing: '...rw name if:...' == Line 145 has weird spacing: '...-family rib...' == Line 181 has weird spacing: '...mber-id uin...' -- The document date (July 3, 2016) is 2853 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-17) exists of draft-ietf-i2rs-protocol-security-requirements-06 == Outdated reference: A later version (-17) exists of draft-ietf-i2rs-rib-info-model-08 == Outdated reference: A later version (-06) exists of draft-ietf-i2rs-security-environment-reqs-01 == Outdated reference: A later version (-03) exists of draft-ietf-i2rs-usecase-reqs-summary-02 Summary: 0 errors (**), 0 flaws (~~), 8 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 H. Ananthakrishnan 5 Expires: January 4, 2017 Packet Design 6 M. Chen 7 Huawei 8 A. Dass 9 S. Kini 10 Ericsson 11 N. Bahadur 12 Bracket Computing 13 July 3, 2016 15 A YANG Data Model for Routing Information Base (RIB) 16 draft-ietf-i2rs-rib-data-model-06 18 Abstract 20 This document defines a YANG data model for Routing Information Base 21 (RIB) that aligns with the I2RS RIB information model. 23 Requirements Language 25 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 26 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 27 document are to be interpreted as described in RFC 2119 [RFC2119]. 29 Status of This Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on January 4, 2017. 46 Copyright Notice 48 Copyright (c) 2016 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 64 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 65 1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 3 66 2. Model Structure . . . . . . . . . . . . . . . . . . . . . . . 3 67 2.1. RIB Capability . . . . . . . . . . . . . . . . . . . . . 7 68 2.2. Routing Instance and Rib . . . . . . . . . . . . . . . . 8 69 2.3. Route . . . . . . . . . . . . . . . . . . . . . . . . . . 8 70 2.4. Nexthop . . . . . . . . . . . . . . . . . . . . . . . . . 10 71 2.5. RPC Operations . . . . . . . . . . . . . . . . . . . . . 14 72 2.6. Notifications . . . . . . . . . . . . . . . . . . . . . . 18 73 3. YANG Modules . . . . . . . . . . . . . . . . . . . . . . . . 20 74 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 64 75 5. Security Considerations . . . . . . . . . . . . . . . . . . . 64 76 6. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 65 77 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 65 78 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 65 79 8.1. Normative References . . . . . . . . . . . . . . . . . . 65 80 8.2. Informative References . . . . . . . . . . . . . . . . . 65 81 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 66 83 1. Introduction 85 The Interface to the Routing System (I2RS) 86 [I-D.ietf-i2rs-architecture] provides read and write access to the 87 information and state within the routing process that exists inside 88 the routing elements, this is achieved via protocol message exchange 89 between I2RS clients and I2RS agents associated with the routing 90 system. One of the functions of I2RS is to read and write data of 91 Routing Information Base (RIB). [I-D.ietf-i2rs-usecase-reqs-summary] 92 introduces a set of RIB use cases. The RIB information model is 93 defined in [I-D.ietf-i2rs-rib-info-model]. 95 This document defines a YANG [RFC6020][RFC6991] data model for the 96 RIB that satisfies the RIB use cases and aligns with the RIB 97 information model. 99 1.1. Definitions and Acronyms 101 RIB: Routing Information Base 103 Information Model (IM): An abstract model of a conceptual domain, 104 independent of a specific implementation or data representation. 106 1.2. Tree Diagrams 108 A simplified graphical representation of the data model is used in 109 this document. The meaning of the symbols in these diagrams is as 110 follows: 112 o Brackets "[" and "]" enclose list keys. 114 o Curly braces "{" and "}" contain names of optional features that 115 make the corresponding node conditional. 117 o Abbreviations before data node names: "rw" means configuration 118 (read-write) and "ro" state data (read-only). 120 o Symbols after data node names: "?" means an optional node and "*" 121 denotes a "list" and "leaf-list". 123 o Parentheses enclose choice and case nodes, and case nodes are also 124 marked with a colon (":"). 126 o Ellipsis ("...") stands for contents of subtrees that are not 127 shown. 129 2. Model Structure 131 The following figure shows an overview of structure tree of the ietf- 132 i2rs-rib module. To give a whole view of the structure tree, some 133 details of the tree are omitted. The relevant details are introduced 134 in the subsequent sub-sections. 136 module: ietf-i2rs-rib 137 +--rw routing-instance 138 +--rw name string 139 +--rw interface-list* [name] 140 | +--rw name if:interface-ref 141 +--rw router-id? yang:dotted-quad 142 +--rw lookup-limit? uint8 143 +--rw rib-list* [name] 144 +--rw name string 145 +--rw address-family rib-family-def 146 +--rw ip-rpf-check? boolean 147 +--rw route-list* [route-index] 148 | +--rw route-index uint64 149 | +--rw match 150 | | +--rw (route-type)? 151 | | +--:(ipv4) 152 | | | ... 153 | | +--:(ipv6) 154 | | | ... 155 | | +--:(mpls-route) 156 | | | ... 157 | | +--:(mac-route) 158 | | | ... 159 | | +--:(interface-route) 160 | | ... 161 | +--rw nexthop 162 | | +--rw nexthop-id? uint32 163 | | +--rw sharing-flag? boolean 164 | | +--rw (nexthop-type)? 165 | | +--:(nexthop-base) 166 | | | ... 167 | | +--:(nexthop-chain) {nexthop-chain}? 168 | | | ... 169 | | +--:(nexthop-replicates) {nexthop-replicates}? 170 | | | ... 171 | | +--:(nexthop-protection) {nexthop-protection}? 172 | | | ... 173 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 174 | | ... 175 | +--rw route-status 176 | | ... 177 | +--rw route-attributes 178 | | ... 179 | +--rw route-vendor-attributes 180 +--rw nexthop-list* [nexthop-member-id] 181 +--rw nexthop-member-id uint32 182 rpcs: 183 +---x rib-add 184 | +---w input 185 | | +---w name string 186 | | +---w address-family rib-family-def 187 | | +---w ip-rpf-check? boolean 188 | +--ro output 189 | +--ro result uint32 190 | +--ro reason? string 191 +---x rib-delete 192 | +---w input 193 | | +---w name string 194 | +--ro output 195 | +--ro result uint32 196 | +--ro reason? string 197 +---x route-add 198 | +---w input 199 | | +---w return-failure-detail? boolean 200 | | +---w rib-name string 201 | | +---w routes 202 | | +---w route-list* [route-index] 203 | | ... 204 | +--ro output 205 | +--ro success-count uint32 206 | +--ro failed-count uint32 207 | +--ro failure-detail 208 | +--ro failed-routes* [route-index] 209 | +--ro route-index uint32 210 | +--ro error-code? uint32 211 +---x route-delete 212 | +---w input 213 | | +---w return-failure-detail? boolean 214 | | +---w rib-name string 215 | | +---w routes 216 | | +---w route-list* [route-index] 217 | | ... 218 | +--ro output 219 | +--ro success-count uint32 220 | +--ro failed-count uint32 221 | +--ro failure-detail 222 | +--ro failed-routes* [route-index] 223 | +--ro route-index uint32 224 | +--ro error-code? uint32 225 +---x route-update 226 | +---w input 227 | | +---w return-failure-detail? boolean 228 | | +---w rib-name string 229 | | +---w (match-options)? 230 | | +--:(match-route-prefix) 231 | | | ... 232 | | +--:(match-route-attributes) 233 | | | ... 234 | | +--:(match-route-vendor-attributes) {...}? 235 | | | ... 236 | | +--:(match-nexthop) 237 | | ... 238 | +--ro output 239 | +--ro success-count uint32 240 | +--ro failed-count uint32 241 | +--ro failure-detail 242 | +--ro failed-routes* [route-index] 243 | +--ro route-index uint32 244 | +--ro error-code? uint32 245 +---x nh-add 246 | +---w input 247 | | +---w rib-name string 248 | | +---w nexthop-id? uint32 249 | | +---w sharing-flag? boolean 250 | | +---w (nexthop-type)? 251 | | +--:(nexthop-base) 252 | | | ... 253 | | +--:(nexthop-chain) {nexthop-chain}? 254 | | | ... 255 | | +--:(nexthop-replicates) {nexthop-replicates}? 256 | | | ... 257 | | +--:(nexthop-protection) {nexthop-protection}? 258 | | | ... 259 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 260 | | ... 261 | +--ro output 262 | +--ro result uint32 263 | +--ro reason? string 264 | +--ro nexthop-id? uint32 265 +---x nh-delete 266 +---w input 267 | +---w rib-name string 268 | +---w nexthop-id? uint32 269 | +---w sharing-flag? boolean 270 | +---w (nexthop-type)? 271 | +--:(nexthop-base) 272 | | ... 273 | +--:(nexthop-chain) {nexthop-chain}? 274 | | ... 275 | +--:(nexthop-replicates) {nexthop-replicates}? 276 | | ... 277 | +--:(nexthop-protection) {nexthop-protection}? 278 | | ... 279 | +--:(nexthop-load-balance) {nexthop-load-balance}? 280 | ... 281 +--ro output 282 +--ro result uint32 283 +--ro reason? string 284 notifications: 285 +---n nexthop-resolution-status-change 286 | +--ro nexthop 287 | | +--ro nexthop-id? uint32 288 | | +--ro sharing-flag? boolean 289 | | +--ro (nexthop-type)? 290 | | +--:(nexthop-base) 291 | | | ... 292 | | +--:(nexthop-chain) {nexthop-chain}? 293 | | | ... 294 | | +--:(nexthop-replicates) {nexthop-replicates}? 295 | | | ... 296 | | +--:(nexthop-protection) {nexthop-protection}? 297 | | | ... 298 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 299 | | ... 300 | +--ro nexthop-state nexthop-state-def 301 +---n route-change 302 +--ro rib-name string 303 +--ro address-family rib-family-def 304 +--ro route-index uint64 305 +--ro match 306 | +--ro (route-type)? 307 | +--:(ipv4) 308 | | ... 309 | +--:(ipv6) 310 | | ... 311 | +--:(mpls-route) 312 | | ... 313 | +--:(mac-route) 314 | | ... 315 | +--:(interface-route) 316 | ... 317 +--ro route-installed-state route-installed-state-def 318 +--ro route-state route-state-def 319 +--ro route-change-reason route-reason-def 321 Figure 1: Overview of I2RS RIB Module Structure 323 2.1. RIB Capability 325 RIB capability negotiation is very important because not all of the 326 hardware will be able to support all kinds of nexthops and there 327 might be a limitation on how many levels of lookup can be practically 328 performed. Therefore, a RIB data model MUST specify a way for an 329 external entity to learn about the functional capabilities of a 330 network device. 332 At the same time, nexthop chains can be used to specify multiple 333 headers over a packet, before that particular packet is forwarded. 334 Not every network device will be able to support all kinds of nexthop 335 chains along with the arbitrary number of headers which are chained 336 together. The RIB data model MUST provide a way to expose the 337 nexthop chaining capability supported by a given network device. 339 This module uses the feature and if-feature statements to achieve 340 above capability advertisement. 342 2.2. Routing Instance and Rib 344 A routing instance, in the context of the RIB information model, is a 345 collection of RIBs, interfaces, and routing protocol parameters. A 346 routing instance creates a logical slice of the router and can allow 347 multiple different logical slices, across a set of routers, to 348 communicate with each other. The routing protocol parameters control 349 the information available in the RIBs. More detail about routing 350 instance can be found in Section 2.2 of 351 [I-D.ietf-i2rs-rib-info-model]. 353 For a routing instance, there can be multiple RIBs. Therefore, this 354 model uses "list" to express the RIBs. The structure tree is shown 355 below: 357 +--rw routing-instance 358 +--rw name string 359 +--rw interface-list* [name] 360 | +--rw name if:interface-ref 361 +--rw router-id? yang:dotted-quad 362 +--rw lookup-limit? uint8 363 +--rw rib-list* [name] 364 +--rw name string 365 +--rw address-family rib-family-def 366 +--rw ip-rpf-check? boolean 367 +--rw route-list* [route-index] 368 ... (refer to Section 2.3) 370 Figure 2: Routing Instance Structure 372 2.3. Route 374 A route is essentially a match condition and an action following that 375 match. The match condition specifies the kind of route (e.g., IPv4, 376 MPLS, MAC, Interface etc.) and the set of fields to match on. 378 According to the definition in [I-D.ietf-i2rs-rib-info-model], a 379 route MUST associate with the following attributes: 381 o ROUTE_PREFERENCE: See Section 2.3 of 382 [I-D.ietf-i2rs-rib-info-model]. 384 o ACTIVE: Indicates whether a route has at least one fully resolved 385 nexthop and is therefore eligible for installation in the FIB. 387 o INSTALLED: Indicates whether the route got installed in the FIB. 389 In addition, a route can be associated with one or more optional 390 route attributes (e.g., route-vendor-attributes). 392 A RIB will have a number of routes, so the routes are expressed as a 393 list under a specific rib. Each RIB has its own route list. 395 +--rw route-list* [route-index] 396 +--rw route-index uint64 397 +--rw match 398 | +--rw (route-type)? 399 | +--:(ipv4) 400 | | +--rw ipv4 401 | | +--rw (ip-route-match-type)? 402 | | +--:(dest-ipv4-address) 403 | | | ... 404 | | +--:(src-ipv4-address) 405 | | | ... 406 | | +--:(dest-src-ipv4-address) 407 | | ... 408 | +--:(ipv6) 409 | | +--rw ipv6 410 | | +--rw (ip-route-match-type)? 411 | | +--:(dest-ipv6-address) 412 | | | ... 413 | | +--:(src-ipv6-address) 414 | | | ... 415 | | +--:(dest-src-ipv6-address) 416 | | ... 417 | +--:(mpls-route) 418 | | +--rw mpls-label uint32 419 | +--:(mac-route) 420 | | +--rw mac-address uint32 421 | +--:(interface-route) 422 | +--rw interface-identifier if:interface-ref 423 +--rw nexthop 424 | ...(refer to Section 2.4) 426 Figure 3: Routes Structure 428 2.4. Nexthop 430 A nexthop represents an object resulting from a route lookup. As 431 illustrated in Section 2.4 of [I-D.ietf-i2rs-rib-info-model], to 432 support various use cases (e.g., load balance, protection, multicast 433 or a combination of them), the nexthop is modeled as a multi-level 434 structure and supports recursion. The first level of the nexthop 435 includes the following four types: 437 o Base: The "base" nexthop is the foundation of all other nexthop 438 types. It includes the follow basic nexthops: 440 * nexthop-id 442 * IPv4 address 444 * IPv6 address 446 * egress-interface 448 * egress-interface with IPv4 address 450 * egress-interface with IPv6 address 452 * egress-interface with MAC address 454 * logical-tunnel 456 * tunnel-encap 458 * tunnel-decap 460 * rib-name 462 o Chain: Provide a way to perform multiple operations on a packet by 463 logically combining them. 465 o Load-balance: Designed for load-balance case where it normally 466 will have multiple weighted nexthops. 468 o Protection: Designed for protection scenario where it normally 469 will have primary and standby nexthop. 471 o Replicate: Designed for multiple destinations forwarding. 473 The structure tree of nexthop is shown in the following figures. 475 +--rw nexthop 476 | +--rw nexthop-id? uint32 477 | +--rw sharing-flag? boolean 478 | +--rw (nexthop-type)? 479 | +--:(nexthop-base) 480 | | ...(refer to Figure 5) 481 | +--:(nexthop-chain) {nexthop-chain}? 482 | | +--rw nexthop-chain 483 | | +--rw nexthop-list* [nexthop-member-id] 484 | | +--rw nexthop-member-id uint32 485 | +--:(nexthop-replicates) {nexthop-replicates}? 486 | | +--rw nexthop-replicates 487 | | +--rw nexthop-list* [nexthop-member-id] 488 | | +--rw nexthop-member-id uint32 489 | +--:(nexthop-protection) {nexthop-protection}? 490 | | +--rw nexthop-protection 491 | | +--rw nexthop-list* [nexthop-member-id] 492 | | +--rw nexthop-member-id uint32 493 | | +--rw nexthop-preference nexthop-preference-def 494 | +--:(nexthop-load-balance) {nexthop-load-balance}? 495 | +--rw nexthop-lb 496 | +--rw nexthop-list* [nexthop-member-id] 497 | +--rw nexthop-member-id uint32 498 | +--rw nexthop-lb-weight nexthop-lb-weight-def 500 Figure 4: Nexthop Structure 502 Figure 5 (as shown blow) is a sub-tree of nexthop, it's under the 503 nexthop base node and shows that structure of the "base" nexthop. 505 +--:(nexthop-base) 506 | +--rw nexthop-base 507 | +--rw (nexthop-base-type)? 508 | +--:(special-nexthop) 509 | | +--rw special? special-nexthop-def 510 | +--:(egress-interface-nexthop) 511 | | +--rw outgoing-interface if:interface-ref 512 | +--:(ipv4-address-nexthop) 513 | | +--rw ipv4-address inet:ipv4-address 514 | +--:(ipv6-address-nexthop) 515 | | +--rw ipv6-address inet:ipv6-address 516 | +--:(egress-interface-ipv4-nexthop) 517 | | +--rw egress-interface-ipv4-address 518 | | +--rw outgoing-interface if:interface-ref 519 | | +--rw ipv4-address inet:ipv4-address 520 | +--:(egress-interface-ipv6-nexthop) 521 | | +--rw egress-interface-ipv6-address 522 | | +--rw outgoing-interface if:interface-ref 523 | | +--rw ipv6-address inet:ipv6-address 524 | +--:(egress-interface-mac-nexthop) 525 | | +--rw egress-interface-mac-address 526 | | +--rw outgoing-interface if:interface-ref 527 | | +--rw ieee-mac-address uint32 528 | +--:(tunnel-encap-nexthop) {nexthop-tunnel}? 529 | | +--rw tunnel-encap 530 | | +--rw (tunnel-type)? 531 | | +--:(ipv4) {ipv4-tunnel}? 532 | | | +--rw ipv4-header 533 | | | +--rw src-ipv4-address inet:ipv4-address 534 | | | +--rw dest-ipv4-address inet:ipv4-address 535 | | | +--rw protocol uint8 536 | | | +--rw ttl? uint8 537 | | | +--rw dscp? uint8 538 | | +--:(ipv6) {ipv6-tunnel}? 539 | | | +--rw ipv6-header 540 | | | +--rw src-ipv6-address inet:ipv6-address 541 | | | +--rw dest-ipv6-address inet:ipv6-address 542 | | | +--rw next-header uint8 543 | | | +--rw traffic-class? uint8 544 | | | +--rw flow-label? uint16 545 | | | +--rw hop-limit? uint8 546 | | +--:(mpls) {mpls-tunnel}? 547 | | | +--rw mpls-header 548 | | | +--rw label-operations* [label-oper-id] 549 | | | +--rw label-oper-id uint32 550 | | | +--rw (label-actions)? 551 | | | +--:(label-push) 552 | | | | +--rw label-push 553 | | | | +--rw label uint32 554 | | | | +--rw s-bit? boolean 555 | | | | +--rw tc-value? uint8 556 | | | | +--rw ttl-value? uint8 557 | | | +--:(label-swap) 558 | | | +--rw label-swap 559 | | | +--rw in-label uint32 560 | | | +--rw out-label uint32 561 | | | +--rw ttl-action? ttl-action-def 562 | | +--:(gre) {gre-tunnel}? 563 | | | +--rw gre-header 564 | | | +--rw (dest-address-type)? 565 | | | | +--:(ipv4) 566 | | | | | +--rw ipv4-dest inet:ipv4-address 567 | | | | +--:(ipv6) 568 | | | | +--rw ipv6-dest inet:ipv6-address 569 | | | +--rw protocol-type uint16 570 | | | +--rw key? uint64 571 | | +--:(nvgre) {nvgre-tunnel}? 572 | | | +--rw nvgre-header 573 | | | +--rw (nvgre-type)? 574 | | | | +--:(ipv4) 575 | | | | | +--rw src-ipv4-address inet:ipv4-address 576 | | | | | +--rw dest-ipv4-address inet:ipv4-address 577 | | | | | +--rw protocol uint8 578 | | | | | +--rw ttl? uint8 579 | | | | | +--rw dscp? uint8 580 | | | | +--:(ipv6) 581 | | | | +--rw src-ipv6-address inet:ipv6-address 582 | | | | +--rw dest-ipv6-address inet:ipv6-address 583 | | | | +--rw next-header uint8 584 | | | | +--rw traffic-class? uint8 585 | | | | +--rw flow-label? uint16 586 | | | | +--rw hop-limit? uint8 587 | | | +--rw virtual-subnet-id uint32 588 | | | +--rw flow-id? uint16 589 | | +--:(vxlan) {vxlan-tunnel}? 590 | | +--rw vxlan-header 591 | | +--rw (vxlan-type)? 592 | | | +--:(ipv4) 593 | | | | +--rw src-ipv4-address inet:ipv4-address 594 | | | | +--rw dest-ipv4-address inet:ipv4-address 595 | | | | +--rw protocol uint8 596 | | | | +--rw ttl? uint8 597 | | | | +--rw dscp? uint8 598 | | | +--:(ipv6) 599 | | | +--rw src-ipv6-address inet:ipv6-address 600 | | | +--rw dest-ipv6-address inet:ipv6-address 601 | | | +--rw next-header uint8 602 | | | +--rw traffic-class? uint8 603 | | | +--rw flow-label? uint16 604 | | | +--rw hop-limit? uint8 605 | | +--rw vxlan-identifier uint32 606 | +--:(tunnel-decap-nexthop) {nexthop-tunnel}? 607 | | +--rw tunnel-decap 608 | | +--rw (tunnel-type)? 609 | | +--:(ipv4) {ipv4-tunnel}? 610 | | | +--rw ipv4-decap 611 | | | +--rw ipv4-decap tunnel-decap-action-def 612 | | | +--rw ttl-action? ttl-action-def 613 | | +--:(ipv6) {ipv6-tunnel}? 614 | | | +--rw ipv6-decap 615 | | | +--rw ipv6-decap tunnel-decap-action-def 616 | | | +--rw hop-limit-action? hop-limit-action-def 617 | | +--:(mpls) {mpls-tunnel}? 618 | | +--rw label-pop 619 | | +--rw label-pop mpls-label-action-def 620 | | +--rw ttl-action? ttl-action-def 621 | +--:(logical-tunnel-nexthop) {nexthop-tunnel}? 622 | | +--rw logical-tunnel 623 | | +--rw tunnel-type tunnel-type-def 624 | | +--rw tunnel-name string 625 | +--:(rib-name-nexthop) 626 | | +--rw rib-name? string 627 | +--:(nexthop-identifier) 628 | +--rw nexthop-ref nexthop-ref 630 Figure 5: Nexthop Base Structure 632 2.5. RPC Operations 634 This module defines the following RPC operations: 636 o rib-add: Add a RIB to a routing instance. A name of the rib, 637 address family of the RIB and (optionally) whether the RPF check 638 is enabled are passed as the input parameters. The output is the 639 result of the add operation: 641 * true - success; 643 * false - failed; when failed, the i2rs agent may return the 644 specific reason that causes the failure. 646 o rib-delete: Delete a RIB from a routing instance. When a RIB is 647 deleted, all routes installed in the RIB will be deleted. A name 648 of the RIB is passed as the input parameter. The output is the 649 result of the delete operation: 651 * true - success; 653 * false - failed; when failed, the i2rs agent may return the 654 specific reason that causes the failure. 656 o route-add: Add a route or a set of routes to a rib. A RIB name, 657 the route prefix(es), route attributes, route vendor attributes, 658 nexthop and whether return failure detail are passed as the input 659 parameters. Before calling the route-add rpc, it is required to 660 call the nh-add rpc to create and/or return the nexthop 661 identifier. The output is a combination of the route operation 662 states that include: 664 * success-count: the number of routes that were successfully 665 added; 667 * failed-count: the number of the routes that failed to be added; 669 * failure-detail: shows the specific routes that failed to be 670 added. 672 o route-delete: Delete a route or a set of routes from a rib. A 673 name of the rib, the route prefix(es) and whether to return 674 failure detail are passed as the input parameters. The output is 675 a combination of route operation states that include: 677 * success-count: the number of routes that were successfully 678 deleted; 680 * failed-count: the number of the routes that failed to be 681 deleted; 683 * failure-detail: shows the specific routes that failed to be 684 deleted. 686 o route-update: Update a route or a set of routes. A RIB name, the 687 route prefix(es), or route attributes, or route vendor attributes, 688 or nexthop are passed as the input parameters. The match 689 conditions can be either route prefix(es), or route attributes, or 690 route vendor attributes, or nexthop. The update actions include: 691 update the nexthop, update the route attributes, update the route 692 vendor attributes. The output is combination of the route 693 operation states that include: 695 * success-count: the number of routes that were successfully 696 updated; 698 * failed-count: the number of the routes that failed to be 699 updated; 701 * failure-detail: shows the specific routes that failed to be 702 updated. 704 o nh-add: Add a nexthop to a rib. A name of the RIB and a nexthop 705 are passed as the input parameters. The network node is required 706 to allocate a nexthop identifier to the nexthop. The outputs 707 include the result of the nexthop add operation. 709 * true - success; when success, a nexthop identifier will be 710 returned to the i2rs client. 712 * false - failed; when failed, the i2rs agent may return the 713 specific reason that causes the failure. 715 o nh-delete: Delete a nexthop from a rib. A name of a RIB and a 716 nexthop or nexthop identifier are passed as the input parameters. 717 The output is the result of the delete operation: 719 * true - success; 721 * false - failed; when failed, the i2rs agent may return the 722 specific reason that causes the failure. 724 The structure tree of rpcs is shown in following figure. 726 rpcs: 727 +---x rib-add 728 | +---w input 729 | | +---w rib-name string 730 | | +---w address-family rib-family-def 731 | | +---w ip-rpf-check? boolean 732 | +--ro output 733 | +--ro result uint32 734 | +--ro reason? string 735 +---x rib-delete 736 | +---w input 737 | | +---w rib-name string 738 | +--ro output 739 | +--ro result uint32 740 | +--ro reason? string 741 +---x route-add 742 | +---w input 743 | | +---w return-failure-detail? boolean 744 | | +---w rib-name string 745 | | +---w routes 746 | | +---w route-list* [route-index] 747 | | ... 748 | +--ro output 749 | +--ro success-count uint32 750 | +--ro failed-count uint32 751 | +--ro failure-detail 752 | +--ro failed-routes* [route-index] 753 | +--ro route-index uint32 754 | +--ro error-code? uint32 755 +---x route-delete 756 | +---w input 757 | | +---w return-failure-detail? boolean 758 | | +---w rib-name string 759 | | +---w routes 760 | | +---w route-list* [route-index] 761 | | ... 762 | +--ro output 763 | +--ro success-count uint32 764 | +--ro failed-count uint32 765 | +--ro failure-detail 766 | +--ro failed-routes* [route-index] 767 | +--ro route-index uint32 768 | +--ro error-code? uint32 769 +---x route-update 770 | +---w input 771 | | +---w return-failure-detail? boolean 772 | | +---w rib-name string 773 | | +---w (match-options)? 774 | | +--:(match-route-prefix) 775 | | | ... 776 | | +--:(match-route-attributes) 777 | | | ... 778 | | +--:(match-route-vendor-attributes) {...}? 779 | | | ... 780 | | +--:(match-nexthop) 781 | | ... 782 | +--ro output 783 | +--ro success-count uint32 784 | +--ro failed-count uint32 785 | +--ro failure-detail 786 | +--ro failed-routes* [route-index] 787 | +--ro route-index uint32 788 | +--ro error-code? uint32 789 +---x nh-add 790 | +---w input 791 | | +---w rib-name string 792 | | +---w nexthop-id? uint32 793 | | +---w sharing-flag? boolean 794 | | +---w (nexthop-type)? 795 | | ... 796 | +--ro output 797 | +--ro result uint32 798 | +--ro reason? string 799 | +--ro nexthop-id? uint32 800 +---x nh-delete 801 +---w input 802 | +---w rib-name string 803 | +---w nexthop-id? uint32 804 | +---w sharing-flag? boolean 805 | +---w (nexthop-type)? 806 | ... 807 +--ro output 808 +--ro result uint32 809 +--ro reason? string 810 Figure 6: RPCs Structure 812 2.6. Notifications 814 Asynchronous notifications are sent by the RIB manager of a network 815 device to an external entity when some event triggers on the network 816 device. An implementation of this RIB data model MUST support 817 sending two kinds of asynchronous notifications. 819 1. Route change notification: 821 o Installed (Indicates whether the route got installed in the FIB) ; 823 o Active (Indicates whether a route has at least one fully resolved 824 nexthop and is therefore eligible for installation in the FIB) ; 826 o Reason - E.g. Not authorized 828 2. Nexthop resolution status notification 830 Nexthops can be fully resolved or an unresolved. 832 A resolved nexthop has an adequate level of information to send the 833 outgoing packet towards the destination by forwarding it on an 834 interface to a directly connected neighbor. 836 An unresolved nexthop is something that requires the RIB manager to 837 determine the final resolved nexthop. In one example, a nexthop 838 could be an IP address. The RIB manager would resolve how to reach 839 that IP address, e.g. by checking if that particular IP address is 840 reachable by regular IP forwarding or by a MPLS tunnel or by both. 841 If the RIB manager cannot resolve the nexthop, then the nexthop 842 remains in an unresolved state and is NOT a suitable candidate for 843 installation in the FIB. 845 An implementation of this RIB data model MUST support sending route- 846 change notifications whenever a route transitions between the 847 following states: 849 o from the active state to the inactive state 851 o from the inactive state to the active state 853 o from the installed state to the uninstalled state 855 o from the uninstalled state to the installed state 856 A single notification MAY be used when a route transitions from 857 inactive/uninstalled to active/installed or in the other direction. 859 The structure tree of notifications is shown in the following figure. 861 notifications: 862 +---n nexthop-resolution-status-change 863 | +--ro nexthop 864 | | +--ro nexthop-id uint32 865 | | +--ro sharing-flag boolean 866 | | +--ro (nexthop-type)? 867 | | +--:(nexthop-base) 868 | | | ... 869 | | +--:(nexthop-chain) {nexthop-chain}? 870 | | | ... 871 | | +--:(nexthop-replicates) {nexthop-replicates}? 872 | | | ... 873 | | +--:(nexthop-protection) {nexthop-protection}? 874 | | | ... 875 | | +--:(nexthop-load-balance) {nexthop-load-balance}? 876 | | ... 877 | +--ro nexthop-state nexthop-state-def 878 +---n route-change 879 +--ro rib-name string 880 +--ro address-family rib-family-def 881 +--ro route-index uint64 882 +--ro match 883 | +--ro (route-type)? 884 | +--:(ipv4) 885 | | ... 886 | +--:(ipv6) 887 | | ... 888 | +--:(mpls-route) 889 | | ... 890 | +--:(mac-route) 891 | | ... 892 | +--:(interface-route) 893 | ... 894 +--ro route-installed-state route-installed-state-def 895 +--ro route-state route-state-def 896 +--ro route-change-reason route-change-reason-def 898 Figure 7: Notifications Structure 900 3. YANG Modules 902 file "ietf-i2rs-rib@2016-07-04.yang" 904 module ietf-i2rs-rib { 905 namespace "urn:ietf:params:xml:ns:yang:ietf-i2rs-rib"; 906 // replace with iana namespace when assigned 907 prefix "iir"; 909 import ietf-inet-types { 910 prefix inet; 911 //rfc6991 912 } 914 import ietf-interfaces { 915 prefix "if"; 916 } 918 import ietf-yang-types { 919 prefix yang; 920 } 922 organization 923 "IETF I2RS (Interface to Routing System) Working Group"; 924 contact 925 "WG Web: 926 WG List: 928 WG Chair: Susan Hares 929 931 WG Chair: Russ White 932 934 Editor: Lixing Wang 935 937 Editor: Hariharan Ananthakrishnan 938 940 Editor: Mach(Guoyi) Chen 941 943 Editor: Amit Dass 944 946 Editor: Sriganesh Kini 947 949 Editor: Nitin Bahadur 950 "; 951 description 952 "This module defines a YANG data model for 953 Routing Information Base (RIB) that aligns 954 with the I2RS RIB information model."; 955 revision "2016-07-04" { 956 description "initial revision"; 957 reference "draft-ietf-i2rs-data-model-06"; 958 } 960 //Features 961 feature nexthop-tunnel { 962 description 963 "This feature means that a node supports 964 tunnel nexthop capability."; 965 } 967 feature nexthop-chain { 968 description 969 "This feature means that a node supports 970 chain nexthop capability."; 971 } 973 feature nexthop-protection { 974 description 975 "This feature means that a node supports 976 protection nexthop capability."; 977 } 979 feature nexthop-replicates { 980 description 981 "This feature means that a node supports 982 replicates nexthop capability."; 983 } 985 feature nexthop-load-balance { 986 description 987 "This feature means that a node supports 988 load balance nexthop capability."; 989 } 991 feature ipv4-tunnel { 992 description 993 "This feature means that a node supports 994 IPv4 tunnel encapsulation capability."; 995 } 996 feature ipv6-tunnel { 997 description 998 "This feature means that a node supports 999 IPv6 tunnel encapsulation capability."; 1000 } 1002 feature mpls-tunnel { 1003 description 1004 "This feature means that a node supports 1005 MPLS tunnel encapsulation capability."; 1006 } 1008 feature vxlan-tunnel { 1009 description 1010 "This feature means that a node supports 1011 VxLAN tunnel encapsulation capability."; 1012 } 1014 feature gre-tunnel { 1015 description 1016 "This feature means that a node supports 1017 GRE tunnel encapsulation capability."; 1018 } 1020 feature nvgre-tunnel { 1021 description 1022 "This feature means that a node supports 1023 NvGRE tunnel encapsulation capability."; 1024 } 1026 feature route-vendor-attributes { 1027 description 1028 "This feature means that a node supports 1029 route vendor attributes."; 1030 } 1032 //Identities and Type Definitions 1033 identity mpls-label-action { 1034 description 1035 "Base identity from which all MPLS label 1036 operations are derived. 1037 The MPLS label stack operations include: 1038 push - to add a new label to a label stack, 1039 pop - to pop the top label from a label stack, 1040 swap - to exchange the top label of a label 1041 stack with new label."; 1042 } 1043 identity label-push { 1044 base "mpls-label-action"; 1045 description 1046 "MPLS label stack operation: push."; 1047 } 1049 identity label-pop { 1050 base "mpls-label-action"; 1051 description 1052 "MPLS label stack operation: pop."; 1053 } 1055 identity label-swap { 1056 base "mpls-label-action"; 1057 description 1058 "MPLS label stack operation: swap."; 1059 } 1061 typedef mpls-label-action-def { 1062 type identityref { 1063 base "mpls-label-action"; 1064 } 1065 description 1066 "MPLS label action def."; 1067 } 1069 identity tunnel-decap-action { 1070 description 1071 "Base identity from which all tunnel decap 1072 actions are derived. 1073 Tunnel decap actions include: 1074 ipv4-decap - to decap an IPv4 tunnel, 1075 ipv6-decap - to decap an IPv6 tunnel."; 1076 } 1078 identity ipv4-decap { 1079 base "tunnel-decap-action"; 1080 description 1081 "IPv4 tunnel decap."; 1082 } 1084 identity ipv6-decap { 1085 base "tunnel-decap-action"; 1086 description 1087 "IPv4 tunnel decap."; 1088 } 1090 typedef tunnel-decap-action-def { 1091 type identityref { 1092 base "tunnel-decap-action"; 1093 } 1094 description 1095 "Tunnel decap def."; 1096 } 1098 identity ttl-action { 1099 description 1100 "Base identity from which all TTL 1101 actions are derived."; 1102 } 1104 identity no-action { 1105 base "ttl-action"; 1106 description 1107 "Do nothing regarding the TTL."; 1108 } 1110 identity copy-to-inner { 1111 base "ttl-action"; 1112 description 1113 "Copy the TTL of the outer header 1114 to the inner header."; 1115 } 1117 identity decrease-and-copy-to-inner { 1118 base "ttl-action"; 1119 description 1120 "Decrease TTL by one and copy the TTL 1121 to the inner header."; 1122 } 1124 identity decrease-and-copy-to-next { 1125 base "ttl-action"; 1126 description 1127 "Decrease TTL by one and copy the TTL 1128 to the next header.For example: when 1129 MPLS label swapping, decrease the TTL 1130 of the inner label and copy it to the 1131 outer label."; 1132 } 1134 typedef ttl-action-def { 1135 type identityref { 1136 base "ttl-action"; 1137 } 1138 description 1139 "TTL action def."; 1140 } 1142 identity hop-limit-action { 1143 description 1144 "Base identity from which all hop limit 1145 actions are derived."; 1146 } 1148 identity hop-limit-no-action { 1149 base "hop-limit-action"; 1150 description 1151 "Do nothing regarding the hop limit."; 1152 } 1154 identity hop-limit-copy-to-inner { 1155 base "hop-limit-action"; 1156 description 1157 "Copy the hop limit of the outer header 1158 to the inner header."; 1159 } 1161 typedef hop-limit-action-def { 1162 type identityref { 1163 base "hop-limit-action"; 1164 } 1165 description 1166 "IPv6 hop limit action def."; 1167 } 1169 identity special-nexthop { 1170 description 1171 "Base identity from which all special 1172 nexthops are derived."; 1173 } 1175 identity discard { 1176 base "special-nexthop"; 1177 description 1178 "This indicates that the network 1179 device should drop the packet and 1180 increment a drop counter."; 1181 } 1183 identity discard-with-error { 1184 base "special-nexthop"; 1185 description 1186 "This indicates that the network 1187 device should drop the packet, 1188 increment a drop counter and send 1189 back an appropriate error message 1190 (like ICMP error)."; 1191 } 1193 identity receive { 1194 base "special-nexthop"; 1195 description 1196 "This indicates that the traffic is 1197 destined for the network device. For 1198 example, protocol packets or OAM packets. 1199 All locally destined traffic SHOULD be 1200 throttled to avoid a denial of service 1201 attack on the router's control plane. An 1202 optional rate-limiter can be specified 1203 to indicate how to throttle traffic 1204 destined for the control plane."; 1205 } 1207 identity cos-value { 1208 base "special-nexthop"; 1209 description 1210 "Cos-value special nexthop."; 1211 } 1213 typedef special-nexthop-def { 1214 type identityref { 1215 base "special-nexthop"; 1216 } 1217 description 1218 "Special nexthop def."; 1219 } 1221 identity ip-route-match-type { 1222 description 1223 "Base identity from which all route 1224 match types are derived. 1225 Route match type could be: 1226 match source, or 1227 match destination, or 1228 match source and destination."; 1229 } 1231 identity match-ip-src { 1232 base "ip-route-match-type"; 1233 description 1234 "Source route match type."; 1236 } 1237 identity match-ip-dest { 1238 base "ip-route-match-type"; 1239 description 1240 "Destination route match type"; 1241 } 1242 identity match-ip-src-dest { 1243 base "ip-route-match-type"; 1244 description 1245 "Source and Destination route match type"; 1246 } 1248 typedef ip-route-match-type-def { 1249 type identityref { 1250 base "ip-route-match-type"; 1251 } 1252 description 1253 "IP route match type def."; 1254 } 1256 identity rib-family { 1257 description 1258 "Base identity from which all RIB 1259 address families are derived."; 1260 } 1262 identity ipv4-rib-family { 1263 base "rib-family"; 1264 description 1265 "IPv4 RIB address family."; 1266 } 1268 identity ipv6-rib-family { 1269 base "rib-family"; 1270 description 1271 "IPv6 RIB address family."; 1272 } 1274 identity mpls-rib-family { 1275 base "rib-family"; 1276 description 1277 "MPLS RIB address family."; 1278 } 1280 identity ieee-mac-rib-family { 1281 base "rib-family"; 1282 description 1283 "MAC RIB address family."; 1285 } 1287 typedef rib-family-def { 1288 type identityref { 1289 base "rib-family"; 1290 } 1291 description 1292 "Rib address family def."; 1293 } 1295 identity route-type { 1296 description 1297 "Base identity from which all route types 1298 are derived."; 1299 } 1301 identity ipv4-route { 1302 base "route-type"; 1303 description 1304 "IPv4 route type."; 1305 } 1307 identity ipv6-route { 1308 base "route-type"; 1309 description 1310 "IPv6 route type."; 1311 } 1313 identity mpls-route { 1314 base "route-type"; 1315 description 1316 "MPLS route type."; 1317 } 1319 identity ieee-mac { 1320 base "route-type"; 1321 description 1322 "MAC route type."; 1323 } 1325 identity interface { 1326 base "route-type"; 1327 description 1328 "Interface route type."; 1329 } 1331 typedef route-type-def { 1332 type identityref { 1333 base "route-type"; 1334 } 1335 description 1336 "Route type def."; 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"; 1379 } 1380 typedef tunnel-type-def { 1381 type identityref { 1382 base "tunnel-type"; 1383 } 1384 description 1385 "Tunnel type def."; 1386 } 1388 identity route-state { 1389 description 1390 "Base identity from which all route 1391 states are derived."; 1392 } 1394 identity active { 1395 base "route-state"; 1396 description 1397 "Active state."; 1398 } 1400 identity inactive { 1401 base "route-state"; 1402 description 1403 "Inactive state."; 1404 } 1406 typedef route-state-def { 1407 type identityref { 1408 base "route-state"; 1409 } 1410 description 1411 "Route state def."; 1412 } 1414 identity nexthop-state { 1415 description 1416 "Base identity from which all nexthop 1417 states are derived."; 1418 } 1420 identity resolved { 1421 base "nexthop-state"; 1422 description 1423 "Reolved nexthop state."; 1424 } 1426 identity unresolved { 1427 base "nexthop-state"; 1428 description 1429 "Unresolved nexthop state."; 1430 } 1432 typedef nexthop-state-def { 1433 type identityref { 1434 base "nexthop-state"; 1435 } 1436 description 1437 "Nexthop state def."; 1438 } 1440 identity route-installed-state { 1441 description 1442 "Base identity from which all route 1443 installed states are derived."; 1444 } 1446 identity uninstalled { 1447 base "route-installed-state"; 1448 description 1449 "Uninstalled state."; 1450 } 1452 identity installed { 1453 base "route-installed-state"; 1454 description 1455 "Installed state."; 1456 } 1458 typedef route-installed-state-def { 1459 type identityref { 1460 base "route-installed-state"; 1461 } 1462 description 1463 "Route installed state def."; 1464 } 1466 //Route change reason identities 1468 identity route-change-reason { 1469 description 1470 "Base identity from which all route change 1471 reasons are derived."; 1472 } 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-def { 1505 type identityref { 1506 base "route-change-reason"; 1507 } 1508 description 1509 "Route change reason def."; 1510 } 1512 typedef nexthop-preference-def { 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 } 1527 typedef nexthop-lb-weight-def { 1528 type uint8 { 1529 range "1..99"; 1530 } 1531 description 1532 "Nexthop-lb-weight is used for load-balancing. 1533 Each list member MUST be assigned a weight 1534 between 1 and 99. The weight determines the 1535 proportion of traffic to be sent over a nexthop 1536 used for forwarding as a ratio of the weight of 1537 this nexthop divided by the weights of all the 1538 nexthops of this route that are used for forwarding. 1539 To perform equal load-balancing, one MAY specify 1540 a weight of 0 for all the member nexthops. The 1541 value 0 is reserved for equal load-balancing 1542 and if applied, MUST be applied to all member nexthops."; 1543 } 1545 typedef nexthop-ref { 1546 type leafref { 1547 path "/iir:routing-instance" + 1548 "/iir:rib-list" + 1549 "/iir:route-list" + 1550 "/iir:nexthop" + 1551 "/iir:nexthop-id"; 1552 } 1553 description 1554 "A nexthop reference that provides 1555 an indirection reference to a nexthop."; 1556 } 1558 //Groupings 1559 grouping route-prefix { 1560 description 1561 "The common attributes used for all types of route prefix."; 1562 leaf route-index { 1563 type uint64 ; 1564 mandatory true; 1565 description 1566 "Route index."; 1567 } 1568 container match { 1569 description 1570 "The match condition specifies the 1571 kind of route (IPv4, MPLS, etc.) 1572 and the set of fields to match on."; 1573 choice route-type { 1574 description 1575 "Route types: IPv4, IPv6, MPLS, MAC etc."; 1576 case ipv4 { 1577 description 1578 "IPv4 route case."; 1579 container ipv4 { 1580 description 1581 "IPv4 route match."; 1582 choice ip-route-match-type { 1583 description 1584 "IP route match type options: 1585 match source, or 1586 match destination, or 1587 match source and destination."; 1588 case dest-ipv4-address { 1589 leaf dest-ipv4-prefix { 1590 type inet:ipv4-prefix; 1591 mandatory true; 1592 description 1593 "An IPv4 destination address as the match."; 1594 } 1595 } 1596 case src-ipv4-address { 1597 leaf src-ipv4-prefix { 1598 type inet:ipv4-prefix; 1599 mandatory true; 1600 description 1601 "An IPv4 source address as the match."; 1602 } 1603 } 1604 case dest-src-ipv4-address { 1605 container dest-src-ipv4-address { 1606 description 1607 "A combination of an IPv4 source and 1608 an IPv4 destination address as the match."; 1609 leaf dest-ipv4-prefix { 1610 type inet:ipv4-prefix; 1611 mandatory true; 1612 description 1613 "The IPv4 destination address of the match."; 1614 } 1615 leaf src-ipv4-prefix { 1616 type inet:ipv4-prefix; 1617 mandatory true; 1618 description 1619 "The IPv4 source address of the match"; 1620 } 1621 } 1622 } 1623 } 1624 } 1625 } 1626 case ipv6 { 1627 description 1628 "IPv6 route case."; 1629 container ipv6 { 1630 description 1631 "IPv6 route match."; 1632 choice ip-route-match-type { 1633 description 1634 "IP route match type options: 1635 match source, or 1636 match destination, or 1637 match source and destination."; 1638 case dest-ipv6-address { 1639 leaf dest-ipv6-prefix { 1640 type inet:ipv6-prefix; 1641 mandatory true; 1642 description 1643 "An IPv6 destination address as the match."; 1644 } 1645 } 1646 case src-ipv6-address { 1647 leaf src-ipv6-prefix { 1648 type inet:ipv6-prefix; 1649 mandatory true; 1650 description 1651 "An IPv6 source address as the match."; 1652 } 1653 } 1654 case dest-src-ipv6-address { 1655 container dest-src-ipv6-address { 1656 description 1657 "A combination of an IPv6 source and 1658 an IPv6 destination address as the match."; 1659 leaf dest-ipv6-prefix { 1660 type inet:ipv6-prefix; 1661 mandatory true; 1662 description 1663 "The IPv6 destination address of the match"; 1664 } 1665 leaf src-ipv6-prefix { 1666 type inet:ipv6-prefix; 1667 mandatory true; 1668 description 1669 "The IPv6 source address of the match."; 1670 } 1671 } 1672 } 1673 } 1674 } 1675 } 1676 case mpls-route { 1677 description 1678 "MPLS route case."; 1679 leaf mpls-label { 1680 type uint32 ; 1681 mandatory true; 1682 description 1683 "The label used for matching."; 1684 } 1685 } 1686 case mac-route { 1687 description 1688 "MAC route case."; 1689 leaf mac-address { 1690 type uint32 ; 1691 mandatory true; 1692 description 1693 "The MAC address used for matching."; 1694 } 1695 } 1696 case interface-route { 1697 description 1698 "Interface route case."; 1699 leaf interface-identifier { 1700 type if:interface-ref; 1701 mandatory true; 1702 description 1703 "The interface used for matching."; 1704 } 1705 } 1706 } 1707 } 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-def; 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-def; 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-def; 1738 config false; 1739 description 1740 "Indicate the reason that causes 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-def; 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-def; 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."; 1852 uses nexthop-base; 1853 } 1854 } 1855 case nexthop-chain { 1856 if-feature nexthop-chain; 1857 container nexthop-chain { 1858 description 1859 "A chain nexthop."; 1860 uses nexthop-list; 1861 } 1862 } 1863 case nexthop-replicates { 1864 if-feature nexthop-replicates; 1865 container nexthop-replicates { 1866 description 1867 "A replicates nexthop."; 1868 uses nexthop-list; 1869 } 1870 } 1871 case nexthop-protection { 1872 if-feature nexthop-protection; 1873 container nexthop-protection { 1874 description 1875 "A protection nexthop."; 1876 uses nexthop-list-p; 1877 } 1878 } 1879 case nexthop-load-balance { 1880 if-feature nexthop-load-balance; 1881 container nexthop-lb { 1882 description 1883 "A load balance nexthop."; 1884 uses nexthop-list-w; 1885 } 1886 } 1887 } 1888 } 1890 grouping nexthop-base { 1891 description 1892 "The base nexthop."; 1893 choice nexthop-base-type { 1894 description 1895 "Nexthop base type options."; 1896 case special-nexthop { 1897 leaf special { 1898 type special-nexthop-def; 1899 description 1900 "A special nexthop."; 1901 } 1902 } 1903 case egress-interface-nexthop { 1904 leaf outgoing-interface { 1905 type if:interface-ref; 1906 mandatory true; 1907 description 1908 "The nexthop is an outgoing interface."; 1909 } 1910 } 1911 case ipv4-address-nexthop { 1912 leaf ipv4-address { 1913 type inet:ipv4-address; 1914 mandatory true; 1915 description 1916 "The nexthop is an IPv4 address."; 1917 } 1918 } 1919 case ipv6-address-nexthop { 1920 leaf ipv6-address { 1921 type inet:ipv6-address; 1922 mandatory true; 1923 description 1924 "The nexthop is an IPv6 address."; 1925 } 1926 } 1927 case egress-interface-ipv4-nexthop { 1928 container egress-interface-ipv4-address{ 1929 leaf outgoing-interface { 1930 type if:interface-ref; 1931 mandatory true; 1932 description 1933 "Name of the outgoing interface."; 1934 } 1935 leaf ipv4-address { 1936 type inet:ipv4-address; 1937 mandatory true; 1938 description 1939 "The nexthop points to an interface with 1940 an IPv4 address."; 1941 } 1942 description 1943 "The nexthop is an egress-interface and an IP 1944 address. This can be used in cases e.g. where 1945 the IP address is a link-local address."; 1946 } 1947 } 1948 case egress-interface-ipv6-nexthop { 1949 container egress-interface-ipv6-address { 1950 leaf outgoing-interface { 1951 type if:interface-ref; 1952 mandatory true; 1953 description 1954 "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 uint32; 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 encap representing an IP tunnel or 1997 MPLS tunnel or others as defined in info model. 1998 An optional egress interface can be chained to the 1999 tunnel encap to indicate which interface to send 2000 the packet out on. The egress interface is useful 2001 when the network device contains Ethernet interfaces 2002 and one needs to perform address resolution for the 2003 IP packet."; 2005 } 2006 } 2007 case tunnel-decap-nexthop { 2008 if-feature nexthop-tunnel; 2009 container tunnel-decap { 2010 uses tunnel-decap; 2011 description 2012 "This is to specify decapsulating a tunnel header."; 2013 } 2014 } 2015 case logical-tunnel-nexthop { 2016 if-feature nexthop-tunnel; 2017 container logical-tunnel { 2018 uses logical-tunnel; 2019 description 2020 "This can be a MPLS LSP or a GRE tunnel (or others 2021 as defined in this document), that is represented 2022 by a unique identifier (e.g. name)."; 2023 } 2024 } 2025 case rib-name-nexthop { 2026 leaf rib-name { 2027 type string; 2028 description 2029 "A nexthop pointing to a RIB indicates that the 2030 route lookup needs to continue in the specified 2031 rib. This is a way to perform chained lookups."; 2032 } 2033 } 2034 case nexthop-identifier { 2035 leaf nexthop-ref { 2036 type nexthop-ref; 2037 mandatory true; 2038 description 2039 "A nexthop reference that points to a nexthop."; 2040 } 2041 } 2042 } 2043 } 2045 grouping route-vendor-attributes { 2046 description 2047 "Route vendor attributes."; 2048 } 2050 grouping logical-tunnel { 2051 description 2052 "A logical tunnel that is identified 2053 by a type and a tunnel name."; 2054 leaf tunnel-type { 2055 type tunnel-type-def; 2056 mandatory true; 2057 description 2058 "A tunnel type."; 2059 } 2060 leaf tunnel-name { 2061 type string; 2062 mandatory true; 2063 description 2064 "A tunnel name that points to a logical tunnel."; 2065 } 2066 } 2068 grouping ipv4-header { 2069 description 2070 "The IPv4 header encapsulation information."; 2071 leaf src-ipv4-address { 2072 type inet:ipv4-address; 2073 mandatory true; 2074 description 2075 "The source IP address of the header."; 2076 } 2077 leaf dest-ipv4-address { 2078 type inet:ipv4-address; 2079 mandatory true; 2080 description 2081 "The destination IP address of the header."; 2082 } 2083 leaf protocol { 2084 type uint8; 2085 mandatory true; 2086 description 2087 "The protocol id of the header."; 2088 } 2089 leaf ttl { 2090 type uint8; 2091 description 2092 "The TTL of the header."; 2093 } 2094 leaf dscp { 2095 type uint8; 2096 description 2097 "The DSCP field of the header."; 2098 } 2099 } 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 uint16; 2128 description 2129 "The flow label of the header."; 2130 } 2131 leaf hop-limit { 2132 type uint8; 2133 description 2134 "The hop limit the header."; 2135 } 2136 } 2138 grouping nvgre-header { 2139 description 2140 "The NvGRE header encapsulation information."; 2141 choice nvgre-type { 2142 description 2143 "NvGRE can use eigher IPv4 2144 or IPv6 header for encapsulation."; 2145 case ipv4 { 2146 uses ipv4-header; 2147 } 2148 case ipv6 { 2149 uses ipv6-header; 2150 } 2151 } 2152 leaf virtual-subnet-id { 2153 type uint32; 2154 mandatory true; 2155 description 2156 "The subnet identifier of the NvGRE header."; 2157 } 2158 leaf flow-id { 2159 type uint16; 2160 description 2161 "The flow identifier of the NvGRE header."; 2162 } 2163 } 2165 grouping vxlan-header { 2166 description 2167 "The VxLAN encapsulation header information."; 2168 choice vxlan-type { 2169 description 2170 "NvGRE can use either IPv4 2171 or IPv6 header for encapsulation."; 2172 case ipv4 { 2173 uses ipv4-header; 2174 } 2175 case ipv6 { 2176 uses ipv6-header; 2177 } 2178 } 2179 leaf vxlan-identifier { 2180 type uint32; 2181 mandatory true; 2182 description 2183 "The VxLAN identifier of the VxLAN header."; 2184 } 2185 } 2187 grouping gre-header { 2188 description 2189 "The GRE encapsulation header information."; 2190 choice dest-address-type { 2191 description 2192 "GRE options: IPv4 and IPv6"; 2193 case ipv4 { 2194 leaf ipv4-dest { 2195 type inet:ipv4-address; 2196 mandatory true; 2197 description 2198 "The destination IP address of the GRE header."; 2199 } 2200 } 2201 case ipv6 { 2202 leaf ipv6-dest { 2203 type inet:ipv6-address; 2204 mandatory true; 2205 description 2206 "The destination IP address of the GRE header."; 2207 } 2208 } 2209 } 2210 leaf protocol-type { 2211 type uint16; 2212 mandatory true; 2213 description 2214 "The protocol type of the GRE header."; 2215 } 2216 leaf key { 2217 type uint64; 2218 description 2219 "The GRE key of the GRE header."; 2220 } 2221 } 2223 grouping mpls-header { 2224 description 2225 "The MPLS encapsulation header information."; 2226 list label-operations { 2227 key "label-oper-id"; 2228 description 2229 "Label operations."; 2230 leaf label-oper-id { 2231 type uint32; 2232 description 2233 "An optional identifier that points 2234 to a label operation."; 2235 } 2236 choice label-actions { 2237 description 2238 "Label action options."; 2239 case label-push { 2240 container label-push { 2241 description 2242 "Label push operation."; 2243 leaf label { 2244 type uint32; 2245 mandatory true; 2246 description 2247 "The label to be pushed."; 2248 } 2249 leaf s-bit { 2250 type boolean; 2251 description 2252 "The s-bit of the label to be pushed. "; 2253 } 2254 leaf tc-value { 2255 type uint8; 2256 description 2257 "The traffic class value of the label to be pushed."; 2258 } 2259 leaf ttl-value { 2260 type uint8; 2261 description 2262 "The TTL value of the label to be pushed."; 2263 } 2264 } 2265 } 2266 case label-swap { 2267 container label-swap { 2268 description 2269 "Label swap operation."; 2270 leaf in-label { 2271 type uint32; 2272 mandatory true; 2273 description 2274 "The label to be swapped."; 2275 } 2276 leaf out-label { 2277 type uint32; 2278 mandatory true; 2279 description 2280 "The out MPLS label."; 2281 } 2282 leaf ttl-action { 2283 type ttl-action-def; 2284 description 2285 "The label ttl actions: 2286 - No-action, or 2287 - Copy to inner label,or 2288 - Decrease (the in label) by 1 and 2289 copy to the out label."; 2290 } 2291 } 2293 } 2294 } 2295 } 2296 } 2298 grouping tunnel-encap{ 2299 description 2300 "Tunnel encapsulation information."; 2301 choice tunnel-type { 2302 description 2303 "Tunnel options for next-hops."; 2304 case ipv4 { 2305 if-feature ipv4-tunnel; 2306 container ipv4-header { 2307 uses ipv4-header; 2308 description 2309 "IPv4 header."; 2310 } 2311 } 2312 case ipv6 { 2313 if-feature ipv6-tunnel; 2314 container ipv6-header { 2315 uses ipv6-header; 2316 description 2317 "IPv6 header."; 2318 } 2319 } 2320 case mpls { 2321 if-feature mpls-tunnel; 2322 container mpls-header { 2323 uses mpls-header; 2324 description 2325 "MPLS header."; 2326 } 2327 } 2328 case gre { 2329 if-feature gre-tunnel; 2330 container gre-header { 2331 uses gre-header; 2332 description 2333 "GRE header."; 2334 } 2335 } 2336 case nvgre { 2337 if-feature nvgre-tunnel; 2338 container nvgre-header { 2339 uses nvgre-header; 2340 description 2341 "NvGRE header."; 2342 } 2343 } 2344 case vxlan { 2345 if-feature vxlan-tunnel; 2346 container vxlan-header { 2347 uses vxlan-header; 2348 description 2349 "VxLAN header."; 2350 } 2351 } 2352 } 2353 } 2355 grouping tunnel-decap { 2356 description 2357 "Tunnel decapsulation information."; 2358 choice tunnel-type { 2359 description 2360 "Nexthop tunnel type options."; 2361 case ipv4 { 2362 if-feature ipv4-tunnel; 2363 container ipv4-decap { 2364 description 2365 "IPv4 decap."; 2366 leaf ipv4-decap { 2367 type tunnel-decap-action-def; 2368 mandatory true; 2369 description 2370 "IPv4 decap operations."; 2371 } 2372 leaf ttl-action { 2373 type ttl-action-def; 2374 description 2375 "The ttl actions: 2376 no-action or copy to inner header."; 2377 } 2378 } 2379 } 2380 case ipv6 { 2381 if-feature ipv6-tunnel; 2382 container ipv6-decap { 2383 description 2384 "IPv6 decap."; 2385 leaf ipv6-decap { 2386 type tunnel-decap-action-def; 2387 mandatory true; 2388 description 2389 "IPv6 decap operations."; 2390 } 2391 leaf hop-limit-action { 2392 type hop-limit-action-def; 2393 description 2394 "The hop limit actions: 2395 no-action or copy to inner header."; 2396 } 2397 } 2398 } 2399 case mpls { 2400 if-feature mpls-tunnel; 2401 container label-pop { 2402 description 2403 "MPLS decap."; 2404 leaf label-pop { 2405 type mpls-label-action-def; 2406 mandatory true; 2407 description 2408 "Pop a label from the label stack."; 2409 } 2410 leaf ttl-action { 2411 type ttl-action-def; 2412 description 2413 "The label ttl action."; 2414 } 2415 } 2416 } 2417 } 2418 } 2420 grouping route-attributes { 2421 description 2422 "Route attributes."; 2423 leaf route-preference { 2424 type uint32; 2425 mandatory true; 2426 description 2427 "ROUTE_PREFERENCE: This is a numerical value that 2428 allows for comparing routes from different 2429 protocols. Static configuration is also 2430 considered a protocol for the purpose of this 2431 field. It is also known as administrative-distance. 2432 The lower the value, the higher the preference."; 2433 } 2434 leaf local-only { 2435 type boolean ; 2436 mandatory true; 2437 description 2438 "Indicate whether the attributes is local only."; 2439 } 2440 container address-family-route-attributes{ 2441 description 2442 "Address family related route attributes."; 2443 choice route-type { 2444 description 2445 "Address family related route attributes."; 2446 case ip-route-attributes { 2447 } 2448 case mpls-route-attributes { 2449 } 2450 case ethernet-route-attributes { 2451 } 2452 } 2453 } 2454 } 2456 container routing-instance { 2457 description 2458 "A routing instance, in the context of 2459 the RIB information model, is a collection 2460 of RIBs, interfaces, and routing parameters"; 2461 leaf name { 2462 type string; 2463 description 2464 "The name of the routing instance. This MUST 2465 be unique across all routing instances in 2466 a given network device."; 2467 } 2468 list interface-list { 2469 key "name"; 2470 description 2471 "This represents the list of interfaces associated 2472 with this routing instance. The interface list helps 2473 constrain the boundaries of packet forwarding. 2474 Packets coming on these interfaces are directly 2475 associated with the given routing instance. The 2476 interface list contains a list of identifiers, with 2477 each identifier uniquely identifying an interface."; 2478 leaf name { 2479 type if:interface-ref; 2480 description 2481 "A reference to the name of a network layer interface."; 2482 } 2483 } 2484 leaf router-id { 2485 type yang:dotted-quad; 2486 description 2487 "Router ID - 32-bit number in the form of a dotted quad."; 2488 } 2489 leaf lookup-limit { 2490 type uint8; 2491 description 2492 "A limit on how many levels of a lookup can be performed."; 2493 } 2494 list rib-list { 2495 key "name"; 2496 description 2497 "A list of RIBs that are associated with the routing 2498 instance."; 2499 leaf name { 2500 type string; 2501 mandatory true; 2502 description 2503 "A reference to the name of each rib."; 2504 } 2505 leaf address-family { 2506 type rib-family-def; 2507 mandatory true; 2508 description 2509 "The address family of a rib."; 2510 } 2511 leaf ip-rpf-check { 2512 type boolean; 2513 description 2514 "Each RIB can be optionally associated with a 2515 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2516 path forwarding (RPF) checks on all IP routes in that 2517 RIB. Reverse path forwarding (RPF) check is used to 2518 prevent spoofing and limit malicious traffic."; 2519 } 2520 list route-list { 2521 key "route-index"; 2522 description 2523 "A list of routes of a rib."; 2524 uses route; 2525 } 2526 // This is a list that maintains the nexthops added to the rib. 2527 uses nexthop-list; 2528 } 2529 } 2531 //RPC Operations 2532 rpc rib-add { 2533 description 2534 "To add a RIB to a instance"; 2535 input { 2536 leaf name { 2537 type string; 2538 mandatory true; 2539 description 2540 "A reference to the name of the RIB 2541 that is to be added."; 2542 } 2543 leaf address-family { 2544 type rib-family-def; 2545 mandatory true; 2546 description 2547 "The address family of the rib."; 2548 } 2549 leaf ip-rpf-check { 2550 type boolean; 2551 description 2552 "Each RIB can be optionally associated with a 2553 ENABLE_IP_RPF_CHECK attribute that enables Reverse 2554 path forwarding (RPF) checks on all IP routes in that 2555 RIB. Reverse path forwarding (RPF) check is used to 2556 prevent spoofing and limit malicious traffic."; 2557 } 2558 } 2559 output { 2560 leaf result { 2561 type boolean; 2562 mandatory true; 2563 description 2564 "Return the result of the rib-add operation. 2565 true - success; 2566 false - failed"; 2567 } 2568 leaf reason { 2569 type string; 2570 description 2571 "The specific reason that causes the failure."; 2572 } 2573 } 2574 } 2576 rpc rib-delete { 2577 description 2578 "To delete a RIB from a routing instance. 2579 After deleting the rib, all routes installed 2580 in the RIB will be deleted as well."; 2582 input { 2583 leaf name { 2584 type string; 2585 mandatory true; 2586 description 2587 "A reference to the name of the RIB 2588 that is to be deleted."; 2589 } 2590 } 2591 output { 2592 leaf result { 2593 type boolean; 2594 mandatory true; 2595 description 2596 "Return the result of the rib-delete operation. 2597 true - success; 2598 false - failed"; 2599 } 2600 leaf reason { 2601 type string; 2602 description 2603 "The specific reason that causes failure."; 2604 } 2605 } 2606 } 2608 grouping route-operation-state { 2609 description 2610 "Route operation state."; 2611 leaf success-count { 2612 type uint32; 2613 mandatory true; 2614 description 2615 "The numbers of routes that are successfully 2616 added/deleted/updated."; 2617 } 2618 leaf failed-count { 2619 type uint32; 2620 mandatory true; 2621 description 2622 "The numbers of the routes that are failed 2623 to be added/deleted/updated."; 2624 } 2625 container failure-detail { 2626 description 2627 "The failure detail reflects the reason why a route 2628 operation fails. It is a array that includes the route 2629 index and error code of the failed route."; 2631 list failed-routes { 2632 key "route-index"; 2633 description 2634 "The list of failed routes."; 2635 leaf route-index { 2636 type uint32; 2637 description 2638 "The route index of the failed route."; 2639 } 2640 leaf error-code { 2641 type uint32; 2642 description 2643 "The error code that reflects the failure reason."; 2644 } 2645 } 2646 } 2647 } 2649 rpc route-add { 2650 description 2651 "To add a route or a list of route to a rib"; 2652 input { 2653 leaf return-failure-detail { 2654 type boolean; 2655 default false; 2656 description 2657 "Whether return the failure detail. 2658 true - return the failure detail; 2659 false - do not return the failure detail; 2660 the default is false."; 2661 } 2662 leaf rib-name { 2663 type string; 2664 mandatory true; 2665 description 2666 "A reference to the name of a rib."; 2667 } 2668 container routes { 2669 description 2670 "The routes to be added to the rib."; 2671 list route-list { 2672 key "route-index"; 2673 description 2674 "The list of routes to be added."; 2675 uses route-prefix; 2676 container route-attributes { 2677 uses route-attributes; 2678 description 2679 "The route attributes."; 2680 } 2681 container route-vendor-attributes { 2682 if-feature route-vendor-attributes; 2683 uses route-vendor-attributes; 2684 description 2685 "The route vendor attributes."; 2686 } 2687 container nexthop { 2688 uses nexthop; 2689 description 2690 "The nexthop of the added route."; 2691 } 2692 } 2693 } 2694 } 2695 output { 2696 uses route-operation-state; 2697 } 2698 } 2700 rpc route-delete { 2701 description 2702 "To delete a route or a list of route from a rib"; 2703 input { 2704 leaf return-failure-detail { 2705 type boolean; 2706 default false; 2707 description 2708 "Whether return the failure detail. 2709 true - return the failure detail; 2710 false - do not return the failure detail; 2711 the default is false."; 2712 } 2713 leaf rib-name { 2714 type string; 2715 mandatory true; 2716 description 2717 "A reference to the name of a rib."; 2718 } 2719 container routes { 2720 description 2721 "The routes to be added to the rib."; 2722 list route-list{ 2723 key "route-index"; 2724 description 2725 "The list of routes to be deleted."; 2726 uses route-prefix; 2728 } 2729 } 2730 } 2731 output { 2732 uses route-operation-state; 2733 } 2734 } 2736 grouping route-update-options { 2737 description 2738 "Update options: 2739 1. update the nexthop 2740 2. update the route attributes 2741 3. update the route-vendor-attributes."; 2742 choice update-options { 2743 description 2744 "Update options: 2745 1. update the nexthop 2746 2. update the route attributes 2747 3. update the route-vendor-attributes."; 2748 case update-nexthop { 2749 container updated-nexthop { 2750 uses nexthop; 2751 description 2752 "The nexthop used for updating."; 2753 } 2754 } 2755 case update-route-attributes { 2756 container updated-route-attr { 2757 uses route-attributes; 2758 description 2759 "The route attributes used for updating."; 2760 } 2761 } 2762 case update-route-vendor-attributes { 2763 container updated-route-vendor-attr { 2764 uses route-vendor-attributes; 2765 description 2766 "The vendor route attributes used for updating."; 2767 } 2768 } 2769 } 2770 } 2772 rpc route-update { 2773 description 2774 "To update a route or a list of route of a rib. 2775 The inputs: 2777 1. The match conditions, could be: 2778 a. route prefix, or 2779 b. route attributes, or 2780 c. nexthop; 2781 2. The update parameters to be used: 2782 a. new nexthop; 2783 b. new route attributes;nexthop 2784 Actions: 2785 1. update the nexthop 2786 2. update the route attributes 2787 The outputs: 2788 success-count - the number of routes updated; 2789 failed-count - the number of routes fail to update 2790 failure-detail - the detail failure info. 2791 "; 2792 input { 2793 leaf return-failure-detail { 2794 type boolean; 2795 default false; 2796 description 2797 "Whether return the failure detail. 2798 true - return the failure detail; 2799 false - do not return the failure detail; 2800 the default is false."; 2801 } 2802 leaf rib-name { 2803 type string; 2804 mandatory true; 2805 description 2806 "A reference to the name of a rib."; 2807 } 2808 choice match-options { 2809 description 2810 "Match options."; 2811 case match-route-prefix { 2812 description 2813 "Update the routes that match route 2814 prefix(es) condition."; 2815 container input-routes { 2816 description 2817 "The matched routes to be updated."; 2818 list route-list { 2819 key "route-index"; 2820 description 2821 "The list of routes to be updated."; 2822 uses route-prefix; 2823 uses route-update-options; 2824 } 2826 } 2827 } 2828 case match-route-attributes { 2829 description 2830 "Update the routes that match the 2831 route attributes condition."; 2832 container input-route-attributes { 2833 description 2834 "The route attributes are used for matching."; 2835 uses route-attributes; 2836 } 2837 container update-parametors { 2838 description 2839 "Update options: 2840 1. update the nexthop 2841 2. update the route attributes 2842 3. update the route-vendor-attributes."; 2843 uses route-update-options; 2844 } 2845 } 2846 case match-route-vendor-attributes { 2847 if-feature route-vendor-attributes; 2848 description 2849 "Update the routes that match the 2850 vendor attributes condition"; 2851 container input-route-vendor-attributes { 2852 description 2853 "The vendor route attributes are used for matching."; 2854 uses route-vendor-attributes; 2855 } 2856 container update-parameters-vendor { 2857 description 2858 "Update options: 2859 1. update the nexthop 2860 2. update the route attributes 2861 3. update the route-vendor-attributes."; 2862 uses route-update-options; 2863 } 2864 } 2865 case match-nexthop { 2866 description 2867 "Update the routes that match the nexthop."; 2868 container input-nexthop { 2869 description 2870 "The nexthop used for matching."; 2871 uses nexthop; 2872 } 2873 container update-parameters-nexthop { 2874 description 2875 "Update options: 2876 1. update the nexthop 2877 2. update the route attributes 2878 3. update the route-vendor-attributes."; 2879 uses route-update-options; 2880 } 2881 } 2882 } 2883 } 2884 output { 2885 uses route-operation-state; 2886 } 2887 } 2889 rpc nh-add { 2890 description 2891 "To add a nexthop to a rib. 2892 Inputs parameters: 2893 1. RIB name 2894 2. nexthop; 2895 Actions: 2896 Add the nexthop to the RIB 2897 Outputs: 2898 1.Operation result: 2899 true - success 2900 false - failed; 2901 2. nexthop identifier."; 2902 input { 2903 leaf rib-name { 2904 type string; 2905 mandatory true; 2906 description 2907 "A reference to the name of a rib."; 2908 } 2909 uses nexthop; 2910 } 2911 output { 2912 leaf result { 2913 type boolean; 2914 mandatory true; 2915 description 2916 "Return the result of the rib-add operation. 2917 true - success; 2918 false - failed;"; 2919 } 2920 leaf reason { 2921 type string; 2922 description 2923 "The specific reason that causes the failure."; 2924 } 2925 leaf nexthop-id { 2926 type uint32; 2927 description 2928 "A nexthop identifier that is allocated to the nexthop."; 2929 } 2930 } 2931 } 2933 rpc nh-delete { 2934 description 2935 "To delete a nexthop from a rib"; 2936 input { 2937 leaf rib-name { 2938 type string; 2939 mandatory true; 2940 description 2941 "A reference to the name of a rib."; 2942 } 2943 uses nexthop; 2944 } 2945 output { 2946 leaf result { 2947 type boolean; 2948 mandatory true; 2949 description 2950 "Return the result of the rib-add operation. 2951 true - success; 2952 false - failed."; 2953 } 2954 leaf reason { 2955 type string; 2956 description 2957 "The specific reason that causes the failure."; 2958 } 2959 } 2960 } 2962 /*Notifications*/ 2963 notification nexthop-resolution-status-change { 2964 description 2965 "Nexthop resolution status (resolved/unresolved) 2966 notification."; 2967 container nexthop{ 2968 description 2969 "The nexthop."; 2971 uses nexthop; 2972 } 2973 leaf nexthop-state { 2974 type nexthop-state-def; 2975 mandatory true; 2976 description 2977 "Nexthop resolution status (resolved/unresolved) 2978 notification."; 2979 } 2980 } 2982 notification route-change { 2983 description 2984 "Route change notification."; 2985 leaf rib-name { 2986 type string; 2987 mandatory true; 2988 description 2989 "A reference to the name of a rib."; 2990 } 2991 leaf address-family { 2992 type rib-family-def; 2993 mandatory true; 2994 description 2995 "The address family of a rib."; 2996 } 2997 uses route-prefix; 2998 leaf route-installed-state { 2999 type route-installed-state-def; 3000 mandatory true; 3001 description 3002 "Indicates whether the route got installed in the FIB."; 3003 } 3004 leaf route-state { 3005 type route-state-def; 3006 mandatory true; 3007 description 3008 "Indicates whether a route is active or inactive."; 3009 } 3010 list route-change-reasons { 3011 key "route-change-reason"; 3012 description 3013 "The reasons that cause the route change. A route 3014 change that may result from several reasons. For 3015 example, a nexthop becoming resolved will make a 3016 route A active which is of better preference than 3017 a currently active route B, which results in the 3018 route A being installed"; 3020 leaf route-change-reason { 3021 type route-change-reason-def; 3022 mandatory true; 3023 description 3024 "The reason that causes the route change."; 3025 } 3026 } 3027 } 3028 } 3030 3032 4. IANA Considerations 3034 This document requests to register a URI in the "ns" registry with 3035 the "IETF XML registry" [RFC3688]: 3037 -------------------------------------------------------------------- 3038 URI: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3039 Registrant Contact: The IESG. 3040 XML: N/A, the requested URI is an XML namespace. 3041 -------------------------------------------------------------------- 3043 This document requests to register a YANG module in the "YANG Module 3044 Names registry" [RFC6020]: 3046 -------------------------------------------------------------------- 3047 name: ietf-i2rs-rib 3048 namespace: urn:ietf:params:xml:ns:yang:ietf-i2rs-rib 3049 prefix: iir 3050 reference: RFC XXXX 3051 -------------------------------------------------------------------- 3053 5. Security Considerations 3055 I2RS protocol provides read and write access to the information and 3056 state (e.g., RIB) within the routing process that exists inside the 3057 routing elements. These information and state are normally 3058 considered sensitive or vulnerable. Improper write operations to 3059 these information and state can have negative effects on the network. 3061 The I2RS protocol will provide security mechanisms as required in 3062 [I-D.ietf-i2rs-security-environment-reqs] and 3063 [I-D.ietf-i2rs-protocol-security-requirements]. 3065 The YANG data model defined in this document itself will not 3066 introduce extra security issues. 3068 6. Contributors 3070 The following individuals also contribute to this document. 3072 o Zekun He, Tencent Holdings Ltd 3074 o Sujian Lu, Tencent Holdings Ltd 3076 o Jeffery Zhang, Juniper Networks 3078 7. Acknowledgements 3080 The authors would like to thank Chris Bowers and John Scudder for his 3081 review, suggestion and comments to this document. 3083 8. References 3085 8.1. Normative References 3087 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 3088 Requirement Levels", BCP 14, RFC 2119, 3089 DOI 10.17487/RFC2119, March 1997, 3090 . 3092 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 3093 DOI 10.17487/RFC3688, January 2004, 3094 . 3096 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 3097 the Network Configuration Protocol (NETCONF)", RFC 6020, 3098 DOI 10.17487/RFC6020, October 2010, 3099 . 3101 [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", 3102 RFC 6991, DOI 10.17487/RFC6991, July 2013, 3103 . 3105 8.2. Informative References 3107 [I-D.ietf-i2rs-architecture] 3108 Atlas, A., Halpern, J., Hares, S., Ward, D., and T. 3109 Nadeau, "An Architecture for the Interface to the Routing 3110 System", draft-ietf-i2rs-architecture-15 (work in 3111 progress), April 2016. 3113 [I-D.ietf-i2rs-protocol-security-requirements] 3114 Hares, S., Migault, D., and J. Halpern, "I2RS Security 3115 Related Requirements", draft-ietf-i2rs-protocol-security- 3116 requirements-06 (work in progress), May 2016. 3118 [I-D.ietf-i2rs-rib-info-model] 3119 Bahadur, N., Kini, S., and J. Medved, "Routing Information 3120 Base Info Model", draft-ietf-i2rs-rib-info-model-08 (work 3121 in progress), October 2015. 3123 [I-D.ietf-i2rs-security-environment-reqs] 3124 Migault, D., Halpern, J., and S. Hares, "I2RS Environment 3125 Security Requirements", draft-ietf-i2rs-security- 3126 environment-reqs-01 (work in progress), April 2016. 3128 [I-D.ietf-i2rs-usecase-reqs-summary] 3129 Hares, S. and M. Chen, "Summary of I2RS Use Case 3130 Requirements", draft-ietf-i2rs-usecase-reqs-summary-02 3131 (work in progress), March 2016. 3133 Authors' Addresses 3135 Lixing Wang 3136 Individual 3138 Email: wang_little_star@sina.com 3140 Hariharan Ananthakrishnan 3141 Packet Design 3143 Email: hari@packetdesign.com 3145 Mach(Guoyi) Chen 3146 Huawei 3148 Email: mach.chen@huawei.com 3150 Amit Dass 3151 Ericsson 3152 Torshamnsgatan 48. 3153 Stockholm 16480 3154 Sweden 3156 Email: amit.dass@ericsson.com 3157 Sriganesh Kini 3158 Ericsson 3160 Email: sriganesh.kini@ericsson.com 3162 Nitin Bahadur 3163 Bracket Computing 3165 Email: nitin_bahadur@yahoo.com