RequestResponseTutorialStep

Package: inet.tutorials.queueing

RequestResponseTutorialStep

network

(no description)

requestProducer : ActivePacketSource

An active packet source which pushes packets into the connected module.

Source:
requestProducer: ActivePacketSource {
    @display("p=100,100");
} responseConsumer : PassivePacketSink

A passive packet sink which is pushed with packets by the connected packet producer.

Source:
responseConsumer: PassivePacketSink {
    @display("p=300,100");
} requestConsumer : RequestConsumer

Processes incoming packets one by one in the order they arrive.

Source:
requestConsumer: RequestConsumer {
    @display("p=100,200");
    responseProducerModule = "^.responseProducer";
} responseProducer : ResponseProducer

Generates several different streams of packets, one after the other.

Source:
responseProducer: ResponseProducer {
    @display("p=300,200");
    tokenGenerator.storageModule = "^.^.requestConsumer.server";
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Properties

Name Value Description
isNetwork
display bgb=400,300

Unassigned submodule parameters

Name Type Default value Description
requestProducer.displayStringTextFormat string "created %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

requestProducer.packetNameFormat string "%a-%c"

See directives in module documentation

requestProducer.packetRepresentation string "byteCount"

Determines the chunk of the packet data

requestProducer.packetProtocol string "unknown"
requestProducer.packetLength int
requestProducer.packetData int -1
requestProducer.attachCreationTimeTag bool true
requestProducer.attachIdentityTag bool true
requestProducer.attachDirectionTag bool true
requestProducer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

requestProducer.initialProductionOffset double -1s

Initial duration before which packets are not produced. When negative, then produce packet in initialize()

requestProducer.productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

requestProducer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

responseConsumer.displayStringTextFormat string "received %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

responseConsumer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

responseConsumer.initialConsumptionOffset double 0s

Initial duration before which packets are not consumed

responseConsumer.consumptionInterval double 0s

Elapsed time between subsequent packets allowed to be pushed by the connected packet producer, 0 means any number of packets can be pushed at the same simulation time

responseConsumer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

responseProducer.provider.displayStringTextFormat string "created %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

responseProducer.provider.packetNameFormat string "%a-%c"

See directives in module documentation

responseProducer.provider.packetRepresentation string "byteCount"

Determines the chunk of the packet data

responseProducer.provider.packetProtocol string "unknown"
responseProducer.provider.packetLength int
responseProducer.provider.packetData int -1
responseProducer.provider.attachCreationTimeTag bool true
responseProducer.provider.attachIdentityTag bool true
responseProducer.provider.attachDirectionTag bool true
responseProducer.provider.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

responseProducer.provider.initialProvidingOffset double 0s

Initial duration before which packets are not provided

responseProducer.provider.providingInterval double 0s

Elapsed time between subsequent packets allowed to be pulled by the connected packet collector, 0 means any number of packets can be pulled at the same simulation time

responseProducer.provider.scheduleForAbsoluteTime bool true

When a clock is used, relative means that setting the clock will not affect the simulation time of the event

responseProducer.server.displayStringTextFormat string "contains %n tk\nserved %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

responseProducer.server.initialNumTokens double 0

Initial number of tokens

responseProducer.server.maxNumTokens double nan

Maximum number of tokens

responseProducer.server.tokenConsumptionPerPacket double 1

How many tokens are consumed per processed packet

responseProducer.server.tokenConsumptionPerBit double 0

How many tokens are consumed per processed bit

responseProducer.multiplexer.displayStringTextFormat string "passed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

responseProducer.multiplexer.forwardServiceRegistration bool true
responseProducer.multiplexer.forwardProtocolRegistration bool true
responseProducer.tokenGenerator.displayStringTextFormat string "generated %t tk\nto %s"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

responseProducer.tokenGenerator.storageModule string "^." + parent.requestConsumerModule + ".server"

Module path of the token storage where the tokens are generated via C++ method call

responseProducer.tokenGenerator.subscriptionModule string "^"
responseProducer.tokenGenerator.signals string "tokensDepleted"
responseProducer.tokenGenerator.intSignalValue int -1
responseProducer.tokenGenerator.doubleSignalValue double nan
responseProducer.tokenGenerator.numTokens double 1

Number of tokens generated repeatedly

Source code

network RequestResponseTutorialStep
{
    @display("bgb=400,300");
    submodules:
        requestProducer: ActivePacketSource {
            @display("p=100,100");
        }
        responseConsumer: PassivePacketSink {
            @display("p=300,100");
        }
        requestConsumer: RequestConsumer {
            @display("p=100,200");
            responseProducerModule = "^.responseProducer";
        }
        responseProducer: ResponseProducer {
            @display("p=300,200");
            tokenGenerator.storageModule = "^.^.requestConsumer.server";
        }
    connections allowunconnected:
        requestProducer.out --> requestConsumer.in;
        responseProducer.out --> responseConsumer.in;
}

//-------------------------------------------------


File: tutorials/queueing/QueueingTutorial.ned