A Discrete-Event Network Simulator
API
test-epc-tft-classifier.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2018 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Nicola Baldo <nbaldo@cttc.es>
18 * Manuel Requena <manuel.requena@cttc.es>
19 */
20
21#include "ns3/epc-tft-classifier.h"
22#include "ns3/ipv4-header.h"
23#include "ns3/ipv4-l3-protocol.h"
24#include "ns3/ipv6-header.h"
25#include "ns3/ipv6-l3-protocol.h"
26#include "ns3/log.h"
27#include "ns3/packet.h"
28#include "ns3/tcp-header.h"
29#include "ns3/tcp-l4-protocol.h"
30#include "ns3/test.h"
31#include "ns3/udp-header.h"
32#include "ns3/udp-l4-protocol.h"
33
34#include <iomanip>
35
36using namespace ns3;
37
38NS_LOG_COMPONENT_DEFINE("TestEpcTftClassifier");
39
50{
51 public:
68 std::string sa,
69 std::string da,
70 uint16_t sp,
71 uint16_t dp,
72 uint8_t tos,
73 uint32_t tftId,
74 bool useIpv6);
75
77
78 private:
81 uint8_t m_tftId;
82 bool m_useIpv6;
87
102 static std::string BuildNameString(Ptr<EpcTftClassifier> c,
104 std::string sa,
105 std::string da,
106 uint16_t sp,
107 uint16_t dp,
108 uint8_t tos,
109 uint32_t tftId,
110 bool useIpv6);
111
112 void DoRun() override;
113};
114
117 std::string sa,
118 std::string da,
119 uint16_t sp,
120 uint16_t dp,
121 uint8_t tos,
122 uint32_t tftId,
123 bool useIpv6)
124 : TestCase(BuildNameString(c, d, sa, da, sp, dp, tos, tftId, useIpv6)),
125 m_c(c),
126 m_d(d),
127 m_tftId(tftId),
128 m_useIpv6(useIpv6)
129{
130 NS_LOG_FUNCTION(this << c << d << sa << da << sp << dp << tos << tftId << useIpv6);
131
132 if (m_useIpv6)
133 {
134 m_ipv6Header.SetSource(Ipv6Address::MakeIpv4MappedAddress(Ipv4Address(sa.c_str())));
135 m_ipv6Header.SetDestination(Ipv6Address::MakeIpv4MappedAddress(Ipv4Address(da.c_str())));
137 m_ipv6Header.SetPayloadLength(8); // Full UDP header
138 m_ipv6Header.SetNextHeader(UdpL4Protocol::PROT_NUMBER);
139 }
140 else
141 {
142 m_ipHeader.SetSource(Ipv4Address(sa.c_str()));
144 m_ipHeader.SetTos(tos);
145 m_ipHeader.SetPayloadSize(8); // Full UDP header
146 m_ipHeader.SetProtocol(UdpL4Protocol::PROT_NUMBER);
147 }
148
151}
152
154{
155}
156
157std::string
160 std::string sa,
161 std::string da,
162 uint16_t sp,
163 uint16_t dp,
164 uint8_t tos,
165 uint32_t tftId,
166 bool useIpv6)
167{
168 std::ostringstream oss;
169 oss << c << " d = " << d;
170 if (useIpv6)
171 {
172 oss << ", sa = " << Ipv6Address::MakeIpv4MappedAddress(Ipv4Address(sa.c_str()))
173 << ", da = " << Ipv6Address::MakeIpv4MappedAddress(Ipv4Address(da.c_str()));
174 }
175 else
176 {
177 oss << ", sa = " << sa << ", da = " << da;
178 }
179 oss << ", sp = " << sp << ", dp = " << dp << ", tos = 0x" << std::hex << (int)tos
180 << " --> tftId = " << tftId;
181 return oss.str();
182}
183
184void
186{
188
189 Ptr<Packet> udpPacket = Create<Packet>();
190 udpPacket->AddHeader(m_udpHeader);
191 if (m_useIpv6)
192 {
193 udpPacket->AddHeader(m_ipv6Header);
194 }
195 else
196 {
197 udpPacket->AddHeader(m_ipHeader);
198 }
199 NS_LOG_LOGIC(this << *udpPacket);
200 uint32_t obtainedTftId =
201 m_c->Classify(udpPacket,
202 m_d,
203 m_useIpv6 ? Ipv6L3Protocol::PROT_NUMBER : Ipv4L3Protocol::PROT_NUMBER);
204 NS_TEST_ASSERT_MSG_EQ(obtainedTftId, (uint16_t)m_tftId, "bad classification of UDP packet");
205}
206
214{
215 public:
217};
218
220
222 : TestSuite("eps-tft-classifier", UNIT)
223{
224 NS_LOG_FUNCTION(this);
225
227 // Same testcases using IPv4 and IPv6 addresses
228 // IPv6 addresses are IPv4 mapped addresses, i.e. 1.2.3.4 -> 0::ffff:1.2.3.4
229 // Currently, we use the format '0::ffff:0102:0304' because
230 // the format '0::ffff:1.2.3.4' is not supported by the Ipv6Address class
232
233 for (bool useIpv6 : {false, true})
234 {
236 // check some TFT matches
238
239 Ptr<EpcTftClassifier> c1 = Create<EpcTftClassifier>();
240
241 Ptr<EpcTft> tft1_1 = Create<EpcTft>();
242
243 EpcTft::PacketFilter pf1_1_1;
244 if (useIpv6)
245 {
246 pf1_1_1.remoteIpv6Address.Set("0::ffff:0100:0000");
247 pf1_1_1.remoteIpv6Prefix = Ipv6Prefix(96 + 8);
248 pf1_1_1.localIpv6Address.Set("0::ffff:0200:0000");
249 pf1_1_1.localIpv6Prefix = Ipv6Prefix(96 + 8);
250 }
251 else
252 {
253 pf1_1_1.remoteAddress.Set("1.0.0.0");
254 pf1_1_1.remoteMask.Set(0xff000000);
255 pf1_1_1.localAddress.Set("2.0.0.0");
256 pf1_1_1.localMask.Set(0xff000000);
257 }
258 tft1_1->Add(pf1_1_1);
259
260 EpcTft::PacketFilter pf1_1_2;
261 if (useIpv6)
262 {
263 pf1_1_2.remoteIpv6Address.Set("0::ffff:0303:0300");
264 pf1_1_2.remoteIpv6Prefix = Ipv6Prefix(96 + 24);
265 pf1_1_2.localIpv6Address.Set("0::ffff:0404:0400");
266 pf1_1_2.localIpv6Prefix = Ipv6Prefix(96 + 24);
267 }
268 else
269 {
270 pf1_1_2.remoteAddress.Set("3.3.3.0");
271 pf1_1_2.remoteMask.Set(0xffffff00);
272 pf1_1_2.localAddress.Set("4.4.4.0");
273 pf1_1_2.localMask.Set(0xffffff00);
274 }
275 tft1_1->Add(pf1_1_2);
276
277 c1->Add(tft1_1, 1);
278
279 Ptr<EpcTft> tft1_2 = Create<EpcTft>();
280
281 EpcTft::PacketFilter pf1_2_1;
282 pf1_2_1.remotePortStart = 1024;
283 pf1_2_1.remotePortEnd = 1035;
284 tft1_2->Add(pf1_2_1);
285
286 EpcTft::PacketFilter pf1_2_2;
287 pf1_2_2.localPortStart = 3456;
288 pf1_2_2.localPortEnd = 3489;
289 tft1_2->Add(pf1_2_2);
290
291 EpcTft::PacketFilter pf1_2_3;
292 pf1_2_3.localPortStart = 7895;
293 pf1_2_3.localPortEnd = 7895;
294 tft1_2->Add(pf1_2_3);
295
296 EpcTft::PacketFilter pf1_2_4;
297 pf1_2_4.remotePortStart = 5897;
298 pf1_2_4.remotePortEnd = 5897;
299 tft1_2->Add(pf1_2_4);
300
301 c1->Add(tft1_2, 2);
302
303 // --------------------------------classifier----direction-------src_addr---dst_addr--src_port--dst_port--ToS--TFT_id
304
305 // test IP addresses
307 EpcTft::UPLINK,
308 "2.2.3.4",
309 "1.1.1.1",
310 4,
311 1234,
312 0,
313 1,
314 useIpv6),
315 TestCase::QUICK);
317 EpcTft::UPLINK,
318 "2.2.3.4",
319 "1.0.0.0",
320 2,
321 123,
322 5,
323 1,
324 useIpv6),
325 TestCase::QUICK);
327 EpcTft::UPLINK,
328 "6.2.3.4",
329 "1.1.1.1",
330 4,
331 1234,
332 0,
333 0,
334 useIpv6),
335 TestCase::QUICK);
337 EpcTft::DOWNLINK,
338 "3.3.3.4",
339 "4.4.4.1",
340 4,
341 1234,
342 0,
343 1,
344 useIpv6),
345 TestCase::QUICK);
347 EpcTft::DOWNLINK,
348 "3.3.4.4",
349 "4.4.4.1",
350 4,
351 1234,
352 0,
353 0,
354 useIpv6),
355 TestCase::QUICK);
357 EpcTft::UPLINK,
358 "3.3.3.4",
359 "4.4.2.1",
360 4,
361 1234,
362 0,
363 0,
364 useIpv6),
365 TestCase::QUICK);
366
367 // test remote port
369 EpcTft::UPLINK,
370 "9.1.1.1",
371 "8.1.1.1",
372 4,
373 1024,
374 0,
375 2,
376 useIpv6),
377 TestCase::QUICK);
379 EpcTft::UPLINK,
380 "9.1.1.1",
381 "8.1.1.1",
382 4,
383 1025,
384 0,
385 2,
386 useIpv6),
387 TestCase::QUICK);
389 EpcTft::UPLINK,
390 "9.1.1.1",
391 "8.1.1.1",
392 4,
393 1035,
394 0,
395 2,
396 useIpv6),
397 TestCase::QUICK);
399 EpcTft::UPLINK,
400 "9.1.1.1",
401 "8.1.1.1",
402 4,
403 1234,
404 0,
405 0,
406 useIpv6),
407 TestCase::QUICK);
409 EpcTft::DOWNLINK,
410 "9.1.1.1",
411 "8.1.1.1",
412 4,
413 1024,
414 0,
415 0,
416 useIpv6),
417 TestCase::QUICK);
419 EpcTft::DOWNLINK,
420 "9.1.1.1",
421 "8.1.1.1",
422 4,
423 1025,
424 0,
425 0,
426 useIpv6),
427 TestCase::QUICK);
429 EpcTft::DOWNLINK,
430 "9.1.1.1",
431 "8.1.1.1",
432 4,
433 1035,
434 0,
435 0,
436 useIpv6),
437 TestCase::QUICK);
438
439 // test local port
441 EpcTft::UPLINK,
442 "9.1.1.1",
443 "8.1.1.1",
444 4,
445 3456,
446 0,
447 0,
448 useIpv6),
449 TestCase::QUICK);
451 EpcTft::UPLINK,
452 "9.1.1.1",
453 "8.1.1.1",
454 4,
455 3457,
456 0,
457 0,
458 useIpv6),
459 TestCase::QUICK);
461 EpcTft::UPLINK,
462 "9.1.1.1",
463 "8.1.1.1",
464 4,
465 3489,
466 0,
467 0,
468 useIpv6),
469 TestCase::QUICK);
471 EpcTft::UPLINK,
472 "9.1.1.1",
473 "8.1.1.1",
474 3456,
475 6,
476 0,
477 2,
478 useIpv6),
479 TestCase::QUICK);
481 EpcTft::DOWNLINK,
482 "9.1.1.1",
483 "8.1.1.1",
484 3461,
485 3461,
486 0,
487 2,
488 useIpv6),
489 TestCase::QUICK);
491 EpcTft::DOWNLINK,
492 "9.1.1.1",
493 "8.1.1.1",
494 9,
495 3489,
496 0,
497 2,
498 useIpv6),
499 TestCase::QUICK);
501 EpcTft::DOWNLINK,
502 "9.1.1.1",
503 "8.1.1.1",
504 9,
505 7895,
506 0,
507 2,
508 useIpv6),
509 TestCase::QUICK);
511 EpcTft::UPLINK,
512 "9.1.1.1",
513 "8.1.1.1",
514 7895,
515 10,
516 0,
517 2,
518 useIpv6),
519 TestCase::QUICK);
521 EpcTft::UPLINK,
522 "9.1.1.1",
523 "8.1.1.1",
524 9,
525 5897,
526 0,
527 2,
528 useIpv6),
529 TestCase::QUICK);
531 EpcTft::DOWNLINK,
532 "9.1.1.1",
533 "8.1.1.1",
534 5897,
535 10,
536 0,
537 2,
538 useIpv6),
539 TestCase::QUICK);
540
542 // check default TFT
544
545 Ptr<EpcTftClassifier> c2 = Create<EpcTftClassifier>();
546 c2->Add(EpcTft::Default(), 1);
547
548 // --------------------------------classifier---direction--------src_addr---dst_addr--src_port--dst_port--ToS--TFT
549 // id
550
551 // test IP addresses
553 EpcTft::UPLINK,
554 "2.2.3.4",
555 "1.1.1.1",
556 4,
557 1234,
558 0,
559 1,
560 useIpv6),
561 TestCase::QUICK);
563 EpcTft::UPLINK,
564 "2.2.3.4",
565 "1.0.0.0",
566 2,
567 123,
568 5,
569 1,
570 useIpv6),
571 TestCase::QUICK);
573 EpcTft::UPLINK,
574 "6.2.3.4",
575 "1.1.1.1",
576 4,
577 1234,
578 0,
579 1,
580 useIpv6),
581 TestCase::QUICK);
583 EpcTft::DOWNLINK,
584 "3.3.3.4",
585 "4.4.4.1",
586 4,
587 1234,
588 0,
589 1,
590 useIpv6),
591 TestCase::QUICK);
593 EpcTft::DOWNLINK,
594 "3.3.4.4",
595 "4.4.4.1",
596 4,
597 1234,
598 0,
599 1,
600 useIpv6),
601 TestCase::QUICK);
603 EpcTft::UPLINK,
604 "3.3.3.4",
605 "4.4.2.1",
606 4,
607 1234,
608 0,
609 1,
610 useIpv6),
611 TestCase::QUICK);
612
613 // test remote port
615 EpcTft::UPLINK,
616 "9.1.1.1",
617 "8.1.1.1",
618 4,
619 1024,
620 0,
621 1,
622 useIpv6),
623 TestCase::QUICK);
625 EpcTft::UPLINK,
626 "9.1.1.1",
627 "8.1.1.1",
628 4,
629 1025,
630 0,
631 1,
632 useIpv6),
633 TestCase::QUICK);
635 EpcTft::UPLINK,
636 "9.1.1.1",
637 "8.1.1.1",
638 4,
639 1035,
640 0,
641 1,
642 useIpv6),
643 TestCase::QUICK);
645 EpcTft::UPLINK,
646 "9.1.1.1",
647 "8.1.1.1",
648 4,
649 1234,
650 0,
651 1,
652 useIpv6),
653 TestCase::QUICK);
655 EpcTft::DOWNLINK,
656 "9.1.1.1",
657 "8.1.1.1",
658 4,
659 1024,
660 0,
661 1,
662 useIpv6),
663 TestCase::QUICK);
665 EpcTft::DOWNLINK,
666 "9.1.1.1",
667 "8.1.1.1",
668 4,
669 1025,
670 0,
671 1,
672 useIpv6),
673 TestCase::QUICK);
675 EpcTft::DOWNLINK,
676 "9.1.1.1",
677 "8.1.1.1",
678 4,
679 1035,
680 0,
681 1,
682 useIpv6),
683 TestCase::QUICK);
684
685 // test local port
687 EpcTft::UPLINK,
688 "9.1.1.1",
689 "8.1.1.1",
690 4,
691 3456,
692 0,
693 1,
694 useIpv6),
695 TestCase::QUICK);
697 EpcTft::UPLINK,
698 "9.1.1.1",
699 "8.1.1.1",
700 4,
701 3457,
702 0,
703 1,
704 useIpv6),
705 TestCase::QUICK);
707 EpcTft::UPLINK,
708 "9.1.1.1",
709 "8.1.1.1",
710 4,
711 3489,
712 0,
713 1,
714 useIpv6),
715 TestCase::QUICK);
717 EpcTft::UPLINK,
718 "9.1.1.1",
719 "8.1.1.1",
720 3456,
721 6,
722 0,
723 1,
724 useIpv6),
725 TestCase::QUICK);
727 EpcTft::DOWNLINK,
728 "9.1.1.1",
729 "8.1.1.1",
730 3461,
731 3461,
732 0,
733 1,
734 useIpv6),
735 TestCase::QUICK);
737 EpcTft::DOWNLINK,
738 "9.1.1.1",
739 "8.1.1.1",
740 9,
741 3489,
742 0,
743 1,
744 useIpv6),
745 TestCase::QUICK);
746
748 // check default TFT plus dedicated ones
750
751 Ptr<EpcTftClassifier> c3 = Create<EpcTftClassifier>();
752 c3->Add(EpcTft::Default(), 1);
753 c3->Add(tft1_1, 2);
754 c3->Add(tft1_2, 3);
755
756 // --------------------------------classifier---direction--------src_addr---dst_addr---src_port--dst_port--ToS--TFT_id
757
758 // test IP addresses
760 EpcTft::UPLINK,
761 "2.2.3.4",
762 "1.1.1.1",
763 4,
764 1234,
765 0,
766 2,
767 useIpv6),
768 TestCase::QUICK);
770 EpcTft::UPLINK,
771 "2.2.3.4",
772 "1.0.0.0",
773 2,
774 123,
775 5,
776 2,
777 useIpv6),
778 TestCase::QUICK);
780 EpcTft::UPLINK,
781 "6.2.3.4",
782 "1.1.1.1",
783 4,
784 1234,
785 0,
786 1,
787 useIpv6),
788 TestCase::QUICK);
790 EpcTft::DOWNLINK,
791 "3.3.3.4",
792 "4.4.4.1",
793 4,
794 1234,
795 0,
796 2,
797 useIpv6),
798 TestCase::QUICK);
800 EpcTft::DOWNLINK,
801 "3.3.4.4",
802 "4.4.4.1",
803 4,
804 1234,
805 0,
806 1,
807 useIpv6),
808 TestCase::QUICK);
810 EpcTft::UPLINK,
811 "3.3.3.4",
812 "4.4.2.1",
813 4,
814 1234,
815 0,
816 1,
817 useIpv6),
818 TestCase::QUICK);
819
820 // test remote port
822 EpcTft::UPLINK,
823 "9.1.1.1",
824 "8.1.1.1",
825 4,
826 1024,
827 0,
828 3,
829 useIpv6),
830 TestCase::QUICK);
832 EpcTft::UPLINK,
833 "9.1.1.1",
834 "8.1.1.1",
835 4,
836 1025,
837 0,
838 3,
839 useIpv6),
840 TestCase::QUICK);
842 EpcTft::UPLINK,
843 "9.1.1.1",
844 "8.1.1.1",
845 4,
846 1035,
847 0,
848 3,
849 useIpv6),
850 TestCase::QUICK);
852 EpcTft::UPLINK,
853 "9.1.1.1",
854 "8.1.1.1",
855 4,
856 1234,
857 0,
858 1,
859 useIpv6),
860 TestCase::QUICK);
862 EpcTft::DOWNLINK,
863 "9.1.1.1",
864 "8.1.1.1",
865 4,
866 1024,
867 0,
868 1,
869 useIpv6),
870 TestCase::QUICK);
872 EpcTft::DOWNLINK,
873 "9.1.1.1",
874 "8.1.1.1",
875 4,
876 1025,
877 0,
878 1,
879 useIpv6),
880 TestCase::QUICK);
882 EpcTft::DOWNLINK,
883 "9.1.1.1",
884 "8.1.1.1",
885 4,
886 1035,
887 0,
888 1,
889 useIpv6),
890 TestCase::QUICK);
891
892 // test local port
894 EpcTft::UPLINK,
895 "9.1.1.1",
896 "8.1.1.1",
897 4,
898 3456,
899 0,
900 1,
901 useIpv6),
902 TestCase::QUICK);
904 EpcTft::UPLINK,
905 "9.1.1.1",
906 "8.1.1.1",
907 4,
908 3457,
909 0,
910 1,
911 useIpv6),
912 TestCase::QUICK);
914 EpcTft::UPLINK,
915 "9.1.1.1",
916 "8.1.1.1",
917 4,
918 3489,
919 0,
920 1,
921 useIpv6),
922 TestCase::QUICK);
924 EpcTft::UPLINK,
925 "9.1.1.1",
926 "8.1.1.1",
927 3456,
928 6,
929 0,
930 3,
931 useIpv6),
932 TestCase::QUICK);
934 EpcTft::DOWNLINK,
935 "9.1.1.1",
936 "8.1.1.1",
937 3461,
938 3461,
939 0,
940 3,
941 useIpv6),
942 TestCase::QUICK);
944 EpcTft::DOWNLINK,
945 "9.1.1.1",
946 "8.1.1.1",
947 9,
948 3489,
949 0,
950 3,
951 useIpv6),
952 TestCase::QUICK);
953
955 // check two TFTs with different ports
957
958 Ptr<EpcTftClassifier> c4 = Create<EpcTftClassifier>();
959 Ptr<EpcTft> tft4_1 = Create<EpcTft>();
960 tft4_1->Add(pf1_2_3);
961 c4->Add(tft4_1, 1);
962 Ptr<EpcTft> tft4_2 = Create<EpcTft>();
963 tft4_2->Add(pf1_2_4);
964 c4->Add(tft4_2, 2);
966 EpcTft::DOWNLINK,
967 "9.1.1.1",
968 "8.1.1.1",
969 9,
970 3489,
971 0,
972 0,
973 useIpv6),
974 TestCase::QUICK);
976 EpcTft::DOWNLINK,
977 "9.1.1.1",
978 "8.1.1.1",
979 9,
980 7895,
981 0,
982 1,
983 useIpv6),
984 TestCase::QUICK);
986 EpcTft::UPLINK,
987 "9.1.1.1",
988 "8.1.1.1",
989 7895,
990 10,
991 0,
992 1,
993 useIpv6),
994 TestCase::QUICK);
996 EpcTft::UPLINK,
997 "9.1.1.1",
998 "8.1.1.1",
999 9,
1000 5897,
1001 0,
1002 2,
1003 useIpv6),
1004 TestCase::QUICK);
1006 EpcTft::DOWNLINK,
1007 "9.1.1.1",
1008 "8.1.1.1",
1009 5897,
1010 10,
1011 0,
1012 2,
1013 useIpv6),
1014 TestCase::QUICK);
1015 }
1016}
Test case to check the functionality of the Tft Classifier.
Ipv4Header m_ipHeader
the IPv4 header
TcpHeader m_tcpHeader
the TCP header
Ptr< EpcTftClassifier > m_c
the EPC TFT classifier
static std::string BuildNameString(Ptr< EpcTftClassifier > c, EpcTft::Direction d, std::string sa, std::string da, uint16_t sp, uint16_t dp, uint8_t tos, uint32_t tftId, bool useIpv6)
Build name string.
bool m_useIpv6
use IPv4 or IPv6 header/addresses
EpcTftClassifierTestCase(Ptr< EpcTftClassifier > c, EpcTft::Direction d, std::string sa, std::string da, uint16_t sp, uint16_t dp, uint8_t tos, uint32_t tftId, bool useIpv6)
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
UdpHeader m_udpHeader
the UDP header
EpcTft::Direction m_d
the EPC TFT direction
Ipv6Header m_ipv6Header
the IPv6 header
Epc Tft Classifier Test Suite.
uint32_t Classify(Ptr< Packet > p, EpcTft::Direction direction, uint16_t protocolNumber)
classify an IP packet
void Add(Ptr< EpcTft > tft, uint32_t id)
add a TFT to the Classifier
Direction
Indicates the direction of the traffic that is to be classified.
Definition: epc-tft.h:51
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:43
void Set(uint32_t address)
input address is in host order.
Packet header for IPv4.
Definition: ipv4-header.h:34
void SetDestination(Ipv4Address destination)
Definition: ipv4-header.cc:309
void SetPayloadSize(uint16_t size)
Definition: ipv4-header.cc:57
void SetProtocol(uint8_t num)
Definition: ipv4-header.cc:288
void SetTos(uint8_t tos)
Definition: ipv4-header.cc:85
void SetSource(Ipv4Address source)
Definition: ipv4-header.cc:295
void Set(uint32_t mask)
input mask is in host order.
void Set(const char *address)
Sets an Ipv6Address by parsing the input C-string.
Packet header for IPv6.
Definition: ipv6-header.h:36
void SetDestination(Ipv6Address dst)
Set the "Destination address" field.
Definition: ipv6-header.cc:130
void SetSource(Ipv6Address src)
Set the "Source address" field.
Definition: ipv6-header.cc:106
void SetPayloadLength(uint16_t len)
Set the "Payload length" field.
Definition: ipv6-header.cc:70
void SetTrafficClass(uint8_t traffic)
Set the "Traffic class" field.
Definition: ipv6-header.cc:46
void SetNextHeader(uint8_t next)
Set the "Next header" field.
Definition: ipv6-header.cc:82
Describes an IPv6 prefix.
Definition: ipv6-address.h:456
void AddHeader(const Header &header)
Add header to this packet.
Definition: packet.cc:268
static void Enable()
Enable the packet metadata.
Header for the Transmission Control Protocol.
Definition: tcp-header.h:46
encapsulates test code
Definition: test.h:1060
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:305
A suite of tests to run.
Definition: test.h:1256
Packet header for UDP packets.
Definition: udp-header.h:41
void SetSourcePort(uint16_t port)
Definition: udp-header.cc:63
void SetDestinationPort(uint16_t port)
Definition: udp-header.cc:57
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:282
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.
Definition: test.h:144
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:71
Ipv4Address localAddress
IPv4 address of the UE.
Definition: epc-tft.h:121
Ipv6Prefix localIpv6Prefix
IPv6 address prefix of the UE.
Definition: epc-tft.h:127
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:132
Ipv4Mask localMask
IPv4 address mask of the UE.
Definition: epc-tft.h:122
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:130
Ipv6Address remoteIpv6Address
IPv6 address of the remote host.
Definition: epc-tft.h:124
Ipv4Mask remoteMask
IPv4 address mask of the remote host.
Definition: epc-tft.h:120
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:129
Ipv6Address localIpv6Address
IPv6 address of the UE.
Definition: epc-tft.h:126
Ipv4Address remoteAddress
IPv4 address of the remote host.
Definition: epc-tft.h:119
Ipv6Prefix remoteIpv6Prefix
IPv6 address prefix of the remote host.
Definition: epc-tft.h:125
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:131
static EpcTftClassifierTestSuite g_lteTftClassifierTestSuite