Compound Module EthernetInterfaceThrMtr

Package: pubsub_sim
File: src/EthernetInterfaceThrMtr.ned

Ethernet Interface with Throughput Meter

Ethernet network interface which supports full-duplex operation only. Complements EtherMAC2 and EtherEncap with an output queue for QoS and RED support. It also incorporates a throuput meter, but easier recording of statistics.

See also: EthernetInterface, EthernetInterfaceNoQueue, ThruputMeter.

OutputQueue EtherMAC2 EtherEncap ThrPutMeter

Used in compound modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

PSRouter (compound module)

The Publish-Subscribe Router

PubHost (compound module)

The Publisher Host

SubHost (compound module)

The Subscriber Host

Parameters:

Name Type Default value Description
queueType string "DropTailQueue"

Properties:

Name Value Description
display i=block/ifcard;bgb=214,341

Gates:

Name Direction Size Description
netwIn input
netwOut output
phys inout

Unassigned submodule parameters:

Name Type Default value Description
mac.promiscuous bool false

if true, all packets are received, otherwise only the ones with matching destination MAC address

mac.address string "auto"

MAC address as hex string (12 hex digits), or "auto". "auto" values will be replaced by a generated MAC address in init stage 0.

mac.mtu int 1500
thruputMeter.startTime double 0s
thruputMeter.batchSize int 10000
thruputMeter.maxInterval double 1s

Source code:

//
// <b> Ethernet Interface with Throughput Meter </b>
//
// Ethernet network interface which supports full-duplex operation only.
// Complements EtherMAC2 and EtherEncap with an output queue for QoS and
// RED support. It also incorporates a throuput meter, but easier recording
// of statistics.
//
// @see EthernetInterface, EthernetInterfaceNoQueue, ThruputMeter.
//
module EthernetInterfaceThrMtr like INetworkInterface
{
    parameters:
        string queueType = default("DropTailQueue");
        @display("i=block/ifcard;bgb=214,341");
    gates:
        input netwIn;
        output netwOut;
        inout phys @labels(EtherFrame);
    submodules:
        queue: <queueType> like OutputQueue {
            parameters:
                @display("p=76,65;q=l2queue");
        }
        mac: EtherMAC2 {
            parameters:
                queueModule = "queue";
                txQueueLimit = 1; // queue sends one packet at a time
                @display("p=129,267");
        }
        encap: EtherEncap {
            parameters:
                @display("p=129,187");
        }
        thruputMeter: ThrPutMeter {
            @display("p=76,125");
        }
    connections:
        netwIn --> queue.in;
        queue.out --> thruputMeter.in;
        netwOut <-- { @display("m=n"); } <-- encap.upperLayerOut;
        encap.lowerLayerOut --> mac.upperLayerIn;
        encap.lowerLayerIn <-- mac.upperLayerOut;
        mac.phys <--> phys;
        thruputMeter.out --> encap.upperLayerIn;
}