Compound Module BGPRouterSimple

Package: inet.examples.bgpv4.BGPOpen
File: examples/bgpv4/BGPOpen/BGPRouterSimple.ned

Example IPv4 router with BGPv4 support.

InterfaceTable IPv4RoutingTable BGPRouting MessageChecker MessageChecker ITCP IPv4NetworkLayer IWiredNic

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram:

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

Networks:

Name Type Description
Net network (no description)

Parameters:

Name Type Default value Description
tcpType string firstAvailable("TCP","TCP_lwIP","TCP_NSC")

tcp implementation (e.g. TCP, TCP_lwIP, TCP_NSC) or TCPSpoof

Properties:

Name Value Description
networkNode
labels node
display i=abstract/router

Gates:

Name Direction Size Description
pppg [ ] inout

Unassigned submodule parameters:

Name Type Default value Description
interfaceTable.displayAddresses bool false

whether to display IP addresses on links

routingTable.interfaceTableModule string

The path to the InterfaceTable module

routingTable.netmaskRoutes string "*"

maintain netmask routes for interfaces

routingTable.multicastForwarding bool false

turns multicast forwarding on/off

routingTable.useAdminDist bool false

Use Cisco like administrative distances

routingTable.routingFile string ""

routing table file name

bgp.interfaceTableModule string

The path to the InterfaceTable module

bgp.routingTableModule string
bgp.bgpConfig xml
bgp.dataTransferMode string "bytecount"
snifferIn.config xml

Configuration file

snifferOut.config xml

Configuration file

networkLayer.configurator.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.configurator.networkConfiguratorModule string "configurator"

TODO: eventually rename to networkConfigurator

networkLayer.configurator.configureRoutingTable bool true

add routing entries to routing table (uses the configurator module)

networkLayer.ip.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.ip.routingTableModule string
networkLayer.ip.arpModule string
networkLayer.ip.icmpModule string
networkLayer.ip.procDelay double 0s
networkLayer.ip.timeToLive int 32
networkLayer.ip.multicastTimeToLive int 32
networkLayer.ip.fragmentTimeout double 60s
networkLayer.ip.forceBroadcast bool false
networkLayer.icmp.interfaceTableModule string

The path to the InterfaceTable module

networkLayer.icmp.routingTableModule string

Source code:

//
// Example IPv4 router with BGPv4 support.
//
module BGPRouterSimple
{
    parameters:
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=abstract/router");
        string tcpType = default(firstAvailable("TCP","TCP_lwIP","TCP_NSC"));  // tcp implementation (e.g. ~TCP, ~TCP_lwIP, ~TCP_NSC) or ~TCPSpoof
        *.interfaceTableModule = default(absPath(".interfaceTable"));
        *.routingTableModule = default(absPath(".routingTable"));
    gates:
        inout pppg[] @labels(PPPFrame-conn);
    submodules:
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=52,108;i=block/table_s");
        }
        routingTable: IPv4RoutingTable {
            parameters:
                forwarding = true;
                routerId = "auto";
                @display("p=52,172;i=block/table2_s");
        }
        bgp: BGPRouting {
            parameters:
                ospfRoutingModule = "";
                @display("p=160,50;i=block/network");
        }
        snifferIn: MessageChecker {
            parameters:
                @display("i=block/uparrow_s;p=132,124");
        }
        snifferOut: MessageChecker {
            parameters:
                @display("i=block/downarrow_s;p=196,124");
        }
        tcp: <tcpType> like ITCP if tcpType != "" {
            parameters:
                @display("p=160,202;i=block/transport");
        }
        networkLayer: IPv4NetworkLayer {
            parameters:
                proxyARP = true;
                @display("p=120,284;i=block/layer;q=queue");
            gates:
                ifIn[sizeof(pppg)];
                ifOut[sizeof(pppg)];
        }
        ppp[sizeof(pppg)]: <default("PPPInterface")> like IWiredNic {
            parameters:
                @display("p=74,369,row,110;q=l2queue;i=block/ifcard");
        }
    connections allowunconnected:
        bgp.tcpOut --> { @display("m=s"); } --> snifferOut.in;
        bgp.tcpIn <-- { @display("m=s"); } <-- snifferIn.out;

        snifferOut.out --> { @display("m=s"); } --> tcp.appIn++;
        snifferIn.in <-- { @display("m=s"); } <-- tcp.appOut++;

        tcp.ipOut --> { @display("m=s"); } --> networkLayer.transportIn++;
        tcp.ipIn <-- { @display("m=s"); } <-- networkLayer.transportOut++;

        // connections to network outside
        for i=0..sizeof(pppg)-1 {
            pppg[i] <--> { @display("m=s"); } <--> ppp[i].phys;
            ppp[i].upperLayerOut --> networkLayer.ifIn[i];
            ppp[i].upperLayerIn <-- networkLayer.ifOut[i];
        }
}