RFC 7181
The Optimized Link State Routing Protocol Version 2
RFC 7181: The Optimized Link State Routing Protocol Version 2 โจ
okay bestie, let's start with the title block ๐ This one's an IETF Standards Track doc (no cap, it's the real deal ๐), published in April 2014 as RFC 7181. It's giving ISSN 2070-1721 ๐ and it doesn't list anything it obsoletes or updates, so it stands on its own ๐ฆ
The authors are a squad of four: T. Clausen (LIX, Ecole Polytechnique), C. Dearlove (BAE Systems ATC), P. Jacquet (Alcatel-Lucent Bell Labs), and U. Herberg (Fujitsu Laboratories of America) ๐ธ Iconic team, honestly ๐ญ
Abstract
So here's the tea โ This spec describes version 2 of the Optimized Link State Routing Protocol (OLSRv2) for Mobile Ad Hoc Networks (MANETs) ๐ง Basically it's the routing protocol for networks where devices are always wandering around and the links keep changing, so it has to figure out where things are going to go next. Main character energy ๐
Status of This Memo
Okay, the status bit is short and sweet ๐ This is an Internet Standards Track document, which means the IETF community has agreed on it, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication ๐ฅ
If you want more info on what "Internet Standards" even means, check out Section 2 of RFC 5741 ๐ You can also see the current status, any errata, and how to send feedback at http://www.rfc-editor.org/info/rfc7181 ๐
Copyright Notice
Okay, the legal bit, but make it cute ๐ The copyright belongs to the IETF Trust and the authors, copyright 2014, all rights reserved ๐
This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents, which you can find at http://trustee.ietf.org/license-info as they stood on the publication date โจ Please actually read those, bestie, because they explain what you're allowed to do with it ๐ซถ
Any Code Components pulled out of this doc have to include the Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions ๐ They come with no warranty, same as that license says ๐ธ
Some of the material here came from IETF Documents or IETF Contributions published before November 10, 2008 ๐ฆ The people who hold the copyright on some of that older stuff might not have given the IETF Trust permission to let it be modified outside the IETF Standards Process ๐ So unless you get a proper license from them, you can't modify this doc outside the IETF Standards Process, and you can't make derivative works outside it either ๐ The only exceptions are formatting it for publication as an RFC or translating it into languages other than English ๐
Table of Contents โจ
okay bestie, this is the map of the whole spec ๐บ๏ธ every section and appendix is listed here, so you can see exactly where each part lives ๐
Table of Contents
1. Introduction ....................................................5
2. Terminology .....................................................6
3. Applicability Statement .........................................9
4. Protocol Overview and Functioning ..............................10
4.1. Overview ..................................................10
4.2. Routers and Interfaces ....................................12
4.3. Information Base Overview .................................13
4.3.1. Local Information Base .............................13
4.3.2. Interface Information Base .........................14
4.3.3. Neighbor Information Base ..........................14
4.3.4. Topology Information Base ..........................14
4.3.5. Received Message Information Base ..................16
4.4. Signaling Overview ........................................16
4.5. Link Metrics ..............................................17
4.6. Flooding MPRs and Routing MPR .............................18
4.7. Routing Set Use ...........................................19
5. Protocol Parameters and Constants ..............................19
5.1. Protocol and Port Numbers .................................19
5.2. Multicast Address .........................................20
5.3. Interface Parameters ......................................20
5.3.1. Received Message Validity Time .....................20
5.4. Router Parameters .........................................20
5.4.1. Local History Times ................................20
5.4.2. Link Metric Parameters .............................21
5.4.3. Message Intervals ..................................21
5.4.4. Advertised Information Validity Times ..............22
5.4.5. Processing and Forwarding Validity Times ...........22
5.4.6. Jitter .............................................23
5.4.7. Hop Limit ..........................................23
5.4.8. Willingness ........................................24
5.5. Parameter Change Constraints ..............................25
5.6. Constants .................................................27
5.6.1. Link Metric Constants ..............................27
5.6.2. Willingness Constants ..............................28
5.6.3. Time Constant ......................................28
6. Link Metric Values .............................................28
6.1. Link Metric Representation ................................28
6.2. Link Metric Compressed Form ...............................29
7. Local Information Base .........................................29
7.1. Originator Set ............................................30
7.2. Local Attached Network Set ................................30
8. Interface Information Base .....................................31
8.1. Link Set ..................................................31
8.2. 2-Hop Set .................................................32
9. Neighbor Information Base ......................................32
10. Topology Information Base .....................................34
10.1. Advertising Remote Router Set ............................34
10.2. Router Topology Set ......................................35
10.3. Routable Address Topology Set ............................35
10.4. Attached Network Set .....................................36
10.5. Routing Set ..............................................37
11. Received Message Information Base .............................37
11.1. Received Set .............................................38
11.2. Processed Set ............................................38
11.3. Forwarded Set ............................................39
12. Information Base Properties ...................................39
12.1. Corresponding Protocol Tuples ............................39
12.2. Address Ownership ........................................40
13. Packets and Messages ..........................................41
13.1. Messages .................................................41
13.2. Packets ..................................................41
13.3. TLVs .....................................................42
13.3.1. Message TLVs ......................................42
13.3.2. Address Block TLVs ................................42
14. Message Processing and Forwarding .............................45
14.1. Actions When Receiving a Message .........................45
14.2. Message Considered for Processing ........................46
14.3. Message Considered for Forwarding ........................47
15. HELLO Messages ................................................49
15.1. HELLO Message Generation .................................49
15.2. HELLO Message Transmission ...............................51
15.3. HELLO Message Processing .................................51
15.3.1. HELLO Message Discarding ..........................51
15.3.2. HELLO Message Usage ...............................52
16. TC Messages ...................................................56
16.1. TC Message Generation ....................................56
16.2. TC Message Transmission ..................................58
16.3. TC Message Processing ....................................59
16.3.1. TC Message Discarding .............................59
16.3.2. TC Message Processing Definitions .................61
16.3.3. Initial TC Message Processing .....................61
16.3.4. Completing TC Message Processing ..................65
17. Information Base Changes ......................................66
17.1. Originator Address Changes ...............................66
17.2. Link State Changes .......................................66
17.3. Neighbor State Changes ...................................67
17.4. Advertised Neighbor Changes ..............................67
17.5. Advertising Remote Router Tuple Expires ..................68
17.6. Neighborhood Changes and MPR Updates .....................68
17.7. Routing Set Updates ......................................70
18. Selecting MPRs ................................................71
18.1. Overview .................................................72
18.2. Neighbor Graph ...........................................72
18.3. MPR Properties ...........................................73
18.4. Flooding MPRs ............................................74
18.5. Routing MPRs .............................................76
18.6. Calculating MPRs .........................................77
19. Routing Set Calculation .......................................78
19.1. Network Topology Graph ...................................78
19.2. Populating the Routing Set ...............................80
20. Proposed Values for Parameters ................................81
20.1. Local History Time Parameters ............................82
20.2. Message Interval Parameters ..............................82
20.3. Advertised Information Validity Time Parameters ..........82
20.4. Received Message Validity Time Parameters ................82
20.5. Jitter Time Parameters ...................................82
20.6. Hop Limit Parameter ......................................82
20.7. Willingness Parameters ...................................82
21. Sequence Numbers ..............................................83
22. Extensions ....................................................83
23. Security Considerations .......................................84
23.1. Security Architecture ....................................84
23.2. Integrity ................................................85
23.3. Confidentiality ..........................................86
23.4. Interaction with External Routing Domains ................87
23.5. Mandatory Security Mechanisms ............................87
23.6. Key Management ...........................................88
24. IANA Considerations ...........................................90
24.1. Expert Review: Evaluation Guidelines .....................91
24.2. Message Types ............................................91
24.3. Message-Type-Specific TLV Type Registries ................91
24.4. Message TLV Types ........................................92
24.5. Address Block TLV Types ..................................93
24.6. NBR_ADDR_TYPE and MPR Values .............................96
25. Contributors ..................................................96
26. Acknowledgments ...............................................97
27. References ....................................................97
27.1. Normative References .....................................97
27.2. Informative References ...................................98
Appendix A. Constraints .........................................100
Appendix B. Example Algorithm for Calculating MPRs ..............104
B.1. Additional Notation ......................................104
B.2. MPR Selection Algorithm ................................. 105
Appendix C. Example Algorithm for Calculating the Routing Set ...105
C.1. Local Interfaces and Neighbors ...........................106
C.2. Add Neighbor Routers .....................................107
C.3. Add Remote Routers .......................................107
C.4. Add Neighbor Addresses ...................................108
C.5. Add Remote Routable Addresses ............................109
C.6. Add Attached Networks ....................................110
C.7. Add 2-Hop Neighbors ......................................110
Appendix D. TC Message Example ..................................111
Appendix E. Flow and Congestion Control .........................114
ngl this is a LOT of sections ๐ญ but the numbering is the roadmap, so the names and numbers stay exactly as the spec has them ๐ซถ
1. Introduction โจ
okay so OLSRv2 (Optimized Link State Routing Protocol version 2) is the successor to OLSR version 1, which is published in [RFC3626]. ๐ Compared to [RFC3626], OLSRv2 keeps the same basic mechanisms and algorithms, but it can use a link metric other than hop count when picking shortest routes. It also has a more flexible and efficient signaling framework and simplifies some of the messages being exchanged. ๐
OLSRv2 is made for Mobile Ad Hoc Networks (MANETs) ๐ธ. It's a table-driven, proactive protocol, which just means it swaps topology info with the other routers in the network on a regular schedule. It's an optimization of the classic link state routing protocol, and its key concept is multipoint relays (MPRs) ๐. Each router picks two sets of MPRs. Each set is a group of its neighbor routers that "cover" all of its symmetrically connected 2-hop neighbor routers. These two sets are "flooding MPRs" and "routing MPRs", and they're used for flooding reduction and topology reduction, respectively. ๐ฆ
Flooding reduction works by flooding control traffic through the network with hop-by-hop forwarding. The catch is that a router only needs to forward control traffic that it first received directly from one of the routers that selected it as a flooding MPR (its "flooding MPR selectors") ๐ . This is called "MPR flooding", and it's an efficient way to spread information around the MANET because it cuts down on the number of transmissions required [MPR]. iconic, honestly. โจ
Topology reduction is achieved by giving a special job to routers that were selected as routing MPRs when they declare link state information. OLSRv2 is guaranteed to provide shortest routes to all destinations if routers declare link state information for their routing MPR selectors, if any. ๐ง Routers that aren't selected as routing MPRs need not send any link state information. Based on this reduced link state information, routing MPRs are used as intermediate routers in multi-hop routes. ๐
So MPRs cut down on the number and size of link state messages, and they also reduce how much link state information each router has to keep track of. ๐ซถ When it's possible (especially if you're using a hop count metric), the same routers can be picked as both flooding MPRs and routing MPRs. main character energy ๐
A router picks both routing and flooding MPRs from among its one-hop neighbors connected by "symmetric", i.e., bidirectional, links. That means selecting routes through routing MPRs avoids the problems that come with data packet transfer over unidirectional links ๐. For example, you don't get link-layer acknowledgments at each hop, for link layers that use this technique. ngl that's a big deal. ๐
OLSRv2 uses and extends the MANET Neighborhood Discovery Protocol (NHDP) defined in [RFC6130]. It also uses the Generalized MANET Packet/Message Format [RFC5444], the TLVs specified in [RFC5497] and, optionally, message jitter as specified in [RFC5148]. ๐ All four of these other protocols and specifications were originally created as part of OLSRv2, but they've been specified separately so more people can use them. โจ
OLSRv2 doesn't make any assumptions about the underlying link layer ๐ธ. Through its use of [RFC6130], OLSRv2 may use link-layer information and notifications when they're available and applicable. On top of that, OLSRv2 uses link metrics that may be derived from link layer information or any other information. OLSRv2 doesn't specify the physical meaning of link metrics, but it does specify a way that new types of link metrics can be defined in the future and then used by OLSRv2 without any modification. ๐ฅ
Like OLSR [RFC3626], OLSRv2 inherits its concept of forwarding and relaying from the High Performance Radio Local Area Network (HIPERLAN), a MAC-layer protocol standardized by ETSI [HIPERLAN] [HIPERLAN2] ๐ง. This document does not obsolete [RFC3626], which is left in place for further experimentation. ๐
2. Terminology
okay this section is the vocab list, so let's get the definitions straight ๐. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. ๐
All terms introduced in [RFC5444] are to be interpreted as described there. That includes "packet", "Packet Header", "message", "Message Header", "Message Body", "Message Type", "message sequence number", "hop limit", "hop count", "Address Block", "TLV Block", "TLV", "Message TLV", "Address Block TLV", "type" (of TLV), "type extension" (of TLV), "value" (of TLV), "address", "address prefix", and "address object". ๐ฆ
All terms introduced in [RFC6130] are to be interpreted as described there too. That includes "interface", "MANET interface", "network address", "link", "symmetric link", "symmetric 1-hop neighbor", "symmetric 2-hop neighbor", "symmetric 1-hop neighborhood" "constant", "interface parameter", "router parameter", "Information Base", and "HELLO message". ๐
Additionally, this specification uses the following terminology: โจ
Router: A MANET router that implements this protocol. ๐
OLSRv2 interface: A MANET interface running this protocol. A router running this protocol MUST have at least one OLSRv2 interface. ๐ซถ
Routable address: A network address that may be used as the destination of a data packet. A router that implements this protocol will need to tell a routable address apart from a non-routable address by directly inspecting the network address. This is based on global-scope address allocations by IANA and/or administrative configuration, and it has to be consistent across the MANET. Broadcast and multicast addresses, and addresses that are limited in scope to less than the entire MANET, MUST NOT be considered as routable addresses. Anycast addresses may be considered as routable addresses. ๐
Originator address: An address that is unique (within the MANET) to a router. A router MUST select an originator address. It MAY choose one of its interface addresses as its originator address, and it MAY select either a routable or non-routable address. A broadcast, multicast, or anycast address MUST NOT be chosen as an originator address. If the router selects a routable address, then it MUST be one that the router will accept as destination. An originator address MUST NOT have a prefix length, except when included in an Address Block, where it MAY be associated with a prefix of maximum prefix length. For example, if the originator address is an IPv6 address, it MUST have either no prefix length or a prefix length of 128. ๐
Message originator address: The originator address of the router that created a message, as deduced from that message by its recipient. For all messages used in this specification, including HELLO messages defined in [RFC6130], the recipient MUST be able to deduce an originator address. The message originator address will usually be included in the message as its <msg-orig-addr> element, as defined in [RFC5444]. However, there's an exceptional case, which doesn't add a <msg-orig-addr> element to a HELLO message. A router that only has a single address may use that case. ๐ง
Willingness: A numerical value between WILL_NEVER and WILL_ALWAYS (both inclusive) that represents the router's willingness to be selected as an MPR. A router has separate willingness values to be a flooding MPR and a routing MPR. ๐
Willing symmetric 1-hop neighbor: A symmetric 1-hop neighbor that has willingness not equal to WILL_NEVER. ๐ธ
Multipoint relay (MPR): A router, X, is an MPR for a router, Y, if router Y has indicated its selection of router X as an MPR in a recent HELLO message. Router X may be a flooding MPR for Y if it's indicated to participate in the flooding process of messages received from router Y. Or it may be a routing MPR for Y if it's indicated to declare link state information for the link from X to Y. It may also be both at the same time. ๐ฅ
MPR selector: A router, Y, is a flooding/routing MPR selector of router X if router Y has selected router X as a flooding/routing MPR. ๐ฆ
MPR flooding: The optimized MANET-wide information distribution mechanism employed by this protocol. A message is relayed by only a reduced subset of the routers in the network. MPR flooding is the mechanism by which flooding reduction is achieved. ๐
EXPIRED: Indicates that a timer is set to a value clearly preceding the current time (e.g., current time - 1). โญ
This specification employs the same notational conventions as [RFC5444] and [RFC6130]. ๐
3. Applicability Statement
This document specifies OLSRv2, a proactive routing protocol intended for use in Mobile Ad Hoc Networks (MANETs) [RFC2501]. The protocol's applicability is determined by its characteristics. This protocol: ๐
- Is designed to work in networks with a dynamic topology, and in networks where messages may be lost, such as due to collisions over wireless media. ๐
- Supports routers that each have one or more participating OLSRv2 interfaces. These consist of some or all of its MANET interfaces using [RFC6130]. The set of a router's OLSRv2 interfaces, and the sets of its other MANET and non-MANET interfaces, may change over time. Each interface may have one or more network addresses (which may have prefix lengths), and these may also be dynamically changing. ๐
- Enables hop-by-hop routing, i.e., each router can use its local information provided by this protocol to route packets. ๐ง
- Continuously maintains routes to all destinations in the network. Routes are instantly available, and data traffic is subject to no delays due to route discovery. Consequently, no data traffic buffering is required. โจ
- Supports routers that have non-OLSRv2 interfaces, which may be local to a router or may serve as gateways towards other networks. ๐ซถ
- Enables the use of bidirectional additive link metrics to use shortest distance routes (i.e., routes with the smallest total of link metrics). Incoming link metric values are to be determined by a process outside this specification. ๐
- Is optimized for large and dense networks. The larger and more dense a network, the more optimization can be achieved by using MPRs, compared to the classic link state algorithm [MPR]. ๐
- Uses [RFC5444] as described in its "Intended Usage" appendix and by [RFC5498]. ๐
- Allows "external" and "internal" extensibility (adding new Message Types and adding information to existing messages) as enabled by [RFC5444]. ๐ฆ
- Is designed to work in a completely distributed manner and does not depend on any central entity. ๐ธ
4. Protocol Overview and Functioning โจ
The objectives of this protocol are for each router to: ๐
- Identify all destinations in the network. ๐
- Identify a sufficient subset of links in the network, in order that shortest routes can be calculated to all available destinations. ๐ฆ
- Provide a Routing Set containing these shortest routes from this router to all destinations (routable addresses and local links). ๐
4.1. Overview โจ
okay so here's how each router pulls this off, bestie ๐
- Using NHDP [RFC6130] to find symmetric 1-hop neighbors and symmetric 2-hop neighbors. ๐
- Telling everyone it's in OLSRv2 ๐ and how willing it is to be a flooding MPR and a routing MPR, by extending the HELLO messages from [RFC6130] with an MPR_WILLING Message TLV. The "flooding willingness" is how eager it is to join MPR flooding, and the "routing willingness" is how eager it is to be an intermediate router for routing. Even if a router is unwilling to do either, it can still be a routing source or destination. Main character energy ๐ฆ
- Extending HELLO messages from [RFC6130] so links to other OLSRv2 routers can carry directional link metrics, and so routers can say which link metric type they're using. Incoming and outgoing link metrics can both be reported, and the incoming one is decided by the advertising router. ๐ธ
- Picking flooding MPRs and routing MPRs from its willing symmetric 1-hop neighbors. For each set of MPRs, every symmetric 2-hop neighbor has to be reachable, either directly or through at least one selected MPR, along a path with an appropriate minimum total metric for routing MPR selection (at least). MPR selection algorithms are analysed with examples in [MPR], and a suggested algorithm, adapted for each set of MPRs, lives in Appendix B of this spec. Routers don't need the same algorithm to interoperate in the same MANET, but every algorithm must have the properties in Section 18. ๐ง
- Signalling its flooding MPR and routing MPR selections by extending HELLO messages from [RFC6130], using MPR Address Block TLV(s) tied to the right network addresses. ๐ฃ
- Pulling out its flooding MPR selectors and routing MPR selectors from received HELLO messages, using those MPR Address Block TLV(s). ๐
- Defining a TC (Topology Control) Message Type in the format from [RFC5444]. TC messages periodically announce links between routing MPR selectors and the router itself across the whole MANET, including suitable directional neighbor metrics (the best link metric in that direction between those routers). ๐
- Letting TC messages and HELLO messages sit inside packets from [RFC5444], using the "manet" IP protocol or UDP port from [RFC5498]. ๐ซถ
- Spreading TC messages with a flooding reduction mechanism called "MPR flooding". Only a router's flooding MPRs retransmit messages received from (meaning originated by or last relayed by) that router. Less noise, more slay โจ
Heads up: the extensions to [RFC6130] are all in forms that spec already permits. ๐
This specification defines:
- The requirement to use [RFC6130], along with its parameters, constants, HELLO messages, and Information Bases, each as extended here. ๐
- Two new Information Bases: the Topology Information Base and the Received Message Information Base. ๐
- TC messages, used for MANET-wide signalling of selected topology (link state) information with MPR flooding. ๐
- A requirement that every router has an originator address that is included in, or can be deduced from, HELLO messages and TC messages. ๐
- New Message TLVs and Address Block TLVs used in HELLO messages and TC messages. They cover reporting neighbor status, MPR selection, external gateways, link metrics, willingness to be an MPR, and content sequence numbers. Heads up, though: generating incoming link metric values is handled by a process outside this spec. This spec only deals with distributing and using those metrics. ๐
- Generating TC messages from the right information in the Information Bases. ๐ง
- Updating the Topology Information Base based on received TC messages. ๐
- The MPR flooding mechanism, including the message originator address and sequence number that manage duplicate messages, using information recorded in the Received Message Information Base. ๐ฆ
- How the protocol responds to other events, like information in the Information Bases expiring. โญ
This protocol inherits the stability of a link state algorithm, and because it's proactive, routes are immediately available when needed. Iconic behaviour ๐
This protocol only interacts with IP through routing table management and by using the sending IP address of IP datagrams that carry messages used by this specification. ๐ธ
4.2. Routers and Interfaces โจ
Okay so for a router to join a MANET using this protocol, it must have at least one OLSRv2 interface, and it might have more. Each OLSRv2 interface:
- Is a MANET interface, as described in [RFC6130]. Specifically, it must be configured with one or more network addresses. Those addresses must each be specific to this router, and they must include any address that will be used as the sending address of any IP packet sent on this OLSRv2 interface. ๐
- Has a set of interface parameters, added to the ones from [RFC6130]. ๐
- Has an Interface Information Base, extending the one from [RFC6130]. ๐
- Generates and processes HELLO messages according to [RFC6130], extended as Section 15 specifies. ๐ซถ
On top of that set of OLSRv2 interfaces, each router:
- May have one or more non-OLSRv2 interfaces (these can include MANET interfaces and/or non-MANET interfaces) and/or local attached networks where it can accept IP packets. Every routable address the router is supposed to accept IP packets for must be used as an interface network address (OLSRv2 or non-OLSRv2) or as an address of a local attached network of the router. ๐ง
- Has a set of router parameters, added to the ones from [RFC6130]. ๐
- Has a Local Information Base, extending the one from [RFC6130]. This covers choosing an originator address and recording any locally attached networks. ๐
- Has a Neighbor Information Base, extending the one from [RFC6130] to record MPR selection and advertisement information. ๐
- Has a Topology Information Base, recording information received in TC messages. ๐
- Has a Received Message Information Base, recording information about received messages. This makes sure each TC message is only processed once, and forwarded at most once on each OLSRv2 interface, by a router. ๐
- Generates, receives, and processes TC messages. โญ
4.3. Information Base Overview โจ
Each router keeps the Information Bases described in the next sections. They're used to describe the protocol in this specification. An implementation can store this information in the indicated form, or in any other organisation that gives access to it. Heads up: it isn't necessary to remove Tuples from Sets at the exact time indicated. It only has to behave as though the Tuples were removed at that time. ๐ฆ
4.3.1. Local Information Base ๐
The Local Information Base is specified in [RFC6130] and holds a router's local configuration. This spec extends it to also record an originator address, and to include a router's:
- Originator Set, which holds addresses that were recently used as this router's originator address. Together with the router's current originator address, it lets a router recognise and discard control traffic that it originated itself. ๐ธ
- Local Attached Network Set, which holds network addresses of networks this router can act as a gateway to. It advertises these in its TC messages. ๐ง
4.3.2. Interface Information Base ๐
The Interface Information Base for each OLSRv2 interface is as specified in [RFC6130]. This spec extends it so each Link Set also records link metric values (incoming and outgoing) and flooding MPR selector information. ๐
4.3.3. Neighbor Information Base โญ
The Neighbor Information Base is specified in [RFC6130]. This spec extends it so each neighbor's Neighbor Tuple also records:
- Its originator address. ๐
- Neighbor metric values. These are the minimum of the link metric values in the indicated direction across all symmetric 1-hop links with that neighbor. ๐
- Its willingness to be a flooding MPR and to be a routing MPR. ๐
- Whether this router has selected it as a flooding MPR or as a routing MPR, and whether it is a routing MPR selector of this router. (Whether it is a flooding MPR selector of this neighbor is recorded in the Interface Information Base.) ๐ซถ
- Whether it is to be advertised in TC messages sent by this router. ๐ง
4.3.4. Topology Information Base ๐บ๏ธ
okay so the Topology Information Base is basically the router's tea board ๐ต and it holds:
- An Advertising Remote Router Set, which records each remote router that has sent TC messages. This is how a router figures out if a TC message is fresh or outdated, and an outdated one gets ignored ๐
- A Router Topology Set, which records links between routers in the MANET, as described by received TC messages ๐
- A Routable Address Topology Set, which records routable addresses in the MANET (the ones you can use as IP packet destinations) and which remote router each one can be directly reached through (that's a single IP hop from that router), as reported by received TC messages ๐
- An Attached Network Set, which records networks that a remote router has advertised it may act as a gateway for. These networks might be one or more IP hops away from that router ๐
- A Routing Set, which records routes from this router to all available destinations. The IP routing table gets updated using this Routing Set โจ (A router can choose to use any or all of the destination network addresses in the Routing Set to update the IP routing table. That selection is outside the scope of this specification, so it's up to the implementer ๐ซถ)
The whole point of the Topology Information Base is to store the info that, together with the Local Information Base, the Interface Information Bases, and the Neighbor Information Base, gets used to build the Routing Set (which also lives in the Topology Information Base ๐ ).
This specification works out the Routing Set from a Topology Graph that gets built in two phases. First, there's a "backbone" graph that shows the routers in the MANET and how they're connected to each other. It's built from the Local Information Base, the Neighbor Information Base, and the Router Topology Set. Second, that graph gets "decorated" with extra destination network addresses, using the Local Information Base, the Routable Address Topology Set, and the Attached Network Set ๐
The Topology Graph doesn't have to be stored in the Topology Information Base. You can either build it whenever the Routing Set needs to change, or skip building it explicitly altogether (there's an example of that in Appendix C ๐ง). An implementation is still allowed to build and keep the Topology Graph if it prefers that, though ๐
4.3.5. Received Message Information Base ๐ฌ
okay the Received Message Information Base in each router holds:
- A Received Set for each OLSRv2 interface, describing the TC messages this router received on that OLSRv2 interface
- A Processed Set, describing the TC messages this router processed
- A Forwarded Set, describing the TC messages this router forwarded
This is what keeps the MPR flooding mechanism on track ๐ฆ It makes sure received messages get forwarded at most once by a router, and that they get processed exactly once by a router. The Received Message Information Base can also record info about other Message Types that use the MPR flooding mechanism ๐ธ
4.4. Signaling Overview ๐ข
This protocol creates and processes HELLO messages according to [RFC6130]. HELLO messages sent on OLSRv2 interfaces get extended under Section 15 of this specification so they include an originator address, link metrics, and MPR selection information ๐
This specification defines just one Message Type, which is the TC message. TC messages get sent by their originating router proactively, at a regular interval, on all OLSRv2 interfaces โฐ That interval can be fixed or dynamic. For example, it might get backed off because of congestion or network stability ๐ฎโ๐จ TC messages can also be sent in response to a change in the router itself, or in its advertised symmetric 1-hop neighborhood, like when it first gets selected as a routing MPR ๐ฅ
Because TC messages are sent periodically, this protocol is tolerant of unreliable transmissions. Messages can get lost more often in wireless networks because of collisions or other transmission problems ๐ก This protocol may use "jitter", which means randomized adjustments to message transmission times, to cut down on collisions, as specified in [RFC5148] ๐ฒ
This protocol is also tolerant of out-of-sequence delivery of TC messages, which can happen when messages get reordered in transit ๐ Each router keeps an Advertised Neighbor Sequence Number (ANSN) that gets incremented whenever its recorded neighbor information that goes into its TC messages changes. The ANSN is included in the router's TC messages. The recipient of a TC message can use that ANSN to figure out which information it has is the most recent, even if messages got reordered on the way. Only the most recent information is used, and older information that shows up later gets thrown out ๐๏ธ
TC messages can be "complete" or "incomplete". A complete TC message advertises all of the originating router's routing MPR selectors, and it may also advertise other symmetric 1-hop neighbors ๐ Complete TC messages are generated periodically (and also, optionally, in response to changes in the symmetric 1-hop neighborhood). Incomplete TC messages can be used to report additions to the advertised info without repeating stuff that hasn't changed ๐
TC messages, and HELLO messages as extended by this specification, define an originator address for the router that created the message. They do this either by including it or by deducing it when there's only a single address ๐ชช A TC message reports both the originator addresses and the routable addresses of its advertised neighbors, and it tells the two apart with an Address Block TLV. (An address can be both routable and an originator address, btw ๐ซง) TC messages also report the originator's locally attached networks ๐
TC messages get MPR flooded throughout the MANET. A router retransmits a TC message it received on an OLSRv2 interface if and only if all of these are true: the message didn't originate at this router, the router hasn't forwarded it before, this is the first time the message has been received on this OLSRv2 interface, and the message was received from (meaning it originated from or was last relayed by) one of this router's flooding MPR selectors ๐
Some TC messages may only get MPR flooded over part of the network. That lets a router keep nearer routers more up to date than distant ones, which is what Fisheye State Routing [FSR] and Fuzzy Sighted Link State routing [FSLS] do. This is enabled using [RFC5497] ๐
TC messages include outgoing neighbor metrics that get used when routes are selected ๐
4.5. Link Metrics ๐
OLSRv1 [RFC3626] created minimum hop routes to destinations. But in lots of situations (honestly, most of them ๐ค), you can make better routes, in terms of quality of service for end users, by using link metrics โจ
OLSRv2, the way this specification defines it, supports metric-based routing. That means each link can have a chosen metric ๐ Link metrics in OLSRv2 are additive, and the routes that get created are the ones with the minimum sum of link metrics along that route ๐
Link metrics are directional, so the link metric from one router to another can be different from the one on the reverse link โ๏ธ The link metric gets assessed at the receiver, like on a (typically) wireless link, because the receiver is the one that knows the most about that link ๐ง OLSRv2 uses both incoming and outgoing link info, so you have to keep the distinctions in this specification crystal clear ๐
This specification also defines both incoming and outgoing neighbor metrics for each symmetric 1-hop neighbor. Each one is the minimum value of the link metrics in the same direction across all symmetric links with that neighbor. So every neighbor metric value is also a link metric value, and when you specify something like link metric value encoding, that encoding also covers neighbor metric values ๐ซถ
This specification doesn't define what the link metric actually is. What it does allow is, through the type extension of a defined Address Block TLV, link metrics with specific meanings. Those can be allocated by IANA or used privately ๐ Each HELLO or TC message that carries link (or neighbor) metrics says which link metric info it's carrying, so routers can tell if they can interoperate ๐ค If link metrics need extra signaling to get their values, whether in HELLO messages or somewhere else, that's allowed, but it's outside the scope of this specification ๐ โโ๏ธ
Be careful about how you use link metrics. In particular, it's a good idea to not just default to using all links with equal metrics (aka hop count) for routing without thinking about whether that's actually appropriate ๐ค
4.6. Flooding MPRs and Routing MPR ๐
This specification uses two sets of MPRs: flooding MPRs and routing MPRs. They get selected separately, because:
- Flooding MPRs may use metrics, but routing MPRs must use metrics ๐
- When flooding MPRs use metrics, those are outgoing link metrics. Routing MPRs use incoming neighbor metrics ๐ฅ
- Flooding MPRs must be selected per OLSRv2 interface, but routing MPRs don't need to be selected per OLSRv2 interface ๐งฉ
4.7. Routing Set Use ๐ฃ๏ธ
The Routing Set exists to determine and record routes (local interface network address and next-hop interface network address) to every possible routable address advertised by this protocol. It also covers all destinations that are local to the router, meaning within one hop, whether they use routable addresses or not ๐ก Only symmetric links get used in these routes ๐
The Routing Set is meant to be used for IP packet routing, by using its contents to update the IP routing table. That update, and whether any Routing Tuples are left out when the IP routing table gets updated, is outside the scope of this specification ๐คทโโ๏ธ
This signaling was designed so that a "backbone" Topology Graph of routers can be built. Each router is identified by its originator address, and there's at most one direct connection between any pair of routers. It's built from the Neighbor Set and the Router Topology Set using a suitable minimum path length algorithm ๐งฎ Other network addresses (routable ones or ones of symmetric 1-hop neighbors) can then be added to that graph, using the Interface Information Bases, the Routable Address Topology Set, and the Attached Network Set ๐
5. Protocol Parameters and Constants โจ
The parameters and constants in this specification are the ones defined in [RFC6130], plus the ones in this section. The split in [RFC6130] into interface parameters, router parameters, and constants is also used here ๐
Just like the parameters in [RFC6130], parameters defined in this specification MAY be changed dynamically by a router. They don't need to be the same on different routers, even in the same MANET, or (for interface parameters) on different interfaces of the same router ๐ฆ
5.1. Protocol and Port Numbers ๐
okay so this protocol sends TC messages, and they get tucked inside packets the way [RFC5444] defines ๐ These packets MUST be sent using either the "manet" protocol number or the "manet" UDP well-known port number, as specified in [RFC5498].
TC messages and HELLO messages [RFC6130] MUST, in a given MANET, either both use IP or both use UDP. The reason is so that messages from both protocols can be combined into the same [RFC5444] packet for transmission ๐งฆโจ
5.2. Multicast Address ๐ฆ
TC messages get included in packets as defined by [RFC5444] ๐ฆ These packets MAY be transmitted using the Link-Local multicast address "LL-MANET-Routers", as specified in [RFC5498].
5.3. Interface Parameters ๐ธ
only one extra interface parameter is specified, and it's only for OLSRv2 interfaces ๐
5.3.1. Received Message Validity Time ๐
this parameter handles how long we keep track of messages we've already received ๐ฐ๏ธ
RX_HOLD_TIME: The period after receipt of a message by the appropriate OLSRv2 interface of this router for which that information is recorded, in order that the message is recognized as having been previously received on this OLSRv2 interface.
the constraints for this one are:
RX_HOLD_TIME > 0RX_HOLD_TIMESHOULD be greater than the maximum difference in time that a message may take to traverse the MANET, taking into account any message forwarding jitter as well as propagation, queuing, and processing delays. ๐ซถ
5.4. Router Parameters ๐
these are the router parameters, and they're specified for routers ๐
5.4.1. Local History Times โณ
this router parameter controls how long local information sticks around ๐งธ
O_HOLD_TIME: The time for which a recently used and replaced originator address is used to recognize the router's own messages.
the constraint here is:
O_HOLD_TIME > 0
5.4.2. Link Metric Parameters ๐
all routes found using this spec use a single link metric type, which is set by the router parameter LINK_METRIC_TYPE. It can be any value from 0 to 255, both inclusive ๐ข
5.4.3. Message Intervals โฐ
okay this one is so good ๐ญ These parameters control when a router sends TC messages. TC messages are usually sent periodically, but they MAY also be sent in response to changes in the router's Neighbor Set and/or Local Attached Network Set. In a highly dynamic network, with a larger value of the parameter TC_INTERVAL and a smaller value of the parameter TC_MIN_INTERVAL, TC messages MAY be transmitted more often in response to changes than periodically. BUT a router has no knowledge of, for example, routers remote to it (i.e., beyond two hops away) joining the network, so TC messages MUST NOT be sent purely responsively. ๐
โโ๏ธ
TC_INTERVAL: The maximum time between the transmission of two successive TC messages by this router. When no TC messages are sent in response to local network changes (by design or because the local network is not changing), then TC messages MUST be sent at a regular interval TC_INTERVAL, possibly modified by jitter, as specified in [RFC5148].
TC_MIN_INTERVAL: The minimum interval between transmission of two successive TC messages by this router. (This minimum interval MAY be modified by jitter, as specified in [RFC5148].)
the constraints for these are:
TC_INTERVAL > 00 <= TC_MIN_INTERVAL <= TC_INTERVAL- If TLVs with Type =
INTERVAL_TIME, as defined in [RFC5497], are included in TC messages, thenTC_INTERVALMUST be representable by way of the exponent-mantissa notation described in Section 5 of [RFC5497]. ๐งฎ
5.4.4. Advertised Information Validity Times ๐ฃ
these parameters manage how long the info we advertise in TC messages stays valid ๐๏ธ
T_HOLD_TIME: Used as the minimum value in the TLV with Type = VALIDITY_TIME included in all TC messages sent by this router. If a single value of parameter TC_HOP_LIMIT (see Section 5.4.7) is used, then this will be the only value in that TLV.
A_HOLD_TIME: The period during which TC messages are sent after they no longer have any advertised information to report but are sent in order to accelerate outdated information removal by other routers. ๐งน
the constraints here are:
T_HOLD_TIME > 0A_HOLD_TIME >= 0T_HOLD_TIME >= TC_INTERVAL- If TC messages can be lost, then both
T_HOLD_TIMEandA_HOLD_TIMESHOULD be significantly greater thanTC_INTERVAL; a value>= 3 x TC_INTERVALis RECOMMENDED. ๐ T_HOLD_TIMEMUST be representable by way of the exponent-mantissa notation described in Section 5 of [RFC5497].
5.4.5. Processing and Forwarding Validity Times ๐
these parameters manage the validity time of recorded message info for processing and forwarding ๐ง
P_HOLD_TIME: The period after receipt of a message that is processed by this router for which that information is recorded, in order that the message is not processed again if received again.
F_HOLD_TIME: The period after receipt of a message that is forwarded by this router for which that information is recorded, in order that the message is not forwarded again if received again.
the constraints are:
P_HOLD_TIME > 0F_HOLD_TIME > 0- Both of these parameters SHOULD be greater than the maximum difference in time that a message may take to traverse the MANET, taking into account any message forwarding jitter as well as propagation, queuing, and processing delays. ๐
5.4.6. Jitter ๐ฒ
if jitter, as defined in [RFC5148], is used, then these are the governing jitter parameters:
TP_MAXJITTER: Represents the value of MAXJITTER used in [RFC5148] for periodically generated TC messages sent by this router.
TT_MAXJITTER: Represents the value of MAXJITTER used in [RFC5148] for externally triggered TC messages sent by this router.
F_MAXJITTER: Represents the default value of MAXJITTER used in [RFC5148] for messages forwarded by this router. However, before using F_MAXJITTER, a router MAY attempt to deduce a more appropriate value of MAXJITTER, for example, based on any TLVs with Type = INTERVAL_TIME or Type = VALIDITY_TIME contained in the message to be forwarded. โจ
For constraints on these parameters, see [RFC5148].
5.4.7. Hop Limit ๐ฏ
the parameter TC_HOP_LIMIT is the hop limit set in each TC message. TC_HOP_LIMIT MAY be a single fixed value or MAY be different in TC messages sent by the same router. but here's the catch ๐ each other router, at any hop count distance, MUST see a regular pattern of TC messages, so that meaningful values of TLVs with Type = INTERVAL_TIME and Type = VALIDITY_TIME at each hop count distance can be included as defined in [RFC5497]. So the pattern of TC_HOP_LIMIT MUST be defined to have this property.
for example, the repeating pattern (255 4 4) satisfies this property (having period TC_INTERVAL at hop counts up to 4, inclusive, and 3 x TC_INTERVAL at hop counts greater than 4). But the repeating pattern (255 255 4 4) does NOT satisfy this property, because at hop counts greater than 4, message intervals are alternately TC_INTERVAL and 3 x TC_INTERVAL ๐
the constraints for this parameter:
- The maximum value of
TC_HOP_LIMIT >= the network diameter in hops; a value of 255 is RECOMMENDED. Note that if using a pattern of different values ofTC_HOP_LIMITas described above, then only the maximum value in the pattern is so constrained. - All values of
TC_HOP_LIMIT >= 2.
5.4.8. Willingness ๐โโ๏ธ
each router has two willingness parameters: WILL_FLOODING and WILL_ROUTING, and each of them MUST be in the range WILL_NEVER to WILL_ALWAYS, inclusive ๐
WILL_FLOODING is the router's willingness to be selected as a flooding MPR, and so to take part in MPR flooding, especially of TC messages.
WILL_ROUTING is the router's willingness to be selected as a routing MPR, and so to be an intermediate router on routes.
either way, the higher the value, the more willing the router is to be a flooding or routing MPR, as appropriate. If a router has a willingness value of WILL_NEVER (the lowest possible value), it does not perform the corresponding task. Heads up โ ๏ธ a MANET using this protocol with too many routers having either WILL_FLOODING or WILL_ROUTING equal to WILL_NEVER will not function, so it MUST be ensured, by administrative or other means, that this does not happen.
Note that the proportion at which routers with a willingness value equal to WILL_NEVER count as "too many" depends on the network topology, which in a MANET may change dynamically ๐ Willingness is meant to let certain routers (e.g., routers with generous resources, like a permanent power supply) take on more of the network operation, while others (e.g., routers with fewer resources, like battery-operated ones) can avoid such tasks ๐ A general guideline: only if a router is not actually able to assume the task (flooding or routing) should it be configured with the corresponding willingness WILL_NEVER.
If a router has a willingness value equal to WILL_ALWAYS (the highest possible value), then it will always be selected as a flooding or routing MPR, as appropriate, by all symmetric 1-hop neighbors. ๐
In a MANET where all routers have WILL_FLOODING = WILL_ALWAYS, flooding reduction will effectively be disabled, and flooding will perform as blind flooding ๐
In a MANET where all routers have WILL_ROUTING = WILL_ALWAYS, topology reduction will effectively be disabled, and all routers will advertise all of their links in TC messages ๐ฃ
A router that has WILL_ROUTING = WILL_NEVER will not act as an intermediate router in the MANET. Such a router can act as a source, destination, or gateway to another routing domain. ๐ง
Different routers MAY have different values for WILL_FLOODING and/or WILL_ROUTING. ๐ซง
the constraints for these parameters:
WILL_NEVER <= WILL_FLOODING <= WILL_ALWAYSWILL_NEVER <= WILL_ROUTING <= WILL_ALWAYS
5.5. Parameter Change Constraints
okay bestie, this is the part where we talk about what happens when you turn the knobs mid-run ๐๏ธโจ if protocol parameters get changed dynamically, these constraints kick in, so pay attention ๐
RX_HOLD_TIME
- If
RX_HOLD_TIMEfor an OLSRv2 interface changes, the expiry time for all Received Tuples for that OLSRv2 interface MAY be changed.
O_HOLD_TIME
- If
O_HOLD_TIMEchanges, the expiry time for all Originator Tuples MAY be changed.
TC_INTERVAL
- If
TC_INTERVALincreases, the next TC message generated by this router MUST be generated according to the previous, shorterTC_INTERVAL. Additional subsequent TC messages MAY be generated according to the previous, shorter,TC_INTERVAL. - If
TC_INTERVALdecreases, the following TC messages from this router MUST be generated according to the current, shorter,TC_INTERVAL.
P_HOLD_TIME
- If
P_HOLD_TIMEchanges, the expiry time for all Processed Tuples MAY be changed.
F_HOLD_TIME
- If
F_HOLD_TIMEchanges, the expiry time for all Forwarded Tuples MAY be changed.
TP_MAXJITTER
- If
TP_MAXJITTERchanges, the periodic TC message schedule on this router MAY be changed immediately.
TT_MAXJITTER
- If
TT_MAXJITTERchanges, externally triggered TC messages on this router MAY be rescheduled.
F_MAXJITTER
- If
F_MAXJITTERchanges, TC messages waiting to be forwarded with a delay based on this parameter MAY be rescheduled.
TC_HOP_LIMIT
- If
TC_HOP_LIMITchanges, and the router uses multiple values after the change, then message intervals and validity times included in TC messages MUST be respected. The simplest way to do this is to start any new repeating pattern ofTC_HOP_LIMITvalues with its largest value.
LINK_METRIC_TYPE
- If
LINK_METRIC_TYPEchanges, then all link metric information recorded by the router is invalid. The router MUST take the following actions and all consequent actions described in Section 17 and [RFC6130].- For each Link Tuple in any Link Set for an OLSRv2 interface, either update
L_in_metric(the valueMAXIMUM_METRICMAY be used) or remove the Link Tuple from the Link Set. - For each Link Tuple that is not removed, set:
L_out_metric := UNKNOWN_METRIC;L_SYM_time := EXPIRED;L_MPR_selector := false.
- Remove all Router Topology Tuples, Routable Address Topology Tuples, Attached Network Tuples, and Routing Tuples from their respective Protocol Sets in the Topology Information Base.
- For each Link Tuple in any Link Set for an OLSRv2 interface, either update
5.6. Constants
The following constants are specified for routers. Unlike router parameters, constants MUST NOT change and MUST be the same on all routers. ๐โจ
5.6.1. Link Metric Constants
The constant minimum and maximum link metric values are defined by:
MINIMUM_METRIC := 1MAXIMUM_METRIC := 16776960
The symbolic value UNKNOWN_METRIC is defined in Section 6.1.
5.6.2. Willingness Constants
The constant minimum, RECOMMENDED default, and maximum willingness values are defined by:
WILL_NEVER := 0WILL_DEFAULT := 7WILL_ALWAYS := 15
5.6.3. Time Constant
The constant C (time granularity) is used as specified in [RFC5497]. It MUST be the same as is used by [RFC6130], with RECOMMENDED value:
C := 1/1024 second
Note that this constant is used in the representation of time intervals. Time values (such as are stored in Protocol Tuples) are not so represented. A resolution of C in such values is sufficient (but not necessary) for such values. โฑ๏ธ
6. Link Metric Values
A router records a link metric value for each direction of a link of which it has knowledge. These link metric values are used to create metrics for routes by the addition of link metric values. ๐ฆ
6.1. Link Metric Representation
Link metrics are reported in messages using a compressed representation that occupies 12 bits, consisting of a 4-bit field and an 8-bit field. The compressed representation represents positive integer values with a minimum value of 1 and a maximum value that is slightly smaller than the maximum 24-bit value. Only those values that have exact representation in the compressed form are used. Route metrics are the summation of no more than 256 link metric values and can therefore be represented using no more than 32 bits.
Link and route metrics used in the Information Bases defined in this specification refer to the uncompressed values, and arithmetic involving them does likewise and assumes full precision in the result. (How an implementation records the values is not part of this specification, as long as it behaves as if recording uncompressed values. An implementation can, for example, use 32-bit values for all link and route metrics.)
In some cases, a link metric value may be unknown. This is indicated in this specification by the symbolic value UNKNOWN_METRIC. An implementation may use any representation of UNKNOWN_METRIC as it is never included in messages or used in any computation. (Possible representations are zero or any value greater than the maximum representable metric value.) ๐คทโโ๏ธ
6.2. Link Metric Compressed Form
The 12-bit compressed form of a link metric uses a modified form of a representation with an 8-bit mantissa (denoted a) and a 4-bit exponent (denoted b). Note that if represented as the 12-bit value 256b+a, then the ordering of those 12-bit values is identical to the ordering of the represented values. ๐
The value so represented is (257+a)2^b - 256, where ^ denotes exponentiation. This has a minimum value (when a = 0 and b = 0) of MINIMUM_METRIC = 1 and a maximum value (when a = 255 and b = 15) of MAXIMUM_METRIC = 2^24 - 256.
An algorithm for computing a and b for the smallest representable value not less than a link metric value v such that MINIMUM_METRIC <= v <= MAXIMUM_METRIC is:
- Find the smallest integer
bsuch thatv + 256 <= 2^(b + 9). - Set
a := (v - 256(2^b - 1)) / (2^b) - 1, rounded up to the nearest integer.
7. Local Information Base
The Local Information Base, as defined for each router in [RFC6130], is extended by this protocol by:
- Recording the router's originator address. The originator address MUST be unique to this router. It MUST NOT be used by any other router as an originator address. It MAY be included in any network address in any
I_local_iface_addr_listof this router; it MUST NOT be included in any network address in anyI_local_iface_addr_listof any other router. It MAY be included in, but MUST NOT be equal to, theAL_net_addrin any Local Attached Network Tuple in this or any other router. - The addition of an Originator Set, defined in Section 7.1, and a Local Attached Network Set, defined in Section 7.2.
All routable addresses of the router for which it is to accept IP packets as destination MUST be included in the Local Interface Set or the Local Attached Network Set. ๐ฆ
7.1. Originator Set
A router's Originator Set records addresses that were recently used as originator addresses by this router. If a router's originator address is immutable, then the Originator Set is always empty and MAY be omitted. It consists of Originator Tuples:
(O_orig_addr, O_time)
where:
O_orig_addr is a recently used originator address; note that this does not include a prefix length.
O_time specifies the time at which this Tuple expires and MUST be removed. โ
7.2. Local Attached Network Set
A router's Local Attached Network Set records its local non-OLSRv2 interfaces via which it can act as a gateway to other networks. The Local Attached Network Set MUST be provided to this protocol and MUST reflect any changes in the router's status. (In cases where the router's configuration is static, the Local Attached Network Set will be constant; in cases where the router has no such non-OLSRv2 interfaces, the Local Attached Network Set will be empty.) The Local Attached Network Set is not modified by this protocol. This protocol will respond to (externally provided) changes to the Local Attached Network Set. It consists of Local Attached Network Tuples:
(AL_net_addr, AL_dist, AL_metric)
where:
AL_net_addr is the network address of an attached network that can be reached via this router. This SHOULD be a routable address. It is constrained as described below.
AL_dist is the number of hops to the network with network address AL_net_addr from this router.
AL_metric is the metric of the link to the attached network with address AL_net_addr from this router.
Attached networks local to this router only (i.e., not reachable except via this router) SHOULD be treated as local non-MANET interfaces and added to the Local Interface Set, as specified in [RFC6130], rather than added to the Local Attached Network Set.
Because an attached network is not specific to the router and may be outside the MANET, an attached network MAY also be attached to other routers. Routing to an AL_net_addr will use maximum prefix length matching; consequently, an AL_net_addr MAY include, but MUST NOT equal or be included in, any network address that is of any interface of any router (i.e., is included in any I_local_iface_addr_list) or equal any router's originator address.
It is not the responsibility of this protocol to maintain routes from this router to networks recorded in the Local Attached Network Set.
Local Attached Network Tuples are removed from the Local Attached Network Set only when the router's local attached network configuration changes, i.e., they are not subject to timer-based expiration or changes due to received messages. ๐
8. Interface Information Base
An Interface Information Base, as defined in [RFC6130], is maintained for each MANET interface. The Link Set and 2-Hop Set in the Interface Information Base for an OLSRv2 interface are modified by this protocol. In some cases, it may be convenient to consider these Sets as also containing these additional elements for other MANET interfaces, taking the indicated values on creation but never being updated. ๐ง
8.1. Link Set
The Link Set is modified by adding these additional elements to each Link Tuple:
L_in_metricis the metric of the link from the OLSRv2 interface with addressesL_neighbor_iface_addr_listto this OLSRv2 interface;L_out_metricis the metric of the link to the OLSRv2 interface with addressesL_neighbor_iface_addr_listfrom this OLSRv2 interface;L_mpr_selectoris a boolean flag, describing if this neighbor has selected this router as a flooding MPR, i.e., is a flooding MPR selector of this router.
L_in_metric will be specified by a process that is external to this specification. Any Link Tuple with L_status = HEARD or L_status = SYMMETRIC MUST have a specified value of L_in_metric if it is to be used by this protocol.
A Link Tuple created (but not updated) by [RFC6130] MUST set:
L_in_metric := UNKNOWN_METRIC;L_out_metric := UNKNOWN_METRIC;L_mpr_selector := false.
8.2. 2-Hop Set ๐ฆ
okay so the 2-Hop Set gets upgraded bestie ๐ every 2-Hop Tuple picks up two new fields:
N2_in_metricis the neighbor metric from the router with addressN2_2hop_iface_addrto the router with OLSRv2 interface addressesN2_neighbor_iface_addr_list๐ธN2_out_metricis the neighbor metric to the router with addressN2_2hop_iface_addrfrom the router with OLSRv2 interface addressesN2_neighbor_iface_addr_listโจ
a 2-Hop Tuple that gets created (but not updated) by [RFC6130] MUST set these:
N2_in_metric := UNKNOWN_METRIC;N2_out_metric := UNKNOWN_METRIC.
9. Neighbor Information Base ๐
every router keeps a Neighbor Information Base, as defined in [RFC6130] ๐ง this protocol adds more stuff to each Neighbor Tuple in the Neighbor Set. sometimes it's easier to think of these Sets as also holding these extra bits for other MANET interfaces, which get the listed values when they're created and never get updated after that ๐ซถ
N_orig_addris the neighbor's originator address, which might be unknown. heads up that this originator address does not include a prefix length ๐N_in_metricis the neighbor metric of any link from this neighbor to an OLSRv2 interface of this router. that's the minimum of all the matchingL_in_metricvalues whereL_status = SYMMETRICandL_in_metric != UNKNOWN_METRIC, and it'sUNKNOWN_METRICif there are no such Link Tuples ๐ญN_out_metricis the neighbor metric of any link from an OLSRv2 interface of this router to this neighbor. same energy: the minimum of all the matchingL_out_metricvalues whereL_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC, andUNKNOWN_METRICif there are no such Link Tuples ๐N_will_floodingis the neighbor's willingness to be picked as a flooding MPR, anywhere fromWILL_NEVERtoWILL_ALWAYS(both included). it'sWILL_NEVERif no OLSRv2-specific info has come in from this neighbor ๐N_will_routingis the neighbor's willingness to be picked as a routing MPR, anywhere fromWILL_NEVERtoWILL_ALWAYS(both included). alsoWILL_NEVERif no OLSRv2-specific info has come in from this neighbor ๐N_flooding_mpris a boolean flag saying whether this router has picked this neighbor as a flooding MPR ๐N_routing_mpris a boolean flag saying whether this router has picked this neighbor as a routing MPR ๐N_mpr_selectoris a boolean flag saying whether this neighbor has picked this router as a routing MPR. in other words, it's a routing MPR selector of this router ๐ฆN_advertisedis a boolean flag saying whether this router has decided to advertise a link to this neighbor in its TC messages โญ
a Neighbor Tuple that gets created (but not updated) by [RFC6130] MUST set:
N_orig_addr := unknown;N_in_metric := UNKNOWN_METRIC;N_out_metric := UNKNOWN_METRIC;N_will_flooding := WILL_NEVER;N_will_routing := WILL_NEVER;N_routing_mpr := false;N_flooding_mpr := false;N_mpr_selector := false;N_advertised := false.
the Neighbor Information Base also has a variable called the Advertised Neighbor Sequence Number (ANSN) โจ its value goes into TC messages so everyone can tell how fresh the info is ๐ฐ๏ธ the ANSN goes up whenever the advertised info changes (that's the originator and routable addresses in Neighbor Tuples with N_advertised = true, plus the local attached networks recorded in the Local Attached Network Set in the Local Information Base). adding or removing any of that counts as a change too ๐ฅ
10. Topology Information Base ๐ธ
the Topology Information Base is defined for each router by this spec, and it stores info received in TC messages in the Advertising Remote Router Set, the Router Topology Set, the Routable Address Topology Set, and the Attached Network Set ๐
there's also a Routing Set, which gets derived from the Local Information Base, the Interface Information Bases, the Neighbor Information Base, and the rest of the Topology Information Base. it's giving layers ๐ง
10.1. Advertising Remote Router Set ๐
a router's Advertising Remote Router Set keeps track of every remote router in the network that sends TC messages. that way outdated TC messages can be spotted and tossed out ๐๏ธ it's made of Advertising Remote Router Tuples:
(AR_orig_addr, AR_seq_number, AR_time)
where:
AR_orig_addris the originator address of a received TC message. note that this doesn't include a prefix length ๐ซถAR_seq_numberis the greatest ANSN in any TC message received from the router with originator addressAR_orig_addr(aka the ANSN that contributed to the info in this Tuple) ๐งAR_timeis the time this Tuple expires, and it MUST be removed at that point โฐ
10.2. Router Topology Set ๐ฐ๏ธ
a router's Topology Set holds topology info about the links between routers in the MANET. it's made of Router Topology Tuples:
(TR_from_orig_addr, TR_to_orig_addr, TR_seq_number, TR_metric,
TR_time)
where:
TR_from_orig_addris the originator address of a router that can reach the router with originator addressTR_to_orig_addrin one hop. (no prefix length here either ๐)TR_to_orig_addris the originator address of a router that can be reached by the router with originator addressTR_from_orig_addrin one hop. (still no prefix length ๐ )TR_seq_numberis the greatest ANSN in any TC message received from the router with originator addressTR_from_orig_addr(the ANSN that helped build this Tuple) ๐TR_metricis the neighbor metric from the router with originator addressTR_from_orig_addrto the router with originator addressTR_to_orig_addr๐ถTR_timesays when this Tuple expires, and it MUST be removed then โณ
10.3. Routable Address Topology Set ๐บ๏ธ
a router's Routable Address Topology Set holds topology info about the routable addresses inside the MANET, including which routers you can reach them through ๐ง it's made of Routable Address Topology Tuples:
(TA_from_orig_addr, TA_dest_addr, TA_seq_number, TA_metric,
TA_time)
where:
TA_from_orig_addris the originator address of a router that can reach the router with routable addressTA_dest_addrin one hop (no prefix length, babe ๐)TA_dest_addris a routable address of a router that can be reached by the router with originator addressTA_from_orig_addrin one hop ๐ฏTA_seq_numberis the greatest ANSN in any TC message received from the router with originator addressTA_from_orig_addr(the one that contributed to this Tuple) ๐TA_metricis the neighbor metric from the router with originator addressTA_from_orig_addrto the router with OLSRv2 interface addressTA_dest_addr๐TA_timesays when this Tuple expires, and it MUST be removed then ๐ฅ
10.4. Attached Network Set ๐
a router's Attached Network Set holds info about networks (which can be outside the MANET) attached to other routers, plus their routable addresses. it's made of Attached Network Tuples:
(AN_orig_addr, AN_net_addr, AN_seq_number, AN_dist, AN_metric,
AN_time)
where:
AN_orig_addris the originator address of a router that can act as a gateway to the network with network addressAN_net_addr(no prefix length, as always ๐)AN_net_addris the network address of an attached network that can be reached via the router with originator addressAN_orig_addr๐AN_seq_numberis the greatest ANSN in any TC message received from the router with originator addressAN_orig_addr(the one that contributed to this Tuple) ๐งพAN_distis the number of hops to the network with network addressAN_net_addrfrom the router with originator addressAN_orig_addr๐ฆถAN_metricis the metric of the link from the router with originator addressAN_orig_addrto the attached network with addressAN_net_addr๐AN_timesays when this Tuple expires, and it MUST be removed then ๐ซ
10.5. Routing Set ๐ค๏ธ
a router's Routing Set records the first hop along a selected path to each destination that has any known path โจ it's made of Routing Tuples:
(R_dest_addr, R_next_iface_addr, R_local_iface_addr, R_dist,
R_metric)
where:
R_dest_addris the network address of the destination. it's either the network address of an interface of a destination router, or the network address of an attached network ๐R_next_iface_addris the network address of the "next hop" on the selected path to the destination ๐ฃR_local_iface_addris an address of the local interface that an IP packet MUST be sent over to reach the destination by the selected path. no skipping this one, it's a must ๐ฆR_distis the number of hops on the selected path to the destination ๐ขR_metricis the metric of the route to the destination with addressR_dest_addr๐
the Routing Set for a router is derived from the contents of its other Protocol Sets (the Link Sets, the Neighbor Set, the Router Topology Set, the Routable Address Topology Set, the Attached Network Set, and OPTIONAL use of the 2-Hop Sets). it gets updated (Routing Tuples added or removed, or the whole Routing Set recalculated) when routing paths are calculated, based on changes to those other Protocol Sets ๐ and fun fact: Routing Tuples don't get timer-based expiration ๐
11. Received Message Information Base ๐ฌ
the Received Message Information Base, defined by this spec, keeps info needed to make sure a message gets processed at most once, and forwarded at most once per OLSRv2 interface of a router, using MPR flooding ๐ messages get recorded by their "signature", which is their type, originator address, and message sequence number ๐ชช
11.1. Received Set ๐ฅ
a router has a Received Set per OLSRv2 interface. each Received Set records the signatures of messages received over that OLSRv2 interface. each one is made of Received Tuples:
(RX_type, RX_orig_addr, RX_seq_number, RX_time)
where:
RX_typeis the received Message Type ๐ท๏ธRX_orig_addris the originator address of the received message (no prefix length, obvi ๐)RX_seq_numberis the message sequence number of the received message ๐ขRX_timesays when this Tuple expires, and it MUST be removed then ๐ณ๏ธ
11.2. Processed Set โ
a router has one single Processed Set that records signatures of messages the router has processed. it's made of Processed Tuples:
(P_type, P_orig_addr, P_seq_number, P_time)
where:
P_typeis the processed Message Type ๐งฉP_orig_addris the originator address of the processed message (no prefix length, periodt ๐ )P_seq_numberis the message sequence number of the processed message ๐P_timesays when this Tuple expires, and it MUST be removed then ๐
11.3. Forwarded Set ๐
Every router has a single Forwarded Set ๐ฆ It's basically a diary of the messages this router has already passed along, so it doesn't pass the same thing twice. Each entry is a Forwarded Tuple:
(F_type, F_orig_addr, F_seq_number, F_time)
Here's what each piece means:
F_typeis the Message Type that got forwarded ๐ฆF_orig_addris the originator address of the forwarded message (and yes, no prefix length here, so don't add one ๐ โโ๏ธ)F_seq_numberis the message sequence number of that forwarded messageF_timesays when the Tuple expires, and at that point it MUST be removed ๐๏ธ no exceptions, bestie
12. Information Base Properties โจ
Okay, this part is about some extra properties of the Information Bases and what's inside them ๐ง
12.1. Corresponding Protocol Tuples ๐
So a lot of the time, one Protocol Tuple in one Protocol Set has a natural partner, a single Protocol Tuple in another Protocol Set. That could be in the same Information Base or a different one ๐ The partner is called "corresponding" to the first one. It's like matching besties across the group chat ๐ฏโโ๏ธ
Here are the main matches:
- There's a Local Interface Tuple for each Link Tuple, where the Link Tuple sits in the Link Set for a MANET interface, and the Local Interface Tuple represents that same MANET interface ๐ธ
- There's a Neighbor Tuple for each Link Tuple whose
L_HEARD_timeis notEXPIRED, as long asN_neighbor_addr_listcontainsL_neighbor_iface_addr_list๐ - There's a Link Tuple (in the Link Set of the same Interface Information Base) for each 2-Hop Tuple where
L_neighbor_iface_addr_list=N2_neighbor_iface_addr_listโจ - There's a Neighbor Tuple for each 2-Hop Tuple, where
N_neighbor_addr_listcontainsN2_neighbor_iface_addr_list. This is the Neighbor Tuple that corresponds to the Link Tuple that corresponds to the 2-Hop Tuple ๐ (the matchmaking chain is real, iykyk ๐ญ) - There's an Advertising Remote Router Tuple for each Router Topology Tuple where
AR_orig_addr=TR_from_orig_addr๐ฆ - There's an Advertising Remote Router Tuple for each Routable Address Topology Tuple where
AR_orig_addr=TA_from_orig_addr๐ - There's an Advertising Remote Router Tuple for each Attached Network Tuple where
AR_orig_addr=AN_orig_addr๐ - There's a Neighbor Tuple for each Routing Tuple where
N_neighbor_addr_listcontainsR_next_iface_addr๐
12.2. Address Ownership ๐
This one is all about who "owns" an address when a router is processing a received message. Ownership comes in two flavors, and they're kinda layered ๐ง
Addresses or network addresses count as "fully owned" by a router when processing a received message if they meet any of these:
- They equal its originator address; OR
- They equal the
O_orig_addrin an Originator Tuple; OR - They equal or are a sub-range of the
I_local_iface_addr_listin a Local Interface Tuple; OR - They equal or are a sub-range of the
IR_local_iface_addrin a Removed Interface Address Tuple; OR - They equal an
AL_net_addrin a Local Attached Network Tuple.
Addresses or network addresses count as "partially owned" (which can also include being fully owned) by a router when processing a received message if they meet any of these:
- They overlap (equal or contain) its originator address; OR
- They overlap (equal or contain) the
O_orig_addrin an Originator Tuple; OR - They overlap the
I_local_iface_addr_listin a Local Interface Tuple; OR - They overlap the
IR_local_iface_addrin a Removed Interface Address Tuple; OR - They equal or have as a sub-range an
AL_net_addrin a Local Attached Network Tuple.
13. Packets and Messages ๐จ
The packet and message format this protocol uses is defined in [RFC5444] ๐ Unless otherwise noted, options defined in [RFC5444] may be freely used, especially the alternative formats defined by packet, message, Address Block, and TLV flags ๐
This section explains how this spec uses the packets and messages defined in [RFC5444], plus the TLVs that this spec defines and uses ๐
13.1. Messages ๐ฌ
Routers using this protocol swap info through messages. The Message Types used here are the HELLO message and the TC message. The HELLO message is defined by [RFC6130] and extended by this specification (see Section 15) โจ The TC message is defined by this specification (see Section 16) ๐ซถ
13.2. Packets ๐ฆ
One or more messages that a router sends at the same time SHOULD be combined into a single packet ๐งณ That's subject to any limits on maximum packet size (like the ones derived from the MTU over a local single hop) that MAY be imposed. These messages might have started at the sending router, or at another router and are just being forwarded by the sending router ๐ Messages with different originating routers MAY be combined into the same packet. Messages from other protocols defined using [RFC5444], including but not limited to NHDP [RFC6130], MAY be combined into the same packet too ๐ง This specification does not define or use any contents of the Packet Header ๐
Forwarded messages MAY be jittered as described in [RFC5148] ๐ฒ And the observation there is that the forwarding jitter of all messages received in a single packet SHOULD be the same. The value of MAXJITTER used when jittering a forwarded message MAY be based on information in that message (in particular any Message TLVs with Type = INTERVAL_TIME or Type = VALIDITY_TIME). Otherwise, it SHOULD be with a maximum delay of F_MAXJITTER ๐ A router MAY modify the jitter applied to a message so it can combine messages into packets more efficiently, as long as the maximum jitter isn't exceeded ๐ธ
13.3. TLVs ๐ท๏ธ
This specification defines two Message TLVs and four Address Block TLVs โจ
Any reference in this specification to a TLV that doesn't indicate a type extension assumes Type Extension = 0. In processed messages, TLVs with a type extension that is neither zero (as assumed) nor a specifically indicated non-zero type extension are ignored ๐ โโ๏ธ
Quick reminder: following [RFC5444] and network byte order, bits in an octet are numbered from 0 (most significant) to 7 (least significant) ๐ข
13.3.1. Message TLVs ๐
The MPR_WILLING TLV is used in HELLO messages. A message MUST NOT contain more than one MPR_WILLING TLV ๐ซ
+-------------+--------------+--------------------------------------+
| Type | Value Length | Value |
+-------------+--------------+--------------------------------------+
| MPR_WILLING | 1 octet | Bits 0-3 encode the parameter |
| | | WILL_FLOODING; bits 4-7 encode the |
| | | parameter WILL_ROUTING. |
+-------------+--------------+--------------------------------------+
Table 1: MPR_WILLING TLV Definition ๐ง
The CONT_SEQ_NUM TLV is used in TC messages. A message MUST NOT contain more than one CONT_SEQ_NUM TLV ๐ โโ๏ธ
+--------------+--------------+-------------------------------------+
| Type | Value Length | Value |
+--------------+--------------+-------------------------------------+
| CONT_SEQ_NUM | 2 octets | The ANSN contained in the Neighbor |
| | | Information Base. |
+--------------+--------------+-------------------------------------+
Table 2: CONT_SEQ_NUM TLV Definition ๐
13.3.2. Address Block TLVs ๐
okay so the LINK_METRIC TLV shows up in HELLO messages and TC messages ๐ฆ It MAY use any type extension, but this spec only uses LINK_METRIC TLVs whose type extension equals LINK_METRIC_TYPE โจ And an address MUST NOT be associated with more than one link metric value for any given type extension, kind (link or neighbor), and direction using this TLV. no double dipping!! ๐
+-------------+--------------+--------------------------------------+
| Type | Value Length | Value |
+-------------+--------------+--------------------------------------+
| LINK_METRIC | 2 octets | Bits 0-3 indicate kind(s) and |
| | | direction(s); bits 4-7 indicate |
| | | exponent (b); and bits 8-15 indicate |
| | | mantissa (a). |
+-------------+--------------+--------------------------------------+
Table 3: LINK_METRIC TLV Definition
The exponent and mantissa use the representation defined in Section 6 ๐ง Each bit of the types and directions sub-field, if set ('1'), says the link metric is of that kind and direction. Any combination of these bits MAY be used, so mix and match ๐
+-----+-----------------+-----------+
| Bit | Kind | Direction |
+-----+-----------------+-----------+
| 0 | Link metric | Incoming |
| 1 | Link metric | Outgoing |
| 2 | Neighbor metric | Incoming |
| 3 | Neighbor metric | Outgoing |
+-----+-----------------+-----------+
Table 4: LINK_METRIC TLV Types and Directions
The MPR TLV is used in HELLO messages, and it tells you that an address it's attached to belongs to a symmetric 1-hop neighbor that got picked as an MPR ๐
+------+--------------+---------------------------------------------+
| Type | Value Length | Value |
+------+--------------+---------------------------------------------+
| MPR | 1 octet | FLOODING indicates that the corresponding |
| | | address is of a neighbor selected as a |
| | | flooding MPR; ROUTING indicates that the |
| | | corresponding address is of a neighbor |
| | | selected as a routing MPR; and FLOOD_ROUTE |
| | | indicates both (see Section 24.6). |
+------+--------------+---------------------------------------------+
Table 5: MPR TLV Definition
The NBR_ADDR_TYPE TLV is used in TC messages ๐
+---------------+--------------+------------------------------------+
| Type | Value Length | Value |
+---------------+--------------+------------------------------------+
| NBR_ADDR_TYPE | 1 octet | ORIGINATOR indicates that the |
| | | corresponding address (which MUST |
| | | have maximum prefix length) is an |
| | | originator address; ROUTABLE |
| | | indicates that the corresponding |
| | | network address is a routable |
| | | address of an interface; and |
| | | ROUTABLE_ORIG indicates that the |
| | | corresponding address is both (see |
| | | Section 24.6). |
+---------------+--------------+------------------------------------+
Table 6: NBR_ADDR_TYPE TLV Definition
If an address is both an originator address and a routable address, then it may be associated with either one Address Block TLV with Type := NBR_ADDR_TYPE and Value := ROUTABLE_ORIG, or with two Address Block TLVs with Type:= NBR_ADDR_TYPE, one with Value := ORIGINATOR and one with Value := ROUTABLE. two options, pick your fave ๐
The GATEWAY TLV is used in TC messages. An address MUST NOT be associated with more than one hop count value using this TLV ๐
+---------+--------------+-------------------------------------+
| Type | Value Length | Value |
+---------+--------------+-------------------------------------+
| GATEWAY | 1 octet | Number of hops to attached network. |
+---------+--------------+-------------------------------------+
Table 7: GATEWAY TLV Definition
All address objects included in a TC message according to this specification MUST be associated either with at least one TLV with Type := NBR_ADDR_TYPE or with a TLV with Type := GATEWAY, but not both. Any other address objects MAY be included in Address Blocks in a TC message but are ignored by this specification. the rules are strict, but the vibes are clean ๐ซถ
14. Message Processing and Forwarding ๐ฅ
This section describes the optimized flooding operation (MPR flooding) used when control messages, as instances of [RFC5444], are intended for MANET-wide distribution. This flooding mechanism defines when a received message is, or is not, processed and/or forwarded. it's the gatekeeper, bestie ๐ชโจ
This flooding mechanism is used by this protocol and MAY be used by extensions to this protocol that define, and hence own, other Message Types, to manage processing and/or forwarding of these messages. This specification contains elements (P_type, RX_type, F_type) required only for such usage ๐ง
This flooding mechanism is always used for TC messages (see Section 16). Received HELLO messages (see Section 15) are, unless invalid, always processed and never forwarded by this flooding mechanism. They thus do not need to be recorded in the Received Message Information Base ๐ธ
The processing selection and forwarding mechanisms are designed to only need to parse the Message Header in order to determine whether a message is to be processed and/or forwarded, and not to have to parse the Message Body even if the message is forwarded (but not processed). An implementation MAY only parse the Message Body if necessary or MAY always parse the Message Body and reject the message if it cannot be so parsed or any other error is identified. so much efficiency, it's giving main character ๐
An implementation MUST discard the message silently if it is unable to parse the Message Header or (if attempted) the Message Body, or if a message (other than a HELLO message) does not include a message sequence number. no sequence number, no entry!! ๐
14.1. Actions When Receiving a Message ๐ฆ
On receiving, on an OLSRv2 interface, a message of a type specified to be using this mechanism, which includes the TC messages defined in this specification, a router MUST perform the following:
- If the router recognizes from the originator address of the message that the message is one that the receiving router itself originated (i.e., the message originator address is the originator address of this router or is an O_orig_addr in an Originator Tuple), then the message MUST be silently discarded. talking to yourself is not it ๐ช
- Otherwise:
- If the message is of a type that may be processed, then the message is considered for processing according to Section 14.2.
- If the message is of a type that may be forwarded, AND:
- <msg-hop-limit> is present and <msg-hop-limit> > 1; AND
- <msg-hop-count> is not present or <msg-hop-count> < 255,
then the message is considered for forwarding according to Section 14.3. ๐
14.2. Message Considered for Processing ๐
If a message (the "current message") is considered for processing, then the following tasks MUST be performed:
- If the sending address (i.e., the source address of the IP datagram containing the current message) does not match (taking into account any address prefix) a network address in an L_neighbor_iface_addr_list of a Link Tuple, with L_status = SYMMETRIC, in the Link Set for the OLSRv2 interface on which the current message was received (the "receiving interface"), then processing the current message is OPTIONAL. If the current message is not processed, then the following steps are not carried out. it's a soft pass, not a hard no ๐ท
- If a Processed Tuple exists with:
- P_type = the Message Type of the current message; AND
- P_orig_addr = the originator address of the current message; AND
- P_seq_number = the message sequence number of the current message,
then the current message MUST NOT be processed. already seen it, already ate it ๐
- Otherwise:
- Create a Processed Tuple in the Processed Set with:
- P_type := the Message Type of the current message;
- P_orig_addr := the originator address of the current message;
- P_seq_number := the sequence number of the current message;
- P_time := current time + P_HOLD_TIME.
- Process the current message according to its Message Type. For a TC message, this is as defined in Section 16.3. โจ
- Create a Processed Tuple in the Processed Set with:
14.3. Message Considered for Forwarding ๐
If a message (the "current message") is considered for forwarding, then the following tasks MUST be performed:
- If the sending address (i.e., the source address of the IP datagram containing the current message) does not match (taking into account any address prefix) a network address in an L_neighbor_iface_addr_list of a Link Tuple, with L_status = SYMMETRIC, in the Link Set for the OLSRv2 interface on which the current message was received (the "receiving interface"), then the current message MUST be silently discarded. not from a friend? not getting forwarded ๐
- Otherwise:
- If a Received Tuple exists in the Received Set for the receiving interface, with:
- RX_type = the Message Type of the current message; AND
- RX_orig_addr = the originator address of the current message; AND
- RX_seq_number = the sequence number of the current message,
- If a Received Tuple exists in the Received Set for the receiving interface, with:
then the current message MUST be silently discarded. we already did this one, periodt ๐
- Otherwise:
- Create a Received Tuple in the Received Set for the receiving interface with:
- RX_type := the Message Type of the current message;
- RX_orig_addr := originator address of the current message;
- RX_seq_number := sequence number of the current message;
- RX_time := current time + RX_HOLD_TIME.
- If a Forwarded Tuple exists with:
- F_type = the Message Type of the current message; AND
- F_orig_addr = the originator address of the current message; AND
- F_seq_number = the sequence number of the current message,
- Create a Received Tuple in the Received Set for the receiving interface with:
then the current message MUST be silently discarded. forwarded already, don't be extra ๐
- Otherwise, if the sending address matches (taking account of any address prefix), any network address in an L_neighbor_iface_addr_list of a Link Tuple in the Link Set for the receiving OLSRv2 interface that has L_status = SYMMETRIC and L_mpr_selector = true, then:
- Okay bestie, first up: create a Forwarded Tuple in the Forwarded Set with:
F_type:= the Message Type of the current message ๐F_orig_addr:= originator address of the current message ๐F_seq_number:= sequence number of the current message ๐ขF_time:= current time +F_HOLD_TIMEโฐ
- Then the Message Header of the current message gets modified by:
- Decrement
<msg-hop-limit>in the Message Header by 1; AND - If present, increment
<msg-hop-count>in the Message Header by 1. โจ
- Decrement
- The message gets transmitted over all OLSRv2 interfaces, as described in Section 13. ๐
- Otherwise, the current message MUST be silently discarded. ๐
15. HELLO Messages ๐ฆ
Okay so the HELLO Message Type is owned by NHDP [RFC6130], which means HELLO messages get generated, transmitted, received, and processed by NHDP. This protocol, as permitted by [RFC6130], also uses HELLO messages. It adds to HELLO message generation and does extra processing based on the HELLO messages it receives. Ngl, the division of labour is iconic. ๐ HELLO messages are not forwarded by NHDP [RFC6130] or by OLSRv2, so they stay put. ๐ซถ
15.1. HELLO Message Generation ๐ธ
HELLO messages sent over OLSRv2 interfaces are generated as defined in [RFC6130] and then modified as described in this section. HELLO messages sent on other MANET interfaces are not modified by this specification. The main character is only the OLSRv2 interface, bestie. ๐
HELLO messages sent over OLSRv2 interfaces are extended by adding the following elements:
- A message originator address, recording this router's originator address. This MUST use a
<msg-orig-addr>element, unless:- The message specifies only a single local interface address (i.e., contains only one address object that is associated with an Address Block TLV with Type =
LOCAL_IFand that has no prefix length or a maximum prefix length) that will then be used as the message originator address; OR - The message does not include any local interface network addresses (i.e., has no address objects associated with an Address Block TLV with Type =
LOCAL_IF), as permitted by the specification in [RFC6130], when the router that generated the HELLO message has only one interface address and will use that as the sending address of the IP datagram in which the HELLO message is contained. In this case, that address will be used as the message originator address. ๐ง
- The message specifies only a single local interface address (i.e., contains only one address object that is associated with an Address Block TLV with Type =
- A Message TLV with Type :=
MPR_WILLINGMUST be included. ๐ - The following cases associate Address Block TLVs with one or more addresses from a Link Tuple or a Neighbor Tuple if these are included in the HELLO message. In each case, the TLV MUST be associated with at least one address object for an address from the relevant Tuple. The TLV MAY be associated with more such addresses (including a copy of that address object, possibly not itself associated with any other indicated TLVs, in the same or a different Address Block). These additional TLVs MUST NOT be associated with any other addresses in a HELLO message that will be processed by NHDP [RFC6130]. Bestie, this part is giving rules, so read it twice. ๐
- For each Link Tuple for which
L_in_metric!=UNKNOWN_METRICand for which one or more addresses in itsL_neighbor_iface_addr_listare included as address objects with an associated Address Block TLV with Type =LINK_STATUSand Value =HEARDor Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=LINK_METRICindicating an incoming link metric with valueL_in_metric. - For each Link Tuple for which
L_out_metric!=UNKNOWN_METRICand for which one or more addresses in itsL_neighbor_iface_addr_listare included as address objects with an associated Address Block TLV with Type =LINK_STATUSand Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=LINK_METRICindicating an outgoing link metric with valueL_out_metric. - For each Neighbor Tuple for which
N_symmetric= true and for which one or more addresses in itsN_neighbor_addr_listare included as address objects with an associated Address Block TLV with Type =LINK_STATUSor Type =OTHER_NEIGHBand Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=LINK_METRICindicating an incoming neighbor metric with valueN_in_metric. - For each Neighbor Tuple for which
N_symmetric= true and for which one or more addresses in itsN_neighbor_addr_listare included as address objects with an associated Address Block TLV with Type =LINK_STATUSor Type =OTHER_NEIGHBand Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=LINK_METRICindicating an outgoing neighbor metric with valueN_out_metric. - For each Neighbor Tuple with
N_flooding_mpr= true and for which one or more network addresses in itsN_neighbor_addr_listare included as address objects in the HELLO message with an associated Address Block TLV with Type =LINK_STATUSand Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=MPRand Value :=FLOODINGor Value :=FLOOD_ROUTE. - For each Neighbor Tuple with
N_routing_mpr= true and for which one or more network addresses in itsN_neighbor_addr_listare included as address objects in the HELLO message with an associated Address Block TLV with Type =LINK_STATUSand Value =SYMMETRIC, at least one of these addresses MUST be associated with an Address Block TLV with Type :=MPRand Value :=ROUTINGor Value :=FLOOD_ROUTE. ๐
- For each Link Tuple for which
15.2. HELLO Message Transmission ๐ฎ
HELLO messages are scheduled and transmitted by NHDP [RFC6130]. This protocol MAY require that an additional HELLO message be sent on each OLSRv2 interface when either of the router's sets of MPRs changes, in addition to the cases specified in [RFC6130] and subject to the constraints specified in [RFC6130] (notably on minimum HELLO message transmission intervals). So it's a maybe, plus the usual NHDP limits, no cap. ๐ฐ๏ธ
15.3. HELLO Message Processing ๐
When received on an OLSRv2 interface, HELLO messages are made available to this protocol in two ways, both as permitted by [RFC6130]:
- Such received HELLO messages MUST be made available to this protocol on reception, which allows them to be discarded before being processed by NHDP [RFC6130], for example, if the information added to the HELLO message by this specification is inconsistent. ๐๏ธ
- Such received HELLO messages MUST be made available to OLSRv2 after NHDP [RFC6130] has completed its processing thereof, unless discarded as malformed by NHDP, for processing by OLSRv2. ๐ฅฐ
15.3.1. HELLO Message Discarding ๐ โโ๏ธ
In addition to the reasons specified in [RFC6130] for discarding a HELLO message on reception, a HELLO message received on an OLSRv2 interface MUST be discarded before processing by NHDP [RFC6130] or this specification if it:
- Has more than one Message TLV with Type =
MPR_WILLING. - Has a message originator address, or a network address corresponding to an address object associated with an Address Block TLV with Type =
LOCAL_IF, that is partially owned by this router. (Some of these cases are already excluded by [RFC6130].) - Includes any address object associated with an Address Block TLV with Type =
LINK_STATUSor Type =OTHER_NEIGHBthat overlaps the message's originator address. - Contains any address that will be processed by NHDP [RFC6130] that is associated, using the same or different address objects, with two different values of link metric with the same kind and direction using a TLV with Type =
LINK_METRICand Type Extension =LINK_METRIC_TYPE. This also applies to different addresses that are both of the OLSRv2 interface on which the HELLO message was received. - Contains any address object associated with an Address Block TLV with Type =
MPRthat is not also associated with an Address Block TLV with Type =LINK_STATUSand Value =SYMMETRIC(including using a different copy of that address object in the same or a different Address Block). ๐ซ
15.3.2. HELLO Message Usage ๐
HELLO messages are first processed as specified in [RFC6130]. That processing includes identifying (or creating) a Link Tuple and a Neighbor Tuple corresponding to the originator of the HELLO message (the "current Link Tuple" and the "current Neighbor Tuple"). After this, the following processing MUST also be performed if the HELLO message is received on an OLSRv2 interface and contains a TLV with Type = MPR_WILLING:
- If the HELLO message has a well-defined message originator address, i.e., has an
<msg-orig-addr>element or has zero or one network addresses associated with a TLV with Type =LOCAL_IF:- Remove any Neighbor Tuple, other than the current Neighbor Tuple, with
N_orig_addr= message originator address, taking any consequent action (including removing one or more Link Tuples) as specified in [RFC6130]. - The current Link Tuple is then updated according to:
- Update
L_in_metricandL_out_metricas described in Section 15.3.2.1; - Update
L_mpr_selectoras described in Section 15.3.2.3.
- Update
- The current Neighbor Tuple is then updated according to:
N_orig_addr:= message originator address;- Update
N_in_metricandN_out_metricas described in Section 15.3.2.1; - Update
N_will_floodingandN_will_routingas described in Section 15.3.2.2; - Update
N_mpr_selectoras described in Section 15.3.2.3.
- All 2-Hop Tuples that were updated as described in [RFC6130] are then updated according to:
- Update
N2_in_metricandN2_out_metricas described in Section 15.3.2.1.
- Update
- Remove any Neighbor Tuple, other than the current Neighbor Tuple, with
- If there are any changes to the router's Information Bases, then perform the processing defined in Section 17. ๐
15.3.2.1. Updating Metrics ๐โจ
okay so for every address in a received HELLO message that has an associated Type = LINK_STATUS TLV with Value = HEARD or Value = SYMMETRIC, we get an incoming (to the message originator) link metric ๐
. If the HELLO also has a Type = LINK_METRIC TLV with Type Extension = LINK_METRIC_TYPE that ties that address to a metric of the right kind (link) and direction (incoming), that value is the incoming link metric. If not, it's UNKNOWN_METRIC. no cap, it's that deep ๐ซถ
same vibe for Value = SYMMETRIC, but this time we're looking at the outgoing (from the message originator) link metric. Same matching rule: find the link metric for that address with the right kind (link) and direction (outgoing), and if it's not there, it's UNKNOWN_METRIC ๐ฆ
now neighbor metrics ๐ธ For every address with an associated Type = LINK_STATUS or Type = OTHER_NEIGHB TLV whose Value = SYMMETRIC, we get an incoming (to the message originator) neighbor metric. Same matching idea, but this time it's the kind (neighbor) and direction (incoming). No match means UNKNOWN_METRIC.
and the last one is the same setup, just flipped: outgoing (from the message originator) neighbor metric, using the same Type = LINK_STATUS or Type = OTHER_NEIGHB with Value = SYMMETRIC condition, matched on kind (neighbor) and direction (outgoing). No match, UNKNOWN_METRIC ๐
now the Link Tuple elements L_in_metric and L_out_metric get updated like this ๐
- okay so
L_in_metricMAY be set to any representable value by a process outside this specification, at any time ๐ง But it MUST be set wheneverL_statusbecomes equal toHEARDorSYMMETRIC. If there's no other value available, the valueMAXIMUM_METRICMUST be used ๐ฅ SettingL_in_metricMAY use info based on receiving a packet with a HELLO message that creates or updates the Link Tuple. - when a Link Tuple gets updated (maybe right after it's created) because we got a HELLO message, as specified in [RFC6130], and
L_status = SYMMETRIC, thenL_out_metricis set equal to the incoming link metric for any included address of the interface the HELLO came in on. (psst, the rules for discarding HELLO messages in Section 15.3.1 make this value unambiguous ๐) If there's an address like that but no such link metric, thenL_out_metricis set toUNKNOWN_METRIC.
the Neighbor Tuple elements N_in_metric and N_out_metric are updated according to Section 17.3 โจ
and for any 2-Hop Tuple updated as defined in [RFC6130], N2_in_metric and N2_out_metric get set equal to the incoming neighbor metric and the outgoing neighbor metric, respectively, that go with the matching N2_2hop_addr. If there aren't any such metrics, both get set to UNKNOWN_METRIC ๐
15.3.2.2. Updating Willingness ๐
N_will_flooding and N_will_routing in the current Neighbor Tuple get updated using the Message TLV with Type = MPR_WILLING. (note that this must be present, bestie ๐) It goes like this:
N_will_flooding := bits 0-3 of the value of that TLV; ANDN_will_routing := bits 4-7 of the value of that TLV.
(each one being in the range 0 to 15, aka WILL_NEVER up to WILL_ALWAYS ๐
)
15.3.2.3. Updating MPR Selector Status ๐ฆ
okay so L_mpr_selector gets updated like this:
- if a router finds an address object for any of its relevant local interface network addresses (the ones in the
I_local_iface_addr_listof an OLSRv2 interface) that has an associated Address Block TLV withType = MPRandValue = FLOODINGorValue = FLOOD_ROUTEin the HELLO message (which means the originating router picked the receiving router as a flooding MPR ๐ซ), then, for the current Link Tuple:L_mpr_selector := true.
- otherwise (i.e., if no such address object and Address Block TLV was found), if a router finds an address object for any of its relevant local interface network addresses (again, the ones in the
I_local_iface_addr_listof an OLSRv2 interface) with an associated Address Block TLV withType = LINK_STATUSandValue = SYMMETRICin the HELLO message, then, for the current Link Tuple:L_mpr_selector := false.
and N_mpr_selector gets updated like this ๐
- if a router finds an address object for any of its relevant local interface network addresses (the ones in the
I_local_iface_addr_listof an OLSRv2 interface) with an associated Address Block TLV withType = MPRandValue = ROUTINGorValue = FLOOD_ROUTEin the HELLO message (meaning the originating router picked the receiving router as a routing MPR ๐), then, for the current Neighbor Tuple:N_mpr_selector := true;N_advertised := true.
- otherwise (i.e., if no such address object and Address Block TLV was found), if a router finds an address object for any of its relevant local interface network addresses (the ones contained in the
I_local_iface_addr_listof an OLSRv2 interface) with an associated Address Block TLV withType = LINK_STATUSandValue = SYMMETRICin the HELLO message, then, for the current Neighbor Tuple:N_mpr_selector := false;- the router MAY also set
N_advertised := false.๐ซ
16. TC Messages ๐กโจ
this protocol defines, and so owns, the TC Message Type (see Section 24) ๐ So, as specified in [RFC5444], this protocol generates and transmits all TC messages, receives all TC messages, and decides whether and how each TC message gets processed (updating the Topology Information Base) and/or forwarded, according to this specification. main character energy, no notes ๐
16.1. TC Message Generation ๐ง
a TC message is a message as defined in [RFC5444]. A generated TC message MUST contain the following elements as defined in [RFC5444]:
- a message originator address that records this router's originator address. This MUST use a
<msg-orig-addr>element. ๐ - a
<msg-seq-num>element containing the message sequence number. ๐ธ - a
<msg-hop-limit>element containingTC_HOP_LIMIT. A router MAY use the same or different values ofTC_HOP_LIMITin its TC messages (see Section 5.4.7). ๐ฆ - a
<msg-hop-count>element containing zero, if the message contains a TLV with eitherType = VALIDITY_TIMEorType = INTERVAL_TIME(as specified in [RFC5497]) indicating more than one time value according to distance. A TC message MAY contain such a<msg-hop-count>element even if it doesn't need to. ๐ - a single Message TLV with
Type := CONT_SEQ_NUMandValue := ANSNfrom the Neighbor Information Base. If the TC message is complete, this Message TLV MUST haveType Extension := COMPLETE; otherwise, it MUST haveType Extension := INCOMPLETE. (Exception: a TC message MAY omit this Message TLV if the TC message doesn't include any address objects with an associated Address Block TLV withType = NBR_ADDR_TYPEorType = GATEWAY.) ๐ - a single Message TLV with
Type := VALIDITY_TIME, as specified in [RFC5497]. If all TC messages are sent with the same hop limit, then this TLV MUST have a value encoding the periodT_HOLD_TIME.
if TC messages are sent with different hop limits (more than one value of TC_HOP_LIMIT), then this TLV MUST specify times that vary with the number of hops that match the chosen pattern of TC message hop limits, as specified in [RFC5497]. These times SHOULD be appropriate multiples of T_HOLD_TIME. The options included in [RFC5497] for representing zero and infinite times MUST NOT be used. โณ
- if the TC message is complete, all network addresses that are the
N_orig_addrof a Neighbor Tuple withN_advertised = trueMUST be represented by address objects in one or more Address Blocks. If the TC message is incomplete, any such address objects MAY be included. At least one copy of each such address object that is included MUST be associated with an Address Block TLV withType := NBR_ADDR_TYPEandValue := ORIGINATOR, or withValue := ROUTABLE_ORIGif that address object is also going to be associated withValue = ROUTABLE. ๐ซถ - if the TC message is complete, all routable addresses in the
N_neighbor_addr_listof a Neighbor Tuple withN_advertised = trueMUST be represented by address objects in one or more Address Blocks. If the TC message is incomplete, any such address objects MAY be included. At least one copy of each such address object MUST be associated with an Address Block TLV withType = NBR_ADDR_TYPEandValue = ROUTABLE, or withValue = ROUTABLE_ORIGif also going to be associated withValue = ORIGINATOR. At least one copy of each such address object MUST be associated with an Address Block TLV withType = LINK_METRICandType Extension = LINK_METRIC_TYPEindicating an outgoing neighbor metric with a value equal to the correspondingN_out_metric. โจ - if the TC message is complete, all network addresses that are the
AL_net_addrof a Local Attached Network Tuple MUST be represented by address objects in one or more Address Blocks. If the TC message is incomplete, any such address objects MAY be included. At least one copy of each such address object MUST be associated with an Address Block TLV withType := GATEWAYandValue := AN_dist. At least one copy of each such address object MUST be associated with an Address Block TLV withType = LINK_METRICandType Extension = LINK_METRIC_TYPEindicating an outgoing neighbor metric equal to the correspondingAL_metric. ๐
A TC message MAY contain:
- a single Message TLV with
Type := INTERVAL_TIME, as specified in [RFC5497]. If all TC messages are sent with the same hop limit, then this TLV MUST have a value encoding the periodTC_INTERVAL. If TC messages are sent with different hop limits, then this TLV MUST specify times that vary with the number of hops that match the chosen pattern of TC message hop limits, as specified in [RFC5497]. These times MUST be appropriate multiples ofTC_INTERVAL. The options included in [RFC5497] for representing zero and infinite times MUST NOT be used. ๐
16.2. TC Message Transmission ๐ฆ
okay so a router with one or more OLSRv2 interfaces, and with any Neighbor Tuples with N_advertised = true or a non-empty Local Attached Network Set, MUST generate TC messages ๐ก. If a router has nothing to advertise, it MUST also generate "empty" TC messages for a period of A_HOLD_TIME after it last generated a non-empty TC message. bestie, that's giving continuity โจ
Complete TC messages get generated and transmitted periodically on all OLSRv2 interfaces. The default interval between two consecutive TC message transmissions by the same router is TC_INTERVAL โฐ
TC messages MAY be generated in response to a change in the information they advertise, which shows up as a change in the ANSN in the Neighbor Information Base ๐
When that happens, a router MAY send a complete TC message and, if it does, MAY restart its TC message schedule. Or, alternatively, a router MAY send an incomplete TC message with at least the newly advertised network addresses in its Address Blocks, along with the associated Address Block TLV(s). By "newly advertised" I mean addresses that weren't advertised before but now are, so an N_orig_addr, something in an N_neighbor_addr_list in a Neighbor Tuple with N_advertised = true, or an AL_net_addr ๐ซถ Just a heads-up though: a router cannot report removal of advertised content using an incomplete TC message ๐
When a router sends a TC message because the advertised network addresses changed, it MUST respect a minimum interval of TC_MIN_INTERVAL between sending TC messages (complete or incomplete). It also MUST respect a maximum interval of TC_INTERVAL between sending complete TC messages. So, a router MUST NOT send an incomplete TC message if it's within TC_MIN_INTERVAL of the next scheduled time to send a complete TC message ๐
The generation of TC messages, whether it's scheduled or triggered by a change of contents, MAY be jittered as described in [RFC5148] ๐ The values of MAXJITTER used MUST be:
TP_MAXJITTERfor periodic TC message generation;TT_MAXJITTERfor responsive TC message generation.
16.3. TC Message Processing ๐ง
When a router receives a TC message on an OLSRv2 interface, it MUST then follow the processing and forwarding procedures defined in Section 14.
If the message is considered for processing (Section 14.2), a router MUST first check whether the message is invalid for processing by this router, as defined in Section 16.3.1. A router MAY make a similar check before considering a message for forwarding. When it does, it MUST check the aspects that apply to elements in the Message Header.
If the TC message is not invalid, then the processing specific to the TC Message Type, described in Section 16.3.2, MUST be applied. This updates its appropriate Interface Information Bases and its Router Information Base. After that, if there are any changes in these Information Bases, the processing in Section 17 MUST be performed โจ
16.3.1. TC Message Discarding ๐๏ธ
A received TC message is invalid for processing by this router if the message:
- Has an address length specified in the Message Header that is not equal to the length of the addresses used by this router.
- Does not include a message originator address and a message sequence number.
- Does not include a hop count and contains a multi-value TLV with
Type = VALIDITY_TIMEorType = INTERVAL_TIME, as defined in [RFC5497]. - Does not have exactly one Message TLV with
Type = VALIDITY_TIME. - Has more than one Message TLV with
Type = INTERVAL_TIME. - Does not have a Message TLV with
Type = CONT_SEQ_NUMandType Extension = COMPLETEorType Extension = INCOMPLETE, and contains at least one address object associated with an Address Block TLV withType = NBR_ADDR_TYPEorType = GATEWAY. - Has more than one Message TLV with
Type = CONT_SEQ_NUMandType Extension = COMPLETEorType Extension = INCOMPLETE. - Has a message originator address that is partially owned by this router.
- Includes any address object with a prefix length that is not maximal (equal to the address length, in bits), associated with an Address Block TLV with
Type = NBR_ADDR_TYPEandValue = ORIGINATORorValue = ROUTABLE_ORIG. - Includes any address object that represents a non-routable address, associated with an Address Block TLV with
Type = NBR_ADDR_TYPEandValue = ROUTABLEorValue = ROUTABLE_ORIG. - Includes any address object associated with an Address Block TLV with
Type = NBR_ADDR_TYPEorType = GATEWAYthat also represents the message's originator address. - Includes any address object (including different copies of an address object in the same or different Address Blocks) that is associated with an Address Block TLV with
Type = NBR_ADDR_TYPEorType = GATEWAY, and that is also associated with more than one outgoing neighbor metric using a TLV withType = LINK_METRICandType Extension = LINK_METRIC_TYPE. - Associates any address object (including different copies of an address object in the same or different Address Blocks) with more than one single hop count value using one or more Address Block TLV(s) with
Type = GATEWAY. - Associates any address object (including different copies of an address object in the same or different Address Blocks) with Address Block TLVs with
Type = NBR_ADDR_TYPEandType = GATEWAY.
A router MAY recognize additional reasons for identifying that a message is invalid. An invalid message MUST be silently discarded, without updating the router's Information Bases ๐คซ
Note that a router that acts inconsistently, for example by rejecting TC messages "at random", may cause parts of the network to be unable to communicate with other parts of the network ๐ญ It is RECOMMENDED that such "additional reasons for identifying that a message is invalid" be a consistent network-wide policy (e.g., as part of a security policy), implemented on all participating routers ๐
16.3.2. TC Message Processing Definitions ๐
When, according to Section 14.2, a TC message is to be "processed according to its type", this means that:
- If the TC message contains a Message TLV with
Type = CONT_SEQ_NUMandType Extension = COMPLETE, then processing according to Section 16.3.3 and then according to Section 16.3.4 is carried out. - If the TC message contains a Message TLV with
Type = CONT_SEQ_NUMandType Extension = INCOMPLETE, then only processing according to Section 16.3.3 is carried out.
For the purposes of the TC message processing in Section 16.3.3 and Section 16.3.4:
- "validity time" is calculated from a
VALIDITY_TIMEMessage TLV in the TC message according to the specification in [RFC5497]. All information in the TC message has the same validity time. - "received ANSN" is defined as being the value of a Message TLV with
Type = CONT_SEQ_NUM. - "associated metric value" is defined for any address in the TC message as being either the outgoing neighbor metric value indicated by a TLV with
Type = LINK_METRICandType Extension = LINK_METRIC_TYPEthat is associated with any address object in the TC message that is equal to that address, or asUNKNOWN_METRICotherwise. (Note that the rules in Section 16.3.1 make this definition unambiguous.) - Comparisons of sequence numbers are carried out as specified in Section 21.
16.3.3. Initial TC Message Processing ๐ธ
The TC message is processed as follows:
- The Advertising Remote Router Set is updated according to Section 16.3.3.1. If the TC message is indicated as discarded in that processing, then the following steps are not carried out.
- The Router Topology Set is updated according to Section 16.3.3.2.
- The Routable Address Topology Set is updated according to Section 16.3.3.3.
- The Attached Network Set is updated according to Section 16.3.3.4.
16.3.3.1. Populating the Advertising Remote Router Set ๐
The router MUST update its Advertising Remote Router Set as follows:
- If there is an Advertising Remote Router Tuple with:
AR_orig_addr = message originator address; ANDAR_seq_number > received ANSN,
then the TC message MUST be discarded.
- Otherwise:
- If there is no Advertising Remote Router Tuple such that:
AR_orig_addr = message originator address;
- If there is no Advertising Remote Router Tuple such that:
then create an Advertising Remote Router Tuple with:
AR_orig_addr := message originator address.
- This Advertising Remote Router Tuple (existing or new) is then modified as follows:
AR_seq_number := received ANSN;AR_time := current time + validity time.
16.3.3.2. Populating the Router Topology Set ๐
The router MUST update its Router Topology Set as follows:
- For each address (henceforth, advertised address) that corresponds to one or more address objects with an associated Address Block TLV with
Type = NBR_ADDR_TYPEandValue = ORIGINATORorValue = ROUTABLE_ORIG, and that is not partially owned by this router, perform the following processing:- If the associated metric is
UNKNOWN_METRIC, then remove any Router Topology Tuple such that:TR_from_orig_addr = message originator address; ANDTR_to_orig_addr = advertised address.
- Otherwise, if there is no Router Topology Tuple such that:
TR_from_orig_addr = message originator address; ANDTR_to_orig_addr = advertised address,
- If the associated metric is
then create a new Router Topology Tuple with:
TR_from_orig_addr := message originator address;TR_to_orig_addr := advertised address.
- This Router Topology Tuple (existing or new) is then modified as follows:
TR_seq_number := received ANSN;TR_metric := associated link metric;TR_time := current time + validity time.
16.3.3.3. Populating the Routable Address Topology Set ๐ฆ
The router MUST update its Routable Address Topology Set as follows:
- For each network address (henceforth, advertised address) that corresponds to one or more address objects with an associated Address Block TLV with
Type = NBR_ADDR_TYPEandValue = ROUTABLEorValue = ROUTABLE_ORIG, and that is not partially owned by this router, perform the following processing:- If the associated metric is
UNKNOWN_METRIC, then remove any Routable Address Topology Tuple such that:TA_from_orig_addr = message originator address; ANDTA_dest_addr = advertised address.
- Otherwise, if there is no Routable Address Topology Tuple such that:
TA_from_orig_addr = message originator address; ANDTA_dest_addr = advertised address,
- If the associated metric is
then create a new Routable Address Topology Tuple with:
TA_from_orig_addr := message originator address;TA_dest_addr := advertised address.
- This Routable Address Topology Tuple (existing or new) is then modified as follows:
TA_seq_number := received ANSN;TA_metric := associated link metric;TA_time := current time + validity time.
16.3.3.4. Populating the Attached Network Set ๐ธ
okay bestie, this is where the router updates its Attached Network Set, and it MUST do it in this exact order ๐
- For each network address (henceforth, attached address) that corresponds to one or more address objects with an associated Address Block TLV with Type =
GATEWAYand that is not fully owned by this router, perform the following processing:- If the associated metric is
UNKNOWN_METRIC, then remove any Attached Network Tuple such that:AN_net_addr = attached address; ANDAN_orig_addr = message originator address.
- Otherwise, if there is no Attached Network Tuple such that:
AN_net_addr = attached address; ANDAN_orig_addr = message originator address,
- If the associated metric is
then create a new Attached Network Tuple with:
AN_net_addr := attached address;AN_orig_addr := message originator address.
- This Attached Network Tuple (existing or new) is then modified as follows:
AN_seq_number := received ANSN;AN_dist := the Value of the associated GATEWAY TLV;AN_metric := associated link metric;AN_time := current time + validity time.
16.3.4. Completing TC Message Processing โจ
the TC message gets finished off in three steps, in this order ๐
- The Router Topology Set is updated according to Section 16.3.4.1.
- The Routable Address Topology Set is updated according to Section 16.3.4.2.
- The Attached Network Set is updated according to Section 16.3.4.3.
16.3.4.1. Purging the Router Topology Set ๐ฆ
the Router Topology Set MUST be updated like this:
- Any Router Topology Tuples with:
TR_from_orig_addr = message originator address; ANDTR_seq_number < received ANSN,
MUST be removed.
16.3.4.2. Purging the Routable Address Topology Set ๐
the Routable Address Topology Set MUST be updated like this:
- Any Routable Address Topology Tuples with:
TA_from_orig_addr = message originator address; ANDTA_seq_number < received ANSN,
MUST be removed.
16.3.4.3. Purging the Attached Network Set ๐ง
the Attached Network Set MUST be updated like this:
- Any Attached Network Tuples with:
AN_orig_addr = message originator address; ANDAN_seq_number < received ANSN,
MUST be removed.
17. Information Base Changes ๐
the changes in the following sections MUST be carried out whenever an Information Base changes as indicated. no skipping, periodt ๐ญ
17.1. Originator Address Changes ๐
if the router changes its originator address, then:
- If there is no Originator Tuple with:
O_orig_addr = old originator address
then create an Originator Tuple with:
O_orig_addr := old originator address
The Originator Tuple (existing or new) with:
O_orig_addr = new originator address
is then modified as follows:
O_time := current time + O_HOLD_TIME
17.2. Link State Changes ๐ฅ
the consistency of a Link Tuple MUST be maintained according to the following rules, in addition to those in [RFC6130]:
- If
L_status = HEARDorL_status = SYMMETRIC, thenL_in_metricMUST be set (by a process outside this specification). - If
L_status != SYMMETRIC, then setL_mpr_selector := false. - If
L_out_metric = UNKNOWN_METRIC, thenL_statusMUST NOT equalSYMMETRIC; setL_SYM_time := EXPIREDif this would otherwise be the case.
17.3. Neighbor State Changes ๐
the consistency of a Neighbor Tuple MUST be maintained according to the following rules, in addition to those in [RFC6130]:
- If
N_symmetric = true, thenN_in_metricMUST equal the minimum value of allL_in_metricof corresponding Link Tuples withL_status = SYMMETRICandL_in_metric != UNKNOWN_METRIC. If there are no such Link Tuples, thenN_in_metricMUST equalUNKNOWN_METRIC. - If
N_symmetric = true, thenN_out_metricMUST equal the minimum value of allL_out_metricof corresponding Link Tuples withL_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC. If there are no such Link Tuples, thenN_out_metricMUST equalUNKNOWN_METRIC. - If
N_symmetric = false, thenN_flooding_mpr,N_routing_mpr,N_mpr_selector, andN_advertisedMUST all be equal to false. - If
N_mpr_selector = true, thenN_advertisedMUST be equal to true. - If
N_symmetric = true,N_out_metric != UNKNOWN_METRICandN_mpr_selector = false, then a router MAY selectN_advertised = trueorN_advertised = false. The more neighbors that are advertised, the larger TC messages become, but the more redundancy is available for routing. A router SHOULD consider the nature of its network in making such a decision and SHOULD avoid unnecessary changes in advertising status, which may result in unnecessary changes to routing.
17.4. Advertised Neighbor Changes ๐
the router MUST increment the ANSN in the Neighbor Information Base whenever:
- Any Neighbor Tuple changes its
N_advertisedvalue, or any Neighbor Tuple withN_advertised = trueis removed. - Any Neighbor Tuple with
N_advertised = truechanges itsN_orig_addror has any routable address added to or removed fromN_neighbor_addr_list. - Any Neighbor Tuple with
N_advertised = truehasN_out_metricchanged. - There is any change to the Local Attached Network Set.
17.5. Advertising Remote Router Tuple Expires ๐ฆ
the Router Topology Set, the Routable Address Topology Set, and the Attached Network Set MUST be changed when an Advertising Remote Router Tuple expires (AR_time is reached). The following changes are required before the Advertising Remote Router Tuple is removed:
- All Router Topology Tuples with:
TR_from_orig_addr = AR_orig_addrof the Advertising Remote Router Tuple
are removed.
- All Routable Address Topology Tuples with:
TA_from_orig_addr = AR_orig_addrof the Advertising Remote Router Tuple
are removed.
- All Attached Network Tuples with:
AN_orig_addr = AR_orig_addrof the Advertising Remote Router Tuple
are removed.
17.6. Neighborhood Changes and MPR Updates ๐ง
the sets of symmetric 1-hop neighbors selected as flooding MPRs and routing MPRs MUST satisfy the conditions defined in Section 18. To make sure this happens:
- The set of flooding MPRs of a router MUST be recalculated if:
- A Link Tuple is added with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC; OR - A Link Tuple with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRICis removed; OR - A Link Tuple with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRICchanges to havingL_status = HEARD,L_status = LOST, orL_out_metric = UNKNOWN_METRIC; OR - A Link Tuple with
L_status = HEARDorL_status = LOSTchanges to havingL_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC; OR - The flooding MPR selection process uses metric values (see Section 18.4) and the
L_out_metricof any Link Tuple withL_status = SYMMETRICchanges; OR - The
N_will_floodingof a Neighbor Tuple withN_symmetric = trueandN_out_metric != UNKNOWN_METRICchanges fromWILL_NEVERto any other value; OR - The
N_will_floodingof a Neighbor Tuple withN_flooding_mpr = truechanges toWILL_NEVERfrom any other value; OR - The
N_will_floodingof a Neighbor Tuple withN_symmetric = true,N_out_metric != UNKNOWN_METRIC, andN_flooding_mpr = falsechanges toWILL_ALWAYSfrom any other value; OR - A 2-Hop Tuple with
N2_out_metric != UNKNOWN_METRICis added or removed; OR - The
N2_out_metricof any 2-Hop Tuple changes and either the flooding MPR selection process uses metric values (see Section 18.4) or the change is to or fromUNKNOWN_METRIC.
- A Link Tuple is added with
- Otherwise, the set of flooding MPRs of a router MAY be recalculated if the
N_will_floodingof a Neighbor Tuple withN_symmetric = truechanges in any other way; it SHOULD be recalculated ifN_flooding_mpr = falseand this is an increase inN_will_floodingor ifN_flooding_mpr = trueand this is a decrease inN_will_flooding. - The set of routing MPRs of a router MUST be recalculated if:
- A Neighbor Tuple is added with
N_symmetric = trueandN_in_metric != UNKNOWN_METRIC; OR - A Neighbor Tuple with
N_symmetric = trueandN_in_metric != UNKNOWN_METRICis removed; OR - A Neighbor Tuple with
N_symmetric = trueandN_in_metric != UNKNOWN_METRICchanges to havingN_symmetric = false; OR - A Neighbor Tuple with
N_symmetric = falsechanges to havingN_symmetric = trueandN_in_metric != UNKNOWN_METRIC; OR - The
N_in_metricof any Neighbor Tuple withN_symmetric = truechanges; OR - The
N_will_routingof a Neighbor Tuple withN_symmetric = trueandN_in_metric != UNKNOWN_METRICchanges fromWILL_NEVERto any other value; OR - The
N_will_routingof a Neighbor Tuple withN_routing_mpr = truechanges toWILL_NEVERfrom any other value; OR - The
N_will_routingof a Neighbor Tuple withN_symmetric = true,N_in_metric != UNKNOWN_METRICandN_routing_mpr = falsechanges toWILL_ALWAYSfrom any other value; OR - A 2-Hop Tuple with
N2_in_metric != UNKNOWN_METRICis added or removed; OR - The
N2_in_metricof any 2-Hop Tuple changes.
- A Neighbor Tuple is added with
- Otherwise, the set of routing MPRs of a router MAY be recalculated if the
N_will_routingof a Neighbor Tuple withN_symmetric = truechanges in any other way; it SHOULD be recalculated ifN_routing_mpr = falseand this is an increase inN_will_routingor ifN_routing_mpr = trueand this is a decrease inN_will_routing.
If either set of MPRs of a router is recalculated, this MUST be as described in Section 18. that's the whole section, slay โจ
17.7. Routing Set Updates โจ
Okay bestie, the Routing Set MUST be updated, as described in Section 19, whenever the Local Information Base, the Neighborhood Information Base, or the Topology Information Base shows a change (including any change to potentially used outgoing neighbor metric values) in the known symmetric links and/or attached networks across the MANET ๐ธ. That changes the Topology Graph, so it's a whole big deal. You only need to care about changes that affect at least one of these:
- Local Interface Set for an OLSRv2 interface, if the change removes any network address in an
I_local_iface_addr_list. In this case, unless the OLSRv2 interface is removed, it may not be necessary to do more than replace such network addresses, if used, with an alternative network address from the sameI_local_iface_addr_list๐ฆ. - Local Attached Set, if the change removes any
AL_net_addrthat is also anAN_net_addr. In this case, it may not be necessary to do more than add Routing Tuples withR_dest_addrequal to thatAN_net_addr๐ . - Link Set of any OLSRv2 interface, considering only Link Tuples that have, or just had,
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC(including removal of such Link Tuples) ๐ฅ. - Neighbor Set of the router, considering only Neighbor Tuples that have, or just had,
N_symmetric = trueandN_out_metric != UNKNOWN_METRICand do not haveN_orig_addr = unknown๐ซถ. - 2-Hop Set of any OLSRv2 interface, if used in the creation of the Routing Set and if the change affects any 2-Hop Tuples with
N2_out_metric != UNKNOWN_METRIC๐. - Router Topology Set of the router. โญ
- Routable Address Topology Set of the router. ๐ง
- Attached Network Set of the router. ๐
18. Selecting MPRs ๐
Okay so each router MUST select, from among its willing symmetric 1-hop neighbors, two subsets of these routers: flooding MPRs and routing MPRs ๐ญ. That selection gets recorded in the router's Neighbor Set and reported in the router's HELLO messages. Routers MAY select their MPRs by any process that satisfies the conditions below, which may, but doesn't have to, use the organization of the data described. Routers can freely interoperate whether they use the same or different MPR selection algorithms, which is honestly so iconic ๐.
Only flooding MPRs forward control messages that get flooded through the MANET. That's the flooding reduction, an optimization of the flooding mechanism known as MPR flooding โจ. Routing MPRs are used to effect a topology reduction in the MANET. (If no such reduction is required, then a router can select all of its relevant neighbors as routing MPRs.) So while it isn't essential for these two sets to be minimal, keeping the numbers of MPRs small keeps the overhead of this protocol as low as possible ๐.
18.1. Overview ๐ธ
MPRs get selected through the following steps, which are defined in the sections below:
- A data structure known as a Neighbor Graph is defined.
- The properties of an MPR Set derived from a Neighbor Graph are defined. Any algorithm that creates an MPR Set satisfying these properties is a valid MPR selection algorithm. An example algorithm that creates such an MPR Set is given in Appendix B ๐ฆ.
- How to create a Neighbor Graph for each interface, based on the corresponding Interface Information Base, is defined. It also explains how to combine the resulting MPR Sets to determine the router's flooding MPRs and record those in the router's Neighbor Set ๐ .
- How to create a single Neighbor Graph based on all Interface Information Bases and the Neighbor Information Base is defined. It also explains how to record the resulting MPR Set as the router's routing MPRs in the router's Neighbor Set ๐ฅ.
- A specification as to when MPRs MUST be calculated is given. Literally non-negotiable ๐.
When a router selects its MPRs, it MAY consider any characteristics of its neighbors that it's aware of ๐ซถ. In particular, it SHOULD consider the willingness of the neighbor, as recorded by the corresponding N_will_flooding or N_will_routing value (whichever is appropriate), preferring neighbors with higher values ๐. (Note that willingness values equal to WILL_NEVER and WILL_ALWAYS are always considered, as described.) However, a router MAY consider other characteristics to have a greater significance ๐.
Each router MAY select its flooding and routing MPRs independently of each other, or it MAY coordinate its selections ๐ง. A router MAY make its MPR selections independently of the MPR selection by other routers. Or it MAY, for example, give preference to routers that either are, or are not, already selected as MPRs by other routers. Very strategic, very main character โญ.
18.2. Neighbor Graph ๐
A Neighbor Graph is a structure defined here as consisting of sets N1 and N2, plus some associated metric and willingness values ๐. Elements of set N1 represent willing symmetric 1-hop neighbors, and elements of set N2 represent addresses of a symmetric 2-hop neighbor ๐ธ.
A Neighbor Graph has the following properties:
- It contains two disjoint sets, N1 and N2.
- For each element x in N1, there is an associated willingness value W(x) such that
WILL_NEVER < W(x) <= WILL_ALWAYS๐ฆ. - For each element x in N1, there is an associated metric
d1(x) > 0๐ . - For some elements y in N2, there is an associated metric
d1(y) > 0. (Other elements y in N2 have undefinedd1(y), which may be considered to be infinite ๐ฅ.) - For each element x in N1, there is a subset N2(x) of elements of N2. This subset may be empty. For each x in N1 and each y in N2(x), there is an associated metric
d2(x,y) > 0. (For other x in N1 and y in N2,d2(x,y)is undefined and may be considered infinite ๐ซถ.) - N2 is equal to the union of all the N2(x) for all x in N1. In other words, for each y in N2, there is at least one x in N1 such that y is in N2(x) ๐.
It's convenient to also define:
- For each y in N2, the set N1(y) that contains x in N1 if and only if y is in N2(x). From the final property above, N1(y) is not empty ๐.
- For each x in N1 and y in N2, if
d2(x,y)is defined, thend(x,y) := d1(x)+d2(x,y). Otherwise,d(x,y)is not defined. (Thus,d(x,y)is defined if y is in N2(x) or, equivalently, if x is in N1(y).) ๐ง - For any subset S of N1 and for each y in N2, the metric
d(y,S)is the minimum value ofd1(y), if defined, and of alld(x,y)for x in N1(y) and in S. If there are no such metrics to take the minimum value of, thend(y,S)is undefined (and may be considered infinite). From the final property above,d(y,N1)is defined for all y โญ.
18.3. MPR Properties ๐
Given a Neighbor Graph as defined in Section 18.2, an MPR Set for that Neighbor Graph is a subset M of the set N1 that satisfies the following properties ๐:
- If x in N1 has
W(x) = WILL_ALWAYS, then x is in M ๐ธ. - For any y in N2 that does not have a defined
d1(y), there is at least one element in M that is also in N1(y). This is equivalent to the requirement thatd(y,M)is defined ๐ฆ. - For any y in N2,
d(y,M) = d(y,N1)๐ .
These properties reflect that the MPR Set is a set of symmetric 1-hop neighbors that cover all the symmetric 2-hop neighbors, and that they do so while keeping a minimum-distance route (1-hop, if present, or 2-hop) to each symmetric 2-hop neighbor ๐ซถ.
Note that if M is an MPR Set, then so is any subset of N1 that contains M. Also, N1 is always an MPR Set ๐. An MPR Set may be empty, but it cannot be empty if N2 contains any elements y that don't have a defined d1(y) โจ.
18.4. Flooding MPRs โจ
Okay so whenever flooding MPRs need to be calculated, an implementation MUST determine and record a set of flooding MPRs that is equivalent to one calculated the way this section describes ๐
The calculation of flooding MPRs need not use link metrics, or, equivalently, may use link metrics with a fixed value, here taken to be 1 ๐ฆ But links with unknown metric (L_out_metric = UNKNOWN_METRIC) MUST NOT be used, even if link metrics are otherwise not used. Not even a little ๐
Routers MAY make individual decisions about whether to use link metrics for the calculation of flooding MPRs. A router MUST use the same approach to that choice for all links. So in the cases marked A or B, the same choice MUST be made in each case. Consistency is everything, periodt ๐
For each OLSRv2 interface (the "current interface"), define a Neighbor Graph as defined in Section 18.2, following these rules:
- Define a reachable Link Tuple to be a Link Tuple in the Link Set for the current interface with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRIC. - Define an allowed Link Tuple to be a reachable Link Tuple whose corresponding Neighbor Tuple has
N_will_flooding > WILL_NEVER. - Define an allowed 2-Hop Tuple to be a 2-Hop Tuple in the 2-Hop Set for the current interface for which
N2_out_metric != UNKNOWN_METRICand there is an allowed Link Tuple withL_neighbor_iface_addr_list = N2_neighbor_iface_addr_list. - Define an element of N1 for each allowed Link Tuple. This then defines the corresponding Link Tuple for each element of N1, and the corresponding Neighbor Tuple for each element of N1, being the Neighbor Tuple corresponding to that Link Tuple.
- For each element
xin N1, defineW(x) := N_will_floodingof the corresponding Neighbor Tuple. - For each element
xin N1, defined1(x)as either:- A.
L_out_metricof the corresponding Link Tuple; OR - B.
1.
- A.
- Define an element of N2 for each network address that is the
N2_2hop_addrof one or more allowed 2-Hop Tuples. This then defines the corresponding address for each element of N2. - For each element
yin N2, if the corresponding address is in theN_neighbor_addr_listof a Neighbor Tuple that corresponds to one or more reachable Link Tuples, then defined1(y)as either:- A. the minimum value of the
L_out_metricof those Link Tuples; OR - B.
1.
- A. the minimum value of the
Otherwise, d1(y) is not defined. In the latter case, where d1(y) := 1, all such y in N2 may instead be removed from N2.
- For each element
xin N1, defineN2(x)as the set of elementsyin N2 whose corresponding address is theN2_2hop_addrof an allowed 2-Hop Tuple that hasN2_neighbor_iface_addr_list = L_neighbor_iface_addr_listof the Link Tuple corresponding tox. For all suchxandy, defined2(x,y)as either:- A.
N2_out_metricof that 2-Hop Tuple; OR - B.
1.
- A.
It is up to an implementation to decide how to label each element of N1 or N2. For example, an element of N1 may be labeled with one or more addresses from the corresponding L_neighbor_iface_addr_list, or with a pointer or reference to the corresponding Link Tuple. Pick whatever labelling vibes with your code ๐ธ
Using these Neighbor Graphs, flooding MPRs are selected and recorded by:
- For each OLSRv2 interface, determine an MPR Set as specified in Section 18.3.
- A Neighbor Tuple represents a flooding MPR and has
N_flooding_mpr := true(otherwise,N_flooding_mpr := false) if and only if that Neighbor Tuple corresponds to an element in an MPR Set created for any interface as described above. That means the overall set of flooding MPRs is the union of the sets of flooding MPRs for all OLSRv2 interfaces. Main character energy ๐
A router MAY select its flooding MPRs for each OLSRv2 interface independently, or it MAY coordinate its MPR selections across its OLSRv2 interfaces, as long as the required condition is satisfied for each OLSRv2 interface. One coordinated approach is to process the OLSRv2 interfaces one at a time and, for each interface, start with flooding MPRs selected (and not removable) if the neighbor has already been selected as an MPR for an OLSRv2 interface that has already been processed. The algorithm specified in Appendix B can be used in this way ๐ง
18.5. Routing MPRs ๐
Whenever routing MPRs need to be calculated, an implementation MUST determine and record a set of routing MPRs that is equivalent to one calculated as described in this section. Same energy as before, bestie ๐ซถ
Define a single Neighbor Graph as defined in Section 18.2, following these rules:
- Define a reachable Neighbor Tuple to be a Neighbor Tuple with
N_symmetric = trueandN_in_metric != UNKNOWN_METRIC. - Define an allowed Neighbor Tuple to be a reachable Neighbor Tuple with
N_will_routing > WILL_NEVER. - Define an allowed 2-Hop Tuple to be a 2-Hop Tuple in the 2-Hop Set for any OLSRv2 interface with
N2_in_metric != UNKNOWN_METRICand for which there is an allowed Neighbor Tuple withN_neighbor_addr_listcontainingN2_neighbor_iface_addr_list. - Define an element of N1 for each allowed Neighbor Tuple. This then defines the corresponding Neighbor Tuple for each element of N1.
- For each element
xin N1, defineW(x) := N_will_routingof the corresponding Neighbor Tuple. - For each element
xin N1, defined1(x) := N_in_metricof the corresponding Neighbor Tuple. - Define an element of N2 for each network address that is the
N2_2hop_addrof one or more allowed 2-Hop Tuples. This then defines the corresponding address for each element of N2. - For each element
yin N2, if the corresponding address is in theN_neighbor_addr_listof a reachable Neighbor Tuple, then defined1(y)to be theN_in_metricof that Neighbor Tuple; otherwise,d1(y)is not defined. - For each element
xin N1, defineN2(x)as the set of elementsyin N2 whose corresponding address is theN2_2hop_addrof an allowed 2-Hop Tuple that hasN2_neighbor_iface_addr_listcontained inN_neighbor_addr_listof the Neighbor Tuple corresponding tox. For all suchxandy, defined2(x,y) := N2_out_metricof that 2-Hop Tuple.
It is up to an implementation to decide how to label each element of N1 or N2. For example, an element of N1 may be labeled with one or more addresses from the corresponding N_neighbor_addr_list, or with a pointer or reference to the corresponding Neighbor Tuple. Labels are yours to choose ๐
Using these Neighbor Graphs, routing MPRs are selected and recorded according to the following:
- Determine an MPR Set as specified in Section 18.3.
- A Neighbor Tuple represents a routing MPR and has
N_routing_mpr := true(otherwise,N_routing_mpr := false) if and only if that Neighbor Tuple corresponds to an element in the MPR Set created as described above.
18.6. Calculating MPRs ๐
A router MUST recalculate each of its sets of MPRs whenever the currently selected set of MPRs does not still satisfy the required conditions. It MAY recalculate its MPRs if the current set is still valid but could be more efficient. Sufficient conditions to recalculate a router's sets of MPRs are given in Section 17.6. Recalc when needed, not vibes-only ๐ญ
19. Routing Set Calculation ๐ฆ
The Routing Set of a router is populated with Routing Tuples that represent paths from that router to all destinations in the network. These paths are calculated based on the Network Topology Graph, which is constructed from information in the Information Bases, obtained via HELLO and TC message exchange. Basically the whole network map, sorted out for you โจ
Changes to the Routing Set do not require any messages to be transmitted. The state of the Routing Set SHOULD, however, be reflected in the IP routing table by adding and removing entries from that routing table as appropriate. Only appropriate Routing Tuples (in particular only those that represent local links or paths to routable addresses) need be reflected in the IP routing table. So not every tuple has to make it into the routing table, just the right ones ๐
19.1. Network Topology Graph โจ
okay so the Network Topology Graph gets built from the router's Local Interface Set, the Link Sets for OLSRv2 interfaces, the Neighbor Set, the Router Topology Set, the Routable Address Topology Set, and the Attached Network Set. it MAY also use info from the router's 2-Hop Sets for OLSRv2 interfaces ๐ง this graph is the router's whole view of the network as a directed graph, and every edge in it has a metric value ๐ the "backbone" is where the minimum total metric routes get constructed, and it's got these edges:
- Edges
X -> Yfor all possibleY, with oneXperY, such that:Yis theN_orig_addrof a Neighbor Tuple; ANDN_orig_addris not unknown; ANDXis in theI_local_iface_addr_listof a Local Interface Tuple; AND- There is a Link Tuple with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRICsuch that this Neighbor Tuple and this Local Interface Tuple correspond to it. A network address fromL_neighbor_iface_addr_listwill be denotedRin this case.
It SHOULD be preferred, where possible, to select R = Y and to select X from the Local Interface Tuple corresponding to the Link Tuple from which R was selected. The metric for such an edge is the corresponding N_out_metric.
- All edges
W -> Usuch that:Wis theTR_from_orig_addrof a Router Topology Tuple; ANDUis theTR_to_orig_addrof the same Router Topology Tuple.
The metric of such an edge is the corresponding TR_metric.
the Network Topology Graph also gets extra "decorations" ๐ with the edges below. quick warning, bestie: if a network address S, V, Z, or T equals a network address Y or W, then the edge ending at that address MUST NOT be used in any path. no exceptions ๐
โโ๏ธ
If a network addressS,V,Z, orTequals a network addressYorW, the edge terminating in that address MUST NOT be used in any path.
- Edges
X -> Sfor all possibleS, with oneXperS, such that:Sis in theN_neighbor_addr_listof a Neighbor Tuple; ANDXis in theI_local_iface_addr_listof a Local Interface Tuple; AND- There is a Link Tuple with
L_status = SYMMETRICandL_out_metric != UNKNOWN_METRICsuch that this Neighbor Tuple and this Local Interface Tuple correspond to it. A network address fromL_neighbor_iface_addr_listwill be denotedRin this case.
It SHOULD be preferred, where possible, to select R = S and to select X from the Local Interface Tuple corresponding to the Link Tuple from which R was selected. The metric for such an edge is the corresponding N_out_metric.
- All edges
W -> Vsuch that:Wis theTA_from_orig_addrof a Routable Address Topology Tuple; ANDVis theTA_dest_addrof the same Routable Address Topology Tuple.
The metric for such an edge is the corresponding TA_metric.
- All edges
W -> Tsuch that:Wis theAN_orig_addrof an Attached Network Tuple; ANDTis theAN_net_addrof the same Attached Network Tuple.
The metric for such an edge is the corresponding AN_metric.
- (OPTIONAL) All edges
Y -> Zsuch that:Zis a routable address and is theN2_2hop_addrof a 2-Hop Tuple withN2_out_metric != UNKNOWN_METRIC; ANDYis theN_orig_addrof the corresponding Neighbor Tuple; AND- This Neighbor Tuple has
N_will_routingnot equal toWILL_NEVER.
A path terminating with such an edge MUST NOT be used in preference to any other path. The metric for such an edge is the corresponding N2_out_metric.
ok last bits, and these matter ๐ซถ any part of the Topology Graph that isn't connected to a local network address X just gets ignored ๐ only one selection X SHOULD be made from each I_local_iface_addr_list, and only one selection R SHOULD be made from any L_neighbor_iface_addr_list. every edge has a hop count of 1, except the edges W -> T, which have a hop count of the matching AN_dist value ๐
19.2. Populating the Routing Set
the Routing Set MUST contain the shortest paths for all destinations from all local OLSRv2 interfaces, calculated over the Network Topology Graph ๐ this calculation MAY use any algorithm, including any way of picking between paths with equal total metric. (quick aside: if two paths have equal total metric but different hop counts, the path with the lower hop count SHOULD be used โจ)
so the order goes like this: first you build the "backbone" paths using only X -> Y and W -> U edges, using a minimum distance algorithm. then you can add paths whose final edge is one of the other types. those extra paths MUST NOT replace backbone paths with the same destination, and paths ending in an edge Y -> Z SHOULD NOT replace paths with any other form of terminating edge ๐
every path turns into a Routing Tuple, and there are two types. the first type covers single edge paths, meaning X -> S or X -> Y, and it looks like this:
R_local_iface_addr := X;R_next_iface_addr := R;R_dest_addr := S or Y;R_dist := 1;R_metric := edge metric,
where R is defined in Section 19.1 for these edge types โจ
the second type covers multiple edge paths. these always start with an X -> Y edge, and they finish with an edge of type W -> U, W -> V, W -> T, or Y -> Z. the Routing Tuple is:
R_local_iface_addr := X;R_next_iface_addr := Y;R_dest_addr := U, V, T or Z;R_dist := the total hop count of all edges in the path;R_metric := the total metric of all edges in the path.
last one: Routing Tuples of the second type whose R_dest_addr is not routable MAY be discarded ๐งน and if you want an example algorithm for calculating a router's Routing Set, it's in Appendix C ๐ฆ
20. Proposed Values for Parameters ๐
this protocol uses all the parameters defined in [RFC6130], plus extra ones defined in this specification ๐ all of these extra parameters are router parameters as defined in [RFC6130] except one, RX_HOLD_TIME. the proposed values for the extra parameters in the following sections are the right ones for when every parameter (including the [RFC6130] ones) has a single value. proposed values for [RFC6130] parameters live in that spec, so go check there ๐
the following proposed values come from experience with [RFC3626] deployments (like the ones documented in [McCabe]) and they're considered typical ๐ซง you can change them for different deployment needs. for example, a network with capacity-limited interfaces would be expected to use bigger message intervals, whereas a super mobile network would be expected to use smaller ones ๐โโ๏ธ when you're picking these values, the constraints in Section 5 MUST be respected, no skipping ๐ฅ
also, routers in a MANET don't all need the same parameters, and the ones marked as interface parameters don't need to match across all OLSRv2 interfaces on a single router ๐
20.1. Local History Time Parameters
O_HOLD_TIME := 30 seconds
20.2. Message Interval Parameters
TC_INTERVAL := 5 secondsTC_MIN_INTERVAL := TC_INTERVAL/4
20.3. Advertised Information Validity Time Parameters
T_HOLD_TIME := 3 x TC_INTERVALA_HOLD_TIME := T_HOLD_TIME
20.4. Received Message Validity Time Parameters
RX_HOLD_TIME := 30 secondsP_HOLD_TIME := 30 secondsF_HOLD_TIME := 30 seconds
20.5. Jitter Time Parameters
TP_MAXJITTER := HP_MAXJITTERTT_MAXJITTER := HT_MAXJITTERF_MAXJITTER := TT_MAXJITTER
20.6. Hop Limit Parameter
TC_HOP_LIMIT := 255
20.7. Willingness Parameters
WILL_FLOODING := WILL_DEFAULTWILL_ROUTING := WILL_DEFAULT
21. Sequence Numbers ๐ธ
sequence numbers are how this protocol tosses out "old" info, aka messages that show up out of order ๐ฌ but there's a catch: with only a limited number of bits, wraparound happens, meaning the number goes from the max value back to zero ๐ญ so to stop that from messing things up, the following MUST be observed when working out the ordering of sequence numbers ๐
the term MAXVALUE means one more than the largest possible value for a sequence number. for a 16-bit sequence number (like the ones defined in this spec), MAXVALUE is 65536 ๐งฎ
sequence number S1 is "greater than" sequence number S2 if:
S1 > S2 AND S1 - S2 < MAXVALUE/2, OR
S2 > S1 AND S2 - S1 > MAXVALUE/2
when S1 and S2 differ by MAXVALUE/2, their ordering can't be figured out. in that case (which shouldn't happen!) either ordering may be assumed ๐
so even with wraparound, comparing two messages still tells you which one has the most recent info ๐
22. Extensions ๐ง
an extension to this protocol will need to interact with this specification and maybe with [RFC6130] too ๐ฆ this protocol was designed to allow those interactions, specifically:
- Through accessing, and possibly extending, the information in the Information Bases. All updates to the elements specified in this specification are subject to the normative constraints specified in [RFC6130] and Appendix A. Note that the processing specified in this document ensures that these constraints are satisfied.
- Through accessing an outgoing message before it's transmitted over any OLSRv2 interface, and adding information to it as specified in [RFC5444]. This MAY include Message TLVs and/or network addresses with associated Address Block TLVs. (Network addresses without new associated TLVs SHOULD NOT be added to messages.) This might, for example, let a security protocol, as suggested in Section 23, add a TLV containing a cryptographic signature to the message ๐
- Through accessing an incoming message and potentially discarding it before this protocol processes it. This might, for example, let a security protocol, as suggested in Section 23, verify message signatures and stop unverifiable messages from being processed and/or forwarded by this protocol ๐ก๏ธ
- Through accessing an incoming message after this protocol has fully processed it. In particular, this may let a protocol that has added information (by including appropriate TLVs or network addresses associated with new TLVs) access that information after the updates have been recorded in the Information Bases in this protocol ๐
- Through requesting that a message be generated at a specific time. In that case, message generation MUST still respect the constraints in [RFC6130] and Section 5.4.3 โฐ
23. Security Considerations ๐
okay bestie, this one's serious ๐ญ as a proactive routing protocol, OLSRv2 is a potential target for all kinds of attacks ๐จ this section lays out the envisioned security architecture for OLSRv2 and gives guidelines on how to get integrity, confidentiality, and integration into external routing domains ๐ it also summarizes the separately specified mandatory security mechanisms and shares some observations on key management ๐๏ธ the security stuff is literally the main character here, so read it carefully ๐
23.1. Security Architecture ๐ฐ
okay so OLSRv2 slots right into the architecture from Appendix A of [RFC5444], plus [RFC5498], plus Section 16 of [RFC6130], and that last one works by using and extending its messages and Information Bases ๐
NHDP [RFC6130] and OLSRv2 both know there can be outside reasons to reject messages that count as "badly formed" or "insecure" ๐ like when an Integrity Check Value (ICV) that some external mechanism put in a message can't be verified. The architecture gives you options on whether and how to do security stuff, because MANET deployments have wildly different security needs, from "practically unbreakable" ๐ all the way down to "virtually none" ๐ So the protocol specs stay generic, and you add extensions to them and/or to the multiplexing and demultiplexing process from Appendix A of [RFC5444] to get the security that fits your deployment domain โจ
The next sections give guidelines on how to provide integrity, confidentiality, and integration with external routing domains in those extensions ๐ฆ
23.2. Integrity ๐
Every router puts topology info into the network by sending HELLO messages and, for some routers, TC messages too ๐ธ If some routers inject invalid control traffic, whether from malice or malfunction, the network's integrity can get wrecked ๐ญ So message, or packet, authentication is strongly advised ๐ซถ
Here's what that could look like:
- A router generates TC messages, advertising links to non-neighbor routers;
- A router generates TC messages, pretending to be another router;
- A router generates HELLO messages, advertising non-neighbor routers;
- A router generates HELLO messages, pretending to be another router;
- A router forwards altered control messages;
- A router does not forward control messages;
- A router does not select multipoint relays correctly;
- A router forwards broadcast control messages unaltered but does not forward unicast data traffic;
- A router "replays" previously recorded control traffic from another router.
Authenticating the originator router for control messages (for situations 2, 4, and 5) and the individual links announced in the control messages (for situations 1 and 3) can be used as a countermeasure ๐ก๏ธ BUT ๐ stopping routers from repeating old, correctly authenticated info (situation 9) needs extra stuff, like a timestamp or sequence number, so a router can spot replayed messages positively ๐ง
ICVs (e.g., digital signatures) and other required security info can ride inside the HELLO and TC messages, or in a packet header using the TLV mechanism ๐ Either way, different levels of protection can coexist in the same network if you want that ๐
Here's the big thing ๐ All control messages (HELLO and TC) go to every router in the 1-hop neighborhood, and some (TC messages) get flooded to every router in the network. That happens in a packet sent to everyone in the 1-hop neighborhood, and the current set of those routers might not even be known ๐ต So every control message or packet in this protocol is always inside a transmission aimed at multiple destinations, which means the authentication mechanism has to let any receiving router validate the authenticity of a message or packet ๐
[RFC7182] defines a common exchange format for cryptographic info as Packet TLVs, Message TLVs, and Address Block TLVs, as specified in [RFC5444] ๐ง Everyone can use (and share) these among MANET routing protocol security extensions. Specifically, [RFC7182] gives the format of TLVs that hold Integrity Check Values (ICVs), i.e., signatures for integrity, plus TLVs with temporal info for preventing replay attacks โฐ It also sets up registries for different ciphers and formats of temporal info ๐
When you use ICV TLVs in an OLSRv2 deployment, failing to verify an included ICV means the incoming message or packet gets rejected as "invalid" ๐ซ That follows Section 12.1 of [RFC6130], and Section 16.3.1 of this specification when you're using the multiplexing and demultiplexing process from Appendix A of [RFC5444] ๐
[RFC7182] also covers how to insert ICVs into generated messages, how to verify incoming ones, and how to reject "insecure" messages, meaning ones with no ICV or an ICV that can't be verified ๐ โโ๏ธ Different MANET deployments might need different ICV algorithms and timestamps, or multiple keys, depending on what they're for and how they can be configured ๐ So a security extension can use any of the options in [RFC7182] that it needs ๐งโโ๏ธ
23.3. Confidentiality ๐คซ
OLSRv2 periodically MPR floods topological info to every router in the network ๐ก So if you use it on an unprotected network (especially an unprotected wireless one), anyone who listens to the control messages can see the network topology ๐ That info can help an attacker learn the topology and then launch stronger attacks on routers in the routing domain, like spoofing router addresses to pull in traffic for them ๐ฑ Also, this is separate from data traffic. It only protects the control traffic, i.e., the info about network topology ๐ฆ
When the confidentiality of the topology really matters, regular crypto techniques can be applied ๐ For example, OLSRv2 multicast control packets can be encrypted using IPsec (e.g., with a shared secret key), so only authorized readers can read and interpret the control traffic ๐ Or a security extension can specify its own mechanism for confidentiality of control messages and/or packets ๐ ๏ธ
Unless the network topology info itself is confidential, integrity of control messages (as specified in Section 23.2) is enough to let in only trusted routers (i.e., routers with valid credentials) ๐ซถ
23.4. Interaction with External Routing Domains ๐
This protocol has a basic mechanism for injecting external routing info into its own routing domain ๐ช Routing info can also be pulled out of this protocol's Information Bases, especially the Routing Set, and injected into an external routing domain, as long as the protocol governing that external domain allows it โจ
When you run routers that connect a routing domain using this protocol to an external one, you MUST take care not to let potentially insecure and untrustworthy info get injected from this domain into the external one ๐จ You MUST also take care to validate the correctness of info before it's injected, so you don't pollute routing tables with invalid info ๐
A recommended way to extend connectivity from an external routing domain into this one, which is routed using this protocol, is to assign an IP prefix exclusively to this domain ๐ That prefix is assigned under the authority of the routers/gateways connecting the two domains, and those gateways are configured to advertise routes for that IP prefix into the external routing domain ๐ธ
23.5. Mandatory Security Mechanisms ๐ก๏ธ
A conformant implementation of OLSRv2 MUST, at minimum, implement the security mechanisms specified in [RFC7183] ๐ That gives integrity and replay protection for OLSRv2 control messages, including the HELLO messages specified by [RFC6130] and used by OLSRv2, using a timestamp TLV and an Integrity Check Value (ICV) TLV ๐ This ICV TLV uses a SHA-256-based HMAC and one or more manually managed shared secret keys ๐ The timestamp TLV is based on Portable Operating System Interface (POSIX) time, assuming router time synchronization โฐ
The baseline use case is short-lived OLSRv2 deployments (for example, up to a couple of months). For those, this security mechanism gives adequate integrity protection without rekeying ๐ฆ
Any OLSRv2 deployment SHOULD use the security mechanism specified in [RFC7183] ๐ It MAY use another mechanism if that's more appropriate for the OLSRv2 deployment ๐ For example, for longer-term OLSRv2 deployments, alternative security mechanisms (e.g., rekeying) SHOULD be considered ๐ง
23.6. Key Management โจ
okay so this one's about key management, and the spec is like "we are NOT making automated key management (AKM) mandatory for OLSRv2 ๐ โโ๏ธ." that goes for this spec and [RFC7183] too. AKM might be needed for some OLSRv2 use cases, but the baseline assumption is that a lot of them don't need it, and here's why ๐
Bootstrapping a key is hard in a radio network ๐ก Generally you can't tell where a received signal came from, or whether two transmissions are from the same source or different ones. It's giving chaos ๐ญ
Radio networks and mobile phone networks already work because (i) secret info gets baked into phones at manufacture, and (ii) a centralized database of that info is reachable for the whole life of the network ๐ซถ
BUT a primary use case of a MANET is connectivity without centralized entities and with minimal management ๐ฆ So a setup like the one in the paragraph above is just not feasible. A cryptographic authority might not even exist in the MANET, since it would be too vulnerable ๐ And because the topology of a MANET can change a lot, a cryptographic authority could become unreachable (for some or all of the MANET routers) with zero warning ๐ฉ
[BCP107] has guidelines for cryptographic key management โจ Section 2.1 covers when AKM is required, and Section 2.2 covers when manual key management is acceptable.
Section 2.1 of [BCP107] says "Automated key management MUST be used if any of [a set of given] conditions hold". Here are those conditions, with how each one applies to the baseline OLSRv2 use case ๐
- A party will have to manage n^2 static keys, where n may become large.
The baseline OLSRv2 use case only uses one shared secret, or a small set of manually managed ones, across the whole MANET. So not a problem ๐ธ
- Any stream cipher (such as RC4 [RFC6229][RC4], AES-CTR [RFC3610][NIST-SP-800-38A], or AES-CCM [RFC3686][NIST-SP-800-38C]) is used.
A stream cipher isn't planned for generating ICVs for OLSRv2 control messages ๐
- An initialization vector (IV) might be reused, especially an implicit IV. Note that random or pseudo-random explicit IVs are not a problem unless the probability of repetition is high.
An IV isn't planned for generating ICVs for OLSRv2 control messages either ๐ง
- Large amounts of data might need to be encrypted in a short time, causing frequent change of the short-term session key.
Integrity Check Values (ICVs) are only needed for OLSRv2 control messages, and those are low-volume messages ๐
- Long-term session keys are used by more than two parties. Multicast is a necessary exception, but multicast key management standards are emerging in order to avoid this in the future. Sharing long-term session keys should generally be discouraged.
All OLSRv2 control messages are sent using link-local multicast ๐ฃ
- The likely operational environment is one where personnel (or device) turnover is frequent, causing frequent change of the short-term session key.
This isn't an intended deployment of OLSRv2. For longer-term OLSRv2 deployments, alternative security mechanisms (e.g., including rekeying) SHOULD be considered ๐ฅ
Section 2.2 of [BCP107] says "Manual key management may be a reasonable approach in any of [a given set of] situations". Here are those situations and how they apply to the baseline OLSRv2 use case ๐
- The environment has very limited available bandwidth or very high round-trip times. Public key systems tend to require long messages and lots of computation; symmetric key alternatives, such as Kerberos, often require several round trips and interaction with third parties.
Like we said before, there may not be the required infrastructure (a cryptographic authority) in the MANET, or if there is one, it might not be reachable ๐ญ Bandwidth in a MANET is usually limited, both because it's a radio environment and because any signaling has to eat up only a minimal proportion of it. Round trip times can also be significant โณ
- The information being protected has low value.
This depends on the OLSRv2 use case, but the info being protected is OLSRv2 control traffic, which has at least moderate value. So this case does not apply ๐ โโ๏ธ
- The total volume of traffic over the entire lifetime of the long-term session key will be very low.
ICVs are only needed for OLSRv2 control messages, which are low-volume messages ๐
- The scale of each deployment is very limited.
A typical OLSRv2 use case might only involve tens of devices, and even the biggest ones are small by Internet standards ๐
24. IANA Considerations โจ
This spec defines one Message Type, which was allocated from the "Message Types" registry of [RFC5444]. It also defines two Message TLV Types, allocated from the "Message TLV Types" registry of [RFC5444], and four Address Block TLV Types, allocated from the "Address Block TLV Types" registry of [RFC5444] ๐
24.1. Expert Review: Evaluation Guidelines
For the registries that need an Expert Review, the designated expert SHOULD take the same general recommendations into consideration as the ones specified by [RFC5444] ๐ง
24.2. Message Types
This spec defines one Message Type, allocated from the 0-223 range of the "Message Types" namespace defined in [RFC5444], as specified in Table 8 ๐
+------+----------------------------------------------+
| Type | Description |
+------+----------------------------------------------+
| 1 | TC : Topology Control (MANET-wide signaling) |
+------+----------------------------------------------+
Table 8: Message Type Assignment
24.3. Message-Type-Specific TLV Type Registries
IANA made a registry for Message-Type-specific Message TLVs for TC messages, following Section 6.2.1 of [RFC5444], with initial assignments and allocation policies as specified in Table 9 ๐ฆ
+---------+-------------+-------------------+
| Type | Description | Allocation Policy |
+---------+-------------+-------------------+
| 128-223 | Unassigned | Expert Review |
+---------+-------------+-------------------+
Table 9: TC Message-Type-Specific Message TLV Types
IANA also made a registry for Message-Type-specific Address Block TLVs for TC messages, following Section 6.2.1 of [RFC5444], with initial assignments and allocation policies as specified in Table 10 ๐
+---------+-------------+-------------------+
| Type | Description | Allocation Policy |
+---------+-------------+-------------------+
| 128-223 | Unassigned | Expert Review |
+---------+-------------+-------------------+
Table 10: TC Message-Type-Specific Address Block TLV Types
24.4. Message TLV Types
This spec defines two Message TLV Types, allocated from the "Message TLV Types" namespace defined in [RFC5444]. IANA made allocations in the 0-127 range for these types. Two new Type Extension registries were created, with assignments as specified in Table 11 and Table 12. The specs for these TLVs are in Section 13.3.1. Each of these TLVs MUST NOT be included more than once in a Message TLV Block ๐ซ
+-------------+------+-----------+---------------------+------------+
| Name | Type | Type | Description | Allocation |
| | | Extension | | Policy |
+-------------+------+-----------+---------------------+------------+
| MPR_WILLING | 7 | 0 | Bits 0-3 specify | |
| | | | the originating | |
| | | | router's | |
| | | | willingness to act | |
| | | | as a flooding MPR; | |
| | | | bits 4-7 specify | |
| | | | the originating | |
| | | | router's | |
| | | | willingness to act | |
| | | | as a routing MPR. | |
| MPR_WILLING | 7 | 1-255 | Unassigned. | Expert |
| | | | | Review |
+-------------+------+-----------+---------------------+------------+
Table 11: Message TLV Type Assignment: MPR_WILLING
+--------------+------+-----------+--------------------+------------+
| Name | Type | Type | Description | Allocation |
| | | Extension | | Policy |
+--------------+------+-----------+--------------------+------------+
| CONT_SEQ_NUM | 8 | 0 | COMPLETE: | |
| | | | Specifies a | |
| | | | content sequence | |
| | | | number for this | |
| | | | complete message. | |
| CONT_SEQ_NUM | 8 | 1 | INCOMPLETE: | |
| | | | Specifies a | |
| | | | content sequence | |
| | | | number for this | |
| | | | incomplete | |
| | | | message. | |
| CONT_SEQ_NUM | 8 | 2-255 | Unassigned. | |
| | | | | Expert |
| | | | | Review |
+--------------+------+-----------+--------------------+------------+
Table 12: Message TLV Type Assignment: CONT_SEQ_NUM
Type extensions marked as Expert Review SHOULD be allocated as described in [RFC5444], based on Expert Review as defined in [RFC5226] ๐
24.5. Address Block TLV Types ๐
Okay bestie, this part is all about the four Address Block TLV Types ๐ฆ They were grabbed from the "Address Block TLV Types" namespace that [RFC5444] set up, and IANA gave them numbers in the 8-127 range. There are also four new Type Extension registries, with the assignments in Tables 13, 14, 15, and 16. The full specs for these TLVs live in Section 13.3.2 โจ
The registration procedure for the "LINK_METRIC Address Block TLV Type Extensions" registry is Expert Review ๐
+-------------+------+-----------+----------------------------------+
| Name | Type | Type | Description |
| | | Extension | |
+-------------+------+-----------+----------------------------------+
| LINK_METRIC | 7 | 0 | Link metric meaning assigned by |
| | | | administrative action. |
| LINK_METRIC | 7 | 1-223 | Unassigned. |
| LINK_METRIC | 7 | 224-255 | Reserved for Experimental Use |
+-------------+------+-----------+----------------------------------+
Table 13: Address Block TLV Type Assignment: LINK_METRIC
Okay so every LINK_METRIC TLV, no matter what its type extension is, MUST use its value field to encode the kind and value of a link metric ๐ฅ The value has to sit somewhere in the interval MINIMUM_METRIC to MAXIMUM_METRIC (inclusive), and Sections 6 and 13.3.2 explain how. Also, whoever assigns a LINK_METRIC TLV type extension MUST specify the physical meaning of that link metric, plus how that meaning maps onto the representable values in the interval. It's giving precision ๐
+------+------+-----------+----------------------------+------------+
| Name | Type | Type | Description | Allocation |
| | | Extension | | Policy |
+------+------+-----------+----------------------------+------------+
| MPR | 8 | 0 | Specifies that a given | |
| | | | network address is of a | |
| | | | router selected as a | |
| | | | flooding MPR (FLOODING = | |
| | | | 1), that a given network | |
| | | | address is of a router | |
| | | | selected as a routing MPR | |
| | | | (ROUTING = 2), or both | |
| | | | (FLOOD_ROUTE = 3). | |
| MPR | 8 | 1-255 | Unassigned. | Expert |
| | | | | Review |
+------+------+-----------+----------------------------+------------+
Table 14: Address Block TLV Type Assignment: MPR
+---------------+------+-----------+-------------------+------------+
| Name | Type | Type | Description | Allocation |
| | | Extension | | Policy |
+---------------+------+-----------+-------------------+------------+
| NBR_ADDR_TYPE | 9 | 0 | Specifies that a | |
| | | | given network | |
| | | | address is of a | |
| | | | neighbor reached | |
| | | | via the | |
| | | | originating | |
| | | | router, if it is | |
| | | | an originator | |
| | | | address | |
| | | | (ORIGINATOR = 1), | |
| | | | is a routable | |
| | | | address (ROUTABLE | |
| | | | = 2), or if it is | |
| | | | both | |
| | | | (ROUTABLE_ORIG = | |
| | | | 3). | |
| NBR_ADDR_TYPE | 9 | 1-255 | Unassigned. | Expert |
| | | | | Review |
+---------------+------+-----------+-------------------+------------+
Table 15: Address Block TLV Type Assignment: NBR_ADDR_TYPE
+---------+------+-----------+-------------------------+------------+
| Name | Type | Type | Description | Allocation |
| | | extension | | Policy |
+---------+------+-----------+-------------------------+------------+
| GATEWAY | 10 | 0 | Specifies that a given | |
| | | | network address is | |
| | | | reached via a gateway | |
| | | | on the originating | |
| | | | router, with value | |
| | | | equal to the number of | |
| | | | hops. | |
| GATEWAY | 10 | 1-255 | | Expert |
| | | | | Review |
+---------+------+-----------+-------------------------+------------+
Table 16: Address Block TLV Type Assignment: GATEWAY
Any type extension marked Expert Review SHOULD be allocated the way [RFC5444] describes, based on Expert Review as defined in [RFC5226] ๐ซถ
24.6. NBR_ADDR_TYPE and MPR Values ๐
Note: This section does not require any IANA action, since the info it needs is already in the descriptions of the MPR and NBR_ADDR_TYPE Address Block TLVs allocated in Section 24.5. It's recorded here just for clarity and so it can be used elsewhere in this specification ๐ง
The values the MPR Address Block TLV can use are:
FLOODING := 1;ROUTING := 2;FLOOD_ROUTE := 3.
The values the NBR_ADDR_TYPE Address Block TLV can use are:
ORIGINATOR := 1;ROUTABLE := 2;ROUTABLE_ORIG := 3.
25. Contributors ๐ฏ
This specification is the result of the joint efforts of the following contributors, listed alphabetically ๐
- Cedric Adjih, INRIA, France, <Cedric.Adjih@inria.fr>
- Emmanuel Baccelli, INRIA , France, <Emmanuel.Baccelli@inria.fr>
- Thomas Heide Clausen, LIX, France, <T.Clausen@computer.org>
- Justin Dean, NRL, USA, <jdean@itd.nrl.navy.mil>
- Christopher Dearlove, BAE Systems, UK, <chris.dearlove@baesystems.com>
- Ulrich Herberg, Fujitsu Laboratories of America, USA, <ulrich@herberg.name>
- Satoh Hiroki, Hitachi SDL, Japan, <hiroki.satoh.yj@hitachi.com>
- Philippe Jacquet, Alcatel Lucent Bell Labs, France, <philippe.jacquet@alcatel-lucent.fr>
- Monden Kazuya, Hitachi SDL, Japan, <kazuya.monden.vw@hitachi.com>
- Kenichi Mase, Niigata University, Japan, <mase@ie.niigata-u.ac.jp>
- Ryuji Wakikawa, Toyota, Japan, <ryuji@sfc.wide.ad.jp>
26. Acknowledgments ๐ธ
The authors want to shout out the team behind OLSRv1, as listed in RFC 3626, including Anis Laouiti (INT), Pascale Minet (INRIA), Paul Muhlethaler (INRIA), Amir Qayyum (M.A. Jinnah University), and Laurent Viennot (INRIA) for their contributions ๐
The authors also want to thank the following people for intense technical discussions, early reviews, and comments on the specification and its components (listed alphabetically): Khaldoun Al Agha (LRI), Teco Boot (Infinity Networks), Ross Callon (Juniper), Song-Yean Cho (Samsung), Alan Cullen (BAE Systems), Louise Lamont (CRC), Li Li (CRC), Joseph Macker (NRL), Richard Ogier (SRI), Charles E. Perkins (Futurewei), Henning Rogge (Frauenhofer FKIE), and the entire IETF MANET Working Group ๐
Finally, the authors are so grateful to the Area Directors for their valuable review comments during the IESG evaluation, in particular (listed alphabetically) Benoit Claise, Adrian Farrel, Stephen Farrell, Barry Leiba, Pete Resnick, and Martin Stiemerling ๐
27. References ๐
27.1. Normative References
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
- [RFC5148] Clausen, T., Dearlove, C., and B. Adamson, "Jitter Considerations in Mobile Ad Hoc Networks (MANETs)", RFC 5148, February 2008.
- [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.
- [RFC5444] Clausen, T., Dearlove, C., Dean, J., and C. Adjih, "Generalized Mobile Ad Hoc Network (MANET) Packet/Message Format", RFC 5444, February 2009.
- [RFC5497] Clausen, T. and C. Dearlove, "Representing Multi-Value Time in Mobile Ad Hoc Networks (MANETs)", RFC 5497, March 2009.
- [RFC5498] Chakeres, I., "IANA Allocations for Mobile Ad Hoc Network (MANET) Protocols", RFC 5498, March 2009.
- [RFC6130] Clausen, T., Dearlove, C., and J. Dean, "Mobile Ad Hoc Network (MANET) Neighborhood Discovery Protocol (NHDP)", RFC 6130, April 2011.
- [RFC7182] Herberg, U., Clausen, T., and C. Dearlove, "Integrity Check Value and Timestamp TLV Definitions for Mobile Ad Hoc Networks (MANETs)", RFC 7182, April 2014.
- [RFC7183] Herberg, U., Dearlove, C., and T. Clausen, "Integrity Protection for the Neighborhood Discovery Protocol (NHDP) and Optimized Link State Routing Protocol Version 2 (OLSRv2)", RFC 7183, April 2014.
27.2. Informative References
okay so bestie, this is the reading list for the stuff that's helpful but not required to implement OLSRv2 ๐ โจ
[BCP107] Bellovin, S. and R. Housley, "Guidelines for Cryptographic Key Management", BCP 107, RFC 4107, June 2005.
[FSLS] Santivanez, C., Ramanathan, R., and I. Stavrakakis, "Making Link-State Routing Scale for Ad Hoc Networks", MobiHoc '01, Proceedings of the 2nd ACM International Symposium on Mobile Ad Hoc Networking & Computing, 2001.
[FSR] Pei, G., Gerla, M., and T. Chen, "Fisheye State Routing in Mobile Ad Hoc Networks", ICDCS Workshop on Wireless Networks and Mobile Computing, 2000.
[HIPERLAN] ETSI, "Radio Equipment and Systems (RES); HIgh PErformance Radio Local Area Network (HIPERLAN) Type 1; Functional Specification", ETSI 300-652, June 1996.
[HIPERLAN2] Jacquet, P., Minet, P., Muhlethaler, P., and N. Rivierre, "Increasing Reliability in Cable-Free Radio LANs: Low Level Forwarding in HIPERLAN", Wireless Personal Communications, Volume 4, Issue 1, 1997.
[MPR] Qayyum, A., Viennot, L., and A. Laouiti, "Multipoint relaying: An efficient technique for flooding in mobile wireless Networks", INRIA, No. 3898, March 2000.
[McCabe] McCabe, A., Dearlove, C., Fredin, M., and L. Axelsson, "Scalability modelling of ad hoc routing protocols - a comparison of OLSR and DSR", Scandinavian Wireless Adhoc Networks '04, 2004.
[NIST-SP-800-38A] National Institute of Standards and Technology, "Recommendation for Block Cipher Modes of Operation: Methods and Techniques", Special Publication 800-38A, December 2001.
[NIST-SP-800-38C] National Institute of Standards and Technology, "Recommendation for Block Cipher Modes of Operation: The CCM Mode for Authentication and Confidentiality", Special Publication 800-38C, May 2004.
[RC4] Schneier, B., "Applied Cryptography: Protocols, Algorithms, and Source Code in C", Second Edition, John Wiley and Sons, New York, 1996.
[RFC2501] Corson, M. and J. Macker, "Mobile Ad hoc Networking (MANET): Routing Protocol Performance Issues and Evaluation Considerations", RFC 2501, January 1999.
[RFC3610] Whiting, D., Housley, R., and N. Ferguson, "Counter with CBC-MAC (CCM)", RFC 3610, September 2003.
[RFC3626] Clausen, T. and P. Jacquet, "Optimized Link State Routing Protocol (OLSR)", RFC 3626, October 2003.
[RFC3686] Housley, R., "Using Advanced Encryption Standard (AES) Counter Mode With IPsec Encapsulating Security Payload (ESP)", RFC 3686, January 2004.
[RFC6229] Strombergson, J. and S. Josefsson, "Test Vectors for the Stream Cipher RC4", RFC 6229, May 2011.
Appendix A. Constraints ๐
okay this is the rulebook for the data stores ๐ง the Local Information Base, the Neighborhood Information Base, and the Topology Information Base. ANY update to them MUST keep every constraint in here (plus the ones in [RFC6130]) happy. this is true for the processing in this document, and ANY protocol extension or outside process that touches the NIB or TIB MUST ALSO keep these constraints maintained. no exceptions, bestie ๐ญ
In each Originator Tuple:
- O_orig_addr MUST NOT equal any other O_orig_addr.
- O_orig_addr MUST NOT equal this router's originator address.
In each Local Attached Network Tuple:
- AL_net_addr MUST NOT equal any other AL_net_addr.
- AL_net_addr MUST NOT equal or be a sub-range of any network address in the I_local_iface_addr_list of any Local Interface Tuple.
- AL_net_addr MUST NOT equal this router's originator address or equal the O_orig_addr in any Originator Tuple.
- AL_dist MUST NOT be less than zero.
In each Link Tuple:
- L_neighbor_iface_addr_list MUST NOT contain any network address that AL_net_addr of any Local Attached Network Tuple equals or is a sub-range of.
- If L_in_metric != UNKNOWN_METRIC, then L_in_metric MUST be representable in the defined compressed form.
- If L_out_metric != UNKNOWN_METRIC, then L_out_metric MUST be representable in the defined compressed form.
- If L_mpr_selector = true, then L_status = SYMMETRIC.
In each Neighbor Tuple:
- N_orig_addr MUST NOT be changed to unknown.
- N_orig_addr MUST NOT equal this router's originator address or equal O_orig_addr in any Originator Tuple.
- N_orig_addr MUST NOT equal the AL_net_addr in any Local Attached Network Tuple.
- If N_orig_addr != unknown, then N_orig_addr MUST NOT equal the N_orig_addr in any other Neighbor Tuple.
- N_neighbor_addr_list MUST NOT contain any network address that includes this router's originator address, the O_orig_addr in any Originator Tuple, or equal or have as a sub-range the AL_net_addr in any Local Attached Network Tuple.
- If N_orig_addr = unknown, then N_will_flooding = WILL_NEVER, N_will_routing = WILL_NEVER, N_flooding_mpr = false, N_routing_mpr = false, N_mpr_selector = false, and N_advertised = false.
- N_in_metric MUST equal the minimum value of the L_in_metric values of all corresponding Link Tuples with L_status = SYMMETRIC and L_in_metric != UNKNOWN_METRIC, if any; otherwise, N_in_metric = UNKNOWN_METRIC.
- N_out_metric MUST equal the minimum value of the L_out_metric values of all corresponding Link Tuples with L_status = SYMMETRIC and L_out_metric != UNKNOWN_METRIC, if any; otherwise, N_out_metric = UNKNOWN_METRIC.
- N_will_flooding and N_will_routing MUST be in the range from WILL_NEVER to WILL_ALWAYS, inclusive.
- If N_flooding_mpr = true, then N_symmetric MUST be true, N_out_metric MUST NOT equal UNKNOWN_METRIC, and N_will_flooding MUST NOT equal WILL_NEVER.
- If N_routing_mpr = true, then N_symmetric MUST be true, N_in_metric MUST NOT equal UNKNOWN_METRIC, and N_will_routing MUST NOT equal WILL_NEVER.
- If N_symmetric = true and N_flooding_mpr = false, then N_will_flooding MUST NOT equal WILL_ALWAYS.
- If N_symmetric = true and N_routing_mpr = false, then N_will_routing MUST NOT equal WILL_ALWAYS.
- If N_mpr_selector = true, then N_advertised MUST be true.
- If N_advertised = true, then N_symmetric MUST be true and N_out_metric MUST NOT equal UNKNOWN_METRIC.
In each Lost Neighbor Tuple:
- NL_neighbor_addr MUST NOT include this router's originator address, the O_orig_addr in any Originator Tuple, or equal or have as a sub-range the AL_net_addr in any Local Attached Network Tuple.
In each 2-Hop Tuple:
- N2_2hop_addr MUST NOT equal this router's originator address, equal the O_orig_addr in any Originator Tuple, or equal or have as a sub-range the AL_net_addr in any Local Attached Network Tuple.
- If N2_in_metric != UNKNOWN_METRIC, then N2_in_metric MUST be representable in the defined compressed form.
- If N2_out_metric != UNKNOWN_METRIC, then N2_out_metric MUST be representable in the defined compressed form.
In each Advertising Remote Router Tuple:
- AR_orig_addr MUST NOT be in any network address in the I_local_iface_addr_list in any Local Interface Tuple or be in the IR_local_iface_addr in any Removed Interface Address Tuple.
- AR_orig_addr MUST NOT equal this router's originator address or equal the O_orig_addr in any Originator Tuple.
- AR_orig_addr MUST NOT be in the AL_net_addr in any Local Attached Network Tuple.
- AR_orig_addr MUST NOT equal the AR_orig_addr in any other Advertising Remote Router Tuple.
In each Router Topology Tuple:
- There MUST be an Advertising Remote Router Tuple with AR_orig_addr = TR_from_orig_addr.
- TR_to_orig_addr MUST NOT be in any network address in the I_local_iface_addr_list in any Local Interface Tuple or be in the IR_local_iface_addr in any Removed Interface Address Tuple.
- TR_to_orig_addr MUST NOT equal this router's originator address or equal the O_orig_addr in any Originator Tuple.
- TR_to_orig_addr MUST NOT be in the AL_net_addr in any Local Attached Network Tuple.
- The ordered pair (TR_from_orig_addr, TR_to_orig_addr) MUST NOT equal the corresponding pair for any other Router Topology Tuple.
- TR_seq_number MUST NOT be greater than AR_seq_number in the Advertising Remote Router Tuple with AR_orig_addr = TR_from_orig_addr.
- TR_metric MUST be representable in the defined compressed form.
In each Routable Address Topology Tuple:
- There MUST be an Advertising Remote Router Tuple with AR_orig_addr = TA_from_orig_addr.
- TA_dest_addr MUST be routable.
- TA_dest_addr MUST NOT overlap any network address in the I_local_iface_addr_list in any Local Interface Tuple or overlap the IR_local_iface_addr in any Removed Interface Address Tuple.
- TA_dest_addr MUST NOT include this router's originator address or include the O_orig_addr in any Originator Tuple.
- TA_dest_addr MUST NOT equal or have as a sub-range the AL_net_addr in any Local Attached Network Tuple.
- The ordered pair (TA_from_orig_addr, TA_dest_addr) MUST NOT equal the corresponding pair for any other Attached Network Tuple.
- TA_seq_number MUST NOT be greater than AR_seq_number in the Advertising Remote Router Tuple with AR_orig_addr = TA_from_orig_addr.
- TA_metric MUST be representable in the defined compressed form.
In each Attached Network Tuple:
- There MUST be an Advertising Remote Router Tuple with AR_orig_addr = AN_orig_addr.
- AN_net_addr MUST NOT equal or be a sub-range of any network address in the I_local_iface_addr_list in any Local Interface Tuple or equal or be a sub-range of the IR_local_iface_addr in any Removed Interface Address Tuple.
- AN_net_addr MUST NOT equal this router's originator address or equal the O_orig_addr in any Originator Tuple.
- The ordered pair (AN_orig_addr, AN_net_addr) MUST NOT equal the corresponding pair for any other Attached Network Tuple.
- AN_seq_number MUST NOT be greater than AR_seq_number in the Advertising Remote Router Tuple with AR_orig_addr = AN_orig_addr.
- AN_dist MUST NOT be less than zero.
- AN_metric MUST be representable in the defined compressed form.
Appendix B. Example Algorithm for Calculating MPRs ๐
okay so this part is an example algorithm for picking the MPR Set from a Neighbor Graph (see Section 18.2 and Section 18.3). it's totally allowed to use it, it MAY be used, but it's just one option ๐
this algorithm picks an MPR Set M that's a subset of the set N1 in the Neighbor Graph. it assumes a subset I of N1 is already pre-selected as MPRs, so M will contain I ๐ฆ
B.1. Additional Notation ๐งฎ
Okay so, on top of the notation from Section 18.2, this algorithm brings in a few extra definitions ๐
N: a subset ofN2, made of the elementsyinN2where eitherd1(y)is not defined, or there is at least onexinN1such thatd(x,y)is defined andd(x,y) < d1(y).D(x): for an elementxinN1, the number of elementsyinNfor whichd(x,y)is defined and has minimal value among thed(z,y)for allzinN1.R(x,M): for an elementxinN1, the number of elementsyinNfor whichd(x,y)is defined has minimal value among thed(z,y)for allzinN1, and no such minimal values havezinM. (Note that, denoting the empty set by0,D(x)=R(x,0).)
B.2. MPR Selection Algorithm ๐ธ
Here's how we build the MPR Set. We start with M := I and then work through these steps:
- Add all elements
xinN1that haveW(x) = WILL_ALWAYStoM. - For each element
yinNfor which there is only one elementxinN1such thatd2(x,y)is defined, add that elementxtoM. - While there exists any element
xinN1withR(x,M) > 0:- Select an element
xinN1withR(x,M) > 0in the following order of priority, and then add it toM:- greatest
W(x), THEN - greatest
R(x,M), THEN - greatest
D(x), THEN - any choice, which MAY be based on other criteria (for example, a router MAY choose to prefer a neighbor as an MPR if that neighbor has already selected the router as an MPR of the same type, MAY prefer a neighbor based on information freshness, or MAY prefer a neighbor based on length of time previously selected as an MPR) or MAY be random.
- greatest
- Select an element
- OPTIONAL: consider each element
xinM, but not inI, in turn. Ifxcan be removed fromMwhile still leaving it satisfying the definition of an MPR Set, then remove that elementxfromM. Elements MAY be considered in any order, e.g., in order of increasingW(x). ๐ฆ
Appendix C. Example Algorithm for Calculating the Routing Set โจ
The following procedure is given as an example for calculating the Routing Set using a variation of Dijkstra's algorithm. First, all Routing Tuples are removed. Then, using the selections and definitions in Appendix C.1, the procedures in the following sections (each considered a "stage" of the processing) are applied in turn. ๐
C.1. Local Interfaces and Neighbors ๐
The following selections and definitions are made:
- For each Local Interface Tuple, select a network address from its
I_local_iface_addr_list. This is defined as the selected address for this Local Interface Tuple. - For each Link Tuple, the selected address of its corresponding Local Interface Tuple is defined as the selected local address for this Link Tuple.
- For each Neighbor Tuple with
N_symmetric = trueandN_out_metric != UNKNOWN_METRIC, select a Link Tuple withL_status = SYMMETRICfor which this is the corresponding Neighbor Tuple and hasL_out_metric = N_out_metric. This is defined as the selected Link Tuple for this Neighbor Tuple. - For each network address (
N_orig_addror inN_neighbor_addr_list, the "neighbor address") from a Neighbor Tuple withN_symmetric = trueandN_out_metric != UNKNOWN_METRIC, select a Link Tuple (the "selected Link Tuple") from those for which this is the corresponding Neighbor Tuple, haveL_status = SYMMETRIC, and haveL_out_metric = N_out_metric, by:- If there is such a Link Tuple whose
L_neighbor_iface_addr_listcontains the neighbor address, select that Link Tuple. - Otherwise, select the selected Link Tuple for this Neighbor Tuple.
- If there is such a Link Tuple whose
Then, for this neighbor address:
- The selected local address is defined as the selected local address for the selected Link Tuple.
- The selected link address is defined as an address from the
L_neighbor_iface_addr_listof the selected Link Tuple, if possible equal to this neighbor address.
- Routing Tuple preference is decided by preference for minimum
R_metric, then for minimumR_dist, and then for preference for corresponding Neighbor Tuples in this order:- For greater
N_will_routing. - For
N_mpr_selector = trueoverN_mpr_selector = false.
- For greater
Note that preferred Routing Tuples SHOULD be used. Routing Tuples with minimum R_metric MUST be used; this is specified outside the definition of preference. An implementation MAY modify this definition of preference (including for minimum R_dist) without otherwise affecting this algorithm. ๐ฅ
C.2. Add Neighbor Routers ๐
The following procedure is executed once.
- For each Neighbor Tuple with
N_symmetric = trueandN_out_metric != UNKNOWN_METRIC, add a Routing Tuple with:R_dest_addr := N_orig_addr;R_next_iface_addr := selected link address for N_orig_addr;R_local_iface_addr := selected local address for N_orig_addr;R_metric := N_out_metric;R_dist := 1.
C.3. Add Remote Routers ๐ง
The following procedure is executed once.
- Add a label that may be "used" or "unused" to each Routing Tuple, with all initial values equal to unused. (Note that this label is only required during this algorithm.)
- If there are no unused Routing Tuples, then this stage is complete. Otherwise, repeat the following until that is the case:
- Find the unused Routing Tuple with minimum
R_metric(if more than one, pick any) and denote it the "current Routing Tuple". - Mark the current Routing Tuple as used.
- For each Router Topology Tuple, with
TR_from_orig_addr = R_dest_addrof the current Routing Tuple:- Define:
new_metric := R_metric of the current Routing Tuple + TR_metric;new_dist := R_dist of the current Routing Tuple + 1.
- If there is no Routing Tuple with
R_dest_addr = TR_to_orig_addr, then create an unused Routing Tuple with:R_dest_addr := TR_to_orig_addr;R_next_iface_addr := R_next_iface_addr of the current Routing Tuple;R_local_iface_addr := R_local_iface_addr of the current Routing Tuple;R_metric := new_metric;R_dist := new_dist.
- Otherwise, if there is an unused Routing Tuple with
R_dest_addr = TR_to_orig_addr, and eithernew_metric < R_metricor (new_metric = R_metricand the updated Routing Tuple would be preferred), then update this Routing Tuple to have:R_next_iface_addr := R_next_iface_addr of the current Routing Tuple;R_local_iface_addr := R_local_iface_addr of the current Routing Tuple;R_metric := new_metric;R_dist := new_dist.
- Define:
- Find the unused Routing Tuple with minimum
C.4. Add Neighbor Addresses ๐
The following procedure is executed once.
- For each Neighbor Tuple with
N_symmetric = trueandN_out_metric != UNKNOWN_METRIC:- For each network address (the "neighbor address") in
N_neighbor_addr_list, if the neighbor address is not equal to theR_dest_addrof any Routing Tuple, then add a new Routing Tuple with:R_dest_addr := neighbor address;R_next_iface_addr := selected link address for the neighbor address;R_local_iface_addr := selected local address for the neighbor address;R_metric := N_out_metric;R_dist := 1.
- For each network address (the "neighbor address") in
C.5. Add Remote Routable Addresses ๐
The following procedure is executed once.
- For each Routable Address Topology Tuple, if:
TA_dest_addris not equal to theR_dest_addrof any Routing Tuple added in an earlier stage; ANDTA_from_orig_addris equal to theR_dest_addrof a Routing Tuple (the "previous Routing Tuple"),
then add a new Routing Tuple, with:
R_dest_addr := TA_dest_addr;R_next_iface_addr := R_next_iface_addr of the previous Routing Tuple;R_local_iface_addr := R_local_iface_addr of the previous Routing Tuple;R_metric := R_metric of the previous Routing Tuple + TA_metric;R_dist := R_dist of the previous Routing Tuple + 1.
There may be more than one Routing Tuple that may be added for an R_dest_addr in this stage. If so, then for each such R_dest_addr, a Routing Tuple with minimum R_metric MUST be added; otherwise, a Routing Tuple that is preferred SHOULD be added. โจ
C.6. Add Attached Networks ๐ธ
The following procedure is executed once.
- For each Attached Network Tuple, if:
AN_net_addris not equal to theR_dest_addrof any Routing Tuple added in an earlier stage; ANDAN_orig_addris equal to theR_dest_addrof a Routing Tuple (the "previous Routing Tuple"),
then add a new Routing Tuple, with:
R_dest_addr := AN_net_addr;R_next_iface_addr := R_next_iface_addr of the previous Routing Tuple;R_local_iface_addr := R_local_iface_addr of the previous Routing Tuple;R_metric := R_metric of the previous Routing Tuple + AN_metric;R_dist := R_dist of the previous Routing Tuple + AN_dist.
There may be more than one Routing Tuple that may be added for an R_dest_addr in this stage. If so, then for each such R_dest_addr, a Routing Tuple with minimum R_metric MUST be added; otherwise, a Routing Tuple that is preferred SHOULD be added. ๐ฆ
C.7. Add 2-Hop Neighbors ๐
The following procedure is OPTIONAL according to Section 19.1 and MAY be executed once.
- For each 2-Hop Tuple with
N2_out_metric != UNKNOWN_METRIC, if:N2_2hop_addris a routable address; ANDN2_2hop_addris not equal to theR_dest_addrof any Routing Tuple added in an earlier stage; AND- the Routing Tuple with
R_dest_addr = N_orig_addrof the corresponding Neighbor Tuple (the "previous Routing Tuple") hasR_dist = 1,
then add a new Routing Tuple, with:
R_dest_addr := N2_2hop_addr;R_next_iface_addr := R_next_iface_addr of the previous Routing Tuple;R_local_iface_addr := R_local_iface_addr of the previous Routing Tuple;R_metric := R_metric of the previous Routing Tuple + N_out_metric of the corresponding Neighbor Tuple;R_dist := 2.
There may be more than one Routing Tuple that may be added for an R_dest_addr in this stage. If so, then for each such R_dest_addr, a Routing Tuple with minimum R_metric MUST be added; otherwise, a Routing Tuple that is preferred SHOULD be added. ๐
Appendix D. TC Message Example โจ
okay bestie, so TC messages are instances of [RFC5444] messages ๐ฆ and this spec says they MUST contain the <msg-hop-limit> and <msg-orig-addr> fields ๐
. that's the non-negotiable part. everything else is up to you, because [RFC5444] lets you mix and match the remaining message header options and address encodings, as long as the required info still gets conveyed ๐. so there is no single "one true look" for a TC message, which is kinda iconic honestly ๐. this appendix just shows you ONE example, and the exact values are explained right after ๐ง
The TC message's four-bit Message Flags (MF) field is set to 15 ๐, which means the header has the originator address, hop limit, hop count, and message sequence number fields. its four-bit Message Address Length (MAL) field is 3, so the addresses are four octets long (these are IPv4 addresses here) ๐ธ. the whole message is 75 octets long โจ.
the message has a Message TLV Block with a content length of 17 octets, holding four TLVs ๐ซถ. the first two are validity and interval times. the third is the content sequence number TLV, which carries the 2-octet ANSN and (with default type extension zero, aka COMPLETE) tells you the TC message is complete ๐. the fourth TLV has the forwarding and routing willingness values for the originating router (FWILL and RWILL) ๐ฅ. every TLV here uses a TLV with Flags octet (MTLVF) value 16, which means it has a Value but no type extension or start and stop indexes ๐. the first two have a Value Length of 1 octet, and the last one has 2 octets ๐ฆ.
the message has two Address Blocks ๐. (this is not necessary, lowkey! one Address Block could do the job. using two is allowed too, it's just there to illustrate ๐) the first Address Block has 3 addresses, with Flags octet (ABF) value 128. that means it has a Head section (length 2 octets), no Tail section, and Mid sections that are two octets long ๐. the TLV Block after it has a content length of 13 octets and two TLVs ๐ . the first is an NBR_ADDR_TYPE TLV with ATLVF value 16, meaning one single Value and no indexes. so all these addresses get the Value ROUTABLE_ORIG (Value Length 1 octet), which means they're originator addresses of advertised neighbors that are ALSO routable ๐ซถ. the second is a LINK_METRIC TLV with ATLVF value 20, which means there's a Value for each address. the total Value Length is 6 octets, so each address gets a 2-octet Value ๐ง. each of those Values has four bits saying they're outgoing neighbor metric values, and twelve bits for the metric itself (the first four bits are the exponent, the other eight are the mantissa) ๐.
the second Address Block has 1 address, with ABF value 176 ๐ธ. that means there's a Head section (length 2 octets), a Tail section (length 2 octets) made of zero valued octets (so they're not included), and a single prefix length, which is 16 โจ. the network address works out to Head.0.0/16 ๐. the TLV Block after it has a content length of 9 octets and two TLVs ๐ฅ. the first has ATLVF 16 (again, no indexes), with a Value (Value Length 1 octet) giving the address distance as a number of hops ๐. the second is another LINK_METRIC TLV, same as in the first Address Block, except its ATLVF is 16, meaning a single Value is present ๐ฆ.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TC | MF=15 | MAL=3 | Message Length = 75 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Originator Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Hop Limit | Hop Count | Message Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Message TLV Block Length = 17 | VALIDITY_TIME | MTLVF = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value Len = 1 | Value (Time) | INTERVAL_TIME | MTLVF = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value Len = 1 | Value (Time) | CONT_SEQ_NUM | MTLVF = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value Len = 2 | Value (ANSN) | MPR_WILLING |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| MTLVF = 16 | Value Len = 1 | FWILL | RWILL | Num Addrs = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ABF = 128 | Head Len = 2 | Head |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mid | Mid |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Mid | Address TLV Block Length = 13 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NBR_ADDR_TYPE | ATLVF = 16 | Value Len = 1 | ROUTABLE_ORIG |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LINK_METRIC | ATLVF = 20 | Value Len = 6 |0|0|0|1|Metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Metric (cont) |0|0|0|1| Metric |0|0|0|1|Metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Metric (cont) | Num Addrs = 1 | ABF = 176 | Head Len = 2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Head | Tail Len = 2 | Pref Len = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Address TLV Block Length = 9 | GATEWAY | ATLVF = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value Len = 1 | Value (Hops) | LINK_METRIC | ATLVF = 16 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Value Len = 2 |0|0|0|1| Metric |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Appendix E. Flow and Congestion Control ๐ธ
okay so, due to its proactive nature, this protocol has a natural control over the flow of its control traffic ๐ . routers send control messages at predetermined rates, which are specified and bounded by message intervals โจ.
this protocol uses [RFC6130] for local signaling ๐ฆ. it embeds MPR selection advertisement through a simple Address Block TLV, and router willingness advertisement (if there is any) as a single Message TLV ๐ซถ. so local signaling shares the characteristics and constraints of [RFC6130] ๐.
the MPRs can also greatly reduce signaling overhead from link state information dissemination, in two ways: flooding reduction and topology reduction ๐ฅ. first, with MPR flooding, distributing link state information through the network costs less than blind flooding, since only MPRs need to forward link state declaration messages ๐. second, the amount of link state information a router has to declare shrinks, because it only needs to contain that router's MPR selectors ๐ง. that makes a link state declaration way smaller than declaring full link state information, and some routers may not need to declare any such information at all ๐. in dense networks, the reduction in control traffic can be several orders of magnitude compared to routing protocols using blind flooding [MPR] ๐. this leaves more bandwidth for useful data traffic and pushes the congestion frontier further out ๐.
since control traffic is continuous and periodic, it keeps the quality of the links used in routing more stable ๐. however, with some options, some control messages (HELLO messages or TC messages) may be sent early, ahead of their deadline, to make the protocol more responsive to topology changes โญ. this can cause a small, temporary, and local increase in control traffic, but it is at all times bounded by the use of minimum message intervals ๐ซถ.
a router that notices the network is congested can increase its message interval parameters ๐ญ. if most or all routers do this, the overall control traffic in the network goes down ๐ . when using this, routers have to be careful not to increase message interval parameters so much that they can't cope with network topology changes ๐. and routers can make these decisions independently: it's not necessary for all routers to use the same parameter values, nor for all of them to change their intervals at the same time ๐ฆ.
Authors' Addresses ๐
Thomas Heide Clausen LIX, Ecole Polytechnique
Phone: +33 6 6058 9349 EMail: T.Clausen@computer.org URI: http://www.ThomasClausen.org/
Christopher Dearlove BAE Systems Advanced Technology Centre West Hanningfield Road Great Baddow, Chelmsford United Kingdom
Phone: +44 1245 242194 EMail: chris.dearlove@baesystems.com URI: http://www.baesystems.com/
Philippe Jacquet Alcatel-Lucent Bell Labs
Phone: +33 6 7337 1880 EMail: philippe.jacquet@alcatel-lucent.com
Ulrich Herberg Fujitsu Laboratories of America 1240 E. Arques Ave. Sunnyvale, CA 94085 USA
EMail: ulrich@herberg.name URI: http://www.herberg.name/
๐ฆ where this page comes from
- ietf: rfc7181 2014-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms