KENSv3
KAIST Educational Network System
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
E::Link Class Referenceabstract

Link makes connections among multiple Wires. It supports packet switching and output queuing. Random drop occurs when the queue is full. More...

#include <E_Link.hpp>

Inheritance diagram for E::Link:
E::NetworkModule E::NetworkLog E::Module E::Hub E::Switch

Classes

class  Message
 

Public Types

enum  MessageType { CHECK_QUEUE }
 
- Public Types inherited from E::Module
using Message = std::unique_ptr< MessageBase >
 

Public Member Functions

 Link (std::string name, NetworkSystem &system)
 
virtual void enablePCAPLogging (const std::string &filename, Size snaplen=65535) final
 Make a PCAP formatted log file.
 
virtual void setLinkSpeed (Size bps) final
 
virtual void setQueueSize (Size max_queue_length) final
 
- Public Member Functions inherited from E::NetworkModule
 NetworkModule (System &system)
 
int connectWire (const ModuleID moduleID)
 
size_t getPortCount ()
 
- Public Member Functions inherited from E::Module
 Module (System &system)
 Module must belong to a System. Module is registered to a System when it is created.
 
std::string getModuleName ()
 
std::string getModuleName (const ModuleID moduleID)
 
Time getCurrentTime ()
 

Protected Member Functions

virtual void packetArrived (const ModuleID inWireID, Packet &&packet)=0
 
virtual void packetSent (const ModuleID wireID, Packet &&packet)
 
virtual void sendPacket (const ModuleID wireID, Packet &&packet) final
 
- Protected Member Functions inherited from E::Module
virtual UUID sendMessage (const ModuleID to, Module::Message message, Time timeAfter) final
 Send a Message to other Module. Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System.
 
virtual UUID sendMessageSelf (Module::Message message, Time timeAfter) final
 Send a Message to self Every message has its own delay before it is actually sent. The System guarantees the total ordering of all delayed messages in the System.
 
virtual bool cancelMessage (UUID messageID) final
 Cancel the raised Message. If a message is not actually sent yet, you can cancel the message. If the message is already sent, this function has no effect.
 

Protected Attributes

std::unordered_map< ModuleID, Time > nextAvailable
 
std::unordered_map< ModuleID, std::list< Packet > > outputQueue
 
Size bps
 
Size max_queue_length
 
- Protected Attributes inherited from E::NetworkModule
std::vector< ModuleID > ports
 

Detailed Description

Link makes connections among multiple Wires. It supports packet switching and output queuing. Random drop occurs when the queue is full.

Member Function Documentation

◆ enablePCAPLogging()

void E::Link::enablePCAPLogging ( const std::string &  filename,
Size  snaplen = 65535 
)
finalvirtual

Make a PCAP formatted log file.

Parameters
filenameName of the log file.
snaplenLength of packet data to be recorded.
Note
You cannot override this function.

◆ setLinkSpeed()

void E::Link::setLinkSpeed ( Size  bps)
finalvirtual
Parameters
bpsSet link speed to bps.

◆ setQueueSize()

void E::Link::setQueueSize ( Size  max_queue_length)
finalvirtual
Parameters
max_queue_lengthSet the maximum queue length. Zero indicates infinite queue.

The documentation for this class was generated from the following files: