DscpMarker

Package: inet.networklayer.diffserv

DscpMarker

simple module

This module sets the DSCP field (lower six bit of Tos/TrafficClass) of IP datagrams to the value specified by the dscps parameter.

The dscps parameter is a space separated list of DSCP values. Packets arrived at gate in[i] are marked with the ith value. If there are fewer dscp values given than input gates, then the last one is repeated.

Inheritance diagram

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

Extends

Name Type Description
PacketProcessorBase simple module

This is a base module for various packet processing modules which maintains a few statistics.

Parameters

Name Type Default value Description
displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

dscps string

space separated list if dscp values; both names (e.g. AF11, EF) and numbers (0x0A,0b101110) can be used

Properties

Name Value Description
display i=block/star
class DscpMarker

Gates

Name Direction Size Description
in [ ] input
out output

Signals

Name Type Unit
packetMarked cPacket

Statistics

Name Title Source Record Unit Interpolation Mode
packetMarked packets marked packetMarked count, sum(packetBytes), vector(packetBytes) none

Direct method calls (observed)

call tofunctioninfo
EthernetInterfaceinet::NetworkInterface::pushPacketpushPacket
PacketMultiplexerinet::queueing::PacketMultiplexer::pushPacketpushPacket

Called methods (observed)

functioninfocall from
inet::DscpMarker::pushPacketpushPacketMultiFieldClassifier, PacketMultiplexer

Pushed in messages (observed)

gatemsgkindctrlsrcModuletags
in[]Packet0BehaviorAggregateClassifierDispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag
in[]Packet0MultiFieldClassifierInterfaceInd, MacAddressInd, PacketProtocolTag, DispatchProtocolInd?, DispatchProtocolReq?, InterfaceReq?, NetworkProtocolInd?
in[]Packet0TokenBucketMeterDispatchProtocolReq, InterfaceInd, MacAddressInd, PacketProtocolTag

Push out messages (observed)

gatemsgkindctrldestModuletags
outPacket0MessageDispatcherDispatchProtocolReq, InterfaceInd, MacAddressInd, PacketProtocolTag, NetworkProtocolInd?
outPacket0TokenBucketMeterDispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag
outPacket0PacketMultiplexerInterfaceInd, MacAddressInd, NetworkProtocolInd, PacketProtocolTag, DispatchProtocolInd?, DispatchProtocolReq?, InterfaceReq?

Packet operations (observed)

chunkTypepacketAction
EthernetMacHeaderpeekDataAt
Ipv4HeaderinsertDataAt, removeDataAt

Shared Tagging operations (observed)

tagTypetagAction
NetworkProtocolIndaddTagIfAbsent, removeTagIfPresent
PacketProtocolTaggetTag

Source code

//
// This module sets the DSCP field (lower six bit of Tos/TrafficClass) of IP datagrams
// to the value specified by the dscps parameter.
//
// The dscps parameter is a space separated list of DSCP values.
// Packets arrived at gate in[i] are marked with the ith value. If there are fewer
// dscp values given than input gates, then the last one is repeated.
//
simple DscpMarker extends PacketProcessorBase
{
    parameters:
        string dscps; // space separated list if dscp values; both names (e.g. AF11, EF) and numbers (0x0A,0b101110) can be used
        @class(DscpMarker);
        @display("i=block/star");
        @signal[packetMarked](type=cPacket);
        @statistic[packetMarked](title="packets marked"; source=packetMarked; record=count,"sum(packetBytes)","vector(packetBytes)"; interpolationmode=none);
    gates:
        input in[];
        output out;
}

File: src/inet/networklayer/diffserv/DscpMarker.ned