38#ifndef UWMULTI_TRAFFIC_Control_H
39#define UWMULTI_TRAFFIC_Control_H
126 virtual int command(
int,
const char*
const*);
133 virtual void recv(Packet *p);
191 up_map[traffic] = upper_layer_id;
202 down_map[traffic][lower_layer_stack] = std::make_pair(lower_layer_id, behavior);
275 double send_down_delay=0);
Class used to represents the UwMultiTrafficControl layer of a node.
BufferTrafficFeature buffer_feature_map
Map with features of each buffer.
DownTrafficBuffer down_buffer
Map of buffer per traffic types.
virtual ~UwMultiTrafficControl()
Destructor of UwMultiPhy class.
virtual void recvFromUpperLayers(Packet *p)
Handle a packet coming from upper layers.
void setBufferFeature(int traffic_id, int max_size, bool is_circular, double send_down_delay=0)
set buffer features for the given traffic type
virtual int command(int, const char *const *)
TCL command interpreter.
UwMultiTrafficControl()
Constructor of UwMultiPhy class.
virtual int getUpperLayer(int traffic)
return the Upper Layer id where to forward the received packet of traffic type
int debug_
Flag to activate debug verbosity.
virtual void addLowLayerFromTag(int traffic_id, std::string tag, int behavior)
add a lower layer from the tag name in the map
virtual void manageBuffer(int traffic)
manage to tx a packet of traffic type
DownTrafficMap down_map
Map of lower layers.
virtual int getBestLowerLayer(int traffic, Packet *p=NULL)
return the Best Lower Layer id where to forward the packet of traffic type
UpTrafficMap up_map
Map of upper layers.
virtual Packet * getFromBuffer(int traffic)
get a packet of a certain type from the buffer and return it
virtual Packet * removeFromBuffer(int traffic)
remove a packet of a certain type from the buffer and return it
virtual void eraseTraffic2Low(int traffic)
remove the traffic from the lower layers matrix
virtual void recv(Packet *p)
recv method.
virtual void addUpLayerFromTag(int traffic_id, std::string tag)
add an upper layer from the tag name in the map
virtual void eraseTraffic2LowerLayer(int traffic, int lower_layer_stack)
remove the behavior from the traffic lower layers matrix
virtual void incrPktLoss(int traffic_id)
Increment by 1 the number of lost packets for the given traffic.
virtual uint getDiscardedPacket(int traffic_id) const
get discarded packets
virtual void eraseTraffic2Up(int traffic)
remove the traffic from the upper layers matrix
void insertTraffic2UpLayer(int traffic, int upper_layer_id)
Set to which upper layer forward a specific kind of traffic received from the lower layers.
void insertTraffic2LowerLayer(int traffic, int lower_layer_stack, int lower_layer_id, int behavior)
Set to which upper layer forward a specific kind of traffic received from the lower layers.
virtual void insertInBuffer(Packet *p, int traffic)
insert a packet of a certain type in the buffer
double last_sched_tx
Last scheduled transmission time.
BufferBehavior behavior_buff
Buffer behavior.
double getUpdatedDelay(double time_instant)
uint pkts_lost
Packet lost for buffer overflow.
double send_delay
Send down delay.
uint max_size
Maximum buffer size.
BufferType(uint size, BufferBehavior behav, double del)
std::pair< int, int > BehaviorItem
module_id, behavior>
std::map< int, Buffer * > DownTrafficBuffer
app_type, PacketQueue
std::map< int, BehaviorItem > BehaviorMap
stack_id, behavior>
std::map< int, BehaviorMap > DownTrafficMap
app_type, BehaviorMap
std::queue< Packet * > Buffer
std::map< int, BufferType > BufferTrafficFeature
traffic, buffer type
std::map< int, int > UpTrafficMap
app_type, module_id>