MrpInterconnection

Package: inet.linklayer.mrp

MrpInterconnection

simple module

C++ definition

Implements ring interconnection support for the Media Redundancy Protocol (MRP) as specified in IEC 62439-2. This is an extension of the ~Mrp module with the Media Redundancy Interconnection Manager (MIM) and Media Redundancy Interconnection Client (MIC) roles. This module should be used instead of ~Mrp in MRP nodes that are also ring interconnection nodes.

As per IEC 62439-2, it is possible to redundantly interconnect two or more MRP rings via the Media Redundancy Protocol (MRP) Interconnection Protocol. An MRP Interconnection setup consists at a minimum of two rings and two redundant interconnection links between these rings. The redundant interconnection links are provided by four dedicated devices supporting the MRP Interconnection protocol. The roles of these four devices must be one Media Redundancy Interconnection Manager (MIM) and three Media Redundancy Interconnection Clients (MIC). All four devices must additionally take one of the basic operational MRP roles, MRC or MRM, as they are also part of the MRP rings. The MRP Interconnect protocol may use either or ring check (RC) mode (MRP_InTest frames) or link check (LC) mode (IEEE802.1q CFM-based) to find the failure in the network among these 4 devices.

To configure an MRP Interconnection in a network, follow these steps:

1. Identify the 2+2 nodes that interconnect the two rings with two direct links. Ensure that the MRP components in them are of the type ~MrpInterconnection and not plain ~Mrp. Using the interconnectionID parameter, assign a unique interconnection ID to the four nodes.

2. Assign Interconnection Ports: Configure the interconnectionPort parameter. If you already set up the network topology so the interconnection ports are index 2, the default setting will suffice.

3. Set Node(1,2) Roles: Use the interconnectionRole parameter, designate one of the four interconnection nodes as the Media Redundancy Interconnection Manager (MIM) and the other three as Media Redundancy Interconnection Clients (MIC).

4. Adjust Features: Modify optional feature flags and settings as needed.

<b>See also:</b> ~Mrp, ~MrpRelay, ~MrpMacForwardingTable, ~L2NetworkConfigurator, ~InterfaceTable

Inheritance diagram

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

Extends

Name Type Description
Mrp simple module

Implements the Media Redundancy Protocol (MRP) as specified in IEC 62439-2. MRP is used for managing redundancy in ring network topologies commonly found in industrial network settings. MRP is similar in its function to STP and RSTP, in that it ensures a loop-free topology for an Ethernet local area network. This module implements the Media Redundancy Manager (MRM), Media Redundancy Client (MRC), and Media Redundancy Automanager (MRA) roles. This model also includes support for detecting link errors with the help of Continuity Check Messages (CCM) messages defined in 802.1q CFM.

Parameters

Name Type Default value Description
displayStringTextFormat string "role: %r, %R\nstate: %n, in: %N\nring: %g in: %I"

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

linkDetectionDelay double truncnormal(385ms,325ms)

Switches do not detect a link change immediately. This parameter sets the simulated delay of a "link down" event. Note: the delay for "link up" is hardcoded to 1us in the code.

processingDelay double truncnormal(100us,80us)

Switches require a certain amount of time to process each received packet. This parameter sets the processing delay; it is applied in handleMessageWhenUp().

timingProfile int 500ms

MRP defines four Maximum Recovery Time settings for rings: 500 ms, 200 ms, 30 ms, or 10 ms. This parameter sets a hard upper time limit guaranteed by the protocol, and the interval for test frames, topology changes, and link change times are adapted accordingly. It should be set to the same value on all nodes within a ring.

mrpRole string "disabled"

Each MRP node can either be disabled (value 0, no MRP function), be a MediaRedundancyClient (MRC, value 1), a MediaRedundancyManager (MRM, value 2), or a MediaRedundancyAutoManager (MRA, value 4). The model does not support the backward-compatible MRA (value 3) as it would be redundant. Each network may have only one MRM; all other nodes must assume the MRC role. MRAs can vote on which node should take the MRM role based on priority and MAC address value; other nodes dynamically switch to the MRC role. Mixing MRM and MRA is possible but not recommended.

ringPort1 int 0

Each MRP node has exactly two ring interfaces, which must be configured by the network administrator. The ringPort1 and ringPort2 parameters define the port index of the first and second ring port, respectively.

ringPort2 int 1
uuid0 int

An MRP ring has a UUID, split into two 64-bit parts. Every node in a ring must be configured with the same UUID.

uuid1 int
enableLinkCheckOnRing bool false

It is possible to enable active link checks on Layer 2 for each ring port, using CCM (Connectivity Check Message) messages defined in 802.1q Continuity Fault Management (CFM). Consider the additional load on the node and network when enabling this feature.

ccmInterval double 10ms

CCM (Connectivity Check Message) link checks can be performed every 3.3 ms or every 10 ms.

interconnectionRingCheckAware bool true

MRP rings can be redundantly connected by interconnection nodes. To manage necessary communication, normal MRP nodes should be aware of the check methods used. Checks can be performed either by ring check (similar to the ring test mechanism) or by link check on Layer 2 (CCM messages).

interconnectionLinkCheckAware bool true
visualize bool true

Visualizes the ring by coloring connections in the network graphics. Labels the Ethernet interface with port role and status.

interfaceTableModule string

The path to the InterfaceTable module.

macTableModule string

The path to the MacForwardingTable module.

mrpRelayModule string

The path to the MrpRelay module.

mrpPriority int 0xA000

A MRM or MRA can have a priority ranging from the highest (0x0000) to the lowest (0xFFFF). MRMs should be assigned one of the following values: HIGHEST = 0x0000, HIGH = 0x4000, DEFAULT = 0x8000. If the node is an MRA, assign one of these: MRAHIGHEST = 0x9000, MRADEFAULT = 0xA000, MRALOWEST = 0xFFFF. MRAs determine the acting manager based on priority and MAC address.

nonblockingMrcSupported bool true

In MRM role: Specifies whether non-blocking MRCs are supported by the MRM, i.e. those that are not capable of setting a ring port to BLOCKED state.

reactOnLinkChange bool true

In MRM role: Determines if the manager reacts to link change frames sent by clients or if it solely relies on ring tests for status updates.

interconnectionRole string

Specifies the interconnection role for each node within the redundancy setup: Interconnection Client (MIC, value 1) or Interconnection Manager (MIM, value 2). Only one of the four required nodes can assume the manager role (MIM), while the other three should be clients (MIC).

interconnectionPort int 2

Port number of the interconnection port.

interconnectionID int 1

Unique identifier for the interconnection, ranging from 0 to 65535.

interconnectionCheckMode string "RC"

Defines how to check the integrity of the interconnection.

  • RC (Ring Check) mode: MIM sends periodic interconnection test frames on its interconnection and ring ports, which be received on the opposite port. If not received within five interconnection test intervals, the interconnection ring is assumed broken, and the MIM changes its interconnection port from BLOCKING to FORWARDING.
  • LC (Link Check) mode: Nodes check their attached links using 802.1q-CFM (CCM messages) on the interconnection port, and report changes to the MIM. The MIM also perform a link status poll at start-up. Enabling both link check and ring check is possible but not recommended.

Properties

Name Value Description
class MrpInterconnection
display i=block/network2

Gates

Name Direction Size Description
relayIn input
relayOut output

Signals

Name Type Unit Description
inLinkChangeDetected long

emitted by the node that detected the link change; value = constant 0 or 1 (for down/up)

inPortStateChanged unsigned long
inTestFrameLatency simtime_t

emitted by the MIM only, upon receiving an InTest frame

inStatusPollSent long

emitted by MIM only with value = constant 1

inTopologyChangeAnnounced long

emitted by MIM only with value = constant 1

inRoleChanged long
inNodeStateChanged unsigned long
inTopologyStateChanged unsigned long

Statistics

Name Title Source Record Unit Interpolation Mode Description
inLinkChangeDetections Interconnection Link Up/Down Detection Events inLinkChangeDetected vector none
inTopologyChangeAnnouncements Interconnection Topology Change Announcements by MIM inTopologyChangeAnnounced vector none
inNodeState Interconnection Node State inNodeStateChanged vector sample-hold
inTestFrameLatency Latency of Received inTest Frames inTestFrameLatency vector none
inTopologyState Interconnection Topology State inTopologyStateChanged vector sample-hold
inStatusPollSent Interconnection Status Polls Sent by MIM inStatusPollSent vector none
inRole Interconnection Role inRoleChanged vector sample-hold
inPortState State of Interconnection Port inPortStateChanged vector sample-hold

Source code

//
// Implements ring interconnection support for the Media Redundancy Protocol
// (MRP) as specified in IEC 62439-2. This is an extension of the ~Mrp module
// with the Media Redundancy Interconnection Manager (MIM) and Media Redundancy
// Interconnection Client (MIC) roles. This module should be used instead of
// ~Mrp in MRP nodes that are also ring interconnection nodes.
//
// As per IEC 62439-2, it is possible to redundantly interconnect two or more
// MRP rings via the Media Redundancy Protocol (MRP) Interconnection Protocol.
// An MRP Interconnection setup consists at a minimum of two rings and two
// redundant interconnection links between these rings. The redundant
// interconnection links are provided by four dedicated devices supporting the
// MRP Interconnection protocol. The roles of these four devices must be one
// Media Redundancy Interconnection Manager (MIM) and three Media Redundancy
// Interconnection Clients (MIC). All four devices must additionally take one of
// the basic operational MRP roles, MRC or MRM, as they are also part of the MRP
// rings. The MRP Interconnect protocol may use either or ring check (RC) mode
// (MRP_InTest frames) or link check (LC) mode (IEEE802.1q CFM-based) to find
// the failure in the network among these 4 devices.
//
// To configure an MRP Interconnection in a network, follow these steps:
//
// 1. Identify the 2+2 nodes that interconnect the two rings with two direct
//    links. Ensure that the MRP components in them are of the type
//    ~MrpInterconnection and not plain ~Mrp. Using the `interconnectionID`
//    parameter, assign a unique interconnection ID to the four nodes.
//
// 2. Assign Interconnection Ports: Configure the `interconnectionPort`
//    parameter. If you already set up the network topology so the
//    interconnection ports are index 2, the default setting will suffice.
//
// 3. Set Node Roles: Use the `interconnectionRole` parameter, designate one of
//    the four interconnection nodes as the Media Redundancy Interconnection
//    Manager (MIM) and the other three as Media Redundancy Interconnection
//    Clients (MIC).
//
// 4. Adjust Features: Modify optional feature flags and settings as needed.
//
// @see ~Mrp, ~MrpRelay, ~MrpMacForwardingTable, ~L2NetworkConfigurator, ~InterfaceTable
//
simple MrpInterconnection extends Mrp like IMrp
{
    parameters:
        @class(MrpInterconnection);

        // Specifies the interconnection role for each node within the redundancy setup:
        // Interconnection Client (MIC, value 1) or Interconnection Manager (MIM, value 2).
        // Only one of the four required nodes can assume the manager role (MIM),
        // while the other three should be clients (MIC).
        string interconnectionRole @enum("MIC","MIM");

        // Port number of the interconnection port.
        int interconnectionPort = default(2);

        // Unique identifier for the interconnection, ranging from 0 to 65535.
        int interconnectionID = default(1);

        // Defines how to check the integrity of the interconnection.
        // - RC (Ring Check) mode: MIM sends periodic interconnection test
        //   frames on its interconnection and ring ports, which be received on
        //   the opposite port. If not received within five interconnection test
        //   intervals, the interconnection ring is assumed broken, and the MIM
        //   changes its interconnection port from BLOCKING to FORWARDING.
        // - LC (Link Check) mode: Nodes check their attached links using 802.1q-CFM
        //   (CCM messages) on the interconnection port, and report changes to the MIM.
        //   The MIM also perform a link status poll at start-up.
        // Enabling both link check and ring check is possible but not recommended.
        string interconnectionCheckMode @enum("RC","LC","RC_AND_LC") = default("RC");

        // Format for the text displayed above the module icon.
        // Directives: `%r`: MRP role, `%n`: node state, `%g`: ring state,
        // `%R`: interconnection role, `%N`: interconnection node state, `%I`: interconnection state.
        displayStringTextFormat = default("role: %r, %R\nstate: %n, in: %N\nring: %g in: %I");

        @signal[inRoleChanged](type="long");
        @signal[inNodeStateChanged](type="unsigned long");
        @signal[inTopologyStateChanged](type="unsigned long");
        @signal[inPortStateChanged](type="unsigned long");
        @signal[inTopologyChangeAnnounced](type=long); // emitted by MIM only with value = constant 1
        @signal[inStatusPollSent](type=long); // emitted by MIM only with value = constant 1
        @signal[inLinkChangeDetected](type=long);  // emitted by the node that detected the link change; value = constant 0 or 1 (for down/up)
        @signal[inTestFrameLatency](type=simtime_t); // emitted by the MIM only, upon receiving an InTest frame
        @statistic[inRole](title="Interconnection Role"; source=inRoleChanged; record=vector; interpolationmode=sample-hold; enumname=inet::MrpInterconnection::InterconnectionRole);
        @statistic[inNodeState](title="Interconnection Node State"; source=inNodeStateChanged; record=vector; interpolationmode=sample-hold; enumname=inet::MrpInterconnection::InterconnectionNodeState);
        @statistic[inTopologyState](title="Interconnection Topology State"; source=inTopologyStateChanged; record=vector; interpolationmode=sample-hold; enumname=inet::MrpInterconnection::InterconnectionTopologyState);
        @statistic[inPortState](title="State of Interconnection Port"; source=inPortStateChanged; record=vector; interpolationmode=sample-hold; enumname=inet::MrpInterfaceData::PortState);
        @statistic[inTopologyChangeAnnouncements](title="Interconnection Topology Change Announcements by MIM"; source=inTopologyChangeAnnounced; record=vector; interpolationmode=none);
        @statistic[inStatusPollSent](title="Interconnection Status Polls Sent by MIM"; source=inStatusPollSent; record=vector; interpolationmode=none);
        @statistic[inLinkChangeDetections](title="Interconnection Link Up/Down Detection Events"; source=inLinkChangeDetected; record=vector; interpolationmode=none);
        @statistic[inTestFrameLatency](title="Latency of Received inTest Frames"; source=inTestFrameLatency; record=vector; interpolationmode=none);
}

File: src/inet/linklayer/mrp/MrpInterconnection.ned