PcapFilePacketProducer

Package: inet.queueing.source

simple module PcapFilePacketProducer

An active packet source which pushes packets into the connected packet consumer. All pushed packets are read from a PCAP file.

Available packet name format directives:

%s - source address and/or port %d - destination address and/or port %p - innermost packet protocol %t - innermost packet protocol subtype %l - packet length %i - packet data information %n - number of packets read so far

inet.queueing.source.PcapFilePacketProducerPcapFilePacketProducersimple

Inheritance diagram

Extends

Name

Type

Description

ActivePacketSourceBase

simple module

Base module for various active packet source modules.

Parameters

Name

Type

Default value

Description

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

packetNameFormat

string

“Pcap-%p-%t-%n”

See directives in module documentation

packetRepresentation

string

“byteCount”

Determines the chunk of the packet data

packetProtocol

string

“unknown”

packetLength

int

packetData

int

-1

attachCreationTimeTag

bool

true

attachIdentityTag

bool

true

attachDirectionTag

bool

true

filename

string

The PCAP file to be read

Properties

Name

Value

Description

class

PcapFilePacketProducer

display

i=block/source

Gates

Name

Direction

Size

Description

out

output

Signals

Name

Type

Unit

Description

packetCreated

inet::Packet

packetPushed

inet::Packet

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

dataRate

data rate

throughput(packetPushed)

vector

bps

linear

the statistical value is the data rate of the packets

packetLengths

packet lengths

packetLength(packetPushed)

sum,histogram,vector

b

none

the statistical value is the length of the packet

packets

packets

packetPushed

count

pk

the statistical value is the packet

Source code

//
// An active packet source which pushes packets into the connected
// packet consumer. All pushed packets are read from a PCAP file.
//
// Available packet name format directives:
//  %s - source address and/or port
//  %d - destination address and/or port
//  %p - innermost packet protocol
//  %t - innermost packet protocol subtype
//  %l - packet length
//  %i - packet data information
//  %n - number of packets read so far
//
simple PcapFilePacketProducer extends ActivePacketSourceBase like IActivePacketSource
{
    parameters:
        string filename; // The PCAP file to be read
        packetNameFormat = default("Pcap-%p-%t-%n"); // Determines the name of the packets read from the PCAP file
        @class(PcapFilePacketProducer);
    gates:
        output out @labels(push);
}

File: src/inet/queueing/source/PcapFilePacketProducer.ned