43
ONOS SDN Controller 소스코드 분석 SDN 응용개발 Mobile Convergence Lab, Computer Engineering, Kyung Hee University Sangyun Han Email : [email protected] SDN/NFV 이론, 실습, 최신동향 [ONOS 환경설정, 빌드 및 테스트 환경 구축]

ONOS - setting, configuration, installation, and test

Embed Size (px)

Citation preview

ONOS SDN Controller소스코드 분석 및 SDN 응용개발

Mobile Convergence Lab, Computer Engineering, Kyung Hee University

Sangyun Han

Email : [email protected]

SDN/NFV 이론, 실습, 최신동향

[ONOS 환경설정, 빌드 및 테스트 환경 구축]

Setting

Mobile Convergence Laboratory 2

목차A Table of Contents

Install

Test

환경설정

가상머신 셋팅, 네트워크 환경 설정

의존성SW 설치 및 빌드

관련 오픈소스 설치 및 변수 설정, 빌드

테스트 환경 구축SDN 컨트롤러 테스트를 위한 물리 및 가상 환경 셋팅

Q&A

질의응답

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.9 and later)

• Apache Karaf(3.0.5 and later)

• Git

Mobile Convergence Laboratory 3

제공된 VM instance

• Ubuntu 14.04 LTS

• 2GB memory

• 12GB hard disk(dynamic allocation)

• eth0 NAT / eth1 host-only

• username : sdn• password : mclab

Mobile Convergence Laboratory 4

Setting1. Installing VM

2. Creating VM instance

3. Configuring network option

Mobile Convergence Laboratory 5

Virtual Box

• Virtual Box 다운로드 및 설치• https://www.virtualbox.org/wiki/Downloads

• Ubuntu 설치• www.ubuntu.com/download/desktop

Mobile Convergence Laboratory 6

Set VM (1/2)

Mobile Convergence Laboratory 7

• 가상머신 생성 및 Ubuntu 설치

Set VM (2/2)

• 하드디스크 할당• 최소 여유 공간 8GB• Ubuntu OS 할당 공간 + α

Mobile Convergence Laboratory 8

Install Ubuntu (1/2)

Mobile Convergence Laboratory 9

Install Ubuntu (2/2)

• username : sdn // 다중 인스턴스 설치 때 필요

Mobile Convergence Laboratory 10

VM Network Setting

• 설정 è 네트워크 è 어댑터 1 è NAT• For connecting internet

• 설정 è 네트워크 è 어댑터 2 è 호스트 전용 어댑터• For communicating ONOS cluster member

11

Structure of Machines

• 다중 인스턴스 설치 시, 사용할 머신들의 구조

Mobile Convergence Laboratory 12

Internet

Physical machine

Virtual machine Virtual machine Virtual machine

Instance 1 Instance 2 Instance 3

Eth0 Eth1 Eth0 Eth1 Eth0 Eth1

Host-Only Network

Structure of Machines

• 다중 인스턴스 설치 시, 사용할 머신들의 구조

Mobile Convergence Laboratory 13

Internet

Physical machine

Virtual machine Virtual machine Virtual machine

Instance 1 Instance 2 Instance 3

Eth0 Eth1 Eth0 Eth1 Eth0 Eth1

Host-Only Network

현재 설치 중인인스턴스 Instance Duplication

ONOS - InstallSingle Instance setting1. Getting ONOS

2. Installing ONOS

3. Start ONOS

Mobile Convergence Laboratory 14https://wiki.onosproject.org/display/ONOS/Installing+and+Running+ONOS

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 15

Single Instance Setting (1/10)

1. Install Java 8

Mobile Convergence Laboratory 16

Single Instance Setting (1/10)

• Java8 라이선스 동의

2. Configure Java Path

• on Ubuntu

$ env | grep JAVA_HOMEJAVA_HOME=/usr/lib/jvm/java-8-oracle

$ export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Mobile Convergence Laboratory 17

Single Instance Setting (2/10)

3. Install Git

$ sudo apt-get install git-core

$ git --version

Mobile Convergence Laboratory 18

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.9/binaries/apache-maven-3.3.9-bin.tar.gz

$ tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ../Applications/

Mobile Convergence Laboratory 19

Single Instance Setting (4/10)

4. Set Maven

$ cd; mkdir Downloads Applications

$ cd Downloads

$ wget http://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

$ tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ../Applications/

Mobile Convergence Laboratory 20

Single Instance Setting (4/10)

중요!static path

5. Set Karaf

$ cd Downloads

$ wget http://archive.apache.org/dist/karaf/3.0.5/apache-karaf-3.0.5.tar.gz

$ tar -zxvf apache-karaf-3.0.5.tar.gz -C ../Applications/

Mobile Convergence Laboratory 21

Single Instance Setting (5/10)

6. Clone ONOS

$ cd ~/$ git clone https://gerrit.onosproject.org/onos/

$ cd onos

if> getting specific ONOS version$ git checkout onos-1.5

Mobile Convergence Laboratory 22

Single Instance Setting (6/10)

7. Configure ONOS Path

$ export ONOS_ROOT=~/onos

$ source $ONOS_ROOT/tools/dev/bash_profile

Mobile Convergence Laboratory 23

Single Instance Setting (7/10)

# add bashsudo vi /etc/bash.bashrcexport ONOS_ROOT=~/onossource $ONOS_ROOT/tools/dev/bash_profile

8. Build ONOS

$ cd ~/onos

$ mvn clean install

Mobile Convergence Laboratory 24

빌드 성공

Single Instance Setting (8/10)

9. Start ONOS CLI

$ ok clean

Mobile Convergence Laboratory 25

Single Instance Setting (9/10)

10. Start ONOS GUI

• start ONOS (ONOS CLI)

• In web browser

• http://localhost:8181/onos/ui/login.html

Default ID: karaf / PW: karaf

Mobile Convergence Laboratory 26

Single Instance Setting (10/10)

Mobile Convergence Laboratory 27

Mobile Convergence Laboratory 28

Activate ONOS app

onos> app activate <APP_NAME>onos> app deactivate <APP_NAME>

Mobile Convergence Laboratory 29

Test1. mininet을 이용한 가상 테스트 환경 구축

2. Open vSwitch를 이용한 물리 테스트 환경 구축

Mobile Convergence Laboratory 30

Mininet

• Open source 네트워크 에뮬레이터

• 네트워크 테스트, 디버깅 등의 용도로 사용가능

• 단일 Linux kernel에 수 백 개의 가상 host, switch, router 구축

• 각 node에서 Linux sw를 실행가능• wireshark, tcpdump, web server, etc

• OpenFlow 지원

• Python API를 이용한 custom topology 생성

Mobile Convergence Laboratory 31

1. mininet을 이용한 가상 테스트 환경 구축 (1/6)

mininet 설치

• Ubuntu package• $ apt-get install mininet• $ sudo mn

• Source build• $ git clone git://github.com/mininet/mininet.git• $ ./mininet/util/install.sh -nfw• $ sudo mn

Mobile Convergence Laboratory 32

1. mininet을 이용한 가상 테스트 환경 구축 (2/6)

토폴로지 생성 및 ONOS 연동

• mininet을 이용한 tree 토폴로지 생성• // OpenFlow 1.0의 경우, 6633 포트를 사용, ONOS는 OpenFlow 1.0과 1.3만 지원• $ sudo mn -- [topology][,depth=][,fanout=]• $ sudo mn --topo tree,2,3 --controller=remote,ip=127.0.0.1,port=6633

Mobile Convergence Laboratory 33

1. mininet을 이용한 가상 테스트 환경 구축 (3/6)

Python을 이용한mininet 커스텀토폴로지 예제

ping test & host discovery

mininet> pingall

Mobile Convergence Laboratory 34

만약 SDN controlle를연동하지 않았다면pingall 테스트 시에unreachable 문제 발생(포워딩 문제)

1. mininet을 이용한 가상 테스트 환경 구축 (4/6)

ping test & host discovery

Mobile Convergence Laboratory 35

1. mininet을 이용한 가상 테스트 환경 구축 (5/6)

mininet tool

• xterm• node의 terminal 접속• xterm <node_name>

• ifconfig• <node_name> ifconfig

• ping• <src_node_name> ping <dst_node_name>

• net • node간 연결 정보 출력

Mobile Convergence Laboratory 36

1. mininet을 이용한 가상 테스트 환경 구축 (6/6)

Open vSwitch를 이용한 물리 테스트 환경 구축

• PC/Server/RaspberryPi를 기반으로 OpenFlow 스위치를 구축• 테스트베드로 실제 망에 적용 및 테스트 가능

Mobile Convergence Laboratory 37

Open vSwitch를 이용한 물리 테스트 환경 구축

Mobile Convergence Laboratory 38

• Pi Stack Switch• https://github.com/MobileConvergenceLab/pi-switch• 리눅스 기반이라면 Raspberry Pi에 셋팅한 과정 그대로사용 가능

Mobile Convergence Laboratory 39

실제 캠퍼스 망에 설치 및 테스트

Mobile Convergence Laboratory 40

Pi only SDN (1/3)

Raspberry Pi

Mobile Convergence Laboratory 41

Pi only SDN (2/3)

ONOS controller

Pi Stack Switch(SDN Switch)

Mobile Convergence Laboratory 42

Pi only SDN (3/3)

Raspberry Pi Screen running ONOS

Mobile Convergence Laboratory 43