Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
187d091
Added Traffic Control Layer
natale-p Oct 7, 2015
eb9a024
Internet depends on traffic-control
natale-p Oct 7, 2015
262931f
Made public ProtocolHandlerEntry struct in node.h
natale-p Oct 7, 2015
80baa0f
Aggregate TrafficControlLayer on any Internet-enabled node
natale-p Oct 7, 2015
9285b11
Aggregate TCLayer by default on tests
natale-p Oct 7, 2015
cbafa49
Register callbacks on TCLayer and NetDevices, RX side
natale-p Oct 7, 2015
11f20e7
Use traffic-control to send packets
natale-p Oct 7, 2015
0c814e4
Initial support for multiple transmission queues inside NetDevices
stavallo Nov 19, 2015
ef2c685
WifiNetDevices can return the number of transmission queues based on …
stavallo Nov 19, 2015
bb27480
Flow control Part I: NetDeviceQueues can be started, stopped and woken
stavallo Oct 20, 2015
610f9c7
PointToPointNetDevice: Add support for flow control
stavallo Nov 12, 2015
251787d
NetDevices return the index of the transmission queue they select for…
stavallo Nov 20, 2015
bd130e8
Make Queue store QueueItem objects
stavallo Jan 5, 2016
2bf15fb
Add the QueueDisc base class
stavallo Oct 23, 2015
6e6ba99
The traffic control layer enqueues packets in the queue disc
stavallo Dec 4, 2015
4dd14d5
Defer the addition of the IP header until the packet is extracted fro…
stavallo Jan 6, 2016
9881fe5
Ipv4Header: Add GetVersion and make DscpTypeToString static
stavallo Jan 8, 2016
106f8f2
Add the pfifo_fast queue disc
stavallo Jan 9, 2016
7d99326
Add a queue disc helper to ease the installation of queue discs
stavallo Dec 2, 2015
d850946
Add a traffic control example
pasquimp Nov 25, 2015
0815e6b
Add a pfifo_fast test suite
pasquimp Dec 14, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PointToPointNetDevice: Add support for flow control
The (unique) transmission queue is stopped when enqueuing a packet fails, so
that upper layers do not send other packets down. When a packet transmission
is completed, if the queue is empty then wake the upper layers. If the queue
was stopped, there is now room for another packet and hence wake the upper
layers as well.
  • Loading branch information
stavallo committed Jan 15, 2016
commit 610f9c7b814b944b90e5e68ba20c7b44c8ed5f04
23 changes: 19 additions & 4 deletions src/point-to-point/model/point-to-point-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,26 @@ PointToPointNetDevice::TransmitComplete (void)
m_phyTxEndTrace (m_currentPkt);
m_currentPkt = 0;

Ptr<NetDeviceQueue> txq = GetTxQueue (0);

Ptr<Packet> p = m_queue->Dequeue ();
if (p == 0)
{
//
// No packet was on the queue, so we just exit.
//
NS_LOG_LOGIC ("No pending packets in device queue after tx complete");
txq->Wake ();
return;
}

//
// Got another packet off of the queue, so start the transmit process agin.
// Got another packet off of the queue, so start the transmit process again.
// If the queue was stopped, start it again. Note that we cannot wake the upper
// layers because otherwise a packet is sent to the device while the machine
// state is busy, thus causing the assert in TransmitStart to fail.
//
if (txq->IsStopped ())
{
txq->Start ();
}
m_snifferTrace (p);
m_promiscSnifferTrace (p);
TransmitStart (p);
Expand Down Expand Up @@ -510,6 +518,12 @@ PointToPointNetDevice::Send (
const Address &dest,
uint16_t protocolNumber)
{
Ptr<NetDeviceQueue> txq = GetTxQueue (0);
if (txq->IsStopped ())
{
NS_LOG_WARN ("Send should not be called when the device is stopped");
}

NS_LOG_FUNCTION (this << packet << dest << protocolNumber);
NS_LOG_LOGIC ("p=" << packet << ", dest=" << &dest);
NS_LOG_LOGIC ("UID is " << packet->GetUid ());
Expand Down Expand Up @@ -552,6 +566,7 @@ PointToPointNetDevice::Send (

// Enqueue may fail (overflow)
m_macTxDropTrace (packet);
txq->Stop ();
return false;
}

Expand Down