Table Of Contents
Table Of Contents

Time-Based Server

The PacketServer module connects to passive packet sources and sinks. The server actively pops packets from the connected packet provider and after a configurable processing delay, it pushes them onto the connected packet consumer.

In this step, packets are passed through from the source to the sink periodically (randomly) by the active packet processor (PacketServer). The packets are generated by a passive packet source (PassivePacketSource) and consumed by a passive packet sink (PassivePacketSink).

../../../_images/Server.png
network ServerTutorialStep
{
    @display("bgb=600,200");
    submodules:
        provider: PassivePacketSource {
            @display("p=100,100");
        }
        server: PacketServer {
            @display("p=300,100");
        }
        consumer: PassivePacketSink {
            @display("p=500,100");
        }
    connections allowunconnected:
        provider.out --> server.in;
        server.out --> consumer.in;
}
[Config Server]
network = ServerTutorialStep
sim-time-limit = 10s

*.provider.packetLength = 1B
*.server.processingTime = uniform(0s, 2s)