北京邮电大学学报

  • EI核心期刊

北京邮电大学学报 ›› 2021, Vol. 44 ›› Issue (2): 14-19.doi: 10.13190/j.jbupt.2020-133

• 未来网络体系架构和关键技术专题 • 上一篇    下一篇

通用平台高性能可扩展网络地址转换系统

李峻峰, 李丹, 黄昱恺, 程阳, 令瑞林   

  1. 清华大学 计算机科学与技术系, 北京 100084
  • 收稿日期:2020-08-20 出版日期:2021-04-28 发布日期:2021-04-28
  • 通讯作者: 李丹(1981-),男,教授,E-mail:tolidan@tsinghua.edu.cn. E-mail:tolidan@tsinghua.edu.cn
  • 作者简介:李峻峰(1992-),男,博士生.
  • 基金资助:
    国家重点研发计划项目(2018YFB1800100);广东省重点领域研发计划项目(2018B010113001);国家自然科学基金项目(61432002,61772305,61672499)

High Performance and Scalable NAT System on Commodity Platforms

LI Jun-feng, LI Dan, HUANG Yu-kai, CHENG Yang, LING Rui-lin   

  1. Department of Computer Science and Technology, Tsinghua University, Beijing 100084, China
  • Received:2020-08-20 Online:2021-04-28 Published:2021-04-28

摘要: 为了提高通用平台网络地址转换(NAT)的性能,设计了高性能可扩展网络地址转换系统——Quick NAT.高速网络地址转换查表算法将原始规则表划分为若干子表,并采用哈希查表算法极大地提高了NAT规则的查找效率;为了充分发挥多核中央处理器(CPU)和多队列网卡的性能优势,设计了高效的并行架构,使用本地化的连接记录表和基于比较并交换原子操作的无锁NAT规则表,避免了多CPU核访问修改全局表带来的锁开销;借助轮询取代中断、越过内核等机制,全程使用指针操作数据包,实现零拷贝,进一步降低开销.实验结果表明,Quick NAT可以极大地提高NAT查表的效率和吞吐量,具有较强的多核可扩展性,能够在10 Gbit/s的网络环境下实现64 byte小包线速.

关键词: 网络地址转换, 性能优化, 哈希算法, 数据结构本地化

Abstract: Quick network address translation (NAT) is proposed to improve the network performance of the NAT system on the commodity server by three ways. Firstly, the quick NAT search algorithm is designed to use the Hash search instead of the sequential search to reduce latency when looking up the NAT rule table. Secondly, to leverage the power of multi-core central processing unit (CPU) and multi-queue network interface card, Quick NAT enables multiple CPU cores to process in parallel. The localized connection tracking table and the compare-and-swap based lock-free NAT Hash tables are designed to eliminate the lock overhead. Thirdly, Quick NAT uses the polling and zero-copy delivery to reduce the cost of interrupt and packet copies. The experiment results show that Quick NAT obtains high scalability and line-rate throughput on the commodity server.

Key words: network address translation, performance optimization, Hash search, localized data structure

中图分类号: