㈜유미테크
DPDK
(Data Plane Development Kit)
Intel Architecture 기반 패킷 처리
최적화 시스템 소프트웨어
㈜유미테크2㈜유미테크 DPDK
1. DPDK란?
2. Environmennt Abstraction Layer
3. Ethernet Poll Mode Driver Architecture
4. 주요 라이브러리
5. DPDK 개발 환경
6. 네트워크 카드 Driver Setting
7. Compiling a Sample Application
8. 테스트 환경 구성
9. DPDK 응용 기본 흐름도
10.향후 계획
개요
㈜유미테크3㈜유미테크 DPDK
1. DPDK란?
㈜유미테크4㈜유미테크 DPDK
 DPDK : Data plane Development Kit
- Intel Architecture 기반 패킷 처리 최적화 시스템 소프트웨어
- 패킷 처리 속도 최적화 프레임 워크 지원
- 어플리케이션 개발자는 로직 개발에 충실
 x86 플랫폼에 고속 패킷 처리를 위한 라이브러리와 드라이버의 집합
- 리눅스 사용자 공간 IO 동작
- 프로파일에 필요한 모든 원소를 제공
- 고성능 패킷 처리 애플리케이션 작성
 DPDK Libraries and Drivers
- Memory Manager : object pools, huge page memory, object ring, alignment
- Buffer Manager : pre-allocates fixed size buffers
- Queue Manager : safe lockless queues, no spinlocks, avoiding wait times
- Poll Mode Drivers : no asynchronous, interrupt-based signaling mechanisms
- Flow Classification : a hash based on tuple information
1.1 DPDK란?
㈜유미테크5㈜유미테크 DPDK
 DPDK 장점
- 고성능 패킷 처리
- 고가의 장비를 사용 하지 않아도 된다.
- CPU가 지장 받지 않고 작업을 수행 할 수 있다.
 DPDK 단점
- DPDK를 사용하기 위한 랜카드 종류가 한정되어 있다. (2014. 06 현재)
• e1000 (82540, 82545, 82546)
• e1000e (82571..82574, 82583, ich8..ich10, pch..pch2)
• igb (82575..82576, 82580, i210, i211, i350, i354, dh89xxcc)
• ixgbe (82598..82599, x540)
• i40e (xl710)
1.2 DPDK 장점과 단점
㈜유미테크6㈜유미테크 DPDK
 활용 사례
- 윈드리버 : 실시간 가상화 소프트 웨어
• 네트워크 기능 가상화, NFV 및 클라우드 환경을 위한 윈드리버 OVP 개발
• 고속 네트워크 환경 및 물리적 디바이스에 필적하는 고성능 제공
• 네트워크 구간의 어디에서든 유연하게 운용 가능, TOC 절감
• 서비스 제공사의 네트워크 활용도 향상, 서비스 적용시간 단축
- 6WIND : 6WINDGate 소프트 웨어
• 모바일 인프라 스트럭쳐와 네트워킹 제품의 개발
1.3 DPDK 활용 사례
㈜유미테크7㈜유미테크 DPDK
1.4 Core Components
㈜유미테크8㈜유미테크 DPDK
 Core Components Architecture
- rte_timer : Timer 기능. EAL에서 제공되는 타이머 인터페이스 기반으로 DPDK 실행 단위로 타
이머 서비스를 제공
- rte_malloc : hugepages에 메모리 할당
- rte_mempool : 메모리에 있는 개체의 풀을 할당
- rte_eal + libc : 응용 프로그램 로딩, 메모리 할당. 시간 인터페이스, PCI 접근 및 로딩 지원
- rte_mbuf : IP 트래픽 및 메시지 데이터 패킷의 버퍼를 지원
- rte_ring : 크기가 고정 된 개체를 저장하거나 코어 사이의 통신을 허용하는 FIFO를 고정
1.4 Core Components
㈜유미테크9㈜유미테크 DPDK
2. Environment Abstraction Layer
㈜유미테크10㈜유미테크 DPDK
 하드웨어 및 메모리 공간과 같은 낮은 수준의 리소스를 엑세스 한다.
 EAL은 응용 프로그램 및 라이브러리에서 환경 특성을 숨기는 일반적인 인터페이스를 제공
 자원을 할당하는 방법을 결정하는 초기화 루틴을 책임진다.
 EAL – 어플리케이션과 라이브러리로부터 인터페이스에 대한 서비스를 제공
- Intel DPDK loading and launching
- Support for multi-process and multi-thread execution types
- Core affinity / assignment procedures
- System memory allocation / de-allocation
- Atomic / lock operations
- Time reference
- PCI bus access
- Trace and debug functions
- CPU feature identification
- Interrupt handling
- alarm operations
2.1 Environment Abstraction Layer
㈜유미테크11㈜유미테크 DPDK
 The EAL options are as follows
2.2 The EAL options are as follows
$ example –c 0x5 –n 4 …
0 1 0 1
0123
㈜유미테크12㈜유미테크 DPDK
3. Ethernet Poll Mode Driver
Architecture
㈜유미테크13㈜유미테크 DPDK
 1Gbe and 10Gbe 이더넷을 폴링 모드 드라이버를 포함하며 비동기 없이 작동하도록 설계 이더
넷 컨트롤러, 신호 전달 메커니즘을 기반으로한 인터럽트
 장치를 구성, 사용자 공간에서 BSD 드라이버 실행을 통해 API를 제공하고 각각의 큐를 구성
 PMD는 수신 프로세스 및 사용자의 어플리세이션에서 패킷을 임의의 인터럽트 없이 신속하게
전달하는 직접적인 디스크립터
3. Ethernet Poll Mode Driver Architecture
㈜유미테크14㈜유미테크 DPDK
4. 주요 라이브러리
㈜유미테크15㈜유미테크 DPDK
 Packet Forwarding Algorithm Suport
- 패킷 포워딩 알고리즘을 지원하는 라이브러리
 librte_net
- IP 프로토콜을 정의하고 편리한 매크로를 가지고 있다.
 Ring Library
- Ring Lib는 큐를 관리 할수 있다.
- 무한한 크기의 연결 리스트를 갖는다.
- rte_ring의 속성
• FIFO
• 최대 크기는 고정되고 포인터는 테이블에 저장된다.
• Lockless implementation
• Multi-consumer, single-consumer는 대기열에서 제외된다.
• Multi-producer, single-producer는 대기열에 포함된다.
• Bulk dequeue – 성공하면 지정된 개체 수를 뺀다. 그렇지 않으면 실패
• Bulk enqueue – 성공하면 지정된 개체수를 큐에 넣는다. 그렇지 않으면 실패
• Burst dequeue – 지정된 수를 충족 할 수 없는 경우 최대 사용 가능한 개체 큐에서 제거된다.
• Burst enqueue – 지정된 개체수가 성취 될 수 없는 경우에 최대 개체를 저장한다
4. 주요 라이브러리
㈜유미테크16㈜유미테크 DPDK
5. DPDK 개발 환경
㈜유미테크17㈜유미테크 DPDK
 DPDK 지원
- Kernel version : 2.6.33 이상 (개발 서버 버전: 3.13.0)
- glibc : 2.7 이상
 테스트 환경 (Ubuntu 12.10)
- ixbge 모듈 기본 탑재 (인텔 10G 네트워크 드라이버)
 커널 환경 설정 (hugepages)
- hugepages = 1024
- default_hugepagesz=1G hugepagesz=1G hugepages=4
- echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048KB/nr_hugepages
- echo 2048 > /sys/devices/system/node/node0hugepages/hugepages-
2048KB/nr_hugepages
- mkdir /mnt/huge && mount –t hugetlbfs nodev /mnt/huge
5.1 DPDK 개발 환경
㈜유미테크18㈜유미테크 DPDK
 Compilation of the Intel DPDK
- Required Tools
• GNU make
• coreutils : cmp, sed, grep, arch
• gcc(version 4.5.x 이상)
• libc headers(glibc-devel.i686 / libc6-dev-i386; glibc-devel.x86_64)
• Linux kernel headers or sources required to build kernel modules
• Additional packages required for 32-bit compilation on 64-bit systems are:
glibc.i686, libgcc.i686, libstdc++.i686 and glibc-devel.i686
• Python(version 2.6 or 2.7)
- Optional Tools
• C++ Compiler(icc)
• libpcap headers and libraries to compile and use the libpcap-based poll-mode driver
This driver is disabled by default and can be enabled by setting
CONFIG_RTE_LIBRTE_PMD_PCAP=Y in the build time config file
5.1 DPDK 개발 환경
㈜유미테크19㈜유미테크 DPDK
 DPDK source directory
$ unzip DPDK-<version>.zip
$ cd DPDK-<version>
 DPDK is composed of several directories :
- lib : Source code of Intel DPDK libraries
- app : Source code of Intel DPDK applications
- examples : Source code of Intel DPDK application examples
 To install and make targets
$ make install T=x86_64-default-linuxapp-gcc
 To prepare a target without building it
$ make config T=x86_64-default-linuxapp-gcc
5.2 DPDK 빌드
㈜유미테크20㈜유미테크 DPDK
6. 네트워크 카드 Driver Setting
㈜유미테크21㈜유미테크 DPDK
 네트워크 카드 설정
- Kernel
6.1 Kernel Driver 모드 Setting
• IP 설정
- 경로 : /etc/network/interfaces
- 설정 내용
- 인터페이스 재시작
$ /etc/init.d/networking restart
- 인터페이스 활성화
$ ifconfig <interface name> up
- 인터페이스 비활성화
$ ifconfig <interface name> down
auto <interface name>
iface <interface name> inet static
Address <ip>
Netmask <netmask>
Network <network>
Broadcast <broadcast>
Gateway <gateway>
Dns-nameservers <dns-nameservers>
Dns-search <dns-search>
• 라우팅 설정
- 특정 IP에서 오는 패킷을 특정 인터페이스로 수신
$ route add –net <ip> netmask <netmask> dev <interface name>
- 설정된 라우팅 테이블 삭제
$ route net –net <ip> netmask <netmask> dev <interface name>
- 리눅스 재시작 시 라우팅 테이블 설정
- 경로 : /etc/network/interface
Up route add –net <ip> netmask <netmask> dev <interface name>
㈜유미테크22㈜유미테크 DPDK
 네트워크 카드 설정
- Loading the Intel DPDK igb_uio Module
$ cd <DPDK>/x86_64-default-linuxapp-gcc
$ sudo modprobe uio
$ sudo insmod kmod/igb_uio.ko
- Binding and Unbinding Network Ports to / from the igb_uio Module
$ ./tools/pci_unbinnd.py – status
6.2 UIO Driver 모드 Setting
㈜유미테크23㈜유미테크 DPDK
 네트워크 카드 설정
- To bind device eth2, 0000:0a:00.0, to the igb_uio driver :
$ ./tools/pci_unbind.py – bind=igb_uio 0a:00.0 or ./tools/pci_unbind.py – bind=igb_uio eth2
$ ./tools/pci_unbind.py – bind=igb_uio 0a:00.1 or ./tools/pci_unbind.py – bind=igb_uio eth3
• Routing table indicates that interface 0000:0a:00.1 is active. Not modifying 메시지
발생 시 설정 하려는 인터페이스를 사용하지 않는 상태로 변경 후 다시 위 의 명령어를
실행
6.2 UIO Driver 모드 Setting
㈜유미테크24㈜유미테크 DPDK
7. Compiling a Sample Application
㈜유미테크25㈜유미테크 DPDK
 When compiling an application in the Linux* environment on the Intel DPDK, the following
variables must be exported :
- RTE_SDK – Points to the Intel DPDK installation directory
$ export RTE_SDK=/home/ymtech/dpdk/DPDK-1.6.0
- RTE_TARGET – Points to the Intel DPDK target environment directory
$ export RTE_TARGET=x86_64-default-linuxapp-gcc
 Sample – helloworld
- helloworld 위치로 이동
7. Compiling a Sample Application
㈜유미테크26㈜유미테크 DPDK
 Sample – helloworld
$ ls
$ cd build && ls -al
7. Compiling a Sample Application
㈜유미테크27㈜유미테크 DPDK
 Sample – helloworld
$ sudo ./helloworld –c f –n 4
- 메모리가 동적 할당 됨.
7. Compiling a Sample Application
㈜유미테크28㈜유미테크 DPDK
8. 테스트 환경 구성
㈜유미테크29㈜유미테크 DPDK
 테스트 환경 및 실행
8. 테스트 환경 구성
DPDK 수집 패킷 전송
10 G
10 G
10 G
10 G
Recv Send
Recv Send
㈜유미테크30㈜유미테크 DPDK
9. DPDK 응용 기본 흐름도
㈜유미테크31㈜유미테크 DPDK
9. DPDK 응용 기본 흐름도
시작
(main)
EAL 초기화
(rte_eal_inet)
종료
메모리 할당
(rte_mempool_cre
ate)
드라이버 초기화
(rte_pmd_init_all)
등록된 PCI Driver
확인
(rte_eal_pci_probe)
드라이버가 초기화
된 이더넷 장치의 수
(rte_eth_dev_count )
이더넷 장치의 상황
에 맞는 정보 검색
(rte_eth_dev_info_
get)
이더넷 장치를 구성
(rte_eth_dev_confi
gure)
이더넷 장치의 주소
를 검색
(rte_eth_macaddr_
get)
이더넷 장치에 대한
수신 큐를 할당
(rte_eth_rx_queue_
setup)
이더넷 장치 시작
(rrte_eth_dev_start)
모든 lcores 함수를
실행
(rte_eal_mp_remot
e_launch)
패킷이 수신되면 그
에 대한 포인터를
rte_mbuf 구조에 저
장(rte_eth_rx_burst)
수신된 패킷의 수
확인
수신된 패킷의 메
모리 해제
(rte_pktmbuf_free)
While
1초 주기로 수신
된 패킷 확인
㈜유미테크32㈜유미테크 DPDK
10. 향후 계획
㈜유미테크33㈜유미테크 DPDK
 CentOS에 DPDK 개발 환경 셋팅 및 테스트
 멀티코드 응용 작성 방법 기술 조사
 DNS 패킷 분석 및 Mirroring 모듈과 연결
10. 향후 계획

More Related Content

PPSX
FD.IO Vector Packet Processing
PDF
BPF / XDP 8월 세미나 KossLab
PDF
Intel dpdk Tutorial
PPTX
Dpdk applications
PDF
Faster packet processing in Linux: XDP
PDF
DPDK In Depth
PPSX
FD.io Vector Packet Processing (VPP)
PDF
DPDK: Multi Architecture High Performance Packet Processing
FD.IO Vector Packet Processing
BPF / XDP 8월 세미나 KossLab
Intel dpdk Tutorial
Dpdk applications
Faster packet processing in Linux: XDP
DPDK In Depth
FD.io Vector Packet Processing (VPP)
DPDK: Multi Architecture High Performance Packet Processing

What's hot (20)

PPTX
Introduction to DPDK
PPTX
Understanding DPDK
PPTX
DPDK
PPTX
DPDK KNI interface
PDF
Linux Networking Explained
PPTX
VPP事始め
PPTX
Tcpdump
PDF
LAS16-403: GDB Linux Kernel Awareness
PDF
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
PDF
DPDK in Containers Hands-on Lab
PDF
Service Function Chaining in Openstack Neutron
PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
PDF
Network Programming: Data Plane Development Kit (DPDK)
PDF
Introduction to eBPF and XDP
PDF
Sparser: Faster Parsing of Unstructured Data Formats in Apache Spark with Fir...
PDF
DPDK QoS
PDF
DoS and DDoS mitigations with eBPF, XDP and DPDK
PDF
Linux-Internals-and-Networking
PDF
BPF - in-kernel virtual machine
ODP
eBPF maps 101
Introduction to DPDK
Understanding DPDK
DPDK
DPDK KNI interface
Linux Networking Explained
VPP事始め
Tcpdump
LAS16-403: GDB Linux Kernel Awareness
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
DPDK in Containers Hands-on Lab
Service Function Chaining in Openstack Neutron
LinuxCon 2015 Linux Kernel Networking Walkthrough
Network Programming: Data Plane Development Kit (DPDK)
Introduction to eBPF and XDP
Sparser: Faster Parsing of Unstructured Data Formats in Apache Spark with Fir...
DPDK QoS
DoS and DDoS mitigations with eBPF, XDP and DPDK
Linux-Internals-and-Networking
BPF - in-kernel virtual machine
eBPF maps 101
Ad

Viewers also liked (20)

PDF
[1A6]Docker로 보는 서버 운영의 미래
PDF
Recent advance in netmap/VALE(mSwitch)
PDF
Intel DPDK Step by Step instructions
PPTX
Understanding DPDK algorithmics
PDF
Virtualized network with openvswitch
ODP
Dpdk performance
PDF
Open vSwitch 패킷 처리 구조
PPTX
Netmap presentation
PDF
In-memory Caching: Curb Tail Latency with Pelikan
PDF
DPDK Summit 2015 - HP - Al Sanders
PPTX
Nexus
PPTX
[234] toast cloud open stack sdn 전략-박성우
PPT
Java Script 2 Part.1
PPT
C수업자료
PDF
[C언어] 반복문_for문
PDF
ONOS (Open Network Operating System) Blackbird Release 분석
PDF
ONF Atrium 분석
PDF
NAIM Networks SDN/NFV Training
PPTX
리눅스 스터디 1회차
PDF
오픈스택 커뮤니티 하반기 스터디: 안내
[1A6]Docker로 보는 서버 운영의 미래
Recent advance in netmap/VALE(mSwitch)
Intel DPDK Step by Step instructions
Understanding DPDK algorithmics
Virtualized network with openvswitch
Dpdk performance
Open vSwitch 패킷 처리 구조
Netmap presentation
In-memory Caching: Curb Tail Latency with Pelikan
DPDK Summit 2015 - HP - Al Sanders
Nexus
[234] toast cloud open stack sdn 전략-박성우
Java Script 2 Part.1
C수업자료
[C언어] 반복문_for문
ONOS (Open Network Operating System) Blackbird Release 분석
ONF Atrium 분석
NAIM Networks SDN/NFV Training
리눅스 스터디 1회차
오픈스택 커뮤니티 하반기 스터디: 안내
Ad

Similar to DPDK (Data Plane Development Kit) (20)

PDF
네트워크 부트의 활용, 원격관리
PDF
Maker 오해와 진실
PDF
[OpenInfra Days Korea 2018] (Track 2) Cloud 환경에서의 보안과 네트워크 성능 보안 (xFW), DPDK OVS
PDF
미디움 회사소개서
PDF
[Korean](주) 미디움 회사소개서
PDF
Medium Company profile
PDF
Linux 강의자료 ed10
PDF
ce_grad
PPTX
caanoo Device driver
PDF
ice_grad
PDF
아이씨엔 매거진- December 2012. Industrial Communication Network MAGAZINE
PDF
2015 n tels iot product lineup_2015
PDF
아이씨엔 매거진- August 2013. Industrial Communication Network MAGAZINE
PPTX
Processor
PDF
아이씨엔 매거진- November 2012. Industrial Communication Network MAGAZINE
PPTX
프로세스
PPTX
사물인터넷을 활용한 디지털 도어락 DDiT 비교논문 발표자료 1차
PDF
김성윤 - 우분투로 슈퍼컴 만들기 (2011Y03M26D)
PDF
OCP Switch Overview
PDF
아이씨엔 매거진- August 2013. Industrial Communication Network MAGAZINE
네트워크 부트의 활용, 원격관리
Maker 오해와 진실
[OpenInfra Days Korea 2018] (Track 2) Cloud 환경에서의 보안과 네트워크 성능 보안 (xFW), DPDK OVS
미디움 회사소개서
[Korean](주) 미디움 회사소개서
Medium Company profile
Linux 강의자료 ed10
ce_grad
caanoo Device driver
ice_grad
아이씨엔 매거진- December 2012. Industrial Communication Network MAGAZINE
2015 n tels iot product lineup_2015
아이씨엔 매거진- August 2013. Industrial Communication Network MAGAZINE
Processor
아이씨엔 매거진- November 2012. Industrial Communication Network MAGAZINE
프로세스
사물인터넷을 활용한 디지털 도어락 DDiT 비교논문 발표자료 1차
김성윤 - 우분투로 슈퍼컴 만들기 (2011Y03M26D)
OCP Switch Overview
아이씨엔 매거진- August 2013. Industrial Communication Network MAGAZINE

More from ymtech (20)

PPTX
20171120 tech day-11th-소프트웨어 테스팅2-서현용
PPTX
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
PPTX
20170713 tech day_7th_pxe 부팅-김주한
PPTX
20170609 tech day_4th-nginx(lb)-이재훈
PPTX
20170519 tech day-3rd-highcharts를 이용한 차트 구현-김영석
PPTX
20170414 techday 2nd_uiux디자인-최민희
PPTX
20170310 tech day-1st-maven을 이용한 프로그램 빌드-박준홍
PPTX
Mikrotic CCR1036 라우팅 설정
PPTX
Cubietruck 리눅스 이미지 설치
PPTX
Installation Openstack Swift
PPTX
Welcome to keystone the open stack identity service_v1.0.0-20141208-1212
PPTX
Ubuntu Host AP Setting
PPTX
Intel Galileo Linux Setting
PPTX
MarsBoard RK3066 Linux 설치
PPTX
HP 3800-24G-2SFP OpenFlow Setting
PDF
Openstack Instance Resize
PDF
Openstack live migration
PPTX
SDN OpenFlow Load Balancer 시나리오
PPTX
TR-069 클라이언트 검토자료8편
PPTX
TR-069 클라이언트 검토자료7편
20171120 tech day-11th-소프트웨어 테스팅2-서현용
20170908 tech day-9th-재미없는 java runtime process 디버그-김성중
20170713 tech day_7th_pxe 부팅-김주한
20170609 tech day_4th-nginx(lb)-이재훈
20170519 tech day-3rd-highcharts를 이용한 차트 구현-김영석
20170414 techday 2nd_uiux디자인-최민희
20170310 tech day-1st-maven을 이용한 프로그램 빌드-박준홍
Mikrotic CCR1036 라우팅 설정
Cubietruck 리눅스 이미지 설치
Installation Openstack Swift
Welcome to keystone the open stack identity service_v1.0.0-20141208-1212
Ubuntu Host AP Setting
Intel Galileo Linux Setting
MarsBoard RK3066 Linux 설치
HP 3800-24G-2SFP OpenFlow Setting
Openstack Instance Resize
Openstack live migration
SDN OpenFlow Load Balancer 시나리오
TR-069 클라이언트 검토자료8편
TR-069 클라이언트 검토자료7편

DPDK (Data Plane Development Kit)

  • 1. ㈜유미테크 DPDK (Data Plane Development Kit) Intel Architecture 기반 패킷 처리 최적화 시스템 소프트웨어
  • 2. ㈜유미테크2㈜유미테크 DPDK 1. DPDK란? 2. Environmennt Abstraction Layer 3. Ethernet Poll Mode Driver Architecture 4. 주요 라이브러리 5. DPDK 개발 환경 6. 네트워크 카드 Driver Setting 7. Compiling a Sample Application 8. 테스트 환경 구성 9. DPDK 응용 기본 흐름도 10.향후 계획 개요
  • 4. ㈜유미테크4㈜유미테크 DPDK  DPDK : Data plane Development Kit - Intel Architecture 기반 패킷 처리 최적화 시스템 소프트웨어 - 패킷 처리 속도 최적화 프레임 워크 지원 - 어플리케이션 개발자는 로직 개발에 충실  x86 플랫폼에 고속 패킷 처리를 위한 라이브러리와 드라이버의 집합 - 리눅스 사용자 공간 IO 동작 - 프로파일에 필요한 모든 원소를 제공 - 고성능 패킷 처리 애플리케이션 작성  DPDK Libraries and Drivers - Memory Manager : object pools, huge page memory, object ring, alignment - Buffer Manager : pre-allocates fixed size buffers - Queue Manager : safe lockless queues, no spinlocks, avoiding wait times - Poll Mode Drivers : no asynchronous, interrupt-based signaling mechanisms - Flow Classification : a hash based on tuple information 1.1 DPDK란?
  • 5. ㈜유미테크5㈜유미테크 DPDK  DPDK 장점 - 고성능 패킷 처리 - 고가의 장비를 사용 하지 않아도 된다. - CPU가 지장 받지 않고 작업을 수행 할 수 있다.  DPDK 단점 - DPDK를 사용하기 위한 랜카드 종류가 한정되어 있다. (2014. 06 현재) • e1000 (82540, 82545, 82546) • e1000e (82571..82574, 82583, ich8..ich10, pch..pch2) • igb (82575..82576, 82580, i210, i211, i350, i354, dh89xxcc) • ixgbe (82598..82599, x540) • i40e (xl710) 1.2 DPDK 장점과 단점
  • 6. ㈜유미테크6㈜유미테크 DPDK  활용 사례 - 윈드리버 : 실시간 가상화 소프트 웨어 • 네트워크 기능 가상화, NFV 및 클라우드 환경을 위한 윈드리버 OVP 개발 • 고속 네트워크 환경 및 물리적 디바이스에 필적하는 고성능 제공 • 네트워크 구간의 어디에서든 유연하게 운용 가능, TOC 절감 • 서비스 제공사의 네트워크 활용도 향상, 서비스 적용시간 단축 - 6WIND : 6WINDGate 소프트 웨어 • 모바일 인프라 스트럭쳐와 네트워킹 제품의 개발 1.3 DPDK 활용 사례
  • 8. ㈜유미테크8㈜유미테크 DPDK  Core Components Architecture - rte_timer : Timer 기능. EAL에서 제공되는 타이머 인터페이스 기반으로 DPDK 실행 단위로 타 이머 서비스를 제공 - rte_malloc : hugepages에 메모리 할당 - rte_mempool : 메모리에 있는 개체의 풀을 할당 - rte_eal + libc : 응용 프로그램 로딩, 메모리 할당. 시간 인터페이스, PCI 접근 및 로딩 지원 - rte_mbuf : IP 트래픽 및 메시지 데이터 패킷의 버퍼를 지원 - rte_ring : 크기가 고정 된 개체를 저장하거나 코어 사이의 통신을 허용하는 FIFO를 고정 1.4 Core Components
  • 10. ㈜유미테크10㈜유미테크 DPDK  하드웨어 및 메모리 공간과 같은 낮은 수준의 리소스를 엑세스 한다.  EAL은 응용 프로그램 및 라이브러리에서 환경 특성을 숨기는 일반적인 인터페이스를 제공  자원을 할당하는 방법을 결정하는 초기화 루틴을 책임진다.  EAL – 어플리케이션과 라이브러리로부터 인터페이스에 대한 서비스를 제공 - Intel DPDK loading and launching - Support for multi-process and multi-thread execution types - Core affinity / assignment procedures - System memory allocation / de-allocation - Atomic / lock operations - Time reference - PCI bus access - Trace and debug functions - CPU feature identification - Interrupt handling - alarm operations 2.1 Environment Abstraction Layer
  • 11. ㈜유미테크11㈜유미테크 DPDK  The EAL options are as follows 2.2 The EAL options are as follows $ example –c 0x5 –n 4 … 0 1 0 1 0123
  • 12. ㈜유미테크12㈜유미테크 DPDK 3. Ethernet Poll Mode Driver Architecture
  • 13. ㈜유미테크13㈜유미테크 DPDK  1Gbe and 10Gbe 이더넷을 폴링 모드 드라이버를 포함하며 비동기 없이 작동하도록 설계 이더 넷 컨트롤러, 신호 전달 메커니즘을 기반으로한 인터럽트  장치를 구성, 사용자 공간에서 BSD 드라이버 실행을 통해 API를 제공하고 각각의 큐를 구성  PMD는 수신 프로세스 및 사용자의 어플리세이션에서 패킷을 임의의 인터럽트 없이 신속하게 전달하는 직접적인 디스크립터 3. Ethernet Poll Mode Driver Architecture
  • 15. ㈜유미테크15㈜유미테크 DPDK  Packet Forwarding Algorithm Suport - 패킷 포워딩 알고리즘을 지원하는 라이브러리  librte_net - IP 프로토콜을 정의하고 편리한 매크로를 가지고 있다.  Ring Library - Ring Lib는 큐를 관리 할수 있다. - 무한한 크기의 연결 리스트를 갖는다. - rte_ring의 속성 • FIFO • 최대 크기는 고정되고 포인터는 테이블에 저장된다. • Lockless implementation • Multi-consumer, single-consumer는 대기열에서 제외된다. • Multi-producer, single-producer는 대기열에 포함된다. • Bulk dequeue – 성공하면 지정된 개체 수를 뺀다. 그렇지 않으면 실패 • Bulk enqueue – 성공하면 지정된 개체수를 큐에 넣는다. 그렇지 않으면 실패 • Burst dequeue – 지정된 수를 충족 할 수 없는 경우 최대 사용 가능한 개체 큐에서 제거된다. • Burst enqueue – 지정된 개체수가 성취 될 수 없는 경우에 최대 개체를 저장한다 4. 주요 라이브러리
  • 17. ㈜유미테크17㈜유미테크 DPDK  DPDK 지원 - Kernel version : 2.6.33 이상 (개발 서버 버전: 3.13.0) - glibc : 2.7 이상  테스트 환경 (Ubuntu 12.10) - ixbge 모듈 기본 탑재 (인텔 10G 네트워크 드라이버)  커널 환경 설정 (hugepages) - hugepages = 1024 - default_hugepagesz=1G hugepagesz=1G hugepages=4 - echo 2048 > /sys/kernel/mm/hugepages/hugepages-2048KB/nr_hugepages - echo 2048 > /sys/devices/system/node/node0hugepages/hugepages- 2048KB/nr_hugepages - mkdir /mnt/huge && mount –t hugetlbfs nodev /mnt/huge 5.1 DPDK 개발 환경
  • 18. ㈜유미테크18㈜유미테크 DPDK  Compilation of the Intel DPDK - Required Tools • GNU make • coreutils : cmp, sed, grep, arch • gcc(version 4.5.x 이상) • libc headers(glibc-devel.i686 / libc6-dev-i386; glibc-devel.x86_64) • Linux kernel headers or sources required to build kernel modules • Additional packages required for 32-bit compilation on 64-bit systems are: glibc.i686, libgcc.i686, libstdc++.i686 and glibc-devel.i686 • Python(version 2.6 or 2.7) - Optional Tools • C++ Compiler(icc) • libpcap headers and libraries to compile and use the libpcap-based poll-mode driver This driver is disabled by default and can be enabled by setting CONFIG_RTE_LIBRTE_PMD_PCAP=Y in the build time config file 5.1 DPDK 개발 환경
  • 19. ㈜유미테크19㈜유미테크 DPDK  DPDK source directory $ unzip DPDK-<version>.zip $ cd DPDK-<version>  DPDK is composed of several directories : - lib : Source code of Intel DPDK libraries - app : Source code of Intel DPDK applications - examples : Source code of Intel DPDK application examples  To install and make targets $ make install T=x86_64-default-linuxapp-gcc  To prepare a target without building it $ make config T=x86_64-default-linuxapp-gcc 5.2 DPDK 빌드
  • 21. ㈜유미테크21㈜유미테크 DPDK  네트워크 카드 설정 - Kernel 6.1 Kernel Driver 모드 Setting • IP 설정 - 경로 : /etc/network/interfaces - 설정 내용 - 인터페이스 재시작 $ /etc/init.d/networking restart - 인터페이스 활성화 $ ifconfig <interface name> up - 인터페이스 비활성화 $ ifconfig <interface name> down auto <interface name> iface <interface name> inet static Address <ip> Netmask <netmask> Network <network> Broadcast <broadcast> Gateway <gateway> Dns-nameservers <dns-nameservers> Dns-search <dns-search> • 라우팅 설정 - 특정 IP에서 오는 패킷을 특정 인터페이스로 수신 $ route add –net <ip> netmask <netmask> dev <interface name> - 설정된 라우팅 테이블 삭제 $ route net –net <ip> netmask <netmask> dev <interface name> - 리눅스 재시작 시 라우팅 테이블 설정 - 경로 : /etc/network/interface Up route add –net <ip> netmask <netmask> dev <interface name>
  • 22. ㈜유미테크22㈜유미테크 DPDK  네트워크 카드 설정 - Loading the Intel DPDK igb_uio Module $ cd <DPDK>/x86_64-default-linuxapp-gcc $ sudo modprobe uio $ sudo insmod kmod/igb_uio.ko - Binding and Unbinding Network Ports to / from the igb_uio Module $ ./tools/pci_unbinnd.py – status 6.2 UIO Driver 모드 Setting
  • 23. ㈜유미테크23㈜유미테크 DPDK  네트워크 카드 설정 - To bind device eth2, 0000:0a:00.0, to the igb_uio driver : $ ./tools/pci_unbind.py – bind=igb_uio 0a:00.0 or ./tools/pci_unbind.py – bind=igb_uio eth2 $ ./tools/pci_unbind.py – bind=igb_uio 0a:00.1 or ./tools/pci_unbind.py – bind=igb_uio eth3 • Routing table indicates that interface 0000:0a:00.1 is active. Not modifying 메시지 발생 시 설정 하려는 인터페이스를 사용하지 않는 상태로 변경 후 다시 위 의 명령어를 실행 6.2 UIO Driver 모드 Setting
  • 25. ㈜유미테크25㈜유미테크 DPDK  When compiling an application in the Linux* environment on the Intel DPDK, the following variables must be exported : - RTE_SDK – Points to the Intel DPDK installation directory $ export RTE_SDK=/home/ymtech/dpdk/DPDK-1.6.0 - RTE_TARGET – Points to the Intel DPDK target environment directory $ export RTE_TARGET=x86_64-default-linuxapp-gcc  Sample – helloworld - helloworld 위치로 이동 7. Compiling a Sample Application
  • 26. ㈜유미테크26㈜유미테크 DPDK  Sample – helloworld $ ls $ cd build && ls -al 7. Compiling a Sample Application
  • 27. ㈜유미테크27㈜유미테크 DPDK  Sample – helloworld $ sudo ./helloworld –c f –n 4 - 메모리가 동적 할당 됨. 7. Compiling a Sample Application
  • 29. ㈜유미테크29㈜유미테크 DPDK  테스트 환경 및 실행 8. 테스트 환경 구성 DPDK 수집 패킷 전송 10 G 10 G 10 G 10 G Recv Send Recv Send
  • 31. ㈜유미테크31㈜유미테크 DPDK 9. DPDK 응용 기본 흐름도 시작 (main) EAL 초기화 (rte_eal_inet) 종료 메모리 할당 (rte_mempool_cre ate) 드라이버 초기화 (rte_pmd_init_all) 등록된 PCI Driver 확인 (rte_eal_pci_probe) 드라이버가 초기화 된 이더넷 장치의 수 (rte_eth_dev_count ) 이더넷 장치의 상황 에 맞는 정보 검색 (rte_eth_dev_info_ get) 이더넷 장치를 구성 (rte_eth_dev_confi gure) 이더넷 장치의 주소 를 검색 (rte_eth_macaddr_ get) 이더넷 장치에 대한 수신 큐를 할당 (rte_eth_rx_queue_ setup) 이더넷 장치 시작 (rrte_eth_dev_start) 모든 lcores 함수를 실행 (rte_eal_mp_remot e_launch) 패킷이 수신되면 그 에 대한 포인터를 rte_mbuf 구조에 저 장(rte_eth_rx_burst) 수신된 패킷의 수 확인 수신된 패킷의 메 모리 해제 (rte_pktmbuf_free) While 1초 주기로 수신 된 패킷 확인
  • 33. ㈜유미테크33㈜유미테크 DPDK  CentOS에 DPDK 개발 환경 셋팅 및 테스트  멀티코드 응용 작성 방법 기술 조사  DNS 패킷 분석 및 Mirroring 모듈과 연결 10. 향후 계획