Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.6.0.3
Pinging Physical Devices

Overview

In this section, we assume you have a multi-tenant (demo1 and demo2), 2 node cluster up and running as described in previous sections. Here, we talk about how tenant VMs can ping physical devices in your cluster. We assume here:

Instructions

The following assumes the configuration of the OpenStack cluster and switch as described previously in this documentation.

List Tenant Networks

solmaz-10GB:~/devstack$ neutron net-list
+--------------------------------------+----------+----------------------------------------------------+
| id                                   | name     | subnets                                            |
+--------------------------------------+----------+----------------------------------------------------+
| 1b396b4a-71e3-42b5-872d-84e3aa3a134e | demo2net | 103673e4-b7a0-4ddc-a2d9-83e1f697b07f 10.4.128.0/20 |
| 6b4da7eb-be9d-4b64-85aa-9337abd94bef | private  | 576a02ec-d4d5-432e-a1ab-f9dcc7892ced 10.4.128.0/24 |
| f33ebab8-1919-4c2c-8547-541c55c18af4 | demo1net | 1828e41a-f24a-4dcd-8ef4-fcbce8888b7b 10.4.128.0/20 |
+--------------------------------------+----------+----------------------------------------------------+

The above tells us that demo2 tenant network is 1b396b4a-71e3-42b5-872d-84e3aa3a134e and demo1 tenant network is f33ebab8-1919-4c2c-8547-541c55c18af4.

Map Namespaces to Tenant Networks

solmaz-10GB:~/devstack$ ip netns
qdhcp-f33ebab8-1919-4c2c-8547-541c55c18af4
qdhcp-1b396b4a-71e3-42b5-872d-84e3aa3a134e

Notice that UUIDs match the tenant network lists. This tells us that the namespace for demo1 is qdhcp-f33ebab8-1919-4c2c-8547-541c55c18af4, and the namespace for demo2 is qdhcp-1b396b4a-71e3-42b5-872d-84e3aa3a134e.

Determine Tenant VM IP Address Assignments

solmaz-10GB:~/devstack$ source openrc demo1 demo1
solmaz-10GB:~/devstack$ nova list
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| ID                                   | Name  | Status | Task State | Power State | Networks            |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| 3bcf9ee1-e585-4aec-a8d8-6e0aca9346d5 | test5 | ACTIVE | -          | Running     | demo1net=10.4.128.2 |
| 459b4819-ea65-4a95-bb67-fd5740a24864 | test6 | ACTIVE | -          | Running     | demo1net=10.4.128.3 |
| b58194fd-f1e8-4186-92d6-c781f6bd7a93 | test7 | ACTIVE | -          | Running     | demo1net=10.4.128.5 |
| 0ad37ebe-a388-4e1a-be46-ca62d1943320 | test8 | ACTIVE | -          | Running     | demo1net=10.4.128.6 |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
solmaz-10GB:~/devstack$ source openrc demo2 demo2
solmaz-10GB:~/devstack$ nova list
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| ID                                   | Name  | Status | Task State | Power State | Networks            |
+--------------------------------------+-------+--------+------------+-------------+---------------------+
| 1f9551e8-bfd9-45a3-b6c1-ed49580eb701 | test1 | ACTIVE | -          | Running     | demo2net=10.4.128.4 |
| 09c18fac-d4e8-4be8-ac09-e031ba0b7ab2 | test2 | ACTIVE | -          | Running     | demo2net=10.4.128.2 |
| 9988c65c-98ce-42c7-b59e-d7ebb639cf19 | test3 | ACTIVE | -          | Running     | demo2net=10.4.128.6 |
| 10bb9182-59aa-43f8-b215-bbf1e9bc2541 | test4 | ACTIVE | -          | Running     | demo2net=10.4.128.5 |
+--------------------------------------+-------+--------+------------+-------------+---------------------+

The above tells us that from the demo1 namespace, we should be able to ping or ssh into 10.4.128.[2 3 5 6] and from the demo2 namespace, we should be able to ping or ssh into 10.4.128.[2 4 5 6].

Ping VMs

Now, for each namespace, enter the namespace and ping the tenant VMs

solmaz-10GB:~/devstack$ sudo ip netns exec qdhcp-f33ebab8-1919-4c2c-8547-541c55c18af4 bash
root-10GB:~/devstack# ping 10.4.128.2
PING 10.4.128.2 (10.4.128.2) 56(84) bytes of data.
64 bytes from 10.4.128.2: icmp_seq=1 ttl=64 time=5.79 ms
64 bytes from 10.4.128.2: icmp_seq=2 ttl=64 time=0.660 ms
^C64 bytes from 10.4.128.2: icmp_seq=3 ttl=64 time=0.683 ms
^C
--- 10.4.128.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.660/2.378/5.791/2.413 ms
root-10GB:~/devstack# ping 10.4.128.3
PING 10.4.128.3 (10.4.128.3) 56(84) bytes of data.
64 bytes from 10.4.128.3: icmp_seq=1 ttl=64 time=2.20 ms
^C
--- 10.4.128.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.209/2.209/2.209/0.000 ms
root-10GB:~/devstack# ^C
root-10GB:~/devstack# ^C
root-10GB:~/devstack# ^C
root-10GB:~/devstack# ping 10.4.128.5
PING 10.4.128.5 (10.4.128.5) 56(84) bytes of data.
64 bytes from 10.4.128.5: icmp_seq=1 ttl=64 time=2.75 ms
64 bytes from 10.4.128.5: icmp_seq=2 ttl=64 time=0.716 ms
^C
--- 10.4.128.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.716/1.734/2.752/1.018 ms
root-10GB:~/devstack# ping 10.4.128.6
PING 10.4.128.6 (10.4.128.6) 56(84) bytes of data.
64 bytes from 10.4.128.6: icmp_seq=1 ttl=64 time=1.99 ms
^C
--- 10.4.128.6 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.991/1.991/1.991/0.000 ms
root-10GB:~/devstack# ^C
root-10GB:~/devstack# exit

solmaz-10GB:~/devstack$ sudo ip netns exec qdhcp-1b396b4a-71e3-42b5-872d-84e3aa3a134e bash
root-10GB:~/devstack# ping 10.4.128.2
PING 10.4.128.2 (10.4.128.2) 56(84) bytes of data.
64 bytes from 10.4.128.2: icmp_seq=1 ttl=64 time=1.89 ms
^C
--- 10.4.128.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.894/1.894/1.894/0.000 ms
root-10GB:~/devstack# ping 10.4.128.4
PING 10.4.128.4 (10.4.128.4) 56(84) bytes of data.
64 bytes from 10.4.128.4: icmp_seq=1 ttl=64 time=2.94 ms
64 bytes from 10.4.128.4: icmp_seq=1 ttl=64 time=2.95 ms (DUP!)
64 bytes from 10.4.128.4: icmp_seq=1 ttl=64 time=2.96 ms (DUP!)
64 bytes from 10.4.128.4: icmp_seq=2 ttl=64 time=0.690 ms
64 bytes from 10.4.128.4: icmp_seq=3 ttl=64 time=0.683 ms
^C
--- 10.4.128.4 ping statistics ---
3 packets transmitted, 3 received, +2 duplicates, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.683/2.047/2.961/1.111 ms
root-10GB:~/devstack# ping 10.4.128.5
PING 10.4.128.5 (10.4.128.5) 56(84) bytes of data.
64 bytes from 10.4.128.5: icmp_seq=1 ttl=64 time=2.52 ms
64 bytes from 10.4.128.5: icmp_seq=2 ttl=64 time=0.549 ms
^C
--- 10.4.128.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.549/1.539/2.529/0.990 ms
root-10GB:~/devstack# ^C
root-10GB:~/devstack# ping 10.4.128.6
PING 10.4.128.6 (10.4.128.6) 56(84) bytes of data.
64 bytes from 10.4.128.6: icmp_seq=1 ttl=64 time=2.57 ms
64 bytes from 10.4.128.6: icmp_seq=1 ttl=64 time=2.59 ms (DUP!)
64 bytes from 10.4.128.6: icmp_seq=2 ttl=64 time=0.719 ms
64 bytes from 10.4.128.6: icmp_seq=3 ttl=64 time=0.670 ms
^C
--- 10.4.128.6 ping statistics ---
3 packets transmitted, 3 received, +1 duplicates, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.670/1.641/2.598/0.948 ms

SSH into VMs

For each tenant, enter the corresponding namespace, pick a VM, and ssh into it.

solmaz-10GB:~/devstack$ sudo ip netns exec qdhcp-d9f75cdc-524b-4e11-962e-2be64dd2b7e5 bash
root-10GB:~/devstack# ssh -i oskey2.priv root@.nosp@m.10.4.nosp@m..128.3
The authenticity of host '10.4.128.3 (10.4.128.3)' can't be established.
ECDSA key fingerprint is 31:79:d3:89:bb:a5:88:80:64:75:26:9b:c5:8e:37:e0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '10.4.128.3' (ECDSA) to the list of known hosts.
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-48-generic x86_64)
  Documentation:  https://help.ubuntu.com/
  System information as of Tue Oct 21 22:30:30 UTC 2014
  System load:  0.15              Processes:           67
  Usage of /:   3.6% of 19.68GB   Users logged in:     0
  Memory usage: 3%                IP address for eth0: 10.4.128.3
  Swap usage:   0%
  Graph this data and manage this system at:
    https://landscape.canonical.com/
  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud
0 packages can be updated.
0 updates are security updates.

Ping Physical Devices

For each tenant, pick a VM, ssh into it (as above) and then ping the physical device that has been configured for that tenant.

In this example, physical devices are on ports 29 and 30, cabled to a dual homed 10GB card plugged into a desktop PC that is running Ubuntu Linux.

The corresponding interfaces are eth1 and eth2:

eth1      Link encap:Ethernet  HWaddr 90:e2:ba:19:b1:ec
          inet addr:192.168.3.99  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::92e2:baff:fe19:b1ec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:587525 errors:1 dropped:0 overruns:0 frame:1
          TX packets:12869 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:143692974 (143.6 MB)  TX bytes:1192878 (1.1 MB)
eth2      Link encap:Ethernet  HWaddr 90:e2:ba:19:b1:ed
          inet addr:192.168.3.201  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::92e2:baff:fe19:b1ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1513372 errors:1 dropped:0 overruns:0 frame:1
          TX packets:184198 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:330820419 (330.8 MB)  TX bytes:17631396 (17.6 MB)

The above mac address and IP address assignments are reflected in the vtepc configuration (/etc/vtepc/vtepc_config.py), described earlier.

Ping 192.168.3.201 from Tenant demo1

$ sudo route add -net 192.168.3.0 netmask 255.255.255.0 dev eth0
$ sudo arp -i eth0 -s 192.168.3.201 90:e2:ba:19:b1:ed
$ ping 192.168.3.201
64 bytes from 192.168.3.201: icmp_req=1981 ttl=64 time=0.607 ms
64 bytes from 192.168.3.201: icmp_req=1982 ttl=64 time=0.674 ms
64 bytes from 192.168.3.201: icmp_req=1983 ttl=64 time=0.552 ms
64 bytes from 192.168.3.201: icmp_req=1984 ttl=64 time=0.734 ms
64 bytes from 192.168.3.201: icmp_req=1985 ttl=64 time=0.530 ms
64 bytes from 192.168.3.201: icmp_req=1986 ttl=64 time=0.621 ms
64 bytes from 192.168.3.201: icmp_req=1987 ttl=64 time=0.677 ms
64 bytes from 192.168.3.201: icmp_req=1988 ttl=64 time=0.714 ms
64 bytes from 192.168.3.201: icmp_req=1989 ttl=64 time=0.642 ms
64 bytes from 192.168.3.201: icmp_req=1990 ttl=64 time=0.456 ms
64 bytes from 192.168.3.201: icmp_req=1991 ttl=64 time=0.631 ms
64 bytes from 192.168.3.201: icmp_req=1992 ttl=64 time=0.635 ms

Ping 192.168.3.99 from Tenant demo2

$ sudo route add -net 192.168.3.0 netmask 255.255.255.0 dev eth0
$ sudo arp -i eth0 -s 192.168.3.99 90:e2:ba:19:b1:ec
$ ping 192.168.3.99
64 bytes from 192.168.3.99: icmp_req=2009 ttl=64 time=0.840 ms
64 bytes from 192.168.3.99: icmp_req=2010 ttl=64 time=0.646 ms
64 bytes from 192.168.3.99: icmp_req=2011 ttl=64 time=0.787 ms
64 bytes from 192.168.3.99: icmp_req=2012 ttl=64 time=0.514 ms
64 bytes from 192.168.3.99: icmp_req=2013 ttl=64 time=0.544 ms
64 bytes from 192.168.3.99: icmp_req=2014 ttl=64 time=0.671 ms
64 bytes from 192.168.3.99: icmp_req=2015 ttl=64 time=0.576 ms
64 bytes from 192.168.3.99: icmp_req=2016 ttl=64 time=0.495 ms
64 bytes from 192.168.3.99: icmp_req=2017 ttl=64 time=0.570 ms
64 bytes from 192.168.3.99: icmp_req=2018 ttl=64 time=0.560 ms
64 bytes from 192.168.3.99: icmp_req=2019 ttl=64 time=0.541 ms
64 bytes from 192.168.3.99: icmp_req=2020 ttl=64 time=0.632 ms
64 bytes from 192.168.3.99: icmp_req=2021 ttl=64 time=0.669 ms