99 "Trace source indicating a packet has been dropped by the device before transmission", |
99 "Trace source indicating a packet has been dropped by the device before transmission", |
100 MakeTraceSourceAccessor (&CsmaNetDevice::m_macTxDropTrace)) |
100 MakeTraceSourceAccessor (&CsmaNetDevice::m_macTxDropTrace)) |
101 .AddTraceSource ("MacRx", |
101 .AddTraceSource ("MacRx", |
102 "Trace source indicating a packet has been received by this device and is being forwarded up the stack", |
102 "Trace source indicating a packet has been received by this device and is being forwarded up the stack", |
103 MakeTraceSourceAccessor (&CsmaNetDevice::m_macRxTrace)) |
103 MakeTraceSourceAccessor (&CsmaNetDevice::m_macRxTrace)) |
|
104 #if 0 |
|
105 // Not currently implemented in this device |
|
106 .AddTraceSource ("MacRxDrop", |
|
107 "Trace source indicating a packet was received, but dropped before being forwarded up the stack", |
|
108 MakeTraceSourceAccessor (&CsmaNetDevice::m_macRxDropTrace)) |
|
109 #endif |
|
110 .AddTraceSource ("MacTxBackoff", |
|
111 "Trace source indicating a packet has been delayed by the CSMA backoff process", |
|
112 MakeTraceSourceAccessor (&CsmaNetDevice::m_macTxBackoffTrace)) |
104 // |
113 // |
105 // Trace souces at the "bottom" of the net device, where packets transition |
114 // Trace souces at the "bottom" of the net device, where packets transition |
106 // to/from the channel. |
115 // to/from the channel. |
107 // |
116 // |
108 .AddTraceSource ("PhyTxStart", |
117 .AddTraceSource ("PhyTxBegin", |
109 "Trace source indicating a packet has begun transmitting over the channel", |
118 "Trace source indicating a packet has begun transmitting over the channel", |
110 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxStartTrace)) |
119 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxBeginTrace)) |
111 .AddTraceSource ("PhyTx", |
120 .AddTraceSource ("PhyTxEnd", |
112 "Trace source indicating a packet has been completely transmitted over the channel", |
121 "Trace source indicating a packet has been completely transmitted over the channel", |
113 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxTrace)) |
122 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxEndTrace)) |
114 .AddTraceSource ("PhyTxDrop", |
123 .AddTraceSource ("PhyTxDrop", |
115 "Trace source indicating a packet has been dropped by the device during transmission", |
124 "Trace source indicating a packet has been dropped by the device during transmission", |
116 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxDropTrace)) |
125 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxDropTrace)) |
117 .AddTraceSource ("PhyRxStart", |
126 #if 0 |
|
127 // Not currently implemented in this device |
|
128 .AddTraceSource ("PhyRxBegin", |
118 "Trace source indicating a packet has begun being received by the device", |
129 "Trace source indicating a packet has begun being received by the device", |
119 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxStartTrace)) |
130 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxBeginTrace)) |
120 .AddTraceSource ("PhyRx", |
131 #endif |
|
132 .AddTraceSource ("PhyRxEnd", |
121 "Trace source indicating a packet has been completely received by the device", |
133 "Trace source indicating a packet has been completely received by the device", |
122 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxTrace)) |
134 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxEndTrace)) |
123 .AddTraceSource ("PhyRxDrop", |
135 .AddTraceSource ("PhyRxDrop", |
124 "Trace source indicating a packet has been dropped by the device during reception", |
136 "Trace source indicating a packet has been dropped by the device during reception", |
125 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxDropTrace)) |
137 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyRxDropTrace)) |
126 .AddTraceSource ("PhyTxBackoff", |
|
127 "Trace source indicating a packet has been delayed by the CSMA backoff process", |
|
128 MakeTraceSourceAccessor (&CsmaNetDevice::m_phyTxBackoffTrace)) |
|
129 |
|
130 // |
138 // |
131 // Trace sources designed to simulate a packet sniffer facility (tcpdump). |
139 // Trace sources designed to simulate a packet sniffer facility (tcpdump). |
132 // |
140 // |
133 .AddTraceSource ("Sniffer", |
141 .AddTraceSource ("Sniffer", |
134 "Trace source simulating a non-promiscuous packet sniffer attached to the device", |
142 "Trace source simulating a non-promiscuous packet sniffer attached to the device", |
541 // Transmission succeeded, reset the backoff time parameters and |
549 // Transmission succeeded, reset the backoff time parameters and |
542 // schedule a transmit complete event. |
550 // schedule a transmit complete event. |
543 // |
551 // |
544 m_backoff.ResetBackoffTime (); |
552 m_backoff.ResetBackoffTime (); |
545 m_txMachineState = BUSY; |
553 m_txMachineState = BUSY; |
546 m_phyTxStartTrace (m_currentPkt); |
554 m_phyTxBeginTrace (m_currentPkt); |
547 |
555 |
548 Time tEvent = Seconds (m_bps.CalculateTxTime (m_currentPkt->GetSize ())); |
556 Time tEvent = Seconds (m_bps.CalculateTxTime (m_currentPkt->GetSize ())); |
549 NS_LOG_LOGIC ("Schedule TransmitCompleteEvent in " << tEvent.GetSeconds () << "sec"); |
557 NS_LOG_LOGIC ("Schedule TransmitCompleteEvent in " << tEvent.GetSeconds () << "sec"); |
550 Simulator::Schedule (tEvent, &CsmaNetDevice::TransmitCompleteEvent, this); |
558 Simulator::Schedule (tEvent, &CsmaNetDevice::TransmitCompleteEvent, this); |
551 } |
559 } |