20#include "ns3/ap-wifi-mac.h"
21#include "ns3/attribute-container.h"
22#include "ns3/boolean.h"
23#include "ns3/config.h"
24#include "ns3/ctrl-headers.h"
25#include "ns3/double.h"
26#include "ns3/mac-rx-middle.h"
27#include "ns3/mobility-helper.h"
28#include "ns3/originator-block-ack-agreement.h"
29#include "ns3/packet-socket-client.h"
30#include "ns3/packet-socket-helper.h"
31#include "ns3/packet-socket-server.h"
32#include "ns3/packet.h"
33#include "ns3/pointer.h"
34#include "ns3/qos-txop.h"
35#include "ns3/qos-utils.h"
36#include "ns3/recipient-block-ack-agreement.h"
37#include "ns3/string.h"
39#include "ns3/wifi-mac-header.h"
40#include "ns3/wifi-mpdu.h"
41#include "ns3/wifi-net-device.h"
42#include "ns3/yans-wifi-helper.h"
92 void DoRun()
override;
97 :
TestCase(
"Check correct order of buffering when startSequence < endSeq")
113 std::list<uint16_t> m_buffer;
114 std::list<uint16_t>::iterator i;
115 std::list<uint16_t>::iterator j;
116 m_buffer.push_back(0);
117 m_buffer.push_back(16);
118 m_buffer.push_back(56000);
120 uint16_t endSeq = 4000;
122 uint16_t receivedSeq = 4001 * 16;
125 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
133 m_buffer.insert(i, receivedSeq);
135 receivedSeq = 3999 * 16;
138 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
146 m_buffer.insert(i, receivedSeq);
148 for (i = m_buffer.begin(), j =
m_expectedBuffer.begin(); i != m_buffer.end(); i++, j++)
190 void DoRun()
override;
195 :
TestCase(
"Check correct order of buffering when startSequence > endSeq")
212 std::list<uint16_t> m_buffer;
213 std::list<uint16_t>::iterator i;
214 std::list<uint16_t>::iterator j;
215 m_buffer.push_back(256);
216 m_buffer.push_back(64000);
217 m_buffer.push_back(16);
219 uint16_t endSeq = 10;
221 uint16_t receivedSeq = 15 * 16;
224 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
232 m_buffer.insert(i, receivedSeq);
234 receivedSeq = 15 * 16 + 1;
237 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
245 m_buffer.insert(i, receivedSeq);
247 receivedSeq = 4050 * 16;
250 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
258 m_buffer.insert(i, receivedSeq);
260 for (i = m_buffer.begin(), j =
m_expectedBuffer.begin(); i != m_buffer.end(); i++, j++)
278 void DoRun()
override;
282 :
TestCase(
"Check the correctness of the originator block ack window")
289 uint16_t winSize = 16;
290 uint16_t startingSeq = 4090;
300 for (uint16_t i = 0; i < winSize; i++)
304 "Not all flags are cleared after initialization");
310 Ptr<WifiMpdu> mpdu = Create<WifiMpdu>(Create<Packet>(), hdr);
311 uint16_t seqNumber = startingSeq;
312 mpdu->GetHeader().SetSequenceNumber(seqNumber);
337 "Incorrect starting sequence after 5 acknowledgments");
338 for (uint16_t i = 0; i < winSize; i++)
342 "Not all flags are cleared after 5 acknowledgments");
369 "Incorrect starting sequence after 1 unacknowledged MPDU");
372 "Incorrect flag after 1 unacknowledged MPDU");
375 "Incorrect flag after 1 unacknowledged MPDU");
378 "Incorrect flag after 1 unacknowledged MPDU");
381 "Incorrect flag after 1 unacknowledged MPDU");
384 "Incorrect flag after 1 unacknowledged MPDU");
385 for (uint16_t i = 5; i < winSize; i++)
389 "Incorrect flag after 1 unacknowledged MPDU");
394 mpdu->GetHeader().SetSequenceNumber(startingSeq);
407 "Incorrect starting sequence after acknowledgment of missing MPDU");
408 for (uint16_t i = 0; i < winSize; i++)
412 "Not all flags are cleared after acknowledgment of missing MPDU");
418 mpdu->GetHeader().SetSequenceNumber(seqNumber);
431 mpdu->GetHeader().SetSequenceNumber(seqNumber);
449 "Incorrect starting sequence after 3 unacknowledged MPDUs");
452 "Incorrect flag after 3 unacknowledged MPDUs");
455 "Incorrect flag after 3 unacknowledged MPDUs");
458 "Incorrect flag after 3 unacknowledged MPDUs");
461 "Incorrect flag after 3 unacknowledged MPDUs");
464 "Incorrect flag after 3 unacknowledged MPDUs");
467 "Incorrect flag after 3 unacknowledged MPDUs");
470 "Incorrect flag after 3 unacknowledged MPDUs");
473 "Incorrect flag after 3 unacknowledged MPDUs");
476 "Incorrect flag after 3 unacknowledged MPDUs");
479 "Incorrect flag after 3 unacknowledged MPDUs");
482 "Incorrect flag after 3 unacknowledged MPDUs");
485 "Incorrect flag after 3 unacknowledged MPDUs");
486 for (uint16_t i = 12; i < winSize; i++)
490 "Incorrect flag after 3 unacknowledged MPDUs");
496 mpdu->GetHeader().SetSequenceNumber(seqNumber);
510 "Incorrect starting sequence after transmitting an MPDU beyond the current window");
513 "Incorrect flag after transmitting an MPDU beyond the current window");
516 "Incorrect flag after transmitting an MPDU beyond the current window");
519 "Incorrect flag after transmitting an MPDU beyond the current window");
522 "Incorrect flag after transmitting an MPDU beyond the current window");
525 "Incorrect flag after transmitting an MPDU beyond the current window");
528 "Incorrect flag after transmitting an MPDU beyond the current window");
531 "Incorrect flag after transmitting an MPDU beyond the current window");
534 "Incorrect flag after transmitting an MPDU beyond the current window");
537 "Incorrect flag after transmitting an MPDU beyond the current window");
540 "Incorrect flag after transmitting an MPDU beyond the current window");
541 for (uint16_t i = 10; i < winSize; i++)
546 "Incorrect flag after transmitting an MPDU beyond the current window");
552 mpdu->GetHeader().SetSequenceNumber(seqNumber);
566 "Incorrect starting sequence after transmitting another MPDU beyond the current window");
570 "Incorrect flag after transmitting another MPDU beyond the current window");
574 "Incorrect flag after transmitting another MPDU beyond the current window");
578 "Incorrect flag after transmitting another MPDU beyond the current window");
582 "Incorrect flag after transmitting another MPDU beyond the current window");
586 "Incorrect flag after transmitting another MPDU beyond the current window");
587 for (uint16_t i = 5; i < winSize; i++)
592 "Incorrect flag after transmitting another MPDU beyond the current window");
598 mpdu->GetHeader().SetSequenceNumber(seqNumber);
611 "Incorrect starting sequence after discarding an MPDU");
612 for (uint16_t i = 0; i < winSize; i++)
616 "Incorrect flag after discarding an MPDU");
621 for (uint16_t i = 1; i < winSize; i++)
636 "Incorrect starting sequence after acknowledging all but the first MPDU");
639 "Incorrect flag after acknowledging all but the first MPDU");
640 for (uint16_t i = 1; i < winSize; i++)
644 "Incorrect flag after acknowledging all but the first MPDU");
661 "Incorrect starting sequence after acknowledging the first MPDU");
662 for (uint16_t i = 0; i < winSize; i++)
666 "Incorrect flag after acknowledging the first MPDU");
682 void DoRun()
override;
687 :
TestCase(
"Check the correctness of block ack compressed bitmap")
699 for (uint16_t i = 179; i < 220; i++)
703 for (uint16_t i = 225; i <= 242; i++)
728 "error in compressed bitmap");
735 for (uint16_t i = 4090; i != 10; i = (i + 1) % 4096)
739 for (uint16_t i = 22; i < 25; i++)
783 void DoRun()
override;
799 :
TestCase(
"Test case for Block Ack recipient reordering buffer operations"),
842 "The MPDU forwarded up is not the expected one");
894 "The MPDU forwarded up is not the expected one");
899 "The MPDU forwarded up is not the expected one");
902 "The MPDU forwarded up is not the expected one");
907 "The MPDU forwarded up is not the expected one");
912 "The MPDU forwarded up is not the expected one");
917 "The MPDU forwarded up is not the expected one");
935 "The MPDU forwarded up is not the expected one");
977 "The MPDU forwarded up is not the expected one");
982 "The MPDU forwarded up is not the expected one");
987 "The MPDU forwarded up is not the expected one");
1006 void DoRun()
override;
1010 :
TestCase(
"Check the correctness of Multi-STA block ack")
1024 uint16_t aid1 = 100;
1025 bool ackType1 =
true;
1028 blockAck.SetAid11(aid1, 0);
1029 blockAck.SetAckType(ackType1, 0);
1030 blockAck.SetTidInfo(tid1, 0);
1033 uint16_t aid2 = 200;
1034 bool ackType2 =
false;
1036 uint16_t startSeq2 = 1000;
1038 blockAck.SetAid11(aid2, 1);
1039 blockAck.SetAckType(ackType2, 1);
1040 blockAck.SetTidInfo(tid2, 1);
1041 blockAck.SetStartingSequence(startSeq2, 1);
1043 for (uint16_t i = startSeq2; i < startSeq2 + 8; i += 2)
1045 blockAck.SetReceivedPacket(i, 1);
1048 for (uint16_t i = startSeq2 + 9; i < startSeq2 + 16; i += 2)
1050 blockAck.SetReceivedPacket(i, 1);
1054 for (uint16_t i = startSeq2 + 24; i < startSeq2 + 32; i++)
1056 blockAck.SetReceivedPacket(i, 1);
1060 uint16_t aid3 = 300;
1061 bool ackType3 =
false;
1063 uint16_t startSeq3 = 2000;
1065 blockAck.SetAid11(aid3, 2);
1066 blockAck.SetAckType(ackType3, 2);
1067 blockAck.SetTidInfo(tid3, 2);
1068 blockAck.SetStartingSequence(startSeq3, 2);
1070 for (uint16_t i = startSeq3; i < startSeq3 + 8; i += 2)
1072 blockAck.SetReceivedPacket(i, 2);
1075 for (uint16_t i = startSeq3 + 9; i < startSeq3 + 16; i += 2)
1077 blockAck.SetReceivedPacket(i, 2);
1081 for (uint16_t i = startSeq3 + 24; i < startSeq3 + 32; i++)
1083 blockAck.SetReceivedPacket(i, 2);
1086 for (uint16_t i = startSeq3 + 32; i < startSeq3 + 36; i++)
1088 blockAck.SetReceivedPacket(i, 2);
1091 for (uint16_t i = startSeq3 + 44; i < startSeq3 + 48; i++)
1093 blockAck.SetReceivedPacket(i, 2);
1097 for (uint16_t i = startSeq3 + 56; i < startSeq3 + 64; i++)
1099 blockAck.SetReceivedPacket(i, 2);
1103 uint16_t aid4 = 400;
1104 bool ackType4 =
false;
1106 uint16_t startSeq4 = 3000;
1108 blockAck.SetAid11(aid4, 3);
1109 blockAck.SetAckType(ackType4, 3);
1110 blockAck.SetTidInfo(tid4, 3);
1111 blockAck.SetStartingSequence(startSeq4, 3);
1113 for (uint16_t i = startSeq4; i < startSeq4 + 8; i += 2)
1115 blockAck.SetReceivedPacket(i, 3);
1118 for (uint16_t i = startSeq4 + 9; i < startSeq4 + 16; i += 2)
1120 blockAck.SetReceivedPacket(i, 3);
1124 for (uint16_t i = startSeq4 + 24; i < startSeq4 + 32; i++)
1126 blockAck.SetReceivedPacket(i, 3);
1129 for (uint16_t i = startSeq4 + 32; i < startSeq4 + 36; i++)
1131 blockAck.SetReceivedPacket(i, 3);
1134 for (uint16_t i = startSeq4 + 44; i < startSeq4 + 48; i++)
1136 blockAck.SetReceivedPacket(i, 3);
1140 for (uint16_t i = startSeq4 + 56; i < startSeq4 + 64; i++)
1142 blockAck.SetReceivedPacket(i, 3);
1146 for (uint16_t i = startSeq4 + 72; i < startSeq4 + 80; i++)
1148 blockAck.SetReceivedPacket(i, 3);
1152 for (uint16_t i = startSeq4 + 88; i < startSeq4 + 96; i++)
1154 blockAck.SetReceivedPacket(i, 3);
1158 for (uint16_t i = startSeq4 + 104; i < startSeq4 + 112; i++)
1160 blockAck.SetReceivedPacket(i, 3);
1164 for (uint16_t i = startSeq4 + 120; i < startSeq4 + 128; i++)
1166 blockAck.SetReceivedPacket(i, 3);
1170 uint16_t aid5 = 500;
1171 bool ackType5 =
false;
1173 uint16_t startSeq5 = 4000;
1175 blockAck.SetAid11(aid5, 4);
1176 blockAck.SetAckType(ackType5, 4);
1177 blockAck.SetTidInfo(tid5, 4);
1178 blockAck.SetStartingSequence(startSeq5, 4);
1180 for (
int i = startSeq5; i < startSeq5 + 8; i += 2)
1182 blockAck.SetReceivedPacket(i, 4);
1185 for (
int i = startSeq5 + 9; i < startSeq5 + 16; i += 2)
1187 blockAck.SetReceivedPacket(i, 4);
1191 for (
int i = startSeq5 + 24; i < startSeq5 + 32; i++)
1193 blockAck.SetReceivedPacket(i, 4);
1196 for (
int i = startSeq5 + 32; i < startSeq5 + 36; i++)
1198 blockAck.SetReceivedPacket(i, 4);
1201 for (
int i = startSeq5 + 44; i < startSeq5 + 48; i++)
1203 blockAck.SetReceivedPacket(i, 4);
1207 for (
int i = startSeq5 + 56; i < startSeq5 + 64; i++)
1209 blockAck.SetReceivedPacket(i, 4);
1213 for (
int i = startSeq5 + 72; i < startSeq5 + 80; i++)
1215 blockAck.SetReceivedPacket(i, 4);
1219 for (
int i = startSeq5 + 88; i < startSeq5 + 96; i++)
1221 blockAck.SetReceivedPacket(i, 4);
1225 for (
int i = (startSeq5 + 104) % 4096; i < (startSeq5 + 112) % 4096; i++)
1227 blockAck.SetReceivedPacket(i, 4);
1231 for (
int i = (startSeq5 + 120) % 4096; i < (startSeq5 + 128) % 4096; i++)
1233 blockAck.SetReceivedPacket(i, 4);
1237 for (
int i = (startSeq5 + 136) % 4096; i < (startSeq5 + 144) % 4096; i++)
1239 blockAck.SetReceivedPacket(i, 4);
1243 for (
int i = (startSeq5 + 152) % 4096; i < (startSeq5 + 160) % 4096; i++)
1245 blockAck.SetReceivedPacket(i, 4);
1249 for (
int i = (startSeq5 + 168) % 4096; i < (startSeq5 + 176) % 4096; i++)
1251 blockAck.SetReceivedPacket(i, 4);
1255 for (
int i = (startSeq5 + 184) % 4096; i < (startSeq5 + 192) % 4096; i++)
1257 blockAck.SetReceivedPacket(i, 4);
1261 for (
int i = (startSeq5 + 200) % 4096; i < (startSeq5 + 208) % 4096; i++)
1263 blockAck.SetReceivedPacket(i, 4);
1267 for (
int i = (startSeq5 + 216) % 4096; i < (startSeq5 + 224) % 4096; i++)
1269 blockAck.SetReceivedPacket(i, 4);
1273 for (
int i = (startSeq5 + 232) % 4096; i < (startSeq5 + 240) % 4096; i++)
1275 blockAck.SetReceivedPacket(i, 4);
1279 for (
int i = (startSeq5 + 248) % 4096; i < (startSeq5 + 256) % 4096; i++)
1281 blockAck.SetReceivedPacket(i, 4);
1285 uint16_t aid6 = 2045;
1286 bool ackType6 =
true;
1290 blockAck.SetAid11(aid6, 5);
1291 blockAck.SetAckType(ackType6, 5);
1292 blockAck.SetTidInfo(tid6, 5);
1293 blockAck.SetUnassociatedStaAddress(address6, 5);
1297 packet->AddHeader(blockAck);
1301 packet->RemoveHeader(blockAckCopy);
1308 "Different block ack variant");
1320 "Different AID for the first Per AID TID Info subfield");
1323 "Different Ack Type for the first Per AID TID Info subfield");
1326 "Different TID for the first Per AID TID Info subfield");
1331 "Different AID for the second Per AID TID Info subfield");
1334 "Different Ack Type for the second Per AID TID Info subfield");
1337 "Different TID for the second Per AID TID Info subfield");
1341 "Different starting sequence number for the second Per AID TID Info subfield");
1343 auto& bitmap2 = blockAckCopy.
GetBitmap(1);
1346 "Different bitmap length for the second Per AID TID Info subfield");
1350 "Error in the 1st byte of the bitmap for the second Per AID TID Info subfield");
1354 "Error in the 2nd byte of the bitmap for the second Per AID TID Info subfield");
1358 "Error in the 3rd byte of the bitmap for the second Per AID TID Info subfield");
1362 "Error in the 4th byte of the bitmap for the second Per AID TID Info subfield");
1367 "Different AID for the third Per AID TID Info subfield");
1370 "Different Ack Type for the third Per AID TID Info subfield");
1373 "Different TID for the third Per AID TID Info subfield");
1377 "Different starting sequence number for the third Per AID TID Info subfield");
1379 auto& bitmap3 = blockAckCopy.
GetBitmap(2);
1382 "Different bitmap length for the third Per AID TID Info subfield");
1386 "Error in the 1st byte of the bitmap for the third Per AID TID Info subfield");
1390 "Error in the 2nd byte of the bitmap for the third Per AID TID Info subfield");
1394 "Error in the 3rd byte of the bitmap for the third Per AID TID Info subfield");
1398 "Error in the 4th byte of the bitmap for the third Per AID TID Info subfield");
1402 "Error in the 5th byte of the bitmap for the third Per AID TID Info subfield");
1406 "Error in the 6th byte of the bitmap for the third Per AID TID Info subfield");
1410 "Error in the 7th byte of the bitmap for the third Per AID TID Info subfield");
1414 "Error in the 8th byte of the bitmap for the third Per AID TID Info subfield");
1419 "Different AID for the fourth Per AID TID Info subfield");
1422 "Different Ack Type for the fourth Per AID TID Info subfield");
1425 "Different TID for the fourth Per AID TID Info subfield");
1429 "Different starting sequence number for the fourth Per AID TID Info subfield");
1431 auto& bitmap4 = blockAckCopy.
GetBitmap(3);
1434 "Different bitmap length for the fourth Per AID TID Info subfield");
1438 "Error in the 1st byte of the bitmap for the fourth Per AID TID Info subfield");
1442 "Error in the 2nd byte of the bitmap for the fourth Per AID TID Info subfield");
1446 "Error in the 3rd byte of the bitmap for the fourth Per AID TID Info subfield");
1450 "Error in the 4th byte of the bitmap for the fourth Per AID TID Info subfield");
1454 "Error in the 5th byte of the bitmap for the fourth Per AID TID Info subfield");
1458 "Error in the 6th byte of the bitmap for the fourth Per AID TID Info subfield");
1462 "Error in the 7th byte of the bitmap for the fourth Per AID TID Info subfield");
1466 "Error in the 8th byte of the bitmap for the fourth Per AID TID Info subfield");
1470 "Error in the 9th byte of the bitmap for the fourth Per AID TID Info subfield");
1474 "Error in the 10th byte of the bitmap for the fourth Per AID TID Info subfield");
1478 "Error in the 11th byte of the bitmap for the fourth Per AID TID Info subfield");
1482 "Error in the 12th byte of the bitmap for the fourth Per AID TID Info subfield");
1486 "Error in the 13th byte of the bitmap for the fourth Per AID TID Info subfield");
1490 "Error in the 14th byte of the bitmap for the fourth Per AID TID Info subfield");
1494 "Error in the 15th byte of the bitmap for the fourth Per AID TID Info subfield");
1498 "Error in the 16th byte of the bitmap for the fourth Per AID TID Info subfield");
1503 "Different AID for the fifth Per AID TID Info subfield");
1506 "Different Ack Type for the fifth Per AID TID Info subfield");
1509 "Different TID for the fifth Per AID TID Info subfield");
1513 "Different starting sequence number for the fifth Per AID TID Info subfield");
1515 auto& bitmap5 = blockAckCopy.
GetBitmap(4);
1518 "Different bitmap length for the fifth Per AID TID Info subfield");
1522 "Error in the 1st byte of the bitmap for the fifth Per AID TID Info subfield");
1526 "Error in the 2nd byte of the bitmap for the fifth Per AID TID Info subfield");
1530 "Error in the 3rd byte of the bitmap for the fifth Per AID TID Info subfield");
1534 "Error in the 4th byte of the bitmap for the fifth Per AID TID Info subfield");
1538 "Error in the 5th byte of the bitmap for the fifth Per AID TID Info subfield");
1542 "Error in the 6th byte of the bitmap for the fifth Per AID TID Info subfield");
1546 "Error in the 7th byte of the bitmap for the fifth Per AID TID Info subfield");
1550 "Error in the 8th byte of the bitmap for the fifth Per AID TID Info subfield");
1554 "Error in the 9th byte of the bitmap for the fifth Per AID TID Info subfield");
1558 "Error in the 10th byte of the bitmap for the fifth Per AID TID Info subfield");
1562 "Error in the 11th byte of the bitmap for the fifth Per AID TID Info subfield");
1566 "Error in the 12th byte of the bitmap for the fifth Per AID TID Info subfield");
1570 "Error in the 13th byte of the bitmap for the fifth Per AID TID Info subfield");
1574 "Error in the 14th byte of the bitmap for the fifth Per AID TID Info subfield");
1578 "Error in the 15th byte of the bitmap for the fifth Per AID TID Info subfield");
1582 "Error in the 16th byte of the bitmap for the fifth Per AID TID Info subfield");
1586 "Error in the 17th byte of the bitmap for the fifth Per AID TID Info subfield");
1590 "Error in the 18th byte of the bitmap for the fifth Per AID TID Info subfield");
1594 "Error in the 19th byte of the bitmap for the fifth Per AID TID Info subfield");
1598 "Error in the 20th byte of the bitmap for the fifth Per AID TID Info subfield");
1602 "Error in the 21th byte of the bitmap for the fifth Per AID TID Info subfield");
1606 "Error in the 22th byte of the bitmap for the fifth Per AID TID Info subfield");
1610 "Error in the 23th byte of the bitmap for the fifth Per AID TID Info subfield");
1614 "Error in the 24th byte of the bitmap for the fifth Per AID TID Info subfield");
1618 "Error in the 25th byte of the bitmap for the fifth Per AID TID Info subfield");
1622 "Error in the 26th byte of the bitmap for the fifth Per AID TID Info subfield");
1626 "Error in the 27th byte of the bitmap for the fifth Per AID TID Info subfield");
1630 "Error in the 28th byte of the bitmap for the fifth Per AID TID Info subfield");
1634 "Error in the 29th byte of the bitmap for the fifth Per AID TID Info subfield");
1638 "Error in the 30th byte of the bitmap for the fifth Per AID TID Info subfield");
1642 "Error in the 31th byte of the bitmap for the fifth Per AID TID Info subfield");
1646 "Error in the 32th byte of the bitmap for the fifth Per AID TID Info subfield");
1651 "Different AID for the sixth Per AID TID Info subfield");
1654 "Different Ack Type for the sixth Per AID TID Info subfield");
1657 "Different TID for the sixth Per AID TID Info subfield");
1661 "Different starting sequence number for the sixth Per AID TID Info subfield");
1733 void DoRun()
override;
1772 if (duration >
m_max)
1779 :
TestCase(
"Test case for Block Ack Policy with aggregation disabled"),
1798 if (p->GetSize() == 1400)
1831 "Unexpected QoS ack policy");
1837 "Unexpected QoS ack policy");
1868 wifiApNode.Create(1);
1872 phy.SetChannel(channel.Create());
1877 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1881 mac.SetType(
"ns3::StaWifiMac",
1889 "BE_BlockAckThreshold",
1895 staDevices = wifi.Install(phy, mac, wifiStaNode);
1897 mac.SetType(
"ns3::ApWifiMac",
1916 apDevices = wifi.Install(phy, mac, wifiApNode);
1921 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1922 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1923 mobility.SetPositionAllocator(positionAlloc);
1925 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1926 mobility.Install(wifiApNode);
1927 mobility.Install(wifiStaNode);
1933 sta_device->GetMac()->SetAttribute(
"BE_MaxAmpduSize",
UintegerValue(0));
1939 sta_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
1940 ptr.
Get<
QosTxop>()->TraceConnectWithoutContext(
1952 packetSocket.
Install(wifiStaNode);
1953 packetSocket.
Install(wifiApNode);
1961 client1->SetRemote(socket);
1963 client1->SetStartTime(
Seconds(1));
1964 client1->SetStopTime(
Seconds(3.0));
1974 client2->SetRemote(socket);
1976 client2->SetStartTime(
Seconds(1.5));
1977 client2->SetStopTime(
Seconds(3.0));
1980 server->SetLocal(socket);
1981 wifiApNode.Get(0)->AddApplication(server);
1982 server->SetStartTime(
Seconds(0.0));
1983 server->SetStopTime(
Seconds(4.0));
1985 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
2009 "The maximum TXOP duration is too short!");
static BlockAckTestSuite g_blockAckTestSuite
the test suite
Test for Block Ack Policy with aggregation disabled.
uint16_t m_nBa
received BlockAck frames
uint16_t m_txTotal
transmitted data packets
void L7Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Function to trace packets received by the server application.
BlockAckAggregationDisabledTest(bool txop)
Constructor.
~BlockAckAggregationDisabledTest() override
uint16_t m_nBar
transmitted BlockAckReq frames
void Receive(std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand rxPowersW)
Callback invoked when PHY receives a packet.
void Transmit(std::string context, Ptr< const Packet > p, double power)
Callback invoked when PHY transmits a packet.
uint16_t m_txSinceBar
packets transmitted since the agreement was established or the last block ack was received
uint32_t m_received
received packets
void DoRun() override
Implementation to actually run this TestCase.
bool m_txop
true for non-null TXOP limit
Test for recipient reordering buffer operations.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_ssn
the Starting Sequence Number used to initialize WinStartB
BlockAckRecipientBufferTest(uint16_t ssn)
Constructor.
std::list< Ptr< const WifiMpdu > > m_fwup
list of MPDUs that have been forwarded up
void ForwardUp(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
Keep track of MPDUs received on the given link that are forwarded up.
~BlockAckRecipientBufferTest() override
Test for the originator block ack window.
void DoRun() override
Implementation to actually run this TestCase.
OriginatorBlockAckWindowTest()
std::list< uint16_t > m_expectedBuffer
expected test buffer
void DoRun() override
Implementation to actually run this TestCase.
~PacketBufferingCaseA() override
std::list< uint16_t > m_expectedBuffer
expected test buffer
~PacketBufferingCaseB() override
void DoRun() override
Implementation to actually run this TestCase.
a polymophic address class
A container for one type of attribute.
void SetStartingSequence(uint16_t seq)
Set starting sequence number.
void SetBufferSize(uint16_t bufferSize)
Set buffer size.
std::size_t GetWinSize() const
Get the window size.
uint16_t GetWinStart() const
Get the current winStart value.
uint16_t GetWinEnd() const
Get the current winEnd value.
std::vector< bool >::reference At(std::size_t distance)
Get a reference to the element in the window having the given distance from the current winStart.
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static Mac48Address Allocate()
Allocate a new Mac48Address.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Maintains the state and information about transmitted MPDUs with Ack Policy set to Block Ack for an o...
void NotifyDiscardedMpdu(Ptr< const WifiMpdu > mpdu)
Advance the transmit window beyond the MPDU that has been reported to be discarded.
uint16_t GetStartingSequence() const override
Return the starting sequence number of the transmit window, if a transmit window has been initialized...
BlockAckWindow m_txWindow
originator's transmit window
void NotifyTransmittedMpdu(Ptr< const WifiMpdu > mpdu)
Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet...
void NotifyAckedMpdu(Ptr< const WifiMpdu > mpdu)
Record that the given MPDU has been acknowledged and advance the transmit window if possible.
void InitTxWindow()
Initialize the originator's transmit window by setting its size and starting sequence number equal to...
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
Maintains the scoreboard and the receive reordering buffer used by a recipient of a Block Ack agreeme...
void NotifyReceivedBar(uint16_t startingSequenceNumber)
Update both the scoreboard and the receive reordering buffer upon reception of a Block Ack Request.
void NotifyReceivedMpdu(Ptr< const WifiMpdu > mpdu)
Update both the scoreboard and the receive reordering buffer upon reception of the given MPDU.
void SetMacRxMiddle(const Ptr< MacRxMiddle > rxMiddle)
Set the MAC RX Middle to use.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
manage and create wifi channel objects for the YANS model.
static YansWifiChannelHelper Default()
Create a channel helper in a default working state.
Make it easy to create and manage PHY objects for the YANS model.
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report if not.
#define NS_TEST_EXPECT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
uint32_t QosUtilsMapSeqControlToUniqueInteger(uint16_t seqControl, uint16_t endSequence)
Next function is useful to correctly sort buffered packets under block ack.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static constexpr uint16_t SEQNO_SPACE_SIZE
Size of the space of sequence numbers.
std::map< WifiSpectrumBandInfo, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Keeps the maximum duration among all TXOPs.
Time m_max
max TXOP duration
void Trace(Time startTime, Time duration, uint8_t linkId)
Callback for the TxopTrace trace.
The different BlockAck variants.
Variant m_variant
Block Ack variant.
std::vector< uint8_t > m_bitmapLen
Length (bytes) of included bitmaps.