(國防科學技術大學 計算機學院,湖南 長沙 410073)
2(中國人民解放軍95942部隊,湖北 武漢 430313)
摘要: 通過物理網卡接口進行數據收發,需要接口板卡能完整掛載在操作系統下。該文提出一種基于虛擬以太網設備TAP的數據轉發模型,通過在虛擬設備和物理設備之間增加一個轉發器,使得接口卡即便不能在操作系統下掛載也能通過轉發實現標準的數據收發。在轉發過程中用戶可以對數據幀進行自定義封裝和構造,從而實現了PPP數據幀在以太網設備上的收發,并通過對PPP數據幀頭進行細微改造,達到利用wireshark的以太網鏈路協議解析器實現PPP鏈路協議解析的目的,并進行了實驗驗證。
關鍵詞:TUN/TAP;RAW SOCKET;PPP數據收發;PPP協議解析;wireshark
The Realization of PPP Data Transceiver and Protocol Analysis Based on TAP Device under Linux
LUO Yuebin1, WANG Baosheng1, CHEN Xiaomei1, LIU Xiaobo2
1(School of Computer, National University of Defense Technology, Changsha, 410073, China)
2(95942 Troops of PLA, Wuhan, 430313, China)
Abstract: In general, network interface cards should be complete mounted in the operating system to realize data transceiver. This paper presents a data forwarding model based on the virtual Ethernet device TAP. In this model we build a transceiver between the virtual device and the physical device so that we can realize standard data transceiver even though interface cards cannot be mounted in the operating system. After some changes of the PPP protocol format we realize PPP data transceiver on TAP. Then we use wireshark to achieve the purpose of PPP protocol analysis by changing the head of the PPP frame, which has been confirmed in the following experiment.
Key words: TUN/TAP; raw socket; PPP data transceiver; PPP protocol analysis; wireshark
參考文獻
[1] 肖萍萍,吳健學,周芳等. SDH原理與技術[M].北京:北京郵電大學出版社. 2002.
[2] M Y Maxim Krasnyansky. Universal TUN/TAP driver[OL] .ht-tp://vtun.sourceforge.net/tun/. 1999.
[3] 龍湘君,邵棟,榮國平. 基于TUN/TAP與UDP打洞技術的虛擬局域網[J]計算機應用與軟件,2011,7(28) : 224-226.
[5] 尤文堅. 利用RAW SOCKET捕獲網絡底層數據包的方法[J]. 廣西輕工業,,2007,(11).
[6] 李俊華. PPPoE協議分析及Linux操作系統下的設計與實現[D]. 西南交通大學,2004 .
[7] 蔡開裕,朱培棟,徐明. 計算機網絡[M]. 北京:機械工業出版社,2009.
基金項目:長江學者和創新團隊發展計劃(No.IRT1012);“網絡技術”湖南省科技創新團隊支持計劃;湖南省自然科學基金資助項目(No.11JJ7003);可重構信息通信基礎網絡模擬仿真實驗平臺國家重大基礎研究專項
作者簡介
羅躍斌,男,1987年生,云南玉溪人,國防科技大學計算機學院碩士研究生,主要研究方向為網絡協議測試,網絡協議技術。
王寶生,男,1970年生,河北黃驊人,博士,國防科技大學計算機學院研究員,博士生導師,主要研究方向為計算機網絡體系結構,網絡協議技術。
陳曉梅,女,1974年生,山東海陽人,博士,國防科技大學計算機學院副研究員,碩士生導師,主要研究方向為下一代高性能網絡協議。
劉曉波,男,1973年生,山西垣曲人,中國人民解放軍95942部隊職教辦主任。