高速網卡數(shù)據(jù)傳輸?shù)难芯颗c實現(xiàn)
發(fā)布時間:2018-11-13 10:21
【摘要】:隨著網絡的快速發(fā)展和計算機的普及,網絡帶寬和流量都在急速增長,特別是由于光纖地誕生應用,網絡帶寬已經到達10Gb/s水平。隨著網絡帶寬的增加,對網卡也提出了更高的要求,于是,高速網卡應運而生。然而,受數(shù)據(jù)拷貝,中斷開銷,系統(tǒng)調用等因素影響,高速網卡往往達不到預想中的性能。因此,我們迫切需要對高速網卡的數(shù)據(jù)傳輸機制進行改進,為防火墻、路由器、IDS及其他網絡測試應用提供一個可靠的捕包系統(tǒng)。輪詢技術、NAPI技術、ZERO-COPY技術就是針對高速網卡數(shù)據(jù)傳輸機制的一些改進手段,目的是降低數(shù)據(jù)傳輸過程中系統(tǒng)資源的消耗。Luca Deri在ZERO-COPY、NAPI基礎上提出了PFRING機制。PFRING在內核中,創(chuàng)建了一種帶緩存的協(xié)議簇,改進了內核協(xié)議棧處理數(shù)據(jù)包的方式,降低了網卡中斷響應頻率。 在PFRING基礎上,本文提出了基于DNA的高速網卡數(shù)據(jù)傳輸機制,所謂DNA,就是通過把網卡設備的寄存器全部映射進用戶態(tài),使得用戶層的應用程序可以直接對網卡進行訪問和控制,避免了數(shù)據(jù)傳輸過程中內核態(tài)和用戶態(tài)的互斥操作,使得用戶程序能夠更加方便有效地對數(shù)據(jù)緩沖區(qū)進行管理,此外,為減少數(shù)據(jù)拷貝,讓PFRING的環(huán)形緩存不再保存原始數(shù)據(jù)包數(shù)據(jù),而僅僅存儲數(shù)據(jù)包緩存的地址,最后,設計了自適應NAPI機制,讓數(shù)據(jù)包的傳輸方式可以根據(jù)網絡流量的變化而進行靈活地切換。通過以上幾種技術,大大提高了高速網卡的數(shù)據(jù)傳輸效率。 本論文閱讀了大量國內外的相關文獻,對高速網卡相關技術進行了比較分析,改進了高速網卡的傳輸機制,實現(xiàn)了真正的ZERO-COPY,提升了網卡數(shù)據(jù)包I/O的性能。本文的主要工作包括以下幾個方面: (1)理論研究部分,首先詳細介紹了高速網卡數(shù)據(jù)傳輸?shù)南嚓P技術,分析了網卡數(shù)據(jù)傳輸?shù)腎/O過程,,然后對Linux網絡結構進行了研究,剖析了高速網卡的驅動程序,接著研究了提高網卡數(shù)據(jù)傳輸效率和性能的幾種方式,特別針對PFRING機制進行了深入地分析,了解了PFRING機制的原理,實現(xiàn),最后針對PFRING機制的不足,提出了基于DNA的高速網卡數(shù)據(jù)傳輸機制; (2)實踐研究部分,詳細介紹了DNA機制的實現(xiàn)過程,包括把網卡寄存器映射進用戶空間,改進DMA環(huán)形緩沖區(qū),改進PFRING環(huán)形緩存,實現(xiàn)自適應NAPI機制等等。最后,配置實驗環(huán)境,對DNA的性能進行了測試,證明了基于DNA的高速網卡數(shù)據(jù)傳輸機制的優(yōu)越性。
[Abstract]:With the rapid development of the network and the popularization of computers, the network bandwidth and traffic are increasing rapidly, especially because of the birth of optical fiber applications, the network bandwidth has reached the level of 10Gb/s. With the increase of network bandwidth, higher requirements for network cards are put forward, so high-speed network cards emerge as the times require. However, due to the influence of data copy, interrupt overhead, system call and so on, the high speed network card often can not achieve the expected performance. Therefore, we urgently need to improve the data transmission mechanism of high-speed network card to provide a reliable packet capture system for firewall, router, IDS and other network testing applications. Polling technology, NAPI technology and ZERO-COPY technology are some improved methods for data transmission mechanism of high-speed network card. The purpose is to reduce the consumption of system resource. Luca Deri in ZERO-COPY,. On the basis of NAPI, a PFRING mechanism is proposed. In the kernel, PFRING creates a kind of protocol cluster with cache, which improves the way in which the kernel protocol stack handles data packets and reduces the frequency of interrupt response of the network card. On the basis of PFRING, this paper puts forward the data transmission mechanism of high-speed network card based on DNA. The so-called DNA, is that by mapping all the registers of the network card device into the user state, the application program in the user layer can directly access and control the network card. It avoids the mutually exclusive operation between kernel state and user state in the process of data transmission, makes the user program more convenient and effective to manage the data buffer, in addition, in order to reduce the data copy, The ring cache of PFRING can not save the original data but only store the address of the data packet cache. Finally an adaptive NAPI mechanism is designed so that the transmission mode of the data packet can be switched flexibly according to the change of network traffic. The data transmission efficiency of high-speed network card is greatly improved by the above technology. This paper has read a large number of domestic and foreign related literature, compared and analyzed the high speed network card correlation technology, improved the high speed network card transmission mechanism, realized the real ZERO-COPY, to enhance the network card packet I / O performance. The main work of this paper includes the following aspects: (1) in the theoretical research part, firstly, the related technology of high-speed network card data transmission is introduced in detail, and the I / O process of network card data transmission is analyzed. Then the Linux network structure is studied, the driver of the high-speed network card is analyzed, and several ways to improve the efficiency and performance of the network card data transmission are studied, especially the PFRING mechanism is deeply analyzed, and the principle of the PFRING mechanism is understood. Finally, aiming at the shortage of PFRING mechanism, a high-speed network card data transmission mechanism based on DNA is proposed. (2) in the part of practical research, the implementation of DNA mechanism is introduced in detail, including mapping network card register into user space, improving DMA ring buffer, improving PFRING ring buffer, realizing adaptive NAPI mechanism and so on. Finally, the performance of DNA is tested by configuring the experimental environment, and the superiority of high-speed network card data transmission mechanism based on DNA is proved.
【學位授予單位】:電子科技大學
【學位級別】:碩士
【學位授予年份】:2013
【分類號】:TP334.7
本文編號:2328812
[Abstract]:With the rapid development of the network and the popularization of computers, the network bandwidth and traffic are increasing rapidly, especially because of the birth of optical fiber applications, the network bandwidth has reached the level of 10Gb/s. With the increase of network bandwidth, higher requirements for network cards are put forward, so high-speed network cards emerge as the times require. However, due to the influence of data copy, interrupt overhead, system call and so on, the high speed network card often can not achieve the expected performance. Therefore, we urgently need to improve the data transmission mechanism of high-speed network card to provide a reliable packet capture system for firewall, router, IDS and other network testing applications. Polling technology, NAPI technology and ZERO-COPY technology are some improved methods for data transmission mechanism of high-speed network card. The purpose is to reduce the consumption of system resource. Luca Deri in ZERO-COPY,. On the basis of NAPI, a PFRING mechanism is proposed. In the kernel, PFRING creates a kind of protocol cluster with cache, which improves the way in which the kernel protocol stack handles data packets and reduces the frequency of interrupt response of the network card. On the basis of PFRING, this paper puts forward the data transmission mechanism of high-speed network card based on DNA. The so-called DNA, is that by mapping all the registers of the network card device into the user state, the application program in the user layer can directly access and control the network card. It avoids the mutually exclusive operation between kernel state and user state in the process of data transmission, makes the user program more convenient and effective to manage the data buffer, in addition, in order to reduce the data copy, The ring cache of PFRING can not save the original data but only store the address of the data packet cache. Finally an adaptive NAPI mechanism is designed so that the transmission mode of the data packet can be switched flexibly according to the change of network traffic. The data transmission efficiency of high-speed network card is greatly improved by the above technology. This paper has read a large number of domestic and foreign related literature, compared and analyzed the high speed network card correlation technology, improved the high speed network card transmission mechanism, realized the real ZERO-COPY, to enhance the network card packet I / O performance. The main work of this paper includes the following aspects: (1) in the theoretical research part, firstly, the related technology of high-speed network card data transmission is introduced in detail, and the I / O process of network card data transmission is analyzed. Then the Linux network structure is studied, the driver of the high-speed network card is analyzed, and several ways to improve the efficiency and performance of the network card data transmission are studied, especially the PFRING mechanism is deeply analyzed, and the principle of the PFRING mechanism is understood. Finally, aiming at the shortage of PFRING mechanism, a high-speed network card data transmission mechanism based on DNA is proposed. (2) in the part of practical research, the implementation of DNA mechanism is introduced in detail, including mapping network card register into user space, improving DMA ring buffer, improving PFRING ring buffer, realizing adaptive NAPI mechanism and so on. Finally, the performance of DNA is tested by configuring the experimental environment, and the superiority of high-speed network card data transmission mechanism based on DNA is proved.
【學位授予單位】:電子科技大學
【學位級別】:碩士
【學位授予年份】:2013
【分類號】:TP334.7
【參考文獻】
相關期刊論文 前3條
1 秦大偉;萬國龍;戴英霞;;高性能網絡服務器Linux網絡接口驅動程序設計[J];電子測量技術;2005年05期
2 張攀勇;王達偉;曾宇;歷軍;;專用捕包網絡適配器的設計與實現(xiàn)[J];通信學報;2006年02期
3 譚躍生;賈元春;王靜宇;顧瑞春;;一種改進的NAPI輪詢機制方法研究[J];微計算機應用;2007年09期
相關碩士學位論文 前1條
1 喬思遠;基于DMA_ring的高速網絡報文捕獲機制的實現(xiàn)及應用[D];山東大學;2007年
本文編號:2328812
本文鏈接:http://sikaile.net/kejilunwen/jisuanjikexuelunwen/2328812.html
最近更新
教材專著