22 #include "ns3/string.h"
23 #include "ns3/qos-utils.h"
24 #include "ns3/ctrl-headers.h"
25 #include "ns3/packet.h"
26 #include "ns3/wifi-net-device.h"
27 #include "ns3/ap-wifi-mac.h"
28 #include "ns3/wifi-mac-header.h"
29 #include "ns3/mobility-helper.h"
30 #include "ns3/yans-wifi-helper.h"
31 #include "ns3/packet-socket-server.h"
32 #include "ns3/packet-socket-client.h"
33 #include "ns3/packet-socket-helper.h"
34 #include "ns3/config.h"
35 #include "ns3/pointer.h"
36 #include "ns3/recipient-block-ack-agreement.h"
37 #include "ns3/mac-rx-middle.h"
85 void DoRun (
void)
override;
90 :
TestCase (
"Check correct order of buffering when startSequence < endSeq")
106 std::list<uint16_t> m_buffer;
107 std::list<uint16_t>::iterator i,j;
108 m_buffer.push_back (0);
109 m_buffer.push_back (16);
110 m_buffer.push_back (56000);
112 uint16_t endSeq = 4000;
114 uint16_t receivedSeq = 4001 * 16;
117 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
125 m_buffer.insert (i, receivedSeq);
127 receivedSeq = 3999 * 16;
130 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
138 m_buffer.insert (i, receivedSeq);
140 for (i = m_buffer.begin (), j =
m_expectedBuffer.begin (); i != m_buffer.end (); i++, j++)
182 void DoRun (
void)
override;
187 :
TestCase (
"Check correct order of buffering when startSequence > endSeq")
204 std::list<uint16_t> m_buffer;
205 std::list<uint16_t>::iterator i,j;
206 m_buffer.push_back (256);
207 m_buffer.push_back (64000);
208 m_buffer.push_back (16);
210 uint16_t endSeq = 10;
212 uint16_t receivedSeq = 15 * 16;
215 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
223 m_buffer.insert (i, receivedSeq);
225 receivedSeq = 15 * 16 + 1;
228 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
236 m_buffer.insert (i, receivedSeq);
238 receivedSeq = 4050 * 16;
241 for (i = m_buffer.begin (); i != m_buffer.end (); i++)
249 m_buffer.insert (i, receivedSeq);
251 for (i = m_buffer.begin (), j =
m_expectedBuffer.begin (); i != m_buffer.end (); i++, j++)
268 void DoRun (
void)
override;
272 :
TestCase (
"Check the correctness of the originator block ack window")
279 uint16_t winSize = 16;
280 uint16_t startingSeq = 4090;
290 for (uint16_t i = 0; i < winSize; i++)
299 uint16_t seqNumber = startingSeq;
324 for (uint16_t i = 0; i < winSize; i++)
357 for (uint16_t i = 5; i < winSize; i++)
376 for (uint16_t i = 0; i < winSize; i++)
425 for (uint16_t i = 12; i < winSize; i++)
445 "Incorrect starting sequence after transmitting an MPDU beyond the current window");
456 for (uint16_t i = 10; i < winSize; i++)
476 "Incorrect starting sequence after transmitting another MPDU beyond the current window");
482 for (uint16_t i = 5; i < winSize; i++)
502 "Incorrect starting sequence after discarding an MPDU");
503 for (uint16_t i = 0; i < winSize; i++)
510 for (uint16_t i = 1; i < winSize; i++)
524 "Incorrect starting sequence after acknowledging all but the first MPDU");
526 for (uint16_t i = 1; i < winSize; i++)
544 "Incorrect starting sequence after acknowledging the first MPDU");
545 for (uint16_t i = 0; i < winSize; i++)
563 void DoRun (
void)
override;
568 :
TestCase (
"Check the correctness of block ack compressed bitmap")
580 for (uint16_t i = 179; i < 220; i++)
584 for (uint16_t i = 225; i <= 242; i++)
614 for (uint16_t i = 4090; i != 10; i = (i + 1) % 4096)
618 for (uint16_t i = 22; i < 25; i++)
663 void DoRun (
void)
override;
678 :
TestCase (
"Test case for Block Ack recipient reordering buffer operations"),
706 hdr.
SetAddr1 (Mac48Address::Allocate ());
716 "The MPDU forwarded up is not the expected one");
768 "The MPDU forwarded up is not the expected one");
773 "The MPDU forwarded up is not the expected one");
775 "The MPDU forwarded up is not the expected one");
780 "The MPDU forwarded up is not the expected one");
785 "The MPDU forwarded up is not the expected one");
790 "The MPDU forwarded up is not the expected one");
808 "The MPDU forwarded up is not the expected one");
850 "The MPDU forwarded up is not the expected one");
855 "The MPDU forwarded up is not the expected one");
860 "The MPDU forwarded up is not the expected one");
864 Simulator::Destroy ();
879 virtual void DoRun (
void);
883 :
TestCase (
"Check the correctness of Multi-STA block ack")
891 BlockAckType baType (BlockAckType::MULTI_STA, {0, 4, 8, 16, 32, 8});
898 bool ackType1 =
true;
901 blockAck.SetAid11 (aid1, 0);
902 blockAck.SetAckType (ackType1, 0);
903 blockAck.SetTidInfo (tid1, 0);
907 bool ackType2 =
false;
909 uint16_t startSeq2 = 1000;
911 blockAck.SetAid11 (aid2, 1);
912 blockAck.SetAckType (ackType2, 1);
913 blockAck.SetTidInfo (tid2, 1);
914 blockAck.SetStartingSequence (startSeq2, 1);
916 for (uint16_t i = startSeq2; i < startSeq2 + 8; i+=2)
918 blockAck.SetReceivedPacket (i, 1);
921 for (uint16_t i = startSeq2 + 9; i < startSeq2 + 16; i+=2)
923 blockAck.SetReceivedPacket (i, 1);
927 for (uint16_t i = startSeq2 + 24; i < startSeq2 + 32; i++)
929 blockAck.SetReceivedPacket (i, 1);
934 bool ackType3 =
false;
936 uint16_t startSeq3 = 2000;
938 blockAck.SetAid11 (aid3, 2);
939 blockAck.SetAckType (ackType3, 2);
940 blockAck.SetTidInfo (tid3, 2);
941 blockAck.SetStartingSequence (startSeq3, 2);
943 for (uint16_t i = startSeq3; i < startSeq3 + 8; i+=2)
945 blockAck.SetReceivedPacket (i, 2);
948 for (uint16_t i = startSeq3 + 9; i < startSeq3 + 16; i+=2)
950 blockAck.SetReceivedPacket (i, 2);
954 for (uint16_t i = startSeq3 + 24; i < startSeq3 + 32; i++)
956 blockAck.SetReceivedPacket (i, 2);
959 for (uint16_t i = startSeq3 + 32; i < startSeq3 + 36; i++)
961 blockAck.SetReceivedPacket (i, 2);
964 for (uint16_t i = startSeq3 + 44; i < startSeq3 + 48; i++)
966 blockAck.SetReceivedPacket (i, 2);
970 for (uint16_t i = startSeq3 + 56; i < startSeq3 + 64; i++)
972 blockAck.SetReceivedPacket (i, 2);
977 bool ackType4 =
false;
979 uint16_t startSeq4 = 3000;
981 blockAck.SetAid11 (aid4, 3);
982 blockAck.SetAckType (ackType4, 3);
983 blockAck.SetTidInfo (tid4, 3);
984 blockAck.SetStartingSequence (startSeq4, 3);
986 for (uint16_t i = startSeq4; i < startSeq4 + 8; i+=2)
988 blockAck.SetReceivedPacket (i, 3);
991 for (uint16_t i = startSeq4 + 9; i < startSeq4 + 16; i+=2)
993 blockAck.SetReceivedPacket (i, 3);
997 for (uint16_t i = startSeq4 + 24; i < startSeq4 + 32; i++)
999 blockAck.SetReceivedPacket (i, 3);
1002 for (uint16_t i = startSeq4 + 32; i < startSeq4 + 36; i++)
1004 blockAck.SetReceivedPacket (i, 3);
1007 for (uint16_t i = startSeq4 + 44; i < startSeq4 + 48; i++)
1009 blockAck.SetReceivedPacket (i, 3);
1013 for (uint16_t i = startSeq4 + 56; i < startSeq4 + 64; i++)
1015 blockAck.SetReceivedPacket (i, 3);
1019 for (uint16_t i = startSeq4 + 72; i < startSeq4 + 80; i++)
1021 blockAck.SetReceivedPacket (i, 3);
1025 for (uint16_t i = startSeq4 + 88; i < startSeq4 + 96; i++)
1027 blockAck.SetReceivedPacket (i, 3);
1031 for (uint16_t i = startSeq4 + 104; i < startSeq4 + 112; i++)
1033 blockAck.SetReceivedPacket (i, 3);
1037 for (uint16_t i = startSeq4 + 120; i < startSeq4 + 128; i++)
1039 blockAck.SetReceivedPacket (i, 3);
1043 uint16_t aid5 = 500;
1044 bool ackType5 =
false;
1046 uint16_t startSeq5 = 4000;
1048 blockAck.SetAid11 (aid5, 4);
1049 blockAck.SetAckType (ackType5, 4);
1050 blockAck.SetTidInfo (tid5, 4);
1051 blockAck.SetStartingSequence (startSeq5, 4);
1053 for (uint16_t i = startSeq5; i < startSeq5 + 8; i+=2)
1055 blockAck.SetReceivedPacket (i, 4);
1058 for (uint16_t i = startSeq5 + 9; i < startSeq5 + 16; i+=2)
1060 blockAck.SetReceivedPacket (i, 4);
1064 for (uint16_t i = startSeq5 + 24; i < startSeq5 + 32; i++)
1066 blockAck.SetReceivedPacket (i, 4);
1069 for (uint16_t i = startSeq5 + 32; i < startSeq5 + 36; i++)
1071 blockAck.SetReceivedPacket (i, 4);
1074 for (uint16_t i = startSeq5 + 44; i < startSeq5 + 48; i++)
1076 blockAck.SetReceivedPacket (i, 4);
1080 for (uint16_t i = startSeq5 + 56; i < startSeq5 + 64; i++)
1082 blockAck.SetReceivedPacket (i, 4);
1086 for (uint16_t i = startSeq5 + 72; i < startSeq5 + 80; i++)
1088 blockAck.SetReceivedPacket (i, 4);
1092 for (uint16_t i = startSeq5 + 88; i < startSeq5 + 96; i++)
1094 blockAck.SetReceivedPacket (i, 4);
1098 for (uint16_t i = (startSeq5 + 104) % 4096; i < (startSeq5 + 112) % 4096; i++)
1100 blockAck.SetReceivedPacket (i, 4);
1104 for (uint16_t i = (startSeq5 + 120) % 4096; i < (startSeq5 + 128) % 4096; i++)
1106 blockAck.SetReceivedPacket (i, 4);
1110 for (uint16_t i = (startSeq5 + 136) % 4096; i < (startSeq5 + 144) % 4096; i++)
1112 blockAck.SetReceivedPacket (i, 4);
1116 for (uint16_t i = (startSeq5 + 152) % 4096; i < (startSeq5 + 160) % 4096; i++)
1118 blockAck.SetReceivedPacket (i, 4);
1122 for (uint16_t i = (startSeq5 + 168) % 4096; i < (startSeq5 + 176) % 4096; i++)
1124 blockAck.SetReceivedPacket (i, 4);
1128 for (uint16_t i = (startSeq5 + 184) % 4096; i < (startSeq5 + 192) % 4096; i++)
1130 blockAck.SetReceivedPacket (i, 4);
1134 for (uint16_t i = (startSeq5 + 200) % 4096; i < (startSeq5 + 208) % 4096; i++)
1136 blockAck.SetReceivedPacket (i, 4);
1140 for (uint16_t i = (startSeq5 + 216) % 4096; i < (startSeq5 + 224) % 4096; i++)
1142 blockAck.SetReceivedPacket (i, 4);
1146 for (uint16_t i = (startSeq5 + 232) % 4096; i < (startSeq5 + 240) % 4096; i++)
1148 blockAck.SetReceivedPacket (i, 4);
1152 for (uint16_t i = (startSeq5 + 248) % 4096; i < (startSeq5 + 256) % 4096; i++)
1154 blockAck.SetReceivedPacket (i, 4);
1158 uint16_t aid6 = 2045;
1159 bool ackType6 =
true;
1163 blockAck.SetAid11 (aid6, 5);
1164 blockAck.SetAckType (ackType6, 5);
1165 blockAck.SetTidInfo (tid6, 5);
1166 blockAck.SetUnassociatedStaAddress (address6, 5);
1199 auto& bitmap2 = blockAckCopy.
GetBitmap (1);
1200 NS_TEST_EXPECT_MSG_EQ (bitmap2.size (), 4,
"Different bitmap length for the second Per AID TID Info subfield");
1201 NS_TEST_EXPECT_MSG_EQ (bitmap2[0], 0x55,
"Error in the 1st byte of the bitmap for the second Per AID TID Info subfield");
1202 NS_TEST_EXPECT_MSG_EQ (bitmap2[1], 0xaa,
"Error in the 2nd byte of the bitmap for the second Per AID TID Info subfield");
1203 NS_TEST_EXPECT_MSG_EQ (bitmap2[2], 0x00,
"Error in the 3rd byte of the bitmap for the second Per AID TID Info subfield");
1204 NS_TEST_EXPECT_MSG_EQ (bitmap2[3], 0xff,
"Error in the 4th byte of the bitmap for the second Per AID TID Info subfield");
1212 auto& bitmap3 = blockAckCopy.
GetBitmap (2);
1213 NS_TEST_EXPECT_MSG_EQ (bitmap3.size (), 8,
"Different bitmap length for the third Per AID TID Info subfield");
1214 NS_TEST_EXPECT_MSG_EQ (bitmap3[0], 0x55,
"Error in the 1st byte of the bitmap for the third Per AID TID Info subfield");
1215 NS_TEST_EXPECT_MSG_EQ (bitmap3[1], 0xaa,
"Error in the 2nd byte of the bitmap for the third Per AID TID Info subfield");
1216 NS_TEST_EXPECT_MSG_EQ (bitmap3[2], 0x00,
"Error in the 3rd byte of the bitmap for the third Per AID TID Info subfield");
1217 NS_TEST_EXPECT_MSG_EQ (bitmap3[3], 0xff,
"Error in the 4th byte of the bitmap for the third Per AID TID Info subfield");
1218 NS_TEST_EXPECT_MSG_EQ (bitmap3[4], 0x0f,
"Error in the 5th byte of the bitmap for the third Per AID TID Info subfield");
1219 NS_TEST_EXPECT_MSG_EQ (bitmap3[5], 0xf0,
"Error in the 6th byte of the bitmap for the third Per AID TID Info subfield");
1220 NS_TEST_EXPECT_MSG_EQ (bitmap3[6], 0x00,
"Error in the 7th byte of the bitmap for the third Per AID TID Info subfield");
1221 NS_TEST_EXPECT_MSG_EQ (bitmap3[7], 0xff,
"Error in the 8th byte of the bitmap for the third Per AID TID Info subfield");
1229 auto& bitmap4 = blockAckCopy.
GetBitmap (3);
1230 NS_TEST_EXPECT_MSG_EQ (bitmap4.size (), 16,
"Different bitmap length for the fourth Per AID TID Info subfield");
1231 NS_TEST_EXPECT_MSG_EQ (bitmap4[0], 0x55,
"Error in the 1st byte of the bitmap for the fourth Per AID TID Info subfield");
1232 NS_TEST_EXPECT_MSG_EQ (bitmap4[1], 0xaa,
"Error in the 2nd byte of the bitmap for the fourth Per AID TID Info subfield");
1233 NS_TEST_EXPECT_MSG_EQ (bitmap4[2], 0x00,
"Error in the 3rd byte of the bitmap for the fourth Per AID TID Info subfield");
1234 NS_TEST_EXPECT_MSG_EQ (bitmap4[3], 0xff,
"Error in the 4th byte of the bitmap for the fourth Per AID TID Info subfield");
1235 NS_TEST_EXPECT_MSG_EQ (bitmap4[4], 0x0f,
"Error in the 5th byte of the bitmap for the fourth Per AID TID Info subfield");
1236 NS_TEST_EXPECT_MSG_EQ (bitmap4[5], 0xf0,
"Error in the 6th byte of the bitmap for the fourth Per AID TID Info subfield");
1237 NS_TEST_EXPECT_MSG_EQ (bitmap4[6], 0x00,
"Error in the 7th byte of the bitmap for the fourth Per AID TID Info subfield");
1238 NS_TEST_EXPECT_MSG_EQ (bitmap4[7], 0xff,
"Error in the 8th byte of the bitmap for the fourth Per AID TID Info subfield");
1239 NS_TEST_EXPECT_MSG_EQ (bitmap4[8], 0x00,
"Error in the 9th byte of the bitmap for the fourth Per AID TID Info subfield");
1240 NS_TEST_EXPECT_MSG_EQ (bitmap4[9], 0xff,
"Error in the 10th byte of the bitmap for the fourth Per AID TID Info subfield");
1241 NS_TEST_EXPECT_MSG_EQ (bitmap4[10], 0x00,
"Error in the 11th byte of the bitmap for the fourth Per AID TID Info subfield");
1242 NS_TEST_EXPECT_MSG_EQ (bitmap4[11], 0xff,
"Error in the 12th byte of the bitmap for the fourth Per AID TID Info subfield");
1243 NS_TEST_EXPECT_MSG_EQ (bitmap4[12], 0x00,
"Error in the 13th byte of the bitmap for the fourth Per AID TID Info subfield");
1244 NS_TEST_EXPECT_MSG_EQ (bitmap4[13], 0xff,
"Error in the 14th byte of the bitmap for the fourth Per AID TID Info subfield");
1245 NS_TEST_EXPECT_MSG_EQ (bitmap4[14], 0x00,
"Error in the 15th byte of the bitmap for the fourth Per AID TID Info subfield");
1246 NS_TEST_EXPECT_MSG_EQ (bitmap4[15], 0xff,
"Error in the 16th byte of the bitmap for the fourth Per AID TID Info subfield");
1254 auto& bitmap5 = blockAckCopy.
GetBitmap (4);
1255 NS_TEST_EXPECT_MSG_EQ (bitmap5.size (), 32,
"Different bitmap length for the fifth Per AID TID Info subfield");
1256 NS_TEST_EXPECT_MSG_EQ (bitmap5[0], 0x55,
"Error in the 1st byte of the bitmap for the fifth Per AID TID Info subfield");
1257 NS_TEST_EXPECT_MSG_EQ (bitmap5[1], 0xaa,
"Error in the 2nd byte of the bitmap for the fifth Per AID TID Info subfield");
1258 NS_TEST_EXPECT_MSG_EQ (bitmap5[2], 0x00,
"Error in the 3rd byte of the bitmap for the fifth Per AID TID Info subfield");
1259 NS_TEST_EXPECT_MSG_EQ (bitmap5[3], 0xff,
"Error in the 4th byte of the bitmap for the fifth Per AID TID Info subfield");
1260 NS_TEST_EXPECT_MSG_EQ (bitmap5[4], 0x0f,
"Error in the 5th byte of the bitmap for the fifth Per AID TID Info subfield");
1261 NS_TEST_EXPECT_MSG_EQ (bitmap5[5], 0xf0,
"Error in the 6th byte of the bitmap for the fifth Per AID TID Info subfield");
1262 NS_TEST_EXPECT_MSG_EQ (bitmap5[6], 0x00,
"Error in the 7th byte of the bitmap for the fifth Per AID TID Info subfield");
1263 NS_TEST_EXPECT_MSG_EQ (bitmap5[7], 0xff,
"Error in the 8th byte of the bitmap for the fifth Per AID TID Info subfield");
1264 NS_TEST_EXPECT_MSG_EQ (bitmap5[8], 0x00,
"Error in the 9th byte of the bitmap for the fifth Per AID TID Info subfield");
1265 NS_TEST_EXPECT_MSG_EQ (bitmap5[9], 0xff,
"Error in the 10th byte of the bitmap for the fifth Per AID TID Info subfield");
1266 NS_TEST_EXPECT_MSG_EQ (bitmap5[10], 0x00,
"Error in the 11th byte of the bitmap for the fifth Per AID TID Info subfield");
1267 NS_TEST_EXPECT_MSG_EQ (bitmap5[11], 0xff,
"Error in the 12th byte of the bitmap for the fifth Per AID TID Info subfield");
1268 NS_TEST_EXPECT_MSG_EQ (bitmap5[12], 0x00,
"Error in the 13th byte of the bitmap for the fifth Per AID TID Info subfield");
1269 NS_TEST_EXPECT_MSG_EQ (bitmap5[13], 0xff,
"Error in the 14th byte of the bitmap for the fifth Per AID TID Info subfield");
1270 NS_TEST_EXPECT_MSG_EQ (bitmap5[14], 0x00,
"Error in the 15th byte of the bitmap for the fifth Per AID TID Info subfield");
1271 NS_TEST_EXPECT_MSG_EQ (bitmap5[15], 0xff,
"Error in the 16th byte of the bitmap for the fifth Per AID TID Info subfield");
1272 NS_TEST_EXPECT_MSG_EQ (bitmap5[16], 0x00,
"Error in the 17th byte of the bitmap for the fifth Per AID TID Info subfield");
1273 NS_TEST_EXPECT_MSG_EQ (bitmap5[17], 0xff,
"Error in the 18th byte of the bitmap for the fifth Per AID TID Info subfield");
1274 NS_TEST_EXPECT_MSG_EQ (bitmap5[18], 0x00,
"Error in the 19th byte of the bitmap for the fifth Per AID TID Info subfield");
1275 NS_TEST_EXPECT_MSG_EQ (bitmap5[19], 0xff,
"Error in the 20th byte of the bitmap for the fifth Per AID TID Info subfield");
1276 NS_TEST_EXPECT_MSG_EQ (bitmap5[20], 0x00,
"Error in the 21th byte of the bitmap for the fifth Per AID TID Info subfield");
1277 NS_TEST_EXPECT_MSG_EQ (bitmap5[21], 0xff,
"Error in the 22th byte of the bitmap for the fifth Per AID TID Info subfield");
1278 NS_TEST_EXPECT_MSG_EQ (bitmap5[22], 0x00,
"Error in the 23th byte of the bitmap for the fifth Per AID TID Info subfield");
1279 NS_TEST_EXPECT_MSG_EQ (bitmap5[23], 0xff,
"Error in the 24th byte of the bitmap for the fifth Per AID TID Info subfield");
1280 NS_TEST_EXPECT_MSG_EQ (bitmap5[24], 0x00,
"Error in the 25th byte of the bitmap for the fifth Per AID TID Info subfield");
1281 NS_TEST_EXPECT_MSG_EQ (bitmap5[25], 0xff,
"Error in the 26th byte of the bitmap for the fifth Per AID TID Info subfield");
1282 NS_TEST_EXPECT_MSG_EQ (bitmap5[26], 0x00,
"Error in the 27th byte of the bitmap for the fifth Per AID TID Info subfield");
1283 NS_TEST_EXPECT_MSG_EQ (bitmap5[27], 0xff,
"Error in the 28th byte of the bitmap for the fifth Per AID TID Info subfield");
1284 NS_TEST_EXPECT_MSG_EQ (bitmap5[28], 0x00,
"Error in the 29th byte of the bitmap for the fifth Per AID TID Info subfield");
1285 NS_TEST_EXPECT_MSG_EQ (bitmap5[29], 0xff,
"Error in the 30th byte of the bitmap for the fifth Per AID TID Info subfield");
1286 NS_TEST_EXPECT_MSG_EQ (bitmap5[30], 0x00,
"Error in the 31th byte of the bitmap for the fifth Per AID TID Info subfield");
1287 NS_TEST_EXPECT_MSG_EQ (bitmap5[31], 0xff,
"Error in the 32th byte of the bitmap for the fifth Per AID TID Info subfield");
1365 void DoRun (
void)
override;
1403 if (duration >
m_max)
1410 :
TestCase (
"Test case for Block Ack Policy with aggregation disabled"),
1500 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1504 mac.SetType (
"ns3::StaWifiMac",
1515 mac.SetType (
"ns3::ApWifiMac",
1527 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1528 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
1529 mobility.SetPositionAllocator (positionAlloc);
1531 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1545 sta_device->
GetMac ()->GetAttribute (
"BE_Txop", ptr);
1551 ap_mac->GetAttribute (
"BE_Txop", ptr);
1562 packetSocket.
Install (wifiStaNode);
1571 client1->SetRemote (socket);
1573 client1->SetStartTime (
Seconds (1));
1574 client1->SetStopTime (
Seconds (3.0));
1584 client2->SetRemote (socket);
1586 client2->SetStartTime (
Seconds (1.5));
1587 client2->SetStopTime (
Seconds (3.0));
1590 server->SetLocal (socket);
1592 server->SetStartTime (
Seconds (0.0));
1593 server->SetStopTime (
Seconds (4.0));
1599 Simulator::Stop (
Seconds (5));
1602 Simulator::Destroy ();
static BlockAckTestSuite g_blockAckTestSuite
the test suite
Test for Block Ack Policy with aggregation disabled.
virtual ~BlockAckAggregationDisabledTest()
uint16_t m_nBa
received BlockAck frames
void DoRun(void) override
Implementation to actually run this TestCase.
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.
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
bool m_txop
true for non-null TXOP limit
Test for recipient reordering buffer operations.
void DoRun(void) override
Implementation to actually run this TestCase.
uint16_t m_ssn
the Starting Sequence Number used to initialize WinStartB
void ForwardUp(Ptr< WifiMacQueueItem > mpdu)
Keep track of MPDUs that are forwarded up.
BlockAckRecipientBufferTest(uint16_t ssn)
Constructor.
virtual ~BlockAckRecipientBufferTest()
std::list< Ptr< WifiMacQueueItem > > m_fwup
list of MPDUs that have been forwarded up
Test for the originator block ack window.
OriginatorBlockAckWindowTest()
void DoRun(void) override
Implementation to actually run this TestCase.
void DoRun(void) override
Implementation to actually run this TestCase.
virtual ~PacketBufferingCaseA()
std::list< uint16_t > m_expectedBuffer
expected test buffer
std::list< uint16_t > m_expectedBuffer
expected test buffer
void DoRun(void) override
Implementation to actually run this TestCase.
virtual ~PacketBufferingCaseB()
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(void) const
Get the window size.
uint16_t GetWinStart(void) const
Get the current winStart 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.
uint16_t GetWinEnd(void) const
Get the current winEnd value.
AttributeValue implementation for Boolean.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
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 InitTxWindow(void)
Initialize the originator's transmit window by setting its size and starting sequence number equal to...
void NotifyAckedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Record that the given MPDU has been acknowledged and advance the transmit window if possible.
void NotifyTransmittedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Advance the transmit window so as to include the transmitted MPDU, if the latter is not an old packet...
BlockAckWindow m_txWindow
originator's transmit window
uint16_t GetStartingSequence(void) const override
Return the starting sequence number of the transmit window, if a transmit window has been initialized...
void NotifyDiscardedMpdu(Ptr< const WifiMacQueueItem > mpdu)
Advance the transmit window beyond the MPDU that has been reported to be discarded.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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>.
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< WifiMacQueueItem > 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.
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.
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Ptr< WifiMac > GetMac(void) const
Address GetAddress(void) const override
uint32_t GetIfIndex(void) const override
manage and create wifi channel objects for the YANS model.
Make it easy to create and manage PHY objects for the YANS model.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
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.
@ WIFI_STANDARD_80211n_5GHZ
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
const uint16_t SEQNO_SPACE_SIZE
Size of the space of sequence numbers.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Keeps the maximum duration among all TXOPs.
void Trace(Time startTime, Time duration)
Callback for the TxopTrace trace.
Time m_max
max TXOP duration
The different BlockAck variants.
enum Variant m_variant
Block Ack variant.
std::vector< uint8_t > m_bitmapLen
Length (bytes) of included bitmaps.