Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
EN
SB
Uploaded by
Seung-Hoon Baek
PDF, PPTX
2,625 views
Open vSwitch의 Vendor Extension 구현
OVS(Open vSwitch)의 Vendor Extension 구현에 관한 자료입니다.
Technology
◦
Read more
2
Save
Share
Embed
Embed presentation
Download
Download as PDF, PPTX
1
/ 22
2
/ 22
3
/ 22
4
/ 22
5
/ 22
6
/ 22
7
/ 22
8
/ 22
9
/ 22
10
/ 22
11
/ 22
12
/ 22
13
/ 22
14
/ 22
15
/ 22
16
/ 22
17
/ 22
18
/ 22
19
/ 22
20
/ 22
21
/ 22
22
/ 22
More Related Content
PDF
Open vSwitch와 Mininet을 이용한 가상 네트워크 생성과 OpenDaylight를 사용한 네트워크 제어실험
by
Seung-Hoon Baek
PDF
Open vSwitch 패킷 처리 구조
by
Seung-Hoon Baek
PPTX
Mininet
by
ymtech
PDF
ONOS(Open Network Operating System) V1.0 Avocet
by
rootfs32
PDF
ONF Atrium 분석
by
jungbh
PDF
20160518 jun lee_ opnfv_brahmaputra_분석
by
rootfs32
PDF
150416 OpenStack Networking with Neutron Jieun, Kim
by
jieun kim
PDF
20150818 jun lee_openstack kilo release 내용 분석
by
rootfs32
Open vSwitch와 Mininet을 이용한 가상 네트워크 생성과 OpenDaylight를 사용한 네트워크 제어실험
by
Seung-Hoon Baek
Open vSwitch 패킷 처리 구조
by
Seung-Hoon Baek
Mininet
by
ymtech
ONOS(Open Network Operating System) V1.0 Avocet
by
rootfs32
ONF Atrium 분석
by
jungbh
20160518 jun lee_ opnfv_brahmaputra_분석
by
rootfs32
150416 OpenStack Networking with Neutron Jieun, Kim
by
jieun kim
20150818 jun lee_openstack kilo release 내용 분석
by
rootfs32
What's hot
PDF
20150818 jun lee_openstack juno release 내용 분석
by
rootfs32
PDF
ONS2014 출장보고
by
Yongyoon Shin
PDF
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
by
OpenStack Korea Community
DOCX
F5 container ingress_service_in_kuernetes_with_calico_cni_by_duck_in_korea
by
InfraEngineer
PDF
오픈 소스 클라우드 플랫폼 분석
by
Jennifer Noh
PDF
초보자를 위한 네트워크/VLAN 기초
by
Open Source Consulting
PDF
[오픈소스컨설팅]Docker on Kubernetes v1
by
Ji-Woong Choi
PDF
Build the OpenStack Cloud with Neutron Networing, IceHouse
by
jieun kim
PDF
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
by
InfraEngineer
PDF
20150511 jun lee_openstack neutron 분석 (최종)
by
rootfs32
DOCX
Calico routing modes_trans_by_duck_in_korean
by
InfraEngineer
PDF
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
by
Ji-Woong Choi
PPTX
클라우드 환경을 위한 네트워크 가상화와 NSX(기초편)
by
Laehyoung Kim
PDF
Opendaylight beryllium
by
Cheolmin Lee
PDF
ONOS (Open Network Operating System) Blackbird Release 분석
by
rootfs32
PDF
Openstack live migration
by
ymtech
PPTX
DPDK
by
ymtech
PDF
Brocade Vyatta Controller Overview
by
Seung-Hoon Baek
PDF
[MeetUp][2nd] 오리뎅이의_쿠버네티스_네트워킹_v1.2
by
InfraEngineer
PDF
OpenDaylight의 High Availability 기능 분석
by
Seung-Hoon Baek
20150818 jun lee_openstack juno release 내용 분석
by
rootfs32
ONS2014 출장보고
by
Yongyoon Shin
[OpenStack 하반기 스터디] Docker를 이용한 OpenStack 가상화
by
OpenStack Korea Community
F5 container ingress_service_in_kuernetes_with_calico_cni_by_duck_in_korea
by
InfraEngineer
오픈 소스 클라우드 플랫폼 분석
by
Jennifer Noh
초보자를 위한 네트워크/VLAN 기초
by
Open Source Consulting
[오픈소스컨설팅]Docker on Kubernetes v1
by
Ji-Woong Choi
Build the OpenStack Cloud with Neutron Networing, IceHouse
by
jieun kim
[MeetUp][1st] 오리뎅이의_쿠버네티스_네트워킹
by
InfraEngineer
20150511 jun lee_openstack neutron 분석 (최종)
by
rootfs32
Calico routing modes_trans_by_duck_in_korean
by
InfraEngineer
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
by
Ji-Woong Choi
클라우드 환경을 위한 네트워크 가상화와 NSX(기초편)
by
Laehyoung Kim
Opendaylight beryllium
by
Cheolmin Lee
ONOS (Open Network Operating System) Blackbird Release 분석
by
rootfs32
Openstack live migration
by
ymtech
DPDK
by
ymtech
Brocade Vyatta Controller Overview
by
Seung-Hoon Baek
[MeetUp][2nd] 오리뎅이의_쿠버네티스_네트워킹_v1.2
by
InfraEngineer
OpenDaylight의 High Availability 기능 분석
by
Seung-Hoon Baek
Viewers also liked
PDF
NFV VNF Architecture
by
jungbh
PDF
NFV Architectural Framework
by
Seung-Hoon Baek
PDF
Docker Container
by
Seung-Hoon Baek
PPTX
Introduction to Virtualization, Virsh and Virt-Manager
by
walkerchang
PDF
QEMU Disk IO Which performs Better: Native or threads?
by
Pradeep Kumar
PDF
20151030 jun lee_vnf 의 reliabilityavailability 제공을 위한 방법 (최종)
by
rootfs32
PDF
Kvm performance optimization for ubuntu
by
Sim Janghoon
PDF
NFV Management and Orchestration 분석
by
rootfs32
NFV VNF Architecture
by
jungbh
NFV Architectural Framework
by
Seung-Hoon Baek
Docker Container
by
Seung-Hoon Baek
Introduction to Virtualization, Virsh and Virt-Manager
by
walkerchang
QEMU Disk IO Which performs Better: Native or threads?
by
Pradeep Kumar
20151030 jun lee_vnf 의 reliabilityavailability 제공을 위한 방법 (최종)
by
rootfs32
Kvm performance optimization for ubuntu
by
Sim Janghoon
NFV Management and Orchestration 분석
by
rootfs32
Similar to Open vSwitch의 Vendor Extension 구현
PDF
오픈스택 멀티노드 설치 후기
by
영우 김
PDF
제로부터시작하는오픈소스
by
Mario Cho
PDF
Foss open sorucesw_6902
by
승우 백
PDF
2nd SDN Interest Group Seminar-Session3 (121218)
by
NAIM Networks, Inc.
PDF
Ryu with OpenFlow 1.3, Traffic Monitor
by
jieun kim
PDF
Ryu with OpenFlow 1.3, REST API
by
jieun kim
PDF
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
by
Nalee Jang
PDF
The practice of handling with FOSS by GPL v2inthe automotive
by
Byungjoo Hwang
PDF
Open stack의 vm개념을 통한 docker의 활용
by
Tae Young Lee
PDF
OpenFlow 1.5.1
by
jungbh
PDF
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
by
Mario Cho
PPTX
Node-RED Modbus sample (Node-RED 간단 사용법)
by
HyukSun Kwon
PDF
resource on openstack
by
jieun kim
PDF
[242]open stack neutron dataplane 구현
by
NAVER D2
PDF
하이퍼레저 패브릭 데이터 구조
by
Logpresso
PPTX
IRIS
by
ymtech
PDF
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
by
Jinuk Kim
PDF
제로부터시작하는 Git 두번째 이야기
by
Mario Cho
PDF
리눅스 커널 기초 태스크관리
by
Seungyong Lee
PDF
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
by
Ji-Woong Choi
오픈스택 멀티노드 설치 후기
by
영우 김
제로부터시작하는오픈소스
by
Mario Cho
Foss open sorucesw_6902
by
승우 백
2nd SDN Interest Group Seminar-Session3 (121218)
by
NAIM Networks, Inc.
Ryu with OpenFlow 1.3, Traffic Monitor
by
jieun kim
Ryu with OpenFlow 1.3, REST API
by
jieun kim
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
by
Nalee Jang
The practice of handling with FOSS by GPL v2inthe automotive
by
Byungjoo Hwang
Open stack의 vm개념을 통한 docker의 활용
by
Tae Young Lee
OpenFlow 1.5.1
by
jungbh
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
by
Mario Cho
Node-RED Modbus sample (Node-RED 간단 사용법)
by
HyukSun Kwon
resource on openstack
by
jieun kim
[242]open stack neutron dataplane 구현
by
NAVER D2
하이퍼레저 패브릭 데이터 구조
by
Logpresso
IRIS
by
ymtech
NDC14 모바일 게임서비스를 위한 사설 클라우드 구축/운영 분투기
by
Jinuk Kim
제로부터시작하는 Git 두번째 이야기
by
Mario Cho
리눅스 커널 기초 태스크관리
by
Seungyong Lee
클라우드 컴퓨팅 기반 기술과 오픈스택(Kvm) 기반 Provisioning
by
Ji-Woong Choi
Open vSwitch의 Vendor Extension 구현
1.
Open vSwitch의 Vendor Extension
구현 2015.03.31 (주)파이오링크 SDN 개발실 백승훈 (sh.baek@piolink.com)
2.
© PIOLINK, Inc.
SDN No.1 목차 Vendor Extension Implementation -System Overview -ovs-vswitchd (User Space Application) -openvswitch.ko (Kernel Module) -ovs-ofctl (Test Program) References
3.
© PIOLINK, Inc.
SDN No.1 Vendor Extension Vendor Extension - OpenFlow에서 Vendor가 원하는 기능을 확장할 수 있도록 제공하는 표준 - OpenFlow 1.1 부터 Vendor를 Experimenter로 재정의함 (*본 ppt는 Vendor로 표현) - 메시지 헤더의 Type이 0x04이면 Vendor Message임 - Vendor Message에서 vendor_id 값으로 Vendor를 구분 - vendor_id의 최상위 바이트가 0이면 IEEE OUI(Organizationally Unique Identifier)임 (IEEE OUI는 ONF로부터 할당 받은 고유 ID임) - OpenFlow 메시지 data의 Action에서 action type이 0xFFFF이면 Vendor Action임 Version (8 bits) Type (8 bits) Length (16 bits) xid (32 bits) vendor_id (32 bits) data[ ]… Controller Switch 0x00 Hello 0x01 Error .... 0x04 Vendor … 0x14 FlowMod … Vendor 고유 식별자 < Vendor 메시지 (OpenFlow 1.0 기준) > Type (16 bits) Length (16 bits) Vendor(32 bits) data[]… < Vendor Action (OpenFlow 1.0 기준) > 0x0000 Output 0x0001 SetVLANVID … 0xFFFF Vendor
4.
© PIOLINK, Inc.
SDN No.1 Implementation(System Overview) Implementation System - OVS에 Vendor Extension을 구현하기 위해서는 ovs-vswitchd, openvswitch.ko의 수정이 필요함. - OVS에 Vendor Message를 전송하기 위한 컨트롤러 프로그램은 ovs-ofctl을 수정해 사용 ovs-ofctl ovs-vswitchd openvswitch.ko Open vSwitch OpenFlow를 이용해 ovs-vswitchd를 관리하는 OVS 툴 *본 ppt에서 Vendor Message를 생성하고 전송하기 위한 테스트 목적으로 사용됨 OVS 데몬으로 controller로부터 Vendor Message를 받고 kernel 모듈로 Vendor Action을 전달함 OVS의 kernel 모듈로 network 장비로부터 packet을 받아 매칭되는 Vendor Action을 수행함 만약 없으면 ovs-vswitchd에게 Vendor Action을 받아옴 Vendor Action Vendor Message
5.
© PIOLINK, Inc.
SDN No.1 Implementation(System Overview) 구현 방법 설명은 예제프로그램을 만드는 과정으로 진행 -예제프로그램은 PIOLINK Vendor Message와 Action을 추가해 in_port 1에 매칭되는 packet에 대해 Vendor Action을 수행하도록 함. -전체 과정을 4 단계로 구분해 성공 시 해당 Log를 출력해 동작을 검증 -Log 출력 API 및 확인 방법 •ovs-vswitchd -API : VLOG_WARN(string, args…) -확인 방법 : cat /usr/local/var/log/openvswitch/ovs-vswitchd.log •openvswitch.ko -API : pr_info(), printk() … -확인 방법 : dmesg 단계 동작 Log 1 Vendor Message를 OVS가 수신 “Vendor Message Receive” 2 Vendor Action을 OVS datapath로 전송 “Vendor Action Send” 3 Vendor Action을 OVS datapath가 수신 “Vendor Action Receive” 4 매칭되는 packet에 Vendor Action을 수행 “Vendor Action Processing”
6.
© PIOLINK, Inc.
SDN No.1 Implementation(수정할 소스 파일) ovs-vswitchd (User Space Application) - Vendor Message • ~/include/openflow/openflow-common.h • ~/lib/ofp-msgs.c • ~/lib/ofp-msgs.h • ~/lib/ofp-msgs.inc • ~/lib/ofp-util.c - Vendor Action • ~/lib/ofp-actions.c • ~/lib/ofp-actions.h • ~/lib/ofp-actions.inc1 • ~/lib/ofp-actions.inc2 • ~/ofproto/ofproto-dpif-xlate.c openvswitch.ko (Kernel Module) - Vendor Action • ~/datapath/flow_netlink.c • ~/datapath/actions.c • ~/datapath/linux/compat/include/linux/openvswitch.h ovs-ofctl (Test Program) - Vendor Message & Vendor Action • ~/utilities/ovs-ofctl.c
7.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Message) ovs-vswitchd(Vendor Message) … #define ONF_VENDOR_ID 0x4f4e4600 #define PIOLINK_VENDOR_ID 0xFF001021 … 파일명 : ~/include/openflow/openflow-common.h YYY는 바로 밑에 “OFPTYPE_FLOW_MOD,”를 추가한 라인 번호 XXX는 ~/lib/ofp-msgs.h 파일에서 “OFPRAW_PIOLINK_FLOW_MOD,”를 추가한 라인 번호 static struct raw_info raw_infos[]{ ... { ofpraw_piolink_flow_mod_instances, 1, 6, #line XXX "./lib/ofp-msgs.h" 16, // OpenFlow 메시지 길이( header(8bytes) + body ) #line XXX "./lib/ofp-msgs.h" 0, #line YYY "./lib/ofp-msgs.inc" OFPTYPE_FLOW_MOD, "PIOLINK_FLOW_MOD", } }; 파일명 : ~/lib/ofp-msgs.inc *편의를 위해 따로 헤더 파일을 만들어 관리 파일명 : ~/lib/piolink_msgs.h #ifndef __PIOLINK_MSGS_H__ #define __PIOLINK_MSGS_H__ static struct raw_instance ofpraw_piolink_flow_mod_instances[] = { {{0, NULL}, {1, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, {{0, NULL}, {2, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, {{0, NULL}, {3, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, {{0, NULL}, {4, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, {{0, NULL}, {5, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, {{0, NULL}, {6, 4, 0, 0xFF001021, 0}, OFPRAW_PIOLINK_FLOW_MOD, 0}, }; #endif *두꺼운 글씨가 추가/수정한 부분임! enum ofraw { ... OFPRAW_PIOLINK_FLOW_MOD, }; 파일명 : ~/lib/ofp-msgs.h Vendor ID, Subtype Vendor ID : vendor의 고유 식별번호 Subtype : 같은 vendor에서의 식별번호 *컴파일할 때 삭제 되는 경우도 있으니 주의 !
8.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Message) ovs-vswitchd(Vendor Message) ... #include "piolink-msgs.h" #include "ofp-msgs.inc" … static enum ofperr ofphdrs_decode(…){ … if(hdrs->type == OFPT_VENDOR){ … if( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ){ … } } else if( hdrs->version == OFP10_VERSION && (hdrs->type == OFPT10_STATS_REQUEST || hdrs->type == OFPT10_STATS_REPLY)){ … if(hdrs->stat == OFPST_VENDOR){ … if( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ){ … } … } … } else if( hdrs->version != OFP10_VERSION && (hdrs->type == OFPT11_STATS_REQUEST || hdrs->type == OFPT11_STATS_REPLY)){ … if(hdrs->stat == OFPST_VENDOR){ … if( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ){ … } … } … } … (뒷장에 계속!!) … 파일명 : ~/lib/ofp-msgs.c #include "ofp-msgs.inc" 위에 추가하기! OVS에서 기본으로 구현돼있는 Nicira의 Vendor id
9.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Message) ovs-vswitchd(Vendor Message) static void ofpraw_put__(…){ … if(hdrs->type == OFPT_VENDOR){ … ovs_assert( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ); … } else if( hdrs->version == OFP10_VERSION && (hdrs->type == OFPT10_STATS_REQUEST || hdrs->type == OFPT10_STATS_REPLY)){ … if(hdrs->stat == OFPST_VENDOR){ … if( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ){ … } … } … } else if( hdrs->version != OFP10_VERSION && (hdrs->type == OFPT11_STATS_REQUEST || hdrs->type == OFPT11_STATS_REPLY)){ … if(hdrs->stat == OFPST_VENDOR){ … if( (hdrs->vendor == NX_VENDOR_ID) || (hdrs->vendor == PIOLINK_VENDOR_ID) ){ … } … } … } 파일명 : ~/lib/ofp-msgs.c
10.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Message) ovs-vswitchd(Vendor Message) enum ofperr ofputil_decode_flow_mod(…){ … if(raw == OFPRAW_OFPT11_FLOW_MOD){ … } else{ … if(raw == OFPRAW_OFPT10_FLOW_MOD){ … } else if(…) { … } else if(raw == OFPRAW_PIOLINK_FLOW_MOD){ /* PIOLINK EXTEND FLOW MOD */ VLOG_WARN(“Vendor Message Receive! "); /* fm 변수 설정 (match, cookie 등 ) */ memset(&fm->match.flow, 0, sizeof fm->match.flow); ofputil_wildcard_from_ofpfw10(0x003FFFFE, &fm->match.wc); fm->match.flow.in_port.ofp_port = 1; fm->priority = 200; fm->cookie = htonll(0); fm->cookie_mask = htonll(0); fm->new_cookie = 0x01; fm->idle_timeout = 10000; fm->hard_timeout = 30000; fm->importance = 0; fm->buffer_id = 0xFFFFFFFF; fm->out_port = 0x00; fm->out_group = OFPG11_ANY; /* command 변수 설정 (flow add, flow delete 등) */ command = 0x0000; // flow add /* raw_flags 변수 설정 */ raw_flags = 0x0000; } … } … } 파일명 : ~/lib/ofp-util.c OpenFlow의 FLOW_MOD에 관련된 파라미터를 OVS에 설정하는 부분. (*예제는 임의로 in_port 1에 매칭하도록 하드코딩 함.) 1. Vendor Message를 OVS가 수신 성공 (동작 검증을 위한 Log는 빨간색으로 표시)
11.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Action) ovs-vswitchd(Vendor Action) … #define OFPACTS /* Output. */ OFPACT(OUTPUT, ofpact_output, ofpact, "output") … OFPACT(PIOLINK, ofpact_piolink, ofpact, "piolink") … struct ofpact_piolink { struct ofpact ofpact; /* body 선언 */ uint16_t nop; uint32_t body; }; … 파일명 : ~/lib/ofp-actions.h … put_PIOLINK(struct ofpbuf *openflow); … static enum ofperr decode_PIOLINK(const struct piolink_action * , struct ofpbuf *); … 파일명 : ~/lib/ofp-actions.inc1 *컴파일할 때 삭제 되는 경우도 있으니 주의 !
12.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Action) ovs-vswitchd(Vendor Action) ... BUILD_ASSERT_DECL(sizeof(struct piolink_action) % OFP_ACTION_ALIGN == 0); … static struct ofpact_raw_instance all_raw_instances[] = { … { { 0xFF001021, 1, 0x01 }, PIOLINK_RAW, HMAP_NODE_NULL_INITIALIZER, HMAP_NODE_NULL_INITIALIZER, sizeof(struct piolink_action), sizeof(struct piolink_action), 0, 0, "PIOLINK", NULL, }, … (*중간의 OpenFlow Version은 내용이 반복돼 생략함) { { 0xFF001021, 1, 0x06 }, PIOLINK_RAW, HMAP_NODE_NULL_INITIALIZER, HMAP_NODE_NULL_INITIALIZER, sizeof(struct piolink_action), sizeof(struct piolink_action), 0, 0, "PIOLINK", NULL, }, }; … static inline struct piolink_action * put_PIOLINK (struct ofpbuf *openflow){ return ofpact_put_raw(openflow, 1, PIOLINK_RAW, 0); // version 1.0 } … static enum ofperr ofpact_decode(…){ switch(raw){ … case PIOLINK_RAW : return decode_PIOLINK_RAW(ALIGNED_CAST(const struct ship_action *, a), out); … } … } 파일명 : ~/lib/ofp-actions.inc2 OpenFlow Version 위의 내용과 OpenFlow Version만 다름 *컴파일할 때 삭제 되는 경우도 있으니 주의 !
13.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Action) ovs-vswitchd(Vendor Action) … enum ofp_raw_action_type{ … PIOLINK_RAW, }; … struct piolink_action{ ovs_be16 type; /* OFPAT_VENDOR. */ ovs_be16 len; /* piolink_action 길이 = 16*/ ovs_be32 vendor; /* PIOLINK_VENDOR_ID */ ovs_be16 subtype; /* PIOLINK */ /* body */ ovs_be16 nop; /* 구조체 크기를 맞추기 위함 */ ovs_be32 body; }; OFP_ASSERT(sizeof(struct piolink_action) == 16); static enum ofperr decode_PIOLINK_RAW(const struct piolink_action* pa, struct ofpbuf* out){ struct ofpact_piolink *piolink; piolink = ofpact_put_PIOLINK(out); /* piolink body 값 디코딩 */ piolink->body = ntohl(pa->body); return 0; } static void encode_PIOLINK( const struct ofpact_piolink* piolink , enum ofp_version ofp_version OVS_UNUSED , struct ofpbuf *out){ struct piolink_action* pa; pa = put_PIOLINK(out); /* piolink body 값 엔코딩 */ pa->body = htonl(piolink->body); } static char* OVS_WARN_UNUSED_RESULT parse_PIOLINK(char* arg, struct ofpbuf* ofpacts , enum ofputil_protocol* usable_protocols OVS_UNUSED){ struct ofpact_piolink* piolink = ofpact_put_PIOLINK(ofpacts); char *key, *value; while(ofputil_parse_key_value(&arg, &key, &value)){ char* error = NULL; if(!strcmp(key, "body")){ error = str_to_u32(value, &piolink->body); } else{ error = xasprintf("invalid key "%s"", key); } if(error) return error; } return NULL; } static void format_PIOLINK(const struct ofpact_piolink* piolink, struct ds* s) { ds_put_format(s, "piolink(body=%"PRIu32") ",piolink->body); } … static bool ofpact_is_set_or_move_action(…) { switch(a->type){ … case OFPACT_PIOLINK: return false; … } } … (뒷장에 계속!!) … 파일명 : ~/lib/ofp-actions.c 구조체 크기는 16의 배수로 해야함!
14.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Action) ovs-vswitchd(Vendor Action) static bool ofpact_is_allowed_in_actions_set(…){ switch(a->type){ … case OFPACT_PIOLINK: return false; … } } … enum ovs_instruction_type ovs_instruction_type_from_ofpact_type(…){ switch(type){ … case OFPACT_PIOLINK: default: … } } … static enum ofperr ofpact_check(…){ … switch(a->type){ … case OFPACT_PIOLINK: /* action 유효 체크 */ VLOG_WARN("OFPACT_PIOLINK VALID"); return 0; … } } … static bool ofpact_outputs_to_port(…){ switch(ofpact->type){ … case OFPACT_PIOLINK: default: return false; } } … static enum ofperr ofpact_decode_raw(…){ … if(oah->type == htons(OFPAT_VENDOR)){ … if( ( hdrs.vendor == …) || … || (hdrs.vendor == PIOLINK_VENDOR_ID) ){ … } … } … } … static void* ofpact_put_raw(…){ … switch(hdrs->vendor){ … case NX_VENDOR_ID: case PIOLINK_VENDOR_ID; … } } 파일명 : ~/lib/ofp-actions.c
15.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-vswitchd: Vendor Action) ovs-vswitchd(Vendor Action) … static bool ofpact_needs_recirculation_after_mpls(…){ … switch(a->type){ … case OFPACT_PIOLINK: return false; … } … } static void do_xlate_actions(…){ … OFPACT_FOR_EACH(a, ofpacts, ofpacts_len){ … switch(a->type) { … case OFPACT_PIOLINK: /* 커널로 전달할 메시지 만들기 */ VLOG_WARN(“Vendor Action Send"); const struct ofpact_piolink* piolink = ofpact_get_PIOLINK(a); ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, ctx->xout->odp_actions , &ctx->xout->wc, ctx->xbridge->masked_set_action); nl_msg_put_u32( ctx->xout->odp_actions , OVS_ACTION_ATTR_PIOLINK /* kernel module에서 메시지를 구별하기 위한 식별자 */ , odp_to_u32(20 ) /* kernel module에 전달할 메시지 body */ ); break; } } } … 파일명 : ~/ofproto/ofproto-dpif-xlate.c 2. Vendor Action을 OVS datapath로 전송
16.
© PIOLINK, Inc.
SDN No.1 Implementation(openvswitch.ko: Vendor Action) openvswitch.ko(Vendor Action) … enum ovs_piolink_attr{ OVS_PIOLINK_ATTR_UNSPEC, OVS_PIOLINK_ATTR_NOMAL, __OVS_PIOLINK_ATTR_MAX, }; #define OVS_PIOLINK_ATTR_MAX (__OVS_PIOLINK_ATTR_MAX – 1) … enum ovs_action_attr { OVS_ACTION_ATTR_UNSPEC, … OVS_ACTION_ATTR_PIOLINK, … __OVS_ACTION_ATTR_MAX }; … 파일명 : ~/datapath/linux/compat/include/linux/openvswitch.h Vendor Action 추가 Vendor Action의 subtype
17.
© PIOLINK, Inc.
SDN No.1 Implementation(openvswitch.ko: Vendor Action) openvswitch.ko(Vendor Action) … static int __ovs_nla_copy_actions(…){ … nla_for_each_nested(a, attr, rem) { static const u32 action_lens[OVS_ACTION_ATTR_MAX + 1] = { [OVS_ACTION_ATTR_OUTPUT] = sizeof(u32), … [OVS_ACTION_ATTR_PIOLINK] = (u32)-1 }; … switch(type) { … case OVS_ACTION_ATTR_PIOLINK: /* action 유효 체크 */ pr_info(“Vendor Action Receiven"); break; … } … } … } … 파일명 : ~/datapath/flow_netlink.c 3. Vendor Action을 OVS datapath가 수신
18.
© PIOLINK, Inc.
SDN No.1 Implementation(openvswitch.ko: Vendor Action) openvswitch.ko(Vendor Action) … static int do_execute_actions(…){ … for(a = attr, rem = len; rem > 0; a = nla_next(a, &rem)){ … switch(nla_type(a)) { … case OVS_ACTION_ATTR_PIOLINK: /* packet에 대한 action !! THE END!!*/ pr_info(“Vendor Action Processingn"); err = 0; break; … } … } … } 파일명 : ~/datapath/actions.c 4. 매칭되는 packet에 Vendor Action을 수행
19.
© PIOLINK, Inc.
SDN No.1 Implementation(ovs-ofctl: Vendor Message & Vendor Action) ovs-ofctl(Vendor Message & Vendor Action) ~> *수정 후 테스트 프로그램으로 사용 … static void piolink_vendor_test(int argc OVS_UNUSED, char* argv[]); static const struct command all_commands[] = { {"show", "switch", 1, 1, ofctl_show }, … {"piolink", NULL, 1, 1, piolink_vendor_test }, { NULL, NULL, 0, 0, NULL }, }; … static struct piolink_action { ovs_be16 type; ovs_be16 len; ovs_be32 vendor; ovs_be16 subtype; ovs_be16 nop; ovs_be32 body; }; static void piolink_vendor_test(int argc OVS_UNUSED, char* argv[]){ struct vconn* vconn; struct ofpbuf* request; enum ofputil_protocol protocol; enum ofp_version version;; struct ofpact_piolink* piolink; struct piolink_action pa = { 0xFFFF, htons(16), htonl(0xFF001021), htons(1), htons(0), htonl(2) }; protocol = open_vconn(argv[1], &vconn); protocol = set_protocol_for_flow_dump(vconn, protocol, OFPUTIL_P_OF10_STD); version = ofputil_protocol_to_ofp_version(protocol); request = ofpraw_alloc(OFPRAW_PIOLINK_FLOW_MOD, version, 0); piolink = ofpact_put(request, OFPACT_PIOLINK, 16); memcpy(piolink, &pa, sizeof(struct piolink_action)); transact_noreply(vconn, request); vconn_close(vconn); } 파일명 : ~/utilities/ovs-ofctl.c
20.
© PIOLINK, Inc.
SDN No.1 Implementation(검증) 1) Mininet을 이용해 환경 구축 2) 수정한 ovs-ofctl을 이용해 Vendor Message 전송 • “sudo ovs-ofctl piolink s1” 3) Vendor Message 수신 확인 “Log 1” 4) “ovs-ofpctl dump-flows s1” 으로 OVS의 flow table에 Vendor Action 저장 확인 5) Mininet에서 h1(port 1)에서 h2(port 2)로 ping을 보냄 6) Vendor Action 전송 확인 “Log 2” 7) Vendor Action 수신 확인 “Log 3” 8) Vendor Action으로 packet을 처리하는 것 확인 “Log 4”
21.
© PIOLINK, Inc.
SDN No.1 References http://www.openvswitch.org/ https://github.com/openvswitch/ovs/ http://en.wikipedia.org/wiki/Open_vSwitch http://www.slideshare.net/rajdeep/openvswitch-deep-dive http://mininet.org/ http://flowgrammable.org/sdn/openflow/message-layer/ https://www.opennetworking.org/images/stories/downloads/sdn- resources/onf-specifications/openflow/openflow-spec-v1.3.0.pdf http://dpdk.org/ http://www.apache.org/ http://www.xenproject.org/ https://www.openstack.org/ http://www.linux-kvm.org/page/Main_Page https://www.opennetworking.org/sdn-resources/openflow
22.
감사합니다. ㈜파이오링크 서울시 금천구 가산디지털2로
98 (가산동 550-1) IT캐슬 1동 401호 TEL: 02-2025-6900 FAX: 02-2025-6901 www.PIOLINK.com
Download