Opendaylight-boron Study notes: 6 VTN Module

Source: Internet
Author: User
Tags curl json
environment and software release notes

===

Sn-controller:

Cpu:2 cores

Ram:4gb

Disk:32gb

Operating system:centos7 x86_64 1611 (Linux 3.10.0-514) Infrastructure Server

IP1:10.0.3.100/24 (Public Network)

IP2:172.16.3.100/24 (SDN Network)

===

Opendaylight:boron

Download Address Reference

Virtual Tenant Network (VTN)

"Opendaylight Application Guide" (Hong Tang, etc.) functional Experience

Opendaylight's VTN is an application on the SDN controller that provides a multi-tenant virtual network. It consists of two major components: VTN Manager VTN Coordinator VTN Manager

Install the VTN plugin in the Karaf console of the ODL controller:

Opendaylight-user@root>feature:install Odl-vtn-manager odl-vtn-manager-rest Odl-vtn-manager-neutron

Send the following rest request to create a VTN:

[Spinlock@archer ~]$ curl-d-\
>--user "admin": "admin" \
>-h "Content-type:application/json" \
> -h "Accept:application/json" \
>-x POST \
> Http://10.0.3.100:8181/restconf/operations/vtn:update-vtn \
>-d ' {"input": {"Tenant-name": "Vtn1"}} '
http/1.1 OK
set-cookie:jsessionid= 1UVJEUT3QYYNCICO5HA2BTBRR; Path=/restconf
Expires:thu, 1970 00:00:00 GMT
Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:12:21 GMT
content-type:application/json
transfer-encoding:chunked
Server:jetty (8.1.19.v20160209)

{"Output": {"status": "CREATED"}}

After sending the request, return the status code of OK and send the rest request below to view the VTN status:

[Spinlock@archer ~]$ curl-d-\
>--user "admin": "admin" \
>-h "Accept:application/json" \
>-H "C Ontent-type:application/json "\
> x GET \
> Http://10.0.3.100:8181/restconf/operational/vtn:vtns
http/1.1 OK
Set-cookie:jsessionid=u9c2ec8bfx4osiq1rio4l4wn; Path=/restconf
Expires:thu, 1970 00:00:00 GMT
Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:15:39 GMT
content-type:application/json
vary:accept-encoding, User-Agent
transfer-encoding:chunked
Server:jetty (8.1.19.v20160209)

{"Vtns": {"VTN": [{"Name": "Vtn1", "Vtenant-config": {"hard-timeout": 0, " Idle-timeout ":", "Vbridge": [{"Name": "VBR1", "Bridge-status": {"Path-faults": 0, "state": "UNKNOWN"}, " Vbridge-config ": {" Age-interval ": 600}}]}}}

A status code of $ OK is returned and contains the data of the VTN1 after the send is completed. Send the following request to delete the created VTN:

[Spinlock@archer ~]$ curl-d-\
>--user "admin": "admin" \
>-h "Content-type:application/json" \
> -X POST \
> HTTP://10.0.3.100:8181/RESTCONF/OPERATIONS/VTN:REMOVE-VTN \
>-d ' {"input": {"Tenant-name": "Vtn1"}} '
http/1.1-ok
set-cookie:jsessionid=1ea0ylyvlmz27m8io74da2b46; Path=/restconf
Expires:thu, 1970 00:00:00 GMT
Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:40:02 GMT
content-type:application/yang.operation+json
content-length:0
Server:jetty (8.1.19.v20160209)

Returns a status code of OK after sending the request. Description Delete succeeded. Here, the official website does not delete Vtn's rest instructions, generally these rest request instructions, can log on to the ODL control page, found in the Yang UI. VTN Coordinator

VTN Coordinator's Rest API documentation: Opendaylight virtual Tenant Network (VTN): VTN coordinator:restapi Building Primitives

In Vtn, virtual networks are built from virtual nodes (such as virtual bridges, virtual routes), virtual interfaces, and virtual links. By using virtual links to connect virtual interfaces on virtual nodes, you can make up a virtual network that contains L2 or L3 forwarding capabilities. In Vtn, the following virtual nodes are included:

Virtual node name Virtual node Capabilities
Vbridge Logic representation with 2-layer switching capability
VRouter Logical representation of the owning routing function
VTep Logical representation of tunnel endpoints
Vtunnel Logical representation of tunnels
Vbypass Logical representation of connections between managed networks
Virtual interface Represents an endpoint (interface) on a virtual node
Virtual linkv (Vlink) Represents a L1 layer connection between virtual interfaces (physical connection)
Experiment

Refer to the examples given in the website for the relevant experimental verification.

mininet Virtual machine parameters: HOSTNAME:MININET-VM1 Cpu:2 Core RAM:4GB ip1:10.0.3.101 (public network) ip2:172.16.3.101 (SDN Network) L2 layer Virtual network

Reference example using Mininet to create a topology

In Mininet-vm1, create a tree-type topology:

mininet@mininet-vm1:~$ sudo mn--topo=tree,2--mac--controller=remote,ip=10.0.3.100,port=6633--switch Ovsk, Protocols=openflow13
mininet> Pingall
* * * ping:testing Ping reachability
H1-h2 H3 H4 H2-
H 1 H3 h4
H3, H1 H2 H4
H4, H1 H2 H3
* * results:0% dropped (12/12 received)
mininet> net
H 1 h1-eth0:s2-eth1
h2 h2-eth0:s2-eth2
h3 h3-eth0:s3-eth1
h4 h4-eth0:s3-eth2
s1 lo:  s1-eth1: S2-eth3 s1-eth2:s3-eth3
s2 lo:  s2-eth1:h1-eth0 s2-eth2:h2-eth0 s2-eth3:s1-eth1
S3 lo:  s3-eth1: H3-eth0 s3-eth2:h4-eth0 s3-eth3:s1-eth2
C0
Configure VTN

Send the following request to create the VTN:

[Spinlock@archer ~]$ curl-d-\
>--user "admin": "admin" \
>-h "Content-type:application/json" \
> -h "Accept:application/json" \
>-x POST \
> Http://10.0.3.100:8181/restconf/operations/vtn:update-vtn \
>-d ' {"input": {"Tenant-name": "Vtn1"}} '
http/1.1 OK
set-cookie:jsessionid= 1UVJEUT3QYYNCICO5HA2BTBRR; Path=/restconf
Expires:thu, 1970 00:00:00 GMT
Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:12:21 GMT
content-type:application/json
transfer-encoding:chunked
Server:jetty (8.1.19.v20160209)

{"Output": {"status": "CREATED"}}

Returns a $ OK status code after the request and contains the content that was created successfully. Send the following request to create a virtual bridge VBR1:

[Spinlock@archer ~]$ curl \
>--user "admin": "admin" \
>-h "Content-type:application/json" \
>-x P OST \
> Http://10.0.3.100:8181/restconf/operations/vtn-vbridge:update-vbridge \
>-d ' {"input": {" Tenant-name ":" Vtn1 "," Bridge-name ":" Vbr1 "}} '
{" output ": {" status ":" CREATED "}}

Returns a $ OK status code after the request and contains the content that was created successfully. Create two virtual interfaces for a virtual bridge using the following two rest requests:

[Spinlock@archer ~]$ curl-d-\ >--user "admin": "admin" \ >-H "Content-type:application/json" \ >-x POST \ & Gt Http://10.0.3.100:8181/restconf/operations/vtn-vinterface:update-vinterface \ >-d ' {"input": {"Tenant-name": " Vtn1 "," Bridge-name ":" VBR1 "," Interface-name ":" If1 "}} ' http/1.1 OK set-cookie:jsessionid= 1D84IDPMJ8U9EZKCI184MDZMN; Path=/restconf Expires:thu, 1970 00:00:00 GMT Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:21:30 GMT content-type:application/yang.operation+json transfer-encoding:chunked Server: Jetty (8.1.19.v20160209) {"Output": {"status": "CREATED"}} [Spinlock@archer ~]$ curl-d-\ >--user "admin": "admin" \ &G T -h "Content-type:application/json" \ >-x POST \ > Http://10.0.3.100:8181/restconf/operations/vtn-vinterface: Update-vinterface \ >-d ' {"input": {"Tenant-name": "Vtn1", "Bridge-name": "VBR1", "Interface-name": "If2"}} ' http/1.1 OK Set-cookie:jsessionid=evg2giwcf42990lfvulk91PQ; Path=/restconf Expires:thu, 1970 00:00:00 GMT Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:23:20 GMT content-type:application/yang.operation+json transfer-encoding:chunked Server: Jetty (8.1.19.v20160209) {"Output": {"status": "CREATED"}}

The

Two requests enabled the virtual interface to be created successfully. Send two rest requests below to set port mappings:

[Spinlock@archer ~]$ curl-d-\ >--user "admin": "admin" \ >-H "Content-type:application/json" \ >-x POST \ & Gt HTTP://10.0.3.100:8181/RESTCONF/OPERATIONS/VTN-PORT-MAP:SET-PORT-MAP \ >-d ' {"input": {"Tenant-name": "Vtn1", " Bridge-name ":" VBR1 "," Interface-name ":" If1 "," Node ":" Openflow:2 "," Port-name ":" S2-eth1 "}} ' http/1.1 OK set-cookie : jsessionid=1ghi8v29vruwzw20by3q3hc84; Path=/restconf Expires:thu, 1970 00:00:00 GMT Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:28:56 GMT content-type:application/yang.operation+json transfer-encoding:chunked Server: Jetty (8.1.19.v20160209) {"Output": {"status": "CREATED"}} [Spinlock@archer ~]$ curl-d-\ >--user "admin": "admin" \ &G T -h "Content-type:application/json" \ >-x POST \ > Http://10.0.3.100:8181/restconf/operations/vtn-port-map: SET-PORT-MAP \ >-d ' {"input": {"Tenant-name": "Vtn1", "Bridge-name": "VBR1", "Interface-name": "If2", "Node": " Openflow:3 "," Port-name":" S3-eth1 "}} ' http/1.1-ok set-cookie:jsessionid=1w6wntp502au11viqd7e6q1s8m; Path=/restconf Expires:thu, 1970 00:00:00 GMT Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:29:56 GMT content-type:application/yang.operation+json transfer-encoding:chunked Server: Jetty (8.1.19.v20160209) {"Output": {"status": "CREATED"}}

You can see that the two request operation succeeded. The following tests are performed in the MN console in MININET-VM1:

mininet> Pingall
* * * ping:testing Ping reachability
H1-
H2 H3 H4 H2-H1 H3 H4 H3 H1 H2
H4
H4, H1 H2 H3
* * results:0% dropped (12/12 received)

Between H1 and H3 is a pass. However, I personally feel that the official website gives such an experiment does not seem to show that vtn really effective, after all, before setting up VTN H1 and H3 is pass. However, the current VTN configuration can be seen through the rest request:

[Spinlock@archer ~]$ curl-d-\ >--user "admin": "admin" \ >-H "Content-type:application/json" \ >-x GET \ &G T http://10.0.3.100:8181/restconf/operational/vtn:vtns/HTTP/1.1 OK set-cookie:jsessionid= 1r3oda59gx3n2y52koy9jv7e6; Path=/restconf Expires:thu, 1970 00:00:00 GMT Set-cookie:rememberme=deleteme; path=/restconf; max-age=0;
Expires=sun, 21-may-2017 13:37:28 GMT Content-type:application/yang.data+json vary:accept-encoding, User-Agent transfer-encoding:chunked Server:jetty (8.1.19.v20160209) {"Vtns": {"VTN": [{"Name": "Vtn1", "Vtenant-config": {" Hard-timeout ": 0," idle-timeout ":" "," Vbridge ": [{" Name ":" VBR1 "," Bridge-status ": {" Path-faults ": 0," state ":" Up "}," Vbridge-config ": {" Age-interval ": $}," Vinterface ": [{" Name ":" If2 "," Vinterface-config ": {" Enabled ": true}," Port-map-config ": {" Vlan-id ": 0," node ":" Openflow:3 "," Port-name ":" S3-eth1 "}," Vinterface-status ": {" entity-state ":" Up, ' state ': "Up", "Mapped-port": "Openflow:3:1"}},{"name": "If1", "Vinterface-config": {"Enabled": True}, "Port-map-config": {"Vlan-id": 0, "node": "Openflow:2", "Port-name": "S2-eth1"}, "Vinterface-status": {" Entity-state ': ' Up ', ' state ': ' Up ', ' mapped-port ': ' Openflow:2:1 '}}]}]}}}

You can delete Vtn by using the following rest request:

[Spinlock@archer ~]$ curl-d-\
>--user "admin": "admin" \
>-h "Content-type:application/json" \
> -X POST \
> HTTP://10.0.3.100:8181/RESTCONF/OPERATIONS/VTN:REMOVE-VTN \
>-d ' {"input": {"Tenant-name": "Vtn1"}} '
http/1.1-ok
set-cookie:jsessionid=1ea0ylyvlmz27m8io74da2b46; Path=/restconf
Expires:thu, 1970 00:00:00 GMT
Set-cookie:rememberme=deleteme; path=/restconf; max-age=0; Expires=sun, 21-may-2017 13:40:02 GMT
content-type:application/yang.operation+json
content-length:0
Server:jetty (8.1.19.v20160209)
VLAN Mapping Experiment

Reference example to create a topological environment

Will vlan_vtn_test.py
Download to MININET-VM1. and execute the following command to create the topology:

mininet@mininet-vm1:~$ sudo mn--controller=remote,ip=10.0.3.100,port=6633--custom=./ vlan_vtn_test.py--topo=mytopo--mac--switch=ovsk,protocols=openflow13 mininet> net H1 h1-eth0.200:s1-eth1 H2 H2-eth0.300:s2 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.