INET Framework for OMNeT++/OMNEST
inet::Flooding Class Reference

A simple flooding protocol. More...

#include <Flooding.h>

Inheritance diagram for inet::Flooding:
inet::NetworkProtocolBase inet::INetworkProtocol inet::LayeredProtocolBase inet::DefaultProtocolRegistrationListener inet::OperationalBase inet::IProtocolRegistrationListener inet::OperationalMixin< cSimpleModule > inet::ILifecycle

Classes

class  Bcast
 

Public Member Functions

 Flooding ()
 
virtual int numInitStages () const override
 Initialization of omnetpp.ini parameters. More...
 
virtual void initialize (int) override
 Reads all parameters from the ini file. More...
 
virtual void finish () override
 
const ProtocolgetProtocol () const override
 
- Public Member Functions inherited from inet::NetworkProtocolBase
virtual void handleRegisterService (const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterProtocol (const Protocol &protocol, cGate *gate, ServicePrimitive servicePrimitive) override
 
- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 
- Public Member Functions inherited from inet::DefaultProtocolRegistrationListener
virtual void handleRegisterServiceGroup (const ProtocolGroup &protocolGroup, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterProtocolGroup (const ProtocolGroup &protocolGroup, cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterAnyService (cGate *gate, ServicePrimitive servicePrimitive) override
 
virtual void handleRegisterAnyProtocol (cGate *gate, ServicePrimitive servicePrimitive) override
 
- Public Member Functions inherited from inet::INetworkProtocol
virtual ~INetworkProtocol ()
 

Protected Types

typedef std::list< BcastcBroadcastList
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 

Protected Member Functions

virtual void handleUpperPacket (Packet *packet) override
 Handle messages from upper layer. More...
 
virtual void handleLowerPacket (Packet *packet) override
 Handle messages from lower layer. More...
 
bool notBroadcasted (const FloodingHeader *)
 Checks whether a message was already broadcasted. More...
 
void decapsulate (Packet *packet)
 Decapsulates the packet from the received Network packet. More...
 
void encapsulate (Packet *packet)
 Encapsulates the received ApplPkt into a NetwPkt and set all needed header fields. More...
 
virtual void setDownControlInfo (Packet *const pMsg, const MacAddress &pDestAddr)
 Attaches a "control info" (NetwToMac) structure (object) to the message pMsg. More...
 
virtual void handleStartOperation (LifecycleOperation *operation) override
 
virtual void handleStopOperation (LifecycleOperation *operation) override
 
virtual void handleCrashOperation (LifecycleOperation *operation) override
 
- Protected Member Functions inherited from inet::NetworkProtocolBase
 NetworkProtocolBase ()
 
virtual ~NetworkProtocolBase ()
 
virtual void sendUp (cMessage *message)
 
virtual void sendDown (cMessage *message, int interfaceId=-1)
 
virtual bool isUpperMessage (cMessage *message) const override
 
virtual bool isLowerMessage (cMessage *message) const override
 
virtual bool isInitializeStage (int stage) const override
 
virtual bool isModuleStartStage (int stage) const override
 
virtual bool isModuleStopStage (int stage) const override
 
virtual void handleUpperCommand (cMessage *msg) override
 
- Protected Member Functions inherited from inet::LayeredProtocolBase
virtual void handleMessageWhenUp (cMessage *message) override
 
virtual void handleSelfMessage (cMessage *message)
 
virtual void handleUpperMessage (cMessage *message)
 
virtual void handleLowerMessage (cMessage *message)
 
virtual void handleLowerCommand (cMessage *message)
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void refreshDisplay () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenDown (cMessage *msg)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual State getInitialOperationalState () const
 Returns initial operational state: OPERATING or NOT_OPERATING. More...
 
virtual void handleActiveOperationTimeout (cMessage *message)
 
virtual bool isUp () const
 utility functions More...
 
virtual bool isDown () const
 
virtual void setOperationalState (State newState)
 
virtual void scheduleOperationTimeout (simtime_t timeout)
 
virtual void setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State)
 
virtual void delayActiveOperationFinish (simtime_t timeout)
 
virtual void startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO)
 
virtual void startActiveOperationExtraTimeOrFinish (simtime_t extraTime)
 
virtual void finishActiveOperation ()
 

Protected Attributes

unsigned long seqNum = 0
 Network layer sequence number. More...
 
L3Address myNetwAddr
 cached variable of my networ address More...
 
int headerLength = 0
 Length of the header. More...
 
int defaultTtl = 0
 Default time-to-live (ttl) used for this module. More...
 
bool plainFlooding = false
 Defines whether to use plain flooding or not. More...
 
cBroadcastList bcMsgs
 List of already broadcasted messages. More...
 
unsigned int bcMaxEntries = 0
 Max number of entries in the list of already broadcasted messages. More...
 
simtime_t bcDelTime
 Time after which an entry for an already broadcasted msg can be deleted. More...
 
long nbDataPacketsReceived = 0
 
long nbDataPacketsSent = 0
 
long nbDataPacketsForwarded = 0
 
long nbHops = 0
 
- Protected Attributes inherited from inet::NetworkProtocolBase
ModuleRefByPar< IInterfaceTableinterfaceTable
 
std::set< const Protocol * > upperProtocols
 
std::map< int, SocketDescriptor * > socketIdToSocketDescriptor
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 

Detailed Description

A simple flooding protocol.

This implementation uses plain flooding, i.e. it "remembers" (stores) already broadcasted messages in a list and does not rebroadcast them again, if it gets another copy of that message.

The maximum number of entires for that list can be defined in the .ini file (bcMaxEntries) as well as the time after which an entry is deleted (bcDelTime).

If you prefere a memory-less version you can comment out the

#define PLAINFLOODING 
Author
Daniel Willkomm

ported to Mixim 2.0 by Theodoros Kapourniotis

Member Typedef Documentation

◆ cBroadcastList

typedef std::list<Bcast> inet::Flooding::cBroadcastList
protected

Constructor & Destructor Documentation

◆ Flooding()

inet::Flooding::Flooding ( )
inline
106 {}

Member Function Documentation

◆ decapsulate()

void inet::Flooding::decapsulate ( Packet packet)
protected

Decapsulates the packet from the received Network packet.

260 {
261  auto floodHeader = packet->popAtFront<FloodingHeader>();
262  auto payloadLength = floodHeader->getPayloadLengthField();
263  if (packet->getDataLength() < payloadLength) {
264  throw cRuntimeError("Data error: illegal payload length"); // FIXME packet drop
265  }
266  if (packet->getDataLength() > payloadLength)
267  packet->setBackOffset(packet->getFrontOffset() + payloadLength);
268  auto payloadProtocol = floodHeader->getProtocol();
269  packet->addTagIfAbsent<NetworkProtocolInd>()->setProtocol(&getProtocol());
270  packet->addTagIfAbsent<NetworkProtocolInd>()->setNetworkProtocolHeader(floodHeader);
271  packet->addTagIfAbsent<DispatchProtocolReq>()->setProtocol(payloadProtocol);
272  packet->addTagIfAbsent<PacketProtocolTag>()->setProtocol(payloadProtocol);
273  auto addressInd = packet->addTagIfAbsent<L3AddressInd>();
274  addressInd->setSrcAddress(floodHeader->getSourceAddress());
275  addressInd->setDestAddress(floodHeader->getDestinationAddress());
276  packet->addTagIfAbsent<HopLimitInd>()->setHopLimit(floodHeader->getTtl());
277 }

Referenced by handleLowerPacket().

◆ encapsulate()

void inet::Flooding::encapsulate ( Packet packet)
protected

Encapsulates the received ApplPkt into a NetwPkt and set all needed header fields.

284 {
285  L3Address netwAddr;
286 
287  EV << "in encaps...\n";
288 
289  auto cInfo = appPkt->removeControlInfo();
290  auto pkt = makeShared<FloodingHeader>(); // TODO appPkt->getName(), appPkt->getKind());
291  pkt->setChunkLength(b(headerLength));
292 
293  auto& hopLimitReq = appPkt->removeTagIfPresent<HopLimitReq>();
294  int ttl = (hopLimitReq != nullptr) ? hopLimitReq->getHopLimit() : -1;
295  if (ttl == -1)
296  ttl = defaultTtl;
297 
298  pkt->setSeqNum(seqNum);
299  seqNum++;
300  pkt->setTtl(ttl);
301 
302  const auto& addressReq = appPkt->findTag<L3AddressReq>();
303  if (addressReq == nullptr) {
304  EV << "warning: Application layer did not specifiy a destination L3 address\n"
305  << "\tusing broadcast address instead\n";
306  netwAddr = netwAddr.getAddressType()->getBroadcastAddress();
307  }
308  else {
309  pkt->setProtocol(appPkt->getTag<PacketProtocolTag>()->getProtocol());
310  netwAddr = addressReq->getDestAddress();
311  EV << "CInfo removed, netw addr=" << netwAddr << endl;
312  delete cInfo;
313  }
314 
315  pkt->setSrcAddr(myNetwAddr);
316  pkt->setDestAddr(netwAddr);
317  EV << " netw " << myNetwAddr << " sending packet" << endl;
318 
319  EV << "sendDown: nHop=L3BROADCAST -> message has to be broadcasted"
320  << " -> set destMac=L2BROADCAST" << endl;
321 
322  pkt->setPayloadLengthField(appPkt->getDataLength());
323 
324  // encapsulate the application packet
326 
327  appPkt->insertAtFront(pkt);
328  EV << " pkt encapsulated\n";
329 }

Referenced by handleUpperPacket().

◆ finish()

void inet::Flooding::finish ( )
overridevirtual
76 {
77  if (plainFlooding) {
78  bcMsgs.clear();
79  }
80  recordScalar("nbDataPacketsReceived", nbDataPacketsReceived);
81  recordScalar("nbDataPacketsSent", nbDataPacketsSent);
82  recordScalar("nbDataPacketsForwarded", nbDataPacketsForwarded);
83  if (nbDataPacketsReceived > 0) {
84  recordScalar("meanNbHops", (double)nbHops / (double)nbDataPacketsReceived);
85  }
86  else {
87  recordScalar("meanNbHops", 0);
88  }
89 }

◆ getProtocol()

const Protocol& inet::Flooding::getProtocol ( ) const
inlineoverridevirtual

Implements inet::NetworkProtocolBase.

115 { return Protocol::flooding; }

Referenced by decapsulate(), and setDownControlInfo().

◆ handleCrashOperation()

virtual void inet::Flooding::handleCrashOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

149 {} // TODO implementation

◆ handleLowerPacket()

void inet::Flooding::handleLowerPacket ( Packet packet)
overrideprotectedvirtual

Handle messages from lower layer.

Messages from the mac layer will be forwarded to the application only if the are broadcast or destined for this node.

If the arrived message is a broadcast message it is also reflooded only if the tll field is bigger than one. Before the message is handed back to the mac layer the ttl field is reduced by one to account for this hop.

In the case of plain flooding the message will only be processed if there is no corresponding entry in the bcMsgs list (notBroadcasted). Otherwise the message will be deleted.

Reimplemented from inet::LayeredProtocolBase.

147 {
148  auto floodHeader = packet->peekAtFront<FloodingHeader>();
149 
150  // msg not broadcasted yet
151  if (notBroadcasted(floodHeader.get())) {
152  // msg is for me
153  if (interfaceTable->isLocalAddress(floodHeader->getDestinationAddress())) {
154  EV << " data msg for me! send to Upper" << endl;
155  nbHops = nbHops + (defaultTtl + 1 - floodHeader->getTtl());
156  decapsulate(packet);
157  sendUp(packet);
159  }
160  // broadcast message
161  else if (floodHeader->getDestinationAddress().isBroadcast()) {
162  // check ttl and rebroadcast
163  if (floodHeader->getTtl() > 1) {
164  EV << " data msg BROADCAST! ttl = " << floodHeader->getTtl()
165  << " > 1 -> rebroadcast msg & send to upper\n";
166  auto dMsg = packet->dup();
167  auto newFloodHeader = dMsg->removeAtFront<FloodingHeader>();
168  newFloodHeader->setTtl(newFloodHeader->getTtl() - 1);
169  dMsg->insertAtFront(newFloodHeader);
171  sendDown(dMsg);
173  }
174  else
175  EV << " max hops reached (ttl = " << floodHeader->getTtl() << ") -> only send to upper\n";
176 
177  // message has to be forwarded to upper layer
178  nbHops = nbHops + (defaultTtl + 1 - floodHeader->getTtl());
179  decapsulate(packet);
180  sendUp(packet);
182  }
183  // not for me -> rebroadcast
184  else {
185  // check ttl and rebroadcast
186  if (floodHeader->getTtl() > 1) {
187  EV << " data msg not for me! ttl = " << floodHeader->getTtl()
188  << " > 1 -> forward\n";
189  decapsulate(packet);
190  auto packetCopy = new Packet();
191  packetCopy->insertAtBack(packet->peekDataAt(b(0), packet->getDataLength()));
192  auto floodHeaderCopy = staticPtrCast<FloodingHeader>(floodHeader->dupShared());
193  floodHeaderCopy->setTtl(floodHeader->getTtl() - 1);
194  packetCopy->insertAtFront(floodHeaderCopy);
195  // needs to set the next hop address again to broadcast
196  cObject *const pCtrlInfo = packetCopy->removeControlInfo();
197  if (pCtrlInfo != nullptr)
198  delete pCtrlInfo;
200  sendDown(packetCopy);
202  delete packet;
203  }
204  else {
205  // max hops reached -> delete
206  EV << " max hops reached (ttl = " << floodHeader->getTtl() << ") -> delete msg\n";
207  delete packet;
208  }
209  }
210  }
211  else {
212  EV << " data msg already BROADCASTed! delete msg\n";
213  delete packet;
214  }
215 }

◆ handleStartOperation()

virtual void inet::Flooding::handleStartOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

147 {} // TODO implementation

◆ handleStopOperation()

virtual void inet::Flooding::handleStopOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

148 {} // TODO implementation

◆ handleUpperPacket()

void inet::Flooding::handleUpperPacket ( Packet packet)
overrideprotectedvirtual

Handle messages from upper layer.

All messages have to get a sequence number and the ttl filed has to be specified.

Afterwards the messages can be handed to the mac layer. The mac address is set to -1 (broadcast address) because the message is flooded (i.e. has to be send to all neighbors)

In the case of plain flooding the message sequence number and source address has also be stored in the bcMsgs list, so that this message will not be rebroadcasted, if a copy will be flooded back from the neigbouring nodes.

If the maximum number of entries is reached the first (oldest) entry is deleted.

Reimplemented from inet::LayeredProtocolBase.

106 {
107  encapsulate(packet);
108  auto floodHeader = packet->peekAtFront<FloodingHeader>();
109 
110  if (plainFlooding) {
111  if (bcMsgs.size() >= bcMaxEntries) {
112  // serach the broadcast list of outdated entries and delete them
113  for (auto it = bcMsgs.begin(); it != bcMsgs.end();) {
114  if (it->delTime < simTime())
115  it = bcMsgs.erase(it);
116  else
117  ++it;
118  }
119  // delete oldest entry if max size is reached
120  if (bcMsgs.size() >= bcMaxEntries) {
121  EV << "bcMsgs is full, delete oldest entry" << endl;
122  bcMsgs.pop_front();
123  }
124  }
125  bcMsgs.push_back(Bcast(floodHeader->getSeqNum(), floodHeader->getSourceAddress(), simTime() + bcDelTime));
126  }
127  // there is no routing so all messages are broadcast for the mac layer
128  sendDown(packet);
130 }

◆ initialize()

void inet::Flooding::initialize ( int  stage)
overridevirtual

Reads all parameters from the ini file.

If a parameter is not specified in the ini file a default value will be set.

Reimplemented from inet::NetworkProtocolBase.

39 {
41  if (stage == INITSTAGE_LOCAL) {
42  // initialize seqence number to 0
43  seqNum = 0;
47  nbHops = 0;
48  headerLength = par("headerLength");
49  defaultTtl = par("defaultTtl");
50  plainFlooding = par("plainFlooding");
51 
52  EV << "defaultTtl = " << defaultTtl
53  << " plainFlooding = " << plainFlooding << endl;
54 
55  if (plainFlooding) {
56  // these parameters are only needed for plain flooding
57  bcMaxEntries = par("bcMaxEntries");
58  bcDelTime = par("bcDelTime");
59  EV << "bcMaxEntries = " << bcMaxEntries
60  << " bcDelTime = " << bcDelTime << endl;
61  }
62  }
64  for (int i = 0; i < interfaceTable->getNumInterfaces(); i++)
65  interfaceTable->getInterface(i)->setHasModulePathAddress(true);
66  }
67  else if (stage == INITSTAGE_NETWORK_LAYER) {
68  if (auto ie = interfaceTable->findFirstNonLoopbackInterface())
69  myNetwAddr = ie->getNetworkAddress();
70  else
71  throw cRuntimeError("No non-loopback interface found!");
72  }
73 }

◆ notBroadcasted()

bool inet::Flooding::notBroadcasted ( const FloodingHeader msg)
protected

Checks whether a message was already broadcasted.

The bcMsgs list is searched for the arrived message.

If the message is in the list, it was already broadcasted and the function returns false.

Concurrently all outdated (older than bcDelTime) are deleted. If the list is full and a new message has to be entered, the oldest entry is deleted.

227 {
228  if (!plainFlooding)
229  return true;
230 
231  // serach the broadcast list of outdated entries and delete them
232  for (auto it = bcMsgs.begin(); it != bcMsgs.end();) {
233  if (it->delTime < simTime()) {
234  it = bcMsgs.erase(it);
235  }
236  // message was already broadcasted
237  else if ((it->srcAddr == msg->getSourceAddress()) && (it->seqNum == msg->getSeqNum())) {
238  // update entry
239  it->delTime = simTime() + bcDelTime;
240  return false;
241  }
242  else
243  ++it;
244  }
245 
246  // delete oldest entry if max size is reached
247  if (bcMsgs.size() >= bcMaxEntries) {
248  EV << "bcMsgs is full, delete oldest entry\n";
249  bcMsgs.pop_front();
250  }
251 
252  bcMsgs.push_back(Bcast(msg->getSeqNum(), msg->getSourceAddress(), simTime() + bcDelTime));
253  return true;
254 }

Referenced by handleLowerPacket().

◆ numInitStages()

virtual int inet::Flooding::numInitStages ( ) const
inlineoverridevirtual

Initialization of omnetpp.ini parameters.

109 { return NUM_INIT_STAGES; }

◆ setDownControlInfo()

void inet::Flooding::setDownControlInfo ( Packet *const  pMsg,
const MacAddress pDestAddr 
)
protectedvirtual

Attaches a "control info" (NetwToMac) structure (object) to the message pMsg.

Attaches a "control info" structure (object) to the down message pMsg.

This is most useful when passing packets between protocol layers of a protocol stack, the control info will contain the destination MAC address.

The "control info" object will be deleted when the message is deleted. Only one "control info" structure can be attached (the second setL3ToL2ControlInfo() call throws an error).

Parameters
pMsgThe message where the "control info" shall be attached.
pDestAddrThe MAC address of the message receiver.
335 {
336  pMsg->addTagIfAbsent<MacAddressReq>()->setDestAddress(pDestAddr);
337  pMsg->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&getProtocol());
338  pMsg->addTagIfAbsent<DispatchProtocolInd>()->setProtocol(&getProtocol());
339 }

Referenced by encapsulate(), and handleLowerPacket().

Member Data Documentation

◆ bcDelTime

simtime_t inet::Flooding::bcDelTime
protected

Time after which an entry for an already broadcasted msg can be deleted.

Referenced by handleUpperPacket(), initialize(), and notBroadcasted().

◆ bcMaxEntries

unsigned int inet::Flooding::bcMaxEntries = 0
protected

Max number of entries in the list of already broadcasted messages.

Referenced by handleUpperPacket(), initialize(), and notBroadcasted().

◆ bcMsgs

cBroadcastList inet::Flooding::bcMsgs
protected

List of already broadcasted messages.

Referenced by finish(), handleUpperPacket(), and notBroadcasted().

◆ defaultTtl

int inet::Flooding::defaultTtl = 0
protected

Default time-to-live (ttl) used for this module.

Referenced by encapsulate(), handleLowerPacket(), and initialize().

◆ headerLength

int inet::Flooding::headerLength = 0
protected

Length of the header.

Referenced by encapsulate(), and initialize().

◆ myNetwAddr

L3Address inet::Flooding::myNetwAddr
protected

cached variable of my networ address

Referenced by encapsulate(), and initialize().

◆ nbDataPacketsForwarded

long inet::Flooding::nbDataPacketsForwarded = 0
protected

◆ nbDataPacketsReceived

long inet::Flooding::nbDataPacketsReceived = 0
protected

◆ nbDataPacketsSent

long inet::Flooding::nbDataPacketsSent = 0
protected

◆ nbHops

long inet::Flooding::nbHops = 0
protected

◆ plainFlooding

bool inet::Flooding::plainFlooding = false
protected

Defines whether to use plain flooding or not.

Referenced by finish(), handleUpperPacket(), initialize(), and notBroadcasted().

◆ seqNum

unsigned long inet::Flooding::seqNum = 0
protected

Network layer sequence number.

Referenced by encapsulate(), and initialize().


The documentation for this class was generated from the following files:
inet::Flooding::bcDelTime
simtime_t bcDelTime
Time after which an entry for an already broadcasted msg can be deleted.
Definition: Flooding.h:98
inet::Flooding::headerLength
int headerLength
Length of the header.
Definition: Flooding.h:62
inet::Flooding::nbDataPacketsReceived
long nbDataPacketsReceived
Definition: Flooding.h:100
DispatchProtocolReq
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down DispatchProtocolReq
Definition: IUdp-gates.txt:25
inet::INITSTAGE_NETWORK_LAYER
INET_API InitStage INITSTAGE_NETWORK_LAYER
Initialization of network layer protocols.
L3AddressInd
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd L3AddressInd
Definition: IUdp-gates.txt:20
inet::Flooding::seqNum
unsigned long seqNum
Network layer sequence number.
Definition: Flooding.h:56
inet::Flooding::encapsulate
void encapsulate(Packet *packet)
Encapsulates the received ApplPkt into a NetwPkt and set all needed header fields.
Definition: Flooding.cc:283
inet::Flooding::myNetwAddr
L3Address myNetwAddr
cached variable of my networ address
Definition: Flooding.h:59
inet::Flooding::decapsulate
void decapsulate(Packet *packet)
Decapsulates the packet from the received Network packet.
Definition: Flooding.cc:259
inet::Flooding::nbDataPacketsSent
long nbDataPacketsSent
Definition: Flooding.h:101
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
INET_API InitStage INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
Initialization of network interfaces includes:
inet::NetworkProtocolBase::sendUp
virtual void sendUp(cMessage *message)
Definition: NetworkProtocolBase.cc:51
HopLimitReq
removed HopLimitReq
Definition: IUdp-gates.txt:11
inet::Flooding::defaultTtl
int defaultTtl
Default time-to-live (ttl) used for this module.
Definition: Flooding.h:65
inet::NetworkProtocolBase::interfaceTable
ModuleRefByPar< IInterfaceTable > interfaceTable
Definition: NetworkProtocolBase.h:35
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::Flooding::bcMaxEntries
unsigned int bcMaxEntries
Max number of entries in the list of already broadcasted messages.
Definition: Flooding.h:92
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::Flooding::plainFlooding
bool plainFlooding
Defines whether to use plain flooding or not.
Definition: Flooding.h:68
inet::Flooding::nbDataPacketsForwarded
long nbDataPacketsForwarded
Definition: Flooding.h:102
inet::Flooding::bcMsgs
cBroadcastList bcMsgs
List of already broadcasted messages.
Definition: Flooding.h:86
inet::Flooding::nbHops
long nbHops
Definition: Flooding.h:103
inet::Flooding::getProtocol
const Protocol & getProtocol() const override
Definition: Flooding.h:115
inet::Flooding::notBroadcasted
bool notBroadcasted(const FloodingHeader *)
Checks whether a message was already broadcasted.
Definition: Flooding.cc:226
inet::Flooding::setDownControlInfo
virtual void setDownControlInfo(Packet *const pMsg, const MacAddress &pDestAddr)
Attaches a "control info" (NetwToMac) structure (object) to the message pMsg.
Definition: Flooding.cc:334
inet::MacAddress::BROADCAST_ADDRESS
static const MacAddress BROADCAST_ADDRESS
The broadcast MAC address, ff:ff:ff:ff:ff:ff.
Definition: MacAddress.h:34
inet::NetworkProtocolBase::initialize
virtual void initialize(int stage) override
Definition: NetworkProtocolBase.cc:28
inet::Protocol::flooding
static const Protocol flooding
Definition: Protocol.h:126
inet::NetworkProtocolBase::sendDown
virtual void sendDown(cMessage *message, int interfaceId=-1)
Definition: NetworkProtocolBase.cc:91