OpenDayLight学习记录之User Guide

讲真是有点害怕的

Chapter 1 OpenDaylight Controller Overview

The OpenDaylight controller is JVM software and can be run from any operating system and hardware as long as it supports Java. The controller is an implementation of the Software Defined Network (SDN) concept and makes use of the following tools:

  • Maven: OpenDaylight uses Maven for easier build automation. Maven uses pom.xml (Project Object Model) to script the dependencies between bundle and also to describe what bundles to load and start.
  • OSGi: This framework is the back-end of OpenDaylight as it allows dynamically loading bundles and packages JAR files, and binding bundles together for exchanging information.
  • JAVA interfaces: Java interfaces are used for event listening, specifications, and forming patterns. This is the main way in which specific bundles implement call-back functions for events and also to indicate awareness of specific state.
  • REST APIs: These are northbound APIs such as topology manager, host tracker, flow programmer, static routing, and so on.(我应该只需要学习北向相关)
    The controller exposes open northbound APIs which are used by applications. The OSGi framework and bidirectional REST are supported for the northbound APIs. The OSGi framework is used for applications that run in the same address space as the controller while the REST (web-based) API is used for applications that do not run in the same address space (or even the same system) as the controller.
    The business logic and algorithms reside in the applications. These applications use the controller to gather network intelligence, run its algorithm to do analytics, and then orchestrate the new rules throughout the network.
    On the southbound, multiple protocols are supported as plugins, e.g. OpenFlow 1.0, OpenFlow 1.3, BGP-LS, and so on. The OpenDaylight controller starts with an OpenFlow 1.0 southbound plugin. Other OpenDaylight contributors begin adding to the controller code. These modules are linked dynamically into a Service Abstraction Layer (SAL).

The SAL exposes services to which the modules north of it are written. The SAL figures out how to fulfill the requested service irrespective of the underlying protocol used between the controller and the network devices. This provides investment protection to the applications as OpenFlow and other protocols evolve over time. For the controller to control devices in its domain, it needs to know about the devices, their capabilities, reachability, and so on. This information is stored and managed by the Topology Manager. The other components like ARP handler, Host Tracker, Device Manager, and Switch Manager help in generating the topology database for the Topology Manager.

Chapter 2 Using the OpenDaylight User Interface(DLUX)

2.1 Getting started with DLUX

To integrate with Opendaylight Controller you must enable DLUX Karaf feature. You can enable adsal, md sal and various other bundles within Karaf depending on the features you would like to access using DLUX. Each feature can be enabled or disabled separately.

[Important] Important
Ensure that you have created a topology and enabled MD-SAL feature in the Karaf distribution before you use DLUX for network management.

2.3 Working with DLUX

Modules that use the MD SAL based apis are :

Nodes
Yang UI
Topology
Modules that use the AD SAL based apis are:

Connection manager
Container
Network
Flows

To view features that are enabled:

Right click on the DLUX page.
Select Inspect Element and then click Network. A table that contains the list of features and if they are available in the DLUX distribution. The features that are not enabled is highlighted with red font and has status 404 Not Found.
在这里插入图片描述

2.4 Viewing Network Statistics

在这里插入图片描述
这里的7个都是switch
The Nodes module on the left pane enables you to view the network statistics and port information for the switches in the network.

To use the Nodes module:

Select Nodes on the left pane. The right pane displays atable that lists all the nodes, node connectors and the statistics.
Enter a node ID in the Search Nodes tab to search by node connectors.
Click on the Node Connector number to view details such as port ID, port name, number of ports per switch, MAC Address, and so on.
Click Flows in the Statistics column to view Flow Table Statistics for the particular node like table ID, packet match, active flows and so on.
Click Node Connectors to view Node Connector Statistics for the particular node ID.

2.5 Viewing Network Topology

To view network topology:

Select Topology on the left pane. You will view the graphical representation on the right pane. In the diagram blue boxes represent the switches, the black represents the hosts available, and lines represents how switches are connected.
Hover your mouse on hosts,links, or switches to view source and destination ports.
Zoom in and zoom out using mouse scroll to verify topology for huge topologies.
在这里插入图片描述
在我pingall后,所有的主机就显现啦

2.6 Interacting with the Open Daylight Controller (ODL)

The Yang UI module enables you to interact with the ODL. For more information about Yang Tools, see https://wiki.opendaylight.org/view/YANG_Tools:Main [YANG_Tools].

在这里插入图片描述
To use Yang UI:

  1. Select Yang UI on the left pane. The right pane is divided in two parts.

  2. The top part displays a tree of APIs and subAPIs and buttons to call possible functions (GET, POST, PUT, DELETE, …). Not every subAPIs can call every function. For example, subAPIs “operational” have GET functionality only. Inputs can be filled from ODL when existing data from ODL is displayed or can be filled by user on the page and sent to ODL. Buttons under the API tree are variable. It depends on subAPI specifications. Common buttons are:

    • GET to get data from ODL,
    • PUT and POST for sending data to ODL for saving
    • DELETE for sending data to ODL for deleting. You must specify the xpath for all these operations. This path is displayed in the same row before buttons and it can include text inputs for specific path elements identifiers.
  3. The bottom part of the right pane displays inputs according to the chosen subAPI. Every subAPI is represented by list elements of list statement. It is possible to have a many list elements of one list. + For example, a device can store multiple flows. In this case “flow” is name of the list and every list element is different by a key value. List element of list can obtain other lists. Every list element has a list name, a key name and its value, and a button for removing this list element. Usually the key of the list statement obtains an ID. Inputs can be filled from ODL using GET button from xpath part, or can be filled by user on the page and sent to ODL.
    在这里插入图片描述

  4. Click Show Preview button under API tree to display request that will be sent to ODL. A pane is displayed on the right side with text of request when some input is filled.

2.6.1 Displaying Topology on the Yang UI

在这里插入图片描述
To display topology:

Select subAPI network-topology → operational → network-topology.
Get data from ODL by clicking on the “GET” button.
Click Display Topology.
但是我一开始没操作好,Display topology 显示无topology然后消失了
在这里插入图片描述
重启又有了,但是和示意图中不一样,这个是黑白的

2.6.2 Configuring List Elements on the Yang UI

The list is displayed like tree structure with possibility to expand or collapse by the arrow before name of the list. To configure list elements on the Yang UI:

  1. To add a new list element with empty inputs use the plus icon-button + that is provided after list name. When some list element is added, button with his name and key value is displayed.
    To remove several list elements, use the X button that is provided after every list element.

  2. DLUX List Elements. image::dlux-yang-list elements.png[DLUX list elements,width=500]

  3. Key of list is one or more inputs, which are used like identifier of list element. All list elements in one list must have different key values. If some elements has the same key values, the new warning icon ! is displayed near their name buttons.

  4. When the list obtains at least one list element, after + icon is icon for selecting the list element displayed. You can choose one of them by clicking the icon. The name button of the list element and name buttons of its neighbours will be displayed in the row list. You can can forward or backward row list of list elements name buttons by clicking on the arrow button on the end of row.
    一头雾水不知道自己在干什么orz

Chapter 3. Running XSQL Console Commands and Queries

3.1 XSQL overview

XSQL is an XML-based query language that describes simple stored procedures which parse XML data, query or update database tables, and compose XML output. It allows you to query tree models as if they were a sequential database. For example, you could run a query that lists all of the ports configured on a particular module and their attributes.

The following sections will cover the XSQL installation process, supported XSQL commands, and the proper way to structure queries.

3.2 Installing XSQL

在这里插入图片描述
啊我的OpenDayLight版本是锂啊

3.3 XSQL Console Commands

When entering a command in the XSQL console, structure it as follows: odl:xsql

The following table describes the commands supported in the OpenDaylight Helium release.

Table 3.1. Supported XSQL Console Commands

CommandDescription
rRepeats the last command you executed.
list vtablesLists the schema node containers that are currently installed. Whenever an OpenDaylight module is installed, its YANG model is placed in the Schema Context. At that point, the XSQL receives a notification, confirms that the module’s YANG model resides in the Schema Context, and then maps the model to XSQL by setting up the necessary vtables and vfields. This command is useful when you need to determine vtable information for a query.
list vfields Lists the vfields present in a specific vtable. This command is useful when you need to determine vfields information for a query.
jdbc When the ODL server is behind a firewall, and the JDBC client cannot connect to the JDBC server, run this command to start the client as if it was a server and establish a connection.
exitCloses the console.
tocsvEnables/disables the forwarding of query output as a .csv file.
filename Specifies the .tocsv file to which query data is exported. If you do not specify a value for this option when the toccsv option is enabled, the filename for the query data file is generated automatically.

在这里插入图片描述

3.4 XSQL queries

skip criteria operator

Example: skip Criteria Operator
Say you are looking at the following structure and want to determine all of the ports that belong to a YY type module:

Network Element 1

   Module 1, Type XX
        Module 1.1, Type YY
              Port 1
              Port 2
    Module 2, Type YY
              Port 1
              Port 2

If you specify Module.Type=’YY’ in your query criteria, the ports associated with module 1.1 will not be returned since its parent module is type XX. Instead, enter Module.Type=’YY’ or skip Module!=’YY’. This tells XSQL to disregard any parent module data that does not meet the type YY criteria and collect results for any matching child modules. In this example, you are instructing the query to skip module 1 and collect the relevant data from module 1.1.

心情有点复杂,什么都看不懂orz
Defense4All是防DDoS攻击的

8 L2Switch

8.2 Create a network using mininet

在这里插入图片描述

8.3 Checking Address Observations

Address Observations are added to the Inventory data tree.

The Address Observations on a Node Connector can be checked through a browser or a REST Client.
在这里插入图片描述

http://127.0.0.1:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:1

8.4 checking host

Host information is added to the Topology data tree.

Host address
Attachment point (link) to a node/switch
This host information and attachment point information can be checked through a browser or a REST Client.

在这里插入图片描述

http://127.0.0.1:8080/restconf/operational/network-topology:network-topology/topology/flow:1/

Checking STP status of each link

STP Status information is added to the Inventory data tree.

A status of “forwarding” means the link is active and packets are flowing on it.
A status of “discarding” means the link is inactive and packets are not sent over it.
The STP status of a link can be checked through a browser or a REST Client.

在这里插入图片描述
http://127.0.0.1:8080/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2

Components of the L2Switch

  • Packet Handler: Decodes the packets coming to the controller and dispatches them appropriately
  • Loop Remover: Removes loops in the network
  • Arp Handler: Handles the decoded ARP packets
  • Address Tracker: Learns the Addresses (MAC and IP) of entities in the network
  • Host Tracker: Tracks the locations of hosts in the network
  • L2Switch Main: Installs flows on each switch based on network traffic

Configuration of L2Switch Components

我的环境下的xml文件都在

SDNHub_Opendaylight_Tutorial/distribution/opendaylight-karaf/target/assembly/etc/opendaylight/karaf

在这里插入图片描述
rp Handler (54-arphandler.xml)



    <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

      <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">

        <module>

          <type xmlns:prefix="urn:opendaylight:packet:arp-handler-impl">

            prefix:arp-handler-impl

          </type>

          <name>arp-handler-impl</name>

          <arp-flow-table-id>0</arp-flow-table-id>

          <arp-flow-priority>1</arp-flow-priority>

          <arp-flow-idle-timeout>0</arp-flow-idle-timeout>

          <arp-flow-hard-timeout>0</arp-flow-hard-timeout>

          <flood-flow-table-id>0</flood-flow-table-id>

          <flood-flow-priority>2</flood-flow-priority>

          <flood-flow-idle-timeout>0</flood-flow-idle-timeout>

          <flood-flow-hard-timeout>0</flood-flow-hard-timeout>

          <flood-flow-installation-delay>2000</flood-flow-installation-delay>

          <is-proactive-flood-mode>true</is-proactive-flood-mode>

          <is-hybrid-mode>false</is-hybrid-mode>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值