idnits 2.17.1 draft-vassilev-bmwg-network-interconnect-tester-03.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 191 has weird spacing: '...-stream uin...' == Line 234 has weird spacing: '...-stream uin...' == Line 286 has weird spacing: '...rw type ide...' -- The document date (March 4, 2020) is 1507 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) No issues found here. Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group V. Vassilev 3 Internet-Draft Lightside Instruments 4 Intended status: Standards Track March 4, 2020 5 Expires: September 5, 2020 7 A YANG Data Model for Network Interconnect Tester Management 8 draft-vassilev-bmwg-network-interconnect-tester-03 10 Abstract 12 This document introduces new YANG model for use in network 13 interconnect testing containing modules for traffic generator and 14 traffic analyzer. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at https://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on September 5, 2020. 33 Copyright Notice 35 Copyright (c) 2020 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (https://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1.1. Definitions and Acronyms . . . . . . . . . . . . . . 2 53 1.1.2. Tree Diagram . . . . . . . . . . . . . . . . . . . . 2 54 1.2. Problem Statement . . . . . . . . . . . . . . . . . . . . 3 55 1.3. Solution . . . . . . . . . . . . . . . . . . . . . . . . 3 56 2. Using the network interconnect tester model . . . . . . . . . 4 57 3. Traffic Generator Module Tree Diagram . . . . . . . . . . . . 4 58 4. Traffic Analyzer Module Tree Diagram . . . . . . . . . . . . 6 59 5. Traffic Generator Module YANG . . . . . . . . . . . . . . . . 8 60 6. Traffic Analyzer Module YANG . . . . . . . . . . . . . . . . 16 61 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 62 7.1. URI Registration . . . . . . . . . . . . . . . . . . . . 23 63 7.2. YANG Module Name Registration . . . . . . . . . . . . . . 23 64 8. Security Considerations . . . . . . . . . . . . . . . . . . . 23 65 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 66 9.1. Normative References . . . . . . . . . . . . . . . . . . 23 67 9.2. Informative References . . . . . . . . . . . . . . . . . 24 68 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 24 69 A.1. Basic Test Program . . . . . . . . . . . . . . . . . . . 24 70 A.2. Generating RFC2544 Testframes . . . . . . . . . . . . . . 25 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 26 73 1. Introduction 75 There is a need for standard mechanism to allow the specification and 76 implementation of the transactions part of network tests. The 77 mechanism should allow the control and monitoring of the data plane 78 traffic in a transactional way. This document defines YANG modules 79 for test traffic generator, analyzer and internal interface loopback. 81 1.1. Terminology 83 1.1.1. Definitions and Acronyms 85 DUT: Device Under Test 87 TA: Traffic Analyzer 89 TG: Traffic Generator 91 1.1.2. Tree Diagram 93 For a reference to the annotations used in tree diagrams included in 94 this document, please see YANG Tree Diagrams [RFC8340]. 96 1.2. Problem Statement 98 Network interconnect tests require active network elements part of 99 the tested network that generate test traffic and network elements 100 that analyze the test traffic at one or more points of its path. A 101 network interconnect tester is a device that can either generate test 102 traffic, analyze test traffic or both. Here is a figure borrowed 103 from [RFC2544] representing the horseshoe test setup topology 104 consisting of a single tester and a single DUT connected in a network 105 interconnect loop. 107 +------------+ 108 | | 109 +------------| tester |<-------------+ 110 | | | | 111 | +------------+ | 112 | | 113 | +------------+ | 114 | | | | 115 +----------->| DUT |--------------+ 116 | | 117 +------------+ 119 This document attempts to address the problem of defining YANG model 120 of a network interconnect tester that can be used for development of 121 vendor independent network interconnect tests and utilize the 122 advantages of transactional management using standard protocols like 123 NETCONF. 125 1.3. Solution 127 The proposed model splits the design into 3 modules - 1) Traffic 128 Generator module (TG), 2) Traffic Analyzer module (TA). The modules 129 are implemented as augmentations of the ietf-interfaces module adding 130 configuration and state data that models the functionality of a 131 tester. The TA and TG modules concept is illustrated with the 132 following diagram of a tester with two interfaces (named e0 and e1) 133 connected in a loop with single DUT: 135 +----------------+ 136 e0.egress | | e1.ingress 137 +------------| TG tester TA |<-------------+ 138 | | | | 139 | +----------------+ | 140 | | 141 | +------------+ | 142 | | | | 143 +------------->| DUT |----------------+ 144 | | 145 +------------+ 147 2. Using the network interconnect tester model 149 Basic example of how the model can be used in transactional network 150 test API to control the testers part of a network and report counter 151 statistics and timing measurement data is presented in Appendix A. 152 All example cases present the configuration and state data from a 153 single test trial. The search algorithm logic that operates to 154 control the trial configuration is outside the scope of this 155 document. One of the examples demonstrates the use of the [RFC2544] 156 defined testframe packet. 158 3. Traffic Generator Module Tree Diagram 160 module: ietf-traffic-generator 161 augment /if:interfaces/if:interface: 162 +--rw traffic-generator {egress-direction}? 163 | +--rw (type)? 164 | | +--:(single-stream) 165 | | | +--rw frame-size uint32 166 | | | +--rw (frame-data-type)? 167 | | | | +--:(raw-frame-data) 168 | | | | +--rw frame-data? string 169 | | | +--rw interframe-gap uint32 170 | | | +--rw interburst-gap? uint32 171 | | | +--rw frames-per-burst? uint32 172 | | | +--rw src-mac-address? yang:mac-address {ethernet}? 173 | | | +--rw dst-mac-address? yang:mac-address {ethernet}? 174 | | | +--rw ether-type? uint16 {ethernet}? 175 | | | +--rw vlan {ethernet-vlan,ethernet}? 176 | | | +--rw id uint16 177 | | | +--rw tpid? uint16 178 | | | +--rw pcp? uint8 179 | | | +--rw cfi? uint8 180 | | +--:(multi-stream) 181 | | +--rw streams 182 | | +--rw stream* [id] 183 | | +--rw id uint32 184 | | +--rw frame-size uint32 185 | | +--rw (frame-data-type)? 186 | | | +--:(raw-frame-data) 187 | | | +--rw frame-data? string 188 | | +--rw interframe-gap uint32 189 | | +--rw interburst-gap? uint32 190 | | +--rw frames-per-burst? uint32 191 | | +--rw frames-per-stream uint32 192 | | +--rw interstream-gap uint32 193 | | +--rw src-mac-address? 194 | | yang:mac-address {ethernet}? 195 | | +--rw dst-mac-address? 196 | | yang:mac-address {ethernet}? 197 | | +--rw ether-type? 198 | | uint16 {ethernet}? 199 | | +--rw vlan {ethernet-vlan,ethernet}? 200 | | +--rw id uint16 201 | | +--rw tpid? uint16 202 | | +--rw pcp? uint8 203 | | +--rw cfi? uint8 204 | +--rw total-frames? uint64 205 +--rw traffic-generator-ingress {ingress-direction}? 206 +--rw (type)? 207 | +--:(single-stream) 208 | | +--rw frame-size uint32 209 | | +--rw (frame-data-type)? 210 | | | +--:(raw-frame-data) 211 | | | +--rw frame-data? string 212 | | +--rw interframe-gap uint32 213 | | +--rw interburst-gap? uint32 214 | | +--rw frames-per-burst? uint32 215 | | +--rw src-mac-address? yang:mac-address {ethernet}? 216 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 217 | | +--rw ether-type? uint16 {ethernet}? 218 | | +--rw vlan {ethernet-vlan,ethernet}? 219 | | +--rw id uint16 220 | | +--rw tpid? uint16 221 | | +--rw pcp? uint8 222 | | +--rw cfi? uint8 223 | +--:(multi-stream) 224 | +--rw streams 225 | +--rw stream* [id] 226 | +--rw id uint32 227 | +--rw frame-size uint32 228 | +--rw (frame-data-type)? 229 | | +--:(raw-frame-data) 230 | | +--rw frame-data? string 231 | +--rw interframe-gap uint32 232 | +--rw interburst-gap? uint32 233 | +--rw frames-per-burst? uint32 234 | +--rw frames-per-stream uint32 235 | +--rw interstream-gap uint32 236 | +--rw src-mac-address? 237 | yang:mac-address {ethernet}? 238 | +--rw dst-mac-address? 239 | yang:mac-address {ethernet}? 240 | +--rw ether-type? 241 | uint16 {ethernet}? 242 | +--rw vlan {ethernet-vlan,ethernet}? 243 | +--rw id uint16 244 | +--rw tpid? uint16 245 | +--rw pcp? uint8 246 | +--rw cfi? uint8 247 +--rw total-frames? uint64 248 augment /if:interfaces-state/if:interface/if:statistics: 249 +--ro generated-pkts? yang:counter64 250 +--ro generated-octets? yang:counter64 251 +--ro generated-ingress-pkts? 252 | yang:counter64 {ingress-direction}? 253 +--ro generated-ingress-octets? 254 yang:counter64 {ingress-direction}? 256 4. Traffic Analyzer Module Tree Diagram 258 module: ietf-traffic-analyzer 259 augment /if:interfaces/if:interface: 260 +--rw traffic-analyzer! {ingress-direction}? 261 | +--rw filter! {filter}? 262 | | +--rw type identityref 263 | | +--rw ether-type? uint16 264 | +--ro state 265 | +--ro pkts? yang:counter64 266 | +--ro errors? yang:counter64 267 | +--ro testframe-stats 268 | | +--ro testframe-pkts? yang:counter64 269 | | +--ro sequence-errors? yang:counter64 270 | | +--ro payload-errors? yang:counter64 271 | | +--ro latency 272 | | +--ro samples? uint64 273 | | +--ro min? uint64 274 | | +--ro max? uint64 275 | | +--ro average? uint64 276 | | +--ro latest? uint64 277 | +--ro capture {capture}? 278 | +--ro frame* [sequence-number] 279 | +--ro sequence-number uint64 280 | +--ro timestamp? yang:date-and-time 281 | +--ro length? uint32 282 | +--ro preceding-interframe-gap? uint32 283 | +--ro data? string 284 +--rw traffic-analyzer-egress! {egress-direction}? 285 +--rw filter! {filter}? 286 | +--rw type identityref 287 +--ro state 288 +--ro pkts? yang:counter64 289 +--ro errors? yang:counter64 290 +--ro testframe-stats 291 | +--ro testframe-pkts? yang:counter64 292 | +--ro sequence-errors? yang:counter64 293 | +--ro payload-errors? yang:counter64 294 | +--ro latency 295 | +--ro samples? uint64 296 | +--ro min? uint64 297 | +--ro max? uint64 298 | +--ro average? uint64 299 | +--ro latest? uint64 300 +--ro capture {capture}? 301 +--ro frame* [sequence-number] 302 +--ro sequence-number uint64 303 +--ro timestamp? yang:date-and-time 304 +--ro length? uint32 305 +--ro preceding-interframe-gap? uint32 306 +--ro data? string 307 augment /if:interfaces-state/if:interface/if:statistics: 308 +--ro testframe-pkts? 309 | yang:counter64 {ingress-direction}? 310 +--ro testframe-sequence-errors? 311 | yang:counter64 {ingress-direction}? 312 +--ro testframe-payload-errors? 313 yang:counter64 {ingress-direction}? 314 augment /if:interfaces-state/if:interface/if:statistics: 315 +--ro testframe-egress-pkts? 316 | yang:counter64 {egress-direction}? 317 +--ro testframe-egress-sequence-errors? 318 | yang:counter64 {egress-direction}? 319 +--ro testframe-egress-payload-errors? 320 yang:counter64 {egress-direction}? 322 5. Traffic Generator Module YANG 324 file "ietf-traffic-generator@2020-03-05.yang" 326 module ietf-traffic-generator { 327 yang-version 1.1; 328 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-generator"; 329 prefix tg; 331 import ietf-interfaces { 332 prefix if; 333 reference 334 "RFC 8343: A YANG Data Model For Interface Management"; 335 } 336 import ietf-yang-types { 337 prefix yang; 338 reference "RFC 6991: Common YANG Data Types"; 339 } 340 import iana-if-type { 341 prefix ianaift; 342 reference "RFC 7224: IANA Interface Type YANG Module"; 343 } 345 organization 346 "IETF Benchmarking Methodology Working Group"; 347 contact 348 "WG Web: 349 WG List: 351 Editor: Vladimir Vassilev 352 "; 353 description 354 "This module contains a collection of YANG definitions for 355 description and management of network interconnect testers. 357 Copyright (c) 2020 IETF Trust and the persons identified as 358 authors of the code. All rights reserved. 360 Redistribution and use in source and binary forms, with or 361 without modification, is permitted pursuant to, and subject 362 to the license terms contained in, the Simplified BSD License 363 set forth in Section 4.c of the IETF Trust's Legal Provisions 364 Relating to IETF Documents 365 (http://trustee.ietf.org/license-info). 367 This version of this YANG module is part of RFC XXXX; see 368 the RFC itself for full legal notices."; 370 revision 2020-03-05 { 371 description 372 "Initial revision."; 373 reference 374 "RFC XXXX: A YANG Data Model for 375 Network Interconnect Tester Management"; 376 } 378 feature egress-direction { 379 description 380 "The device can generate traffic in the egress direction."; 381 } 383 feature ingress-direction { 384 description 385 "The device can generate traffic in the ingress direction."; 386 } 388 feature multi-stream { 389 description 390 "The device can generate multi-stream traffic."; 391 } 393 feature ethernet { 394 description 395 "The device can generate ethernet traffic."; 396 } 398 feature ethernet-vlan { 399 if-feature "ethernet"; 400 description 401 "The device can generate vlan tagged ethernet traffic."; 402 } 404 grouping traffic-generator-burst-data { 405 description 406 "Generated traffic burst parameters."; 407 leaf frame-size { 408 type uint32; 409 mandatory true; 410 description 411 "Size of the frames generated. For example for 412 ethernet interfaces the following definition 413 applies: 415 Ethernet frame-size in octets includes: 416 * Destination Address (6 octets), 417 * Source Address (6 octets), 418 * Frame Type (2 octets), 419 * Data (min 46 octets or 42 octets + 4 octets 802.1Q tag), 420 * CRC Checksum (4 octets). 422 Ethernet frame-size does not include: 423 * Preamble (dependent on MAC configuration 424 by default 7 octets), 425 * Start of frame delimiter (1 octet) 427 Minimum standard ethernet frame-size is 64 bytes but 428 generators might support smaller sizes for validation."; 429 } 430 choice frame-data-type { 431 description 432 "Choice of frame data type generated."; 433 case raw-frame-data { 434 leaf frame-data { 435 type string { 436 pattern '([0-9A-F]{2})*'; 437 } 438 must 'string-length(.)<=(../frame-size*2)'; 439 description 440 "The raw frame data specified as hexadecimal string. 441 The specified data can be shorter then the ../frame-size 442 value specifying only the header or the header and the 443 payload without for example the 4 byte CRC Checksum 444 in the case of a Ethernet frame."; 445 } 446 } 447 } 448 leaf interframe-gap { 449 type uint32; 450 mandatory true; 451 description 452 "Length of the idle period between generated frames. 453 For example for ethernet interfaces the following 454 definition applies: 456 Ethernet interframe-gap between transmission of frames 457 known as the interframe gap (IFG). A brief recovery time 458 between frames allows devices to prepare for 459 reception of the next frame. The minimum 460 interframe gap is 96 bit times (12 octet times) (the time it 461 takes to transmit 96 bits (12 octets) of raw data on the 462 medium). However the preamble (7 octets) and start of 463 frame delimiter (1 octet) are considered a constant gap that 464 should be included in the interframe-gap. Thus the minimum 465 value for standard ethernet transmission should be considered 466 20 octets."; 467 } 468 leaf interburst-gap { 469 type uint32; 470 description 471 "Similar to the interframe-gap but takes place between 472 any two bursts of the stream."; 473 } 474 leaf frames-per-burst { 475 type uint32; 476 description 477 "Number of frames contained in a burst"; 478 } 479 } 481 grouping traffic-generator-multi-stream-data { 482 description 483 "Multi stream traffic generation parameters."; 484 container streams { 485 description 486 "Non-presence container holding the configured stream list."; 487 list stream { 488 key "id"; 489 description 490 "Each stream repeats a burst until frames-per-stream 491 count is reached followed by interstream-gap delay."; 492 leaf id { 493 type uint32; 494 description 495 "Number specifying the order of the stream."; 496 } 497 uses traffic-generator-burst-data; 498 leaf frames-per-stream { 499 type uint32; 500 mandatory true; 501 description 502 "The count of frames to be generated before 503 generation of the next stream is started."; 504 } 505 leaf interstream-gap { 506 type uint32; 507 mandatory true; 508 description 509 "Idle period after the last frame of the last burst."; 510 } 511 } 512 } 513 } 514 grouping ethernet-data { 515 description 516 "Ethernet frame data specific parameters."; 517 reference 518 "IEEE 802-2014 Clause 9.2"; 519 leaf src-mac-address { 520 type yang:mac-address; 521 description 522 "Source Address field of the generated Ethernet packet."; 523 } 524 leaf dst-mac-address { 525 type yang:mac-address; 526 description 527 "Destination Address field of the generated Ethernet packet."; 528 } 529 leaf ether-type { 530 type uint16; 531 description 532 "Length/Type field of the generated Ethernet packet."; 533 } 534 container vlan { 535 if-feature "ethernet-vlan"; 536 description 537 "VLAN tag fields.."; 538 leaf id { 539 type uint16 { 540 range "0..4095"; 541 } 542 mandatory true; 543 description 544 "VLAN id."; 545 } 546 leaf tpid { 547 type uint16; 548 default "33024"; 549 description 550 "Configures the Tag Protocol Identifier (TPID) 551 of the 802.1q VLAN tag sent. This value is used 552 together with the vlan id for filtering incoming 553 vlan tagged packets."; 554 } 555 leaf pcp { 556 type uint8 { 557 range "0..7"; 558 } 559 default "0"; 560 description 561 "Configures the IEEE 802.1p Priority Code Point (PCP) value 562 of the transmitted 802.1q VLAN tag."; 563 } 564 leaf cfi { 565 type uint8 { 566 range "0..1"; 567 } 568 default "0"; 569 description 570 "Configures the Canonical Format Identifier (CFI) field 571 (shall be 0 for Ethernet switches) of the transmitted 572 802.1q VLAN tag."; 573 } 574 } 575 } 577 augment "/if:interfaces/if:interface" { 578 description 579 "Traffic generator augmentations of ietf-interfaces."; 580 container traffic-generator { 581 if-feature "egress-direction"; 582 description 583 "Traffic generator for egress direction."; 584 choice type { 585 description 586 "Choice of the type of the data model of the generator. 587 Single or multi stream."; 588 case single-stream { 589 uses traffic-generator-burst-data; 590 } 591 case multi-stream { 592 uses traffic-generator-multi-stream-data; 593 } 594 } 595 leaf total-frames { 596 type uint64; 597 description 598 "If this leaf is present the stream generation will stop 599 after the specified number of frames are generated."; 600 } 601 } 602 container traffic-generator-ingress { 603 if-feature "ingress-direction"; 604 description 605 "Traffic generator for ingress direction."; 606 choice type { 607 description 608 "Choice of the type of the data model of the generator. 609 Single or multi stream."; 611 case single-stream { 612 uses traffic-generator-burst-data; 613 } 614 case multi-stream { 615 uses traffic-generator-multi-stream-data; 616 } 617 } 618 leaf total-frames { 619 type uint64; 620 description 621 "If this leaf is present the stream generation will stop 622 after the specified number of frames are generated."; 623 } 624 } 625 } 627 augment "/if:interfaces-state/if:interface/if:statistics" { 628 description 629 "Counters of generated traffic octets and packets."; 630 leaf generated-pkts { 631 type yang:counter64; 632 description 633 "Traffic generator packets sent."; 634 } 635 leaf generated-octets { 636 type yang:counter64; 637 description 638 "Traffic generator octets sent."; 639 } 640 leaf generated-ingress-pkts { 641 if-feature "ingress-direction"; 642 type yang:counter64; 643 description 644 "Traffic generator packets generated in ingress mode."; 645 } 646 leaf generated-ingress-octets { 647 if-feature "ingress-direction"; 648 type yang:counter64; 649 description 650 "Traffic generator octets generated in ingress mode."; 651 } 652 } 654 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 655 + "tg:single-stream" { 656 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 657 description 658 "Ethernet interface type."; 660 } 661 if-feature "ethernet"; 662 description 663 "Ethernet specific augmentation for egress 664 single stream generator type."; 665 uses ethernet-data; 666 } 668 augment "/if:interfaces/if:interface/tg:traffic-generator/" 669 + "tg:type/tg:multi-stream/tg:streams/tg:stream" { 670 when "derived-from-or-self(../../../if:type," 671 + "'ianaift:ethernetCsmacd')" { 672 description 673 "Ethernet interface type."; 674 } 675 if-feature "ethernet"; 676 description 677 "Ethernet specific augmentation for egress 678 multi stream generator type."; 679 uses ethernet-data; 680 } 682 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/" 683 + "tg:type/tg:single-stream" { 684 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 685 description 686 "Ethernet interface type."; 687 } 688 if-feature "ethernet"; 689 description 690 "Ethernet specific augmentation for ingress 691 single stream generator type."; 692 uses ethernet-data; 693 } 695 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/" 696 + "tg:type/tg:multi-stream/tg:streams/tg:stream" { 697 when "derived-from-or-self(../../../if:type," 698 + "'ianaift:ethernetCsmacd')" { 699 description 700 "Ethernet interface type."; 701 } 702 if-feature "ethernet"; 703 description 704 "Ethernet specific augmentation for ingress 705 multi stream generator type."; 706 uses ethernet-data; 707 } 709 } 711 713 6. Traffic Analyzer Module YANG 715 file "ietf-traffic-analyzer@2020-03-05.yang" 717 module ietf-traffic-analyzer { 718 yang-version 1.1; 719 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer"; 720 prefix ta; 722 import ietf-interfaces { 723 prefix if; 724 reference 725 "RFC 8343: A YANG Data Model For Interface Management"; 726 } 727 import ietf-yang-types { 728 prefix yang; 729 reference "RFC 6991: Common YANG Data Types"; 730 } 732 organization 733 "IETF Benchmarking Methodology Working Group"; 734 contact 735 "WG Web: 736 WG List: 738 Editor: Vladimir Vassilev 739 "; 740 description 741 "This module contains a collection of YANG definitions for 742 description and management of network interconnect testers. 744 Copyright (c) 2020 IETF Trust and the persons identified as 745 authors of the code. All rights reserved. 747 Redistribution and use in source and binary forms, with or 748 without modification, is permitted pursuant to, and subject 749 to the license terms contained in, the Simplified BSD License 750 set forth in Section 4.c of the IETF Trust's Legal Provisions 751 Relating to IETF Documents 752 (http://trustee.ietf.org/license-info). 754 This version of this YANG module is part of RFC XXXX; see 755 the RFC itself for full legal notices."; 757 revision 2020-03-05 { 758 description 759 "Initial revision."; 760 reference 761 "RFC XXXX: A YANG Data Model for 762 Network Interconnect Tester Management"; 763 } 765 feature egress-direction { 766 description 767 "The device can analyze traffic from the egress direction."; 768 } 770 feature ingress-direction { 771 description 772 "The device can generate traffic from the ingress direction."; 773 } 775 feature filter { 776 description 777 "This feature indicates that the device implements 778 filter that can specify a subset of packets to be 779 analyzed when filtering is enabled."; 780 } 782 feature capture { 783 description 784 "This feature indicates that the device implements 785 packet capture functionality."; 786 } 788 identity filter { 789 description 790 "Base filter identity."; 791 } 793 identity ethernet { 794 base ta:filter; 795 description 796 "Ethernet packet fields filter."; 797 } 799 grouping statistics-data { 800 description 801 "Analyzer statistics."; 802 leaf pkts { 803 type yang:counter64; 804 description 805 "Total number of packets analyzed."; 806 } 807 leaf errors { 808 type yang:counter64; 809 description 810 "Count of packets with errors. 811 Not counted in the pkts or captured. 812 For example packets with CRC error."; 813 } 814 container testframe-stats { 815 description 816 "Statistics for testframe packets containing 817 either sequence number, payload checksum, 818 timestamp or any combination of these features."; 819 leaf testframe-pkts { 820 type yang:counter64; 821 description 822 "Total count of detected testframe packets."; 823 } 824 leaf sequence-errors { 825 type yang:counter64; 826 description 827 "Total count of testframe packets with 828 unexpected sequence number. After each sequence 829 error the expected next sequence number is 830 updated."; 831 } 832 leaf payload-errors { 833 type yang:counter64; 834 description 835 "Total count of testframe packets with 836 payload errors."; 837 } 838 container latency { 839 description 840 "Latency statistics."; 841 leaf samples { 842 type uint64; 843 description 844 "Total count of packets used for estimating 845 the latency statistics. Ideally 846 samples=../testframe-stats."; 847 } 848 leaf min { 849 type uint64; 850 units "nanoseconds"; 851 description 852 "Minimum measured latency."; 854 } 855 leaf max { 856 type uint64; 857 units "nanoseconds"; 858 description 859 "Maximum measured latency."; 860 } 861 leaf average { 862 type uint64; 863 units "nanoseconds"; 864 description 865 "The sum of all sampled latencies divided 866 by the number of samples."; 867 } 868 leaf latest { 869 type uint64; 870 units "nanoseconds"; 871 description 872 "Latency of the latest sample."; 873 } 874 } 875 } 876 } 878 grouping capture-data { 879 description 880 "Grouping with statistics and data 881 of one or more captured frame."; 882 container capture { 883 if-feature "capture"; 884 description 885 "Statistics and data of 886 one or more captured frames."; 887 list frame { 888 key "sequence-number"; 889 description 890 "Statistics and data of a captured frame."; 891 leaf sequence-number { 892 type uint64; 893 description 894 "Incremental counter of frames captured."; 895 } 896 leaf timestamp { 897 type yang:date-and-time; 898 description 899 "Timestamp of the moment the frame was captured."; 900 } 901 leaf length { 902 type uint32; 903 description 904 "Frame length. Ideally the data captured will be 905 of the same length but can be shorter 906 depending on implementation limitations."; 907 } 908 leaf preceding-interframe-gap { 909 type uint32; 910 units "nanoseconds"; 911 description 912 "Measured delay between the reception of the previous 913 frame was completed and the reception of the current 914 frame was started."; 915 } 916 leaf data { 917 type string { 918 pattern '([0-9A-F]{2})*'; 919 } 920 description 921 "Raw data of the captured frame."; 922 } 923 } 924 } 925 } 927 grouping filter-data { 928 description 929 "Grouping with a filter container specifying the filtering 930 rules for processing only a specific subset of the 931 frames."; 932 container filter { 933 if-feature "filter"; 934 presence "When present packets are 935 filtered before analyzed according 936 to the filter type"; 937 description 938 "Contains the filtering rules for processing only 939 a specific subset of the frames."; 940 leaf type { 941 type identityref { 942 base ta:filter; 943 } 944 mandatory true; 945 description 946 "Type of the applied filter. External modules can 947 define alternative filter type identities."; 948 } 949 } 951 } 953 augment "/if:interfaces/if:interface" { 954 description 955 "Traffic analyzer augmentations of ietf-interfaces."; 956 container traffic-analyzer { 957 if-feature "ingress-direction"; 958 presence "Enables the traffic analyzer for ingress traffic."; 959 description 960 "Traffic analyzer for ingress direction."; 961 uses filter-data; 962 container state { 963 config false; 964 description 965 "State data."; 966 uses statistics-data; 967 uses capture-data; 968 } 969 } 970 container traffic-analyzer-egress { 971 if-feature "egress-direction"; 972 presence "Enables the traffic analyzer for egress traffic."; 973 description 974 "Traffic analyzer for egress direction."; 975 uses filter-data; 976 container state { 977 config false; 978 description 979 "State data."; 980 uses statistics-data; 981 uses capture-data; 982 } 983 } 984 } 986 augment "/if:interfaces/if:interface/ta:traffic-analyzer/ta:filter" { 987 when "ta:type = 'ta:ethernet'"; 988 description 989 "Ethernet frame specific filter type."; 990 leaf ether-type { 991 type uint16; 992 description 993 "The Ethernet Type (or Length) value 994 defined by IEEE 802."; 995 reference 996 "IEEE 802-2014 Clause 9.2"; 997 } 998 } 999 augment "/if:interfaces-state/if:interface/if:statistics" { 1000 if-feature "ingress-direction"; 1001 description 1002 "Counters implemented by ports with analyzers."; 1003 leaf testframe-pkts { 1004 type yang:counter64; 1005 description 1006 "Testframe packets recognized by the traffic analyzer."; 1007 } 1008 leaf testframe-sequence-errors { 1009 type yang:counter64; 1010 description 1011 "Testframe packets part of the recognized total 1012 but with unexpected sequence number."; 1013 } 1014 leaf testframe-payload-errors { 1015 type yang:counter64; 1016 description 1017 "Testframe packets part of the recognized total 1018 but with payload errors."; 1019 } 1020 } 1022 augment "/if:interfaces-state/if:interface/if:statistics" { 1023 if-feature "egress-direction"; 1024 description 1025 "Counters implemented by ports with egress analyzers."; 1026 leaf testframe-egress-pkts { 1027 type yang:counter64; 1028 description 1029 "Testframe egress packets recognized by the traffic analyzer."; 1030 } 1031 leaf testframe-egress-sequence-errors { 1032 type yang:counter64; 1033 description 1034 "Testframe egress packets part of the recognized total 1035 but with unexpected sequence number."; 1036 } 1037 leaf testframe-egress-payload-errors { 1038 type yang:counter64; 1039 description 1040 "Testframe egress packets part of the recognized total 1041 but with payload errors."; 1042 } 1043 } 1044 } 1046 1048 7. IANA Considerations 1050 This document registers three URIs and three YANG modules. 1052 7.1. URI Registration 1054 This document registers three URIs in the IETF XML registry 1055 [RFC3688]. Following the format in RFC 3688, the following 1056 registration is requested to be made: 1058 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1059 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1060 URI: urn:ietf:params:xml:ns:yang:ietf-loopback 1062 Registrant Contact: The IESG. 1064 XML: N/A, the requested URI is an XML namespace. 1066 7.2. YANG Module Name Registration 1068 This document registers three YANG module in the YANG Module Names 1069 registry YANG [RFC6020]. 1071 name: ietf-traffic-generator 1072 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 1073 prefix: tg 1074 reference: RFC XXXX 1076 name: ietf-traffic-analyzer 1077 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 1078 prefix: ta 1079 reference: RFC XXXX 1081 8. Security Considerations 1083 This document does not introduce any new security concerns in 1084 addition to those specified in [RFC7950], section 15. 1086 9. References 1088 9.1. Normative References 1090 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 1091 the Network Configuration Protocol (NETCONF)", RFC 6020, 1092 DOI 10.17487/RFC6020, October 2010, 1093 . 1095 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 1096 RFC 7950, DOI 10.17487/RFC7950, August 2016, 1097 . 1099 9.2. Informative References 1101 [RFC2544] Bradner, S. and J. McQuaid, "Benchmarking Methodology for 1102 Network Interconnect Devices", RFC 2544, 1103 DOI 10.17487/RFC2544, March 1999, 1104 . 1106 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1107 DOI 10.17487/RFC3688, January 2004, 1108 . 1110 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 1111 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 1112 . 1114 Appendix A. Examples 1116 The following topology will be used for the examples in this section: 1118 +-------------+ +------------+ +------------+ 1119 | | e0 e0 | | e1 e0 | | 1120 | tester0 TG|>-------->| dut0 |>------->|TA tester1 | 1121 | | | | | | 1122 +-------------+ +------------+ +------------+ 1124 A.1. Basic Test Program 1126 This program based on transactional network test API shows how the 1127 modules can be used: 1129 #Connect to network 1130 net=tntapi.connect("topology.xml") 1132 # Configure DUTs and enable traffic-analyzers 1133 net.node("dut0").edit( \ 1134 "create /interfaces/interface[name='e0'] -- type=ethernetCsmacd") 1135 net.node("dut0").edit( 1136 "create /interfaces/interface[name='e1'] -- type=ethernetCsmacd") 1137 net.node("dut0").edit( 1138 "create /flows/flow[id='t0'] -- match/in-port=e0 " 1139 "actions/action[order='0']/output-action/out-port=e1") 1141 net.node("tester1").edit( 1142 "create /interfaces/interface[name='e0']/traffic-analyzer") 1143 net.commit() 1145 #Get network state - before 1146 before=net.get() 1148 # Start traffic 1149 net.node("tester0).edit( 1150 "create /interfaces/interface[name='e0']/traffic-generator -- " 1151 "frame-size=64 interframe-gap=20") 1153 net.commit() 1155 time.sleep(60) 1157 # Stop traffic 1158 net.node("tester1").edit("delete /interfaces/interface[name='e0']/" 1159 "traffic-generator") 1160 net.commit() 1162 #Get network state - after 1163 after=net.get() 1165 #Report 1166 sent_pkts=delta("tester0",before,after, 1167 "/interfaces/interface[name='e0']/statistics/out-unicast-pkts") 1169 received_pkts=delta("tester1",before,after, 1170 "/interfaces/interface[name='e0']/statistics/in-unicast-pkts") 1172 latency_max=absolute(after, 1173 "/interfaces/interface[name='e0']/traffic-analyzer/state/" 1174 "testframe-stats/latency/max") 1176 #Cleanup 1177 net.node("tester1").edit( 1178 "delete /interfaces/interface/traffic-analyzer") 1179 net.node("dut0").edit("delete /flows") 1180 net.node("dut0").edit("delete /interfaces") 1181 net.commit() 1183 A.2. Generating RFC2544 Testframes 1185 In sec. C.2.6.4 Test Frames a detailed format is specified. The 1186 frame-data leaf allows full control over the generated frames 1187 payload. 1189 ... 1190 net.node("tester1").edit( 1191 "merge /interfaces/interface[name='e0']/" 1192 "traffic-generator -- frame-data=" 1193 "6CA96F0000026CA96F00000108004500" 1194 "002ED4A500000A115816C0000201C000" 1195 "0202C0200007001A0000010203040506" 1196 "0708090A0B0C0D0E0F101112") 1197 ... 1199 Author's Address 1201 Vladimir Vassilev 1202 Lightside Instruments 1204 Email: vladimir@lightside-instruments.com