author | Tom Henderson <tomh@tomh.org> |
Fri, 15 Jun 2007 13:19:57 -0700 | |
changeset 773 | 18ad0b94e2ae |
parent 767 | c36570ed4f5e |
child 926 | 1fdec986d774 |
permissions | -rw-r--r-- |
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 |
/* |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
3 |
* Copyright (c) 2007 University of Washington |
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 |
* |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
18 |
* Author: Craig Dowell <craigdo@ee.washington.edu> |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
19 |
*/ |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
369
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
21 |
#ifndef POINT_TO_POINT_NET_DEVICE_H |
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
22 |
#define POINT_TO_POINT_NET_DEVICE_H |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
24 |
#include <string.h> |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
25 |
#include "ns3/mac-address.h" |
729
b5e744285e92
rename i-node to node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
728
diff
changeset
|
26 |
#include "ns3/node.h" |
331
d75ee9d8efa4
move p2p to new dir
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
252
diff
changeset
|
27 |
#include "ns3/net-device.h" |
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
28 |
#include "ns3/callback.h" |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
29 |
#include "ns3/packet.h" |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
30 |
#include "ns3/callback-trace-source.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
|
31 |
#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
|
32 |
#include "ns3/data-rate.h" |
543 | 33 |
#include "ns3/ptr.h" |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
|
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
namespace ns3 { |
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
|
402
f47285751901
add NetDevice::GetChannel method and doxygen-document it
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
379
diff
changeset
|
37 |
class Queue; |
369
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
38 |
class PointToPointChannel; |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
|
409
1cbb9ed862d0
add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
402
diff
changeset
|
40 |
/** |
414 | 41 |
* \class PointToPointNetDevice |
42 |
* \brief A Device for a Point to Point Network Link. |
|
43 |
* |
|
44 |
* Ns-3 takes a four-layer view of a protocol stack. This is the same model |
|
45 |
* that TCP uses. In this view, layers 5-7 of the OSI reference model are |
|
46 |
* grouped together into an application layer; layer four (transport / TCP) is |
|
47 |
* broken out; layer three (network / IP) is broken out; and layers 1-2 are |
|
48 |
* grouped together. We call this grouping of layers one and two a NetDevice |
|
49 |
* and represent it as a class in the system. |
|
409
1cbb9ed862d0
add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
402
diff
changeset
|
50 |
* |
414 | 51 |
* The NetDevice class is specialized according to the needs of the specific |
52 |
* kind of network link. In this case, the link is a PointToPoint link. The |
|
53 |
* PointToPoint link is a family of classes that includes this class, the |
|
54 |
* PointToPointNetDevice, a PointToPointChannel class that represents the |
|
55 |
* actual medium across which bits are sent, a PointToPointIpv4Interface class |
|
56 |
* that provides the hook to tie a general purpose node to this specific |
|
57 |
* link, and finally, a PointToPointTopology object that is responsible for |
|
58 |
* putting all of the pieces together. |
|
59 |
* |
|
60 |
* This is the PointToPointNetDevice class that represents, essentially, the |
|
61 |
* PC card that is used to connect to the PointToPoint network. |
|
409
1cbb9ed862d0
add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
402
diff
changeset
|
62 |
*/ |
369
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
63 |
class PointToPointNetDevice : public NetDevice { |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
64 |
public: |
414 | 65 |
/** |
66 |
* Enumeration of the types of traces supported in the class. |
|
67 |
* |
|
68 |
*/ |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
69 |
enum TraceType { |
414 | 70 |
QUEUE, /**< Trace queue events on the attached queue */ |
71 |
RX, /**< Trace packet reception events (from the channel) */ |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
72 |
}; |
414 | 73 |
/** |
74 |
* Construct a PointToPointNetDevice |
|
75 |
* |
|
76 |
* This is the constructor for the PointToPointNetDevice. It takes as a |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
77 |
* parameter the Node to which this device is connected. Ownership of the |
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
78 |
* Node pointer is not implied and the node must not be deleded. |
414 | 79 |
* |
80 |
* @see PointToPointTopology::AddPointToPointLink () |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
607
diff
changeset
|
81 |
* @param node the Node to which this device is connected. |
414 | 82 |
*/ |
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
83 |
PointToPointNetDevice (Ptr<Node> node); |
414 | 84 |
/** |
85 |
* Copy Construct a PointToPointNetDevice |
|
86 |
* |
|
87 |
* This is the copy constructor for the PointToPointNetDevice. This is |
|
88 |
* primarily used in topology creation. |
|
89 |
* |
|
90 |
* @see PointToPointTopology::AddPointToPointLink () |
|
91 |
* @param nd the object to be copied |
|
92 |
*/ |
|
379
ae74e8a7bb44
net device copy and assignment, reference counted channel.
Craig Dowell
parents:
378
diff
changeset
|
93 |
PointToPointNetDevice (const PointToPointNetDevice& nd); |
414 | 94 |
/** |
95 |
* Destroy a PointToPointNetDevice |
|
96 |
* |
|
97 |
* This is the destructor for the PointToPointNetDevice. |
|
98 |
*/ |
|
369
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
99 |
virtual ~PointToPointNetDevice(); |
414 | 100 |
/** |
101 |
* Assignment Operator for a PointToPointNetDevice |
|
102 |
* |
|
103 |
* This is the assignment operator for the PointToPointNetDevice. This is |
|
104 |
* to allow |
|
105 |
* |
|
106 |
* @param nd the object to be copied |
|
107 |
*/ |
|
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
108 |
PointToPointNetDevice& operator= (PointToPointNetDevice nd); |
409
1cbb9ed862d0
add empty template for doxygen doc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
402
diff
changeset
|
109 |
/** |
414 | 110 |
* Set the Data Rate used for transmission of packets. The data rate is |
111 |
* set in the Attach () method from the corresponding field in the channel |
|
112 |
* to which the device is attached. It can be overridden using this method. |
|
113 |
* |
|
114 |
* @see Attach () |
|
115 |
* @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
|
116 |
*/ |
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
117 |
void SetDataRate(DataRate bps); |
414 | 118 |
/** |
119 |
* Set the inteframe gap used to separate packets. The interframe gap |
|
120 |
* defines the minimum space required between packets sent by this device. |
|
121 |
* It is usually set in the Attach () method based on the speed of light |
|
122 |
* delay of the channel to which the device is attached. It can be |
|
123 |
* overridden using this method if desired. |
|
124 |
* |
|
125 |
* @see Attach () |
|
126 |
* @param t the interframe gap time |
|
127 |
*/ |
|
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
128 |
void SetInterframeGap(Time t); |
414 | 129 |
/** |
130 |
* Attach the device to a channel. |
|
131 |
* |
|
132 |
* The PointToPointTopology object creates a PointToPointChannel and two |
|
133 |
* PointtoPointNetDevices. In order to introduce these components to each |
|
134 |
* other, the topology object calls Attach () on each PointToPointNetDevice. |
|
135 |
* Inside this method, the Net Device calls out to the PointToPointChannel |
|
136 |
* to introduce itself. |
|
137 |
* |
|
138 |
* @see PointToPointTopology::AddPointToPointLink () |
|
139 |
* @see SetDataRate () |
|
140 |
* @see SetInterframeGap () |
|
141 |
* @param ch a pointer to the channel to which this object is being attached. |
|
142 |
*/ |
|
568
e1660959ecbb
use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
543
diff
changeset
|
143 |
bool Attach(Ptr<PointToPointChannel> ch); |
414 | 144 |
/** |
145 |
* Attach a queue to the PointToPointNetDevice. |
|
146 |
* |
|
147 |
* The PointToPointNetDevice "owns" a queue. This queue is created by the |
|
148 |
* PointToPointTopology object and implements a queueing method such as |
|
149 |
* DropTail or RED. The PointToPointNetDevice assumes ownership of this |
|
150 |
* queue and must delete it when the device is destroyed. |
|
151 |
* |
|
152 |
* @see PointToPointTopology::AddPointToPointLink () |
|
153 |
* @see Queue |
|
154 |
* @see DropTailQueue |
|
155 |
* @param queue a pointer to the queue for which object is assuming |
|
156 |
* ownership. |
|
157 |
*/ |
|
581
15240a33f517
make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
568
diff
changeset
|
158 |
void AddQueue(Ptr<Queue> queue); |
414 | 159 |
/** |
160 |
* Receive a packet from a connected PointToPointChannel. |
|
161 |
* |
|
162 |
* The PointToPointNetDevice receives packets from its connected channel |
|
163 |
* and forwards them up the protocol stack. This is the public method |
|
164 |
* used by the channel to indicate that the last bit of a packet has |
|
165 |
* arrived at the device. |
|
166 |
* |
|
167 |
* @see PointToPointChannel |
|
168 |
* @param p a reference to the received packet |
|
169 |
*/ |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
170 |
void Receive (Packet& p); |
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
171 |
protected: |
517
702e96b8960f
finish Dispose -> DoDispose rework
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
465
diff
changeset
|
172 |
virtual void DoDispose (void); |
414 | 173 |
/** |
174 |
* Get a copy of the attached Queue. |
|
175 |
* |
|
176 |
* This method is provided for any derived class that may need to get |
|
177 |
* direct access to the underlying queue. |
|
178 |
* |
|
179 |
* @see PointToPointTopology |
|
180 |
* @returns a pointer to the queue. |
|
181 |
*/ |
|
581
15240a33f517
make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
568
diff
changeset
|
182 |
Ptr<Queue> GetQueue(void) const; |
414 | 183 |
/** |
184 |
* Get a copy of the attached Channel |
|
185 |
* |
|
186 |
* This method is provided for any derived class that may need to get |
|
187 |
* direct access to the connected channel |
|
188 |
* |
|
189 |
* @see PointToPointChannel |
|
190 |
* @returns a pointer to the channel |
|
191 |
*/ |
|
568
e1660959ecbb
use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
543
diff
changeset
|
192 |
virtual Ptr<Channel> DoGetChannel(void) const; |
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
193 |
private: |
414 | 194 |
/** |
195 |
* Send a Packet Down the Wire. |
|
196 |
* |
|
197 |
* The SendTo method is defined as the standard way that the level three |
|
198 |
* protocol uses to tell a NetDevice to send a packet. SendTo is declared |
|
199 |
* as abstract in the NetDevice class and we declare it here. |
|
200 |
* |
|
201 |
* @see NetDevice |
|
202 |
* @param p a reference to the packet to send |
|
203 |
* @param dest a reference to the MacAddress of the destination device |
|
204 |
* @returns true if success, false on failure |
|
205 |
*/ |
|
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
206 |
virtual bool SendTo (Packet& p, const MacAddress& dest); |
414 | 207 |
/** |
208 |
* Start Sending a Packet Down the Wire. |
|
209 |
* |
|
210 |
* The TransmitStart method is the method that is used internally in the |
|
211 |
* PointToPointNetDevice to begin the process of sending a packet out on |
|
212 |
* the channel. The corresponding method is called on the channel to let |
|
213 |
* it know that the physical device this class represents has virually |
|
214 |
* started sending signals. An event is scheduled for the time at which |
|
215 |
* the bits have been completely transmitted. |
|
216 |
* |
|
217 |
* @see PointToPointChannel::TransmitStart () |
|
218 |
* @see TransmitCompleteEvent () |
|
219 |
* @param p a reference to the packet to send |
|
220 |
* @returns true if success, false on failure |
|
221 |
*/ |
|
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
222 |
bool TransmitStart (Packet &p); |
414 | 223 |
/** |
224 |
* Stop Sending a Packet Down the Wire and Begin the Interframe Gap. |
|
225 |
* |
|
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
226 |
* The TransmitCompleteEvent method is used internally to finish the process |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
227 |
* of sending a packet out on the channel. During execution of this method |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
228 |
* the TransmitEnd method is called on the channel to let it know that the |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
229 |
* physical device this class represents has virually finished sending |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
230 |
* signals. The channel uses this event to begin its speed of light delay |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
231 |
* timer after which it notifies the Net Device at the other end of the |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
232 |
* link that the bits have arrived. During this method, the net device |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
233 |
* also schedules the TransmitReadyEvent at which time the transmitter |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
234 |
* becomes ready to send the next packet. |
414 | 235 |
* |
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
236 |
* @see PointToPointChannel::TransmitEnd () |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
237 |
* @see TransmitReadyEvent () |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
238 |
* @returns true if success, false on failure |
414 | 239 |
*/ |
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
240 |
void TransmitCompleteEvent (void); |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
241 |
/** |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
242 |
* Cause the Transmitter to Become Ready to Send Another Packet. |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
243 |
* |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
244 |
* The TransmitReadyEvent method is used internally to re-enable the |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
245 |
* transmit machine of the net device. It is scheduled after a suitable |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
246 |
* interframe gap after the completion of the previous transmission. |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
247 |
* The queue is checked at this time, and if there is a packet waiting on |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
248 |
* the queue, the transmission process is begun. |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
249 |
* |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
250 |
* @see TransmitStart () |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
251 |
*/ |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
252 |
void TransmitReadyEvent (void); |
414 | 253 |
/** |
254 |
* Create a Trace Resolver for events in the net device. |
|
255 |
* |
|
256 |
* @see class TraceResolver |
|
257 |
*/ |
|
345
47b41507a45a
move channel.cc channel.h to node directory; merge ns-3-tracing from mathieu
Tom Henderson <tomh@tomh.org>
parents:
331
diff
changeset
|
258 |
virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context); |
445
10cd9049a0ad
add NetDevice::NeedsArp method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
419
diff
changeset
|
259 |
virtual bool DoNeedsArp (void) const; |
414 | 260 |
/** |
261 |
* Enumeration of the states of the transmit machine of the net device. |
|
262 |
*/ |
|
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
263 |
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
|
264 |
{ |
414 | 265 |
READY, /**< The transmitter is ready to begin transmission of a packet */ |
773
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
266 |
BUSY, /**< The transmitter is busy transmitting a packet */ |
18ad0b94e2ae
back out unfinished p2p changes
Tom Henderson <tomh@tomh.org>
parents:
767
diff
changeset
|
267 |
GAP /**< The transmitter is in the interframe gap time */ |
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
268 |
}; |
414 | 269 |
/** |
270 |
* The state of the Net Device transmit state machine. |
|
271 |
* @see TxMachineState |
|
272 |
*/ |
|
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
273 |
TxMachineState m_txMachineState; |
414 | 274 |
/** |
275 |
* The data rate that the Net Device uses to simulate packet transmission |
|
276 |
* timing. |
|
277 |
* @see class DataRate |
|
278 |
*/ |
|
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
279 |
DataRate m_bps; |
414 | 280 |
/** |
281 |
* The interframe gap that the Net Device uses to throttle packet |
|
282 |
* transmission |
|
283 |
* @see class Time |
|
284 |
*/ |
|
378
32bd402ea5ea
remove unused files, remove notion of PHY, make more realistic p2p-net-device and p2p-channel
Craig Dowell
parents:
369
diff
changeset
|
285 |
Time m_tInterframeGap; |
414 | 286 |
/** |
287 |
* The PointToPointChannel to which this PointToPointNetDevice has been |
|
288 |
* attached. |
|
289 |
* @see class PointToPointChannel |
|
290 |
*/ |
|
568
e1660959ecbb
use Ptr<> everywhere Object or NsUnknown are used
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
543
diff
changeset
|
291 |
Ptr<PointToPointChannel> m_channel; |
414 | 292 |
/** |
293 |
* The Queue which this PointToPointNetDevice uses as a packet source. |
|
294 |
* Management of this Queue has been delegated to the PointToPointNetDevice |
|
295 |
* and it has the responsibility for deletion. |
|
296 |
* @see class Queue |
|
297 |
* @see class DropTailQueue |
|
298 |
*/ |
|
581
15240a33f517
make Queue derive from Interface
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
568
diff
changeset
|
299 |
Ptr<Queue> m_queue; |
414 | 300 |
/** |
301 |
* The trace source for the packet reception events that the device can |
|
302 |
* fire. |
|
303 |
* |
|
304 |
* @see class CallBackTraceSource |
|
305 |
* @see class TraceResolver |
|
306 |
*/ |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
307 |
CallbackTraceSource<Packet &> m_rxTrace; |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
308 |
}; |
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
309 |
|
368
1df1165d6a68
Rename file names from serial to p2p
Tom Henderson <tomh@tomh.org>
parents:
345
diff
changeset
|
310 |
}; // namespace ns3 |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
311 |
|
369
29ea5d1a83c8
Rename classes from Serial to PointToPoint
Tom Henderson <tomh@tomh.org>
parents:
368
diff
changeset
|
312 |
#endif // POINT_TO_POINT_NET_DEVICE_H |
245
28ba3a5cdff8
add p2p netdevice and channel
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
313 |