Skip to content

Commit 7cf0a4f

Browse files
committed
Bgp: move the BGP timers from the config XML to module parameters
The BGP timers were configured in a single global <TimerParams> element in the bgpConfig XML, applied to every router. They are per-router behavior knobs, not topology, so move them to Bgp module parameters: connectRetryTime (default 120s), holdTime (180s), keepAliveTime (60s) and startDelay (1s) -- all @Unit(s) and overridable from the ini (e.g. **.bgp.holdTime = 90s), consistent with the existing startupTime / ExternalPeerStartDelayOffset parameters. BgpConfigReader now reads the timers from the module parameters and rejects a <TimerParams> element with an informative error that explains how to convert it to module parameters (including the element's source location). <TimerParams> is removed from every BGPConfig*.xml under examples/bgpv4 and tutorials/bgp; each example/tutorial sets the equivalent parameters in its omnetpp.ini where they differ from the new defaults (holdTime=120s in BgpAndOspf, keepAliveTime=680s in BgpOpen, and the various startDelay values). The BGP.xsd schema and the BGP section of the User Guide are updated as well. The timer values are unchanged, so all bgpv4 and tutorials/bgp fingerprints stay byte-identical (verified). The timers are intentionally NOT added to the IBgp moduleinterface, matching how the other Bgp behavior parameters (ebgpMultihop, connectedCheck, ExternalPeerStartDelayOffset) are kept off the interface.
1 parent 9756925 commit 7cf0a4f

34 files changed

Lines changed: 56 additions & 193 deletions

doc/schemas/BGP.xsd

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@
6464
</xsd:complexType>
6565
</xsd:simpleType>
6666

67-
<xsd:element name="TimerParams">
68-
<xsd:complexType>
69-
<xsd:sequence>
70-
<xsd:element name="connectRetryTime" type="xsd:positiveInteger" default="120"/>
71-
<xsd:element name="holdTime" type="xsd:positiveInteger" default="180"/>
72-
<xsd:element name="keepAliveTime" type="xsd:positiveInteger" default= "60"/>
73-
<xsd:element name="startDelay" type="xsd:positiveInteger" />
74-
</xsd:sequence>
75-
</xsd:complexType>
76-
</xsd:element>
77-
7867
<xsd:element name="AS">
7968
<xsd:annotation>
8069
<xsd:documentation xml:lang="en">

doc/src/users-guide/ch-routing.rst

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,8 @@ parameter.
166166
167167
**.bgpConfig = xmldoc("BGPConfig.xml")
168168
169-
The configuration file may contain ``<TimerParams>``, ``<AS>``, and
170-
``Session`` elements at the top level.
171-
172-
- ``<TimerParams>``: allows specifying various timing parameters for
173-
the routers.
169+
The configuration file may contain ``<AS>`` and ``<Session>`` elements
170+
at the top level.
174171

175172
- ``<AS>``: defines Autonomous Systems, routers, and rules to be
176173
applied.
@@ -179,18 +176,23 @@ The configuration file may contain ``<TimerParams>``, ``<AS>``, and
179176
must contain exactly two ``<Router exterAddr="x.x.x.x"/>``
180177
elements.
181178

179+
The BGP timers are module parameters of the :ned:`Bgp` module, not part of
180+
the XML: :par:`connectRetryTime` (default 120s), :par:`holdTime` (180s),
181+
:par:`keepAliveTime` (60s) and :par:`startDelay` (the base session-startup
182+
delay). For example:
183+
184+
.. code-block:: ini
185+
186+
**.bgp.holdTime = 90s
187+
188+
(Earlier versions configured these in a ``<TimerParams>`` XML element, which
189+
is no longer accepted.)
190+
182191
.. code-block:: xml
183192
184193
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
185194
xsi:schemaLocation="BGP.xsd">
186195
187-
<TimerParams>
188-
<connectRetryTime> 120 </connectRetryTime>
189-
<holdTime> 180 </holdTime>
190-
<keepAliveTime> 60 </keepAliveTime>
191-
<startDelay> 15 </startDelay>
192-
</TimerParams>
193-
194196
<AS id="60111">
195197
<Router interAddr="172.1.10.255"/> <!--Router A1-->
196198
<Router interAddr="172.1.20.255"/> <!--Router A2-->

examples/bgpv4/Bgp2RoutersInAS/BGPConfig.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="BGP.xsd">
44

5-
<TimerParams>
6-
<connectRetryTime> 120 </connectRetryTime>
7-
<holdTime> 180 </holdTime>
8-
<keepAliveTime> 60 </keepAliveTime>
9-
<startDelay> 15 </startDelay>
10-
</TimerParams>
11-
125
<AS id="65111">
136
<Router interAddr="10.10.1.254"/> <!--router A1-->
147
<Router interAddr="10.10.3.254"/> <!--router A2-->

examples/bgpv4/Bgp2RoutersInAS/omnetpp.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ output-vector-precision = 4
2727

2828
# bgp settings
2929
**.bgpConfig = xmldoc("BGPConfig.xml")
30+
**.bgp.startDelay = 15s
3031

3132
*.B.bgp.redistributeOspf = "O IA E2"
3233
*.C.bgp.redistributeOspf = "O IA E2"

examples/bgpv4/Bgp3Routers/BGPConfig.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="BGP.xsd">
44

5-
<TimerParams>
6-
<connectRetryTime> 120 </connectRetryTime>
7-
<holdTime> 180 </holdTime>
8-
<keepAliveTime> 60 </keepAliveTime>
9-
<startDelay> 15 </startDelay>
10-
</TimerParams>
11-
125
<AS id="65111">
136
<Router interAddr="10.10.12.1"/> <!--router A-->
147
<!-- DenyRoute: deny route in IN and OUT traffic -->

examples/bgpv4/Bgp3Routers/omnetpp.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ output-scalar-precision = 3
2323

2424
# bgp settings
2525
**.bgpConfig = xmldoc("BGPConfig.xml")
26+
**.bgp.startDelay = 15s
2627
**.bgp.redistributeOspf = "O IA E2"
2728

2829
# Visualizer settings

examples/bgpv4/BgpAndOspf/BGPConfig.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="BGP.xsd">
44

5-
<TimerParams>
6-
<connectRetryTime> 120 </connectRetryTime>
7-
<holdTime> 120 </holdTime>
8-
<keepAliveTime> 60 </keepAliveTime>
9-
<startDelay> 15 </startDelay>
10-
</TimerParams>
11-
125
<AS id="65324">
136
<Router interAddr="100.10.10.1"/> <!--router A-->
147
<!-- DenyRoute: deny route in IN and OUT traffic -->

examples/bgpv4/BgpAndOspf/omnetpp.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ output-scalar-precision = 5
2323

2424
# bgp settings
2525
**.bgpConfig = xmldoc("BGPConfig.xml")
26+
**.bgp.holdTime = 120s
27+
**.bgp.startDelay = 15s
2628
*.*.bgp.redistributeOspf = "E2"
2729

2830
# Visualizer settings

examples/bgpv4/BgpAndOspfSimple/BGPConfig.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<BGPConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="BGP.xsd">
44

5-
<TimerParams>
6-
<connectRetryTime> 120 </connectRetryTime>
7-
<holdTime> 180 </holdTime>
8-
<keepAliveTime> 60 </keepAliveTime>
9-
<startDelay> 15 </startDelay>
10-
</TimerParams>
11-
125
<AS id="65324">
136
<Router interAddr="10.10.1.2"/> <!--router A-->
147
</AS>

examples/bgpv4/BgpAndOspfSimple/omnetpp.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ output-scalar-precision = 2
2323

2424
# bgp settings
2525
**.bgpConfig = xmldoc("BGPConfig.xml")
26+
**.bgp.startDelay = 15s
2627
*.A.bgp.redistributeOspf = "E2"
2728
*.B.bgp.redistributeOspf = "E2"
2829

0 commit comments

Comments
 (0)