OLD | NEW |
(Empty) | |
| 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II |
| 4 * 2016 University of Washington |
| 5 * |
| 6 * This program is free software; you can redistribute it and/or modify |
| 7 * it under the terms of the GNU General Public License version 2 as |
| 8 * published by the Free Software Foundation; |
| 9 * |
| 10 * This program is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 * GNU General Public License for more details. |
| 14 * |
| 15 * You should have received a copy of the GNU General Public License |
| 16 * along with this program; if not, write to the Free Software |
| 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 * |
| 19 * Authors: Stefano Avallone <stavallo@unina.it> |
| 20 * Tom Henderson <tomhend@u.washington.edu> |
| 21 */ |
| 22 |
| 23 #ifndef IPV6_PACKET_FILTER_H |
| 24 #define IPV6_PACKET_FILTER_H |
| 25 |
| 26 #include "ns3/object.h" |
| 27 #include "ns3/packet-filter.h" |
| 28 |
| 29 namespace ns3 { |
| 30 |
| 31 /** |
| 32 * \ingroup internet |
| 33 * |
| 34 * Ipv6PacketFilter is the abstract base class for filters defined for IPv6 pack
ets. |
| 35 */ |
| 36 class Ipv6PacketFilter: public PacketFilter { |
| 37 public: |
| 38 /** |
| 39 * \brief Get the type ID. |
| 40 * \return the object TypeId |
| 41 */ |
| 42 static TypeId GetTypeId (void); |
| 43 |
| 44 Ipv6PacketFilter (); |
| 45 virtual ~Ipv6PacketFilter (); |
| 46 |
| 47 private: |
| 48 virtual bool CheckProtocol (Ptr<QueueDiscItem> item) const; |
| 49 virtual int32_t DoClassify (Ptr<QueueDiscItem> item) const = 0; |
| 50 }; |
| 51 |
| 52 |
| 53 /** |
| 54 * \ingroup internet |
| 55 * |
| 56 * PfifoFastIpv6PacketFilter is the filter to be added to the PfifoFast |
| 57 * queue disc to simulate the behavior of the pfifo_fast Linux queue disc. |
| 58 *· |
| 59 * Packets are classified based on the DSCP. The following values are |
| 60 * recommended for Linux in a patch to the netdev mailing list from |
| 61 * Jesper Dangaard Brouer <brouer@redhat.com> on 15 Sept 2014. |
| 62 * CS* values I made up myself. |
| 63 * |
| 64 * DSCP | Hex | Means | Linux Priority | Band |
| 65 * -----|------|----------------------------|----------------|----- |
| 66 * EF | 0x2E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
| 67 * AF11 | 0x0A | TC_PRIO_BULK=2 | 2 Bulk | 2 |
| 68 * AF21 | 0x12 | TC_PRIO_BULK=2 | 2 Bulk | 2 |
| 69 * AF31 | 0x1A | TC_PRIO_BULK=2 | 2 Bulk | 2 |
| 70 * AF41 | 0x22 | TC_PRIO_BULK=2 | 2 Bulk | 2 |
| 71 * AF12 | 0x0C | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
| 72 * AF22 | 0x14 | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
| 73 * AF32 | 0x1C | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
| 74 * AF42 | 0x34 | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
| 75 * AF13 | 0x0E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
| 76 * AF23 | 0x16 | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
| 77 * AF33 | 0x1E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
| 78 * AF43 | 0x26 | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
| 79 * CS0 | 0x00 | TC_PRIO_BESTEFFORT | 0 Best Effort | 1 |
| 80 * CS1 | 0x20 | TC_PRIO_FILLER | 1 Filler | 2 |
| 81 * CS2 | 0x40 | TC_PRIO_BULK | 2 Bulk | 1 |
| 82 * CS3 | 0x60 | TC_PRIO_INTERACTIVE_BULK | 4 Int. Bulk | 1 |
| 83 * CS4 | 0x80 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
| 84 * CS5 | 0xA0 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
| 85 * CS6 | 0xC0 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
| 86 * CS7 | 0xE0 | TC_PRIO_CONTROL | 8 Control | 0 |
| 87 * |
| 88 */ |
| 89 class PfifoFastIpv6PacketFilter: public Ipv6PacketFilter { |
| 90 public: |
| 91 /** |
| 92 * \brief Get the type ID. |
| 93 * \return the object TypeId |
| 94 */ |
| 95 static TypeId GetTypeId (void); |
| 96 |
| 97 PfifoFastIpv6PacketFilter (); |
| 98 virtual ~PfifoFastIpv6PacketFilter (); |
| 99 |
| 100 private: |
| 101 virtual int32_t DoClassify (Ptr<QueueDiscItem> item) const; |
| 102 uint32_t DscpToBand (Ipv6Header::DscpType dscpType) const; |
| 103 }; |
| 104 |
| 105 } // namespace ns3 |
| 106 |
| 107 #endif /* IPV6_PACKET_FILTER */ |
OLD | NEW |