Migrate ALTO user docs to rst
[docs.git] / manuals / user-guide / src / main / asciidoc / vtn / VTN_How_To_view_STATIONS.adoc
1 ==== How To View Specific VTN Station Information.
2
3 This example demonstrates on how to view a specific VTN Station information.
4
5 .EXAMPLE DEMONSTRATING VTN STATIONS
6 image::vtn/vtn_stations.png[EXAMPLE DEMONSTRATING VTN STATIONS]
7
8 ===== Requirement
9 * Configure mininet and create a topology:
10
11 ----
12  $ sudo mn --custom /home/mininet/mininet/custom/topo-2sw-2host.py --controller=remote,ip=10.100.9.61 --topo mytopo
13 mininet> net
14
15  s1 lo:  s1-eth1:h1-eth0 s1-eth2:s2-eth1
16  s2 lo:  s2-eth1:s1-eth2 s2-eth2:h2-eth0
17  h1 h1-eth0:s1-eth1
18  h2 h2-eth0:s2-eth2
19 ----
20
21 * Generate traffic by pinging between hosts h1 and h2 after configuring the portmaps respectively
22
23
24 ----
25  mininet> h1 ping h2
26  PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
27  64 bytes from 10.0.0.2: icmp_req=1 ttl=64 time=16.7 ms
28  64 bytes from 10.0.0.2: icmp_req=2 ttl=64 time=13.2 ms
29 ----
30
31 ===== Configuration
32
33 * Create a Controller named controllerone and mention its ip-address in the below create-controller command
34
35 ----
36 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"controller": {"controller_id": "controllerone", "ipaddr":"10.100.9.61", "type": "odc", "version": "1.0", "auditstatus":"enable"}}' http://127.0.0.1:8083/vtn-webapi/controllers.json
37 ----
38
39 * Create a VTN named vtn1 by executing the create-vtn command
40
41 ----
42 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vtn" : {"vtn_name":"vtn1","description":"test VTN" }}' http://127.0.0.1:8083/vtn-webapi/vtns.json
43 ----
44
45 * Create a vBridge named vBridge1 in the vtn1 by executing the create-vbr command.
46
47 ----
48 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"vbridge" : {"vbr_name":"vBridge1","controller_id":"controllerone","domain_id":"(DEFAULT)" }}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges.json
49 ----
50
51 * Create two Interfaces named if1 and if2 into the vBridge1
52
53 ----
54 curl --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if1","description": "if_desc1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
55 curl -v --user admin:adminpass -H 'content-type: application/json' -X POST -d '{"interface": {"if_name": "if2","description": "if_desc2"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces.json
56 ----
57
58 * Configure two mappings on each of the interfaces by executing the below command.
59
60 The interface if1 of the virtual bridge will be mapped to the port "s1-eth1" of the switch "openflow:1" of the Mininet.
61 The h1 is connected to the port "s1-eth1".
62
63 The interface if2 of the virtual bridge will be mapped to the port "s1-eth2" of the switch "openflow:1" of the Mininet.
64 The h2 is connected to the port "s1-eth2".
65
66
67 ----
68 curl --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:01-s1-eth1"}}' http://127.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if1/portmap.json
69 curl -v --user admin:adminpass -H 'content-type: application/json' -X PUT -d '{"portmap":{"logical_port_id": "PP-OF:00:00:00:00:00:00:00:02-s2-eth2"}}' http://17.0.0.1:8083/vtn-webapi/vtns/vtn1/vbridges/vBridge1/interfaces/if2/portmap.json
70 ----
71
72 * Get the VTN stations information
73
74 ----
75 curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
76 ----
77
78 ===== Verification
79
80 ----
81 curl -X GET -H 'content-type: application/json' -H 'username: admin' -H 'password: adminpass' "http://127.0.0.1:8083/vtn-webapi/vtnstations?controller_id=controllerone&vtn_name=vtn1"
82 {
83    "vtnstations": [
84        {
85            "domain_id": "(DEFAULT)",
86            "interface": {},
87            "ipaddrs": [
88                "10.0.0.2"
89            ],
90            "macaddr": "b2c3.06b8.2dac",
91            "no_vlan_id": "true",
92            "port_name": "s2-eth2",
93            "station_id": "178195618445172",
94            "switch_id": "00:00:00:00:00:00:00:02",
95            "vnode_name": "vBridge1",
96            "vnode_type": "vbridge",
97            "vtn_name": "vtn1"
98        },
99        {
100            "domain_id": "(DEFAULT)",
101            "interface": {},
102            "ipaddrs": [
103                "10.0.0.1"
104            ],
105            "macaddr": "ce82.1b08.90cf",
106            "no_vlan_id": "true",
107            "port_name": "s1-eth1",
108            "station_id": "206130278144207",
109            "switch_id": "00:00:00:00:00:00:00:01",
110            "vnode_name": "vBridge1",
111            "vnode_type": "vbridge",
112            "vtn_name": "vtn1"
113        }
114    ]
115 }
116 ----