Table Of Contents
Table Of Contents

Blocking/Unblocking Packet Flow (Active Source)

The PacketGate module allows packets to pass through when it is open, and blocks them when it is closed. The gate opens and closes according to the configured schedule. There are multiple ways to specify the schedule: simple open/close time parameters, a script parameter, or programmatically (via C++).

In this example network, packets are produced periodically by an active packet source (ActivePacketSource). The packets pass through a packet gate if it is open, otherwise packets are not generated. The packets are consumed by a passive packet sink (PassivePacketSink). The time of opening and closing the gate is configured via parameters.

network Gate1TutorialStep
        producer: ActivePacketSource {
        gate: PacketGate {
        consumer: PassivePacketSink {
        producer.out -->;
        gate.out -->;
[Config Gate1]
network = Gate1TutorialStep
sim-time-limit = 10s

*.producer.packetLength = 1B
*.producer.productionInterval = 1s
*.gate.openTime = 3s
*.gate.closeTime = 7s