如果不需要修改ONOS代码,只是像启动后和OVS连接一下,可以直接采用官方编译好的版本部署,下面是操作步骤的记录。
前期准备
- java放好
centec@ubuntu:/home$ ll
total 183872
drwxr-xr-x 4 root root 4096 Aug 30 16:40 ./
drwxr-xr-x 24 root root 4096 Aug 30 15:44 ../
drwxr-xr-x 19 centec centec 4096 Aug 30 17:01 centec/
drwxr-xr-x 8 root root 4096 Jul 22 13:11 jdk1.8.0_144_oracle/
-rw-r--r-- 1 root root 188267912 Aug 30 16:40 jdk1.8.0_144_oracle.zip
centec@ubuntu:/home$
- 下载ONOS已经打包好的package,我下载的是1.10.3版本
sudo wget -c http://downloads.onosproject.org/release/onos-$ONOS_VERSION.tar.gz
}}
* 放到/opt/下面并解压缩
{{{
centec@ubuntu:/opt$ ll
total 151968
drwxr-xr-x 4 root root 4096 Aug 30 16:23 ./
drwxr-xr-x 24 root root 4096 Aug 30 15:44 ../
drwxrwxrwx 8 root root 4096 Aug 30 16:47 onos/
-rw-r--r-- 1 root root 155597235 Aug 30 16:23 onos-1.10.3.tar.gz
dr-xr-xr-x 4 root root 4096 Aug 30 14:15 vmware-tools-installer/
centec@ubuntu:/opt$
centec@ubuntu:/opt$ sudo mv onos-1.10.3/ onos/
- 修改karaf配置,重点是下面罗列的两行,其中java要和之前的目录保持一致
centec@ubuntu:/opt/onos/apache-karaf-3.0.8/bin$ sudo vi setenv
export JAVA_HOME=/home/jdk1.8.0_144_oracle/ # Location of Java installation
export KARAF_HOME=/opt/onos/apache-karaf-3.0.8 # Karaf home folder
使用并配置ONOS
启动onos
centec@ubuntu:/opt/onos/bin$ sudo /opt/onos/bin/onos-service start
Welcome to Open Network Operating System (ONOS)!
____ _ ______ ____
/ __ \/ |/ / __ \/ __/
/ /_/ / / /_/ /\ \
\____/_/|_/\____/___/
Documentation: wiki.onosproject.org
Tutorials: tutorials.onosproject.org
Mailing lists: lists.onosproject.org
Come help out! Find out how at: contribute.onosproject.org
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown ONOS.
onos>
- 结果发现openflow都没有装,CLI装回报错
onos> feature:install onos-providers-openflow-base
Error executing command: Can't install feature onos-providers-openflow-base/0.0.0:
Could not start bundle mvn:org.onosproject/onos-providers-openflow-device/1.10.3 in feature(s) onos-providers-openflow-base-1.10.3: Unresolved constraint in bundle org.onosproject.onos-providers-openflow-device [163]: Unable to resolve 163.0: missing requirement [163.0] osgi.wiring.package; (&(osgi.wiring.package=org.onosproject.net.optical.device)(version>=1.10.0)(!(version>=2.0.0)))
onos>
- 打开网页,登陆用户名和密码依然是karaf/karaf,在application将openflow相关app安装
- 确认已经安装
onos> feature:list | grep " x " | grep openflow
onos-providers-openflow-base | 1.10.3 | x | onos-providers-openflow-base-1.10.3 | OpenFlow Provider
onos>
- 好了,可以连上了
DUT214# show openflow controller status
tcp:10.10.11.71:6653 role: master status: online online-time: 0d 0h12m50s mgmt-if: yes bind_ip: none
DUT214#
- snoop一看,每个流表下发,都会加clear-action,而我们不支持,所以flow都没有下发成功
OFPT_FLOW_MOD (OF1.3) (xid=0x0): ADD priority=40000,arp cookie:0x10000aa429454 send_flow_rem actions=CONTROLLER:65535,clear_actions
OFPT_ERROR (OF1.3) (xid=0x0): OFPBIC_UNSUP_INST
OFPT_FLOW_MOD (OF1.3) (xid=0x0):
(***truncated to 64 bytes from 96***)
00000000 04 0e 00 60 00 00 00 00-00 01 00 00 aa 42 94 54 |...`.........B.T|
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 9c 40 |...............@|
00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 01 00 00 |................|
00000030 00 01 00 0a 80 00 0a 02-08 06 00 00 00 00 00 00 |................|
OFPT_FLOW_MOD (OF1.3) (xid=0x0): ADD priority=40000,dl_type=0x88cc cookie:0x1000082a18617 send_flow_rem actions=CONTROLLER:65535,clear_actions
OFPT_ERROR (OF1.3) (xid=0x0): OFPBIC_UNSUP_INST
OFPT_FLOW_MOD (OF1.3) (xid=0x0):
(***truncated to 64 bytes from 96***)
00000000 04 0e 00 60 00 00 00 00-00 01 00 00 82 a1 86 17 |...`............|
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 9c 40 |...............@|
00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 01 00 00 |................|
00000030 00 01 00 0a 80 00 0a 02-88 cc 00 00 00 00 00 00 |................|
OFPT_FLOW_MOD (OF1.3) (xid=0x0): ADD priority=40000,dl_type=0x8942 cookie:0x100005c2f0fce send_flow_rem actions=CONTROLLER:65535,clear_actions
OFPT_ERROR (OF1.3) (xid=0x0): OFPBIC_UNSUP_INST
OFPT_FLOW_MOD (OF1.3) (xid=0x0):
(***truncated to 64 bytes from 96***)
00000000 04 0e 00 60 00 00 00 00-00 01 00 00 5c 2f 0f ce |...`........\/..|
00000010 00 00 00 00 00 00 00 00-00 00 00 00 00 00 9c 40 |...............@|
00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 01 00 00 |................|
00000030 00 01 00 0a 80 00 0a 02-89 42 00 00 00 00 00 00 |.........B......|
- 查看ONOS的源代码
[centec@CentOS7-11 impl]$ pwd
/home/centec/Applications/onos-1.10/core/common/src/main/java/org/onosproject/codec/impl
[centec@CentOS7-11 impl]$
[centec@CentOS7-11 impl]$ cat TrafficTreatmentCodec.java
if (treatment.clearedDeferred()) {
result.put(CLEAR_DEFERRED, true);
}
这里的true,应该改成false,就是无论如何都不加clear_actions这个instruction
- 上述修改可以编译成功,但是op的时候,报错
SHA cannot be verified
- 哪位帮忙验证一下吧
网友评论