An OpenFlow 1.3 device that switches multiple CSMA segments via OpenFlow protocol. More...
#include "ofswitch13-device.h"
Classes | |
struct | PipelinePacket |
Structure to save packet metadata while it is under OpenFlow pipeline. More... | |
class | RemoteController |
Inner class to save information of a remote active controller connected to this OpenFlow switch. More... | |
Public Member Functions | |
OFSwitch13Device () | |
Default constructor. More... | |
~OFSwitch13Device () override | |
Dummy destructor, see DoDispose. More... | |
uint64_t | GetDatapathId () const |
Get the OpenFlow datapath ID. More... | |
uint64_t | GetDpId () const |
Alias for the GetDatapathId () method. More... | |
OpenFLow control channel counter accessors. | |
| |
uint64_t | GetFlowModCounter () const |
uint64_t | GetGroupModCounter () const |
uint64_t | GetMeterModCounter () const |
uint64_t | GetPacketInCounter () const |
uint64_t | GetPacketOutCounter () const |
![]() | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () const |
Check if the object has been initialized. More... | |
![]() | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId () |
Register this type. More... | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Datapath internal accessors. | |||
| |||
typedef void(* | MeterDropTracedCallback) (Ptr< const Packet > packet, uint32_t meterId) | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
typedef void(* | TableDropTracedCallback) (Ptr< const Packet > packet, uint8_t tableId) | ||
TracedCallback signature for unmatched packets dropped by flow tables without table-miss entries. More... | |||
typedef void(* | DeviceTracedCallback) (Ptr< const OFSwitch13Device > dev) | ||
TracedCallback signature for OpenFlow switch device. More... | |||
uint32_t | GetBufferEntries () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetBufferSize () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
double | GetBufferUsage () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
DataRate | GetCpuCapacity () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
DataRate | GetCpuLoad () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
double | GetCpuUsage () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
Time | GetDatapathTimeout () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetDftFlowTableSize () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetFlowTableEntries (uint8_t tableId) const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetFlowTableSize (uint8_t tableId) const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
double | GetFlowTableUsage (uint8_t tableId) const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetGroupTableEntries () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetGroupTableSize () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
double | GetGroupTableUsage () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetMeterTableEntries () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetMeterTableSize () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
double | GetMeterTableUsage () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetNControllers () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetNPipelineTables () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetNSwitchPorts () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
Time | GetPipelineDelay () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
uint32_t | GetSumFlowEntries () const | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
struct datapath * | GetDatapathStruct () | ||
Get a pointer to the internal BOFUSS datapath structure. More... | |||
Ptr< OFSwitch13Port > | AddSwitchPort (Ptr< NetDevice > portDevice) | ||
Add a 'port' to the switch device. More... | |||
Ptr< OFSwitch13Port > | GetSwitchPort (uint32_t no) const | ||
Get the OFSwitch13Port pointer from its number. More... | |||
void | ReceiveFromSwitchPort (Ptr< Packet > packet, uint32_t portNo, uint64_t tunnelId=0) | ||
Called when a packet is received on one of the switch's ports. More... | |||
void | StartControllerConnection (Address ctrlAddr) | ||
Starts the TCP connection between this switch and the target controller indicated by the address parameter. More... | |||
static void | SendPacketToController (struct pipeline *pl, struct packet *pkt, uint8_t tableId, uint8_t reason) | ||
Overriding BOFUSS send_packet_to_controller weak function from udatapath/pipeline.c. More... | |||
static int | SendOpenflowBufferToRemote (struct ofpbuf *buffer, struct remote *remote) | ||
Overriding BOFUSS send_openflow_buffer_to_remote weak function from udatapath/datapath.c. More... | |||
static void | DpActionsOutputPort (struct packet *pkt, uint32_t outPort, uint32_t outQueue, uint16_t maxLength, uint64_t cookie) | ||
Overriding BOFUSS dp_actions_output_port weak function from udatapath/dp_actions.c. More... | |||
static void | MeterCreatedCallback (struct meter_entry *entry) | ||
Callback fired when a new meter entry is created at meter table. More... | |||
static void | MeterDropCallback (struct packet *pkt, struct meter_entry *entry) | ||
Callback fired when a packet is dropped by meter band. More... | |||
static void | TableDropCallback (struct packet *pkt, struct flow_table *table) | ||
Callback fired when an unmatched packet is dropped by a flow table without a table-miss entry. More... | |||
static void | PacketCloneCallback (struct packet *pkt, struct packet *clone) | ||
Callback fired when a packet is cloned. More... | |||
static void | PacketDestroyCallback (struct packet *pkt) | ||
Callback fired when a packet is destroyed. More... | |||
static void | BufferSaveCallback (struct packet *pkt, time_t timeout) | ||
Callback fired when a packet is saved into buffer. More... | |||
static void | BufferRetrieveCallback (struct packet *pkt) | ||
Callback fired when a packet is retrieved from buffer. More... | |||
static Ptr< OFSwitch13Device > | GetDevice (uint64_t id) | ||
Retrieve and existing OpenFlow device object by its datapath ID. More... | |||
void | DoDispose () override | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
void | NotifyConstructionCompleted () override | ||
TracedCallback signature for packets dropped by meter bands. More... | |||
struct datapath * | DatapathNew () | ||
Creates a new datapath. More... | |||
Adjust OpenFlow switch table sizes. | |||||
| |||||
typedef std::vector< Ptr< OFSwitch13Port > > | PortList_t | ||||
Structure to save the list of ports in this datapath. More... | |||||
typedef std::vector< Ptr< OFSwitch13Device::RemoteController > > | CtrlList_t | ||||
Structure to save the list of active controllers. More... | |||||
typedef std::map< uint64_t, Ptr< OFSwitch13Device > > | DpIdDevMap_t | ||||
Structure to map datapath id to OpenFlow device. More... | |||||
typedef std::map< uint64_t, Ptr< Packet > > | IdPacketMap_t | ||||
Structure to save packets, indexed by its id. More... | |||||
TracedCallback< Ptr< const Packet > > | m_bufferExpireTrace | ||||
Trace source fired when a packet in buffer expires. More... | |||||
TracedCallback< Ptr< const Packet > > | m_bufferRetrieveTrace | ||||
Trace source fired when a packet is retrieved from buffer. More... | |||||
TracedCallback< Ptr< const Packet > > | m_bufferSaveTrace | ||||
Trace source fired when a packet is saved into buffer. More... | |||||
TracedCallback< Ptr< const OFSwitch13Device > > | m_datapathTimeoutTrace | ||||
Trace source fired when the datapath timeout operation is completed. More... | |||||
TracedCallback< Ptr< const Packet > > | m_loadDropTrace | ||||
Trace source fired when a packet is dropped due to overloaded switch. More... | |||||
TracedCallback< Ptr< const Packet >, uint32_t > | m_meterDropTrace | ||||
Trace source fired when a packet is dropped by a meter band. More... | |||||
TracedCallback< Ptr< const Packet >, uint8_t > | m_tableDropTrace | ||||
Trace source fired when an unmatched packet is dropped by flow table. More... | |||||
TracedCallback< Ptr< const Packet > > | m_pipePacketTrace | ||||
Trace source fired when a packet is sent to pipeline. More... | |||||
TracedValue< uint32_t > | m_groupEntries | ||||
Number of entries in group table. More... | |||||
TracedValue< uint32_t > | m_meterEntries | ||||
Number of entries in meter table. More... | |||||
TracedValue< uint32_t > | m_sumFlowEntries | ||||
Sum of entries in all flow tables. More... | |||||
TracedValue< Time > | m_pipeDelay | ||||
Average delay for pipeline packet processing. More... | |||||
TracedValue< DataRate > | m_cpuLoad | ||||
Average CPU processing load. More... | |||||
uint64_t | m_dpId | ||||
This datapath id. More... | |||||
Time | m_timeout | ||||
Datapath timeout interval. More... | |||||
Time | m_lastTimeout | ||||
Datapath last timeout. More... | |||||
Time | m_tcamDelay | ||||
Flow Table TCAM lookup delay. More... | |||||
std::string | m_libLog | ||||
The BOFUSS library log level. More... | |||||
struct datapath * | m_datapath | ||||
BOFUSS datapath structure. More... | |||||
PortList_t | m_ports | ||||
List of switch ports. More... | |||||
CtrlList_t | m_controllers | ||||
Collection of active controllers. More... | |||||
uint32_t | m_flowTabSize | ||||
Flow table maximum entries. More... | |||||
uint32_t | m_groupTabSize | ||||
Group table maximum entries. More... | |||||
uint32_t | m_meterTabSize | ||||
Meter table maximum entries. More... | |||||
uint32_t | m_numPipeTabs | ||||
Number of pipeline flow tables. More... | |||||
IdPacketMap_t | m_bufferPkts | ||||
Packets saved in switch buffer. More... | |||||
uint32_t | m_bufferSize | ||||
Buffer size in terms of packets. More... | |||||
PipelinePacket | m_pipePkt | ||||
Packet under switch pipeline. More... | |||||
DataRate | m_cpuCapacity | ||||
CPU processing capacity. More... | |||||
uint64_t | m_cpuConsumed | ||||
CPU processing tokens consumed. More... | |||||
uint64_t | m_cpuTokens | ||||
CPU processing tokens available. More... | |||||
uint64_t | m_cFlowMod | ||||
Pipeline flow mod counter. More... | |||||
uint64_t | m_cGroupMod | ||||
Pipeline group mod counter. More... | |||||
uint64_t | m_cMeterMod | ||||
Pipeline meter mod counter. More... | |||||
uint64_t | m_cPacketIn | ||||
Pipeline packet in counter. More... | |||||
uint64_t | m_cPacketOut | ||||
Pipeline packet out counter. More... | |||||
static uint64_t | m_globalDpId = 0 | ||||
Global counter for datapath IDs. More... | |||||
static uint64_t | m_globalPktId = 0 | ||||
Global counter for packets IDs. More... | |||||
static DpIdDevMap_t | m_globalSwitchMap | ||||
As the integration of BOFUSS and ns-3 involve overriding some C functions, we are using a global map to store a pointer to all OFSwitch13Device objects in simulation, and allow faster object retrieve by datapath id. More... | |||||
void | SetFlowTableSize (uint8_t tableId, uint32_t value) | ||||
Structure to save the list of ports in this datapath. More... | |||||
void | SetDftFlowTableSize (uint32_t value) | ||||
Structure to save the list of ports in this datapath. More... | |||||
void | SetGroupTableSize (uint32_t value) | ||||
Structure to save the list of ports in this datapath. More... | |||||
void | SetMeterTableSize (uint32_t value) | ||||
Structure to save the list of ports in this datapath. More... | |||||
void | DatapathTimeout (struct datapath *dp) | ||||
Check if any flow in any table is timed out and update port status. More... | |||||
int | SendPacketInMessage (struct packet *pkt, uint8_t tableId, uint8_t reason, uint16_t maxLength, uint64_t cookie=0) | ||||
Create an OpenFlow packet in message and send the packet to all controllers with open connections. More... | |||||
bool | SendToSwitchPort (struct packet *pkt, uint32_t portNo, uint32_t queueNo=0) | ||||
Send a message over a specific switch port. More... | |||||
void | SendToPipeline (Ptr< Packet > packet, uint32_t portNo, uint64_t tunnelId=0) | ||||
Send the packet to the OpenFlow BOFUSS pipeline. More... | |||||
int | SendToController (Ptr< Packet > packet, Ptr< OFSwitch13Device::RemoteController > remoteCtrl) | ||||
Send a packet to the controller node. More... | |||||
void | ReceiveFromController (Ptr< Packet > packet, Address from) | ||||
Receive an OpenFlow packet from controller. More... | |||||
int | ReplyWithErrorMessage (ofl_err error, struct ofpbuf *buffer, struct sender *senderCtrl) | ||||
Create an OpenFlow error message and send it back to the sender controller. More... | |||||
void | SocketCtrlSucceeded (Ptr< Socket > socket) | ||||
Socket callback fired when a TCP connection to controller succeed. More... | |||||
void | SocketCtrlFailed (Ptr< Socket > socket) | ||||
Socket callback fired when a TCP connection to controller fail. More... | |||||
void | NotifyMeterEntryCreated (struct meter_entry *entry) | ||||
Notify this device of a new meter entry created at meter table. More... | |||||
void | NotifyPacketCloned (struct packet *pkt, struct packet *clone) | ||||
Notify this device of a packet cloned by the OpenFlow pipeline. More... | |||||
void | NotifyPacketDestroyed (struct packet *pkt) | ||||
Notify this device of a packet destroyed by the OpenFlow pipeline. More... | |||||
void | NotifyPacketDroppedByMeter (struct packet *pkt, struct meter_entry *entry) | ||||
Notify this device of a packet dropped by OpenFlow meter band. More... | |||||
void | NotifyPacketDroppedByTable (struct packet *pkt, struct flow_table *table) | ||||
Notify this device of an unmatched packet dropped by OpenFlow flow table without a table-miss entry. More... | |||||
void | BufferPacketSave (uint64_t packetId, time_t timeout) | ||||
Notify this device of a packet saved into buffer. More... | |||||
void | BufferPacketRetrieve (uint64_t packetId) | ||||
Notify this device of a packet retrieved from buffer. More... | |||||
void | BufferPacketDelete (uint64_t packetId) | ||||
Delete the ns-3 packet from buffer map. More... | |||||
Ptr< OFSwitch13Device::RemoteController > | GetRemoteController (Ptr< Socket > socket) | ||||
Get the remote controller for this socket. More... | |||||
Ptr< OFSwitch13Device::RemoteController > | GetRemoteController (Address address) | ||||
Get the remote controller for this address. More... | |||||
Ptr< OFSwitch13Device::RemoteController > | GetRemoteController (struct remote *remote) | ||||
Get the remote controller for this BOFUSS remote pointer. More... | |||||
static uint64_t | GetNewPacketId () | ||||
Increase the global packet ID counter and return a new packet ID. More... | |||||
static bool | CopyTags (Ptr< const Packet > srcPkt, Ptr< const Packet > dstPkt) | ||||
Copy all tags (packet and byte) from srcPkt packet to dstPkt packet. More... | |||||
static void | RegisterDatapath (uint64_t id, Ptr< OFSwitch13Device > dev) | ||||
Insert a new OpenFlow device in global map. More... | |||||
static void | UnregisterDatapath (uint64_t id) | ||||
Remove an existing OpenFlow device from global map. More... | |||||
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
An OpenFlow 1.3 device that switches multiple CSMA segments via OpenFlow protocol.
Introspection did not find any typical Config paths.
It takes a collection of ports, each one associated with a ns-3 underlying CsmaNetDevice. The device acts as the intermediary between the ports, receiving a packet from one port and forwarding it to another.
The OpenFlow switch datapath implementation (flow tables, group table, and meter table) is provided by the BOFUSS library. For this reason, packets entering the switch are sent to the library for OpenFlow pipeline processing before being forwarded to the correct output port(s). OpenFlow messages received from the controller are also sent to the library for datapath configuration.
DataRate
Time
+0ns:+9.22337e+18ns Time
+1e+06ns:+1e+09ns Size of this type is 680 bytes (on a 64-bit architecture).
Definition at line 53 of file ofswitch13-device.h.
|
private |
Structure to save the list of active controllers.
Definition at line 611 of file ofswitch13-device.h.
typedef void(* ns3::OFSwitch13Device::DeviceTracedCallback) (Ptr< const OFSwitch13Device > dev) |
TracedCallback signature for OpenFlow switch device.
deve | The OpenFlow switch device pointer. |
Definition at line 369 of file ofswitch13-device.h.
|
private |
Structure to map datapath id to OpenFlow device.
Definition at line 614 of file ofswitch13-device.h.
|
private |
Structure to save packets, indexed by its id.
Definition at line 617 of file ofswitch13-device.h.
typedef void(* ns3::OFSwitch13Device::MeterDropTracedCallback) (Ptr< const Packet > packet, uint32_t meterId) |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 353 of file ofswitch13-device.h.
|
private |
Structure to save the list of ports in this datapath.
Definition at line 608 of file ofswitch13-device.h.
typedef void(* ns3::OFSwitch13Device::TableDropTracedCallback) (Ptr< const Packet > packet, uint8_t tableId) |
TracedCallback signature for unmatched packets dropped by flow tables without table-miss entries.
packet | The dropped packet. |
tableId | The flow table ID that dropped the packet. |
Definition at line 362 of file ofswitch13-device.h.
ns3::OFSwitch13Device::OFSwitch13Device | ( | ) |
Default constructor.
Definition at line 45 of file ofswitch13-device.cc.
References m_dpId, m_globalDpId, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, and RegisterDatapath().
|
override |
Dummy destructor, see DoDispose.
Definition at line 64 of file ofswitch13-device.cc.
References NS_LOG_FUNCTION.
Ptr< OFSwitch13Port > ns3::OFSwitch13Device::AddSwitchPort | ( | Ptr< NetDevice > | portDevice | ) |
Add a 'port' to the switch device.
This method adds a new switch port to a OFSwitch13Device, so that the new switch port NetDevice becomes part of the switch and L2 frames start being forwarded to/from this OpenFlow device. The current implementation only supports CsmaNetDevice (for physical ports) or VirtualNetDevice (for logical ports). Keep in mind that an OpenFlow switch expects to receive packets with Ethernet header from port devices).
portDevice | The NetDevice port to add. |
Definition at line 430 of file ofswitch13-device.cc.
References GetNSwitchPorts(), ns3::OFSwitch13Port::GetPortNo(), m_datapath, m_ports, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.
|
private |
Delete the ns-3 packet from buffer map.
packetId | The ns-3 packet id. |
Definition at line 1364 of file ofswitch13-device.cc.
References m_bufferExpireTrace, m_bufferPkts, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by BufferPacketSave(), and NotifyPacketDestroyed().
|
private |
Notify this device of a packet retrieved from buffer.
This method will get the ns-3 packet from buffer map and put it back into pipeline.
packetId | The ns-3 packet id. |
Definition at line 1344 of file ofswitch13-device.cc.
References ns3::OFSwitch13Device::PipelinePacket::GetPacket(), ns3::OFSwitch13Device::PipelinePacket::IsValid(), m_bufferPkts, m_bufferRetrieveTrace, m_pipePkt, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::OFSwitch13Device::PipelinePacket::SetPacket().
|
private |
Notify this device of a packet saved into buffer.
This method will get the ns-3 packet in pipeline and save into buffer map.
packetId | The ns-3 packet id. |
timeout | The buffer timeout. |
Definition at line 1313 of file ofswitch13-device.cc.
References BufferPacketDelete(), ns3::OFSwitch13Device::PipelinePacket::DelCopy(), ns3::Time::FromInteger(), ns3::OFSwitch13Device::PipelinePacket::GetPacket(), ns3::OFSwitch13Device::PipelinePacket::HasId(), ns3::OFSwitch13Device::PipelinePacket::IsValid(), m_bufferPkts, m_bufferSaveTrace, m_pipePkt, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::Time::S, ns3::Simulator::Schedule(), and timeout.
|
static |
Callback fired when a packet is retrieved from buffer.
pkt | The internal packet retrieved from buffer. |
Definition at line 663 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
|
static |
Callback fired when a packet is saved into buffer.
pkt | The internal packet saved into buffer. |
timeout | The timeout for this packet into buffer. |
Definition at line 656 of file ofswitch13-device.cc.
References GetDevice(), and timeout.
Referenced by DatapathNew().
|
staticprivate |
Copy all tags (packet and byte) from srcPkt packet to dstPkt packet.
srcPkt | The source packet. |
dstPkt | The destination packet. |
Definition at line 1430 of file ofswitch13-device.cc.
References ns3::Packet::AddByteTag(), ns3::Packet::AddPacketTag(), ns3::Packet::GetByteTagIterator(), ns3::TypeId::GetConstructor(), ns3::Packet::GetPacketTagIterator(), ns3::ByteTagIterator::Item::GetTag(), ns3::PacketTagIterator::Item::GetTag(), ns3::ByteTagIterator::Item::GetTypeId(), ns3::PacketTagIterator::Item::GetTypeId(), ns3::ByteTagIterator::HasNext(), ns3::PacketTagIterator::HasNext(), ns3::ByteTagIterator::Next(), and ns3::PacketTagIterator::Next().
Referenced by SendToSwitchPort().
|
private |
Creates a new datapath.
Definition at line 739 of file ofswitch13-device.cc.
References BufferRetrieveCallback(), BufferSaveCallback(), GetNPipelineTables(), m_bufferSize, m_dpId, m_lastTimeout, MeterCreatedCallback(), MeterDropCallback(), ns3::Simulator::Now(), NS_LOG_FUNCTION, PacketCloneCallback(), PacketDestroyCallback(), TableDropCallback(), and time_now().
Referenced by NotifyConstructionCompleted().
|
private |
Check if any flow in any table is timed out and update port status.
This method reschedules itself at every m_timout interval, to constantly check the pipeline for timed out flow entries and update port status.
dp | The datapath. |
Definition at line 856 of file ofswitch13-device.cc.
References ns3::DataRate::GetBitRate(), GetGroupTableEntries(), GetMeterTableEntries(), ns3::Time::GetSeconds(), GetSumFlowEntries(), m_cpuCapacity, m_cpuConsumed, m_cpuLoad, m_cpuTokens, m_datapath, m_datapathTimeoutTrace, m_groupEntries, m_lastTimeout, m_meterEntries, m_pipeDelay, m_ports, m_sumFlowEntries, m_tcamDelay, m_timeout, min, ns3::Simulator::Now(), port, ns3::Simulator::Schedule(), and time_now().
Referenced by NotifyConstructionCompleted().
|
overrideprotectedvirtual |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Reimplemented from ns3::Object.
Definition at line 682 of file ofswitch13-device.cc.
References ns3::Object::DoDispose(), m_bufferPkts, m_controllers, m_datapath, m_dpId, m_ports, NS_LOG_FUNCTION, port, and UnregisterDatapath().
|
static |
Overriding BOFUSS dp_actions_output_port weak function from udatapath/dp_actions.c.
Outputs a datapath packet on switch port. This code is nearly the same on ofsoftswitch, but it gets the openflow device from datapath id and uses member functions to send the packet over ns3 structures.
pkt | The internal packet to send. |
outPort | The output switch port number. |
outQueue | The output queue number. |
maxLength | Max length of packet to send to controller. |
cookie | Packet cookie to send to controller. |
Definition at line 559 of file ofswitch13-device.cc.
References GetDevice().
Referenced by dp_actions_output_port().
uint32_t ns3::OFSwitch13Device::GetBufferEntries | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 256 of file ofswitch13-device.cc.
References m_bufferPkts.
Referenced by GetBufferUsage().
uint32_t ns3::OFSwitch13Device::GetBufferSize | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 262 of file ofswitch13-device.cc.
References m_bufferSize.
Referenced by GetBufferUsage().
double ns3::OFSwitch13Device::GetBufferUsage | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 268 of file ofswitch13-device.cc.
References GetBufferEntries(), and GetBufferSize().
DataRate ns3::OFSwitch13Device::GetCpuCapacity | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 279 of file ofswitch13-device.cc.
References m_cpuCapacity.
Referenced by GetCpuUsage().
DataRate ns3::OFSwitch13Device::GetCpuLoad | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 285 of file ofswitch13-device.cc.
References m_cpuLoad.
Referenced by GetCpuUsage().
double ns3::OFSwitch13Device::GetCpuUsage | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 291 of file ofswitch13-device.cc.
References ns3::DataRate::GetBitRate(), GetCpuCapacity(), and GetCpuLoad().
uint64_t ns3::OFSwitch13Device::GetDatapathId | ( | ) | const |
Get the OpenFlow datapath ID.
Definition at line 214 of file ofswitch13-device.cc.
References m_dpId.
struct datapath * ns3::OFSwitch13Device::GetDatapathStruct | ( | ) |
Get a pointer to the internal BOFUSS datapath structure.
Definition at line 424 of file ofswitch13-device.cc.
References m_datapath.
Time ns3::OFSwitch13Device::GetDatapathTimeout | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 302 of file ofswitch13-device.cc.
References m_timeout.
|
static |
Retrieve and existing OpenFlow device object by its datapath ID.
id | The datapath ID. |
Definition at line 670 of file ofswitch13-device.cc.
References m_globalSwitchMap, and NS_ABORT_MSG.
Referenced by BufferRetrieveCallback(), BufferSaveCallback(), DpActionsOutputPort(), MeterCreatedCallback(), MeterDropCallback(), PacketCloneCallback(), PacketDestroyCallback(), SendOpenflowBufferToRemote(), SendPacketToController(), and TableDropCallback().
uint32_t ns3::OFSwitch13Device::GetDftFlowTableSize | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 308 of file ofswitch13-device.cc.
References m_flowTabSize.
Referenced by GetTypeId(), and NotifyConstructionCompleted().
uint64_t ns3::OFSwitch13Device::GetDpId | ( | ) | const |
Alias for the GetDatapathId () method.
Definition at line 220 of file ofswitch13-device.cc.
References m_dpId.
uint64_t ns3::OFSwitch13Device::GetFlowModCounter | ( | ) | const |
Definition at line 226 of file ofswitch13-device.cc.
References m_cFlowMod.
uint32_t ns3::OFSwitch13Device::GetFlowTableEntries | ( | uint8_t | tableId | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 314 of file ofswitch13-device.cc.
References GetNPipelineTables(), m_datapath, and NS_ASSERT_MSG.
Referenced by GetFlowTableUsage(), GetSumFlowEntries(), and SetFlowTableSize().
uint32_t ns3::OFSwitch13Device::GetFlowTableSize | ( | uint8_t | tableId | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 322 of file ofswitch13-device.cc.
References GetNPipelineTables(), m_datapath, and NS_ASSERT_MSG.
Referenced by GetFlowTableUsage().
double ns3::OFSwitch13Device::GetFlowTableUsage | ( | uint8_t | tableId | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 330 of file ofswitch13-device.cc.
References GetFlowTableEntries(), and GetFlowTableSize().
uint64_t ns3::OFSwitch13Device::GetGroupModCounter | ( | ) | const |
Definition at line 232 of file ofswitch13-device.cc.
References m_cGroupMod.
uint32_t ns3::OFSwitch13Device::GetGroupTableEntries | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 341 of file ofswitch13-device.cc.
References m_datapath, and NS_ASSERT_MSG.
Referenced by DatapathTimeout(), GetGroupTableUsage(), and SetGroupTableSize().
uint32_t ns3::OFSwitch13Device::GetGroupTableSize | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 348 of file ofswitch13-device.cc.
References m_groupTabSize.
Referenced by GetGroupTableUsage(), GetTypeId(), and NotifyConstructionCompleted().
double ns3::OFSwitch13Device::GetGroupTableUsage | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 354 of file ofswitch13-device.cc.
References GetGroupTableEntries(), and GetGroupTableSize().
uint64_t ns3::OFSwitch13Device::GetMeterModCounter | ( | ) | const |
Definition at line 238 of file ofswitch13-device.cc.
References m_cMeterMod.
uint32_t ns3::OFSwitch13Device::GetMeterTableEntries | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 365 of file ofswitch13-device.cc.
References m_datapath, and NS_ASSERT_MSG.
Referenced by DatapathTimeout(), GetMeterTableUsage(), and SetMeterTableSize().
uint32_t ns3::OFSwitch13Device::GetMeterTableSize | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 372 of file ofswitch13-device.cc.
References m_meterTabSize.
Referenced by GetMeterTableUsage(), GetTypeId(), and NotifyConstructionCompleted().
double ns3::OFSwitch13Device::GetMeterTableUsage | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 378 of file ofswitch13-device.cc.
References GetMeterTableEntries(), and GetMeterTableSize().
uint32_t ns3::OFSwitch13Device::GetNControllers | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 389 of file ofswitch13-device.cc.
References m_controllers.
|
staticprivate |
Increase the global packet ID counter and return a new packet ID.
This ID is different from the internal ns3::Packet::GetUid (), as we need an unique value even for fragmented or brodcast packets. Its usage is restricted to this device.
Definition at line 1424 of file ofswitch13-device.cc.
References m_globalPktId.
Referenced by NotifyPacketCloned(), and SendToPipeline().
uint32_t ns3::OFSwitch13Device::GetNPipelineTables | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 395 of file ofswitch13-device.cc.
References m_numPipeTabs.
Referenced by DatapathNew(), GetFlowTableEntries(), GetFlowTableSize(), GetSumFlowEntries(), and SetDftFlowTableSize().
uint32_t ns3::OFSwitch13Device::GetNSwitchPorts | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 401 of file ofswitch13-device.cc.
References m_ports.
Referenced by AddSwitchPort().
uint64_t ns3::OFSwitch13Device::GetPacketInCounter | ( | ) | const |
Definition at line 244 of file ofswitch13-device.cc.
References m_cPacketIn.
uint64_t ns3::OFSwitch13Device::GetPacketOutCounter | ( | ) | const |
Definition at line 250 of file ofswitch13-device.cc.
References m_cPacketOut.
Time ns3::OFSwitch13Device::GetPipelineDelay | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 407 of file ofswitch13-device.cc.
References m_pipeDelay.
|
private |
Get the remote controller for this address.
address | The socket address. |
Definition at line 1394 of file ofswitch13-device.cc.
References first::address, m_controllers, and NS_LOG_FUNCTION.
|
private |
Get the remote controller for this socket.
socket | The connection socket. |
Definition at line 1379 of file ofswitch13-device.cc.
References m_controllers, NS_ABORT_MSG, and NS_LOG_FUNCTION.
Referenced by ReceiveFromController(), SocketCtrlSucceeded(), and StartControllerConnection().
|
private |
Get the remote controller for this BOFUSS remote pointer.
remote | The BOFUSS remote pointer. |
Definition at line 1409 of file ofswitch13-device.cc.
References m_controllers, NS_ABORT_MSG, and NS_LOG_FUNCTION.
uint32_t ns3::OFSwitch13Device::GetSumFlowEntries | ( | ) | const |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Definition at line 413 of file ofswitch13-device.cc.
References GetFlowTableEntries(), and GetNPipelineTables().
Referenced by DatapathTimeout().
Ptr< OFSwitch13Port > ns3::OFSwitch13Device::GetSwitchPort | ( | uint32_t | no | ) | const |
Get the OFSwitch13Port pointer from its number.
no | The port number (starting at 1). |
Definition at line 451 of file ofswitch13-device.cc.
References m_ports, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by SendToSwitchPort().
|
static |
Register this type.
Definition at line 70 of file ofswitch13-device.cc.
References ns3::TypeId::ATTR_CONSTRUCT, ns3::TypeId::ATTR_GET, GetDftFlowTableSize(), GetGroupTableSize(), GetMeterTableSize(), m_bufferExpireTrace, m_bufferRetrieveTrace, m_bufferSaveTrace, m_cpuCapacity, m_cpuLoad, m_datapathTimeoutTrace, m_dpId, m_groupEntries, m_loadDropTrace, m_meterDropTrace, m_meterEntries, m_numPipeTabs, m_pipeDelay, m_pipePacketTrace, m_ports, m_sumFlowEntries, m_tableDropTrace, m_tcamDelay, m_timeout, ns3::MakeObjectVectorAccessor(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeTraceSourceAccessor(), ns3::MakeUintegerAccessor(), ns3::MicroSeconds(), ns3::MilliSeconds(), SetDftFlowTableSize(), SetGroupTableSize(), SetMeterTableSize(), and ns3::TypeId::SetParent().
|
static |
Callback fired when a new meter entry is created at meter table.
entry | The new created meter entry. |
Definition at line 619 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
|
static |
Callback fired when a packet is dropped by meter band.
pkt | The original internal packet. |
entry | The meter entry that dropped the packet. |
Definition at line 626 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
|
overrideprotectedvirtual |
TracedCallback signature for packets dropped by meter bands.
packet | The dropped packet. |
meterId | The meter entry ID that dropped the packet. |
Reimplemented from ns3::ObjectBase.
Definition at line 718 of file ofswitch13-device.cc.
References DatapathNew(), DatapathTimeout(), GetDftFlowTableSize(), GetGroupTableSize(), GetMeterTableSize(), m_datapath, ns3::ObjectBase::NotifyConstructionCompleted(), NS_LOG_FUNCTION, SetDftFlowTableSize(), SetGroupTableSize(), and SetMeterTableSize().
|
private |
Notify this device of a new meter entry created at meter table.
This is used to update the initial number of tokens for this meter. Doing this, we avoid the problem of discarding the initial packets before the next datapath timeout.
entry | The new created meter entry. |
Definition at line 1220 of file ofswitch13-device.cc.
References ns3::Time::GetMilliSeconds(), m_lastTimeout, and NS_LOG_FUNCTION.
|
private |
Notify this device of a packet cloned by the OpenFlow pipeline.
pkt | The original BOFUSS packet. |
clone | The cloned BOFUSS packet. |
Definition at line 1235 of file ofswitch13-device.cc.
References GetNewPacketId(), m_pipePkt, ns3::OFSwitch13Device::PipelinePacket::NewCopy(), and NS_LOG_FUNCTION.
|
private |
Notify this device of a packet destroyed by the OpenFlow pipeline.
pkt | The BOFUSS packet. |
Definition at line 1245 of file ofswitch13-device.cc.
References BufferPacketDelete(), ns3::OFSwitch13Device::PipelinePacket::DelCopy(), ns3::OFSwitch13Device::PipelinePacket::HasId(), ns3::OFSwitch13Device::PipelinePacket::IsValid(), m_pipePkt, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
Notify this device of a packet dropped by OpenFlow meter band.
pkt | The BOFUSS packet. |
entry | The meter entry that dropped the packet. |
Definition at line 1283 of file ofswitch13-device.cc.
References ns3::OFSwitch13Device::PipelinePacket::GetPacket(), ns3::OFSwitch13Device::PipelinePacket::HasId(), m_meterDropTrace, m_pipePkt, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
private |
Notify this device of an unmatched packet dropped by OpenFlow flow table without a table-miss entry.
pkt | The BOFUSS packet. |
table | The flow table that dropped the packet. |
Definition at line 1298 of file ofswitch13-device.cc.
References ns3::OFSwitch13Device::PipelinePacket::GetPacket(), ns3::OFSwitch13Device::PipelinePacket::HasId(), m_pipePkt, m_tableDropTrace, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
|
static |
Callback fired when a packet is cloned.
pkt | The internal original packet. |
clone | The internal cloned packet. |
Definition at line 642 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
|
static |
Callback fired when a packet is destroyed.
pkt | The internal packet destroyed. |
Definition at line 649 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
Receive an OpenFlow packet from controller.
packet | The packet with the OpenFlow message. |
from | The packet sender address. |
Definition at line 1035 of file ofswitch13-device.cc.
References ns3::BufferFromPacket(), ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), GetRemoteController(), ns3::Packet::GetSize(), m_cFlowMod, m_cGroupMod, m_cMeterMod, m_cPacketOut, m_datapath, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ReplyWithErrorMessage().
Referenced by SocketCtrlSucceeded().
void ns3::OFSwitch13Device::ReceiveFromSwitchPort | ( | Ptr< Packet > | packet, |
uint32_t | portNo, | ||
uint64_t | tunnelId = 0 |
||
) |
Called when a packet is received on one of the switch's ports.
This method will schedule the packet for OpenFlow pipeline.
packet | The packet. |
portNo | The switch input port number. |
tunnelId | The metadata associated with a logical port. |
Definition at line 461 of file ofswitch13-device.cc.
References ns3::Packet::GetSize(), m_cpuConsumed, m_cpuTokens, m_loadDropTrace, m_pipeDelay, m_pipePacketTrace, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Simulator::Schedule(), and SendToPipeline().
|
staticprivate |
Insert a new OpenFlow device in global map.
Called by device constructor.
id | The datapath id. |
dev | The Ptr<OFSwitch13Device> pointer. |
Definition at line 1460 of file ofswitch13-device.cc.
References m_globalSwitchMap, and NS_ABORT_MSG_IF.
Referenced by OFSwitch13Device().
|
private |
Create an OpenFlow error message and send it back to the sender controller.
This function is used only when an error occurred while processing an OpenFlow message received from the controller.
error | The error code. |
buffer | The message buffer that originated the error. |
senderCtrl | The origin of a received OpenFlow message. |
Definition at line 1149 of file ofswitch13-device.cc.
References m_datapath, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by ReceiveFromController().
|
static |
Overriding BOFUSS send_openflow_buffer_to_remote weak function from udatapath/datapath.c.
Sends the given OFLib buffer message to the controller associated with remote connection structure.
buffer | The message buffer to send. |
remote | The remote controller connection information. |
Definition at line 547 of file ofswitch13-device.cc.
References GetDevice(), and ns3::PacketFromBuffer().
Referenced by send_openflow_buffer_to_remote().
|
private |
Create an OpenFlow packet in message and send the packet to all controllers with open connections.
pkt | The internal packet to send. |
tableId | ID of the table that was looked up. |
reason | Reason packet is being sent (on of OFPR_*). |
maxLength | Max length of packet to send to controller. |
cookie | Packet cookie to send to controller. |
Definition at line 903 of file ofswitch13-device.cc.
References m_cPacketIn, and NS_LOG_FUNCTION.
|
static |
Overriding BOFUSS send_packet_to_controller weak function from udatapath/pipeline.c.
Sends the given packet to controller(s) in a packet_in message.
pl | The pipeline structure. |
pkt | The internal packet to send. |
tableId | ID of the table that was looked up. |
reason | Reason packet is being sent (on of OFPR_*). |
Definition at line 534 of file ofswitch13-device.cc.
References GetDevice().
Referenced by send_packet_to_controller().
|
private |
Send a packet to the controller node.
packet | The ns-3 packet to send. |
remoteCtrl | The remote controller object to send the packet. |
Definition at line 1021 of file ofswitch13-device.cc.
References NS_LOG_ERROR.
|
private |
Send the packet to the OpenFlow BOFUSS pipeline.
packet | The packet. |
portNo | The switch input port number. |
tunnelId | The metadata associated with a logical port. |
Definition at line 995 of file ofswitch13-device.cc.
References ns3::BufferFromPacket(), GetNewPacketId(), ns3::Packet::GetSize(), ns3::OFSwitch13Device::PipelinePacket::IsValid(), m_datapath, m_pipePkt, NS_ASSERT_MSG, NS_LOG_FUNCTION, and ns3::OFSwitch13Device::PipelinePacket::SetPacket().
Referenced by ReceiveFromSwitchPort().
|
private |
Send a message over a specific switch port.
Check port configuration, get the ns-3 packet and send the packet over the proper OpenFlow port.
pkt | The internal packet to send. |
portNo | The port number. |
queueNo | The queue number. |
Definition at line 941 of file ofswitch13-device.cc.
References CopyTags(), ns3::OFSwitch13Device::PipelinePacket::GetPacket(), GetSwitchPort(), ns3::OFSwitch13Device::PipelinePacket::HasId(), ns3::OFSwitch13Device::PipelinePacket::IsValid(), m_pipePkt, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::PacketFromBuffer(), and port.
|
private |
Structure to save the list of ports in this datapath.
Definition at line 810 of file ofswitch13-device.cc.
References GetNPipelineTables(), m_datapath, m_flowTabSize, NS_LOG_FUNCTION, SetFlowTableSize(), and second::value.
Referenced by GetTypeId(), and NotifyConstructionCompleted().
|
private |
Structure to save the list of ports in this datapath.
Definition at line 799 of file ofswitch13-device.cc.
References GetFlowTableEntries(), m_datapath, NS_ABORT_MSG_IF, NS_ASSERT_MSG, NS_LOG_FUNCTION, and second::value.
Referenced by SetDftFlowTableSize().
|
private |
Structure to save the list of ports in this datapath.
Definition at line 825 of file ofswitch13-device.cc.
References GetGroupTableEntries(), m_datapath, m_groupTabSize, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, and second::value.
Referenced by GetTypeId(), and NotifyConstructionCompleted().
|
private |
Structure to save the list of ports in this datapath.
Definition at line 842 of file ofswitch13-device.cc.
References GetMeterTableEntries(), m_datapath, m_meterTabSize, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, and second::value.
Referenced by GetTypeId(), and NotifyConstructionCompleted().
Socket callback fired when a TCP connection to controller fail.
socket | The TCP socket. |
Definition at line 1200 of file ofswitch13-device.cc.
References m_controllers, NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by StartControllerConnection().
Socket callback fired when a TCP connection to controller succeed.
socket | The TCP socket. |
Definition at line 1172 of file ofswitch13-device.cc.
References GetRemoteController(), m_datapath, ns3::MakeCallback(), NS_LOG_FUNCTION, NS_LOG_INFO, and ReceiveFromController().
Referenced by StartControllerConnection().
void ns3::OFSwitch13Device::StartControllerConnection | ( | Address | ctrlAddr | ) |
Starts the TCP connection between this switch and the target controller indicated by the address parameter.
ctrlAddr | The controller address used to open the connection. |
Definition at line 491 of file ofswitch13-device.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), ns3::InetSocketAddress::ConvertFrom(), ns3::Socket::CreateSocket(), GetRemoteController(), ns3::Address::IsInvalid(), ns3::InetSocketAddress::IsMatchingType(), ns3::TypeId::LookupByName(), m_controllers, ns3::MakeCallback(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_ERROR, NS_LOG_FUNCTION, ns3::ObjectBase::SetAttribute(), ns3::Socket::SetConnectCallback(), SocketCtrlFailed(), and SocketCtrlSucceeded().
|
static |
Callback fired when an unmatched packet is dropped by a flow table without a table-miss entry.
pkt | The original internal packet. |
table | The flow table that dropped the packet. |
Definition at line 634 of file ofswitch13-device.cc.
References GetDevice().
Referenced by DatapathNew().
|
staticprivate |
Remove an existing OpenFlow device from global map.
Called by DoDispose.
id | The datapath id. |
Definition at line 1468 of file ofswitch13-device.cc.
References m_globalSwitchMap, and NS_ABORT_MSG.
Referenced by DoDispose().
|
private |
Trace source fired when a packet in buffer expires.
Definition at line 620 of file ofswitch13-device.h.
Referenced by BufferPacketDelete(), and GetTypeId().
|
private |
Packets saved in switch buffer.
Definition at line 670 of file ofswitch13-device.h.
Referenced by BufferPacketDelete(), BufferPacketRetrieve(), BufferPacketSave(), DoDispose(), and GetBufferEntries().
|
private |
Trace source fired when a packet is retrieved from buffer.
Definition at line 623 of file ofswitch13-device.h.
Referenced by BufferPacketRetrieve(), and GetTypeId().
|
private |
Trace source fired when a packet is saved into buffer.
Definition at line 626 of file ofswitch13-device.h.
Referenced by BufferPacketSave(), and GetTypeId().
|
private |
Buffer size in terms of packets.
Definition at line 671 of file ofswitch13-device.h.
Referenced by DatapathNew(), and GetBufferSize().
|
private |
Pipeline flow mod counter.
Definition at line 676 of file ofswitch13-device.h.
Referenced by GetFlowModCounter(), and ReceiveFromController().
|
private |
Pipeline group mod counter.
Definition at line 677 of file ofswitch13-device.h.
Referenced by GetGroupModCounter(), and ReceiveFromController().
|
private |
Pipeline meter mod counter.
Definition at line 678 of file ofswitch13-device.h.
Referenced by GetMeterModCounter(), and ReceiveFromController().
|
private |
Collection of active controllers.
Definition at line 665 of file ofswitch13-device.h.
Referenced by DoDispose(), GetNControllers(), GetRemoteController(), SocketCtrlFailed(), and StartControllerConnection().
|
private |
Pipeline packet in counter.
Definition at line 679 of file ofswitch13-device.h.
Referenced by GetPacketInCounter(), and SendPacketInMessage().
|
private |
Pipeline packet out counter.
Definition at line 680 of file ofswitch13-device.h.
Referenced by GetPacketOutCounter(), and ReceiveFromController().
|
private |
CPU processing capacity.
Definition at line 673 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), GetCpuCapacity(), and GetTypeId().
|
private |
CPU processing tokens consumed.
Definition at line 674 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and ReceiveFromSwitchPort().
|
private |
Average CPU processing load.
Definition at line 656 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), GetCpuLoad(), and GetTypeId().
|
private |
CPU processing tokens available.
Definition at line 675 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and ReceiveFromSwitchPort().
|
private |
BOFUSS datapath structure.
Definition at line 663 of file ofswitch13-device.h.
Referenced by AddSwitchPort(), DatapathTimeout(), DoDispose(), GetDatapathStruct(), GetFlowTableEntries(), GetFlowTableSize(), GetGroupTableEntries(), GetMeterTableEntries(), NotifyConstructionCompleted(), ReceiveFromController(), ReplyWithErrorMessage(), SendToPipeline(), SetDftFlowTableSize(), SetFlowTableSize(), SetGroupTableSize(), SetMeterTableSize(), and SocketCtrlSucceeded().
|
private |
Trace source fired when the datapath timeout operation is completed.
Definition at line 629 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and GetTypeId().
|
private |
This datapath id.
Definition at line 658 of file ofswitch13-device.h.
Referenced by OFSwitch13Device(), DatapathNew(), DoDispose(), GetDatapathId(), GetDpId(), and GetTypeId().
|
private |
Flow table maximum entries.
Definition at line 666 of file ofswitch13-device.h.
Referenced by GetDftFlowTableSize(), and SetDftFlowTableSize().
|
staticprivate |
Global counter for datapath IDs.
Definition at line 682 of file ofswitch13-device.h.
Referenced by OFSwitch13Device().
|
staticprivate |
Global counter for packets IDs.
Definition at line 683 of file ofswitch13-device.h.
Referenced by GetNewPacketId().
|
staticprivate |
As the integration of BOFUSS and ns-3 involve overriding some C functions, we are using a global map to store a pointer to all OFSwitch13Device objects in simulation, and allow faster object retrieve by datapath id.
In this way, static functions like SendOpenflowBufferToRemote, DpActionsOutputPort, and other callbacks can get the object pointer and call member functions.
Definition at line 693 of file ofswitch13-device.h.
Referenced by GetDevice(), RegisterDatapath(), and UnregisterDatapath().
|
private |
Number of entries in group table.
Definition at line 644 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and GetTypeId().
|
private |
Group table maximum entries.
Definition at line 667 of file ofswitch13-device.h.
Referenced by GetGroupTableSize(), and SetGroupTableSize().
|
private |
Datapath last timeout.
Definition at line 660 of file ofswitch13-device.h.
Referenced by DatapathNew(), DatapathTimeout(), and NotifyMeterEntryCreated().
|
private |
The BOFUSS library log level.
Definition at line 662 of file ofswitch13-device.h.
|
private |
Trace source fired when a packet is dropped due to overloaded switch.
Definition at line 632 of file ofswitch13-device.h.
Referenced by GetTypeId(), and ReceiveFromSwitchPort().
|
private |
Trace source fired when a packet is dropped by a meter band.
Definition at line 635 of file ofswitch13-device.h.
Referenced by GetTypeId(), and NotifyPacketDroppedByMeter().
|
private |
Number of entries in meter table.
Definition at line 647 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and GetTypeId().
|
private |
Meter table maximum entries.
Definition at line 668 of file ofswitch13-device.h.
Referenced by GetMeterTableSize(), and SetMeterTableSize().
|
private |
Number of pipeline flow tables.
Definition at line 669 of file ofswitch13-device.h.
Referenced by GetNPipelineTables(), and GetTypeId().
|
private |
Average delay for pipeline packet processing.
Definition at line 653 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), GetPipelineDelay(), GetTypeId(), and ReceiveFromSwitchPort().
|
private |
Trace source fired when a packet is sent to pipeline.
Definition at line 641 of file ofswitch13-device.h.
Referenced by GetTypeId(), and ReceiveFromSwitchPort().
|
private |
Packet under switch pipeline.
Definition at line 672 of file ofswitch13-device.h.
Referenced by BufferPacketRetrieve(), BufferPacketSave(), NotifyPacketCloned(), NotifyPacketDestroyed(), NotifyPacketDroppedByMeter(), NotifyPacketDroppedByTable(), SendToPipeline(), and SendToSwitchPort().
|
private |
List of switch ports.
Definition at line 664 of file ofswitch13-device.h.
Referenced by AddSwitchPort(), DatapathTimeout(), DoDispose(), GetNSwitchPorts(), GetSwitchPort(), and GetTypeId().
|
private |
Sum of entries in all flow tables.
Definition at line 650 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and GetTypeId().
|
private |
Trace source fired when an unmatched packet is dropped by flow table.
Definition at line 638 of file ofswitch13-device.h.
Referenced by GetTypeId(), and NotifyPacketDroppedByTable().
|
private |
Flow Table TCAM lookup delay.
Definition at line 661 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), and GetTypeId().
|
private |
Datapath timeout interval.
Definition at line 659 of file ofswitch13-device.h.
Referenced by DatapathTimeout(), GetDatapathTimeout(), and GetTypeId().