BGPRouterSimple

Package: inet.examples.bgpv4.BgpOpen

BGPRouterSimple

compound module

Example Ipv4 router with BGPv4 support.

InterfaceTable Ipv4RoutingTable Bgp MessageChecker MessageChecker ITcp MessageDispatcher Ipv4NetworkLayer MessageDispatcher IPppInterface

Usage diagram

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

Used in

Name Type Description
BgpNetwork network (no description)

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
bgp.routingTableModule string
bgp.startupTime double 0s

delay before starting BGP

bgp.bgpConfig xml
bgp.ExternalPeerStartDelayOffset double 0.5s
bgp.redistributeRip bool false

redistribute routes learned by RIP into BGP

bgp.redistributeOspf string ""

redistribute routes learned by OSPF into BGP (O IA E1 E2)

bgp.redistributeInternal bool false

redistribute BGP routes into OSPF (as external routes)

bgp.nextHopSelf bool false
bgp.localPreference int 100
bgp.connectedCheck bool true
bgp.ebgpMultihop int 1
snifferIn.config xml

Configuration file

snifferOut.config xml

Configuration file

tn.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

tn.forwardServiceRegistration bool true
tn.forwardProtocolRegistration bool true
ipv4.routingTable.interfaceTableModule string

The path to the InterfaceTable module

ipv4.routingTable.routerId string "auto"

for routers, the router id using IPv4 address dotted notation; specify "auto" to select the highest interface address; should be left empty ("") for hosts

ipv4.routingTable.netmaskRoutes string "*"

maintain netmask routes for interfaces

ipv4.routingTable.forwarding bool true

turns IP forwarding on/off

ipv4.routingTable.multicastForwarding bool false

turns multicast forwarding on/off

ipv4.routingTable.useAdminDist bool false

Use Cisco like administrative distances

ipv4.routingTable.routingFile string ""

routing table file name

ipv4.natTable.networkProtocolModule string "^.ip"
ipv4.natTable.config xml xml("")

XML configuration parameters for network address translation

ipv4.up.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

ipv4.up.forwardServiceRegistration bool true
ipv4.up.forwardProtocolRegistration bool true
ipv4.icmp.interfaceTableModule string

The path to the InterfaceTable module

ipv4.icmp.routingTableModule string
ipv4.icmp.crcMode string "declared"
ipv4.icmp.quoteLength int 8B

Number of bytes from original packet to quote in ICMP reply

ipv4.mp.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

ipv4.mp.forwardServiceRegistration bool true
ipv4.mp.forwardProtocolRegistration bool true
ipv4.lp.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

ipv4.lp.forwardServiceRegistration bool true
ipv4.lp.forwardProtocolRegistration bool true
nl.displayStringTextFormat string "processed %p pk (%l)"

determines the text that is written on top of the submodule

nl.forwardServiceRegistration bool true
nl.forwardProtocolRegistration bool true

Source code

//
// Example Ipv4 router with BGPv4 support.
//
module BGPRouterSimple
{
    parameters:
        @networkNode();
        @labels(node,ethernet-node);
        @display("i=abstract/router");
        *.interfaceTableModule = default(absPath(".interfaceTable"));
        *.routingTableModule = default(absPath(".routingTable"));
    gates:
        inout pppg[] @labels(PppFrame-conn);
    submodules:
        interfaceTable: InterfaceTable {
            parameters:
                @display("p=100,100;is=s");
        }
        routingTable: Ipv4RoutingTable {
            parameters:
                forwarding = true;
                routerId = "auto";
                @display("p=100,200;is=s");
        }
        bgp: Bgp {
            parameters:
                ospfRoutingModule = "";
                @display("p=325,80;i=block/network");
        }
        snifferIn: MessageChecker {
            parameters:
                @display("i=block/uparrow_s;p=250,160");
        }
        snifferOut: MessageChecker {
            parameters:
                @display("i=block/downarrow_s;p=400,160");
        }
        tcp: <default(firstAvailable("Tcp","TcpLwip","TcpNsc"))> like ITcp if typename != "" {
            parameters:
                @display("p=325,240;i=block/transport");
        }
        tn: MessageDispatcher {
            parameters:
                @display("b=300,5,,,,1;p=325,320");
        }
        ipv4: Ipv4NetworkLayer {
            parameters:
                @display("p=325,400;i=block/layer;q=queue");
        }
        nl: MessageDispatcher {
            parameters:
                @display("b=300,5,,,,1;p=325,480");
        }
        ppp[sizeof(pppg)]: <default("PppInterface")> like IPppInterface {
            parameters:
                @display("p=325,560,row,110;q=l2queue;i=block/ifcard");
        }

    connections allowunconnected:
        bgp.socketOut --> { @display("m=s"); } --> snifferOut.in;
        bgp.socketIn <-- { @display("m=s"); } <-- snifferIn.out;

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

        tcp.ipOut --> { @display("m=s"); } --> tn.in++;
        tcp.ipIn <-- { @display("m=s"); } <-- tn.out++;

        tn.out++ --> { @display("m=s"); } --> ipv4.transportIn;
        tn.in++ <-- { @display("m=s"); } <-- ipv4.transportOut;

        ipv4.ifOut --> { @display("m=s"); } --> nl.in++;
        ipv4.ifIn <-- { @display("m=s"); } <-- nl.out++;

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

File: examples/bgpv4/BgpOpen/BGPRouterSimple.ned