TW201251377A - NIC data transmission method and system - Google Patents

NIC data transmission method and system Download PDF

Info

Publication number
TW201251377A
TW201251377A TW100121788A TW100121788A TW201251377A TW 201251377 A TW201251377 A TW 201251377A TW 100121788 A TW100121788 A TW 100121788A TW 100121788 A TW100121788 A TW 100121788A TW 201251377 A TW201251377 A TW 201251377A
Authority
TW
Taiwan
Prior art keywords
packet
layer
parameter
sending
network card
Prior art date
Application number
TW100121788A
Other languages
Chinese (zh)
Inventor
Tan-Ke Luo
Yan He
Qing-Kang Wang
Original Assignee
Hon Hai Prec Ind Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Publication of TW201251377A publication Critical patent/TW201251377A/en

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The present invention provides a NIC data transmission method and system. The method includes: setting the control parameters that used sending in the application layer of the source host of the Linux operating system, and defining the same format Data structure with control parameters in the kernel layer of the source host of the Linux operating system; creating the underlying socket in the application layer, and packing the control parameters, source address, destination address and the content package to packet, sending packet to the application layer by data link layer in the kernel layer in the source host; resolving the packet in the data link layer, and separating the packet will be sent from control parameters; controlling the packet transmission process according to the control parameters in the source host.

Description

201251377 六、發明說明: 【發明所屬之技術領域】 [0001]本發明涉及一種網卡資料傳輸方法及系統。 [先前技術] 目前的測試中’網卡傳輪封包的大致機制如下:在源 端主機Linux作業系統的應用層創建通訊端傳輸封包,該 封包通過0SI 7層模型自上而下層層轉發,到達Linux作 業系統的kernei層中的資料連結層;在資料連結層網卡 的驅動程式將該封包寫入網卡共用的訂ite buffer中, 並對訂ite-buffer中的封包進行分割,在物理層將分割 〇 後封包以序列的形式傳送到網路中去,網路中的目的主 機將根據封包中的目的位址來接受屬於自己的封包。 闕朗試方法雖然能達到傳輸資料,及驗證物理鏈路的連 通性的目的,但是在工廢測試專案中,測試的目的往往 只是驗證物_路的連通性和資财網卡之間傳輸的峰 值’所以不需要資料通過完整的OSI七層。而在0SI七層 模型中,封包從應用居3 丁 & 層往下傳輸資料的過程中,根據相 〇 關協定與_ ’封包每經過—層’都要在頭部做相關封 ◎ 裝的動作才往下傳輸’耗時相當長,成為封包傳輸的一 大瓶頸,且無法得到物理層的資料在網卡之間傳輸的峰 值,再者,封包從Llnux作業系統的應用層傳到以顧作 業系統的1^1161層以及從Li_作業系統的kernel層返 回報告給Li_作業系統的應用層的過程令,也需要耗費 掉回應的傳輸時間,這也就成了封包傳送的另一瓶頸。 假設Linux作業系統的應用層要發送1〇〇〇個封包,如果 100121788 表單編號A0101 第4頁/共27頁 1002036878-0 201251377 用常規的方法做這件事情,Linux作業系統的應用層需要 與Linux作業系統的kernel層進行1 000次的溝通,這是 非常耗時的事情;另外,傳送給目的網卡的資料由於從 上至下的傳輸,資料包有丟失的可能性,存在穩定性的 隱患,有時無法正確回應給源端主機Linux作業系統的應 用層,從而無法有效判斷資料是否準確傳送到目的地。 【發明内容】 [0004] ❹ [0005]201251377 VI. Description of the Invention: [Technical Field of the Invention] [0001] The present invention relates to a network card data transmission method and system. [Prior Art] In the current test, the general mechanism of the NIC transmission packet is as follows: The application layer of the source host Linux operating system creates a communication terminal transmission packet, and the packet is forwarded from the top to the bottom layer through the 0SI 7 layer model to reach Linux. The data link layer in the kernei layer of the operating system; the driver in the data link layer network card writes the packet into the subscription ite buffer shared by the network card, and divides the packet in the subscribed ite-buffer, and divides the packet in the physical layer. The post-packet is transmitted to the network in the form of a sequence, and the destination host in the network will accept its own packet according to the destination address in the packet. Although the test method can achieve the purpose of transmitting data and verifying the connectivity of the physical link, in the work waste test project, the purpose of the test is often only to verify the connectivity between the object and the network card. 'So no need to pass the complete OSI seven layers. In the 0SI seven-layer model, the packet is transmitted from the application to the third layer and the layer is down. In accordance with the relevant agreement, the _ 'package per pass-layer' must be related in the head. The action is only transmitted down. It takes a long time to become a bottleneck for packet transmission, and it cannot obtain the peak value of the physical layer data transmission between the network cards. Furthermore, the packet is transmitted from the application layer of the Llnux operating system to the homework. The process of the system's 1^1161 layer and the return from the kernel layer of the Li_ operating system to the application layer of the Li_ operating system also requires the transmission time of the response, which becomes another bottleneck for packet transmission. Assume that the application layer of the Linux operating system is to send 1 packet. If 100121788 Form No. A0101 Page 4 / Total 27 Page 1002036878-0 201251377 This is done in the usual way, the application layer of the Linux operating system needs to be Linux. The kernel layer of the operating system performs 1000 times of communication, which is very time consuming. In addition, the data transmitted to the destination network card has the possibility of loss due to the transmission from top to bottom, and there is a hidden danger of stability. Sometimes the application layer of the Linux operating system of the source host cannot be correctly responded, so that it is impossible to effectively determine whether the data is accurately transmitted to the destination. SUMMARY OF THE INVENTION [0004] ❹ [0005]

鑒於以上内容,有必要提供一種網卡資料傳輸方法及系 統,能夠將封包直接由Linux作業系統的應用層發送至資 料連結層,可準確、穩定、高效的進行網卡資料的傳輸 〇 所述網卡資料傳輸方法,應用於網卡的資料傳輸,該方 法包括以下步驟:設置步驟:在源端主機的Linux作業系 統的應用層設置用於發送的控制參數,並在源端主機的 Linux作業系統的kerne 1層定義與控制參數格式相同的 資料結構;封裝步驟:在所述應用層創建底層套接字, 並將控制參數、源端位址、目的位址及發送内容封裝至 封包中,所述源端位址為源端主機中第一網卡的MAC位址 ,所述目的位址為目的主機中第二網卡的MAC位址,所述 源端主機與目的主機通過網路連接;發送步驟:在源端 主機中將封包由所述應用層發送至所述kernel層中的資 料連結層;解析步驟:在資料連結層中解析封包,將要 發送的封包及控制參數進行分離,所述控制參數包括發 送參數、隨機設置參數、延時參數、回饋參數和調試參 數;管控步驟:在源端主機中根據分離出的控制參數管 100121788 表單編號A0101 第5頁/共27頁 1002036878-0 201251377 技封包的發送過程。 [0006] [0007] [0008] 所述網卡資料傳輸系統,運行於電腦中該系統包括: 汉置权、’’用於在源端主機的Unux作業系統的應用膚設 置用於發送的控制參數,並在源端主_unux作業系統 的kernel層定義與控制參數格式相同的資料結構;封裝 模組,用於在料細層_底層套龄,並將控制參 數、源端位址、目的位址及發送内容封裝至封包中,所 述源端位址為源端主機中第—網卡的MAC位址,所述目的 位址為目的主機中第二網卡的_位址,所述源端主機與 目的主機通過網路連接;發送模組,用於在源端主機中 將封包由所述應用層發送至所述kernel層中的資料連結 層,解析模組’用於在資料連結層中解析封包,將要發 送的封包及控制參數進行分離,所述控制參數包括發送 參數、隨機設置參數、延時參數、回饋參數和調試參數 ;管控模組,用於在源端主機中根據分離出的控制參數 管控封包的發送過程。 相較於習知技術’本發明所述之網卡資料傳輪方法及系 統,能夠將封包直接由LMuX作業系統的應用層發送至資 料連結層,益可減少Linux作業系統的應用層與Linux作 業系統的kernel層溝通的农數,可準確、穩定、高效的 進行網卡資料的傳輸。 【實施方式】 如圖1所示,係為本發明網肀資料傳輸系統較佳實施例之 100121788 架構圖。 網卡資料傳輸系統10運行於滹端主機1中,該源端主機1 --· ----- 第6頁/并27育 表單編號A0101 1002 [0009] 201251377 [0010] ο [0011] [0012] [0013] Ο 還包括第一網卡11,所述源端主機1通過網路2與目的主 機3連接,目的主機3中包含第二網卡30。所述網路2可以 是企業内部網(Intranet)或乙太網(Ethernet), 也可以是網際網路(Internet)或其他類型的通訊網路 所述第一網卡11和第二網卡30可内置於同一主機中,也 可分別位於不同主機中,通過網路2進行連接。本較佳實 施例以第一網卡11和第二網卡30位於不同主機中,通過 網路2進行連接為例進行介紹。 如圖2所示,係為本發明網卡資料傳輸系統較佳實施例之 功能模組圖》 所述網卡資料傳輸系統10包括設置模組1〇〇、封裝模組 101、發送模組102、解析模組103、管控模組1〇4。 所述設置模組_用於在源端主機_inu_f系统的 應用層設置用於發送的控制參數,並在源端主似的 Unux作㈣㈣kefnel層械與控制參數格式相同的 資料結構。所述資料結構用來錢和解析應用層所設置 的控制參數。 [0014] 所述控制參數包括:發送參數、隨機設置參數、延時參 數、回饋參數和賴參數等。料發送參數用於設定投 遞封包的次數;所料機設置參_於在㈣封包的過 程中’進行封包的資料内容及長度的控制;所述延時參 數用於控祕送«間^㈣%她祕封包發送 失敗時,控㈣新料封包的錢;料戰 100121788 表單編號A0101 第7頁/共27頁 1002036878-0 201251377 封匕的發送過程中顯示的相關資訊的輸出,但此時需用 戶進行相關命令的輪入。 [0015] [0016] [0017] 如圖6所不’所述資料結構包含:Control、Dest Adless ' Source Address 、 Type/Length 、 Data , 所 述Control 中包含:Burst、Rand〇m、j)eiay、Retry、In view of the above, it is necessary to provide a network card data transmission method and system, which can directly send the packet from the application layer of the Linux operating system to the data link layer, and can accurately, stably and efficiently transmit the network card data, and the network card data transmission The method is applied to data transmission of a network card, and the method comprises the following steps: setting step: setting a control parameter for sending at an application layer of a Linux operating system of the source host, and kerne layer 1 of the Linux operating system of the source host Defining a data structure having the same format as the control parameter; encapsulating step: creating an underlying socket in the application layer, and encapsulating the control parameter, the source address, the destination address, and the sending content into the packet, where the source terminal The address is the MAC address of the first network card in the source host, the destination address is the MAC address of the second network card in the destination host, and the source host and the destination host are connected through the network; sending step: at the source end Sending, by the application layer, the packet to the data link layer in the kernel layer in the host; parsing step: parsing in the data link layer The packet separates the packet to be sent and the control parameter, and the control parameter includes a sending parameter, a random setting parameter, a delay parameter, a feedback parameter, and a debugging parameter. The control step is: according to the separated control parameter tube 100121788 form in the source host No. A0101 Page 5 of 27 1002036878-0 201251377 The sending process of the technology package. [0007] [0008] The network card data transmission system runs on a computer, and the system includes: a Han power, a 'control parameter for the application environment of the Unux operating system of the source host for sending And in the source layer of the main _unux operating system, the kernel structure defines the same data structure as the control parameter format; the encapsulation module is used for the seed layer _ bottom set age, and the control parameters, the source end address, the destination bit The address and the sending content are encapsulated into a packet, where the source address is the MAC address of the first network card in the source host, and the destination address is the _ address of the second network card in the destination host, and the source host And the destination host is connected through the network; the sending module is configured to send the packet from the application layer to the data link layer in the kernel layer in the source host, and the parsing module is configured to parse in the data link layer The packet separates the packet to be sent and the control parameter, and the control parameter includes a sending parameter, a random setting parameter, a delay parameter, a feedback parameter, and a debugging parameter. The control module is configured to be separated according to the control in the source host. The parameter is the process of sending the control packet. Compared with the prior art technology card transmission method and system of the present invention, the packet can be directly sent from the application layer of the LLuX operating system to the data link layer, thereby reducing the application layer of the Linux operating system and the Linux operating system. The number of farms communicated by the kernel layer can accurately, stably and efficiently transfer network card data. [Embodiment] As shown in FIG. 1, it is a 100121788 architecture diagram of a preferred embodiment of the network data transmission system of the present invention. The network card data transmission system 10 runs in the terminal host 1 , and the source host 1 --· ----- page 6 / 27 form number A0101 1002 [0009] 201251377 [0010] ο [0011] [0012 [0013] The first network card 11 is also included. The source host 1 is connected to the destination host 3 through the network 2, and the destination host 3 includes the second network card 30. The network 2 may be an intranet or an Ethernet, or may be an Internet or other type of communication network. The first network card 11 and the second network card 30 may be built in In the same host, they can also be located in different hosts and connected through network 2. In the preferred embodiment, the first network card 11 and the second network card 30 are located in different hosts, and the connection is performed through the network 2 as an example. As shown in FIG. 2, it is a functional module diagram of a preferred embodiment of the network card data transmission system of the present invention. The network card data transmission system 10 includes a setup module 1 , a package module 101 , a transmission module 102 , and an analysis The module 103 and the control module 1〇4. The setting module _ is configured to set a control parameter for sending at the application layer of the source host _inu_f system, and at the source end is similar to the Unux (4) (4) kefnel layer and the same data structure of the control parameter format. The data structure is used to money and parse the control parameters set by the application layer. [0014] The control parameters include: a sending parameter, a random setting parameter, a delay parameter, a feedback parameter, and a Lai parameter. The material sending parameter is used to set the number of times the delivery packet is sent; the material setting parameter is used to control the content and length of the data packet in the process of (4) packet; the delay parameter is used for secret control to send «间^(四)% of her When the secret packet fails to be sent, the money of the new material package is controlled (four); the material battle 100121788 Form No. A0101 Page 7 / Total 27 pages 1002036878-0 201251377 The output of the related information displayed during the transmission of the seal, but at this time the user needs to perform The rounding of related commands. [0017] [0017] The data structure as shown in FIG. 6 includes: Control, Dest Adless 'Source Address, Type/Length, Data, and the Control includes: Burst, Rand〇m, j) eiay , Retry,

Debug。資料結構中Control用於接收和解析應用層所設 置的控制參數’ Control中對應各項分別對應接收控制參 數中各參數,Burst對應發送參數,Random對應隨機設 置參數’ Delay對應延時參數,Retry對應回饋參數, Debug對應調試參數。所述pest Address用於接收封包 中目的位址,所述s〇urce Address用於接收封包中源端 位址,所述Type/Length用於接收封包的類型及長度, 所述Data用於接收封包内容。 在Linux作業系統中,所述kernel層也可稱為核心 内核層,實際對應的是作業系統中的.内核.,ker>n、 3 el層負 責與各種底層硬體溝通,各種適配器的驅動就是在 、 kernel層實現的。 所述封裝模組101用於在源端主機1的Linux作業系 應用層創建底層套接字’並將控制參數、源端饭址 的位址及發送内容封裝至封包中。所述源端位址為目Debug. In the data structure, Control is used to receive and parse the control parameters set by the application layer. The corresponding items in the Control respectively correspond to the parameters in the receiving control parameters, Burst corresponds to the sending parameters, Random corresponds to the random setting parameter 'Delay corresponding delay parameter, Retry corresponding feedback Parameters, Debug corresponds to the debugging parameters. The destination address is used to receive the destination address in the packet, the s〇urce address is used to receive the source address in the packet, the Type/Length is used to receive the type and length of the packet, and the Data is used to receive the packet. content. In the Linux operating system, the kernel layer can also be called the core kernel layer, and the actual counterpart is the kernel in the operating system. The ker>n, 3el layer is responsible for communicating with various underlying hardware, and the drivers of various adapters are Implemented in the kernel layer. The encapsulation module 101 is configured to create an underlying socket ’ at the Linux operating system application layer of the source host 1 and encapsulate the control parameters, the address of the source address, and the transmission content into the packet. The source address is

主機1中第一網卡11的MAC位址,所述目的位址A 畤目的主 機3中第二網卡30的MAC位址。 [0018] 底層套接字的格式為:int fd S0CK_RAW, IPPROTO.TCP);The MAC address of the first network card 11 in the host 1, and the destination address A is the MAC address of the second network card 30 in the host 3. [0018] The format of the underlying socket is: int fd S0CK_RAW, IPPROTO.TCP);

socket(PF packet 通過底層套接字 100121788 表單編號A0101 第8頁/共27頁 201251377 [0019] Ο [0020] [0021] Ο [0022] [0023] 第一網卡11 ’即通過操作底層套接字可以實現對第一網 卡11的控制。上述底層套接字格式中的S〇CK_RAW可以換 成SOCK一PACKET,換成s〇CK_PACKET之後的底層套接字 與原來為SOCK一RAW的底層套接字功能相同,但是綁定第 一網卡11的方式不同。 底層套接字可以實現封包直接由Linux作業系統的應用層 發送至資料連結層的目的,從而繞開〇Si七層模型中的前 五層,此五層為:應用層、表示層、會話層、傳輸層、 網路層。 所述發送模組102用於在源端主機1中將封包由l i nux作 業系統的應用層發送至Linux作業系統的kernel層中的 資料連結層。在内核即kernel層中,包括資料連結層、 物理層及第一網卡11的驅動程式。 如圖5所示,在Linux作業系統的應用層中進行封包的封 裝’通過底層套接字可以實現由Linux作業系統的應用層 直接發送至資料連結層,繞開0SI七層模型中的應用層、 表示層、會括層、傳輸層和網路層這五層。在kernei層 中包括資料連結層及物理層。 所述解析模組1〇3用於在源端主機1的資料連結層中解析 封包’將要發送的封包及控制參數進行分離。 在kerne 1層中的資料連結層接收到來自[i nux作業系統 的應用層的封包後,根據所定義的資料結構對封包的内 容進行解析,分離出要發送的封包和控制參數。在資料 連結層第—網卡11的驅動程式將分離出的要發送的封包 100121788 表單編號A0101 第9頁/共27頁 1002036878-0 201251377 寫入第一網卡11的write_buffer*。 [0024] 所述管控模組104用於在源端主機1中根據分離出的控制 參數管控封包的發送過程。 [0025] 所述管控模組104包括以下子模組:發送單元一 105、判 斷單元106、計數單元一 107、溝通單元108、計數單元 二 109。 [0026] 所述發送單元一 1 05用於將源端主機1中所分割的封包發 送至目的主機3,封包的發送時間間隔由延時參數決定。 [0027] 在資料連結層第一網卡11的驅動程式將wri te_buf f er中 的封包進行分割,在物理層將分割後的封包傳送至網路2 中,經網路2發送至目的主機3,目的主機3將根據封包中 的目的位址來接受屬於自己的封包。在將write_buffer 中的封包進行分割的過程中,可由隨機設置參數對要分 割的封包的資料内容及長度進行控制。 [0028] 所述判斷單元106用於在源端主機1的Linux作業系統的 kernel層中,對目的主機3的返回值進行判斷,從而判斷 封包是否發送成功。 [0029] 當封包發送成功時,目的主機3將返回一個正值至源端主 機1的kernel層,而當封包發送失敗時,目的主機3將返 回一個負值至源端主機1的kernel層。 [0030] 所述計數單元一 107用於當封包發送成功時,統計發送的 封包成功投遞的次數,判斷封包成功投遞的次數是否達 到Μ次。所述Μ值,為發送參數設定的封包投遞的次數。 100121788 表單編號Α0101 第10頁/共27頁 1002 201251377 [0031] 所述計數單元二109用於當封包發送失敗時,統計封包重 [0032] 新發送的次數,判斷重新發送的次數是否已達到N次。所 述N值為回饋參數所設置的,封包發送失敗時,重新發送 封包的次數。 所述溝通單元108用於當封包成功投遞的次數達到Μ次時 ,或封包重新發送Ν次依然失敗後,源端主機1的Linux作 業系統的kerne 1層與Linux作業系統的應用層進行溝通 〇 [0033] Linux作業系統的kernel層與Linux作業系統的應用層 的溝通時,返回封包發送完成時相關資訊至Linux作業系 統的應用層,以供用戶查看。當失敗時,顯示的資訊為 ,如成功發送多少個封包、在發送哪個封包時失敗等。 當成功時,顯示的資訊為,如成功發送多少個封包、總 共耗時多少等。各個封包的發送過程中對應的返回值及 各個封包發送過程中的相關資訊顯示,由調試參數控制 輸出,但此時需用戶進行相關命令的輸入。 Ο [0034] 如圖3所示,係為本發明網卡資料傳輸方法較佳實施例之 流程圖。 [0035] 步驟S100,所述設置模組100在源端主機1的Linux作業 系統的應用層設置用於發送的控制參數,並在源端主機1 的Linux作業系統的kernel層定義與控制參數格式相同 的資料結構。所述資料結構用來接收和解析應用層所設 置的控制參數。 [0036] 步驟S101,所述封裝模組101在源端主機1的Linux作業 100121788 表單編號A0101 第11頁/共27頁 1002036878-0 201251377 系統的應用層創建底層套接字,並將控制參數、源端位 址、目的位址及發送内容封裝至封包中。所述源端位址 為源端主機1中第一網卡11的MAC位址,所述目的位址為 目的主機3中第二網卡30的MAC位址。 [0037] 底層套接字的格式為:int fd = socket(PF_PACKET, S0CK_RAW,IPPR0T0_TCP);通過底層套接字可以綁定 第一網卡11,即通過操作底層套接字可以實現對第一網 卡11的控制。上述底層套接字格式中的S0CK_RAW可以換 成SOCK_PACKET,換成SOCK_PACKET之後的底層套接字 與原來為S0CK_RAW的底層套接字功能相同,但是綁定第 一網卡11的方式不同。 [0038] 底層套接字可以實現封包直接由Linux作業系統的應用層 發送至資料連結層的目的,從而繞開0SI七層模型中的前 五層,此五層為:應用層、表示層、會話層、傳輸層、 網路層。 [0039] 步驟S102,所述發送模組1〇2在源端主機1中將封包由 Linux作業系統的應用層發送至Linux作業系統的 kernel層中的資料連結層。在kernel層中,包括資料連 結層、物理層及第一網卡11的驅動程式。 [0040] 如圖5所示,在Linux作業系統的應用層中進行封包的封 裝,通過底層套接字可以實現由Linux作業系統的應用層 直接發送至資料連結層’繞開〇SI七層模型中的應用層、 表示層、會話廣、傳輸層和網路層這五層。在kernel層 中包括資料連結層及物理層。 100121788 表單編號A0101 第12頁/共27頁 1002036878-0 201251377 [0041] 步驟S103,所述解析模組103在源端主機1的資料連結層 中解析封包,將要發送的封包及控制參數進行分離。 [0042] 在kernel層中的資料連結層接收到來自Linux作業系統 的應用層的封包後,根據所定義的資料結構對封包的内 容進行解析,分離出要發送的封包和控制參數。在資料 連結層第一網卡11的驅動程式將分離出的要發送的封包 寫入第一網卡11的write_buffer中。 [0043] 步驟S104,所述管控模組104在源端主機1中根據分離出 0 的控制參數管控封包的發送過程。具體管控過程將在圖4 中詳細介紹。 [0044] 如圖4所示,係為本發明網卡資料傳輸方法較佳實施例之 管控子流程圖。 [0045] 步驟S1 040,所述發送單元一 105將源端主機1中所分割 的封包發送至目的主機3,封包的發送時間間隔由延時參 數決定。 ^ [0046] 在資料連結層第一網卡11的驅動程式將wr i te_buf f er中 的封包進行分割,在物理層將分割後的封包傳送至網路2 中,經網路2發送至目的主機3,目的主機3將根據封包中 的目的位址來接受屬於自己的封包。在將write_buffer 中的封包進行分割的過程中,可由隨機設置參數對要分 割的封包的資料内容及長度進行控制。 [0047] 步驟S1041,所述判斷單元106在源端主機1的Linux作業 系統的kernel層中,對目的主機3的返回值進行判斷,從 而判斷封包是否發送成功。當封包發送成功時,執行步 100121788 表單編號 A0101 第 13 頁/共 27 頁 1002036878-0 201251377 驟S1 042,當封包發送失敗時,執行步驟S1 044。 [0048] 當封包發送成功時,目的主機3將返回一個正值至源端主 機1的kernel層,而當封包發送失敗時,目的主機3將返 回一個負值至源端主機1的kernel層。 [0049] 步驟S1042,所述計數單元一 107統計發送的封包成功投 遞的次數,判斷封包成功投遞的次數是否達到Μ次。當封 包成功投遞的次數達到Μ次時,執行步驟S1 043,當封包 成功投遞的次數沒有達到Μ次時,返回步驟S1040。所述Μ 值,為發送參數設定的封包投遞的次數。 [0050] 步驟S1044,所述計數單元二109統計封包重新發送的次 數,判斷是否已達到Ν次。所述Ν值為回饋參數所設置的 當封包發送失敗時,重新發送封包的次數。當達到Ν次時 ,執行步驟S1043,當沒有達到Ν次時,返回步驟S1040 〇 [0051] 步驟S1 043,所述溝通單元108控制源端主機1的Linux作 業系統的kernel層與Linux作業系統的應用層進行溝通 〇 [0052] Linux作業系統的kernel層與Linux作業系統的應用層 進行溝通時,返回封包發送完成時相關資訊至Linux作業 系統的應用層,以供用戶查看。當失敗時,顯示的資訊 為,如成功發送多少個封包、在發送哪個封包時失敗等 。當成功時,顯示的資訊為,如成功發送多少個封包、 總共耗時多少等。各個封包的發送過程中對應的返回值 及各個封包發送過程中的相關資訊顯示,由調試參數控 100121788 表單編號A0101 第14頁/共27頁 1002036878-0 201251377 制輸出,但此時需用戶進行相關命令的輸入。 [0053] 综上所述,本發明符合發明專利要件,爰依法提出專利 申請。惟,以上所述者僅爲本發明之較佳實施例,本發 明之範圍並不以上述實施例爲限,舉凡熟悉本案技藝之 人士援依本發明之精神所作之等效修飾或變化,皆應涵 蓋於以下申請專利範圍内。 【圖式簡單說明】 [0054] 圖1係為本發明網卡資料傳輸系統較佳實施例之架構圖。 [0055] 圖2係為本發明網卡資料傳輸系統較佳實施例之功能模組 圖。 [0056] 圖3係為本發明網卡資料傳輸方法較佳實施例之流程圖。 [0057] 圖4係為本發明網卡資料傳輸方法較佳實施例之管控子流 程圖。 [0058] 圖5係為本發明網卡資料傳輸系統較佳實施例之網卡資料 傳輸示例圖。 [0059] 圖6係為本發明網卡資料傳輸系統較佳實施例所定義之資 料結構。 【主要元件符號說明】 [0060] 源端主機1 [0061] 網卡資料傳輸系統10 [0062] 第一網卡11 [0063] 網路 2 100121788 表單編號A0101 第15頁/共27頁 1002036878-0 201251377 [0064] 目的主機 3 [0065] 第二網卡 30 [0066] 設置模組 100 [0067] 封裝模組 101 [0068] 發送模組 102 [0069] 解析模組 103 [0070] 管控模組 104 [0071] 發送單元 一 105 [0072] 判斷單元 106 [0073] 計數單元 一 107 [0074] 溝通單元 108 [0075] 計數單元二109 [0076] 在應用層設置用於發送的控制參數 與控制參數格式相同的資料結構S100 [0077] 創建底層套接字,並將控制參數、源端位址、目的位址 及發送的内容封裝至封包中S101 [0078] 將封包由應用層發送至kernel層中的資料連結層 [0079] S102 [0080] 在資料連結層中解析封包,將要發送的封包及控制參數 分離S103 100121788 表單編號A0101 第16頁/共27頁 1002036878-0 201251377 [0081] 根據控制參數管控封包的發送過程S104Socket (PF packet through the underlying socket 100121788 Form No. A0101 Page 8 / Total 27 pages 201251377 [0019] [0022] [0022] [0023] The first network card 11 'is operated by the underlying socket The control of the first network card 11 can be implemented. The S〇CK_RAW in the above-mentioned underlying socket format can be replaced with SOCK-PACKET, and the lower layer socket after s〇CK_PACKET is replaced with the lower layer socket originally SOCK-RAW. The functions are the same, but the way to bind the first network card 11 is different. The underlying socket can realize the purpose of sending the packet directly from the application layer of the Linux operating system to the data link layer, thereby bypassing the first five layers of the 七Si seven-layer model. The five layers are: an application layer, a presentation layer, a session layer, a transport layer, and a network layer. The sending module 102 is configured to send the packet from the application layer of the liux operating system to the Linux operation in the source host 1 The data link layer in the kernel layer of the system. In the kernel layer, including the data link layer, the physical layer, and the driver of the first network card 11. As shown in FIG. 5, the packet is encapsulated in the application layer of the Linux operating system. Package The underlying socket can be directly sent to the data link layer by the application layer of the Linux operating system, bypassing the application layer, presentation layer, presentation layer, transport layer and network layer in the 0SI seven-layer model. The kernei layer includes a data link layer and a physical layer. The parsing module 1-3 is configured to parse the packet in the data link layer of the source host 1 to separate the packet and control parameters to be sent. In the kerne layer 1 After receiving the packet from the application layer of the [i nux operating system, the data link layer parses the content of the packet according to the defined data structure, and separates the packet and the control parameter to be sent. In the data link layer - the network card 11 The driver writes the separated packet 100121788 to be sent, the form number A0101, page 9 / page 27, 1002036878-0 201251377, to the write_buffer* of the first network card 11. [0024] The control module 104 is used at the source host The sending process of the control packet is controlled according to the separated control parameters. [0025] The control module 104 includes the following sub-modules: a transmitting unit 105, a determining unit 106, and a counting unit. 107. The communication unit 108 and the counting unit 2 109. [0026] The sending unit 010 is configured to send the divided packet in the source host 1 to the destination host 3, and the sending time interval of the packet is determined by the delay parameter. 0027] The driver of the first network card 11 in the data link layer divides the packet in the wri te_buf er, and transmits the divided packet to the network 2 at the physical layer, and transmits it to the destination host 3 via the network 2, for the purpose of Host 3 will accept its own packet based on the destination address in the packet. In the process of dividing the packet in the write_buffer, the data content and length of the packet to be divided can be controlled by randomly setting parameters. [0028] The determining unit 106 is configured to determine the return value of the destination host 3 in the kernel layer of the Linux operating system of the source host 1 to determine whether the packet is successfully sent. [0029] When the packet transmission succeeds, the destination host 3 will return a positive value to the kernel layer of the source host 1, and when the packet transmission fails, the destination host 3 will return a negative value to the kernel layer of the source host 1. [0030] The counting unit 107 is configured to count the number of successfully delivered packets when the packet is successfully sent, and determine whether the number of successful delivery of the packet reaches the number of times. The threshold is the number of times the packet is delivered for the transmission parameter. 100121788 Form No. 1010101 Page 10/Total 27 Page 1002 201251377 [0031] The counting unit 2 is used to count the number of new transmissions when the packet transmission fails [0032], and determine whether the number of retransmissions has reached N. Times. The N value is set by the feedback parameter, and the number of times the packet is resent when the packet transmission fails. The communication unit 108 is configured to communicate with the application layer of the Linux operating system when the number of successful delivery of the packet reaches the number of times, or after the packet is resent, the kerne layer 1 of the Linux host system of the source host 1 communicates with the application layer of the Linux operating system. [0033] When the kernel layer of the Linux operating system communicates with the application layer of the Linux operating system, the information related to the completion of the packet transmission is returned to the application layer of the Linux operating system for the user to view. When it fails, the information displayed is , such as how many packets were successfully sent, which packet was sent, and so on. When successful, the information displayed is, for example, how many packets were successfully sent, how much total time spent, and so on. The corresponding return value in the sending process of each packet and the related information in the process of sending each packet are controlled by the debugging parameters, but the user needs to input the relevant commands at this time. [0034] As shown in FIG. 3, it is a flowchart of a preferred embodiment of the network card data transmission method of the present invention. [0035] Step S100, the setting module 100 sets a control parameter for sending at the application layer of the Linux operating system of the source host 1 and a kernel layer definition and control parameter format of the Linux operating system of the source host 1 The same data structure. The data structure is used to receive and parse control parameters set by the application layer. [0036] Step S101, the package module 101 creates an underlying socket in the application layer of the Linux host job 100121788 Form No. A0101 page 11/27 page 1002036878-0 201251377 of the source host 1 and controls parameters, The source address, destination address, and transmission content are encapsulated into a packet. The source address is the MAC address of the first network card 11 in the source host 1, and the destination address is the MAC address of the second network card 30 in the destination host 3. [0037] The format of the underlying socket is: int fd = socket (PF_PACKET, S0CK_RAW, IPPR0T0_TCP); the first network card 11 can be bound by the underlying socket, that is, the first network card 11 can be implemented by operating the underlying socket. control. The above-mentioned underlying socket format S0CK_RAW can be replaced with SOCK_PACKET, and the underlying socket after SOCK_PACKET is replaced with the same function as the underlying socket originally S0CK_RAW, but the manner of binding the first NIC 11 is different. [0038] The underlying socket can realize the purpose that the packet is directly sent from the application layer of the Linux operating system to the data link layer, thereby bypassing the first five layers in the 0SI seven-layer model: the application layer, the presentation layer, Session layer, transport layer, network layer. [0039] Step S102, the sending module 1〇2 sends the packet in the source host 1 to the data link layer in the kernel layer of the Linux operating system by the application layer of the Linux operating system. In the kernel layer, the data link layer, the physical layer, and the driver of the first network card 11 are included. [0040] As shown in FIG. 5, the encapsulation of the packet is performed in the application layer of the Linux operating system, and the application layer of the Linux operating system can be directly sent to the data link layer through the underlying socket to bypass the SI seven-layer model. The five layers of the application layer, the presentation layer, the session wide, the transport layer, and the network layer. The data link layer and the physical layer are included in the kernel layer. 100121788 Form No. A0101 Page 12 of 27 1002036878-0 201251377 [0041] Step S103, the parsing module 103 parses the packet in the data link layer of the source host 1, and separates the packet to be sent and the control parameters. [0042] After receiving the packet from the application layer of the Linux operating system, the data link layer in the kernel layer parses the content of the packet according to the defined data structure, and separates the packet and control parameters to be sent. The driver of the first network card 11 at the data link layer writes the separated packet to be transmitted into the write_buffer of the first network card 11. [0043] Step S104, the control module 104 controls the sending process of the packet in the source host 1 according to the control parameter of the separated 0. The specific control process will be described in detail in Figure 4. [0044] As shown in FIG. 4, it is a flowchart of a control sub-control of a preferred embodiment of the network card data transmission method of the present invention. [0045] Step S1 040, the sending unit 105 sends the packet divided by the source host 1 to the destination host 3, and the sending time interval of the packet is determined by the delay parameter. [0046] The driver of the first network card 11 in the data link layer divides the packet in the wr i te_buf er, and transmits the divided packet to the network 2 at the physical layer, and sends it to the destination host via the network 2 3. The destination host 3 will accept its own packet according to the destination address in the packet. In the process of dividing the packet in the write_buffer, the data content and length of the packet to be divided can be controlled by randomly setting parameters. [0047] Step S1041, the determining unit 106 determines the return value of the destination host 3 in the kernel layer of the Linux operating system of the source host 1 to determine whether the packet is successfully transmitted. When the packet is successfully sent, go to step 100121788 Form No. A0101 Page 13 of 27 1002036878-0 201251377 Step S1 042, when the packet transmission fails, step S1 044 is performed. [0048] When the packet transmission succeeds, the destination host 3 will return a positive value to the kernel layer of the source host 1, and when the packet transmission fails, the destination host 3 will return a negative value to the kernel layer of the source host 1. [0049] Step S1042, the counting unit 107 counts the number of times the successfully transmitted packet is successfully delivered, and determines whether the number of successful delivery of the packet reaches the number of times. When the number of successful delivery of the packet reaches the number of times, step S1 043 is performed, and when the number of successful delivery of the packet has not reached the number of times, the process returns to step S1040. The Μ value is the number of times the packet is delivered for the transmission parameter. [0050] Step S1044, the counting unit 2 109 counts the number of times the packet is resent, and determines whether the number has been reached. The Ν value is set by the feedback parameter, and the number of times the packet is resent when the packet transmission fails. When the number of times is reached, step S1043 is performed. When the number of times is not reached, the process returns to step S1040. [0051] Step S1 043, the communication unit 108 controls the kernel layer of the Linux operating system of the source host 1 and the Linux operating system. Communication at the application layer [0052] When the kernel layer of the Linux operating system communicates with the application layer of the Linux operating system, the information about the completion of the packet transmission is returned to the application layer of the Linux operating system for the user to view. When it fails, the information displayed is, for example, how many packets were successfully sent, which packet was sent, and so on. When successful, the information displayed is, for example, how many packets were successfully sent, how much time was spent, and so on. The corresponding return value during the sending process of each packet and the related information display during the sending process of each packet are output by the debugging parameter control 100121788 Form No. A0101 Page 14/27 pages 1002036878-0 201251377, but the user needs to be related at this time. The input of the command. [0053] In summary, the present invention complies with the requirements of the invention patent, and submits a patent application according to law. The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited to the above-described embodiments, and equivalent modifications or variations made by those skilled in the art in light of the spirit of the present invention are It should be covered by the following patent application. BRIEF DESCRIPTION OF THE DRAWINGS [0054] FIG. 1 is a block diagram of a preferred embodiment of a network card data transmission system of the present invention. 2 is a functional block diagram of a preferred embodiment of the network card data transmission system of the present invention. 3 is a flow chart of a preferred embodiment of a network card data transmission method according to the present invention. 4 is a flow chart of a control sub-control of a preferred embodiment of the network card data transmission method of the present invention. 5 is a diagram showing an example of transmission of a network card data according to a preferred embodiment of the network card data transmission system of the present invention. 6 is a data structure defined by a preferred embodiment of the network card data transmission system of the present invention. [Main component symbol description] [0060] Source host 1 [0061] NIC data transmission system 10 [0062] First network card 11 [0063] Network 2 100121788 Form number A0101 Page 15 / Total 27 pages 1002036878-0 201251377 [ 0064] destination host 3 [0065] second network card 30 [0066] setting module 100 [0067] transmitting module 102 [0069] parsing module 103 [0070] control module 104 [0071] Transmitting unit one 105 [0072] Judging unit 106 [0073] Counting unit one 107 [0074] Communication unit 108 [0075] Counting unit two 109 [0076] Setting the same control data format for transmitting control parameters and control parameters at the application layer Structure S100 [0077] Creating an underlying socket and encapsulating the control parameters, the source address, the destination address, and the sent content into the packet S101 [0078] Sending the packet from the application layer to the data link layer in the kernel layer [0079] S102 parsing the packet in the data link layer, separating the packet to be sent and the control parameter S103 100121788 Form number A0101 Page 16 of 27 page 1002036878-0 201251377 [0081] Controlling the packet according to the control parameter Send process S104

100121788 表單編號A0101 第17頁/共27頁 1002036878-0100121788 Form No. A0101 Page 17 of 27 1002036878-0

Claims (1)

201251377 七、申請專利範圍: 1 . 一種網卡資料傳輸方法,其中,該方法包括步驟: 設置步驟:在源端主機的Linux作業系統的應用層設置用 於發送的控制參數,並在源端主機的L i nux作業系統的 kernel層定義與控制參數格式相同的資料結構; 封裝步驟:在所述應用層創建底層套接字,並將控制參數 、源端位址、目的位址及發送内容封裝至封包中,所述源 端位址為源端主機中第一網卡的MAC位址,所述目的位址 為目的主機中第二網卡的MAC位址,所述源端主機與目的 主機通過網路連接; 發送步驟:在源端主機中將封包由所述應用層發送至所述 kernel層中的資料連結層; 解析步驟:在資料連結層中解析封包,將要發送的封包及 控制參數進行分離,所述控制參數包括發送參數、隨機設 置參數、延時參數、回饋參數和調試參數; 管控步驟:在源端主機中根據分離出的控制參數管控封包 的發送過程。 2 .如申請專利範圍第1項所述之網卡資料傳輸方法,其中, 所述管控步驟包括: 發送步驟一:將源端主機中分割的封包發送至目的主機, 封包的發送時間間隔由延時參數決定; 判斷步驟:在所述kernel層中,根據目的主機的返回值 判斷封包是否發送成功,當封包發送成功時,則執行計數 步驟一,當封包發送失敗時,則執行計數步驟二; 計數步驟一:統計發送的封包成功投遞的次數,當封包成 100121788 表單編號A0101 第18頁/共27頁 201251377 功投遞的次數達到Μ次時,則執行溝通步驟,當封包成功 投遞的次數沒有達到Μ次時,則返回發送步驟一,所述Μ值 ’為發送參數設定的封包投遞的次數; 計數步驟二:統計封包重新發送的次數,當封包重新發送 的次數達到Ν次時,則執行溝通步驟,否則,返回發送步 驟一,所述Ν值,為回饋參數所設置的封包發送失敗時, 重新發送封包的次數; 肩1通步驟:所述kernel層與所述應用層進行溝通。 .如申請專利範圍第2項所述之網卡資料傳輸方法,其中, 所述發送步驟一包括: 在資料連結層第一網卡的驅動程式將分離出的要發送的封 包寫入第一網卡的write_buffer中,並對 write一buffer中封包進行分割,在物理層經網路將分割 後封包發送至目的主機,其中由隨機設置參數控制要分割 的封包的資料内容及長度。 .如申請專利範圍第2項所述之網卡資料傳輪方法,其中 所述溝通步驟還包括: 返回封包發送完成時的資訊至所述應用層,供用戶杳看 .如申請專利範圍第1項所述之網卡資料傳輪方法,其中 所述底層套接字用於實現封包直接由所述應用層發送至資 料連結層的目的。 ~種網卡資料傳輸系統,其中,該系統包括: 毁置模組’用於在源端主機的Linux作業系統的應用層設 置用於發送的控制參數,並在源端主機的Linux作業系统 的kernel層定義與控制參數格式相同的資料社構. 100121788 封裝模組,用於在所述應用層創建底層套接字 表單編號A0101 第19頁/共27頁 ’並將控制 1002036878-0 201251377 參數、源端位址、目的位址及發送内容封裝至封包中,所 述源端位為源端主機中第一網卡的MAC位址,所述目的 位址為目的主機中第二網卡的MAC位址,所述源端主機與 目的主機通過網路連接; 發送模組,用於在源端主機中將封包由所述應用層發送至 所述kernel層中的資料連結層; 解析模組,用於在資料連結層中解析封包,將要發送的封 包及控制參數進行分離,所述控制參數包括發送參數、隨 機設置參數、延時參數、回饋參數和調試參數; 管控模組,用於在源端主機中根據分離出的控制參數管控 封包的發送過程。 7 .如申請專利範圍第6項所述之網卡資料傳輸系統,其中, 所述管控模組包括: 發送單元一,用於將源端主機中分割的封包發送至目的主 機,封包的發送時間間隔由延時參數決定; 判斷單元,在所述kerne 1層中,根據目的主機的返回值 判斷封包是否發送成功; 計數單元一,用於當封包發送成功時,統計發送的封包成 功投遞的次數,判斷封包成功投遞的次數是否達到Μ次; 所述Μ值,為發送參數設定的封包投遞的次數; 計數單元二,用於當封包發送失敗時,統計封包重新發送 的次數,判斷是否已達到Ν次,所述Ν值,為回饋參數所設 置的當封包發送失敗時,重新發送封包的次數; 溝通單元,用於當封包投遞數達到Μ次時,或封包發送Ν次 依然失敗後,控制所述kernel層與所述應用層進行溝通 100121788 表單編號A0101 第20頁/共27頁 1002C 201251377 8 .如申請專利範圍第7項所述之網卡資料傳輸系統,其中, 所述發送單元一的具體操作為: 在資料連結層第一網卡的驅動程式將分離出的要發送的封 包寫入第一網卡的write_buffer中,並對 write_buffer中封包進行分割,在物理層經網路將分割 後封包發送至目的主機,其中由隨機設置參數控制要分割 的封包的資料内容及長度。 9 .如申請專利範圍第7項所述之網卡資料傳輸系統,其中, 所述溝通單元還用於返回封包發送完成時的資訊至所述應 〇 用層,供用戶查看。 10 .如申請專利範圍第6項所述之網卡資料傳輸系統,其中, 所述底層套接字用於實現封包直接由所述應用層發送至資 料連結層的目的。 100121788 表單編號A0101 第21頁/共27頁 1002036878-0201251377 VII. Patent application scope: 1. A network card data transmission method, wherein the method comprises the following steps: setting step: setting a control parameter for sending at an application layer of a Linux operating system of a source host, and at the source host The kernel layer of the L i nux operating system defines the same data structure as the control parameter format; the encapsulation step: creating an underlying socket in the application layer, and encapsulating the control parameters, the source address, the destination address, and the transmission content to In the packet, the source address is the MAC address of the first network card in the source host, the destination address is the MAC address of the second network card in the destination host, and the source host and the destination host pass the network. The sending step is: sending the packet from the application layer to the data link layer in the kernel layer in the source host; parsing step: parsing the packet in the data link layer, separating the packet to be sent and the control parameter, The control parameters include a sending parameter, a random setting parameter, a delay parameter, a feedback parameter, and a debugging parameter; and a control step: in the source host According to the process of separating the transmission control parameters of the control packet. 2. The network card data transmission method according to claim 1, wherein the controlling step comprises: transmitting step 1: transmitting the divided packet in the source host to the destination host, and sending the packet interval interval by the delay parameter Determining step: determining, in the kernel layer, whether the packet is successfully sent according to the return value of the destination host, and when the packet is successfully sent, performing the counting step one, and when the packet sending fails, performing the counting step two; One: Count the number of successful delivery of the packet, when the packet is 100121788 Form No. A0101 Page 18/27 Page 201251377 When the number of delivery times reaches Μ, the communication step is executed, and the number of successful delivery of the packet does not reach the number of times. Returning to the sending step one, the threshold value is the number of times the packet delivery is set by the sending parameter; counting step 2: counting the number of times the packet is resent, and when the number of times of resending the packet reaches the number of times, the communication step is performed. Otherwise, return to the sending step 1, the threshold, the packet set for the feedback parameter When sending fails, resend packet; shoulder 1 via the steps of: a kernel layer and the application layer communication. The method for transmitting a network card data according to claim 2, wherein the transmitting step 1 comprises: writing, by the driver of the first network card of the data link layer, the separated packet to be sent into the write_buffer of the first network card. And dividing the packet in the write-buffer, and transmitting the divided packet to the destination host through the network at the physical layer, wherein the content and length of the packet to be divided are controlled by the random setting parameter. The method for transmitting a network card data according to claim 2, wherein the step of communicating further comprises: returning information when the packet is sent to the application layer for viewing by the user. For example, the first item of the patent application scope The network card data transmission method, wherein the bottom layer socket is used to implement the purpose that the packet is directly sent by the application layer to the data link layer. ~ NIC data transmission system, wherein the system comprises: a tamper module 'for the application layer of the Linux operating system of the source host to set the control parameters for sending, and the kernel of the Linux operating system of the source host The layer defines the same data structure as the control parameter. 100121788 The encapsulation module is used to create the underlying socket form number A0101 on the application layer. Page 19 of 27 and will control 1002036878-0 201251377 parameters, source The source address, the destination address, and the sending content are encapsulated into a packet, where the source end is the MAC address of the first network card in the source host, and the destination address is the MAC address of the second network card in the destination host, The source host and the destination host are connected through a network; the sending module is configured to send, by the application layer, the packet to the data link layer in the kernel layer in the source host; the parsing module is configured to The data packet layer parses the packet, and separates the packet to be sent and the control parameter, where the control parameter includes a sending parameter, a random setting parameter, a delay parameter, a feedback parameter, and a debugging parameter. The control module is configured to control the sending process of the packet according to the separated control parameters in the source host. The network card data transmission system of claim 6, wherein the management module comprises: a sending unit 1 configured to send the divided packet in the source host to the destination host, and the sending time interval of the packet Determining, by the delay parameter, the judging unit, in the kerne layer 1, determining whether the packet is successfully sent according to the return value of the destination host; and the counting unit 1 is configured to count the number of successful delivery of the packet when the packet is successfully sent, and determine Whether the number of successful delivery of the packet reaches the number of times; the threshold value is the number of times of packet delivery set by the sending parameter; and the counting unit 2 is used to count the number of times the packet is resent when the packet transmission fails, and determine whether the number of times the packet has been resent The threshold value is the number of times the packet is resent when the packet transmission fails due to the feedback parameter, and the communication unit is configured to control the packet delivery number to reach the number of times, or after the packet transmission number still fails, The kernel layer communicates with the application layer. 100121788 Form No. A0101 Page 20/Total 27 Pages 1002C 201251377 8 . The network card data transmission system of claim 7, wherein the specific operation of the sending unit 1 is: writing, by the driver of the first network card of the data link layer, the separated packet to be sent into the first network card In the write_buffer, the packet in the write_buffer is split, and the divided packet is sent to the destination host through the network at the physical layer, wherein the content and length of the packet to be divided are controlled by the random setting parameter. 9. The network card data transmission system of claim 7, wherein the communication unit is further configured to return information when the packet transmission is completed to the application layer for the user to view. 10. The network card data transmission system of claim 6, wherein the underlying socket is used for the purpose of transmitting the packet directly from the application layer to the data link layer. 100121788 Form No. A0101 Page 21 of 27 1002036878-0
TW100121788A 2011-06-15 2011-06-22 NIC data transmission method and system TW201251377A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011101597656A CN102833144A (en) 2011-06-15 2011-06-15 Network card data transmission method and system

Publications (1)

Publication Number Publication Date
TW201251377A true TW201251377A (en) 2012-12-16

Family

ID=47336120

Family Applications (1)

Application Number Title Priority Date Filing Date
TW100121788A TW201251377A (en) 2011-06-15 2011-06-22 NIC data transmission method and system

Country Status (2)

Country Link
CN (1) CN102833144A (en)
TW (1) TW201251377A (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320359A (en) * 2014-11-24 2015-01-28 上海斐讯数据通信技术有限公司 Data package transmission method and system of stack-based exchanger
CN104767725A (en) * 2014-12-31 2015-07-08 中兴仪器(深圳)有限公司 Network data transmitting-receiving device and method
CN108712373B (en) * 2018-03-30 2022-01-11 深圳市风云实业有限公司 Unidirectional communication method, device, user terminal and computer readable storage medium
CN111327645B (en) * 2018-11-28 2023-11-21 鸿合科技股份有限公司 Network sharing method and device and electronic equipment
CN111371642B (en) * 2020-02-27 2022-06-21 深信服科技股份有限公司 Network card fault detection method, device, equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7315892B2 (en) * 2001-06-27 2008-01-01 International Business Machines Corporation In-kernel content-aware service differentiation
TW563317B (en) * 2001-12-31 2003-11-21 Realtek Semiconductor Corp Switch controller using link layer protocol for control and its control method
CN101453386A (en) * 2007-12-07 2009-06-10 英业达股份有限公司 Network package extracting method
CN101217464B (en) * 2007-12-28 2010-09-08 北京大学 UDP data package transmission method

Also Published As

Publication number Publication date
CN102833144A (en) 2012-12-19

Similar Documents

Publication Publication Date Title
CN103248452B (en) Data sending device, data receiving device, terminal and data transmission method
CN103428226B (en) Method and system for communication of user state and inner core
CN101388800B (en) Method, device and system for pressed test to network performance of server
US8705572B2 (en) RoCE packet sequence acceleration
TW201251377A (en) NIC data transmission method and system
CN110086578A (en) Data transmission method, device and system
CN105723674A (en) Methods for dynamically binding header field identifiers in a network control protocol
WO2022032984A1 (en) Mqtt protocol simulation method and simulation device
CN106411740A (en) Ethernet controller based network port extension method
CN105988948B (en) A kind of method and apparatus of data transmission
CN106255155B (en) A kind of data transmission method and system based on mobile Internet
WO2011137640A1 (en) File transmission method, file transmission apparatus and file reception apparatus
JP2013123219A5 (en)
CN103414692A (en) High real-time spacecraft data transmission method based on priorities
CN107147543A (en) A kind of socket communication means of server towards pc client
CN105190530A (en) Transmitting hardware-rendered graphical data
CN110120854A (en) The method and apparatus for transmitting data
CN108881425A (en) A kind of data package processing method and system
CN103595712B (en) A kind of Web authentication method, apparatus and system
CN107508828A (en) A kind of very-long-range data interaction system and method
CN106686410B (en) HLS flow-medium transmission method and device
CN104184729A (en) Message processing method and device
CN103888481A (en) Method and system for filtering DHCP data package of local area network
CN106411677A (en) Method and device for determining optimal maximum transmission unit (MTU) of virtual private network (VPN) data channel
CN103973581B (en) Method, device and system for processing message data