PcapFilePacketProducer

Package: inet.queueing.source

PcapFilePacketProducer

simple module

This module is 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

Inheritance diagram

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

Extends

Name Type Description
ActivePacketSourceBase simple module

This is a 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

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
display i=block/source
class PcapFilePacketProducer

Gates

Name Direction Size Description
out output

Signals

Name Type Unit
packetPushed inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode
packetLengths packet lengths packetLength(packetPushed) sum, histogram, vector b none
dataRate data rate throughput(packetPushed) vector bps linear
packets packets packetPushed count pk

Source code

//
// This module is 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