Compound Module BGPRouterEx

Package: inet.examples.bgpv4.BGPUpdate
File: examples/bgpv4/BGPUpdate/BGPRouterEx.ned

Example IP router with BGPv4 and OSPFv4 support.

InterfaceTable IPv4RoutingTable OSPFRouting BGPRouting MessageChecker MessageChecker ITCP IPv4NetworkLayer IWiredNic 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
BGPTest 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
ethg [ ] 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

ospf.interfaceTableModule string
ospf.routingTableModule string
ospf.ospfConfig xml

xml containing the full OSPF AS configuration

ospf.helloInterval int 10s

default values for attributes of interface xml entries:

ospf.pollInterval int 120s
ospf.routerDeadInterval int 40s
ospf.retransmissionInterval int 5s
ospf.interfaceOutputCost int 1
ospf.interfaceTransmissionDelay int 1
ospf.routerPriority int 1
ospf.authenticationType string "NullType"

SimplePasswordType|CrytographicType|NullType

ospf.authenticationKey string "0x00"

0xnn..nn

ospf.linkCost int 1
ospf.RFC1583Compatible bool false
ospf.areaID string ""
ospf.externalInterfaceOutputCost int 1
ospf.externalInterfaceOutputType string ""

Type1|Type2

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 IP router with BGPv4 and OSPFv4 support.
//
module BGPRouterEx
{
    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);
        inout ethg[] @labels(EtherFrame-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");
        }
        ospf: OSPFRouting {
            parameters:
                @display("p=235,284,row;i=block/network2");
        }
        bgp: BGPRouting {
            parameters:
                ospfRoutingModule = "^.ospf";
                @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 {
            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)+sizeof(ethg)];
                ifOut[sizeof(pppg)+sizeof(ethg)];
        }
        ppp[sizeof(pppg)]: <default("PPPInterface")> like IWiredNic {
            parameters:
                @display("p=74,369,row,110;q=l2queue;i=block/ifcard");
        }
        eth[sizeof(ethg)]: <default("EthernetInterface")> like IWiredNic {
            parameters:
                @display("p=196,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++;

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

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

        for i=0..sizeof(ethg)-1 {
            ethg[i] <--> eth[i].phys;
            eth[i].upperLayerOut --> networkLayer.ifIn[sizeof(pppg)+i];
            eth[i].upperLayerIn <-- networkLayer.ifOut[sizeof(pppg)+i];
        }
}