RequestConsumer

Package: inet.queueing.sink

RequestConsumer

compound module

Processes incoming packets one by one in the order they arrive. First, it classifies a packet according to the configured classifier function, then it generates tokens for the selected category in the configured response producer.

<b>See also:</b> ~ResponseProducer

queue : like IPacketQueue

PacketQueue: Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic...

IPacketQueue: Interface for packet queue modules.

Source:
queue: <default("PacketQueue")> like IPacketQueue {
    @display("p=200,100");
} server : like IPacketServer

TokenBasedServer: Repeatedly pulls packets from the connected packet provider and it pushes them into the connected...

IPacketServer: Interface for packet server modules.

Source:
server: <default("TokenBasedServer")> like IPacketServer {
    initialNumTokens = default(1);
    @display("p=200,225");
} classifier : like IPacketClassifier

PacketClassifier: Connects one packet producer to multiple packet consumers.

IPacketClassifier: Interface for packet classifier modules.

Source:
classifier: <default("PacketClassifier")> like IPacketClassifier {
    @display("p=200,350");
} tokenGenerator[numKind] : like IPassivePacketSink

PacketBasedTokenGenerator: Generates tokens into the configured ~TokenBasedServer for each consumed packet.

IPassivePacketSink: Interface for passive packet sink modules.

Source:
tokenGenerator[numKind]: <default("PacketBasedTokenGenerator")> like IPassivePacketSink {
    storageModule = default("^." + parent.responseProducerModule + ".server[" + string(index) + "]");
    @display("p=200,475,row,300");
}

Usage diagram

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

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Used in

Name Type Description
RequestResponseTutorialStep network (no description)

Parameters

Name Type Default value Description
numKind int
responseProducerModule string "^.source"

Properties

Name Value Description
display i=block/sink

Gates

Name Direction Size Description
in input

Source code

//
// Processes incoming packets one by one in the order they arrive.
// First, it classifies a packet according to the configured classifier function,
// then it generates tokens for the selected category in the configured response
// producer.
//
// @see ~ResponseProducer
//
module RequestConsumer like IPassivePacketSink
{
    parameters:
        int numKind;
        string responseProducerModule = default("^.source");
        @display("i=block/sink");
    gates:
        input in;
    submodules:
        queue: <default("PacketQueue")> like IPacketQueue {
            @display("p=200,100");
        }
        server: <default("TokenBasedServer")> like IPacketServer {
            initialNumTokens = default(1);
            @display("p=200,225");
        }
        classifier: <default("PacketClassifier")> like IPacketClassifier {
            @display("p=200,350");
        }
        tokenGenerator[numKind]: <default("PacketBasedTokenGenerator")> like IPassivePacketSink {
            storageModule = default("^." + parent.responseProducerModule + ".server[" + string(index) + "]");
            @display("p=200,475,row,300");
        }
    connections:
        in --> queue.in;
        queue.out --> server.in;
        server.out --> classifier.in;
        for i=0..sizeof(tokenGenerator) - 1 {
            classifier.out++ --> tokenGenerator[i].in;
        }
}
File: src/inet/queueing/sink/RequestConsumer.ned