Package: inet.networklayer.flooding
Flooding
simple moduleA simple flooding protocol for network-level broadcast.
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 entries for that list can be defined in the .ini file (bcMaxEntries parameter) as well as the time after which an entry is deleted (bcDelTime parameter).
If you prefere a memory-less version you should set to false the plainFlooding bool parameter.
Author: Daniel Willkomm
ported to Mixim 2.0 by Theodoros Kapourniotis
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Extends
Name | Type | Description |
---|---|---|
NetworkProtocolBase | simple module |
Module base for different network protocols. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string | ||
headerLength | int | 96b |
length of the network packet header (in bits) |
plainFlooding | bool | true |
flag whether to use plain flooding |
bcMaxEntries | int | 100 |
Max number of entries in the list of already broadcasted messages |
bcDelTime | double | 100 s |
Time after which an entry for an already broadcasted msg can be deleted |
defaultTtl | int | 10 |
Default time-to-live (ttl) used for this module expressed in number of hops. |
Properties
Name | Value | Description |
---|---|---|
display | i=block/fork | |
class | Flooding |
Gates
Name | Direction | Size | Description |
---|---|---|---|
transportIn | input | ||
transportOut | output | ||
queueIn | input | ||
queueOut | output |
Signals
Name | Type | Unit |
---|---|---|
packetReceivedFromUpper | cPacket | |
packetReceivedFromLower | cPacket | |
packetDropped | cPacket | |
packetSentToLower | cPacket | |
packetSentToUpper | cPacket |
Direct method calls (observed)
call to | function | info |
---|---|---|
MessageDispatcher | inet::MessageDispatcher::arrived | arrived |
MessageDispatcher | inet::MessageDispatcher::handleRegisterProtocol | handleRegisterProtocol |
MessageDispatcher | inet::MessageDispatcher::handleRegisterService | handleRegisterService |
InterfaceTable | inet::InterfaceTable::findFirstNonLoopbackInterface | findFirstNonLoopbackInterface |
Called methods (observed)
function | info | call from |
---|---|---|
inet::Flooding::handleRegisterProtocol | handleRegisterProtocol | MessageDispatcher |
inet::Flooding::handleRegisterService | handleRegisterService | MessageDispatcher |
Incoming messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
queueIn | Packet | 0 | EthernetEncapsulation | DispatchProtocolReq, InterfaceInd, MacAddressInd, PacketProtocolTag | |
transportIn | Packet | 0 | PingApp | DispatchProtocolReq, L3AddressReq, PacketProtocolTag, SocketReq | |
transportIn | Packet | 0 | EchoProtocol | DispatchProtocolReq, L3AddressReq, PacketProtocolTag | |
transportIn | Request | 1 | L3SocketBindCommand | PingApp | DispatchProtocolReq, SocketReq |
Outgoing messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
queueOut | Packet | 0 | EthernetEncapsulation | DispatchProtocolInd, DispatchProtocolReq, InterfaceReq, MacAddressReq, PacketProtocolTag, InterfaceInd?, L3AddressReq?, MacAddressInd?, SocketReq? | |
transportOut | Packet | 0 | PingApp | DispatchProtocolReq, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, SocketInd | |
transportOut | Packet | 0 | EchoProtocol | DispatchProtocolReq, HopLimitInd, InterfaceInd, L3AddressInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag |
Packet operations (observed)
chunkType | packetAction |
---|---|
FloodingHeader | insertAtFront, peekAtFront, popAtFront, removeAtFront |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
DispatchProtocolInd | addTagIfAbsent |
DispatchProtocolReq | addTagIfAbsent |
HopLimitInd | addTagIfAbsent |
HopLimitReq | removeTagIfPresent |
InterfaceReq | addTagIfAbsent |
L3AddressInd | addTagIfAbsent, getTag |
L3AddressReq | findTag |
MacAddressReq | addTagIfAbsent |
NetworkProtocolInd | addTagIfAbsent |
PacketProtocolTag | addTagIfAbsent, getTag |
SocketInd | addTagIfAbsent |
SocketReq | getTag |
Tagging operations (observed)
tagType | tagAction |
---|---|
inet::Ipv4InterfaceData | findTag |
inet::Ipv6InterfaceData | findTag |
inet::NextHopInterfaceData | findTag |
Source code
// // A simple flooding protocol for network-level broadcast. // // 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 entries for that list can be defined in the // .ini file (bcMaxEntries parameter) as well as the time after which an entry // is deleted (bcDelTime parameter). // // If you prefere a memory-less version you should set to false the // plainFlooding bool parameter. // // @author Daniel Willkomm // // ported to Mixim 2.0 by Theodoros Kapourniotis // simple Flooding extends NetworkProtocolBase like INetworkProtocol { parameters: @display("i=block/fork"); int headerLength @unit(b) = default(96b); // length of the network packet header (in bits) bool plainFlooding = default(true); // flag whether to use plain flooding // Max number of entries in the list of already broadcasted messages int bcMaxEntries = default(100); // Time after which an entry for an already broadcasted msg can be deleted double bcDelTime @unit(s) = default(100 s); int defaultTtl = default(10); // Default time-to-live (ttl) used for this module expressed in number of hops. @class(Flooding); }File: src/inet/networklayer/flooding/Flooding.ned