A Discrete-Event Network Simulator
API
ipv6-fragmentation-test.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Universita' di Firenze, Italy
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  */
26 #include "ns3/test.h"
27 #include "ns3/config.h"
28 #include "ns3/uinteger.h"
29 #include "ns3/socket-factory.h"
30 #include "ns3/ipv4-raw-socket-factory.h"
31 #include "ns3/ipv6-raw-socket-factory.h"
32 #include "ns3/udp-socket-factory.h"
33 #include "ns3/simulator.h"
34 #include "error-channel.h"
35 #include "ns3/simple-net-device.h"
36 #include "ns3/drop-tail-queue.h"
37 #include "ns3/socket.h"
38 #include "ns3/udp-socket.h"
39 
40 #include "ns3/log.h"
41 #include "ns3/node.h"
42 #include "ns3/inet-socket-address.h"
43 #include "ns3/boolean.h"
44 
45 #include "ns3/ipv6-static-routing.h"
46 #include "ns3/ipv6-list-routing.h"
47 #include "ns3/inet6-socket-address.h"
48 #
49 #include "ns3/arp-l3-protocol.h"
50 #include "ns3/ipv4-l3-protocol.h"
51 #include "ns3/icmpv4-l4-protocol.h"
52 #include "ns3/ipv4-list-routing.h"
53 #include "ns3/ipv4-static-routing.h"
54 #include "ns3/udp-l4-protocol.h"
55 
56 #include "ns3/ipv6-l3-protocol.h"
57 #include "ns3/icmpv6-l4-protocol.h"
58 #include "ns3/traffic-control-layer.h"
59 
60 #include <string>
61 #include <limits>
62 #include <netinet/in.h>
63 
64 using namespace ns3;
65 
66 class UdpSocketImpl;
67 
68 /* ----------------------------------------------------------------------------------
69  * Tag
70  --------------------------------------------------------------------------------- */
71 class IPv6TestTag : public Tag {
72 private:
73  uint64_t token;
74 public:
75  static TypeId GetTypeId () {
76  static TypeId tid = TypeId ("ns3::IPv6TestTag").SetParent<Tag> ().AddConstructor<IPv6TestTag> ();
77  return tid;
78  }
79  virtual TypeId GetInstanceTypeId () const { return GetTypeId (); }
80  virtual uint32_t GetSerializedSize () const { return sizeof (token); }
81  virtual void Serialize (TagBuffer buffer) const { buffer.WriteU64 (token); }
82  virtual void Deserialize (TagBuffer buffer) { token = buffer.ReadU64 (); }
83  virtual void Print (std::ostream &os) const { os << "token=" << token; }
84  void setToken (uint64_t token) { this->token = token; }
85  uint64_t getToken () { return token; }
86 };
87 
88 static void
90 {
91  //IPV6
92  Ptr<Ipv6L3Protocol> ipv6 = CreateObject<Ipv6L3Protocol> ();
93 
94  //Routing for Ipv6
95  Ptr<Ipv6ListRouting> ipv6Routing = CreateObject<Ipv6ListRouting> ();
96  ipv6->SetRoutingProtocol (ipv6Routing);
97  Ptr<Ipv6StaticRouting> ipv6staticRouting = CreateObject<Ipv6StaticRouting> ();
98  ipv6Routing->AddRoutingProtocol (ipv6staticRouting, 0);
99  node->AggregateObject (ipv6);
100 
101  //ICMPv6
102  Ptr<Icmpv6L4Protocol> icmp6 = CreateObject<Icmpv6L4Protocol> ();
103  node->AggregateObject (icmp6);
104 
105  //Ipv6 Extensions
106  ipv6->RegisterExtensions ();
107  ipv6->RegisterOptions ();
108 
109  //UDP
110  Ptr<UdpL4Protocol> udp = CreateObject<UdpL4Protocol> ();
111  node->AggregateObject (udp);
112 
113  // Traffic Control
114  Ptr<TrafficControlLayer> tc = CreateObject<TrafficControlLayer> ();
115  node->AggregateObject (tc);
116 }
117 
118 
120 {
124 
125 
128  uint32_t m_dataSize;
129  uint8_t *m_data;
130  uint32_t m_size;
131  uint8_t m_icmpType;
132  uint8_t m_icmpCode;
133 
134 public:
135  virtual void DoRun (void);
138 
139  // server part
140  void StartServer (Ptr<Node> ServerNode);
141  void HandleReadServer (Ptr<Socket> socket);
142 
143  // client part
144  void StartClient (Ptr<Node> ClientNode);
145  void HandleReadClient (Ptr<Socket> socket);
146  void HandleReadIcmpClient (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType,
147  uint8_t icmpCode,uint32_t icmpInfo);
148 
149  void SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize);
150  Ptr<Packet> SendClient (void);
151 
152 };
153 
154 
156  : TestCase ("Verify the IPv6 layer 3 protocol fragmentation and reassembly")
157 {
158  m_socketServer = 0;
159  m_data = 0;
160  m_dataSize = 0;
161 }
162 
164 {
165  if ( m_data )
166  {
167  delete[] m_data;
168  }
169  m_data = 0;
170  m_dataSize = 0;
171 }
172 
173 
174 void
176 {
177 
178  if (m_socketServer == 0)
179  {
180  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
181  m_socketServer = Socket::CreateSocket (ServerNode, tid);
182  Inet6SocketAddress local = Inet6SocketAddress (Ipv6Address ("2001::1"), 9);
183  m_socketServer->Bind (local);
184  Ptr<UdpSocket> udpSocket = DynamicCast<UdpSocket> (m_socketServer);
185  }
186 
188 }
189 
190 void
192 {
193  Ptr<Packet> packet;
194  Address from;
195  while ((packet = socket->RecvFrom (from)))
196  {
197  if (Inet6SocketAddress::IsMatchingType (from))
198  {
199  m_receivedPacketServer = packet->Copy ();
200  }
201  }
202 }
203 
204 void
206 {
207 
208  if (m_socketClient == 0)
209  {
210  TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
211  m_socketClient = Socket::CreateSocket (ClientNode, tid);
212  m_socketClient->Bind (Inet6SocketAddress (Ipv6Address::GetAny (), 9));
215  m_socketClient->SetAttribute ("IcmpCallback6", cbValue);
216  }
217 
219 }
220 
221 void
223 {
224  Ptr<Packet> packet;
225  Address from;
226  while ((packet = socket->RecvFrom (from)))
227  {
228  if (Inet6SocketAddress::IsMatchingType (from))
229  {
230  m_receivedPacketClient = packet->Copy ();
231  }
232  }
233 }
234 
235 void
237  uint8_t icmpTtl, uint8_t icmpType,
238  uint8_t icmpCode, uint32_t icmpInfo)
239 {
240  m_icmpType = icmpType;
241  m_icmpCode = icmpCode;
242 }
243 
244 void
245 Ipv6FragmentationTest::SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize)
246 {
247  if (dataSize != m_dataSize)
248  {
249  delete [] m_data;
250  m_data = new uint8_t [dataSize];
251  m_dataSize = dataSize;
252  }
253 
254  if (fillSize >= dataSize)
255  {
256  memcpy (m_data, fill, dataSize);
257  return;
258  }
259 
260  uint32_t filled = 0;
261  while (filled + fillSize < dataSize)
262  {
263  memcpy (&m_data[filled], fill, fillSize);
264  filled += fillSize;
265  }
266 
267  memcpy (&m_data[filled], fill, dataSize - filled);
268 
269  m_size = dataSize;
270 }
271 
273 {
274  Ptr<Packet> p;
275  if (m_dataSize)
276  {
277  p = Create<Packet> (m_data, m_dataSize);
278  }
279  else
280  {
281  p = Create<Packet> (m_size);
282  }
283  IPv6TestTag tag;
284  tag.setToken (42);
285  p->AddPacketTag (tag);
286  p->AddByteTag (tag);
287 
288  m_socketClient->Send (p);
289 
290  return p;
291 }
292 
293 void
295 {
296  // Create topology
297 
298  // Receiver Node
299  Ptr<Node> serverNode = CreateObject<Node> ();
300  AddInternetStack (serverNode);
301  Ptr<SimpleNetDevice> serverDev;
302  Ptr<BinaryErrorModel> serverDevErrorModel = CreateObject<BinaryErrorModel> ();
303  {
304  serverDev = CreateObject<SimpleNetDevice> ();
305  serverDev->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
306  serverDev->SetMtu (1500);
307  serverDev->SetReceiveErrorModel (serverDevErrorModel);
308  serverDevErrorModel->Disable ();
309  serverNode->AddDevice (serverDev);
310  Ptr<Ipv6> ipv6 = serverNode->GetObject<Ipv6> ();
311  uint32_t netdev_idx = ipv6->AddInterface (serverDev);
312  Ipv6InterfaceAddress ipv6Addr = Ipv6InterfaceAddress (Ipv6Address ("2001::1"), Ipv6Prefix (32));
313  ipv6->AddAddress (netdev_idx, ipv6Addr);
314  ipv6->SetUp (netdev_idx);
315  }
316  StartServer (serverNode);
317 
318  // Sender Node
319  Ptr<Node> clientNode = CreateObject<Node> ();
320  AddInternetStack (clientNode);
321  Ptr<SimpleNetDevice> clientDev;
322  Ptr<BinaryErrorModel> clientDevErrorModel = CreateObject<BinaryErrorModel> ();
323  {
324  clientDev = CreateObject<SimpleNetDevice> ();
325  clientDev->SetAddress (Mac48Address::ConvertFrom (Mac48Address::Allocate ()));
326  clientDev->SetMtu (1500);
327  clientDev->SetReceiveErrorModel (clientDevErrorModel);
328  clientDevErrorModel->Disable ();
329  clientNode->AddDevice (clientDev);
330  Ptr<Ipv6> ipv6 = clientNode->GetObject<Ipv6> ();
331  uint32_t netdev_idx = ipv6->AddInterface (clientDev);
332  Ipv6InterfaceAddress ipv6Addr = Ipv6InterfaceAddress (Ipv6Address ("2001::2"), Ipv6Prefix (32));
333  ipv6->AddAddress (netdev_idx, ipv6Addr);
334  ipv6->SetUp (netdev_idx);
335  }
336  StartClient (clientNode);
337 
338  // link the two nodes
339  Ptr<ErrorChannel> channel = CreateObject<ErrorChannel> ();
340  serverDev->SetChannel (channel);
341  clientDev->SetChannel (channel);
342  channel->SetJumpingTime (Seconds (0.5));
343 
344 
345  // some small packets, some rather big ones
346  uint32_t packetSizes[5] = {2000, 2500, 5000, 10000, 65000};
347 
348  // using the alphabet
349  uint8_t fillData[78];
350  for ( uint32_t k = 48; k <= 125; k++ )
351  {
352  fillData[k - 48] = k;
353  }
354 
355  // First test: normal channel, no errors, no delays
356  for ( int i = 0; i < 5; i++)
357  {
358  uint32_t packetSize = packetSizes[i];
359 
360  SetFill (fillData, 78, packetSize);
361 
362  m_receivedPacketServer = Create<Packet> ();
363  Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
365  Simulator::Run ();
366 
367  uint8_t recvBuffer[65000];
368 
369  uint16_t recvSize = m_receivedPacketServer->GetSize ();
370 
371  NS_TEST_EXPECT_MSG_EQ (recvSize, packetSizes[i],
372  "Packet size not correct: recvSize: " << recvSize << " packetSizes[" << i << "]: " << packetSizes[i] );
373 
374  m_receivedPacketServer->CopyData (recvBuffer, 65000);
375  NS_TEST_EXPECT_MSG_EQ (memcmp (m_data, recvBuffer, m_receivedPacketServer->GetSize ()),
376  0, "Packet content differs");
377  }
378 
379  // Second test: normal channel, no errors, delays each 2 packets.
380  // Each other fragment will arrive out-of-order.
381  // The packets should be received correctly since reassembly will reorder the fragments.
382  channel->SetJumpingMode (true);
383  for ( int i = 0; i < 5; i++)
384  {
385  uint32_t packetSize = packetSizes[i];
386 
387  SetFill (fillData, 78, packetSize);
388 
389  m_receivedPacketServer = Create<Packet> ();
390  Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
392  Simulator::Run ();
393 
394  uint8_t recvBuffer[65000];
395 
396  uint16_t recvSize = m_receivedPacketServer->GetSize ();
397 
398  NS_TEST_EXPECT_MSG_EQ (recvSize, packetSizes[i],
399  "Packet size not correct: recvSize: " << recvSize << " packetSizes[" << i << "]: " << packetSizes[i] );
400 
401  m_receivedPacketServer->CopyData (recvBuffer, 65000);
402  NS_TEST_EXPECT_MSG_EQ (memcmp (m_data, recvBuffer, m_receivedPacketServer->GetSize ()),
403  0, "Packet content differs");
404  }
405  channel->SetJumpingMode (false);
406 
407  // Third test: normal channel, some errors, no delays.
408  // The reassembly procedure should fire a timeout after 30 seconds (as specified in the RFCs).
409  // Upon the timeout, the fragments received so far are discarded and an ICMP should be sent back
410  // to the sender (if the first fragment has been received).
411  // In this test case the first fragment is received, so we do expect an ICMP.
412  // Client -> Server : errors enabled
413  // Server -> Client : errors disabled (we want to have back the ICMP)
414  clientDevErrorModel->Disable ();
415  serverDevErrorModel->Enable ();
416  for ( int i = 1; i < 5; i++)
417  {
418  uint32_t packetSize = packetSizes[i];
419 
420  SetFill (fillData, 78, packetSize);
421 
422  // reset the model, we want to receive the very first fragment.
423  serverDevErrorModel->Reset ();
424 
425  m_receivedPacketServer = Create<Packet> ();
426  m_icmpType = 0;
427  m_icmpCode = 0;
428  Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
430  Simulator::Run ();
431 
432  uint16_t recvSize = m_receivedPacketServer->GetSize ();
433 
434  NS_TEST_EXPECT_MSG_EQ ((recvSize == 0), true, "Server got a packet, something wrong");
435  NS_TEST_EXPECT_MSG_EQ ((m_icmpType == Icmpv6Header::ICMPV6_ERROR_TIME_EXCEEDED)
436  && (m_icmpCode == Icmpv6Header::ICMPV6_FRAGTIME),
437  true, "Client did not receive ICMPv6::TIME_EXCEEDED " << int(m_icmpType) << int(m_icmpCode) );
438  }
439 
440  // Fourth test: normal channel, no errors, no delays.
441  // We check tags
442  clientDevErrorModel->Disable ();
443  serverDevErrorModel->Disable ();
444  for (int i= 0; i<5; i++)
445  {
446  uint32_t packetSize = packetSizes[i];
447 
448  SetFill (fillData, 78, packetSize);
449 
450  m_receivedPacketServer = Create<Packet> ();
451  Simulator::ScheduleWithContext (m_socketClient->GetNode ()->GetId (), Seconds (0),
453  Simulator::Run ();
454 
455  IPv6TestTag packetTag;
456  bool found = m_receivedPacketServer->PeekPacketTag (packetTag);
457 
458  NS_TEST_EXPECT_MSG_EQ (found, true, "PacketTag not found");
459  NS_TEST_EXPECT_MSG_EQ (packetTag.getToken (), 42, "PacketTag value not correct");
460 
462 
463  uint32_t end = 0;
464  uint32_t tagStart = 0;
465  uint32_t tagEnd = 0;
466  while (iter.HasNext ())
467  {
468  ByteTagIterator::Item item = iter.Next ();
469  NS_TEST_EXPECT_MSG_EQ (item.GetTypeId ().GetName (), "ns3::IPv6TestTag", "ByteTag name not correct");
470  tagStart = item.GetStart ();
471  tagEnd = item.GetEnd ();
472  if (end == 0)
473  {
474  NS_TEST_EXPECT_MSG_EQ (tagStart, 0, "First ByteTag Start not correct");
475  }
476  if (end != 0)
477  {
478  NS_TEST_EXPECT_MSG_EQ (tagStart, end, "ByteTag End not correct");
479  }
480  end = tagEnd;
481  IPv6TestTag *byteTag = dynamic_cast<IPv6TestTag *> (item.GetTypeId ().GetConstructor () ());
482  NS_TEST_EXPECT_MSG_NE (byteTag, 0, "ByteTag not found");
483  item.GetTag (*byteTag);
484  NS_TEST_EXPECT_MSG_EQ (byteTag->getToken (), 42, "ByteTag value not correct");
485  delete byteTag;
486  }
488  }
489 
490  Simulator::Destroy ();
491 }
492 //-----------------------------------------------------------------------------
494 {
495 public:
496  Ipv6FragmentationTestSuite () : TestSuite ("ipv6-fragmentation", UNIT)
497  {
498  AddTestCase (new Ipv6FragmentationTest, TestCase::QUICK);
499  }
tuple channel
Definition: third.py:85
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:462
Access to the IPv6 forwarding table, interfaces, and configuration.
Definition: ipv6.h:81
void WriteU64(uint64_t v)
Definition: tag-buffer.cc:102
static TypeId GetTypeId()
A suite of tests to run.
Definition: test.h:1333
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Definition: packet.cc:824
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:252
virtual uint32_t GetSerializedSize() const
IPv6 address associated with an interface.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Definition: test.h:278
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:792
virtual void Print(std::ostream &os) const
encapsulates test code
Definition: test.h:1147
This test suite implements a Unit Test.
Definition: test.h:1343
void StartServer(Ptr< Node > ServerNode)
A sockets interface to UDP.
a polymophic address class
Definition: address.h:90
Callback< ObjectBase * > GetConstructor(void) const
Get the constructor callback.
Definition: type-id.cc:1042
AttributeValue implementation for Callback.
Definition: callback.h:1880
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
Definition: packet.cc:846
Identifies a byte tag and a set of bytes within a packet to which the tag applies.
Definition: packet.h:61
void HandleReadIcmpClient(Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo)
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Definition: test.cc:298
virtual bool SetMtu(const uint16_t mtu)
An Inet6 address class.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1489
ByteTagIterator GetByteTagIterator(void) const
Returns an iterator over the set of byte tags included in this packet.
Definition: packet.cc:801
void HandleReadClient(Ptr< Socket > socket)
void SetRecvCallback(Callback< void, Ptr< Socket > >)
Notify application when new data is available to be read.
Definition: socket.cc:128
uint32_t GetEnd(void) const
The index is an offset from the start of the packet.
Definition: packet.cc:44
void Disable(void)
Disable the error model.
Definition: error-model.cc:132
virtual void Deserialize(TagBuffer buffer)
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
Definition: packet.cc:122
tag a set of bytes in a packet
Definition: tag.h:36
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint64_t ReadU64(void)
Definition: tag-buffer.cc:134
Iterator over the set of byte tags in a packet.
Definition: packet.h:54
#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report if not.
Definition: test.h:732
std::string GetName(void) const
Get the name.
Definition: type-id.cc:958
void SetReceiveErrorModel(Ptr< ErrorModel > em)
Attach a receive ErrorModel to the SimpleNetDevice.
TypeId GetTypeId(void) const
Definition: packet.cc:34
virtual TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
void HandleReadServer(Ptr< Socket > socket)
Ptr< Packet > SendClient(void)
virtual uint32_t AddInterface(Ptr< NetDevice > device)=0
Add a NetDevice interface.
void GetTag(Tag &tag) const
Read the requested tag and store it in the user-provided tag instance.
Definition: packet.cc:49
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void RegisterExtensions()
Register the IPv6 Extensions.
Describes an IPv6 address.
Definition: ipv6-address.h:48
void SetRoutingProtocol(Ptr< Ipv6RoutingProtocol > routingProtocol)
Set routing protocol for this stack.
read and write tag data
Definition: tag-buffer.h:51
uint32_t GetStart(void) const
The index is an offset from the start of the packet.
Definition: packet.cc:39
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:128
uint32_t GetId(void) const
Definition: node.cc:107
virtual Ptr< Node > GetNode(void) const =0
Return the node this socket is associated with.
virtual void Serialize(TagBuffer buffer) const
virtual void SetAddress(Address address)
Set the address of this interface.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
void SetFill(uint8_t *fill, uint32_t fillSize, uint32_t dataSize)
virtual void RegisterOptions()
Register the IPv6 Options.
void setToken(uint64_t token)
Describes an IPv6 prefix.
Definition: ipv6-address.h:394
virtual bool AddAddress(uint32_t interface, Ipv6InterfaceAddress address)=0
Add an address on the specified IPv6 interface.
uint32_t CopyData(uint8_t *buffer, uint32_t size) const
Copy the packet contents to a byte buffer.
Definition: packet.cc:356
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
static const uint32_t packetSize
void StartClient(Ptr< Node > ClientNode)
Ipv6FragmentationTestSuite g_ipv6fragmentationTestSuite
virtual Ptr< Packet > RecvFrom(uint32_t maxSize, uint32_t flags, Address &fromAddress)=0
Read a single packet from the socket and retrieve the sender address.
virtual int Send(Ptr< Packet > p, uint32_t flags)=0
Send data (or dummy data) to the remote host.
static void AddInternetStack(Ptr< Node > node)
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:191
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
void Enable(void)
Enable the error model.
Definition: error-model.cc:125
virtual void SetUp(uint32_t interface)=0
Set the interface into the "up" state.
void AddByteTag(const Tag &tag) const
Tag each byte included in this packet with a new byte tag.
Definition: packet.cc:791