Delay-based Metric Extension for the Babel Routing ProtocolENS LyonFrancebaptiste.jonglez@ens-lyon.orgIRIF, University of Paris-DiderotCase 701475205 Paris Cedex 13Francejch@irif.frThis document defines an extension to the Babel routing protocol that
uses symmetric delay in metric computation and therefore makes it possible
to prefer lower latency links to higher latency ones.The Babel routing protocol does not mandate
a specific algorithm for computing metrics; existing implementations use
a packet-loss based metric on wireless links and a simple hop-count metric
on all other types of links. While this strategy works reasonably well in
many networks, it fails to select reasonable routes in some topologies
involving tunnels or VPNs.When routing traffic from A to D, it is obviously preferable to use the
local route through B, as this is likely to provide better service quality
and lower monetary cost than the distant route through C. However, the
existing implementations of Babel consider both routes as having the same
metric, and will therefore route the traffic through C in roughly half the
cases.In this document, we specify an extension to the Babel routing protocol
that enables precise measurement of the round-trip time (RTT) of a link,
and allows its usage in metric computation. Since this causes a negative
feedback loop, special care is needed to ensure that the resulting network
is reasonably stable ().We believe that this protocol may be useful in other situations than
the one described above, such as when running Babel in a congested
wireless mesh network or over a complex link layer that performs its own
routing; the high granularity of the timestamps used (1ms) should make it
easier to experiment with RTT-based metrics on this kind of link
layers.The protocol estimates the RTT to each neighbour
() which it then uses for metric
computation ().The RTT to a neighbour is estimated using an algorithm due to Mills
, originally developed for the HELLO routing
protocol and later used in NTP .A Babel speaker periodically sends a multicast Hello message over all
of its interfaces (Section 3.4.1 of ). This Hello
is usually accompanied with a set of IHU messages, one per neighbour
(Section 3.4.2 of ).In order to enable the computation of RTTs, a node A SHOULD include in
every Hello that it sends a timestamp t1 (according to A's clock). When
a node B receives A's Hello, it records in its neighbour table the
timestamp t1 as well as the time t1' according to its own (B's) clock at
which it received the packet.When B later sends an IHU to A, it SHOULD attach to the IHU the
timestamps t1 and t1' which it has stored in its neighbour table.
Additionally, it SHOULD ensure that the packet within which the IHU is
sent contains a Hello TLV with an associated timestamp t2' (according to
B's clock). Symmetrically, A will record in its neighbour table the
timestamp t2' as well as the time t2 (according to A's clock) at which it
has received the Hello. This is illustrated in the following sequence
diagram:A then estimates the RTT between A and B as
(t2 - t1) - (t2' - t1').This algorithm has a number of desirable properties. First, since
there is no requirement that t1' and t2' be equal, the protocol remains
asynchronous — the only change to Babel's message scheduling is the
requirement that a packet containing an IHU also contains a Hello.
Second, since only differences of timestamps according to a single clock
are computed, it does not require synchronised clocks. Third, it requires
very little additional state — a node only needs to store the two
timestamps associated with the last hello received from each neighbour.
Finally, since it only requires piggybacking one or two timestamps on each
Hello and IHU packet, it makes efficient use of network resources.In principle, this algorithm is inaccurate in the presence of clock
drift (i.e. when A's and B's clocks are running at different frequencies).
However, t2' - t1' is usually on the order of seconds, and
significant clock drift is unlikely to happen at that time scale.The algorithm described in the previous section allows computing an RTT
to every neighbour. How to map this value to a link cost is a local
implementation matter.Obviously, the mapping should be monotonic (larger RTTs imply larger
costs). In addition, in order to enhance stability (), the mapping should be bounded — above
a certain RTT, all links are equally bad.The current implementation of Babel uses the following function for
mapping RTTs to link costs, parameterised by three parameters rtt-min,
rtt-max and max-rtt-penalty:For RTTs below rtt-min, the link cost is just the nominal cost of
a single hop, C. Between rtt-min and rtt-max, the cost increases linearly;
abover rtt-max, the constant value max-rtt-penalty is added to the nominal
cost.Using delay as an input to the routing metric in congested networks
gives rise to a negative feedback loop: low RTT encourages traffic, which
in turn causes the RTT to increase. In a congested network, such
a feedback loop can cause persistent oscillations.The current implementation of Babel uses three techniques that
collaborate to limit the frequency of oscillations:
the measured RTT is smoothed, which limits Babel's response to
short-term RTT variations;the mapping function is bounded, which avoids switching between
congested routes;a hysteresis algorithm is applied to the metric before route selection,
which limits the worst-case frequency of route oscillations.These techniques are discussed in more detail in
.This protocol extension stores the data that it requires within
sub-TLVs of Babel's Hello and IHU TLVs. As discussed in Section 4 of
, implementations that do not understand this
extension will silently ignore the sub-TLVs while parsing the rest of the
TLVs that they contain. In effect, this extension supports building
hybrid networks consisting of extended and unextended routers, and while
such networks might suffer from sub-optimal routing, they will not suffer
from blackholes or routing loops.If a sub-TLV defined in this extension is longer than expected, the
additional data is silently ignored. This provision is made in order to
allow a future version of this document to extend the packet format with
additional data.This extension defines the Timestamp sub-TLV ,
whose Type field has value 3. This sub-TLV can be contained within
a Hello sub-TLV, in which case it carries a single timestamp, or
within an IHU sub-TLV, in which case it carries two timestamps.Timestamps are encoded as 32-bit unsigned integers, expressed in
units of one microsecond, counting from an arbitrary origin. Timestamps
wrap around every 4295 seconds, or slightly more than one hour.Fields :
Set to 3 to indicate a Timestamp sub-TLV.The length of the body, exclusive of the Type and
Length fields.The time at which the packet containing
this sub-TLV was sent, according to the sender's clock.If the Length field is larger than the expected 4 octets, the sub-TLV
MUST be processed normally and any extra data contained in this sub-TLV
MUST be silently ignored.Fields :
Set to 3 to indicate a Timestamp sub-TLV.The length of the body, exclusive of the Type and
Length fields.A copy of the transmit timestamp of the last
Timestamp sub-TLV contained in a Hello TLV received from node A.The time at which the last Hello with
a Timestamp sub-TLV was received from node A according to the sender's
clock.If the Length field is larger than the expected 8 octets, the sub-TLV
MUST be processed normally and any extra data contained in this sub-TLV
MUST be silently ignored.IANA is instructed to add the following entry to the "Babel Sub-TLV
Types" registry:TypeNameReference3Timestamp(this document)This extension merely adds additional timestamping data to two of the
TLVs sent by a Babel router, and does not significantly change the
security properties of the Babel protocol.The Babel Routing ProtocolExtension Mechanism for the Babel Routing ProtocolA delay-based routing metricAvailable online from http://arxiv.org/abs/1403.3488DCN Local-Network ProtocolsNetwork Time Protocol Version 4: Protocol and Algorithms Specification