idnits 2.17.1 draft-vassilev-bmwg-network-interconnect-tester-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** There are 17 instances of too long lines in the document, the longest one being 8 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 195 has weird spacing: '...-stream uin...' == Line 239 has weird spacing: '...-stream uin...' == Line 288 has weird spacing: '...rw type ide...' -- The document date (September 4, 2019) is 1696 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: 1 error (**), 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 Transpacket 4 Intended status: Standards Track September 4, 2019 5 Expires: March 7, 2020 7 A YANG Data Model for Network Interconnect Tester Management 8 draft-vassilev-bmwg-network-interconnect-tester-01 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 March 7, 2020. 33 Copyright Notice 35 Copyright (c) 2019 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 . . . . . . . . . . . . . . . . . . . . 3 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 . . . . . . . . . . . . . . . . 7 60 6. Traffic Analyzer Module YANG . . . . . . . . . . . . . . . . 14 61 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 62 7.1. URI Registration . . . . . . . . . . . . . . . . . . . . 20 63 7.2. YANG Module Name Registration . . . . . . . . . . . . . . 20 64 8. Security Considerations . . . . . . . . . . . . . . . . . . . 20 65 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 66 9.1. Normative References . . . . . . . . . . . . . . . . . . 20 67 9.2. Informative References . . . . . . . . . . . . . . . . . 21 68 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 21 69 A.1. Basic Test Program . . . . . . . . . . . . . . . . . . . 21 70 A.2. Generating RFC2544 Testframes . . . . . . . . . . . . . . 22 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 23 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 The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 84 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 85 "OPTIONAL" in this document are to be interpreted as described in BCP 86 14, [RFC2119]. 88 1.1.1. Definitions and Acronyms 90 DUT: Device Under Test 92 TA: Traffic Analyzer 94 TG: Traffic Generator 96 1.1.2. Tree Diagram 98 For a reference to the annotations used in tree diagrams included in 99 this draft, please see YANG Tree Diagrams [RFC8340]. 101 1.2. Problem Statement 103 Network interconnect tests require active network elements part of 104 the tested network that generate test traffic and network elements 105 that analyze the test traffic at one or more points of its path. A 106 network interconnect tester is a device that can either generate test 107 traffic, analyze test traffic or both. Here is a figure borrowed 108 from [RFC2544] representing the horseshoe test setup topology 109 consisting of a single tester and a single DUT connected in a network 110 interconnect loop. 112 +------------+ 113 | | 114 +------------| tester |<-------------+ 115 | | | | 116 | +------------+ | 117 | | 118 | +------------+ | 119 | | | | 120 +----------->| DUT |--------------+ 121 | | 122 +------------+ 124 This document attempts to address the problem of defining YANG model 125 of a network interconnect tester that can be used for development of 126 vendor independent network interconnect tests and utilize the 127 advantages of transactional management using standard protocols like 128 NETCONF. 130 1.3. Solution 132 The proposed model splits the design into 3 modules - 1) Traffic 133 Generator module (TG), 2) Traffic Analyzer module (TA). The modules 134 are implemented as augmentations of the ietf-interfaces module adding 135 configuration and state data that models the functionality of a 136 tester. The TA and TG modules concept is illustrated with the 137 following diagram of a tester with two interfaces (named e0 and e1) 138 conected in a loop with single DUT: 140 +----------------+ 141 e0.egress | | e1.ingress 142 +------------| TG tester TA |<-------------+ 143 | | | | 144 | +----------------+ | 145 | | 146 | +------------+ | 147 | | | | 148 +------------->| DUT |----------------+ 149 | | 150 +------------+ 152 2. Using the network interconnect tester model 154 Basic example of how the model can be used in transactional network 155 test API to control the testers part of a network and report countrer 156 statistics and timing measurement data is presented in Appendix A. 157 One of the examples demonstrates the use of the [RFC2544] defined 158 testframe packet. 160 3. Traffic Generator Module Tree Diagram 162 module: ietf-traffic-generator 163 augment /if:interfaces/if:interface: 164 +--rw traffic-generator {egress-direction}? 165 | +--rw (type)? 166 | | +--:(single-stream) 167 | | | +--rw frame-size uint32 168 | | | +--rw (frame-data-type)? 169 | | | | +--:(raw-frame-data) 170 | | | | +--rw frame-data? string 171 | | | +--rw interframe-gap uint32 172 | | | +--rw interburst-gap? uint32 173 | | | +--rw frames-per-burst? uint32 174 | | | +--rw src-mac-address? yang:mac-address {ethernet}? 175 | | | +--rw dst-mac-address? yang:mac-address {ethernet}? 176 | | | +--rw ether-type? uint16 {ethernet}? 177 | | | +--rw (encapsulation)? {ethernet}? 178 | | | +--:(vlan) 179 | | | +--rw vlan {ethernet-vlan}? 180 | | | +--rw id uint16 181 | | | +--rw tpid? uint16 182 | | | +--rw pcp? uint8 183 | | | +--rw cfi? uint8 184 | | +--:(multi-stream) 185 | | +--rw streams 186 | | +--rw stream* [id] 187 | | +--rw id uint32 188 | | +--rw frame-size uint32 189 | | +--rw (frame-data-type)? 190 | | | +--:(raw-frame-data) 191 | | | +--rw frame-data? string 192 | | +--rw interframe-gap uint32 193 | | +--rw interburst-gap? uint32 194 | | +--rw frames-per-burst? uint32 195 | | +--rw frames-per-stream uint32 196 | | +--rw interstream-gap uint32 197 | | +--rw src-mac-address? yang:mac-address {ethernet}? 198 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 199 | | +--rw ether-type? uint16 {ethernet}? 200 | | +--rw (encapsulation)? {ethernet}? 201 | | +--:(vlan) 202 | | +--rw vlan {ethernet-vlan}? 203 | | +--rw id uint16 204 | | +--rw tpid? uint16 205 | | +--rw pcp? uint8 206 | | +--rw cfi? uint8 207 | +--rw total-frames? uint64 208 +--rw traffic-generator-ingress {ingress-direction}? 209 +--rw (type)? 210 | +--:(single-stream) 211 | | +--rw frame-size uint32 212 | | +--rw (frame-data-type)? 213 | | | +--:(raw-frame-data) 214 | | | +--rw frame-data? string 215 | | +--rw interframe-gap uint32 216 | | +--rw interburst-gap? uint32 217 | | +--rw frames-per-burst? uint32 218 | | +--rw src-mac-address? yang:mac-address {ethernet}? 219 | | +--rw dst-mac-address? yang:mac-address {ethernet}? 220 | | +--rw ether-type? uint16 {ethernet}? 221 | | +--rw (encapsulation)? {ethernet}? 222 | | +--:(vlan) 223 | | +--rw vlan {ethernet-vlan}? 224 | | +--rw id uint16 225 | | +--rw tpid? uint16 226 | | +--rw pcp? uint8 227 | | +--rw cfi? uint8 228 | +--:(multi-stream) 229 | +--rw streams 230 | +--rw stream* [id] 231 | +--rw id uint32 232 | +--rw frame-size uint32 233 | +--rw (frame-data-type)? 234 | | +--:(raw-frame-data) 235 | | +--rw frame-data? string 236 | +--rw interframe-gap uint32 237 | +--rw interburst-gap? uint32 238 | +--rw frames-per-burst? uint32 239 | +--rw frames-per-stream uint32 240 | +--rw interstream-gap uint32 241 | +--rw src-mac-address? yang:mac-address {ethernet}? 242 | +--rw dst-mac-address? yang:mac-address {ethernet}? 243 | +--rw ether-type? uint16 {ethernet}? 244 | +--rw (encapsulation)? {ethernet}? 245 | +--:(vlan) 246 | +--rw vlan {ethernet-vlan}? 247 | +--rw id uint16 248 | +--rw tpid? uint16 249 | +--rw pcp? uint8 250 | +--rw cfi? uint8 251 +--rw total-frames? uint64 252 augment /if:interfaces-state/if:interface/if:statistics: 253 +--ro generated-pkts? yang:counter64 254 +--ro generated-octets? yang:counter64 255 +--ro generated-ingress-pkts? yang:counter64 {ingress-direction}? 256 +--ro generated-ingress-octets? yang:counter64 {ingress-direction}? 258 4. Traffic Analyzer Module Tree Diagram 260 module: ietf-traffic-analyzer 261 augment /if:interfaces/if:interface: 262 +--rw traffic-analyzer! {ingress-direction}? 263 | +--rw filter! {filter}? 264 | | +--rw type identityref 265 | | +--rw ether-type? uint16 266 | +--ro state 267 | +--ro pkts? yang:counter64 268 | +--ro errors? yang:counter64 269 | +--ro testframe-stats 270 | | +--ro testframe-pkts? yang:counter64 271 | | +--ro sequence-errors? yang:counter64 272 | | +--ro payload-errors? yang:counter64 273 | | +--ro latency 274 | | +--ro samples? uint64 275 | | +--ro min? uint64 276 | | +--ro max? uint64 277 | | +--ro average? uint64 278 | | +--ro latest? uint64 279 | +--ro capture {capture}? 280 | +--ro frame* [sequence-number] 281 | +--ro sequence-number uint64 282 | +--ro timestamp? yang:date-and-time 283 | +--ro length? uint32 284 | +--ro preceding-interframe-gap? uint32 285 | +--ro data? string 286 +--rw traffic-analyzer-egress! {egress-direction}? 287 +--rw filter! {filter}? 288 | +--rw type identityref 289 +--ro state 290 +--ro pkts? yang:counter64 291 +--ro errors? yang:counter64 292 +--ro testframe-stats 293 | +--ro testframe-pkts? yang:counter64 294 | +--ro sequence-errors? yang:counter64 295 | +--ro payload-errors? yang:counter64 296 | +--ro latency 297 | +--ro samples? uint64 298 | +--ro min? uint64 299 | +--ro max? uint64 300 | +--ro average? uint64 301 | +--ro latest? uint64 302 +--ro capture {capture}? 303 +--ro frame* [sequence-number] 304 +--ro sequence-number uint64 305 +--ro timestamp? yang:date-and-time 306 +--ro length? uint32 307 +--ro preceding-interframe-gap? uint32 308 +--ro data? string 309 augment /if:interfaces-state/if:interface/if:statistics: 310 +--ro testframe-pkts? yang:counter64 {ingress-direction}? 311 +--ro testframe-sequence-errors? yang:counter64 {ingress-direction}? 312 +--ro testframe-payload-errors? yang:counter64 {ingress-direction}? 313 augment /if:interfaces-state/if:interface/if:statistics: 314 +--ro testframe-egress-pkts? yang:counter64 {egress-direction}? 315 +--ro testframe-egress-sequence-errors? yang:counter64 {egress-direction}? 316 +--ro testframe-egress-payload-errors? yang:counter64 {egress-direction}? 318 5. Traffic Generator Module YANG 320 file "ietf-traffic-generator@2019-09-05.yang" 322 module ietf-traffic-generator { 323 yang-version 1.1; 324 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-generator"; 325 prefix tg; 327 import ietf-interfaces { 328 prefix if; 329 } 330 import ietf-yang-types { 331 prefix yang; 332 } 333 import iana-if-type { 334 prefix ianaift; 335 } 337 organization 338 "IETF Benchmarking Methodology Working Group"; 339 contact 340 "WG Web: 341 WG List: 343 Editor: Vladimir Vassilev 344 "; 345 description 346 "This module contains a collection of YANG definitions for 347 description and management of network interconnect testers. 349 Copyright (c) 2019 IETF Trust and the persons identified as 350 authors of the code. All rights reserved. 352 Redistribution and use in source and binary forms, with or 353 without modification, is permitted pursuant to, and subject 354 to the license terms contained in, the Simplified BSD License 355 set forth in Section 4.c of the IETF Trust's Legal Provisions 356 Relating to IETF Documents 357 (http://trustee.ietf.org/license-info). 359 This version of this YANG module is part of RFC XXXX; see 360 the RFC itself for full legal notices."; 362 revision 2019-09-05 { 363 description 364 "Initial revision."; 365 reference "RFC XXXX: Network Interconnect Tester"; 366 } 368 feature egress-direction { 369 description 370 "The device can generate traffic in the egress direction."; 371 } 373 feature ingress-direction { 374 description 375 "The device can generate traffic in the ingress direction."; 376 } 378 feature multi-stream { 379 description 380 "The device can generate multi-stream traffic."; 381 } 383 feature ethernet { 384 description 385 "The device can generate ethernet traffic."; 386 } 388 feature ethernet-vlan { 389 if-feature "ethernet"; 390 description 391 "The device can generate vlan tagged ethernet traffic."; 392 } 394 grouping traffic-generator-burst-data { 395 leaf frame-size { 396 type uint32; 397 description 398 "Size of the frames generated. For example for 399 ethernet interfaces the following definition 400 applies: 402 Ethernet frame-size in octets includes: 403 * Destination Address (6 octets), 404 * Source Address (6 octets), 405 * Frame Type (2 octets), 406 * Data (min 46 octets or 42 octets + 4 octets 802.1Q tag), 407 * CRC Checksum (4 octets). 409 Ethernet frame-size does not include: 410 * Preamble (dependent on MAC configuration 411 by default 7 octets), 412 * Start of frame delimeter (1 octet) 414 Minimum standard ethernet frame-size is 64 bytes but 415 generators might support smaller sizes for validation."; 416 mandatory true; 417 } 418 choice frame-data-type { 419 case raw-frame-data { 420 leaf frame-data { 421 type string { 422 pattern '([0-9A-F]{2})*'; 423 } 424 must 'string-length(.)<=(../frame-size*2)'; 425 description 426 "The raw frame data specified as hexadecimal string. 428 The specified data can be shorter then the ../frame-size 429 value specifying only the header or the header and the 430 payload without for example the 4 byte CRC Checksum 431 in the case of a Ethernet frame."; 432 } 433 } 434 } 435 leaf interframe-gap { 436 type uint32; 437 description 438 "Length of the idle period between generated frames. 439 For example for ethernet interfaces the following 440 definition applies: 442 Ethernet interframe-gap between transmission of frames 443 known as the interframe gap (IFG). A brief recovery time 444 between frames allows devices to prepare for 445 reception of the next frame. The minimum 446 interframe gap is 96 bit times (12 octet times) (the time it 447 takes to transmit 96 bits (12 octets) of raw data on the 448 medium). However the preamble (7 octets) and start of 449 frame delimeter (1 octet) are considered a constant gap that 450 should be included in the interframe-gap. Thus the minimum 451 value for standard ethernet transmission should be considered 452 20 octets."; 453 mandatory true; 454 } 455 leaf interburst-gap { 456 type uint32; 457 description 458 "Similar to the interframe-gap but takes place between 459 any two bursts of the stream."; 460 } 461 leaf frames-per-burst { 462 type uint32; 463 description 464 "Number of frames contained in a burst"; 465 } 466 } 468 grouping traffic-generator-multi-stream-data { 469 container streams { 470 list stream { 471 key "id"; 472 leaf id { 473 type uint32; 474 description 475 "Number specifying the order of the stream."; 477 } 478 uses traffic-generator-burst-data; 479 leaf frames-per-stream { 480 type uint32; 481 description 482 "The count of frames to be generated before 483 generation of the next stream is started."; 484 mandatory true; 485 } 486 leaf interstream-gap { 487 type uint32; 488 description 489 "Idle period after the last frame of the last burst."; 490 mandatory true; 491 } 492 } 493 } 494 } 496 augment "/if:interfaces/if:interface" { 497 container traffic-generator { 498 if-feature "egress-direction"; 499 choice type { 500 case single-stream { 501 uses traffic-generator-burst-data; 502 } 503 case multi-stream { 504 uses traffic-generator-multi-stream-data; 505 } 506 } 507 leaf total-frames { 508 type uint64; 509 description 510 "If this leaf is present the stream generation will stop 511 after the specified number of frames are generated."; 512 } 513 } 514 container traffic-generator-ingress { 515 if-feature "ingress-direction"; 516 choice type { 517 case single-stream { 518 uses traffic-generator-burst-data; 519 } 520 case multi-stream { 521 uses traffic-generator-multi-stream-data; 522 } 523 } 524 leaf total-frames { 525 type uint64; 526 description 527 "If this leaf is present the stream generation will stop 528 after the specified number of frames are generated."; 529 } 530 } 531 } 532 augment "/if:interfaces-state/if:interface/if:statistics" { 533 description 534 "Counters of generated traffic octets and packets."; 535 leaf generated-pkts { 536 type yang:counter64; 537 description 538 "Traffic generator packets sent."; 539 } 540 leaf generated-octets { 541 type yang:counter64; 542 description 543 "Traffic generator octets sent."; 544 } 545 leaf generated-ingress-pkts { 546 if-feature "ingress-direction"; 547 type yang:counter64; 548 description 549 "Traffic generator packets generated in ingress mode."; 550 } 551 leaf generated-ingress-octets { 552 if-feature "ingress-direction"; 553 type yang:counter64; 554 description 555 "Traffic generator octets generated in ingress mode."; 556 } 557 } 559 grouping ethernet-data { 560 leaf src-mac-address { 561 type yang:mac-address; 562 } 563 leaf dst-mac-address { 564 type yang:mac-address; 565 } 566 leaf ether-type { 567 type uint16; 568 description 569 "The Ethernet Type (or Length) value 570 defined by IEEE 802."; 571 reference "IEEE 802-2014 Clause 9.2"; 572 } 573 choice encapsulation { 574 case vlan { 575 container vlan { 576 if-feature "ethernet-vlan"; 577 leaf id { 578 type uint16 { 579 range "0..4095"; 580 } 581 mandatory true; 582 } 583 leaf tpid { 584 type uint16; 585 default "33024"; 586 description 587 "Configures the Tag Protocol Identifier (TPID) 588 of the 802.1q VLAN tag sent. This value is used 589 together whith the vlan id for filtering incoming 590 vlan tagged packets."; 591 } 592 leaf pcp { 593 type uint8 { 594 range "0..7"; 595 } 596 default "0"; 597 description 598 "Configures the IEEE 802.1p Priority Code Point (PCP) value 599 of the transmitted 802.1q VLAN tag."; 600 } 601 leaf cfi { 602 type uint8 { 603 range "0..1"; 604 } 605 default "0"; 606 description 607 "Configures the Canonical Format Identifier (CFI) field 608 (shall be 0 for Ethernet switches) of the transmitted 609 802.1q VLAN tag."; 610 } 611 } 612 } 613 } 614 } 616 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 617 + "tg:single-stream" { 618 if-feature "ethernet"; 619 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 620 description 621 "Ethernet interface type."; 622 } 623 uses ethernet-data; 624 } 625 augment "/if:interfaces/if:interface/tg:traffic-generator/tg:type/" 626 + "tg:multi-stream/tg:streams/tg:stream" { 627 if-feature "ethernet"; 628 when "derived-from-or-self(../../../if:type, 'ianaift:ethernetCsmacd')" { 629 description 630 "Ethernet interface type."; 631 } 632 uses ethernet-data; 633 } 634 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/tg:type/" 635 + "tg:single-stream" { 636 if-feature "ethernet"; 637 when "derived-from-or-self(../if:type, 'ianaift:ethernetCsmacd')" { 638 description 639 "Ethernet interface type."; 640 } 641 uses ethernet-data; 642 } 643 augment "/if:interfaces/if:interface/tg:traffic-generator-ingress/tg:type/" 644 + "tg:multi-stream/tg:streams/tg:stream" { 645 if-feature "ethernet"; 646 when "derived-from-or-self(../../../if:type, 'ianaift:ethernetCsmacd')" { 647 description 648 "Ethernet interface type."; 649 } 650 uses ethernet-data; 651 } 652 } 654 656 6. Traffic Analyzer Module YANG 658 file "ietf-traffic-analyzer@2019-09-05.yang" 660 module ietf-traffic-analyzer { 661 yang-version 1.1; 662 namespace "urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer"; 663 prefix ta; 665 import ietf-interfaces { 666 prefix if; 667 } 668 import ietf-yang-types { 669 prefix yang; 670 } 672 organization 673 "IETF Benchmarking Methodology Working Group"; 674 contact 675 "WG Web: 676 WG List: 678 Editor: Vladimir Vassilev 679 "; 680 description 681 "This module contains a collection of YANG definitions for 682 description and management of network interconnect testers. 684 Copyright (c) 2019 IETF Trust and the persons identified as 685 authors of the code. All rights reserved. 687 Redistribution and use in source and binary forms, with or 688 without modification, is permitted pursuant to, and subject 689 to the license terms contained in, the Simplified BSD License 690 set forth in Section 4.c of the IETF Trust's Legal Provisions 691 Relating to IETF Documents 692 (http://trustee.ietf.org/license-info). 694 This version of this YANG module is part of RFC XXXX; see 695 the RFC itself for full legal notices."; 697 revision 2019-09-05 { 698 description 699 "Initial revision."; 700 reference "RFC XXXX: Network Interconnect Tester"; 701 } 703 feature egress-direction { 704 description 705 "The device can analyze traffic from the egress direction."; 706 } 708 feature ingress-direction { 709 description 710 "The device can generate traffic from the ingress direction."; 711 } 713 feature filter { 714 description 715 "This feature indicates that the device implements 716 filter that can specify a subset of packets to be 717 analyzed when filtering is enabled."; 718 } 720 feature capture { 721 description 722 "This feature indicates that the device implements 723 packet capture functionality."; 724 } 726 identity filter { 727 description 728 "Base filter identity."; 729 } 731 identity ethernet { 732 base ta:filter; 733 } 735 grouping statistics-data { 736 leaf pkts { 737 type yang:counter64; 738 } 739 leaf errors { 740 type yang:counter64; 741 } 742 container testframe-stats { 743 leaf testframe-pkts { 744 type yang:counter64; 745 } 746 leaf sequence-errors { 747 type yang:counter64; 748 } 749 leaf payload-errors { 750 type yang:counter64; 751 } 752 container latency { 753 leaf samples { 754 type uint64; 755 } 756 leaf min { 757 units "nanoseconds"; 758 type uint64; 759 } 760 leaf max { 761 units "nanoseconds"; 762 type uint64; 763 } 764 leaf average { 765 description 766 "The sum of all sampled latencies divided 767 by the number of samples."; 768 units "nanoseconds"; 769 type uint64; 770 } 771 leaf latest { 772 units "nanoseconds"; 773 type uint64; 774 } 775 } 776 } 777 } 779 grouping capture-data { 780 container capture { 781 if-feature "capture"; 782 list frame { 783 key "sequence-number"; 784 leaf sequence-number { 785 type uint64; 786 } 787 leaf timestamp { 788 type yang:date-and-time; 789 } 790 leaf length { 791 type uint32; 792 } 793 leaf preceding-interframe-gap { 794 type uint32; 795 } 796 leaf data { 797 type string { 798 pattern '([0-9A-F]{2})*'; 799 } 800 } 801 } 802 } 803 } 805 grouping filter-data { 806 container filter { 807 presence 808 "When present ingress packets are 809 filtered before analyzed according 810 to the filter type"; 811 if-feature "filter"; 812 leaf type { 813 mandatory true; 814 type identityref { 815 base ta:filter; 816 } 817 } 818 } 819 } 821 augment "/if:interfaces/if:interface" { 822 container traffic-analyzer { 823 if-feature "ingress-direction"; 824 presence "Enables the traffic analyzer for ingress traffic."; 825 uses filter-data; 826 container state { 827 config false; 828 uses statistics-data; 829 uses capture-data; 830 } 831 } 832 container traffic-analyzer-egress { 833 if-feature "egress-direction"; 834 presence "Enables the traffic analyzer for egress traffic."; 835 uses filter-data; 836 container state { 837 config false; 838 uses statistics-data; 839 uses capture-data; 840 } 841 } 842 } 843 augment "/if:interfaces/if:interface/ta:traffic-analyzer/ta:filter" { 844 when "ta:type = 'ta:ethernet'"; 845 leaf ether-type { 846 type uint16; 847 description 848 "The Ethernet Type (or Length) value 849 defined by IEEE 802."; 850 reference "IEEE 802-2014 Clause 9.2"; 851 } 852 } 853 augment "/if:interfaces-state/if:interface/if:statistics" { 854 if-feature "ingress-direction"; 855 description 856 "Counters implemented by ports with analyzers."; 857 leaf testframe-pkts { 858 type yang:counter64; 859 description 860 "Testframe packets recognized by the traffic analyzer."; 862 } 863 leaf testframe-sequence-errors { 864 type yang:counter64; 865 description 866 "Testframe packets part of the recognized total 867 but with unexpected sequence number."; 868 } 869 leaf testframe-payload-errors { 870 type yang:counter64; 871 description 872 "Testframe packets part of the recognized total 873 but with payload errors."; 874 } 875 } 876 augment "/if:interfaces-state/if:interface/if:statistics" { 877 if-feature "egress-direction"; 878 description 879 "Counters implemented by ports with egress analyzers."; 880 leaf testframe-egress-pkts { 881 type yang:counter64; 882 description 883 "Testframe egress packets recognized by the traffic analyzer."; 884 } 885 leaf testframe-egress-sequence-errors { 886 type yang:counter64; 887 description 888 "Testframe egress packets part of the recognized total 889 but with unexpected sequence number."; 890 } 891 leaf testframe-egress-payload-errors { 892 type yang:counter64; 893 description 894 "Testframe egress packets part of the recognized total 895 but with payload errors."; 896 } 897 } 898 } 900 902 7. IANA Considerations 904 This document registers three URIs and three YANG modules. 906 7.1. URI Registration 908 This document registers three URIs in the IETF XML registry 909 [RFC3688]. Following the format in RFC 3688, the following 910 registration is requested to be made: 912 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 913 URI: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 914 URI: urn:ietf:params:xml:ns:yang:ietf-loopback 916 Registrant Contact: The IESG. 918 XML: N/A, the requested URI is an XML namespace. 920 7.2. YANG Module Name Registration 922 This document registers three YANG module in the YANG Module Names 923 registry YANG [RFC6020]. 925 name: ietf-traffic-generator 926 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-generator 927 prefix: tg 928 reference: RFC XXXX 930 name: ietf-traffic-analyzer 931 namespace: urn:ietf:params:xml:ns:yang:ietf-traffic-analyzer 932 prefix: ta 933 reference: RFC XXXX 935 8. Security Considerations 937 This document does not introduce any new security concerns in 938 addition to those specified in [RFC7950], section 15. 940 9. References 942 9.1. Normative References 944 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 945 Requirement Levels", BCP 14, RFC 2119, 946 DOI 10.17487/RFC2119, March 1997, 947 . 949 [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for 950 the Network Configuration Protocol (NETCONF)", RFC 6020, 951 DOI 10.17487/RFC6020, October 2010, 952 . 954 [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", 955 RFC 7950, DOI 10.17487/RFC7950, August 2016, 956 . 958 9.2. Informative References 960 [RFC2544] Bradner, S. and J. McQuaid, "Benchmarking Methodology for 961 Network Interconnect Devices", RFC 2544, 962 DOI 10.17487/RFC2544, March 1999, 963 . 965 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 966 DOI 10.17487/RFC3688, January 2004, 967 . 969 [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", 970 BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, 971 . 973 Appendix A. Examples 975 The following topology will be used for the examples in this section: 977 +-------------+ +------------+ +------------+ 978 | | e0 e0 | | e1 e0 | | 979 | tester0 TG|>-------->| dut0 |>------->|TA tester1 | 980 | | | | | | 981 +-------------+ +------------+ +------------+ 983 A.1. Basic Test Program 985 This program based on transactional network test API shows how the 986 modules can be used: 988 #Connect to network 989 net=tntapi.connect("topology.xml") 991 # Configure DUTs and enable traffic-analyzers 992 net.node("dut0").edit( \ 993 "create /interfaces/interface[name='e0'] -- type=ethernetCsmacd") 994 net.node("dut0").edit( 995 "create /interfaces/interface[name='e1'] -- type=ethernetCsmacd") 996 net.node("dut0").edit( 997 "create /flows/flow[id='t0'] -- match/in-port=e0 " 998 "actions/action[order='0']/output-action/out-port=e0") 1000 net.node("tester1").edit( 1001 "create /interfaces/interface[name='e0']/traffic-analyzer") 1002 net.commit() 1004 #Get network state - before 1005 before=net.get() 1007 # Start traffic 1008 net.node("tester0).edit( 1009 "create /interfaces/interface[name='e0']/traffic-generator -- " 1010 "frame-size=64 interframe-gap=20") 1012 net.commit() 1014 time.sleep(60) 1016 # Stop traffic 1017 net.node("tester1").edit("delete /interfaces/interface[name='e0']/" 1018 "traffic-generator") 1019 net.commit() 1021 #Get network state - after 1022 after=net.get() 1024 #Report 1025 sent_pkts=delta("tester0",before,after, 1026 "/interfaces/interface[name='e0']/statistics/out-unicast-pkts") 1028 received_pkts=delta("tester1",before,after, 1029 "/interfaces/interface[name='e0']/statistics/in-unicast-pkts") 1031 latency_max=absolute(after, 1032 "/interfaces/interface[name='e0']/traffic-analyzer/state/" 1033 "testframe-stats/latency/max") 1035 #Cleanup 1036 net.node("tester1").edit( 1037 "delete /interfaces/interface/traffic-analyzer") 1038 net.node("dut0").edit("delete /flows") 1039 net.node("dut0").edit("delete /interfaces") 1040 net.commit() 1042 A.2. Generating RFC2544 Testframes 1044 In sec. C.2.6.4 Test Frames a detailed format is specified. The 1045 frame-data leaf allows full control over the generated frames 1046 payload. 1048 ... 1049 net.node("tester1").edit( 1050 "merge /interfaces/interface[name='e0']/" 1051 "traffic-generator -- frame-data=" 1052 "6CA96F0000026CA96F00000108004500" 1053 "002ED4A500000A115816C0000201C000" 1054 "0202C0200007001A0000010203040506" 1055 "0708090A0B0C0D0E0F101112") 1056 ... 1058 Author's Address 1060 Vladimir Vassilev 1061 Transpacket 1063 Email: vladimir@transpacket.com