Pim

Package: inet.routing.pim

compound module Pim

Implements the Protocol Independent Multicast (PIM) routing protocol for IP multicast. This module integrates both PIM-DM (Dense Mode) and PIM-SM (Sparse Mode) implementations, using a splitter to direct packets to the appropriate mode based on interface configuration. PIM builds distribution trees for efficient multicast data delivery across IP networks.

Usage diagram

Inheritance diagram

Used in compound modules

Name

Type

Description

Router

compound module

A network router device with support for multiple routing protocols and network interfaces. Provides the foundation for simulating various types of routers in both wired and wireless networks.

Extends

Name

Type

Description

Module

compound module

Base module for all INET compound modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

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

interfaceTableModule

string

routingTableModule

string

addressFamily

string

“ipv4”

address family PIM operates on (one instance serves one family)

checksumMode

string

“declared”

Properties

Name

Value

Description

class

Pim

display

i=block/network2

Gates

Name

Direction

Size

Description

networkLayerIn

input

networkLayerOut

output

Unassigned submodule parameters

Name

Type

Default value

Description

pimSplitter.displayStringTextFormat

string

“”

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

pimSplitter.interfaceTableModule

string

pimSplitter.pimInterfaceTableModule

string

pimSplitter.addressFamily

string

“ipv4”

pimDM.displayStringTextFormat

string

“”

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

pimDM.interfaceTableModule

string

pimDM.routingTableModule

string

pimDM.pimInterfaceTableModule

string

pimDM.pimNeighborTableModule

string

pimDM.addressFamily

string

“ipv4”

pimDM.holdTime

double

3.5 * helloPeriod

“The Hold Time in the Hello Message should be set to a value that can reasonably be expected to keep the Hello active until a new Hello message is received. On most links, this will be 3.5 times the value of Hello_Period.”

pimSM.displayStringTextFormat

string

“”

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

pimSM.interfaceTableModule

string

pimSM.routingTableModule

string

pimSM.pimInterfaceTableModule

string

pimSM.pimNeighborTableModule

string

pimSM.addressFamily

string

“ipv4”

address family this PIM-SM instance operates on

pimSM.RP

string

“”

pimSM.designatedRouterPriority

int

-1

pimSM.holdTime

double

3.5 * helloPeriod

pimSM.joinPrunePeriod

double

60s

Period between Join/Prune messages (called t_periodic in the RFC)

pimInterfaceTable.displayStringTextFormat

string

“”

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

pimInterfaceTable.interfaceTableModule

string

pimInterfaceTable.pimConfig

xml

xml(“<config/>”)

pimNeighborTable.displayStringTextFormat

string

“”

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

Source code

//
// Implements the Protocol Independent Multicast (PIM) routing protocol for
// IP multicast. This module integrates both PIM-DM (Dense Mode) and PIM-SM
// (Sparse Mode) implementations, using a splitter to direct packets to the
// appropriate mode based on interface configuration. PIM builds distribution
// trees for efficient multicast data delivery across IP networks.
//
module Pim extends Module like IPim
{
    parameters:
        @class(Pim);
        @display("i=block/network2");
        string interfaceTableModule;
        string routingTableModule;
        string addressFamily @enum("ipv4","ipv6") = default("ipv4"); // address family PIM operates on (one instance serves one family)
        string checksumMode @enum("declared", "computed") = default("declared");
        *.interfaceTableModule = default(absPath(this.interfaceTableModule));
        *.routingTableModule = default(absPath(this.routingTableModule));
        *.pimInterfaceTableModule = default("^.pimInterfaceTable");
        *.pimNeighborTableModule = default("^.pimNeighborTable");
        pimDM.addressFamily = default(this.addressFamily);
        pimSM.addressFamily = default(this.addressFamily);
        pimSplitter.addressFamily = default(this.addressFamily);

    gates:
        input networkLayerIn;
        output networkLayerOut;

    submodules:
        pimSplitter: PimSplitter {
            parameters:
                @display("p=250,150");
        }

        pimDM: PimDm {
            parameters:
                @display("p=400,200");
        }

        pimSM: PimSm {
            parameters:
                @display("p=400,100");
        }

        pimInterfaceTable: PimInterfaceTable {
            parameters:
                @display("p=100,100;is=s");
        }

        pimNeighborTable: PimNeighborTable {
            parameters:
                @display("p=100,200;is=s");
        }

    connections:

        // pimDM
        pimSplitter.pimDMOut --> pimDM.ipIn;
        pimSplitter.pimDMIn <-- pimDM.ipOut;

        // pimSM
        pimSplitter.pimSMOut --> pimSM.ipIn;
        pimSplitter.pimSMIn <-- pimSM.ipOut;

        // splitter out
        pimSplitter.ipOut --> { @display("m=s"); } --> networkLayerOut;
        pimSplitter.ipIn <-- { @display("m=s"); } <-- networkLayerIn;
}

File: src/inet/routing/pim/Pim.ned