|
29 | 29 |
|
30 | 30 |
|
31 | 31 | """ |
32 | | -This module contains unit tests for the Packet Handler ICMPv6 TX operations. |
| 32 | +This module contains integration tests for the Packet Handler ICMPv6 TX operations. |
33 | 33 |
|
34 | | -pytcp/tests/unit/test__packet_handler__icmp6__tx.py |
| 34 | +pytcp/tests/integration/test__packet_handler__icmp6__tx.py |
35 | 35 |
|
36 | 36 | ver 3.0.4 |
37 | 37 | """ |
|
111 | 111 | ), |
112 | 112 | }, |
113 | 113 | "_expected__frames_tx": [ |
| 114 | + # Ethernet II |
| 115 | + # Destination MAC : 02:00:00:00:00:91 |
| 116 | + # Source MAC : 02:00:00:00:00:07 |
| 117 | + # Ethertype : 0x86DD (IPv6) |
| 118 | + # Frame length : 344 bytes |
| 119 | + # |
| 120 | + # IPv6 |
| 121 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 122 | + # Payload Length : 0x0148 (328 bytes) |
| 123 | + # Next Header : 58 (ICMPv6) |
| 124 | + # Hop Limit : 64 |
| 125 | + # Source IP : 2001:db8:0:1::7 |
| 126 | + # Destination IP : 2001:db8:0:1::91 |
| 127 | + # |
| 128 | + # ICMPv6 |
| 129 | + # Type/Code : 128 / 0 (Echo Request) |
| 130 | + # Checksum : 0xf53e |
| 131 | + # Identifier : 12345 |
| 132 | + # Sequence : 54320 |
| 133 | + # Payload : 320 bytes ("0123456789ABCDEF" * 20) |
| 134 | + # |
| 135 | + # Summary: ICMPv6 echo request with large payload headed to host A. |
114 | 136 | b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
115 | 137 | b"\x00\x00\x01\x48\x3a\x40\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
116 | 138 | b"\x00\x00\x00\x00\x00\x07\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
|
161 | 183 | ), |
162 | 184 | }, |
163 | 185 | "_expected__frames_tx": [ |
| 186 | + # Ethernet II |
| 187 | + # Destination MAC : 02:00:00:00:00:91 |
| 188 | + # Source MAC : 02:00:00:00:00:07 |
| 189 | + # Ethertype : 0x86DD (IPv6) |
| 190 | + # Frame length : 344 bytes |
| 191 | + # |
| 192 | + # IPv6 |
| 193 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 194 | + # Payload Length : 0x0148 (328 bytes) |
| 195 | + # Next Header : 58 (ICMPv6) |
| 196 | + # Hop Limit : 64 |
| 197 | + # Source IP : 2001:db8:0:1::7 |
| 198 | + # Destination IP : 2001:db8:0:1::91 |
| 199 | + # |
| 200 | + # ICMPv6 |
| 201 | + # Type/Code : 129 / 0 (Echo Reply) |
| 202 | + # Checksum : 0xf43e |
| 203 | + # Identifier : 12345 |
| 204 | + # Sequence : 54320 |
| 205 | + # Payload : 320 bytes mirrored from the request |
| 206 | + # |
| 207 | + # Summary: ICMPv6 echo reply returning the same payload to host A. |
164 | 208 | b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
165 | 209 | b"\x00\x00\x01\x48\x3a\x40\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
166 | 210 | b"\x00\x00\x00\x00\x00\x07\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
|
210 | 254 | ), |
211 | 255 | }, |
212 | 256 | "_expected__frames_tx": [ |
| 257 | + # Ethernet II |
| 258 | + # Destination MAC : 02:00:00:00:00:91 |
| 259 | + # Source MAC : 02:00:00:00:00:07 |
| 260 | + # Ethertype : 0x86DD (IPv6) |
| 261 | + # Frame length : 1266 bytes |
| 262 | + # |
| 263 | + # IPv6 |
| 264 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 265 | + # Payload Length : 0x04d8 (1240 bytes) |
| 266 | + # Next Header : 58 (ICMPv6) |
| 267 | + # Hop Limit : 64 |
| 268 | + # Source IP : 2001:db8:0:1::7 |
| 269 | + # Destination IP : 2001:db8:0:1::91 |
| 270 | + # |
| 271 | + # ICMPv6 |
| 272 | + # Type/Code : 1 / 4 (Destination Unreachable - Port) |
| 273 | + # Checksum : 0x6741 |
| 274 | + # Payload : 1232 bytes (original datagram excerpt) |
| 275 | + # |
| 276 | + # Summary: ICMPv6 destination unreachable (port) with a large quoted packet body. |
213 | 277 | b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
214 | 278 | b"\x00\x00\x04\xd8\x3a\x40\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
215 | 279 | b"\x00\x00\x00\x00\x00\x07\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
|
318 | 382 | ), |
319 | 383 | }, |
320 | 384 | "_expected__frames_tx": [ |
| 385 | + # Ethernet II |
| 386 | + # Destination MAC : 33:33:00:00:00:02 (all-routers multicast) |
| 387 | + # Source MAC : 02:00:00:00:00:07 |
| 388 | + # Ethertype : 0x86DD (IPv6) |
| 389 | + # Frame length : 118 bytes |
| 390 | + # |
| 391 | + # IPv6 |
| 392 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 393 | + # Payload Length : 0x0010 (16 bytes) |
| 394 | + # Next Header : 58 (ICMPv6) |
| 395 | + # Hop Limit : 255 |
| 396 | + # Source IP : 2001:db8:0:1::7 |
| 397 | + # Destination IP : ff02::2 (all routers) |
| 398 | + # |
| 399 | + # ICMPv6 Router Solicitation |
| 400 | + # Options : Source Link-Layer (02:00:00:00:00:07) |
| 401 | + # Checksum : 0x4ae7 |
| 402 | + # |
| 403 | + # Summary: Router solicitation advertising our MAC to local routers. |
321 | 404 | b"\x33\x33\x00\x00\x00\x02\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
322 | 405 | b"\x00\x00\x00\x10\x3a\xff\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
323 | 406 | b"\x00\x00\x00\x00\x00\x07\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00" |
|
364 | 447 | ), |
365 | 448 | }, |
366 | 449 | "_expected__frames_tx": [ |
| 450 | + # Ethernet II |
| 451 | + # Destination MAC : 33:33:00:00:00:01 (all-nodes multicast) |
| 452 | + # Source MAC : 02:00:00:00:00:07 |
| 453 | + # Ethertype : 0x86DD (IPv6) |
| 454 | + # Frame length : 170 bytes |
| 455 | + # |
| 456 | + # IPv6 |
| 457 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 458 | + # Payload Length : 0x0038 (56 bytes) |
| 459 | + # Next Header : 58 (ICMPv6) |
| 460 | + # Hop Limit : 255 |
| 461 | + # Source IP : 2001:db8:0:1::7 |
| 462 | + # Destination IP : ff02::1 (all nodes) |
| 463 | + # |
| 464 | + # ICMPv6 Router Advertisement |
| 465 | + # Checksum : 0x61b9 |
| 466 | + # Hop Limit : 64 |
| 467 | + # Flags : M=1, O=1 |
| 468 | + # Router Lifetime : 1800 s |
| 469 | + # Reachable Time : 900 ms |
| 470 | + # Retrans Timer : 300 ms |
| 471 | + # Options : SLLA + Prefix Information (2001:db8:0:1::/64) |
| 472 | + # |
| 473 | + # Summary: Router advertisement broadcasting stack parameters to local hosts. |
367 | 474 | b"\x33\x33\x00\x00\x00\x01\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
368 | 475 | b"\x00\x00\x00\x38\x3a\xff\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
369 | 476 | b"\x00\x00\x00\x00\x00\x07\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00" |
|
402 | 509 | ), |
403 | 510 | }, |
404 | 511 | "_expected__frames_tx": [ |
| 512 | + # Ethernet II |
| 513 | + # Destination MAC : 02:00:00:00:00:91 |
| 514 | + # Source MAC : 02:00:00:00:00:07 |
| 515 | + # Ethertype : 0x86DD (IPv6) |
| 516 | + # Frame length : 118 bytes |
| 517 | + # |
| 518 | + # IPv6 |
| 519 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 520 | + # Payload Length : 0x0020 (32 bytes) |
| 521 | + # Next Header : 58 (ICMPv6) |
| 522 | + # Hop Limit : 255 |
| 523 | + # Source IP : 2001:db8:0:1::7 |
| 524 | + # Destination IP : 2001:db8:0:1::91 |
| 525 | + # |
| 526 | + # ICMPv6 Neighbor Advertisement |
| 527 | + # Flags : 0x60000000 (Solicited + Override) |
| 528 | + # Target : 2001:db8:0:1::7 |
| 529 | + # Options : TLLA (02:00:00:00:00:07) |
| 530 | + # |
| 531 | + # Summary: Neighbor advertisement conveying our MAC and target address to host A. |
405 | 532 | b"\x02\x00\x00\x00\x00\x91\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
406 | 533 | b"\x00\x00\x00\x20\x3a\xff\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
407 | 534 | b"\x00\x00\x00\x00\x00\x07\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
|
436 | 563 | ), |
437 | 564 | }, |
438 | 565 | "_expected__frames_tx": [ |
| 566 | + # Ethernet II |
| 567 | + # Destination MAC : 33:33:00:00:00:91 (solicited-node multicast for host A) |
| 568 | + # Source MAC : 02:00:00:00:00:07 |
| 569 | + # Ethertype : 0x86DD (IPv6) |
| 570 | + # Frame length : 118 bytes |
| 571 | + # |
| 572 | + # IPv6 |
| 573 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 574 | + # Payload Length : 0x0020 (32 bytes) |
| 575 | + # Next Header : 58 (ICMPv6) |
| 576 | + # Hop Limit : 255 |
| 577 | + # Source IP : 2001:db8:0:1::7 |
| 578 | + # Destination IP : ff02::1:ff00:91 |
| 579 | + # |
| 580 | + # ICMPv6 Neighbor Solicitation |
| 581 | + # Flags : 0x00000000 |
| 582 | + # Target : 2001:db8:0:1::91 |
| 583 | + # Options : SLLA (02:00:00:00:00:07) |
| 584 | + # |
| 585 | + # Summary: Neighbor solicitation probing host A for its MAC address. |
439 | 586 | b"\x33\x33\xff\x00\x00\x91\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
440 | 587 | b"\x00\x00\x00\x20\x3a\xff\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
441 | 588 | b"\x00\x00\x00\x00\x00\x07\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00" |
|
468 | 615 | ), |
469 | 616 | }, |
470 | 617 | "_expected__frames_tx": [ |
| 618 | + # Ethernet II |
| 619 | + # Destination MAC : 33:33:ff:00:00:07 (solicited-node multicast) |
| 620 | + # Source MAC : 02:00:00:00:00:07 |
| 621 | + # Ethertype : 0x86DD (IPv6) |
| 622 | + # Frame length : 94 bytes |
| 623 | + # |
| 624 | + # IPv6 |
| 625 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 626 | + # Payload Length : 0x0018 (24 bytes) |
| 627 | + # Next Header : 58 (ICMPv6) |
| 628 | + # Hop Limit : 255 |
| 629 | + # Source IP : :: |
| 630 | + # Destination IP : ff02::1:ff00:7 |
| 631 | + # |
| 632 | + # ICMPv6 Neighbor Solicitation (DAD) |
| 633 | + # Flags : 0x00000000 |
| 634 | + # Target : 2001:db8:0:1::7 |
| 635 | + # Options : none |
| 636 | + # |
| 637 | + # Summary: DAD neighbor solicitation emitted with unspecified source. |
471 | 638 | b"\x33\x33\xff\x00\x00\x07\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
472 | 639 | b"\x00\x00\x00\x18\x3a\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" |
473 | 640 | b"\x00\x00\x00\x00\x00\x00\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00" |
|
524 | 691 | ), |
525 | 692 | }, |
526 | 693 | "_expected__frames_tx": [ |
| 694 | + # Ethernet II |
| 695 | + # Destination MAC : 33:33:00:00:00:16 (MLDv2 routers multicast) |
| 696 | + # Source MAC : 02:00:00:00:00:07 |
| 697 | + # Ethertype : 0x86DD (IPv6) |
| 698 | + # Frame length : 150 bytes |
| 699 | + # |
| 700 | + # IPv6 |
| 701 | + # Version / Traffic Class / Flow Label : 0x60000000 |
| 702 | + # Payload Length : 0x0080 (128 bytes) |
| 703 | + # Next Header : 58 (ICMPv6) |
| 704 | + # Hop Limit : 1 |
| 705 | + # Source IP : 2001:db8:0:1::7 |
| 706 | + # Destination IP : ff02::16 (MLDv2 routers) |
| 707 | + # |
| 708 | + # ICMPv6 MLDv2 Report |
| 709 | + # Record Count : 6 |
| 710 | + # Records : {CHANGE_TO_EXCLUDE ff02::a, CHANGE_TO_INCLUDE ff02::b, |
| 711 | + # MODE_IS_EXCLUDE ff02::c, MODE_IS_INCLUDE ff02::d, |
| 712 | + # ALLOW_NEW_SOURCES ff02::e, ALLOW_NEW_SOURCES ff02::f} |
| 713 | + # Checksum : 0x3508 |
| 714 | + # |
| 715 | + # Summary: MLDv2 report advertising multicast memberships to routers. |
527 | 716 | b"\x33\x33\x00\x00\x00\x16\x02\x00\x00\x00\x00\x07\x86\xdd\x60\x00" |
528 | 717 | b"\x00\x00\x00\x80\x3a\x01\x20\x01\x0d\xb8\x00\x00\x00\x01\x00\x00" |
529 | 718 | b"\x00\x00\x00\x00\x00\x07\xff\x02\x00\x00\x00\x00\x00\x00\x00\x00" |
|
0 commit comments