|
|
| 240 |
uint32_t test11; |
240 |
uint32_t test11; |
| 241 |
uint32_t test12; |
241 |
uint32_t test12; |
| 242 |
uint32_t test13; |
242 |
uint32_t test13; |
| 243 |
uint32_t test14; |
|
|
| 244 |
} drop; |
243 |
} drop; |
| 245 |
|
244 |
|
| 246 |
|
245 |
|
|
|
| 427 |
NS_TEST_EXPECT_MSG_NE (st.unforcedMark, 0, "There should be some unforced marks"); |
426 |
NS_TEST_EXPECT_MSG_NE (st.unforcedMark, 0, "There should be some unforced marks"); |
| 428 |
|
427 |
|
| 429 |
|
428 |
|
| 430 |
// test 11: Original RED with default parameter settings and fixed m_curMaxP |
429 |
// test 11: RED with default parameter settings, linear drop probability and fixed m_curMaxP |
| 431 |
queue = CreateObject<RedQueueDisc> (); |
430 |
queue = CreateObject<RedQueueDisc> (); |
| 432 |
minTh = 30 * modeSize; |
431 |
minTh = 30 * modeSize; |
| 433 |
maxTh = 90 * modeSize; |
432 |
maxTh = 90 * modeSize; |
|
|
| 477 |
NS_TEST_EXPECT_MSG_LT (drop.test12, drop.test11, "Test 12 should have less drops due to probability mark than test 11"); |
476 |
NS_TEST_EXPECT_MSG_LT (drop.test12, drop.test11, "Test 12 should have less drops due to probability mark than test 11"); |
| 478 |
|
477 |
|
| 479 |
|
478 |
|
| 480 |
// test 11: RED with Linear drop probability |
479 |
// test 13: RED with Nonlinear drop probability |
| 481 |
queue = CreateObject<RedQueueDisc> (); |
|
|
| 482 |
minTh = 30 * modeSize; |
| 483 |
maxTh = 90 * modeSize; |
| 484 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Mode", mode), true, |
| 485 |
"Verify that we can actually set the attribute Mode"); |
| 486 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MinTh", DoubleValue (minTh)), true, |
| 487 |
"Verify that we can actually set the attribute MinTh"); |
| 488 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MaxTh", DoubleValue (maxTh)), true, |
| 489 |
"Verify that we can actually set the attribute MaxTh"); |
| 490 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("QueueLimit", UintegerValue (qSize)), true, |
| 491 |
"Verify that we can actually set the attribute QueueLimit"); |
| 492 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("QW", DoubleValue (0.002)), true, |
| 493 |
"Verify that we can actually set the attribute QW"); |
| 494 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("LInterm", DoubleValue (2)), true, |
| 495 |
"Verify that we can actually set the attribute LInterm"); |
| 496 |
NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("Gentle", BooleanValue (true)), true, |
| 497 |
"Verify that we can actually set the attribute Gentle"); |
| 498 |
queue->Initialize (); |
| 499 |
Enqueue (queue, pktSize, 300, false); |
| 500 |
st = StaticCast<RedQueueDisc> (queue)->GetStats (); |
| 501 |
drop.test13 = st.unforcedDrop; |
| 502 |
NS_TEST_EXPECT_MSG_NE (drop.test13, 0, "There should some dropped packets due to probability mark"); |
| 503 |
|
| 504 |
|
| 505 |
// test 14: RED with Nonlinear drop probability |
| 506 |
queue = CreateObject<RedQueueDisc> (); |
480 |
queue = CreateObject<RedQueueDisc> (); |
| 507 |
minTh = 30 * modeSize; |
481 |
minTh = 30 * modeSize; |
| 508 |
maxTh = 90 * modeSize; |
482 |
maxTh = 90 * modeSize; |
|
|
| 525 |
queue->Initialize (); |
499 |
queue->Initialize (); |
| 526 |
Enqueue (queue, pktSize, 300, false); |
500 |
Enqueue (queue, pktSize, 300, false); |
| 527 |
st = StaticCast<RedQueueDisc> (queue)->GetStats (); |
501 |
st = StaticCast<RedQueueDisc> (queue)->GetStats (); |
| 528 |
drop.test14 = st.unforcedDrop; |
502 |
drop.test13 = st.unforcedDrop; |
| 529 |
NS_TEST_EXPECT_MSG_LT (drop.test14, drop.test13, "Test 14 should have less drops due to probability mark than test 13"); |
503 |
NS_TEST_EXPECT_MSG_LT (drop.test13, drop.test11, "Test 13 should have less drops due to probability mark than test 11"); |
| 530 |
|
504 |
|
| 531 |
} |
505 |
} |
| 532 |
|
506 |
|