20#include "ns3/ap-wifi-mac.h"
21#include "ns3/boolean.h"
22#include "ns3/config.h"
23#include "ns3/ctrl-headers.h"
24#include "ns3/double.h"
25#include "ns3/mac-rx-middle.h"
26#include "ns3/mobility-helper.h"
27#include "ns3/originator-block-ack-agreement.h"
28#include "ns3/packet-socket-client.h"
29#include "ns3/packet-socket-helper.h"
30#include "ns3/packet-socket-server.h"
31#include "ns3/packet.h"
32#include "ns3/pointer.h"
33#include "ns3/qos-txop.h"
34#include "ns3/qos-utils.h"
35#include "ns3/recipient-block-ack-agreement.h"
36#include "ns3/string.h"
38#include "ns3/wifi-mac-header.h"
39#include "ns3/wifi-mpdu.h"
40#include "ns3/wifi-net-device.h"
41#include "ns3/yans-wifi-helper.h"
91 void DoRun()
override;
96 :
TestCase(
"Check correct order of buffering when startSequence < endSeq")
112 std::list<uint16_t> m_buffer;
113 std::list<uint16_t>::iterator i;
114 std::list<uint16_t>::iterator j;
115 m_buffer.push_back(0);
116 m_buffer.push_back(16);
117 m_buffer.push_back(56000);
119 uint16_t endSeq = 4000;
121 uint16_t receivedSeq = 4001 * 16;
124 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
132 m_buffer.insert(i, receivedSeq);
134 receivedSeq = 3999 * 16;
137 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
145 m_buffer.insert(i, receivedSeq);
147 for (i = m_buffer.begin(), j =
m_expectedBuffer.begin(); i != m_buffer.end(); i++, j++)
189 void DoRun()
override;
194 :
TestCase(
"Check correct order of buffering when startSequence > endSeq")
211 std::list<uint16_t> m_buffer;
212 std::list<uint16_t>::iterator i;
213 std::list<uint16_t>::iterator j;
214 m_buffer.push_back(256);
215 m_buffer.push_back(64000);
216 m_buffer.push_back(16);
218 uint16_t endSeq = 10;
220 uint16_t receivedSeq = 15 * 16;
223 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
231 m_buffer.insert(i, receivedSeq);
233 receivedSeq = 15 * 16 + 1;
236 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
244 m_buffer.insert(i, receivedSeq);
246 receivedSeq = 4050 * 16;
249 for (i = m_buffer.begin(); i != m_buffer.end(); i++)
257 m_buffer.insert(i, receivedSeq);
259 for (i = m_buffer.begin(), j =
m_expectedBuffer.begin(); i != m_buffer.end(); i++, j++)
277 void DoRun()
override;
281 :
TestCase(
"Check the correctness of the originator block ack window")
288 uint16_t winSize = 16;
289 uint16_t startingSeq = 4090;
299 for (uint16_t i = 0; i < winSize; i++)
303 "Not all flags are cleared after initialization");
309 Ptr<WifiMpdu> mpdu = Create<WifiMpdu>(Create<Packet>(), hdr);
310 uint16_t seqNumber = startingSeq;
311 mpdu->GetHeader().SetSequenceNumber(seqNumber);
336 "Incorrect starting sequence after 5 acknowledgments");
337 for (uint16_t i = 0; i < winSize; i++)
341 "Not all flags are cleared after 5 acknowledgments");
368 "Incorrect starting sequence after 1 unacknowledged MPDU");
371 "Incorrect flag after 1 unacknowledged MPDU");
374 "Incorrect flag after 1 unacknowledged MPDU");
377 "Incorrect flag after 1 unacknowledged MPDU");
380 "Incorrect flag after 1 unacknowledged MPDU");
383 "Incorrect flag after 1 unacknowledged MPDU");
384 for (uint16_t i = 5; i < winSize; i++)
388 "Incorrect flag after 1 unacknowledged MPDU");
393 mpdu->GetHeader().SetSequenceNumber(startingSeq);
406 "Incorrect starting sequence after acknowledgment of missing MPDU");
407 for (uint16_t i = 0; i < winSize; i++)
411 "Not all flags are cleared after acknowledgment of missing MPDU");
417 mpdu->GetHeader().SetSequenceNumber(seqNumber);
430 mpdu->GetHeader().SetSequenceNumber(seqNumber);
448 "Incorrect starting sequence after 3 unacknowledged MPDUs");
451 "Incorrect flag after 3 unacknowledged MPDUs");
454 "Incorrect flag after 3 unacknowledged MPDUs");
457 "Incorrect flag after 3 unacknowledged MPDUs");
460 "Incorrect flag after 3 unacknowledged MPDUs");
463 "Incorrect flag after 3 unacknowledged MPDUs");
466 "Incorrect flag after 3 unacknowledged MPDUs");
469 "Incorrect flag after 3 unacknowledged MPDUs");
472 "Incorrect flag after 3 unacknowledged MPDUs");
475 "Incorrect flag after 3 unacknowledged MPDUs");
478 "Incorrect flag after 3 unacknowledged MPDUs");
481 "Incorrect flag after 3 unacknowledged MPDUs");
484 "Incorrect flag after 3 unacknowledged MPDUs");
485 for (uint16_t i = 12; i < winSize; i++)
489 "Incorrect flag after 3 unacknowledged MPDUs");
495 mpdu->GetHeader().SetSequenceNumber(seqNumber);
509 "Incorrect starting sequence after transmitting an MPDU beyond the current window");
512 "Incorrect flag after transmitting an MPDU beyond the current window");
515 "Incorrect flag after transmitting an MPDU beyond the current window");
518 "Incorrect flag after transmitting an MPDU beyond the current window");
521 "Incorrect flag after transmitting an MPDU beyond the current window");
524 "Incorrect flag after transmitting an MPDU beyond the current window");
527 "Incorrect flag after transmitting an MPDU beyond the current window");
530 "Incorrect flag after transmitting an MPDU beyond the current window");
533 "Incorrect flag after transmitting an MPDU beyond the current window");
536 "Incorrect flag after transmitting an MPDU beyond the current window");
539 "Incorrect flag after transmitting an MPDU beyond the current window");
540 for (uint16_t i = 10; i < winSize; i++)
545 "Incorrect flag after transmitting an MPDU beyond the current window");
551 mpdu->GetHeader().SetSequenceNumber(seqNumber);
565 "Incorrect starting sequence after transmitting another MPDU beyond the current window");
569 "Incorrect flag after transmitting another MPDU beyond the current window");
573 "Incorrect flag after transmitting another MPDU beyond the current window");
577 "Incorrect flag after transmitting another MPDU beyond the current window");
581 "Incorrect flag after transmitting another MPDU beyond the current window");
585 "Incorrect flag after transmitting another MPDU beyond the current window");
586 for (uint16_t i = 5; i < winSize; i++)
591 "Incorrect flag after transmitting another MPDU beyond the current window");
597 mpdu->GetHeader().SetSequenceNumber(seqNumber);
610 "Incorrect starting sequence after discarding an MPDU");
611 for (uint16_t i = 0; i < winSize; i++)
615 "Incorrect flag after discarding an MPDU");
620 for (uint16_t i = 1; i < winSize; i++)
635 "Incorrect starting sequence after acknowledging all but the first MPDU");
638 "Incorrect flag after acknowledging all but the first MPDU");
639 for (uint16_t i = 1; i < winSize; i++)
643 "Incorrect flag after acknowledging all but the first MPDU");
660 "Incorrect starting sequence after acknowledging the first MPDU");
661 for (uint16_t i = 0; i < winSize; i++)
665 "Incorrect flag after acknowledging the first MPDU");
681 void DoRun()
override;
686 :
TestCase(
"Check the correctness of block ack compressed bitmap")
698 for (uint16_t i = 179; i < 220; i++)
702 for (uint16_t i = 225; i <= 242; i++)
727 "error in compressed bitmap");
734 for (uint16_t i = 4090; i != 10; i = (i + 1) % 4096)
738 for (uint16_t i = 22; i < 25; i++)
782 void DoRun()
override;
798 :
TestCase(
"Test case for Block Ack recipient reordering buffer operations"),
841 "The MPDU forwarded up is not the expected one");
893 "The MPDU forwarded up is not the expected one");
898 "The MPDU forwarded up is not the expected one");
901 "The MPDU forwarded up is not the expected one");
906 "The MPDU forwarded up is not the expected one");
911 "The MPDU forwarded up is not the expected one");
916 "The MPDU forwarded up is not the expected one");
934 "The MPDU forwarded up is not the expected one");
976 "The MPDU forwarded up is not the expected one");
981 "The MPDU forwarded up is not the expected one");
986 "The MPDU forwarded up is not the expected one");
1005 void DoRun()
override;
1009 :
TestCase(
"Check the correctness of Multi-STA block ack")
1023 uint16_t aid1 = 100;
1024 bool ackType1 =
true;
1027 blockAck.SetAid11(aid1, 0);
1028 blockAck.SetAckType(ackType1, 0);
1029 blockAck.SetTidInfo(tid1, 0);
1032 uint16_t aid2 = 200;
1033 bool ackType2 =
false;
1035 uint16_t startSeq2 = 1000;
1037 blockAck.SetAid11(aid2, 1);
1038 blockAck.SetAckType(ackType2, 1);
1039 blockAck.SetTidInfo(tid2, 1);
1040 blockAck.SetStartingSequence(startSeq2, 1);
1042 for (uint16_t i = startSeq2; i < startSeq2 + 8; i += 2)
1044 blockAck.SetReceivedPacket(i, 1);
1047 for (uint16_t i = startSeq2 + 9; i < startSeq2 + 16; i += 2)
1049 blockAck.SetReceivedPacket(i, 1);
1053 for (uint16_t i = startSeq2 + 24; i < startSeq2 + 32; i++)
1055 blockAck.SetReceivedPacket(i, 1);
1059 uint16_t aid3 = 300;
1060 bool ackType3 =
false;
1062 uint16_t startSeq3 = 2000;
1064 blockAck.SetAid11(aid3, 2);
1065 blockAck.SetAckType(ackType3, 2);
1066 blockAck.SetTidInfo(tid3, 2);
1067 blockAck.SetStartingSequence(startSeq3, 2);
1069 for (uint16_t i = startSeq3; i < startSeq3 + 8; i += 2)
1071 blockAck.SetReceivedPacket(i, 2);
1074 for (uint16_t i = startSeq3 + 9; i < startSeq3 + 16; i += 2)
1076 blockAck.SetReceivedPacket(i, 2);
1080 for (uint16_t i = startSeq3 + 24; i < startSeq3 + 32; i++)
1082 blockAck.SetReceivedPacket(i, 2);
1085 for (uint16_t i = startSeq3 + 32; i < startSeq3 + 36; i++)
1087 blockAck.SetReceivedPacket(i, 2);
1090 for (uint16_t i = startSeq3 + 44; i < startSeq3 + 48; i++)
1092 blockAck.SetReceivedPacket(i, 2);
1096 for (uint16_t i = startSeq3 + 56; i < startSeq3 + 64; i++)
1098 blockAck.SetReceivedPacket(i, 2);
1102 uint16_t aid4 = 400;
1103 bool ackType4 =
false;
1105 uint16_t startSeq4 = 3000;
1107 blockAck.SetAid11(aid4, 3);
1108 blockAck.SetAckType(ackType4, 3);
1109 blockAck.SetTidInfo(tid4, 3);
1110 blockAck.SetStartingSequence(startSeq4, 3);
1112 for (uint16_t i = startSeq4; i < startSeq4 + 8; i += 2)
1114 blockAck.SetReceivedPacket(i, 3);
1117 for (uint16_t i = startSeq4 + 9; i < startSeq4 + 16; i += 2)
1119 blockAck.SetReceivedPacket(i, 3);
1123 for (uint16_t i = startSeq4 + 24; i < startSeq4 + 32; i++)
1125 blockAck.SetReceivedPacket(i, 3);
1128 for (uint16_t i = startSeq4 + 32; i < startSeq4 + 36; i++)
1130 blockAck.SetReceivedPacket(i, 3);
1133 for (uint16_t i = startSeq4 + 44; i < startSeq4 + 48; i++)
1135 blockAck.SetReceivedPacket(i, 3);
1139 for (uint16_t i = startSeq4 + 56; i < startSeq4 + 64; i++)
1141 blockAck.SetReceivedPacket(i, 3);
1145 for (uint16_t i = startSeq4 + 72; i < startSeq4 + 80; i++)
1147 blockAck.SetReceivedPacket(i, 3);
1151 for (uint16_t i = startSeq4 + 88; i < startSeq4 + 96; i++)
1153 blockAck.SetReceivedPacket(i, 3);
1157 for (uint16_t i = startSeq4 + 104; i < startSeq4 + 112; i++)
1159 blockAck.SetReceivedPacket(i, 3);
1163 for (uint16_t i = startSeq4 + 120; i < startSeq4 + 128; i++)
1165 blockAck.SetReceivedPacket(i, 3);
1169 uint16_t aid5 = 500;
1170 bool ackType5 =
false;
1172 uint16_t startSeq5 = 4000;
1174 blockAck.SetAid11(aid5, 4);
1175 blockAck.SetAckType(ackType5, 4);
1176 blockAck.SetTidInfo(tid5, 4);
1177 blockAck.SetStartingSequence(startSeq5, 4);
1179 for (
int i = startSeq5; i < startSeq5 + 8; i += 2)
1181 blockAck.SetReceivedPacket(i, 4);
1184 for (
int i = startSeq5 + 9; i < startSeq5 + 16; i += 2)
1186 blockAck.SetReceivedPacket(i, 4);
1190 for (
int i = startSeq5 + 24; i < startSeq5 + 32; i++)
1192 blockAck.SetReceivedPacket(i, 4);
1195 for (
int i = startSeq5 + 32; i < startSeq5 + 36; i++)
1197 blockAck.SetReceivedPacket(i, 4);
1200 for (
int i = startSeq5 + 44; i < startSeq5 + 48; i++)
1202 blockAck.SetReceivedPacket(i, 4);
1206 for (
int i = startSeq5 + 56; i < startSeq5 + 64; i++)
1208 blockAck.SetReceivedPacket(i, 4);
1212 for (
int i = startSeq5 + 72; i < startSeq5 + 80; i++)
1214 blockAck.SetReceivedPacket(i, 4);
1218 for (
int i = startSeq5 + 88; i < startSeq5 + 96; i++)
1220 blockAck.SetReceivedPacket(i, 4);
1224 for (
int i = (startSeq5 + 104) % 4096; i < (startSeq5 + 112) % 4096; i++)
1226 blockAck.SetReceivedPacket(i, 4);
1230 for (
int i = (startSeq5 + 120) % 4096; i < (startSeq5 + 128) % 4096; i++)
1232 blockAck.SetReceivedPacket(i, 4);
1236 for (
int i = (startSeq5 + 136) % 4096; i < (startSeq5 + 144) % 4096; i++)
1238 blockAck.SetReceivedPacket(i, 4);
1242 for (
int i = (startSeq5 + 152) % 4096; i < (startSeq5 + 160) % 4096; i++)
1244 blockAck.SetReceivedPacket(i, 4);
1248 for (
int i = (startSeq5 + 168) % 4096; i < (startSeq5 + 176) % 4096; i++)
1250 blockAck.SetReceivedPacket(i, 4);
1254 for (
int i = (startSeq5 + 184) % 4096; i < (startSeq5 + 192) % 4096; i++)
1256 blockAck.SetReceivedPacket(i, 4);
1260 for (
int i = (startSeq5 + 200) % 4096; i < (startSeq5 + 208) % 4096; i++)
1262 blockAck.SetReceivedPacket(i, 4);
1266 for (
int i = (startSeq5 + 216) % 4096; i < (startSeq5 + 224) % 4096; i++)
1268 blockAck.SetReceivedPacket(i, 4);
1272 for (
int i = (startSeq5 + 232) % 4096; i < (startSeq5 + 240) % 4096; i++)
1274 blockAck.SetReceivedPacket(i, 4);
1278 for (
int i = (startSeq5 + 248) % 4096; i < (startSeq5 + 256) % 4096; i++)
1280 blockAck.SetReceivedPacket(i, 4);
1284 uint16_t aid6 = 2045;
1285 bool ackType6 =
true;
1289 blockAck.SetAid11(aid6, 5);
1290 blockAck.SetAckType(ackType6, 5);
1291 blockAck.SetTidInfo(tid6, 5);
1292 blockAck.SetUnassociatedStaAddress(address6, 5);
1296 packet->AddHeader(blockAck);
1300 packet->RemoveHeader(blockAckCopy);
1307 "Different block ack variant");
1319 "Different AID for the first Per AID TID Info subfield");
1322 "Different Ack Type for the first Per AID TID Info subfield");
1325 "Different TID for the first Per AID TID Info subfield");
1330 "Different AID for the second Per AID TID Info subfield");
1333 "Different Ack Type for the second Per AID TID Info subfield");
1336 "Different TID for the second Per AID TID Info subfield");
1340 "Different starting sequence number for the second Per AID TID Info subfield");
1342 auto& bitmap2 = blockAckCopy.
GetBitmap(1);
1345 "Different bitmap length for the second Per AID TID Info subfield");
1349 "Error in the 1st byte of the bitmap for the second Per AID TID Info subfield");
1353 "Error in the 2nd byte of the bitmap for the second Per AID TID Info subfield");
1357 "Error in the 3rd byte of the bitmap for the second Per AID TID Info subfield");
1361 "Error in the 4th byte of the bitmap for the second Per AID TID Info subfield");
1366 "Different AID for the third Per AID TID Info subfield");
1369 "Different Ack Type for the third Per AID TID Info subfield");
1372 "Different TID for the third Per AID TID Info subfield");
1376 "Different starting sequence number for the third Per AID TID Info subfield");
1378 auto& bitmap3 = blockAckCopy.
GetBitmap(2);
1381 "Different bitmap length for the third Per AID TID Info subfield");
1385 "Error in the 1st byte of the bitmap for the third Per AID TID Info subfield");
1389 "Error in the 2nd byte of the bitmap for the third Per AID TID Info subfield");
1393 "Error in the 3rd byte of the bitmap for the third Per AID TID Info subfield");
1397 "Error in the 4th byte of the bitmap for the third Per AID TID Info subfield");
1401 "Error in the 5th byte of the bitmap for the third Per AID TID Info subfield");
1405 "Error in the 6th byte of the bitmap for the third Per AID TID Info subfield");
1409 "Error in the 7th byte of the bitmap for the third Per AID TID Info subfield");
1413 "Error in the 8th byte of the bitmap for the third Per AID TID Info subfield");
1418 "Different AID for the fourth Per AID TID Info subfield");
1421 "Different Ack Type for the fourth Per AID TID Info subfield");
1424 "Different TID for the fourth Per AID TID Info subfield");
1428 "Different starting sequence number for the fourth Per AID TID Info subfield");
1430 auto& bitmap4 = blockAckCopy.
GetBitmap(3);
1433 "Different bitmap length for the fourth Per AID TID Info subfield");
1437 "Error in the 1st byte of the bitmap for the fourth Per AID TID Info subfield");
1441 "Error in the 2nd byte of the bitmap for the fourth Per AID TID Info subfield");
1445 "Error in the 3rd byte of the bitmap for the fourth Per AID TID Info subfield");
1449 "Error in the 4th byte of the bitmap for the fourth Per AID TID Info subfield");
1453 "Error in the 5th byte of the bitmap for the fourth Per AID TID Info subfield");
1457 "Error in the 6th byte of the bitmap for the fourth Per AID TID Info subfield");
1461 "Error in the 7th byte of the bitmap for the fourth Per AID TID Info subfield");
1465 "Error in the 8th byte of the bitmap for the fourth Per AID TID Info subfield");
1469 "Error in the 9th byte of the bitmap for the fourth Per AID TID Info subfield");
1473 "Error in the 10th byte of the bitmap for the fourth Per AID TID Info subfield");
1477 "Error in the 11th byte of the bitmap for the fourth Per AID TID Info subfield");
1481 "Error in the 12th byte of the bitmap for the fourth Per AID TID Info subfield");
1485 "Error in the 13th byte of the bitmap for the fourth Per AID TID Info subfield");
1489 "Error in the 14th byte of the bitmap for the fourth Per AID TID Info subfield");
1493 "Error in the 15th byte of the bitmap for the fourth Per AID TID Info subfield");
1497 "Error in the 16th byte of the bitmap for the fourth Per AID TID Info subfield");
1502 "Different AID for the fifth Per AID TID Info subfield");
1505 "Different Ack Type for the fifth Per AID TID Info subfield");
1508 "Different TID for the fifth Per AID TID Info subfield");
1512 "Different starting sequence number for the fifth Per AID TID Info subfield");
1514 auto& bitmap5 = blockAckCopy.
GetBitmap(4);
1517 "Different bitmap length for the fifth Per AID TID Info subfield");
1521 "Error in the 1st byte of the bitmap for the fifth Per AID TID Info subfield");
1525 "Error in the 2nd byte of the bitmap for the fifth Per AID TID Info subfield");
1529 "Error in the 3rd byte of the bitmap for the fifth Per AID TID Info subfield");
1533 "Error in the 4th byte of the bitmap for the fifth Per AID TID Info subfield");
1537 "Error in the 5th byte of the bitmap for the fifth Per AID TID Info subfield");
1541 "Error in the 6th byte of the bitmap for the fifth Per AID TID Info subfield");
1545 "Error in the 7th byte of the bitmap for the fifth Per AID TID Info subfield");
1549 "Error in the 8th byte of the bitmap for the fifth Per AID TID Info subfield");
1553 "Error in the 9th byte of the bitmap for the fifth Per AID TID Info subfield");
1557 "Error in the 10th byte of the bitmap for the fifth Per AID TID Info subfield");
1561 "Error in the 11th byte of the bitmap for the fifth Per AID TID Info subfield");
1565 "Error in the 12th byte of the bitmap for the fifth Per AID TID Info subfield");
1569 "Error in the 13th byte of the bitmap for the fifth Per AID TID Info subfield");
1573 "Error in the 14th byte of the bitmap for the fifth Per AID TID Info subfield");
1577 "Error in the 15th byte of the bitmap for the fifth Per AID TID Info subfield");
1581 "Error in the 16th byte of the bitmap for the fifth Per AID TID Info subfield");
1585 "Error in the 17th byte of the bitmap for the fifth Per AID TID Info subfield");
1589 "Error in the 18th byte of the bitmap for the fifth Per AID TID Info subfield");
1593 "Error in the 19th byte of the bitmap for the fifth Per AID TID Info subfield");
1597 "Error in the 20th byte of the bitmap for the fifth Per AID TID Info subfield");
1601 "Error in the 21th byte of the bitmap for the fifth Per AID TID Info subfield");
1605 "Error in the 22th byte of the bitmap for the fifth Per AID TID Info subfield");
1609 "Error in the 23th byte of the bitmap for the fifth Per AID TID Info subfield");
1613 "Error in the 24th byte of the bitmap for the fifth Per AID TID Info subfield");
1617 "Error in the 25th byte of the bitmap for the fifth Per AID TID Info subfield");
1621 "Error in the 26th byte of the bitmap for the fifth Per AID TID Info subfield");
1625 "Error in the 27th byte of the bitmap for the fifth Per AID TID Info subfield");
1629 "Error in the 28th byte of the bitmap for the fifth Per AID TID Info subfield");
1633 "Error in the 29th byte of the bitmap for the fifth Per AID TID Info subfield");
1637 "Error in the 30th byte of the bitmap for the fifth Per AID TID Info subfield");
1641 "Error in the 31th byte of the bitmap for the fifth Per AID TID Info subfield");
1645 "Error in the 32th byte of the bitmap for the fifth Per AID TID Info subfield");
1650 "Different AID for the sixth Per AID TID Info subfield");
1653 "Different Ack Type for the sixth Per AID TID Info subfield");
1656 "Different TID for the sixth Per AID TID Info subfield");
1660 "Different starting sequence number for the sixth Per AID TID Info subfield");
1732 void DoRun()
override;
1771 if (duration >
m_max)
1778 :
TestCase(
"Test case for Block Ack Policy with aggregation disabled"),
1797 if (p->GetSize() == 1400)
1830 "Unexpected QoS ack policy");
1836 "Unexpected QoS ack policy");
1867 wifiApNode.Create(1);
1871 phy.SetChannel(channel.Create());
1876 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1880 mac.SetType(
"ns3::StaWifiMac",
1888 "BE_BlockAckThreshold",
1894 staDevices = wifi.Install(phy, mac, wifiStaNode);
1896 mac.SetType(
"ns3::ApWifiMac",
1907 apDevices = wifi.Install(phy, mac, wifiApNode);
1912 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1913 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1914 mobility.SetPositionAllocator(positionAlloc);
1916 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1917 mobility.Install(wifiApNode);
1918 mobility.Install(wifiStaNode);
1924 sta_device->GetMac()->SetAttribute(
"BE_MaxAmpduSize",
UintegerValue(0));
1930 sta_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
1931 ptr.
Get<
QosTxop>()->TraceConnectWithoutContext(
1936 ap_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
1947 packetSocket.
Install(wifiStaNode);
1948 packetSocket.
Install(wifiApNode);
1956 client1->SetRemote(socket);
1958 client1->SetStartTime(
Seconds(1));
1959 client1->SetStopTime(
Seconds(3.0));
1969 client2->SetRemote(socket);
1971 client2->SetStartTime(
Seconds(1.5));
1972 client2->SetStopTime(
Seconds(3.0));
1975 server->SetLocal(socket);
1976 wifiApNode.Get(0)->AddApplication(server);
1977 server->SetStartTime(
Seconds(0.0));
1978 server->SetStopTime(
Seconds(4.0));
1980 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
2004 "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
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.
Hold objects of type Ptr<T>.
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, TestDuration 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.