23 #ifndef DPDK_NET_DEVICE_H    24 #define DPDK_NET_DEVICE_H    29 #include <rte_mempool.h>    30 #include <rte_cycles.h>    32 struct rte_eth_dev_tx_buffer;
    81   void InitDpdk (
int argc, 
char **argv, std::string dpdkDriver);
   135   ssize_t 
Write (uint8_t *buffer, 
size_t length);
 Simulation virtual time values and global simulation resolution. 
Time m_txTimeout
The time to wait before transmitting burst from Tx buffer. 
struct rte_eth_dev_tx_buffer * m_rxBuffer
Buffer to handle burst reception. 
ssize_t Write(uint8_t *buffer, size_t length)
Write packet data to device. 
void SetDeviceName(std::string deviceName)
Set device name. 
void HandleRx()
Receive packets in burst from the nic to the rx_buffer. 
uint16_t m_nbRxDesc
Number of Rx descriptors. 
uint16_t m_nbTxDesc
Number of Tx descriptors. 
bool IsLinkUp(void) const
Check the status of the link. 
static void SignalHandler(int signum)
A signal handler for SIGINT and SIGTERM signals. 
uint32_t m_maxRxPktBurst
Size of Rx burst. 
DpdkNetDevice()
Constructor for the DpdkNetDevice. 
EventId m_txEvent
Event for stale packet transmission. 
static volatile bool m_forceQuit
Condition variable for Dpdk to stop. 
static TypeId GetTypeId(void)
Get the type ID. 
uint16_t m_portId
The port number of the device to be used. 
virtual uint8_t * AllocateBuffer(size_t len)
Allocate packet buffer. 
static int LaunchCore(void *arg)
A function to handle rx & tx operations. 
virtual void FreeBuffer(uint8_t *buf)
Free the given packet buffer. 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
struct rte_mempool * m_mempool
Packet memory pool. 
struct rte_eth_dev_tx_buffer * m_txBuffer
Buffer to handle burst transmission. 
void DoFinishStoppingDevice(void)
Complete additional actions, if any, to tear down the device. 
~DpdkNetDevice()
Destructor for the DpdkNetDevice. 
std::string m_deviceName
The device name;. 
An identifier for simulation events. 
void CheckAllPortsLinkStatus(void)
Check the link status of all ports in up to 9s and print them finally. 
uint32_t m_mempoolCacheSize
Mempool cache size. 
a NetDevice to read/write network traffic from/into a file descriptor. 
void InitDpdk(int argc, char **argv, std::string dpdkDriver)
Initialize Dpdk. 
uint32_t m_maxTxPktBurst
Size of Tx burst. 
a unique identifier for an interface. 
a NetDevice to read/write network traffic from/into a Dpdk enabled port. 
void HandleTx()
Transmit packets in burst from the tx_buffer to the nic.