Requesting Protocol-Specific Behavior for Packets¶
This step demonstrates the PacketTagger module, which attaches various protocol-specific request tags to packets. Several of the request tags available in INET can be attached, such as the following:
Request to send the packet via a particular interface
Request to use a specific transmission power when transmitting the packet
etc.
For the list of tags that can be attached, see the parameters of PacketTagger.
The packet tagger module has a filter class to filter which packets to attach a tag onto. By default, packets are not filtered.
In this step, packets are produced periodically by an active packet source (ActivePacketSource). The packets pass through a packet tagger which attaches a HopLimitReq tag. The packets are consumed by a passive packet sink (PassivePacketSink).
network TaggerTutorialStep
{
@display("bgb=600,200");
submodules:
producer: ActivePacketSource {
@display("p=100,100");
}
tagger: PacketTagger {
@display("p=300,100");
}
consumer: PassivePacketSink {
@display("p=500,100");
}
connections:
producer.out --> tagger.in;
tagger.out --> consumer.in;
}
[Config Tagger]
network = TaggerTutorialStep
sim-time-limit = 10s
*.producer.packetLength = 1B
*.producer.productionInterval = 1s
*.tagger.hopLimit = 1