src/devices/point-to-point/point-to-point-net-device.h
author Craig Dowell <craigdo@ee.washington.edu>
Fri, 18 Sep 2009 14:14:34 -0700
changeset 5229 0d0779ac3278
parent 5227 ecb08c1fc273
child 5286 6938385e35a8
permissions -rw-r--r--
=================================================================== new file mode 100644
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
368
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     2
/*
3086
5370849d0b76 ppp model description
Craig Dowell <craigdo@ee.washington.edu>
parents: 3021
diff changeset
     3
 * Copyright (c) 2007, 2008 University of Washington
368
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     4
 *
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     7
 * published by the Free Software Foundation;
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     8
 *
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    12
 * GNU General Public License for more details.
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    13
 *
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    14
 * You should have received a copy of the GNU General Public License
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    15
 * along with this program; if not, write to the Free Software
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    17
 */
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    18
369
29ea5d1a83c8 Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents: 368
diff changeset
    19
#ifndef POINT_TO_POINT_NET_DEVICE_H
29ea5d1a83c8 Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents: 368
diff changeset
    20
#define POINT_TO_POINT_NET_DEVICE_H
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    21
368
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    22
#include <string.h>
1167
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 996
diff changeset
    23
#include "ns3/address.h"
729
b5e744285e92 rename i-node to node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 728
diff changeset
    24
#include "ns3/node.h"
331
d75ee9d8efa4 move p2p to new dir
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 252
diff changeset
    25
#include "ns3/net-device.h"
368
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    26
#include "ns3/callback.h"
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
    27
#include "ns3/packet.h"
2502
50d0da37f02f introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2470
diff changeset
    28
#include "ns3/traced-callback.h"
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
    29
#include "ns3/nstime.h"
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
    30
#include "ns3/data-rate.h"
543
a730800a31d5 Node* -> Ptr<Node>
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 517
diff changeset
    31
#include "ns3/ptr.h"
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    32
#include "ns3/mac48-address.h"
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    33
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    34
namespace ns3 {
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    35
402
f47285751901 add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 379
diff changeset
    36
class Queue;
369
29ea5d1a83c8 Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents: 368
diff changeset
    37
class PointToPointChannel;
1820
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
    38
class ErrorModel;
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    39
1403
0286b806eee1 add doxygen for each TraceSourceElement subclass
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1401
diff changeset
    40
/**
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    41
 * \class PointToPointNetDevice
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    42
 * \brief A Device for a Point to Point Network Link.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    43
 *
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    44
 * This PointToPointNetDevice class specializes the NetDevice abstract
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    45
 * base class.  Together with a PointToPointChannel (and a peer 
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    46
 * PointToPointNetDevice), the class models, with some level of 
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    47
 * abstraction, a generic point-to-point or serial link.  
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    48
 * Key parameters or objects that can be specified for this device 
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    49
 * include a queue, data rate, and interframe transmission gap (the 
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    50
 * propagation delay is set in the PointToPointChannel).
409
1cbb9ed862d0 add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 402
diff changeset
    51
 */
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    52
class PointToPointNetDevice : public NetDevice 
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
    53
{
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
    54
public:
2502
50d0da37f02f introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2470
diff changeset
    55
  static TypeId GetTypeId (void);
50d0da37f02f introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2470
diff changeset
    56
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    57
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    58
   * Construct a PointToPointNetDevice
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    59
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    60
   * This is the constructor for the PointToPointNetDevice.  It takes as a
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    61
   * parameter a pointer to the Node to which this device is connected, 
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    62
   * as well as an optional DataRate object.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    63
   */
2502
50d0da37f02f introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2470
diff changeset
    64
  PointToPointNetDevice ();
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    65
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    66
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    67
   * Destroy a PointToPointNetDevice
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    68
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    69
   * This is the destructor for the PointToPointNetDevice.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    70
   */
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    71
  virtual ~PointToPointNetDevice ();
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    72
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    73
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    74
   * Set the Data Rate used for transmission of packets.  The data rate is
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    75
   * set in the Attach () method from the corresponding field in the channel
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    76
   * to which the device is attached.  It can be overridden using this method.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    77
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    78
   * @see Attach ()
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    79
   * @param bps the data rate at which this object operates
409
1cbb9ed862d0 add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 402
diff changeset
    80
   */
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    81
  void SetDataRate (DataRate bps);
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    82
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    83
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    84
   * Set the inteframe gap used to separate packets.  The interframe gap
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    85
   * defines the minimum space required between packets sent by this device.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    86
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    87
   * @param t the interframe gap time
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    88
   */
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    89
  void SetInterframeGap (Time t);
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    90
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    91
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    92
   * Attach the device to a channel.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    93
   *
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    94
   * @param ch Ptr to the channel to which this object is being attached.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    95
   */
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
    96
  bool Attach (Ptr<PointToPointChannel> ch);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
    97
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    98
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
    99
   * Attach a queue to the PointToPointNetDevice.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   100
   *
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   101
   * The PointToPointNetDevice "owns" a queue that implements a queueing 
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   102
   * method such as DropTail or RED.  
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   103
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   104
   * @see Queue
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   105
   * @see DropTailQueue
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   106
   * @param queue Ptr to the new queue.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   107
   */
3010
ad669f4f7e58 bug 153
Craig Dowell <craigdo@ee.washington.edu>
parents: 2655
diff changeset
   108
  void SetQueue (Ptr<Queue> queue);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   109
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   110
  /**
1820
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   111
   * Attach a receive ErrorModel to the PointToPointNetDevice.
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   112
   *
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   113
   * The PointToPointNetDevice may optionally include an ErrorModel in
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   114
   * the packet receive chain.
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   115
   *
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   116
   * @see ErrorModel
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   117
   * @param em Ptr to the ErrorModel.
1820
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   118
   */
3010
ad669f4f7e58 bug 153
Craig Dowell <craigdo@ee.washington.edu>
parents: 2655
diff changeset
   119
  void SetReceiveErrorModel(Ptr<ErrorModel> em);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   120
1820
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   121
  /**
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   122
   * Receive a packet from a connected PointToPointChannel.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   123
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   124
   * The PointToPointNetDevice receives packets from its connected channel
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   125
   * and forwards them up the protocol stack.  This is the public method
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   126
   * used by the channel to indicate that the last bit of a packet has 
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   127
   * arrived at the device.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   128
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   129
   * @see PointToPointChannel
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   130
   * @param p Ptr to the received packet.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   131
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   132
  void Receive (Ptr<Packet> p);
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
   133
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   134
  /**
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   135
   * Set The max frame size of packets sent over this device.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   136
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   137
   * Okay, that was easy to say, but the details are a bit thorny.  We have a MAC-level MTU that is the payload that higher 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   138
   * level protocols see.  We have a PHY-level MTU which is the maximum number of bytes we can send over the link 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   139
   * (cf. 1500 bytes for Ethernet).  We also have a frame size which is some total number of bytes in a packet which could
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   140
   * or could not include any framing and overhead.  There can be a lot of inconsistency in definitions of these terms.  For
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   141
   * example, RFC 1042 asserts that the terms maximum transmission unit and maximum packet size are equivalent.  RFC 791, 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   142
   * however, defines MTU as the maximum sized IP datagram that can be sent.  Packet size and frame size are sometimes
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   143
   * used interchangeably.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   144
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   145
   * So, some careful definitions are in order to avoid confusion:
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   146
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   147
   * In real serial channel (HDLC, for example), the wire idles (sends all ones) until the channel begins sending a packet.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   148
   * A frame on the wire starts with a flag character (01111110).  This is followed by what is usually called the packet: 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   149
   * address, control, payload, and a Frame Check Sequence (FCS).  This is followed by another flag character.  If the flag
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   150
   * characters are used, then bit stuffing must be used to prevent flag characters from appearing in the packet and confusing
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   151
   * the link.  Som to be strictly and pedantically correct the frame size is then necessarily larger than the packet size on 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   152
   * a real link.  But, this isn't a real link, it's a simulation of a device similar to a point-to-point device, and we have
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   153
   * no good reason to add framing bits and therefore to do bit-stuffing.  So, in the case of the point-to-point device, the 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   154
   * frame size is equal to the packet size.  Since these two values are defined to be equal, there is no danger in assuming
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   155
   * they are identical.  We define packet size to be equal to frame size and this excludes the flag characters.  We define a 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   156
   * single (MAC-level) MTU that coresponds to the payload size of the packet, which is the IP-centric view of the term as
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   157
   * seen in RFC 791.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   158
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   159
   * To make this concrete, consider PPP framing on a synchronous link.  In this framing scheme, a real serial frame on the 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   160
   * wire starts with a flag character, address and control characters, then a 16-bit PPP protocol ID (0x21 = IP).  Then we 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   161
   * would see the actual payload we are supposed to send, presumably an IP datagram.  At then we see the FCS and finally 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   162
   * another flag character to end the frame.  We ignore the flag bits on this device since it they are not needed.  We 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   163
   * aren't really using HDLC to send frames across the link, so we don't need the address and control bits either.  In fact,
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   164
   * to encapsulate using unframed PPP all we need to do is prepend the two-byte protocol ID.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   165
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   166
   * Typically the limiting factor in frame size is due to hardware limitations in the underlying HDLC controller receive 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   167
   * FIFO buffer size.  This number can vary widely.  For example, the Motorola MC92460 has a 64 KByte maximum frame size; 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   168
   * the Intel IXP4XX series has a 16 KByte size.  Older USARTs have a maximum frame size around 2KBytes, and typical PPP
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   169
   * links on the Internet have their MTU set to 1500 bytes since this is what will typically be used on Ethernet segments
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   170
   * and will avoid path MTU issues.  We choose to make the default MTU 1500 bytes which then fixes the maximum frame size
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   171
   * as described below.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   172
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   173
   * So, there are really two related variables at work here.  There is the maximum frame size that can be sent over the
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   174
   * link and there is the MTU.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   175
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   176
   * So, what do we do since these values must always be consistent in the driver?  We want to actually allow a user to change 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   177
   * these variables, but we want the results (even at intermediate stages of her ultimate change) to be consistent.  We 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   178
   * certainly don't want to require that users must understand the details of PPP encapsulation in order to set these 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   179
   * variables.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   180
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   181
   * Consider the following situation:  A user wants to set the maximum frame size to 16 KBytes.  This user shouldn't have to
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   182
   * concern herself that the PPP encapsulation will consume six bytes.  She should not have to figure out that the MTU needs
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   183
   * to be set to 16K - 2 bytes to make things consistent.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   184
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   185
   * Similarly, a user who is interested in setting the MTU to 1500 bytes should not be forced to understand that the frame 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   186
   * size will need to be set to 1502 bytes. 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   187
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   188
   * We could play games trying to figure out what the user wants to do, but that is typically a bad plan and programmers
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   189
   * have a long and distinguished history of guessing wrong.  We'll avoid all of that and just define a flexible behavior
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   190
   * that can be worked to get what you want.  Here it is:
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   191
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   192
   * - If the user is changing the MTU, she is interested in getting that part of the system set, so the frame size
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   193
   * will be changed to make it consistent;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   194
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   195
   * - If the user is changing the frame size, he is interested in getting that part of the system set, so the MTU
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   196
   * will be changed to make it consistent;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   197
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   198
   * - You cannot define the MTU and frame size separately -- they are always tied together by the overhead of the PPP 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   199
   * encapsulation.  This is not a restriction.  Consider what this means.  Perhaps you want to set the frame size to some 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   200
   * large number and the MTU to some small number.  The largest packet you can send is going to be limited by the MTU, so it
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   201
   * is not possible to send a frame larger than the MTU plus overhead.  Having the ability to set a  larger frame size is not
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   202
   * useful.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   203
   * 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   204
   * So, if a user calls SetFrameSize, we assume that the maximum frame size is the interesting thing for that user and
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   205
   * we just adjust the MTU to a new "correct value" based on the current encapsulation mode.  If a user calls SetMtu, we 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   206
   * assume that the MTU is the interesting property for that user, and we adjust the frame size to a new "correct value" 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   207
   * for the current encapsulation mode.  If a user calls SetEncapsulationMode, then we take the MTU as the free variable 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   208
   * and set its value to match the current frame size.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   209
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   210
   * \param frameSize The max frame size of packets sent over this device.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   211
   */
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   212
  void SetFrameSize (uint16_t frameSize);
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   213
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   214
  /**
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   215
   * Get The max frame size of packets sent over this device.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   216
   *
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   217
   * \returns The max frame size of packets sent over this device.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   218
   */
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   219
  uint16_t GetFrameSize (void) const;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   220
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   221
  virtual void SetIfIndex(const uint32_t index);
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   222
  virtual uint32_t GetIfIndex(void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   223
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   224
  virtual Ptr<Channel> GetChannel (void) const;
4578
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4322
diff changeset
   225
88434ff8f0a5 Finally make tap bridge work with VMs (bug 569)
Craig Dowell <craigdo@ee.washington.edu>
parents: 4322
diff changeset
   226
  virtual void SetAddress (Address address);
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   227
  virtual Address GetAddress (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   228
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   229
  virtual bool SetMtu (const uint16_t mtu);
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   230
  virtual uint16_t GetMtu (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   231
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   232
  virtual bool IsLinkUp (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   233
4764
e90e1ef585b0 [Bug 653] NetDevice link change callback (SetLinkChangeCallback -> AddLinkChangeCallback).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4578
diff changeset
   234
  virtual void AddLinkChangeCallback (Callback<void> callback);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   235
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   236
  virtual bool IsBroadcast (void) const;
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   237
  virtual Address GetBroadcast (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   238
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   239
  virtual bool IsMulticast (void) const;
3841
1e7abf5fca79 Apply Patch to address bug 294 -- due to vincent
Craig Dowell <craigdo@ee.washington.edu>
parents: 3682
diff changeset
   240
  virtual Address GetMulticast (Ipv4Address multicastGroup) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   241
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   242
  virtual bool IsPointToPoint (void) const;
3936
e525995ce5dc implement IsBridged for net devices
Craig Dowell <craigdo@ee.washington.edu>
parents: 3852
diff changeset
   243
  virtual bool IsBridge (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   244
3442
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   245
  virtual bool Send(Ptr<Packet> packet, const Address &dest, uint16_t protocolNumber);
8eef02250bc9 Add a NetDevice::SendFrom API, for sending packets with a custom source MAC address (a.k.a. MAC spoofing). Only implemented for CsmaNetDevice for now.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3435
diff changeset
   246
  virtual bool SendFrom(Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   247
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   248
  virtual Ptr<Node> GetNode (void) const;
2600
6c389d0c717d add Application::SetNode and NetDevice::SetNode, use them from Node::AddApplication and Node::AddDevice. kill useless "Node" attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2502
diff changeset
   249
  virtual void SetNode (Ptr<Node> node);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   250
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   251
  virtual bool NeedsArp (void) const;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   252
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   253
  virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb);
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   254
3852
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   255
  virtual Address GetMulticast (Ipv6Address addr) const;
9cf7ad0cac85 Initial IPv6 capability
vincent@clarinet.u-strasbg.fr
parents: 3841
diff changeset
   256
3480
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3448
diff changeset
   257
  virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb);
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   258
  virtual bool SupportsSendFrom (void) const;
3480
a920df6b9f02 Make the new NetDevice APIs pure virtual methods, by Mathieu's insistence.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3448
diff changeset
   259
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
   260
private:
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
   261
517
702e96b8960f finish Dispose -> DoDispose rework
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 465
diff changeset
   262
  virtual void DoDispose (void);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   263
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   264
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   265
   * Get a copy of the attached Queue.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   266
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   267
   * This method is provided for any derived class that may need to get
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   268
   * direct access to the underlying queue.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   269
   *
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   270
   * @returns Ptr to the queue.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   271
   */
581
15240a33f517 make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 568
diff changeset
   272
  Ptr<Queue> GetQueue(void) const; 
1793
20bd909c62b5 some cleanup of point-to-point-net-device.h
Tom Henderson <tomh@tomh.org>
parents: 1412
diff changeset
   273
368
1df1165d6a68 Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents: 345
diff changeset
   274
private:
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   275
  /**
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   276
   * Calculate the value for the MTU that would result from 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   277
   * setting the frame size to the given value.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   278
   * \param frameSize size of frame
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   279
   */
3682
cef8288d30ae fix bug 338, MTU overflows frameSize
Craig Dowell <craigdo@ee.washington.edu>
parents: 3632
diff changeset
   280
  uint32_t MtuFromFrameSize (uint32_t frameSize);
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   281
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   282
  /**
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   283
   * Calculate the value for the frame size that would be required
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   284
   * to be able to set the MTU to the given value.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   285
   * \param mtu MTU
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   286
   */
3682
cef8288d30ae fix bug 338, MTU overflows frameSize
Craig Dowell <craigdo@ee.washington.edu>
parents: 3632
diff changeset
   287
  uint32_t FrameSizeFromMtu (uint32_t mtu);
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   288
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   289
  /**
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   290
   * \returns the address of the remote device connected to this device
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   291
   * through the point to point channel.
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   292
   */
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   293
  Address GetRemote (void) const;
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   294
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   295
  /**
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   296
   * Adds the necessary headers and trailers to a packet of data in order to
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   297
   * respect the protocol implemented by the agent.
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   298
   * \param p packet
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   299
   * \param protocolNumber protocol number
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   300
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   301
  void AddHeader(Ptr<Packet> p, uint16_t protocolNumber);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   302
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   303
  /**
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   304
   * Removes, from a packet of data, all headers and trailers that
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   305
   * relate to the protocol implemented by the agent
5227
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   306
   * \param p Packet whose headers need to be processed
ecb08c1fc273 Fix some doxygen warnings revealed by WARN_NO_PARAMDOC=YES in doc/doxygen.conf.
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4764
diff changeset
   307
   * \param param An integer parameter that can be set by the function
975
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   308
   * \return Returns true if the packet should be forwarded up the
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   309
   * protocol stack.
98233c6c9c2e Move LLC encapsulation from NetDevice to subclasses.
Emmanuelle Laprise <emmanuelle.laprise@bluekazoo.ca>
parents: 973
diff changeset
   310
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   311
  bool ProcessHeader(Ptr<Packet> p, uint16_t& param);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   312
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   313
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   314
   * Start Sending a Packet Down the Wire.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   315
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   316
   * The TransmitStart method is the method that is used internally in the
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   317
   * PointToPointNetDevice to begin the process of sending a packet out on
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   318
   * the channel.  The corresponding method is called on the channel to let
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   319
   * it know that the physical device this class represents has virually
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   320
   * started sending signals.  An event is scheduled for the time at which
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   321
   * the bits have been completely transmitted.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   322
   *
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   323
   * @see PointToPointChannel::TransmitStart ()
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   324
   * @see TransmitCompleteEvent ()
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   325
   * @param p a reference to the packet to send
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   326
   * @returns true if success, false on failure
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   327
   */
1866
e7dbcc4df546 do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1412
diff changeset
   328
  bool TransmitStart (Ptr<Packet> p);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   329
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   330
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   331
   * Stop Sending a Packet Down the Wire and Begin the Interframe Gap.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   332
   *
926
1fdec986d774 Simplifications to the point to point devices and channel
George F. Riley<riley@ece.gatech.edu>
parents: 773
diff changeset
   333
   * The TransmitComplete method is used internally to finish the process
1fdec986d774 Simplifications to the point to point devices and channel
George F. Riley<riley@ece.gatech.edu>
parents: 773
diff changeset
   334
   * of sending a packet out on the channel.
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   335
   */
926
1fdec986d774 Simplifications to the point to point devices and channel
George F. Riley<riley@ece.gatech.edu>
parents: 773
diff changeset
   336
  void TransmitComplete(void);
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   337
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   338
  void NotifyLinkUp (void);
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   339
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   340
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   341
   * Enumeration of the states of the transmit machine of the net device.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   342
   */
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   343
  enum TxMachineState
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   344
    {
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   345
      READY, /**< The transmitter is ready to begin transmission of a packet */
926
1fdec986d774 Simplifications to the point to point devices and channel
George F. Riley<riley@ece.gatech.edu>
parents: 773
diff changeset
   346
      BUSY   /**< The transmitter is busy transmitting a packet */
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   347
    };
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   348
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   349
   * The state of the Net Device transmit state machine.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   350
   * @see TxMachineState
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   351
   */
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   352
  TxMachineState m_txMachineState;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   353
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   354
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   355
   * The data rate that the Net Device uses to simulate packet transmission
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   356
   * timing.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   357
   * @see class DataRate
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   358
   */
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   359
  DataRate       m_bps;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   360
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   361
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   362
   * The interframe gap that the Net Device uses to throttle packet
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   363
   * transmission
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   364
   * @see class Time
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   365
   */
378
32bd402ea5ea remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents: 369
diff changeset
   366
  Time           m_tInterframeGap;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   367
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   368
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   369
   * The PointToPointChannel to which this PointToPointNetDevice has been
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   370
   * attached.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   371
   * @see class PointToPointChannel
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   372
   */
568
e1660959ecbb use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 543
diff changeset
   373
  Ptr<PointToPointChannel> m_channel;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   374
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   375
  /**
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   376
   * The Queue which this PointToPointNetDevice uses as a packet source.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   377
   * Management of this Queue has been delegated to the PointToPointNetDevice
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   378
   * and it has the responsibility for deletion.
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   379
   * @see class Queue
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   380
   * @see class DropTailQueue
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   381
   */
581
15240a33f517 make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 568
diff changeset
   382
  Ptr<Queue> m_queue;
3181
26e7f865c548 point-to-point cleanup
Craig Dowell <craigdo@ee.washington.edu>
parents: 3086
diff changeset
   383
414
71babb829194 fix queue leak and add p2p net device dox
Craig Dowell
parents: 409
diff changeset
   384
  /**
1820
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   385
   * Error model for receive packet events
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   386
   */
736919bd4874 Add src/common/error-model implementation and example script, and add to NetDevices
Tom Henderson <tomh@tomh.org>
parents: 1793
diff changeset
   387
  Ptr<ErrorModel> m_receiveErrorModel;
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   388
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   389
  /**
5229
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   390
   * The trace source for the packet transmission animation events that the 
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   391
   * device can fire.
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   392
   * Arguments to the callback are the packet, transmitting
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   393
   * net device, receiving net device, transmittion time and 
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   394
   * packet receipt time.
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   395
   *
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   396
   * @see class CallBackTraceSource
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   397
   */
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   398
  friend class PointToPointChannel; // Allow the channel to call the callback
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   399
  TracedCallback<Ptr<const Packet>, // Packet being transmitted
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   400
                 Ptr<NetDevice>,    // Transmitting NetDevice
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   401
                 Ptr<NetDevice>,    // Receiving NetDevice
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   402
                 Time,              // Amount of time to transmit the pkt
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   403
                 Time               // Last bit receive time (relative to now)
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   404
                 > m_txrxPointToPoint;
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   405
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   406
0d0779ac3278 ===================================================================
Craig Dowell <craigdo@ee.washington.edu>
parents: 5227
diff changeset
   407
  /**
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   408
   * The trace source fired when packets come into the "top" of the device
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   409
   * at the L3/L2 transition, before being queued for transmission.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   410
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   411
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   412
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   413
  TracedCallback<Ptr<const Packet> > m_macTxTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   414
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   415
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   416
   * The trace source fired when packets coming into the "top" of the device
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   417
   * at the L3/L2 transition are dropped before being queued for transmission.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   418
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   419
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   420
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   421
  TracedCallback<Ptr<const Packet> > m_macTxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   422
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   423
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   424
   * The trace source fired for packets successfully received by the device
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   425
   * immediately before being forwarded up to higher layers (at the L2/L3 
4272
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   426
   * transition).  This is a promiscuous trace (which doesn't mean a lot here
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   427
   * in the point-to-point device).
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   428
   *
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   429
   * \see class CallBackTraceSource
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   430
   */
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   431
  TracedCallback<Ptr<const Packet> > m_macPromiscRxTrace;
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   432
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   433
  /**
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   434
   * The trace source fired for packets successfully received by the device
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   435
   * immediately before being forwarded up to higher layers (at the L2/L3 
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   436
   * transition).  This is a non-promiscuous trace (which doesn't mean a lot 
b40ce56e0247 Add MacPromiscRx, make MacRx non-promisc
Craig Dowell <craigdo@ee.washington.edu>
parents: 4264
diff changeset
   437
   * here in the point-to-point device).
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   438
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   439
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   440
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   441
  TracedCallback<Ptr<const Packet> > m_macRxTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   442
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   443
  /**
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   444
   * The trace source fired for packets successfully received by the device
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   445
   * but are dropped before being forwarded up to higher layers (at the L2/L3 
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   446
   * transition).
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   447
   *
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   448
   * \see class CallBackTraceSource
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   449
   */
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   450
  TracedCallback<Ptr<const Packet> > m_macRxDropTrace;
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   451
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   452
  /**
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   453
   * The trace source fired when a packet begins the transmission process on
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   454
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   455
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   456
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   457
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   458
  TracedCallback<Ptr<const Packet> > m_phyTxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   459
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   460
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   461
   * The trace source fired when a packet ends the transmission process on
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   462
   * the medium.  
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   463
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   464
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   465
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   466
  TracedCallback<Ptr<const Packet> > m_phyTxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   467
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   468
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   469
   * The trace source fired when the phy layer drops a packet before it tries
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   470
   * to transmit it.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   471
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   472
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   473
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   474
  TracedCallback<Ptr<const Packet> > m_phyTxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   475
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   476
  /**
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   477
   * The trace source fired when a packet begins the reception process from
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   478
   * the medium -- when the simulated first bit(s) arrive.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   479
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   480
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   481
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   482
  TracedCallback<Ptr<const Packet> > m_phyRxBeginTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   483
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   484
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   485
   * The trace source fired when a packet ends the reception process from
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   486
   * the medium.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   487
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   488
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   489
   */
4264
9d2e96c4e6e4 Piles of changes for tracing rework
Craig Dowell <craigdo@ee.washington.edu>
parents: 4263
diff changeset
   490
  TracedCallback<Ptr<const Packet> > m_phyRxEndTrace;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   491
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   492
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   493
   * The trace source fired when the phy layer drops a packet it has received.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   494
   * This happens if the receiver is not enabled or the error model is active
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   495
   * and indicates that the packet is corrupt.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   496
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   497
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   498
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   499
  TracedCallback<Ptr<const Packet> > m_phyRxDropTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   500
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   501
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   502
   * A trace source that emulates a non-promiscuous protocol sniffer connected 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   503
   * to the device.  Unlike your average everyday sniffer, this trace source 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   504
   * will not fire on PACKET_OTHERHOST events.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   505
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   506
   * On the transmit size, this trace hook will fire after a packet is dequeued
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   507
   * from the device queue for transmission.  In Linux, for example, this would
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   508
   * correspond to the point just before a device hard_start_xmit where 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   509
   * dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   510
   * ETH_P_ALL handlers.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   511
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   512
   * On the receive side, this trace hook will fire when a packet is received,
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   513
   * just before the receive callback is executed.  In Linux, for example, 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   514
   * this would correspond to the point at which the packet is dispatched to 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   515
   * packet sniffers in netif_receive_skb.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   516
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   517
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   518
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   519
  TracedCallback<Ptr<const Packet> > m_snifferTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   520
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   521
  /**
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   522
   * A trace source that emulates a promiscuous mode protocol sniffer connected
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   523
   * to the device.  This trace source fire on packets destined for any host
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   524
   * just like your average everyday packet sniffer.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   525
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   526
   * On the transmit size, this trace hook will fire after a packet is dequeued
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   527
   * from the device queue for transmission.  In Linux, for example, this would
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   528
   * correspond to the point just before a device hard_start_xmit where 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   529
   * dev_queue_xmit_nit is called to dispatch the packet to the PF_PACKET 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   530
   * ETH_P_ALL handlers.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   531
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   532
   * On the receive side, this trace hook will fire when a packet is received,
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   533
   * just before the receive callback is executed.  In Linux, for example, 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   534
   * this would correspond to the point at which the packet is dispatched to 
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   535
   * packet sniffers in netif_receive_skb.
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   536
   *
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   537
   * \see class CallBackTraceSource
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   538
   */
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   539
  TracedCallback<Ptr<const Packet> > m_promiscSnifferTrace;
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   540
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   541
  Ptr<Node> m_node;
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   542
  Mac48Address m_address;
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   543
  NetDevice::ReceiveCallback m_rxCallback;
3584
4eb48239b4dc bug 274: bridge must detect compatibility of devices with bridging mode
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3480
diff changeset
   544
  NetDevice::PromiscReceiveCallback m_promiscCallback;
2470
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   545
  uint32_t m_ifIndex;
254581fb9e9c make NetDevice fully virtual.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1870
diff changeset
   546
  bool m_linkUp;
4764
e90e1ef585b0 [Bug 653] NetDevice link change callback (SetLinkChangeCallback -> AddLinkChangeCallback).
Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
parents: 4578
diff changeset
   547
  TracedCallback<> m_linkChangeCallbacks;
3632
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   548
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   549
  static const uint16_t DEFAULT_MTU = 1500;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   550
  static const uint16_t PPP_OVERHEAD = 2;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   551
  static const uint16_t DEFAULT_FRAME_SIZE = DEFAULT_MTU + PPP_OVERHEAD;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   552
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   553
  /**
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   554
   * The frame size/packet size.  This corresponds to the maximum 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   555
   * number of bytes that can be transmitted as a packet without framing.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   556
   * This corresponds to the 1518 byte packet size often seen on Ethernet.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   557
   */
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   558
  uint32_t m_frameSize;
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   559
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   560
  /**
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   561
   * The Maxmimum Transmission Unit.  This corresponds to the maximum 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   562
   * number of bytes that can be transmitted as seen from higher layers.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   563
   * This corresponds to the 1500 byte MTU size often seen on IP over 
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   564
   * Ethernet.
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   565
   */
aa1fb0f43571 apply MTU/FrameSize treatment to point-to-point
craigdo@ns-test
parents: 3584
diff changeset
   566
  uint32_t m_mtu;
4263
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   567
fec2f830d015 trace consistency changes
Craig Dowell <craigdo@ee.washington.edu>
parents: 3936
diff changeset
   568
  Ptr<Packet> m_currentPkt;
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   569
};
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   570
2502
50d0da37f02f introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2470
diff changeset
   571
} // namespace ns3
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   572
369
29ea5d1a83c8 Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents: 368
diff changeset
   573
#endif // POINT_TO_POINT_NET_DEVICE_H
245
28ba3a5cdff8 add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff changeset
   574