DPDK原生TCP/IP stack架构

1. dpdk介绍

dpdk是 intel 公司发布的一款数据包转发处理套件. 它运行于linux userspace。这组套件包括了linux 进程所需要的大部分组件。

但缺少一个传统的tcp/ip 协议栈。其他应用程序没办法方便的通过dpdk对外通信。本文主要介绍如果移植一个TCP/IP协议栈到dpdk。

  • device: ethdev, devargs,bond,KNI,PCI,PCI IDs
  • memory: memseg, memzone,mempool,malloc,memcpy
  • timers: cycles, timer,alarm
  • locks: atomic, rwlock,spinlock
  • CPU arch: branch prediction, cache prefetch, byte order, CPU flags
  • CPU multicore: interrupts, launch, lcore, per-lcore, power/freq
  • layers: ethernet, IP,SCTP,TCP,UDP,frag/reass,LPM route,ACL
  • QoS: metering, scheduler,RED congestion
  • hashes: hash, jhash,FBK hash,CRC hash
  • containers: mbuf, ring,distributor,tailq,bitmap
  • packet framework:
    • port: ethdev, ring, frag, reass, sched, src/sink
    • table: lpm IPv4, lpm IPv6, ACL, hash, array, stub
    • pipeline
  • basic: approx fraction, random, key/value args, string
  • debug: debug, log,warnings,errno
  • misc: EAL config, common,version

  • 2. ANS总体架构

ANS(Acceleted Network Stack)是参考freebsd,重新设计实现的dpdk原生的tcp/ip协议栈。

ANS架构如下:

Ø  DPDK:各种快速包处理库,是ANS加速网络协议栈的运行环境。

Ø  ANS:加速网络协议栈,包括以下模块:

  ethernet:网络数据包二层处理模块。

  ARP:ARP协议栈处理模块。

  IPv4 Forwarding: 网络数据包三层处理模块,包括三层转发功能。

  IPv4 Reassembly:网络数据包分片重组模块。

  Routing:路由转发表管理模块。

  ICMP:ICMP协议处理模块。

  ACL:包过滤模块,通过KNI旁路控制面数据流到linux kernel。

  UDP Termination:UDP协议栈处理模块。

  TCP Termination:TCP协议栈处理模块。

  SOCKET:是ANS和上层应用程序的接口层,和标准linux SOCKET API兼容。

  配置管理:通过CLI配置Device、IP、Route、Neigh、ACL、Log;从linux kernel同步IP和route到ANS;查看IP统计。


DPDK原生TCP/IP stack架构_第1张图片


有兴趣一起开发的,可以访问代码库:

https://github.com/ansyun/dpdk-ans  

QQ群:86883521



你可能感兴趣的:(DPDK原生TCP/IP stack架构)