PacketServer

Package: inet.queueing.server

simple module PacketServer

Repeatedly pulls packets from the connected packet provider and after a processing delay, it pushes the packet into the connected packet consumer. The processing delay is processingTime + packetLength / processingBitrate.

inet.queueing.server.PacketServerPacketServersimple

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

DataService

compound module

(no description)

QueueingPacketDelayer

compound module

Compound module that delays packets for a specified amount of time while preserving their order. Implements the IPacketDelayer interface using a queue and server architecture. The queue stores packets while they wait, and the server processes each packet with a processing time equal to the configured delay. Note that the actual packet delay will be the sum of the queueing time and the configured delay. Unlike the simple PacketDelayer module, this implementation always maintains packet order regardless of delay distribution.

LeakyBucket

compound module

Implements a parameterizable leaky bucket algorithm.

Extends

Name

Type

Description

PacketServerBase

simple module

Base module for various packet server modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“served %p pk (%l)\n%s”

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

clockModule

string

“”

Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional

serveSchedulingPriority

int

-1

Specifies the FES scheduling priority for the extra event that is pulling the packet, -1 means no extra event

processingTime

double

Determines additional processing time per packet

processingBitrate

double

inf bps

Determines additional processing time per bit

Properties

Name

Value

Description

class

PacketServer

display

i=block/server

Gates

Name

Direction

Size

Description

in

input

out

output

Signals

Name

Type

Unit

Description

packetPulled

inet::Packet

packetPushed

inet::Packet

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

incomingDataRate

incoming datarate

throughput(packetPulled)

vector

bps

linear

the statistical value is the data rate of the incoming packets

incomingPacketLengths

incoming packet lengths

packetLength(packetPulled)

sum,histogram,vector

b

none

the statistical value is the length of the incoming packet

incomingPackets

incoming packets

packetPulled

count

pk

the statistical value is the incoming packet

outgoingDataRate

outgoing datarate

throughput(packetPushed)

vector

bps

linear

the statistical value is the data rate of the outgoing packets

outgoingPacketLengths

outgoing packet lengths

packetLength(packetPushed)

sum,histogram,vector

b

none

the statistical value is the length of the outgoing packet

outgoingPackets

outgoing packets

packetPushed

count

pk

the statistical value is the outgoing packet

Source code

//
// Repeatedly pulls packets from the connected packet provider and
// after a processing delay, it pushes the packet into the connected packet
// consumer. The processing delay is `processingTime` + `packetLength` / `processingBitrate`.
//
simple PacketServer extends PacketServerBase like IPacketServer
{
    parameters:
        displayStringTextFormat = default("served %p pk (%l)\n%s");
        string clockModule = default(""); // Relative path of a module that implements IClock; optional
        int serveSchedulingPriority = default(-1); // Specifies the FES scheduling priority for the extra event that is pulling the packet, -1 means no extra event
        volatile double processingTime @unit(s); // Determines additional processing time per packet
        volatile double processingBitrate @unit(bps) = default(inf bps); // Determines additional processing time per bit
        @class(PacketServer);
}

File: src/inet/queueing/server/PacketServer.ned