Bgp

Package: inet.routing.bgpv4

Bgp

simple module

Implements BGP Version 4 routing protocol.

The bgpConfig parameter can specify an XML file describing the configuration of all BGP routers and their interfaces in the network.

Inheritance diagram

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

Parameters

Name Type Default value Description
interfaceTableModule string
routingTableModule string
ospfRoutingModule string
startupTime double 0s

delay before starting BGP

bgpConfig xml
ExternalPeerStartDelayOffset double 0.5s
redistributeRip bool false

redistribute routes learned by RIP into BGP

redistributeOspf string ""

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

redistributeInternal bool false

redistribute BGP routes into OSPF (as external routes)

nextHopSelf bool false
localPreference int 100
connectedCheck bool true
ebgpMultihop int 1

Properties

Name Value Description
display i=block/network2
selfMessageKinds inet::bgp::BgpSelfMsgKind

Gates

Name Direction Size Description
socketIn input
socketOut output

Scheduled messages (observed)

msgkindctrltagsmsgnamecontext
omnetpp::cMessage81 (BgpSelfMsgKind::START_EVENT_KIND)BGP Startfilled
omnetpp::cMessage82 (BgpSelfMsgKind::CONNECT_RETRY_KIND)BGP Connect Retryfilled
omnetpp::cMessage83 (BgpSelfMsgKind::HOLD_TIME_KIND)BGP Hold Timerfilled
omnetpp::cMessage89 (BgpSelfMsgKind::KEEP_ALIVE_KIND)BGP Keep Alive Timerfilled

Direct method calls (observed)

call tofunctioninfo
MessageDispatcherinet::MessageDispatcher::arrivedarrived
Ipv4RoutingTableinet::Ipv4RoutingTable::addRouteaddRoute(...)
Ipv4RoutingTableinet::Ipv4RoutingTable::deleteRoutedeleteRoute(...)
Ipv4RoutingTableinet::Ipv4RoutingTable::getInterfaceForDestAddrgetInterfaceForDestAddr(%u.%u.%u.%u)
Ospfv2inet::ospfv2::Ospfv2::checkExternalRoutecheckExternalRoute
Ospfv2inet::ospfv2::Ospfv2::insertExternalRouteinsertExternalRoute

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
socketInIndication3 (TcpStatusInd::TCP_I_AVAILABLE)TcpAvailableInfoMessageCheckerSocketInd
socketInIndication3 (TcpStatusInd::TCP_I_AVAILABLE)TcpAvailableInfoTcpSocketInd
socketInIndication4 (TcpStatusInd::TCP_I_ESTABLISHED)TcpConnectInfoMessageCheckerSocketInd
socketInIndication4 (TcpStatusInd::TCP_I_ESTABLISHED)TcpConnectInfoTcpSocketInd
socketInIndication6 (TcpStatusInd::TCP_I_CLOSED)TcpCommandMessageCheckerSocketInd
socketInIndication6 (TcpStatusInd::TCP_I_CLOSED)TcpCommandTcpSocketInd
socketInIndication8 (TcpStatusInd::TCP_I_CONNECTION_RESET)TcpCommandMessageCheckerSocketInd
socketInIndication8 (TcpStatusInd::TCP_I_CONNECTION_RESET)TcpCommandTcpSocketInd
socketInPacket1 (TcpStatusInd::TCP_I_DATA)MessageCheckerSocketInd
socketInPacket1 (TcpStatusInd::TCP_I_DATA)TcpSocketInd

Outgoing messages (observed)

gatemsgkindctrldestModuletags
socketOutPacket4 (TcpCommandCode::TCP_C_SEND)MessageCheckerDispatchProtocolReq, SocketReq
socketOutPacket4 (TcpCommandCode::TCP_C_SEND)TcpDispatchProtocolReq, SocketReq
socketOutRequest1 (TcpCommandCode::TCP_C_OPEN_ACTIVE)TcpOpenCommandMessageCheckerDispatchProtocolReq, SocketReq
socketOutRequest1 (TcpCommandCode::TCP_C_OPEN_ACTIVE)TcpOpenCommandTcpDispatchProtocolReq, SocketReq
socketOutRequest11 (TcpCommandCode::TCP_C_SETOPTION)TcpSetTimeToLiveCommandMessageCheckerDispatchProtocolReq, SocketReq
socketOutRequest11 (TcpCommandCode::TCP_C_SETOPTION)TcpSetTimeToLiveCommandTcpDispatchProtocolReq, SocketReq
socketOutRequest2 (TcpCommandCode::TCP_C_OPEN_PASSIVE)TcpOpenCommandMessageCheckerDispatchProtocolReq, SocketReq
socketOutRequest2 (TcpCommandCode::TCP_C_OPEN_PASSIVE)TcpOpenCommandTcpDispatchProtocolReq, SocketReq
socketOutRequest3 (TcpCommandCode::TCP_C_ACCEPT)TcpAcceptCommandMessageCheckerDispatchProtocolReq, SocketReq
socketOutRequest3 (TcpCommandCode::TCP_C_ACCEPT)TcpAcceptCommandTcpDispatchProtocolReq, SocketReq
socketOutRequest6 (TcpCommandCode::TCP_C_ABORT)TcpCommandMessageCheckerDispatchProtocolReq, SocketReq
socketOutRequest6 (TcpCommandCode::TCP_C_ABORT)TcpCommandTcpDispatchProtocolReq, SocketReq

Packet operations (observed)

chunkTypepacketAction
peekData
BgpKeepAliveMessageinsertAtFront
BgpOpenMessageinsertAtFront
BgpUpdateMessageinsertAtFront

Shared Tagging operations (observed)

tagTypetagAction
DispatchProtocolReqaddTagIfAbsent
SocketIndfindTag, getTag
SocketReqaddTagIfAbsent

Tagging operations (observed)

tagTypetagAction
inet::Ipv4InterfaceDatagetTag

Source code

//
// Implements BGP Version 4 routing protocol.
//
// The bgpConfig parameter can specify an XML file describing the
// configuration of all BGP routers and their interfaces in the network.
//
//# TODO config file!
//
simple Bgp like IBgp
{
    parameters:
        string interfaceTableModule;
        string routingTableModule;
        string ospfRoutingModule;
        volatile double startupTime @unit(s) = default(0s); // delay before starting BGP
        xml bgpConfig;
        double ExternalPeerStartDelayOffset @unit(s) = default(0.5s);
        bool redistributeRip = default(false);        // redistribute routes learned by RIP into BGP
        string redistributeOspf = default("");        // redistribute routes learned by OSPF into BGP (O IA E1 E2)
        bool redistributeInternal = default(false);   // redistribute BGP routes into OSPF (as external routes)
        bool nextHopSelf = default(false);
        int localPreference = default(100);
        bool connectedCheck = default(true);
        int ebgpMultihop = default(1);
        @display("i=block/network2");
        @selfMessageKinds(inet::bgp::BgpSelfMsgKind);
    gates:
        input socketIn @messageKinds(inet::TcpStatusInd);
        output socketOut @messageKinds(inet::TcpCommandCode);
}

File: src/inet/routing/bgpv4/Bgp.ned