Post on 10-Jan-2017
ONOS와 Raspberry Pi 기반
가상/물리 SDN 실증 환경 구축과 응용 개발
경희대학교 이성원 교수
Email : drsungwon@khu.ac.kr
Web : http://mobilelab.khu.ac.kr
경희대학교 컴퓨터공학과 모바일컨버전스Lab 한상윤
Email : sangyun0628@khu.ac.kr
Mobile Convergence Laboratory 2
목차A Table of Contents
ONOS
ONOS(Open Network Operating System) 소개, 아키텍처 분석, 설치 및 데모Keyword : Distributed core,ON.Lab, maven, karaf
OpenVirteX
OVX 소개, Network Hypervisor와 가상화 플랫폼의 기능, 설치 및 데모Keyword : Hypervisor, 네트워크 가상화 플랫폼, Resilient, elastic
Pi Stack Switch / SDN 구축
Raspberry Pi와 Open vSwitch를 이용한 SDN 테스트베드 구축Keyword : Raspberry Pi, Open vSwitch, OpenFlow 스위치
Q&A
질의응답
Pi Stack Switch
SDN Network Operating System & SDN Control Platform
Mobile Convergence Laboratory 3
• Carrier grade SDN OS for service providers
• SDN OS with scalability, high availability, high performance and right abstractions
• By
Mobile Convergence Laboratory 4
Mobile Convergence Laboratory 5
Non-profitTools/Platforms for SDN community
Mobile Convergence Laboratory 6
Mobile Convergence Laboratory 7
Mobile Convergence Laboratory 8
Mobile Convergence Laboratory 9
Supporting members
Mobile Convergence Laboratory 10
Projects
Mobile Convergence Laboratory 11
12Mobile Convergence Laboratory
ONOS의 목표는뭘까?
기존의 수많은SDN controller
Mobile Convergence Laboratory 13
Mobile Convergence Laboratory 14
commercialproducts
Mobile Convergence Laboratory 15
commercialproducts
Mobile Convergence Laboratory 16
High Availability
• Multiple Instance Clustering
• Fault tolerance using Distributed Core
• Five Nines availability
Mobile Convergence Laboratory 17
High Availability High Performance
• High Throughput• ~500K-1M path setups/second
• High Volume• ~500GB-1TB state data
• Low Latency• 10~100ms
Mobile Convergence Laboratory 18
High Availability High Performance Scalability
• OSGi based OSS Karaf Deploy, Config
• Distributed Clustering Sync, Share
• Dynamic Clustering
Mobile Convergence Laboratory 19
High Availability High Performance Scalability White Box (Open)
Reference : ONOS wiki
Mobile Convergence Laboratory 20
High Availability High Performance Scalability White Box (Open)
Mobile Convergence Laboratory 21
The center of SDN/NFV
Mobile Convergence Laboratory 22
ONOS Framework(ONOSFW)
Mobile Convergence Laboratory 23
ONOS as an SDN controller within the
VIM
Mobile Convergence Laboratory 24
ONOS with Linux Foundation
ONOS ArchitectureThe changing history of architecture
Overall architecture
Subsystem Structure
Mobile Convergence Laboratory 25
Mobile Convergence Laboratory 26
The History of ONOS architecture
Founded - 2012
ONOS prototype 12013
(scalability, availability)
ONOS prototype 22013
(performance)
First OpenAvocet 1.0.02014.12.05
Mobile Convergence Laboratory 27
Prototype-1 (1G core)
Mobile Convergence Laboratory 28
Prototype-2 (2G core)
Mobile Convergence Laboratory 29
Clustering Synchronize Data Sharing
Avocet(v1.0) & Blackbird(v1.1) (3G core)
Mobile Convergence Laboratory 30
Cardinal(v1.2) (4G core)
• RAFT Consensus Algorithm• copycat OSS
• ConsistentMap
• CP system
• Gossip protocol based anti-entropy• EventuallyConsistentMap
• AP system
ONOS Overall Architecture
Mobile Convergence Laboratory 31
Architectural Tenets
Mobile Convergence Laboratory 32
• High availability, scalability and performance
• Strong abstractions and simplicity
• Protocol and device behavior independence
• Separation of concerns and modularity
Mobile Convergence Laboratory 33
구체적인 서비스를위한 Application 계층
Mobile Convergence Laboratory 34
Application 계층에네트워크 정보 전달,하위 컴포넌트 제어를위한 인터페이스 제공
Mobile Convergence Laboratory 35
ONOS의 핵심적인 역할을 하며, HA와 Scalability를 위한분산 클러스터링 기능
Mobile Convergence Laboratory 36
네트워크 인프라 제어를위한 인터페이스 제공Network Element 추상화
Mobile Convergence Laboratory 37
Network Element 설정을 위한 프로토콜OpenFlow : SDNNetConf : Legacy
Mobile Convergence Laboratory 38
ONOS Core Subsystems
Device Link Host
Topology
Flow Rule
Path
Packet
StatisticsIntent
Application
Leadership
Messaging
Storage Region
Mastership
Driver
Group
Security
Flow Objective
Event
OpenFlow NetConf OVSDB
Core Cluster
. . .
Proxy ARPMobility L2 Forwarding
REST API GUI CLI
Network Cfg.
SDN IP / BGP Packet / Optical
Tunnel
. . .
OSGi / Apache Karaf
Network Virt.
Device Cfg.
Config
UI Extension
External Apps
Graph
Discovery Tenant . . .
Mobile Convergence Laboratory 39
ONOS Subsystems Structure
Northbound
Core
Southbound
Mobile Convergence Laboratory 40
ONOS Subsystems Structure
• Provider• Interface with the network via
protocol-specific library
• Manager• Receives information from
Providera and serves it to application and service
• Store• Synchronizing the information
received by the Manager
Scale-out / HA scenarios
Mobile Convergence Laboratory 41
Mobile Convergence Laboratory 42
Distributed Core
Instance 1
Scale-out by Distributed Core (1)
Network GraphGlobal network view
Mobile Convergence Laboratory 43
Distributed Core
Instance 1 Instance 2 Instance 3
Scale-out by Distributed Core (2)
Network GraphGlobal network view
Mobile Convergence Laboratory 44
Distributed Core
Instance 1 Instance 2 Instance 3
HA by Distributed Core (1)
Network GraphGlobal network view
Mobile Convergence Laboratory 45
Distributed Core
Instance 1 Instance 2 Instance 3
HA by Distributed Core (2)
Network GraphGlobal network view
Mobile Convergence Laboratory 46
Distributed Core
Instance 1 Instance 2 Instance 3
HA by Distributed Core (3)
Network GraphGlobal network view
Mobile Convergence Laboratory 47
E
ONOS - InstallSingle Instance setting1. Getting ONOS
2. Installing ONOS
3. Start ONOS
Mobile Convergence Laboratory 48
https://wiki.onosproject.org/display/ONOS/Installing+and+Running+ONOS
Prerequisites
• Ubuntu 14.04 LTS 64bits
• 2GB or more RAM
• 2 or more processors
• 8GB or more storage
• Java 8 JDK
• Apache Maven(3.3.1 and later)
• Apache Karaf(3.0.3 and later)
• Git
Mobile Convergence Laboratory 49
1. Install Java 8
$ sudo apt-get install software-properties-common -y
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer oracle-java8-set-default
Mobile Convergence Laboratory 50
Single Instance Setting (1/10)
2. Configure Java Path
• on Ubuntu
$ env | grep JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-8-oracle
$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
Mobile Convergence Laboratory 51
Single Instance Setting (2/10)
3. Install Git
$ sudo apt-get install git-core
$ git --version
Mobile Convergence Laboratory 52
Single Instance Setting (3/10)
4. Set Maven
$ cd; mkdir Downloads Applications
$ cd Downloads
$ wget http://archive.apache.org/dist/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz
$ tar -zxvf apache-maven-3.3.1-bin.tar.gz -C ../Applications/
Mobile Convergence Laboratory 53
Single Instance Setting (4/10)
5. Set Karaf
$ cd Downloads
$ wget http://archive.apache.org/dist/karaf/3.0.3/apache-karaf-3.0.3.tar.gz
$ tar -zxvf apache-karaf-3.0.3.tar.gz -C ../Applications/
Mobile Convergence Laboratory 54
Single Instance Setting (5/10)
6. Clone ONOS
$ git clone https://gerrit.onosproject.org/onos/
$ cd onos
if> getting specific ONOS version
$ git checkout <ver>
Mobile Convergence Laboratory 55
Single Instance Setting (6/10)
7. Configure ONOS Path
$ export ONOS_ROOT=~/onos
$ source $ONOS_ROOT/tools/dev/bash_profile
Mobile Convergence Laboratory 56
Single Instance Setting (7/10)
8. Build ONOS
$ cd ~/onos
$ mvn clean install
Mobile Convergence Laboratory 57
빌드 성공
Single Instance Setting (8/10)
9. Start ONOS CLI
$ karaf clean
Mobile Convergence Laboratory 58
Single Instance Setting (9/10)
10. Start ONOS GUI
• start ONOS (ONOS CLI)
• In web browser
• http://localhost:8181/onos/ui/login.html
ID: karaf / PW: karaf
Mobile Convergence Laboratory 59
Single Instance Setting (10/10)
Mobile Convergence Laboratory 60
Mobile Convergence Laboratory 61
Mobile Convergence Laboratory 62
<Network Graph>토폴로지 GUI와 Host 정보
<Node Info>해당 노드(스위치)의 정보Protocol / Ports / Flow버전 및 지리적 정보
<ONOS Summary>Network Element의 수
링크의 수호스트의 수Flow의 수…
ONOS - InstallMulti Instance setting1. Getting ONOS
2. Installing ONOS
3. Start ONOS
Mobile Convergence Laboratory 63
https://wiki.onosproject.org/display/ONOS/Installing+and+Running+ONOS
ONOS Multiple Instances
Mobile Convergence Laboratory 64
- Download source code
- Build ONOS project
- Package the project
- Deploy the packageDeploy & Install
1. Prepare multi machine
• 물리 머신 or 가상 머신• 홀수의 머신이 필요( ∵ RAFT algorithm for distributed clustering)
• 물리 머신이라면Java 설치 및 경로 설정(1,2), 환경 셋팅(4,5), 경로 설정(7) 필요
• 가상 머신이라면 그대로 복사(주의! MAC 주소 수동 변경)
Mobile Convergence Laboratory 65
Multiple Instance Setting (1/6)
2. cell script
• ~/onos/tools/test/cells 디렉토리에 FILE_NAME 파일에 다음과같이 작성
• 머신과 환경에 맞게 작성
Mobile Convergence Laboratory 66
Multiple Instance Setting (2/6)
3. Connect SSH
• 배포할 머신과 패키징을 받을 머신들끼리 연결
$ ssh-keygen -t rsa // 각 인스턴스 머신마다 key 생성
$ onos-push-keys $OC1 // 노드 개수 만큼
$ onos-push-keys $OC5
$ onos-verify-cell // 연결 확인
Mobile Convergence Laboratory 67
Multiple Instance Setting (3/6)
…
4. Define control plane
• cell 명령어와 작성한 스크립트로 제어 평면에 대한 정의
$ cell FILE_NAME
Mobile Convergence Laboratory 68
Multiple Instance Setting (4/6)
5. Packaging and Deploying
$ mvn clean install
$ onos-package
$ onos-install $OC1
$ onos-install $OC5
배포 및 실행, onos의 process PID가 반환
Mobile Convergence Laboratory 69
Multiple Instance Setting (5/6)
…
6. Manage Multi instances
• CLI
$ onos -w $OC1 //cell script에 등록한 인스턴스 이름
또는
$ onos -w 192.168.56.101 //해당 인스턴스의 IP
• GUI in web
http://192.168.56.101:8181/onos/ui/login.html
//접속하고자 하는 인스턴스의 IP
Mobile Convergence Laboratory 70
Multiple Instance Setting (6/6)
Mobile Convergence Laboratory 71
<ONOS Instance>
ONOS Application (1/3)
• Apps are delivered via ONOS App aRchive (.oar) files• pom.xml / features.xml / bundle 을 포함하여 .oar 파일 형태로 배포
• OAR 파일은 maven으로 빌드할 때, onos-maven-plugin에 의해 생성
• ONOS application 종류• Bundle application
• Service Interface application
• Service Component application
Mobile Convergence Laboratory 72
ONOS Application (2/3)
• ONOS application 종류• Bundle application
• API를 제공하지 않고 자체적으로 모든 기능을 수행
• Service Interface application• 다른 app에서 접근가능한 API를 제공하는 형태 ex>CLI, REST api, GUI
• Service Component application• Activate/Deactivate 등 메소드를 가진 형태
Mobile Convergence Laboratory 73
ONOS Application (3/3)
• Maven을 이용한 ONOS app 프로젝트 생성 방법• maven template toolkit에 의해 skeleton code가 제공
• ONOS archetype• onos-bundle-archetype
• $onos-create-app bundle [groupId] [artifactId]
• onos-cli-archetype• $onos-create-app cli [groupId] [artifactId]
• onos-ui-archetype• $onos-create-app ui [groupId] [artifactId]
Mobile Convergence Laboratory 74
APIhttps://wiki.onosproject.org/display/ONOS/Download+packages+and+tutorial+VMshttp://api.onosproject.org/1.3.0/
OpenVirteXNetwork Virtualization Platform & Network Hypervisor
Mobile Convergence Laboratory 75
OpenVirteX (OVX)
• Network Virtualization Platform
• Network Hypervisor
Mobile Convergence Laboratory 76
Mobile Convergence Laboratory 77
주요 기능
• Topology Virtualization
• Address Space Virtualization
• Control Function Virtualization
Mobile Convergence Laboratory 78
주요 기능 - Topology Virtualization
• 가상화를 통해 물리적 네트워크를 분리
• 물리 계층을 추상화
• 다수의 스위치를 묶어서 하나의 스위치로 가상화(Big Switch)
Mobile Convergence Laboratory 79
주요 기능 - Address Space Virtualization
Mobile Convergence Laboratory 80
주요 기능 - Control Function Virtualization
Mobile Convergence Laboratory 81
SDN Controller(NOS)
Big Switch
Controll Plane(by OpenFlow Channel)
OVX
OpenVirteX - Install
Mobile Convergence Laboratory 82
Prerequisites
Recommended
• 4 Cores
• 4GB Java heap size
Minimum
• 2 Cores
• 1GB Java heap size
Mobile Convergence Laboratory 83
• Git
• Oracle Java7 (Not OpenJDK, Not Java8)
• Maven
• Python 2.7.x
1. Install Git & Maven
$ apt-get install git-core
$ apt-get install maven
Mobile Convergence Laboratory 84
http://ovx.onlab.us/getting-started/installation/
2. Install Java7
$ sudo apt-get install software-properties-common -y
$ sudo add-apt-repository ppa:webupd8team/java -y
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
Mobile Convergence Laboratory 85
3. Clone OpenVirteX
$ git clone https://github.com/OPENNETWORKINGLAB/OpenVirteX.git -b 0.0-MAINT
$ cd ~/OpenVirteX/scripts.
Mobile Convergence Laboratory 86
4. Start OVX
$ sh ovx.sh
ex> 가상 네트워크 생성 및 Big Switch 생성
$ python ovxctl.py -n createNetwork tcp:localhost:30000 10.0.0.0 16
$ python ovxctl.py -n createSwitch DPID_1,DPID_2,DPID_3,DPID_4
<Tutorial & API Doc>
http://ovx.onlab.us/getting-started/tutorial/
http://ovx.onlab.us/documentation/api/
Mobile Convergence Laboratory 87
Pi Stack SwitchRaspberry Pi를 이용한 SDN 테스트베드 개발
Mobile Convergence Laboratory 88
Raspberry Pi
• 영국의 라즈베리파이 재단이 만든 교육용 싱글 보드 컴퓨터
• Single Board Computer
• 대략 US$ 35
• Pi A/B, Pi B+, Pi2 출시
Mobile Convergence Laboratory 89
Raspberry Pi2의 스펙
• Single Board Computer(Micro Computer)
• CPU : 900MHz ARM Cortex-A7 쿼드코어
• RAM : 1GB
• USB 2.0 * 4 + HDMI * 1 + Micro USB전원
• 10/100 Mbit/s Ethernet
Mobile Convergence Laboratory 90출처 : Wikipedia(wikipedia.org/wiki/Raspberry_Pi)
Pi Stack Switch HW구성
Mobile Convergence Laboratory 91
Mobile Convergence Laboratory 92
Pi Stack Switch HW구성
메인 스위치 x 1개 x 1포트+
서브 스위치 x 3개 x 3포트= 10포트 스위치
Mobile Convergence Laboratory 93
Pi Stack Switch 완성
Mobile Convergence Laboratory 94
Software
Mobile Convergence Laboratory 95
SystemArchitecture
Main-Switch
Sub-Switch
Pi Stack Switch - Install
• OpenvSwitch 설치
$ sudo apt-get install openvswitch-switch openvswitch-controller openvswitch-common
$ sudo ovs-vsctl add-br <BridgeName>
$ sudo ovs-vsctl add-port <BridgeName> eth_n
$ sudo ovs-vsctl set-controller <BridgeName> tcp:Ctrl_IP:6633
https://github.com/MobileConvergenceLab/pi-switch
Mobile Convergence Laboratory 96
Pi Stack Switch와 ONOS 연결
Mobile Convergence Laboratory 97
메인 스위치
서브 스위치1
서브 스위치2
서브 스위치3
SDN 실증 환경 구축SDN 테스트베드와 하이퍼바이저 그리고 SDN 컨트롤러
Mobile Convergence Laboratory 98
Mobile Convergence Laboratory 99
Pi Stack Switch
Mobile Convergence Laboratory 100
NetworkArchitecture
NetworkOperatingSystem
Virtual Network
Physical Layer
OpenFlow Interface
Pi Stack Switch
OpenFlow Interface
Big Switch
Mobile Convergence Laboratory 101
NetworkArchitecture
NetworkOperatingSystem
Virtual Network
Physical Layer
OpenFlow Interface
OpenFlow Interface 1 대의 PC- xeon 8 core- 32GB RAM
Raspberry Pi테스트베드
Mobile Convergence Laboratory 102
Network Element Mapping(1)
Mobile Convergence Laboratory 103
Network Element Mapping(2)
Big Switch
By OpenVirteX
Mobile Convergence Laboratory 104
Pi only SDN (1/3)
Raspberry Pi
Mobile Convergence Laboratory 105
Pi only SDN (2/3)
ONOS controller
Pi Stack Switch(SDN Switch)
Mobile Convergence Laboratory 106
Pi only SDN (3/3)
Raspberry Pi Screen running ONOS
Reference
• ONOS• http://onosproject.org/• https://wiki.onosproject.org/ 공식 Wiki• https://wiki.onosproject.org/display/ONOS/ONOS+from+Scratch• https://wiki.onosproject.org/display/ONOS/Installing+and+Running+ONOS• https://www.youtube.com/watch?v=dWhtswhSpWE• Pankaj Berde and others, “ONOS: Towards an Open, Distributed SDN OS”, HostSDN 2014
• OpenVirteX• http://ovx.onlab.us/• Ali Al-Shabibi and others, “OpenVirteX: Make Your Virtual SDNs Programmable”, HotSDN 2014
• OpenvSwitch• http://www.openvswitch.org/
• Raspberry Pi• https://www.raspberrypi.org/• http://en.wikipedia.org/wiki/Raspberry_Pi
Mobile Convergence Laboratory 107
Q&A
Mobile Convergence Laboratory 108