Summary

Sub-menu:/interface mesh

HWMP+ is a MikroTik specific layer-2 routing protocol for wireless mesh networks. It is based on Hybrid Wireless Mesh Protocol (HWMP) from IEEE 802.11s draft standard. It can be used instead of (Rapid) Spanning Tree protocols in mesh setups to ensure loop-free optimal routing.

The HWMP+ protocol however is not compatible with HWMP from IEEE 802.11s draft standard.

Note that the distribution system you use for your network need not to be Wireless Distribution System (WDS). HWMP+ mesh routing supports not only WDS interfaces, but also Ethernet interfaces inside the mesh. So you can use simple Ethernet based distribution system, or you can combine both WDS and Ethernet links!

Note: Prerequisites for this article: you understand what WDS is and why to use it!
Software versions: 3.28+ (earlier versions are incompatible)

Mesh Properties

Property

Description

admin-mac (MAC address; Default: 00:00:00:00:00:00)

administratively assigned MAC address, used when auto-mac setting is disabled

arp (disabled | enabled | proxy-arp | reply-only; Default: enabled)

Address Resolution Protocol setting

auto-mac (boolean; Default: no)

if disabled, then value from admin-mac will be used as the MAC address of the mesh interface; else address of some port will be used if ports are present

hwmp-default-hoplimit (integer: 1..255; Default: )

maximum hop count for generated routing protocol packets; after a HWMP+ packet is forwarded "hoplimit" times, it is dropped

hwmp-prep-lifetime (time; Default: 5m)

lifetime for routes created from received PREP or PREQ messages

hwmp-preq-destination-only (boolean; Default: yes)

whether only destination can respond to HWMP+ PREQ message

hwmp-preq-reply-and-forward (boolean; Default: yes)

whether intermediate nodes should forward HWMP+ PREQ message after responding to it. Useful only when hwmp-preq-destination-only is disabled

hwmp-preq-retries (integer; Default: 2)

how many times to retry a route discovery to a specific MAC address before the address is considered unreachable

hwmp-preq-waiting-time (time; Default: 4s)

how long to wait for a response to the first PREQ message. Note that for subsequent PREQs the waiting time is increased exponentially

hwmp-rann-interval (time; Default: 10s)

how often to send out HWMP+ RANN messages

hwmp-rann-lifetime (time; Default: 1s)

lifetime for routes created from received RANN messages

hwmp-rann-propagation-delay (number; Default: 0.5)

how long to wait before propagating a RANN message. Value in seconds

mesh-portal (boolean; Default: no)

whether this interface is a portal in the mesh network

mtu (number; Default: 1500)

maximum transmission unit size

name (string; Default: )

interface name

reoptimize-paths (boolean; Default: no)

whether to send out periodic PREQ messages asking for known MAC addresses. Turing on this setting is useful if network topology is changing often. Note that if no reply is received to a reoptimization PREQ, the existing path is kept anyway (until it timeouts itself)

outsider -- MAC address belongs to a device external to the mesh network

direct -- MAC address belongs to a wireless client on an interface that is in the mesh network

mesh -- MAC address belongs to a device reachable over the mesh network; it can be either internal or external to the mesh network

neighbor -- MAC address belongs to a mesh router that is direct neighbor to this router

larval -- MAC address belongs to an unknown device that is reachable over the mesh network

unknown -- MAC address belongs to an unknown device

mesh (interface name)

the mesh interface this FDB entry belongs to

on-interface (interface name)

mesh port used for traffic forwarding, kind of a next-hop value

lifetime (time)

time remaining to live if this entry is not used for traffic forwarding

age (time)

age of this FDB entry

metric (integer)

metric value used by routing protocol to determine the 'best' path

Additional wireless configuration

Use wds-default-cost and wds-cost-range wireless interface parameters for controlling the metric that is used in the routing protocol. The WDS cost will be used as path-cost for ports dynamically added to the mesh interface.

Example

This example uses static WDS links that are dynamically added as mesh ports when they become active. Two different frequencies are used: one for AP interconnections, and one for client connections to APs, so the AP must have at least two wireless interfaces. Of course, the same frequency for all connections also could be used, but that might not work as good because of potential interference issues.

Here WDS interface is added manually, because static WDS mode is used. If you are using wds-mode=dynamic-mesh, all WDS interfaces will be created automatically. The frequency and band parameters are specified here only to produce valid example configuration; mesh protocol operations is by no means limited to, or optimized for, these particular values.

Note: You may want to increase disconnect-timeout wireless interface option to make the protocol more stable.

In real world setups you also should take care of securing the wireless connections, using /interface wireless security-profile. For simplicity that configuration is not shown here.

Protocol description

Reactive mode

Router A wants to discover path to C

Router C sends unicast response to A

In reactive mode HWMP+ is very much like AODV (Ad-hoc On-demand Distance Vector). All paths are discovered on demand, by flooding Path Request (PREQ) message in the network. The destination node or some router that has a path to the destination will reply with a Path Response (PREP). Note that if the destination address belongs to a client, the AP this client is connected to will serve as a proxy for him (i.e. reply to PREQs on his behalf).

This mode is best suited for mobile networks, and/or when most of the communication happens between intra-mesh nodes.

Proactive mode

The root announces itself by flooding RANN

Internal nodes respond with PREGs

In proactive mode there are some routers configured as portals. In general being a portal means that router has interfaces to some other network,, i.e. it is entry/exit point to the mesh network.

The portals will announce their presence by flooding Root Announcement (RANN) message in the network. Internal nodes will reply with a Path Registration (PREG) message. The result of this process will be routing trees with roots in the portal.

Routes to portals will serve as a kind of default route. If an internal router does not know path to a particular destination, it will forward all data to its closest portal. The portal will then discover path on behalf of the router, if needed. The data afterwards will flow through the portal. This may lead to sub-optimal routing, unless the data is addressed to the portal itself or some external network the portals has interfaces to.

Proactive mode is best suited when most of traffic goes between internal mesh nodes and a few portal nodes.

Topology change detection

Data flow path

After link disappears, error is propagated upstream

HWMP+ uses Path Error (PERR) message to notify that a link has disappeared. The message is propagated to all upstream nodes up to the data source. The source on PERR reception restarts path discovery process.

FAQ

Q. How is this better than RSTP?

A. It gives you optimal routing. RSTP is only for loop prevention.

Q. How the route selection is done?

A. The route with best metric is always selected after the discovery process. There is also a configuration option to periodically reoptimize already known routes.

Route metric is calculated as the sum of individual link metrics.

Link metric is calculated in the same way as for (R)STP protocols:

For Ethernet links the metric is configured statically (same as for OSPF, for example).

For WDS links the metric is updated dynamically depending on actual link bandwidth, which in turn is influenced by wireless signal strength, and the selected data transfer rate.

Currently the protocol does not take in account the amount of bandwidth being used on a link, but that might be also used in future.

Q. How is this better than OSPF/RIP/layer-3 routing in general?

A. WDS networks usually are bridged, not routed. The ability to self-configure is important for mesh networks; and routing generally requires much more configuration than bridging.
Of course, you can always run any L3 routing protocol over a bridged network, but for mesh networks that usually makes little sense.

Note: Since optimized layer-2 multicast forwarding is not included in the mesh protocol, it is better to avoid forwarding any multicast traffic (including OSPF) over meshed networks. If you need OSPF, then you have to configure OSPF NBMA neighbors that uses unicast mode instead.

Q. What about performance/CPU requirements?

A. The protocol itself, when properly configured, will take much less resources than OSPF (for example) would. Data forwarding performance on an individual router should be close to that of bridging.

Q. How does it work together with existing mesh setups that are using RSTP?

A. The internal structure of a RSTP network is transparent to the mesh protocol (because mesh hello packets are forwarded inside RSTP network). The mesh will see the path between two entry points in the RSTP network as a single segment. On the other hand, a mesh network is not transparent to the RSTP, since RSTP hello packets are not be forwarded inside the mesh network. (This is the behaviour since v3.26)

Warning: Routing loops are possible, if a mesh network is attached to a RSTP network in two or more points!

Note that if you have a WDS link between two access points, then both ends must have the same configuration (either as ports in a mesh on both ends, or as ports in a bridge interface on both ends).

You can also put a bridge interface as a mesh port (to be able to use bridge firewall, for example).

Q. Can I have multiple entry/exit points to the network?

A. If the entry/exit points are configured as portals (i.e. proactive mode is used), each router inside the mesh network will select its closest portal and forward all data to it. The portal will then discover path on behalf of the router, if needed.

Q. How to control or filter mesh traffic?

A. At the moment the only way is to use bridge firewall. Create a bridge interface, put the WDS interfaces and/or Ethernets in that bridge, and put that bridge in a mesh interface. Then configure bridge firewall rules.

To match MAC protocol used for mesh traffic encapsulation, use MAC protocol number 0x9AAA, and to match mesh routing traffic, use MAC protocol number 0x9AAB. Example:

Note that it is perfectly possible to create mixed mesh/bridge setups that will not work (e.g. Problematic example 1 with bridge instead of switch). The recommended fail-safe way that will always work is to create a separate bridge interface per each of the physical interfaces; then add all these bridge interfaces as mesh ports.

Advanced topics

We all know that it's easy to make problematic layer-2 bridging or routing setups and it can be hard to debug them. (Compared to layer-3 routing setups.) So here are a few bad configuration examples which could create problems for you. Avoid them!

Problematic example 1: Ethernet switch inside a mesh

Router A is outside the mesh, all the rest of the routers are inside. For routers B, C, D all interfaces are added as mesh ports.

Router A will not be able to communicate reliably with router C. The problem manifests itself when D is the designated router for Ethernet; if B takes this role, everything is OK. The main cause of the problem is MAC address learning on Ethernet switch.

Consider what happens when router A wants to send something to C. We suppose router A either knowns or floods data to all interfaces. Either way, data arrives at switch. The switch, not knowing anything about destination's MAC address, forwards the data to both B and D.

What happens now:

B receives the packet on a mesh interface. Since the MAC address is not local for B and B knows that he is not the designated router for the Ethernet network, he simply ignores the packet.

D receives the packet on a mesh interface. Since the MAC address is not local for B and D is the designated router for the Ethernet network, he initiates path discovery process to C.

After path discovery is completed, D has information that C is reachable over B. Now D encapsulates the packet and forwards it back to the Ethernet network. The encapsulated packet is forwarded by the switch, received and forwarded by B and received by C. So far everything is good.

Now C is likely to respond to the packet. Since B already knows where A is, he will decapsulate and forward the reply packet. But now the switch will learn that the MAC address of C is reachable through B! That means, next time when something arrives from A addressed to C, the switch will forward data only to B (and B, of course, will silently ignore the packet)!

In contrast, if B took up the role of designated router, everything would be OK, because traffic would not have to go through the Ethernet switch twice.

Troubleshooting: either avoid such setup or disable MAC address learning on the switch. Note that on many switches that is not possible.

Also note that there will be no problem, if either:

router A supports and is configured to use HWMP+;

or Ethernet switch is replaced with a router that supports HWMP+ and has Ethernet interfaces added as mesh ports.

Problematic example 2: wireless modes

Consider this (invalid) setup example:

Routers A and B are inside the mesh, router C: outside. For routers A and B all interfaces are added as mesh ports.

It is not possible to bridge wlan1 and wlan2 on router B now. The reason for this is pretty obvious if you understand how WDS works. For WDS communications four address frames are used. This is because for wireless multihop forwarding you need to know both the addresses of the intermediate hops, as well as the original sender and final receiver. In contrast, non-WDS 802.11 communication includes only three MAC addresses in a frame. That's why it's not possible to do multihop forwarding in station mode.

Troubleshooting: depends on what you want to achieve:

If you want router C to act as a repeater either for wireless or Ethernet traffic, configure WDS link between router B and router C, and run mesh routing protocol on all nodes.

In other cases configure wlan2 on router B in AP mode and wlan on router C in station mode.