|
387 |
void |
387 |
void |
388 |
DcfManagerTest::DoRun (void) |
388 |
DcfManagerTest::DoRun (void) |
389 |
{ |
389 |
{ |
390 |
// 0 3 4 5 8 9 10 12 |
390 |
// SIFS + AIFSN = DIFS |
391 |
// | sifs | aifsn | tx | sifs | aifsn | | tx | |
391 |
|
|
|
392 |
// 0 3 4 5 6 10 11 12 |
393 |
// | sifs | aifsn | backoff | backoff | tx | sifs | aifsn | | tx | |
392 |
// |
394 |
// |
393 |
StartTest (1, 3, 10); |
395 |
StartTest (1, 3, 10); |
394 |
AddDcfState (1); |
396 |
AddDcfState (1); |
395 |
AddAccessRequest (1, 1, 4, 0); |
397 |
AddAccessRequest (1, 1, 6, 0); |
396 |
AddAccessRequest (10, 2, 10, 0); |
398 |
ExpectCollision (1, 2, 0); //backoff: 2 slots |
|
|
399 |
AddAccessRequest (12, 2, 12, 0); |
397 |
EndTest (); |
400 |
EndTest (); |
|
|
401 |
#if 0 |
398 |
// Check that receiving inside SIFS shall be cancelled properly: |
402 |
// Check that receiving inside SIFS shall be cancelled properly: |
399 |
// 0 3 4 5 8 9 12 13 14 |
403 |
// 0 3 4 5 8 9 12 13 14 |
400 |
// | sifs | aifsn | tx | sifs | ack | sifs | aifsn | |tx | |
404 |
// | sifs | aifsn | tx | sifs | ack | sifs | aifsn | |tx | |
|
407 |
AddTxEvt (8, 1); |
411 |
AddTxEvt (8, 1); |
408 |
AddAccessRequest (14, 2, 14, 0); |
412 |
AddAccessRequest (14, 2, 14, 0); |
409 |
EndTest (); |
413 |
EndTest (); |
|
|
414 |
#endif |
410 |
// The test below mainly intends to test the case where the medium |
415 |
// The test below mainly intends to test the case where the medium |
411 |
// becomes busy in the middle of a backoff slot: the backoff counter |
416 |
// becomes busy in the middle of a backoff slot: the backoff counter |
412 |
// must not be decremented for this backoff slot. This is the case |
417 |
// must not be decremented for this backoff slot. This is the case |
|
452 |
ExpectCollision (30, 0, 0); //backoff: 0 slots |
457 |
ExpectCollision (30, 0, 0); //backoff: 0 slots |
453 |
EndTest (); |
458 |
EndTest (); |
454 |
|
459 |
|
|
|
460 |
#if 0 |
455 |
// The test below is subject to some discussion because I am |
461 |
// The test below is subject to some discussion because I am |
456 |
// not sure I understand the intent of the spec here. |
462 |
// not sure I understand the intent of the spec here. |
457 |
// i.e., what happens if you make a request to get access |
463 |
// i.e., what happens if you make a request to get access |
|
470 |
AddRxOkEvt (20, 40); |
476 |
AddRxOkEvt (20, 40); |
471 |
AddAccessRequest (62, 2, 70, 0); |
477 |
AddAccessRequest (62, 2, 70, 0); |
472 |
EndTest (); |
478 |
EndTest (); |
|
|
479 |
#endif |
473 |
|
480 |
|
474 |
// Test an EIFS |
481 |
// Test an EIFS |
475 |
// |
482 |
// |
|
516 |
ExpectInternalCollision (78, 1, 1); //backoff: 1 slot |
523 |
ExpectInternalCollision (78, 1, 1); //backoff: 1 slot |
517 |
EndTest (); |
524 |
EndTest (); |
518 |
|
525 |
|
|
|
526 |
#if 0 |
519 |
// Test of AckTimeout handling: First queue requests access and ack procedure fails, |
527 |
// Test of AckTimeout handling: First queue requests access and ack procedure fails, |
520 |
// inside the ack timeout second queue with higher priority requests access. |
528 |
// inside the ack timeout second queue with higher priority requests access. |
521 |
// |
529 |
// |
|
529 |
AddAccessRequestWithAckTimeout (20, 20, 20, 0); |
537 |
AddAccessRequestWithAckTimeout (20, 20, 20, 0); |
530 |
AddAccessRequest (50, 10, 66, 1); |
538 |
AddAccessRequest (50, 10, 66, 1); |
531 |
EndTest (); |
539 |
EndTest (); |
532 |
|
540 |
#endif |
|
|
541 |
#if 0 |
533 |
// Test of AckTimeout handling: |
542 |
// Test of AckTimeout handling: |
534 |
// |
543 |
// |
535 |
// First queue requests access and ack is 2 us delayed (got ack interval at the picture), |
544 |
// First queue requests access and ack is 2 us delayed (got ack interval at the picture), |
|
568 |
ExpectCollision (39, 2, 0); //backoff: 2 slot |
577 |
ExpectCollision (39, 2, 0); //backoff: 2 slot |
569 |
EndTest (); |
578 |
EndTest (); |
570 |
|
579 |
|
|
|
580 |
#endif |
571 |
// test simple NAV count. This scenario modelizes a simple DATA+ACK handshake |
581 |
// test simple NAV count. This scenario modelizes a simple DATA+ACK handshake |
572 |
// where the data rate used for the ACK is higher than expected by the DATA source |
582 |
// where the data rate used for the ACK is higher than expected by the DATA source |
573 |
// so, the data exchange completes before the end of nav. |
583 |
// so, the data exchange completes before the end of nav. |
|
611 |
EndTest (); |
621 |
EndTest (); |
612 |
|
622 |
|
613 |
|
623 |
|
|
|
624 |
#if 0 |
614 |
// Channel switching tests |
625 |
// Channel switching tests |
615 |
|
626 |
|
616 |
// 0 20 23 24 25 |
627 |
// 0 20 23 24 25 |
|
622 |
AddSwitchingEvt (0,20); |
633 |
AddSwitchingEvt (0,20); |
623 |
AddAccessRequest (21, 1, 24, 0); |
634 |
AddAccessRequest (21, 1, 24, 0); |
624 |
EndTest (); |
635 |
EndTest (); |
|
|
636 |
#endif |
625 |
|
637 |
|
626 |
// 20 40 50 53 54 55 56 57 |
638 |
// 20 40 50 53 54 55 56 57 |
627 |
// | switching | busy | sifs | aifsn | bslot0 | bslot 1 | tx | |
639 |
// | switching | busy | sifs | aifsn | bslot0 | bslot 1 | tx | |
|
636 |
AddAccessRequest (45, 1, 56, 0); |
648 |
AddAccessRequest (45, 1, 56, 0); |
637 |
EndTest (); |
649 |
EndTest (); |
638 |
|
650 |
|
|
|
651 |
#if 0 |
639 |
// 20 30 50 53 54 55 |
652 |
// 20 30 50 53 54 55 |
640 |
// | rx | switching | sifs | aifsn | tx | |
653 |
// | rx | switching | sifs | aifsn | tx | |
641 |
// | |
654 |
// | |
|
647 |
AddSwitchingEvt (30,20); |
660 |
AddSwitchingEvt (30,20); |
648 |
AddAccessRequest (51, 1, 54, 0); |
661 |
AddAccessRequest (51, 1, 54, 0); |
649 |
EndTest (); |
662 |
EndTest (); |
|
|
663 |
#endif |
650 |
|
664 |
|
|
|
665 |
#if 0 |
651 |
// 20 30 50 53 54 55 |
666 |
// 20 30 50 53 54 55 |
652 |
// | busy | switching | sifs | aifsn | tx | |
667 |
// | busy | switching | sifs | aifsn | tx | |
653 |
// | |
668 |
// | |
|
659 |
AddSwitchingEvt (30,20); |
674 |
AddSwitchingEvt (30,20); |
660 |
AddAccessRequest (51, 1, 54, 0); |
675 |
AddAccessRequest (51, 1, 54, 0); |
661 |
EndTest (); |
676 |
EndTest (); |
|
|
677 |
#endif |
662 |
|
678 |
|
|
|
679 |
#if 0 |
663 |
// 20 30 50 53 54 55 |
680 |
// 20 30 50 53 54 55 |
664 |
// | nav | switching | sifs | aifsn | tx | |
681 |
// | nav | switching | sifs | aifsn | tx | |
665 |
// | |
682 |
// | |
|
671 |
AddSwitchingEvt (30,20); |
688 |
AddSwitchingEvt (30,20); |
672 |
AddAccessRequest (51, 1, 54, 0); |
689 |
AddAccessRequest (51, 1, 54, 0); |
673 |
EndTest (); |
690 |
EndTest (); |
|
|
691 |
#endif |
674 |
|
692 |
|
|
|
693 |
#if 0 |
675 |
// 20 40 50 55 58 59 60 |
694 |
// 20 40 50 55 58 59 60 |
676 |
// | tx | ack timeout | switching | sifs | aifsn | tx | |
695 |
// | tx | ack timeout | switching | sifs | aifsn | tx | |
677 |
// | | |
696 |
// | | |
|
684 |
AddSwitchingEvt (50,5); |
703 |
AddSwitchingEvt (50,5); |
685 |
AddAccessRequest (56, 1, 59, 0); |
704 |
AddAccessRequest (56, 1, 59, 0); |
686 |
EndTest (); |
705 |
EndTest (); |
|
|
706 |
#endif |
687 |
|
707 |
|
|
|
708 |
#if 0 |
688 |
// 20 60 66 70 74 78 80 100 106 110 112 |
709 |
// 20 60 66 70 74 78 80 100 106 110 112 |
689 |
// | rx | sifs | aifsn | bslot0 | bslot1 | | switching | sifs | aifsn | tx | |
710 |
// | rx | sifs | aifsn | bslot0 | bslot1 | | switching | sifs | aifsn | tx | |
690 |
// | | |
711 |
// | | |
|
698 |
AddSwitchingEvt (80,20); |
719 |
AddSwitchingEvt (80,20); |
699 |
AddAccessRequest (101, 2, 110, 0); |
720 |
AddAccessRequest (101, 2, 110, 0); |
700 |
EndTest (); |
721 |
EndTest (); |
|
|
722 |
#endif |
701 |
} |
723 |
} |
702 |
|
724 |
|
703 |
|
725 |
|