TCPMsgBasedRcvQueue_2.test 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. %description:
  2. Test TCPMsgBasedSendQueue, TCPMsgBasedRcvQueue classes
  3. Similar to TCPMsgBasedRcvQueue_1.test, but sequence number is turn out zero.
  4. %includes:
  5. #include "TCPQueueTesterFunctions.h"
  6. %global:
  7. using namespace ::inet::tcp;
  8. %activity:
  9. TCPMsgBasedSendQueue sendQueue;
  10. TCPMsgBasedSendQueue *sq = &sendQueue;
  11. sq->init(4294967000);
  12. EV << sq->info() <<"\n";
  13. TCPMsgBasedRcvQueue rcvQueue;
  14. TCPMsgBasedRcvQueue *rq = &rcvQueue;
  15. rq->init(4294967000);
  16. EV << rq->info() <<"\n";
  17. enqueue(sq, "msg1", 100); // 4294967000..4294967100
  18. enqueue(sq, "msg2", 100); // 4294967100..4294967200
  19. enqueue(sq, "msg3", 296); // 4294967200..200
  20. enqueue(sq, "msg4", 600); // 200..800
  21. enqueue(sq, "msg5", 200); // 800..1000
  22. insertSegment(rq, createSegmentWithBytes(sq, 4294967000, 4294967099));
  23. insertSegment(rq, createSegmentWithBytes(sq, 4294967090, 4294967100));
  24. insertSegment(rq, createSegmentWithBytes(sq, 4294967090, 799));
  25. insertSegment(rq, createSegmentWithBytes(sq, 4294967090, 800));
  26. insertSegment(rq, createSegmentWithBytes(sq, 700, 799));
  27. insertSegment(rq, createSegmentWithBytes(sq, 700, 800));
  28. extractBytesUpTo(rq, 4294967099);
  29. discardUpTo(sq, 4294967099);
  30. extractBytesUpTo(rq, 799);
  31. extractBytesUpTo(rq, 799);
  32. discardUpTo(sq, 799);
  33. extractBytesUpTo(rq, 800);
  34. extractBytesUpTo(rq, 800);
  35. discardUpTo(sq, 800);
  36. insertSegment(rq, createSegmentWithBytes(sq, 800, 900));
  37. extractBytesUpTo(rq, 900);
  38. insertSegment(rq, createSegmentWithBytes(sq, 900, 1000));
  39. extractBytesUpTo(rq, 1000);
  40. discardUpTo(sq, 1000);
  41. EV << ".\n";
  42. %subst: /[\{\}]/ /
  43. %contains: stdout
  44. [4294967000..4294967000), 0 packets
  45. rcv_nxt=4294967000 0 msgs
  46. SQ:enqueue("msg1", 100): --> [4294967000..4294967100), 1 packets
  47. SQ:enqueue("msg2", 100): --> [4294967000..4294967200), 2 packets
  48. SQ:enqueue("msg3", 296): --> [4294967000..200), 3 packets
  49. SQ:enqueue("msg4", 600): --> [4294967000..800), 4 packets
  50. SQ:enqueue("msg5", 200): --> [4294967000..1000), 5 packets
  51. SQ:createSegmentWithBytes(4294967000, 4294967099):
  52. RQ:insertSeg [4294967000..4294967099) --> rcv_nxt=4294967099 [4294967000..4294967099) 0 msgs
  53. SQ:createSegmentWithBytes(4294967090, 4294967100): msg1[4294967000..4294967100)
  54. RQ:insertSeg [4294967090..4294967100) --> rcv_nxt=4294967100 [4294967000..4294967100) 1 msgs
  55. SQ:createSegmentWithBytes(4294967090, 799): msg1[4294967000..4294967100), msg2[4294967100..4294967200), msg3[4294967200..200)
  56. RQ:insertSeg [4294967090..799) --> rcv_nxt=799 [4294967000..799) 3 msgs
  57. SQ:createSegmentWithBytes(4294967090, 800): msg1[4294967000..4294967100), msg2[4294967100..4294967200), msg3[4294967200..200), msg4[200..800)
  58. RQ:insertSeg [4294967090..800) --> rcv_nxt=800 [4294967000..800) 4 msgs
  59. SQ:createSegmentWithBytes(700, 799):
  60. RQ:insertSeg [700..799) --> rcv_nxt=800 [4294967000..800) 4 msgs
  61. SQ:createSegmentWithBytes(700, 800): msg4[200..800)
  62. RQ:insertSeg [700..800) --> rcv_nxt=800 [4294967000..800) 4 msgs
  63. RQ:extractUpTo(4294967099): < > --> rcv_nxt=800 [4294967099..800) 4 msgs
  64. SQ:discardUpTo(4294967099): [4294967099..1000), 5 packets
  65. RQ:extractUpTo(799): < < msg1: 100 bytes > < msg2: 100 bytes > < msg3: 296 bytes > > --> rcv_nxt=800 [799..800) 1 msgs
  66. RQ:extractUpTo(799): < > --> rcv_nxt=800 [799..800) 1 msgs
  67. SQ:discardUpTo(799): [799..1000), 2 packets
  68. RQ:extractUpTo(800): < < msg4: 600 bytes > > --> rcv_nxt=800 0 msgs
  69. RQ:extractUpTo(800): < > --> rcv_nxt=800 0 msgs
  70. SQ:discardUpTo(800): [800..1000), 1 packets
  71. SQ:createSegmentWithBytes(800, 900):
  72. RQ:insertSeg [800..900) --> rcv_nxt=900 [800..900) 0 msgs
  73. RQ:extractUpTo(900): < > --> rcv_nxt=900 0 msgs
  74. SQ:createSegmentWithBytes(900, 1000): msg5[800..1000)
  75. RQ:insertSeg [900..1000) --> rcv_nxt=1000 [900..1000) 1 msgs
  76. RQ:extractUpTo(1000): < < msg5: 200 bytes > > --> rcv_nxt=1000 0 msgs
  77. SQ:discardUpTo(1000): [1000..1000), 0 packets
  78. .