TelnetClientApp

Package: inet.applications.tcpapp

compound module TelnetClientApp

This client application contains a configurable pre-composed telnet traffic source and traffic sink.

See also: TelnetServerApp

TelnetClientAppcharacterProducer.out --> scheduler.in++enterProducer.out --> scheduler.in++emptyProducer.out --> scheduler.in++scheduler.out --> io.trafficInio.trafficOut --> consumer.inio.socketOut --> socketOutsocketIn --> io.socketIncharacterProducer: inet.queueing.source.ActivePacketSource (like IActivePacketSource) ActivePacketSource: An active packet source which pushes packets into the connected module. IActivePacketSource: Interface for active packet source modules. Source: characterProducer: <default("ActivePacketSource")> like IActivePacketSource { parameters: packetLength = 1B; packetData = intuniform(97, 122); // Lower case ASCII characters productionInterval = uniform(0.1s, 0.2s); // Typing speed betwe...characterProducerenterProducer: inet.queueing.source.ActivePacketSource (like IActivePacketSource) ActivePacketSource: An active packet source which pushes packets into the connected module. IActivePacketSource: Interface for active packet source modules. Source: enterProducer: <default("ActivePacketSource")> like IActivePacketSource { parameters: packetLength = 1B; packetData = 13; // Enter character productionInterval = 0.1s; @display("p=300,100"); }enterProduceremptyProducer: inet.queueing.source.EmptyPacketSource (like IActivePacketSource) EmptyPacketSource: An active/passive empty packet source. IActivePacketSource: Interface for active packet source modules. Source: emptyProducer: <default("EmptyPacketSource")> like IActivePacketSource { parameters: @display("p=500,100"); }emptyProducerscheduler: inet.queueing.scheduler.MarkovScheduler (like IPacketScheduler) MarkovScheduler: Implements a packet scheduler using a Markov process that has as many states as input gates the s... IPacketScheduler: Interface for packet scheduler modules. Source: scheduler: <default("MarkovScheduler")> like IPacketScheduler { parameters: transitionProbabilities = "0 1 0 0 0 1 1 0 0"; // Character -> enter -> wait -> character waitIntervals = "uniform(0,3) 0 uniform(10,30)"; @display("p=300,200");...schedulerconsumer: inet.queueing.sink.PassivePacketSink (like IPassivePacketSink) PassivePacketSink: A passive packet sink which is pushed with packets by the connected packet producer. IPassivePacketSink: Interface for passive packet sink modules. Source: consumer: <default("PassivePacketSink")> like IPassivePacketSink { parameters: @display("p=100,200"); }consumerio: inet.applications.tcpapp.TcpClientSocketIo Opens a TCP connection to a given address and port and lets the module connected to its `trafficI... Source: io: TcpClientSocketIo { parameters: @display("p=200,300"); }io

Usage diagram

Inheritance diagram

Properties

Name

Value

Description

display

i=block/app

Gates

Name

Direction

Size

Description

socketIn

input

socketOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

characterProducer.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

characterProducer.packetNameFormat

string

“%a-%c”

See directives in module documentation

characterProducer.packetRepresentation

string

“byteCount”

Determines the chunk of the packet data

characterProducer.packetProtocol

string

“unknown”

characterProducer.attachCreationTimeTag

bool

true

characterProducer.attachIdentityTag

bool

true

characterProducer.attachDirectionTag

bool

true

characterProducer.clockModule

string

“”

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

characterProducer.initialProductionOffset

double

-1s

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

characterProducer.scheduleForAbsoluteTime

bool

true

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

enterProducer.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

enterProducer.packetNameFormat

string

“%a-%c”

See directives in module documentation

enterProducer.packetRepresentation

string

“byteCount”

Determines the chunk of the packet data

enterProducer.packetProtocol

string

“unknown”

enterProducer.attachCreationTimeTag

bool

true

enterProducer.attachIdentityTag

bool

true

enterProducer.attachDirectionTag

bool

true

enterProducer.clockModule

string

“”

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

enterProducer.initialProductionOffset

double

-1s

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

enterProducer.scheduleForAbsoluteTime

bool

true

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

emptyProducer.displayStringTextFormat

string

“created 0 pk (0 B)”

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

scheduler.displayStringTextFormat

string

“classified %p pk (%l)\ncurrent state: %s”

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

scheduler.reverseOrder

bool

false

scheduler.clockModule

string

“”

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

scheduler.initialState

int

0

The starting state of the Markov process

consumer.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

consumer.clockModule

string

“”

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

consumer.initialConsumptionOffset

double

0s

Initial duration before which packets are not consumed

consumer.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

consumer.scheduleForAbsoluteTime

bool

true

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

io.displayStringTextFormat

string

“”

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

io.localAddress

string

“”

io.localPort

int

-1

io.connectAddress

string

io.connectPort

int

io.autoRead

bool

true

Whether to use “autoread” or “explicit-read” mode for TCP connection

io.readSize

int

-1B

Used only with autoRead==false

io.readDelay

double

-1s

Used only with autoRead==false; delay for issuing a READ command after the previous READ was satisfied; -1 means immediately, 0 means zero delay

Source code

//
// This client application contains a configurable pre-composed telnet traffic
// source and traffic sink.
//
// @see ~TelnetServerApp
//
module TelnetClientApp like IApp
{
    parameters:
        @display("i=block/app");
    gates:
        input socketIn;
        output socketOut;
    submodules:
        characterProducer: <default("ActivePacketSource")> like IActivePacketSource {
            parameters:
                packetLength = 1B;
                packetData = intuniform(97, 122); // Lower case ASCII characters
                productionInterval = uniform(0.1s, 0.2s); // Typing speed between 5 and 10 characters per second
                @display("p=100,100");
        }
        enterProducer: <default("ActivePacketSource")> like IActivePacketSource {
            parameters:
                packetLength = 1B;
                packetData = 13; // Enter character
                productionInterval = 0.1s;
                @display("p=300,100");
        }
        emptyProducer: <default("EmptyPacketSource")> like IActivePacketSource {
            parameters:
                @display("p=500,100");
        }
        scheduler: <default("MarkovScheduler")> like IPacketScheduler {
            parameters:
                transitionProbabilities = "0 1 0 0 0 1 1 0 0"; // Character -> enter -> wait -> character
                waitIntervals = "uniform(0,3) 0 uniform(10,30)";
                @display("p=300,200");
        }
        consumer: <default("PassivePacketSink")> like IPassivePacketSink {
            parameters:
                @display("p=100,200");
        }
        io: TcpClientSocketIo {
            parameters:
                @display("p=200,300");
        }
    connections:
        characterProducer.out --> scheduler.in++;
        enterProducer.out --> scheduler.in++;
        emptyProducer.out --> scheduler.in++;
        scheduler.out --> { @display("m=s"); } --> io.trafficIn;
        io.trafficOut --> { @display("m=s"); } --> consumer.in;
        io.socketOut --> { @display("m=s"); } --> socketOut;
        socketIn --> { @display("m=s"); } --> io.socketIn;
}

File: src/inet/applications/tcpapp/TelnetClientApp.ned