K 10 svn:author V 5 andre K 8 svn:date V 27 2012-11-08T22:40:24.086992Z K 7 svn:log V 1498 Save this for later continuation: Different approach on ECMP (equal cost multi path) routing. Instead of having shadow rtentry's linked behind the one in the trie, just have an array of different egress interface and next-hops. This simplifies the code significantly. A normal add to the routing table then sets the main next- hop. A ECMP aware add or modify can change any of the other next hops in the rtentry. The next-hop list is sorted by priority (distance in Cisco parlance) with the highest first. Equal priority next-hops are next to each other sorted by next-hop IP address. If the highest priority has more than one next-hop load is equally shared among them. All other routes with lower weight are not used. When a higher priority next-hop is removed or flagged as unavailable (eg. interface link down) the next higher priority prefix will become active. When only unavailable next-hops are in the rtentry it is ignored and a less specific match is searched for. If no route is found the lookup will fail. When an unavailable next-hop becomes available again, the rtentry is valid again and will match on lookups. This way we can implement suppression of routes on link state down interfaces without having to actually remove the rtentry. Additionally it is automatically reinstated when the link comes back. This way for example a OSPF route can take precedence and NLRI reachability is ensured. This is the same behavior as of Cisco, Juniper and other router vendors. END