搜档网
当前位置:搜档网 › 原创-OpenDaylight原理解析v1.0

原创-OpenDaylight原理解析v1.0

OpendayLight

01 Introduction

01-1 Overview

From a high level view, software defined networking is commonly described in layers.

Network Apps & Orchestration: The top layer consists of applications that utilize the network for normal network communications. Also included in this layer are business and network logic applications that control, and monitor network behavior.

Controller Platform: The middle layer is the framework in which the SDN abstractions can manifest; providing a set of common APIs to the application layer (commonly referred to as the northbound interface), while implementing one or more protocols for command and control of the physical hardware within the network (typically referred to as the southbound interface). Physical & Virtual Network Devices: The bottom layer consists of the physical & virtual devices, switches, routers, etc., that make up the connective fabric between all endpoints within the network.

OpenDaylight is an open source project with a modular, pluggable, and flexible controller platform at its core.

The controller exposes open northbound APIs which are used by applications. OpenDaylight supports the OSGi framework and bidirectional REST for the northbound API. The OSGi framework is used for applications that will 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 necessarily on the same machine) as the controller. The business logic and algorithms reside in the applications. These applications use the controller to gather network intelligence, run algorithms to perform analytics, and then use the controller to orchestrate the new rules, if any, throughout the network.

The controller platform itself contains a collection of dynamically pluggable modules to perform needed network tasks. There are a series of base network services for such tasks as understanding what devices are contained within the network and the capabilities of each, statistics gathering, etc. In addition, platform oriented services and other extensions can also be inserted into the controller platform for enhanced SDN functionality.

01-2 Framework

The southbound interface is capable of supporting multiple protocols (as separate plugins), e.g. OpenFlow 1.0, OpenFlow 1.3, BGP-LS, etc. These modules are dynamically linked into a Service Abstraction Layer (SAL). The SAL exposes device services to which the modules north of it are written. The

SAL determines 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 the 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, etc. 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.

01-3 Interface

OpenDaylight Controller

Package/OSGi Bundle Exported Interfaces Description

org.opendaylight.controller.arphandler.internal

?IHostFinder

?IListenDataPacket Handles all ARP traffic: sending ARP requests to find hosts as well as responding to ARP requests from hosts.

org.opendaylight.controller.clustering.services_im plementation.internal ?IClusterContainerServices ?IClusterServices

?IClusterGlobalServices

org.opendaylight.controller.clustering.stub.interna l ?IClusterContainerServices ?IClusterGlobalServices

org.opendaylight.controller.configuration.internal ?IConfigurationService

?IConfigurationContainerServic e

?IConfigurationAware

org.opendaylight.controller.containermanager.int ernal ?IContainerManager ?IContainer

org.opendaylight.controller.forwarding.staticroutin g.internal ?IForwardingStaticRouting ?ICacheUpdateAware

?IfNewHostNotify

?IConfigurationContainerAware

org.opendaylight.controller.forwardingrulesmana ger.internal ?IContainerListener

?ISwitchManagerAware

?IForwardingRulesManager ?IInventoryListener

?ICacheUpdateAware

?IConfigurationContainerAware ?IFlowProgrammerListener

org.opendaylight.controller.hosttracker.internal ?ISwitchManagerAware ?IInventoryListener

?IfIptoHost

?IfHostListener

?ITopologyManagerAware

org.opendaylight.controller.protocol_plugin.openfl ow.internal ?IContainerListener

?IController

?IDataPacketListen

?IDataPacketMux

?IDiscoveryService

?IFlowProgrammerNotifier

?IInventoryShimExternalListener ?IMessageListener

?IOFStatisticsManager

?IPluginInDataPacketService ?IPluginInFlowProgrammerServ ice

?IPluginInInventoryService

?IPluginInReadService

?IPluginInTopologyService

?IPluginReadServiceFilter

?IRefreshInternalProvider

?IStatisticsListener

?ITopologyServiceShimListener

org.opendaylight.controller.protocol_plugins.stub.

internal

?IPluginInReadService

org.opendaylight.controller.routing.dijkstra_imple mentation.internal

? ITopologyManagerAware ? IRouting

org.opendaylight.controller.sal.implementation.int ernal

? IReadService

? IPluginOutTopologyService ? ITopologyService ?

IInventoryService

? IPluginOutInventoryService ? IFlowProgrammerService ?

IPluginOutFlowProgrammerSe rvice

? IPluginOutDataPacketService ?

IDataPacketService org.opendaylight.controller.samples.loadbalancer .internal

? IListenDataPacket ? IConfigManager

org.opendaylight.controller.samples.simpleforwar ding.internal

? IInventoryListener ? IfNewHostNotify ?

IListenRoutingUpdates

org.opendaylight.controller.statisticsmanager.inte rnal

? IStatisticsManager

org.opendaylight.controller.switchmanager.intern al

?

IListenInventoryUpdates ? ISwitchManager ? ICacheUpdateAware

?

IConfigurationContainerAware

org.opendaylight.controller.topologymanager.inte rnal

? IListenTopoUpdates ? ITopologyManager

? IConfigurationContainerAware https://www.sodocs.net/doc/642962346.html,ermanager.internal

?

ICacheUpdateAware ? IUserManager ?

IConfigurationAware

02 arphandler

1) 简介

该模块用于解析arp 包

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.sal.core,

org.opendaylight.controller.sal.utils,

org.opendaylight.controller.sal.packet,

org.opendaylight.controller.switchmanager,

org.opendaylight.controller.hosttracker,

org.opendaylight.controller.hosttracker.hostAware,

org.apache.felix.dm,

https://www.sodocs.net/doc/642962346.html,ponent,

org.slf4j

switchmanager

hosttracker

sal

5)流程图

03 clustering

03-1 Services

1)简介

定义了一系列集群服务接口,包含ICacheUpdateAware集群缓存更新时需要监听的接口,IClusterServicesCommon提供了一组集群中常用的接口,ICoordinatorChangeAware,IGetUpdates,IListenRoleChange角色改变时需要监听的接口, IClusterServices.

2)类图

3)基本原理

4)依赖服务

导出包:

org.opendaylight.controller.clustering.services

javax.transaction

5)流程图

03-2 Services-implementations

1)简介

该模块是集群服务的实现模块,主要实现了上述Services包中的接口服务。集群之间通过JGroup来进行通信,同步数据。集群数据采用infinispan来进行存储。

In?nispan是个开源的数据网格平台。它公开了一个简单的数据结构(一个Cache)来存储对象。虽然可以在本地模式下运行In?nspan,但其真正的价值在于分布式,在这种模式下,In?nispan可以将集群缓存起来并公开大容量的堆内存。这可比简单的复制强大的多,因为它会为每个结点分配固定数量的副本——服务器故障的一种恢复手段——同时还提升了可伸缩性,这是由于存储每个结点所需的工作量是与集群大小息息相关的。

JGroup是当前被广泛使用的可靠组间通信的工具之一。例如OSCache以及JBossTreeCache都是用的是JGroup。JGroup 功能十分强大,通过配置各种参数就可以充分利用它所提供的各项功能。JGroup最大的特点就是支持协议栈的可配置性,它本

是实现了基本的Java的协议栈实现,也就是最基本的消息广播的基础,同时支持附加协议栈的配置,消息的传递就是在这些协议栈之间相互传递,封装,检查,丢弃,重发。JGroup可以基于TCP协议来实现消息广播,也可以通过UDP方式来广播消息,利弊不言而喻,TCP可靠,但是代价大,性能没有UDP来的好,UDP速度快,代价小,但是消息的丢失率以及无序性有着很大的限制。但是JGroup在UDP方式的基础上,增加了协议栈的配置,通过配置上层的协议,可以保证消息的重发,大包体的分解(同时保证消息包体顺序),组内机器的状态检测等功能。

2)类图

3)基本原理

4)依赖服务

org.slf4j,

!org.jboss.*,

!bsh*,

!net.jcip.*,

javax.transaction,

*,

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.sal.core

org.infinispan

infinispan-core

5.2.3.Final

org.opendaylight.controller

clustering.services

0.4.0-SNAPSHOT

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

5)流程图

03-3 Stub

1)简介

实现了Services中的IClusterContainerServices,IClusterGlobalServices,IClusterServicesCommon接口。

2)类图

3)基本原理

4)依赖服务

javax.transaction,

org.apache.felix.dm,

org.slf4j,

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.sal.core

org.opendaylight.controller

clustering.services

0.4.0-SNAPSHOT

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

5)流程图

04 commons

简介

该模块提供了3个配置文件,定义了一些公共属性,供其它模块使用。

05 configuration

configuration

1)简介

该模块提供了配置管理的接口。

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.sal.utils,

https://www.sodocs.net/doc/642962346.html,ng3.builder

org.opendaylight.controller.configuration

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

configuration.implementation

1)简介

该模块实现了configuration的口,完成一些和配置相关的任务。

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.configuration,

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.sal.utils,

org.opendaylight.controller.sal.core,

org.osgi.framework,

org.slf4j,

org.apache.felix.dm

org.opendaylight.controller

clustering.services

0.4.0-SNAPSHOT

org.opendaylight.controller

configuration

0.4.0-SNAPSHOT

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

06 containermanger

containermanger

1)简介

提供容器管理的基本接口。

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.sal.action,

org.opendaylight.controller.sal.authorization,

org.opendaylight.controller.sal.core,

org.opendaylight.controller.sal.flowprogrammer,

org.opendaylight.controller.sal.match,

org.opendaylight.controller.sal.reader,

org.opendaylight.controller.sal.utils,

https://www.sodocs.net/doc/642962346.html,ng3.builder

org.opendaylight.controller.containermanager

containermanager.implementation

1)简介

容器管理实现类,

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.containermanager,

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.sal.packet,

org.opendaylight.controller.sal.utils,

org.opendaylight.controller.sal.core,

org.opendaylight.controller.sal.action,

org.opendaylight.controller.sal.flowprogrammer,

org.opendaylight.controller.sal.match,

org.opendaylight.controller.sal.reader,

org.eclipse.osgi.framework.console,

org.osgi.framework,

org.slf4j,

org.apache.felix.dm

org.opendaylight.controller

clustering.services

0.4.0-SNAPSHOT

org.opendaylight.controller

containermanager

0.4.0-SNAPSHOT

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

07 distribuction

1)简介

是opendaylight的主入口,提供了启动程序的脚本,run.bat为windows下运行脚本,run.sh 为linux下运行脚本。

2)类图

3)基本原理

4)系统模块

../../forwarding/staticrouting

../../clustering/services

../../clustering/services_implementation

../../clustering/stub

../../clustering/test

../../configuration/api

../../configuration/implementation

../../routing/dijkstra_implementation ../../arphandler

../../forwardingrulesmanager

../../hosttracker

../../containermanager/api

../../containermanager/implementation ../../switchmanager

../../statisticsmanager

../../topologymanager

../../usermanager

../../security

../../../third-party/openflowj

../../../third-party/net.sf.jung2

../../../third-party/jersey-servlet

../../sal/api

../../sal/implementation

../../web/root

../../web/flows

../../web/devices

../../web/troubleshoot

../../web/topology

../../northbound/commons

../../northbound/topology

../../northbound/staticrouting

../../northbound/statistics

../../northbound/flowprogrammer

../../northbound/hosttracker

../../northbound/subnets

../../northbound/switchmanager

../../logging/bridge

../../protocol_plugins/openflow

../../samples/simpleforwarding

../../samples/loadbalancer

../../samples/northbound/loadbalancer

08 forwarding

forwarding.staticrouting

1)简介

提供静态路由配置与静态路由的创建功能,用于连接SDN网络与非SDN网络。

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.sal.utils,

org.opendaylight.controller.sal.core,

org.opendaylight.controller.configuration,

org.opendaylight.controller.forwardingrulesmanager,

org.opendaylight.controller.hosttracker,

org.opendaylight.controller.hosttracker.hostAware,

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.sal.packet,

org.opendaylight.controller.sal.routing,

org.opendaylight.controller.topologymanager,

org.eclipse.osgi.framework.console,

org.osgi.framework,

org.slf4j,

org.apache.felix.dm,

https://www.sodocs.net/doc/642962346.html,ng3.builder

org.opendaylight.controller.forwarding.staticrouting

org.opendaylight.controller

topologymanager

0.4.0-SNAPSHOT

org.opendaylight.controller

forwardingrulesmanager

0.4.0-SNAPSHOT

org.opendaylight.controller

hosttracker

0.4.0-SNAPSHOT

org.opendaylight.controller

configuration

0.4.0-SNAPSHOT

junit

junit

4.8.1

test

org.opendaylight.controller

sal

0.4.0-SNAPSHOT

5)流程图

forwardingrulesmanager

1)简介

管理网络容器中的转发规则,包括安装与删除;同时也负责维护安装在网络节点上的转发规则的中心存储仓库。

2)类图

3)基本原理

4)依赖服务

org.opendaylight.controller.forwardingrulesmanager

org.opendaylight.controller.clustering.services,

org.opendaylight.controller.configuration,

org.opendaylight.controller.hosttracker,

org.opendaylight.controller.hosttracker.hostAware,

org.opendaylight.controller.switchmanager,

org.opendaylight.controller.sal.action,

org.opendaylight.controller.sal.core,

org.opendaylight.controller.sal.flowprogrammer,

org.opendaylight.controller.sal.match,

org.opendaylight.controller.sal.utils,

org.opendaylight.controller.sal.packet,

javax.xml.bind.annotation,

javax.xml.bind,

相关主题