Skip to content
Closed
Show file tree
Hide file tree
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
Register callbacks on TCLayer and NetDevices, RX side
  • Loading branch information
natale-p authored and stavallo committed Jan 15, 2016
commit cbafa49b9d0064774b79b9c572286235e377e921
20 changes: 15 additions & 5 deletions src/internet/model/ipv4-l3-protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "ns3/ipv4-header.h"
#include "ns3/boolean.h"
#include "ns3/ipv4-routing-table-entry.h"
#include "ns3/traffic-control-layer.h"

#include "loopback-net-device.h"
#include "arp-l3-protocol.h"
Expand Down Expand Up @@ -369,12 +370,21 @@ uint32_t
Ipv4L3Protocol::AddInterface (Ptr<NetDevice> device)
{
NS_LOG_FUNCTION (this << device);
NS_ASSERT (m_node != 0);

Ptr<Node> node = GetObject<Node> ();
node->RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, this),
Ipv4L3Protocol::PROT_NUMBER, device);
node->RegisterProtocolHandler (MakeCallback (&ArpL3Protocol::Receive, PeekPointer (GetObject<ArpL3Protocol> ())),
ArpL3Protocol::PROT_NUMBER, device);
Ptr<TrafficControlLayer> tc = m_node->GetObject<TrafficControlLayer> ();

NS_ASSERT (tc != 0);

m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
Ipv4L3Protocol::PROT_NUMBER, device);
m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
ArpL3Protocol::PROT_NUMBER, device);

tc->RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, this),
Ipv4L3Protocol::PROT_NUMBER, device);
tc->RegisterProtocolHandler (MakeCallback (&ArpL3Protocol::Receive, PeekPointer (GetObject<ArpL3Protocol> ())),
ArpL3Protocol::PROT_NUMBER, device);

Ptr<Ipv4Interface> interface = CreateObject<Ipv4Interface> ();
interface->SetNode (m_node);
Expand Down
13 changes: 11 additions & 2 deletions src/internet/model/ipv6-l3-protocol.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "ns3/ipv6-route.h"
#include "ns3/mac16-address.h"
#include "ns3/mac64-address.h"
#include "ns3/traffic-control-layer.h"

#include "loopback-net-device.h"
#include "ipv6-l3-protocol.h"
Expand Down Expand Up @@ -189,10 +190,18 @@ Ptr<Ipv6RoutingProtocol> Ipv6L3Protocol::GetRoutingProtocol () const
uint32_t Ipv6L3Protocol::AddInterface (Ptr<NetDevice> device)
{
NS_LOG_FUNCTION (this << device);
Ptr<Node> node = GetObject<Node> ();
Ptr<Ipv6Interface> interface = CreateObject<Ipv6Interface> ();

node->RegisterProtocolHandler (MakeCallback (&Ipv6L3Protocol::Receive, this), Ipv6L3Protocol::PROT_NUMBER, device);
Ptr<TrafficControlLayer> tc = m_node->GetObject<TrafficControlLayer> ();

NS_ASSERT (tc != 0);

m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
Ipv6L3Protocol::PROT_NUMBER, device);

tc->RegisterProtocolHandler (MakeCallback (&Ipv6L3Protocol::Receive, this),
Ipv6L3Protocol::PROT_NUMBER, device);

interface->SetNode (m_node);
interface->SetDevice (device);
interface->SetForwarding (m_ipForward);
Expand Down