Tags:


Forum Replies

  1. Hello Rene,
    can you please explain to us more about RESTCONF and NETCONF and what is the difference? also can we integrate ODL controller with regular Cisco devices in GNS3 ?

    thanks

  2. Hi @ammar.eng100

    There’s not really a quick answer to this but to get an idea what NETCONF and RESTCONF are about, let me show you an example. This is done on an CSR1000V router running IOS XE.

    ## RESTCONF

    Here’s an example of NETCONF on a Cisco IOS router. It’s an alternative to the CLI where you can use XML to retrieve information or to configure the device. It uses RPC for transport and can be used through SSH:

    R1(config)#netconf ssh

    Let’s log in:

    $ ssh admin@192.168.1.1 -s netconf

    The router will respond with a hello like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <hello
    	xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    	<capabilities>
    		<capability>urn:ietf:params:netconf:base:1.0</capability>
    		<capability>urn:ietf:params:netconf:capability:writeable-running:1.0</capability>
    		<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
    		<capability>urn:ietf:params:netconf:capability:url:1.0</capability>
    		<capability>urn:cisco:params:netconf:capability:pi-data-model:1.0</capability>
    		<capability>urn:cisco:params:netconf:capability:notification:1.0</capability>
    	</capabilities>
    	<session-id>2035438880</session-id></hello>]]>]]>
    

    We need to send a hello to the router:

    <?xml version="1.0" encoding="UTF-8"?>
    <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
        <capabilities>
            <capability>urn:ietf:params:netconf:base:1.0</capability>
        </capabilities>
    </hello>]]>]]>
    

    Now we can send commands, for example, request the configuration of an interface:

    <?xml version="1.0"?>
    <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"xmlns:cpi="http://www.cisco.com/cpi_10/schema"
    message-id="101">
       <get-config>
            <source>
                 <running/>
             </source>
              <filter>
                  <config-format-text-cmd>
                   <text-filter-spec>
            interface GigabitEthernet2
                     </text-filter-spec>
                  </config-format-text-cmd>
              </filter>
          </get-config>
    

    This is what the router will send:

    <?xml version="1.0" encoding="UTF-8"?><rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><data><cli-c</cmd>data><cmd>!
    </cmd>nterface GigabitEthernet2
    </cmd>ip address dhcp
    </cmd>negotiation auto
    </cmd></cli-config-data></data></rpc-reply>]]>]]>
    

    We get the configuration of the GigabitEthernet2 interface in XML format. The advantage of these XML outputs is that they can easily be parsed by scripts, making it easier to automate things.

    ## RESTCONF

    A bit similar as NETCONF but it uses an API through HTTP:

    R1(config)#restconf
    R1(config)#virtual-service csr_mgmt
    R1(config-virt-serv)#ip shared host-interface GigabitEthernet 2
    R1(config-virt-serv)#activate
    

    Now we do an HTTP REQUEST for this URL:

    http://192.168.1.1/restconf/api/config/native/interface/GigabitEthernet/2/ip/address

    And we receive an XML object in return:

    <address
    	xmlns="http://cisco.com/ns/yang/ned/ios"
    	xmlns:y="http://tail-f.com/ns/rest"
    	xmlns:ios="http://cisco.com/ns/yang/ned/ios">
    	<dhcp/>
    </address>
    

    Above you can see that the IP address was assigned by DHCP.

    Since IOS XE supports NETCONF / RESTCONF, you could use it with a controller that configures these devices. I believe ODL does have support for IOS XE. In my SDN example, the control plane is only in the controller…not in the devices anymore.

    Hope this helps!

  3. Hi @veera.krn

    Both options are possible, whatever you prefer. It’s possible to create a single virtual machine that includes mininet and multiple SDN controllers.

    Personally, I like to use the VM images that are offered. Mininet also has a pre-installed image:

    http://mininet.org/download/

    OpenDayLight has a VM image that includes their SDN controller and mininet:

    https://wiki.opendaylight.org/view/CrossProject:Integration_Group:Test_VMs

    Using these images usually saves you a lot of time compared to installing everything from source yourself.

  4. Hi Rene,

    I have difficulties understanding this step. sorry, not so familiar with Linux commands:

    Open the following file in your favorite text editor:

    $ vim ~/.bashrc
    And add the following line to set the JAVA_HOME variable:

    export JAVA_HOME=/usr/lib/jvm/default-java
    Save the file and execute the bashrc file:

    $ source ~/.bashrc

3 more replies! Ask a question or join the discussion by visiting our Community Forum