Reviewing the topology

Logically speaking, a distributed virtual router is a single router object connecting two or more project networks, as shown in the following diagram:

In the following example, a distributed virtual router named MyDistributedRouter has been created and connected to two project networks: BLUE_NET and RED_NET. Virtual machine instances in each network use their respective default gateways to route traffic to the other network through the same router. The virtual machine instances are unaware of where the router is located.

A look under the hood, however, tells a different story. In the following example, the blue VM pings the red VM and traffic is routed and forwarded accordingly:

As far as the user is concerned, the router connecting the two networks is a single entity known as MyDistributedRouter:

Using the ip netns exec command, we can see that the qr interfaces within the namespaces on each compute node and the SNAT node share the same interface names, IP addresses, and MAC addresses:

In the preceding screenshot, the qrouter namespaces on the snat01 and compute nodes that correspond to the distributed router contain the same qr-841d9818-bf and qr-d2ce8f82-d8 interfaces and addresses that correspond to the BLUE_NET and RED_NET networks. A creative use of routing tables and Open vSwitch flow rules allows traffic between instances behind the same distributed router to be routed directly between compute nodes. The tricks behind this functionality will be discussed in the following sections and throughout this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset