ODR
What is ODR?
ODR(On Demand Routing) is a routing protocol that runs on top of CDP and that is best suited for a hub and spoke topology. If the CDP traffic is already active between the routers on a Hub and Spoke network, the use of ODR makes sense because the connections will not have to transport routing updates for an IGP routing protocol, relying instead on the CDP packets to carry routing information.
Of course, in terms of features, ODR can’t be compared to other more known IGPs like OSPF, EIGRP or even RIP, but in a simple hub and spoke topology, it can make wonders. The key is to be able to transport CDP frames from the hub to every spoke. This is normally the case with Frame Relay or MPLS, but not whithin a Switched Ethernet environment, where CDP would only work on a hop-by-hop basis, so the router’s will see the switches as neighbors, not each other. But there are situations where ODR can work even over ethernet switches:
When using dumb switches – They will not intercept CDP packets, but will flood them out all ports.
With Cisco swithces (and not just Cisco), using a feature that supports CDP tunneling, like 802.1Q (Q-in-Q) tunneling
Configuring ODR is easy beacuase ODR is enabled ONLY on the hub router with the command:
The hub router will then add routing information to the CDP packets it sends to the other spokes, informing them of a default route pointing towards itself. The nice thing is that on the spokes you don’t have to do anything and the routes will be auto-magically set. What can you do to stop the ODR default route from being installed in the spoke’s routing table?
You can disable CDP
You can start another routing protocol. When this happens, the router will stop processing and sending ODR updates!
You can even start ODR on the spoke. When this happens, the spoke will act just like the hub in terms of processing routing information. It will send default routes toward other spokes with himself as next hop but will not exchange routes with other routers configured for ODR. Of course, this will only work if your topology is more of a “partial mesh” because there are practically 2 hubs and the spokes should connect to both of them directly so they can talk over CDP. The spokes will install default routes from each router and this way they will be able to load-balance traffic between the 2 hubs.
ODR has an adminitrative distance of 160 making it less preferred compared to most other protocols. In fact, only External EIGRP routes (AD=170) and Internal BGP(AD=200) are less preferred than ODR. ODR supports VLSM and will advertise to the hub all directly connected networks, but only based on the primary IP addresses, not the secondary addresses. ODR will be able to redistribute routes to and from other routing protocols on the hub and it can even do route filtering with the classic command:
Just an example
Let’s look now at an example of ODR used in a Frame Relay Topology
ODR Example topology
In this example we will use R1 as the Hub with R2 and R3 as the spokes. R1 and R2 will use the physical interfaces while R3 will use a point-to-point subinterface to the Frame Relay cloud. Each router will have a loopback interface and we will configure ODR on R1 to enable connectivity between each router.
2.1 Basic Frame Relay configuration
After LMI and Inverse ARP information is exchanged we end up with:
2.2 Is CDP working?
In order to make ODR run, we should check if CDP is running:
Notice that interfaces Serial1/1 on R1 and Serial1/2 on R2 do not run CDP, while the subinteface Serial1/3.301 on R3 runs CDP! This is because, when using Frame Relay, CDP is enabled by default only on point-to-point subinterfaces. We will need to activate CDP now on both R1 and R2:
Let’s verify CDP neighbors now:
2.3 Let’s fire up ODR
Now that we have CDP working, we should enable ODR on the hub:
That’s it! Let’s check the routing table now:
[cisco highlite=”7,9,20,29″]! On R1: Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets o 2.2.2.2 [160/1] via 123.0.0.2, 00:00:57, Serial1/1 3.0.0.0/32 is subnetted, 1 subnets o 3.3.3.3 [160/1] via 123.0.0.3, 00:00:16, Serial1/1 123.0.0.0/24 is subnetted, 1 subnets C 123.0.0.0 is directly connected, Serial1/1 ! On R2: R2#sh ip route Gateway of last resort is 123.0.0.1 to network 0.0.0.0
2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 123.0.0.0/24 is subnetted, 1 subnets C 123.0.0.0 is directly connected, Serial1/2 o* 0.0.0.0/0 [160/1] via 123.0.0.1, 00:00:37, Serial1/2 ! On R3: R3#sh ip route Gateway of last resort is 123.0.0.1 to network 0.0.0.0
3.0.0.0/32 is subnetted, 1 subnets C 3.3.3.3 is directly connected, Loopback0 123.0.0.0/24 is subnetted, 1 subnets C 123.0.0.0 is directly connected, Serial1/3.301 o* 0.0.0.0/0 [160/1] via 123.0.0.1, 00:00:23, Serial1/3.301
Well, it looks pretty good. We have default routes on the spokes and the hub knows how to get to all networks. Now let’s test this, just to make sure:
Wow! It all seemed to go well until the last ping. What happend? How come we can ping R3 from R2 but not R2 from R3?
2.4 What went wrong?
Well, this doesn’t really have to do with ODR anymore. ODR did its job – we have correct routing information on all routers. What happens is that when we ping R3 from R2, we actually send packets with source 123.0.0.2 and destination 3.3.3.3. R2 will look in its routing table and will find that is should send packets for 3.3.3.3 using the default route. The default route points to 123.0.0.1, and we have an Inverse ARP map for that – 102. The packet is sent out to R1. On R1, it will be redirected to R3. When R3 receives the ICMP packet, in order to reply, it will create a packet with a source of 3.3.3.3 and destination of 123.0.0.2.
Now here’s why R2 can ping R3’s loopback: To send to 123.0.0.2 the routing table points to the directly connected interface Serial1/3.301. This is a point-to-point interface and R3 doesn’t care about Inverse ARP or static maps on this interface. It will just send the packet using the DLCI assigned to it. THe packet arrives at R3 who redirects it to R2 and we have connectivity!
In the same way, when we ping R2 from R3, we actually send packets with source 123.0.0.3 and destination 2.2.2.2. R3 looks up a route to 2.2.2.2 It doesn’t find one so it uses the default route that points to 123.0.0.1 on the point-to-point Serial1/3.301. R3 just encapsulates the packet using DLCI 301 and sends it out. R1 receives the packet and redirects it over to R2.
Now here’s why R3 can’t ping R2’s loopback: R2 receive the packet and must send a reply from source ip 2.2.2.2 to destination IP 123.0.0.3. It looks up the destination in the routing table, finds out it’s Serial1/2 (directly connected) but we don’t have a mapping for 123.0.0.3 and we don’t know what DLCI to use to reach this IP. Encapsulation fails, the ping fails.
2.5 Solutions?
The solution? We can just ping R2’s loopback using R3’s loopback. There’s no problem with this
Or, we can add a static map on R2 that tells the router to use the same DLCI 201 to reach 123.0.0.3, also.
Last updated