TWI425795B - Method for tracing processing procedure of network packet - Google Patents
Method for tracing processing procedure of network packet Download PDFInfo
- Publication number
- TWI425795B TWI425795B TW99125188A TW99125188A TWI425795B TW I425795 B TWI425795 B TW I425795B TW 99125188 A TW99125188 A TW 99125188A TW 99125188 A TW99125188 A TW 99125188A TW I425795 B TWI425795 B TW I425795B
- Authority
- TW
- Taiwan
- Prior art keywords
- network packet
- function
- packet
- network
- type name
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims description 88
- 238000012545 processing Methods 0.000 title claims description 37
- 230000008569 process Effects 0.000 claims description 13
- 230000006870 function Effects 0.000 description 112
- 238000004891 communication Methods 0.000 description 14
- 238000004458 analytical method Methods 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 238000007689 inspection Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 239000007943 implant Substances 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 229920001690 polydopamine Polymers 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000000700 radioactive tracer Substances 0.000 description 1
- 230000035484 reaction time Effects 0.000 description 1
- 238000007430 reference method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Description
本發明為一種追蹤網路封包之處理程序的方法,尤指一種有關網路通訊裝置、雲端計算之追蹤網路封包的處理程序之方法。The present invention is a method for tracking a processing procedure of a network packet, and more particularly to a method for tracking a network packet of a network communication device and a cloud computing device.
對於網路通訊裝置而言,界定網路行為異常(例如:傳輸延遲、反應時間以及封包遺漏等問題)的原因是有必要的,此對於日漸普及的連網裝置的開發非常重要。通常網路封包會由系統核心處理,系統核心的分析工具(Linux Kernel Profiler)是用來協助開發者分析系統核心內部的(internal)行為,現有的工具大略可以分為三類:原始工具類(Source Instrumentation)、二進制工具類(Binary Instrumentation)、統計取樣類(Statistical Sampling),各分類相關的分析工具即如表一所示者。For network communication devices, it is necessary to define the cause of network behavior anomalies (such as transmission delay, response time, and packet omissions), which is very important for the development of increasingly popular networked devices. Usually the network packet is processed by the system core. The system kernel analysis tool (Linux Kernel Profiler) is used to help developers analyze the internal behavior of the system core. The existing tools can be roughly divided into three categories: the original tool class ( Source Instrumentation), Binary Instrumentation, Statistical Sampling, and the analysis tools associated with each category are shown in Table 1.
Source Instrumentation主要是修改系統原始碼(Source Code),插入能記錄系統內部資訊的指令,以達到分析系統核心內部的(internal)行為。例如Linux追蹤工具箱第二代(Linux Trace Toolkit Next Generation,LTTng)、核心調整及分析公用程式(Kernel Tuning and Analysis Utilities,KTAU)、Linux核心狀態追蹤器(Linux Kernel State Tracer,LKST)等,修改系統中重要的核心函式,此三項技術在核心系統內部對重要的核心函式插入程式碼,記錄下核心事件觸發時間,用來分析核心系統的運作行為,此記錄通常包含上下文切換(context switch)、計時器期滿(timer expired)和系統呼叫(system call)等等。Source Instrumentation mainly modifies the system source code (Source Code) and inserts instructions that can record the internal information of the system to analyze the internal behavior of the system core. For example, Linux Trace Toolkit Next Generation (LTTng), Kernel Tuning and Analysis Utilities (KTAU), Linux Kernel State Tracer (LKST), etc., modified Important core functions in the system. These three technologies insert code into important core functions in the core system, record the trigger time of core events, and analyze the operation behavior of the core system. This record usually contains context switching (context). Switch), timer expired (timer expired) and system call (system call) and so on.
但是,依然無法詳細追蹤網路封包在核心系統內部處理過程,而且無法自動尋找與嵌入追蹤指令於核心函式序列(sequence),亦即此些記錄無法協助開發者追蹤網路封包於核心網路通訊協定的處理過程。核心函式追蹤(Kernel Function Trace,KFT)、FTrace和Kernprof等,則進一步修改所有的系統核心函式,記錄核心函式執行順序和執行時間等資訊,此三項技術在核心系統內部所有的核心函式均插入程式碼,完整取得核心系統的運作過程,結果如第一圖所示者。However, it is still impossible to track in detail the processing of network packets in the core system, and it is not possible to automatically find and embed tracking instructions in the core function sequence, that is, these records cannot help developers track network packets in the core network. The processing of the communication protocol. Kernel Function Trace (KFT), FTrace and Kernprof, etc., further modify all system core functions, record the core function execution order and execution time, etc. These three technologies are all cores in the core system. The function is inserted into the code, and the operation process of the core system is completely obtained. The result is as shown in the first figure.
其中:index指主函式(primary function)的編號、%time指primary function的使用時間比、self指primary function的運行時間、children指primary function呼叫子(child)的運行時間、called指被呼叫的總次數、name指primary function的名稱。在實框線內的主函式的編號(index)分別為[20]及[21],在主函式的上下均有母(Parent)及子(Children)的程式(如以虛線的箭頭所示者);然而,開發者依然無法利用這些資訊,正確地追蹤核心系統處理封包的函式執行順序;亦即使用者依然無法藉由分析結果,進而有效率地且正確地追蹤封包導向的核心函式序列。Where: index refers to the number of the primary function, %time refers to the usage time ratio of the primary function, self refers to the running time of the primary function, children refers to the running time of the primary function call child, and the called refers to the called The total number of times, name refers to the name of the primary function. The number of the main function in the real line is [20] and [21], and there are both the parent and the child in the upper and lower sides of the main function (such as the arrow with the dotted line). However, developers still can't use this information to correctly track the order of execution of the core system's processing of packets; that is, users still cannot efficiently and correctly track the core of packet-oriented by analyzing the results. The sequence of functions.
Binary Instrumentation主要是直接修改系統機器碼(Object Code),將執行流程暫時導到此記錄系統內部資訊的函式,以達到動態分析系統內部的行為。以K探針(Kprobe)為例,開發者需要藉由編譯程式(Compiler)或者反組譯程式(Disassembler)的協助,事先取得目標核心函式的進出點位址,再藉由此類工具協助修改系統機器碼,取得所需資訊。Binary Instrumentation is mainly a function that directly modifies the system object code (Object Code) and temporarily introduces the execution process to the internal information of the recording system to achieve dynamic analysis of the internal behavior of the system. Taking Kprobe as an example, the developer needs to obtain the entry and exit address of the target core function in advance by the help of a compiler or a disassembler, and then assist with such tools. Modify the system machine code to get the required information.
又Kprobe、KernInst、D追蹤(DTrace)此三項技術主要是修改核心系統的機器碼(Object Code),以達到動態分析系統內部的行為,使用者藉由Compiler或者Disassembler的協助再修改機器碼,但是使用者需要具有核心系統處理網路封包的相關知識,否則無法正確地追蹤封包導向的核心函式序列,所以依然無法自動尋找與嵌入追蹤指令於核心函式序列,此類技術皆有須在特定裝置及核心版本上運作的缺失。至於二進制工具類之系統跟蹤分析程式(Systemtap),此技術主要是提供一個介面給使用者,讓使用者藉由此介面簡化使用Kprobe的困難處,使用者只須提供目標核心函式的名稱,Systemtap負責找出目標核心函式的進去點位址,並且完成設定Kprobe,但是使用者依然需要具有核心系統處理網路封包的相關知識,否則無法正確地追蹤封包導向的核心函式序列,所以依然無法自動尋找與嵌入追蹤指令於核心函式序列。Kprobe, KernInst, D tracking (DTrace) These three technologies are mainly to modify the core code of the core system (Object Code) to achieve dynamic analysis of the internal behavior of the system, the user with the help of Compiler or Disassembler to modify the machine code, However, the user needs to have the knowledge of the core system to process the network packet, otherwise the packet-oriented core function sequence cannot be correctly tracked, so it is still impossible to automatically find and embed the tracking instruction in the core function sequence. Lack of operation on specific devices and core versions. As for the system trace analysis program (Systemtap) of the binary tool class, this technology mainly provides an interface to the user, so that the user can simplify the difficulty of using Kprobe by using the interface, and the user only needs to provide the name of the target core function. Systemtap is responsible for finding the entry point address of the target core function and completing the setting of Kprobe, but the user still needs to have the knowledge of the core system to process the network packet, otherwise the packet-oriented core function sequence cannot be correctly tracked, so it is still Unable to automatically find and embed tracking instructions in the core function sequence.
另有些工具,如核心階層特徵定向系統(Kernel Level Aspect-oriented System,KLASY),此技術也是提供一個介面給使用者,讓使用者藉由此介面簡化使用KernInst的困難處,其透過修改後的Compiler(gcc)先對核心程式做處理,再由開發者針對某些函式做追蹤與記錄,使用者可以提供目標資料結構的名稱,KLASY負責找出目標資料結構被處理的指令位址,並且完成設定KernInst,但是此技術所產生的分析資料過於龐大,使用者無法有效率地追蹤封包導向的核心函式序列,且此技術需要特定的compiler協助,對於嵌入式裝置的開發者相當不方便。Other tools, such as the Kernel Level Aspect-oriented System (KLASY), also provide an interface to the user, allowing the user to simplify the use of KernInst through this interface, through the modified Compiler (gcc) first processes the core program, and then the developer tracks and records some functions. The user can provide the name of the target data structure. KLASY is responsible for finding the address of the target data structure to be processed. KernInst is set up, but the analysis data generated by this technology is too large, users can not track the packet-oriented core function sequence efficiently, and this technology requires specific compiler assistance, which is quite inconvenient for developers of embedded devices.
亦即開發者必須具有核心系統處理網路封包的相關知識,才可以人工檢視的方式追蹤封包處理程序,然而人工檢視方式不但費時,更容易遺漏或誤查,很難正確有效地追蹤封包在核心系統的函式執行順序,而且Binary Instrumentation的方式之應用性是較差的。至於Statis-tical Sampling主要是週期性檢查CPU中正在執行的指令(Instruction),再將記錄結果以統計的方式,呈現給使用者。而就O分析工具(Oprofile)而言,此技術主要是以統計的方式,分析核心系統的行為,週期性檢查指令再將記錄結果以統計的方式,呈現給使用者,因此無法完整地且正確地追蹤封包導向的核心函式序列。That is to say, the developer must have the knowledge of the core system to process the network packet, and then the packet processing program can be tracked by manual inspection. However, the manual inspection method is not only time-consuming, but also easy to miss or mis-examine, and it is difficult to correctly and effectively track the packet in the core. The order of execution of the system's functions, and the way Binary Instrumentation is applied is poor. As for the Statis-tical Sampling, it mainly periodically checks the instruction (Instruction) being executed in the CPU, and presents the recorded result to the user in a statistical manner. As far as the O analysis tool (Oprofile) is concerned, this technology mainly analyzes the behavior of the core system in a statistical manner, periodically checks the instructions and presents the recorded results to the user in a statistical manner, so it cannot be completely and correctly. Track the packet-oriented core function sequence.
此些記錄並非針對處理網路封包的函式做記錄,所以並不適合用來追蹤處理封包的函式執行順序。因此,目前沒有一套工具能夠正確有效地分析與追蹤網路通訊裝置之系統處理封包的函式之執行順序,協助開發者除錯並界定發生傳輸延遲、反應時間以及封包遺漏等問題的原因。此系統核心分析工具(Linux Kernel Profiler)應用於追蹤網路通訊裝置處理封包的函式之執行順序的缺點如下:These records are not recorded for functions that process network packets, so they are not suitable for tracking the order in which functions are processed. Therefore, there is currently no set of tools that can correctly and effectively analyze and track the execution order of the functions of the system processing packets of the network communication device, and assist the developer in debugging and defining the causes of transmission delays, reaction times, and packet omissions. The shortcomings of this system kernel analysis tool (Linux Kernel Profiler) applied to track the execution order of the functions of the network communication device processing packets are as follows:
1. 無法提供封包導向的函式序列之追蹤記錄,對於想要分析處理封包的函式之執行順序的使用者相當不方便;1. The tracking record of the packet-oriented function sequence cannot be provided, which is quite inconvenient for the user who wants to analyze the execution order of the function of processing the packet;
2. 必須運作於某種特定的裝置或者系統版本,對於嵌入式裝置的開發相當不方便;以及2. Must operate on a particular device or system version, which is quite inconvenient for the development of embedded devices;
3. 使用者必須先具備封包處理與系統實作知識,並依人工檢閱方式植入追蹤指令,過程繁瑣且容易錯誤。3. The user must first have the knowledge of packet processing and system implementation, and implant the tracking instructions according to the manual review method, which is cumbersome and error-prone.
因此,如何改善函式序列之無法提供封包導向的追蹤記錄、必須運作於某種特定的裝置及必須先具備封包處理與系統實作知識之人工檢閱方式等問題,經發明人進行實驗、測試及研究後,終於獲得一種追蹤網路封包之處理程序的方法,除了有效解決無法提供追蹤記錄、運作於特定裝置及先具備實作知識等缺點外,亦能獲致加速網路通訊軟體的開發時程與執行效能之功效。亦即本發明所欲解決的課題即為如何克服存取網路封包的函式不容易找出的問題,而使得系統核心之處理程序得以被追蹤,以及如何克服只有使用sk_buff此一特定資料之原始型態名作為搜尋的基準點之問題,又如何克服要在該函式中設法記錄執行函式與封包內容的問題等。Therefore, how to improve the function sequence can not provide packet-oriented tracking records, must operate in a specific device and must first have the manual processing method of packet processing and system implementation knowledge, and the inventors conduct experiments, tests and After the research, I finally got a way to track the processing procedures of the network packet. In addition to effectively solving the shortcomings of not being able to provide tracking records, operating on specific devices and having practical knowledge, it can also accelerate the development of network communication software. And the efficacy of performance. That is, the problem to be solved by the present invention is how to overcome the problem that the function of accessing the network packet is not easy to find, so that the processing program of the system core can be tracked, and how to overcome the specific data only by using sk_buff. The original type name is used as the reference point of the search, and how to overcome the problem of trying to record the execution function and the contents of the package in the function.
本發明為一種追蹤一網路封包(Network Packet)之一處理程序的方法,其中該網路封包係儲存在一資料結構內,且該網路封包在一系統核心內接受該處理程序,該方法包括如下步驟,呼叫一函式以傳遞該資料結構,並據以追蹤該處理程序。The present invention is a method for tracking a network packet processing program, wherein the network packet is stored in a data structure, and the network packet accepts the processing program in a system core. The method includes the following steps: calling a function to pass the data structure and tracking the processing program accordingly.
較佳者,該方法的系統為一Linux,而該資料結構為一sk_buff,該方法利用該系統核心以存取該網路封包,該方法更包含利用一特定函式以存取該網路封包,且該處理程序為該資料結構之一執行順序。Preferably, the system of the method is a Linux, and the data structure is a sk_buff, the method uses the core of the system to access the network packet, and the method further comprises using a specific function to access the network packet. And the handler is an execution order of one of the data structures.
又按照一主要技術的觀點來看,本發明可以涵蓋到一種追蹤一網路封包之一處理程序的方法,其中該網路封包係在一系統核心內接受該處理程序,該方法包括如下步驟,提供一函式,以處理該網路封包,其中該函式具一參數,定義該參數之一資料型態名,以及藉搜尋該資料型態名,而追蹤該處理程序。According to a main technical point of view, the present invention can be directed to a method for tracking a processing procedure of a network packet, wherein the network packet accepts the processing program in a system core, the method comprising the following steps, A function is provided to process the network packet, wherein the function has a parameter, defines a data type name of the parameter, and tracks the processing program by searching for the data type name.
較佳者,該方法的資料型態名係為一搜尋的基準點,而該資料型態名為一sk_buff之原始型態名或一變形型態名。Preferably, the data type name of the method is a search reference point, and the data type is a sk_buff original type name or a deformed type name.
當然,該方法的變形型態名可以為一別名、一客製化資料型態名或一巢狀資料結構,而該變形型態名係使其與該網路封包之一資料型態產生關聯。Certainly, the deformed state name of the method may be an alias, a customized data type name or a nested data structure, and the deformed type name is associated with a data type of the network packet. .
當然,該方法更可以包含從該系統核心之一原始碼中,尋找一存取該網路封包的函式,其中該存取該網路封包的函式為一直接存取該網路封包的函式或一間接存取該網路封包的函式。Of course, the method may further include: searching for a function of accessing the network packet from a source code of the system core, wherein the function of accessing the network packet is directly accessing the network packet. A function or a function that indirectly accesses the network packet.
較佳者,該方法之直接存取網路封包的函式係利用一已宣告的變數(Global Variable)、一參數型態名、一回傳型態名或一區域定義以直接存取該網路封包。Preferably, the direct access network packet function of the method utilizes a declared variable (Global Variable), a parameter type name, a backhaul type name or a region definition to directly access the network. Road packet.
較佳者,該方法之間接存取網路封包的函式係利用一呼叫存取網路封包之函式(Indirect Caller)或一被存取網路封包之函式呼叫(Indirect Callee),並藉由一傳址方式而間接得到一指向該網路封包的指標,以存取該網路封包。Preferably, the method for accessing the network packet between the methods utilizes an Indirect Caller or an Indirect Callee that is accessed by the network packet, and An indicator pointing to the network packet is indirectly obtained by a addressing method to access the network packet.
若是從另一個可行的角度來看,本發明即為一種追蹤一網路封包之一處理程序的方法,其中該網路封包係在一系統核心內接受該處理程序,該方法包括如下步驟,提供存取該網路封包的一函式,嵌入一追蹤指令於該函式中,開始執行該函式,並進而觸發該追蹤指令,以及記錄該函式之一識別符,俾得以追蹤該處理程序。If, from another feasible point of view, the present invention is a method for tracking a processing procedure of a network packet, wherein the network packet accepts the processing program in a system core, the method comprising the following steps: Accessing a function of the network packet, embedding a tracking instruction in the function, starting to execute the function, and then triggering the tracking instruction, and recording one of the identifiers of the function, and then tracking the processing program .
當然,該方法的追蹤指令係可以為一工具原始碼(Instrument Source Code),該識別符為一名稱或一代碼。Of course, the tracking instruction of the method may be an Instrument Source Code, and the identifier is a name or a code.
本發明經由上述構想的解說,即能看出所運用之追蹤網路封包的處理程序之方法,果能利用呼叫函式以傳遞該資料結構,而據以追蹤該處理程序,並具有定義該參數之資料型態名進而藉搜尋該資料型態名以追蹤該處理程序之特色。為了易於說明,本發明得藉由下述之較佳實施例及圖示而更加清楚。Through the above description, the present invention can be seen that the method of tracking the processing procedure of the network packet can be used, and the call function can be used to transmit the data structure, and the processing program is tracked and has the parameter defined. The data type name is then searched for the data type name to track the characteristics of the processing program. The invention will be more apparent from the following detailed description and drawings.
本發明提出一種新的應用在網路通訊裝置中之追蹤網路封包處理程序的機制,該機制可藉由核心函式存取網路封包資料的順序,追蹤網路封包在核心系統的處理程序。本發明應用在網路通訊裝置中,可以利用網路封包的資料結構,及一個函式分析方法自動找出程式中有存取網路封包資料的函式,並在此些函式中嵌入指令,藉由程式本身執行函式的順序,依序觸發嵌入指令來記錄被執行的函式名稱或代碼與封包內容之相關資訊。本發明可以利用Linux核心系統內部用於管理與儲存網路封包的資料結構(sk_buff),追蹤核心系統內部處理網路封包的行為與時間點。The invention proposes a new mechanism for tracking a network packet processing program in a network communication device, which can track the processing procedure of the network packet in the core system by the order of the core function access network packet data. . The invention is applied in a network communication device, and can utilize a data structure of a network packet and a function analysis method to automatically find a function for accessing a network packet data in the program, and embed the instruction in the function. By the order in which the program itself executes the functions, the embedded instructions are sequentially triggered to record information about the name or code of the executed function and the contents of the package. The invention can utilize the data structure (sk_buff) for managing and storing network packets inside the Linux core system, and track the behavior and time point of processing the network packet inside the core system.
利用這些紀錄,協助網路通訊軟體開發者很容易分析系統內部之網路通訊的系統行為,釐清與改善網路通訊(網路應用與核心協定或個別軟體函式)的問題,加速網路通訊軟體的開發時程與執行效能。亦即本發明可以追蹤存取網路封包的函式執行順序、追蹤系統內部處理網路封包的行為與時間點及不限定任何的裝置與系統版本。本案可能應用之產業包括資訊產業、網路通訊產業及雲端計算等,而可能應用之產品則為無線網路設備、手提電腦(Note-book)、PDA、手機(Handset)、網路存取閘道器、網路家電與任何連網裝置等。Using these records, it is easy for network communication software developers to analyze the system behavior of network communication within the system, clarify and improve network communication (network applications and core protocols or individual software functions), and accelerate network communication. Software development time and execution performance. That is, the present invention can track the execution order of the function of accessing the network packet, track the behavior and time point of processing the network packet inside the system, and do not limit any device and system version. The industries that may be applied in this case include the information industry, the network communication industry, and cloud computing. The products that may be applied are wireless network devices, notebook computers (Note-books), PDAs, mobile phones (Handsets), and network access gates. Channels, network appliances and any networking devices.
在此我們將以Linux核心系統為例,針對網路封包於Linux核心系統內部處理的過程,紀錄量度(measurement)資料,諸如各函式所做之內容改變或各函式之啟動(statring)時間,說明本發明提出的追蹤網路封包處理程序的機制之一個較佳實施(applying)例,此類記錄資訊在開發(developing)網路裝置上具有重要價值。但本發明應用並不侷限於此一環境,只要知道網路封包資料型態名,就可以套用本發明追蹤此系統處理該網路封包的程序。本發明應用於Linux核心系統中,利用Linux核心系統內部的網路封包之資料結構,追蹤Linux核心系統內部處理網路封包的行為與時間點,協助開發者分析Linux核心系統內部的網路行為。Here we will take the Linux core system as an example, for the process of processing the network packet inside the Linux kernel system, recording the measurement information, such as the content change of each function or the statring time of each function. A preferred example of the mechanism for tracking a network packet processing procedure proposed by the present invention is of great value in developing a network device. However, the application of the present invention is not limited to this environment. As long as the network packet data type name is known, the present invention can be applied to track the system to process the network packet. The invention is applied to a Linux core system, and utilizes the data structure of the network packet inside the Linux core system to track the behavior and time point of processing the network packet inside the Linux core system, and assists the developer in analyzing the network behavior inside the Linux core system.
本發明於Linux核心系統的實施例,主要增加兩個部份,A.追蹤核心系統內部存取網路封包的函式執行順序,以及B.嵌入指令。且先就A.部分而言,請參閱第二圖,可見一網路封包的一資料結構sk_buff,其包括一管理資料(Management Data)及一封包資料儲存(Packet data storage),本發明利用Linux核心系統內部用於管理與儲存網路封包的資料結構,作為尋找的基準點,找出存取網路封包的函式,而在Linux核心系統內部用於管理與儲存網路封包的資料結構即為Sk_buff。請參閱第三圖,顯示出一種追蹤一網路封包之一處理程序的方法,其中該網路封包係儲存在該資料結構內,且該網路封包在一系統核心內接受該處理程序,該方法包括如下步驟,呼叫一函式以傳遞該資料結構,並據以追蹤該處理程序。而且存取網路封包的函式使用函式呼叫傳遞sk_buff(如第三圖中的虛框線內所示者),可讓其餘的函式得以存取網路封包,因此本發明可以輕易實施於Linux核心系統之中。The embodiment of the invention in the Linux core system mainly adds two parts, A. tracking the function execution order of the core system internal access network packet, and B. embedded instruction. And in the case of A., please refer to the second figure, which can be seen as a data structure sk_buff of a network packet, which includes a management data (Management Data) and a packet data storage (Packet data storage), and the present invention utilizes Linux. The data structure used to manage and store network packets within the core system, as a reference point for finding, to find the function to access the network packet, and the data structure for managing and storing the network packet inside the Linux core system is For Sk_buff. Referring to the third figure, a method for tracking a processing procedure of a network packet is shown, wherein the network packet is stored in the data structure, and the network packet accepts the processing program in a system core. The method includes the steps of calling a function to pass the data structure and tracking the processing accordingly. Moreover, the function of accessing the network packet uses the function call to pass sk_buff (as shown in the dashed line in the third figure), so that the remaining functions can access the network packet, so the invention can be easily implemented. In the Linux kernel system.
該方法的作業系統為一Linux,而該資料結構為一sk_buff,該方法利用該系統核心以存取該網路封包,該方法更包含利用一特定函式以存取該網路封包,且該處理程序為該資料結構之一執行順序。The operating system of the method is a Linux, and the data structure is a sk_buff, the method uses the system core to access the network packet, and the method further comprises: using a specific function to access the network packet, and the method The handler executes the order of one of the data structures.
又按照一主要技術的觀點來看,請參閱第四圖,本發明可以涵蓋到一種追蹤網路封包之處理程序的方法,其中該網路封包係在一系統核心內接受該處理程序,該方法包括如下步驟,提供一函式,以處理該網路封包,其中該函式具一參數,定義該參數之一資料型態名,以及藉搜尋該資料型態名,而追蹤該處理程序。當然,此時的方法之資料型態名係可以作為一搜尋的基準點,而本發明利用此函式分析方法,包含一個尋找特定資料之型態名的方法,該特定資料之型態名包含原始型態與各種變形型態名。According to a main technical point of view, referring to the fourth figure, the present invention may include a method for tracking a processing procedure of a network packet, wherein the network packet accepts the processing program in a system core, the method The method includes the following steps: providing a function to process the network packet, wherein the function has a parameter, defines a data type name of the parameter, and tracks the processing program by searching for the data type name. Of course, the data type name of the method at this time can be used as a reference point for searching, and the present invention uses the method of the function analysis to include a method for finding the type name of a specific data, and the type name of the specific data includes The original type and various deformed type names.
亦即從Linux核心系統的原始碼之中,在尋找存取網路封包的函式時,不僅可以使用該資料型態名為一sk_buff此一特定資料之原始型態名,亦可以改用一變形型態名。請參閱第四圖A,因為C語言擁有別名(Alias)、客製化資料型態(Customized data types)、巢狀資料結構(Nested Structures)等規則,故該方法的變形型態名可以為一別名41、一客製化資料型態名42或一巢狀資料結構43,而變形型態名43係使其與該網路封包之一資料型態產生關聯。That is, from the source code of the Linux core system, when searching for a function for accessing the network packet, not only the original type name of the data type named sk_buff but also the original type name may be used. Deformed state name. Please refer to the fourth picture A. Because the C language has aliases (Alias), customized data types (Customized data types), nested data structures (Nested Structures) and other rules, the deformed state name of the method can be one. The alias 41, a customized data type name 42 or a nested data structure 43, and the deformed state name 43 is associated with a data type of the network packet.
由於C語言的函式可以透過許多種方式存取特定資料,因此本發明的函式分析方法包含一個尋找存取網路封包之函式的方法,該方法包含從該系統核心之一原始碼中,尋找一存取該網路封包的函式,其中該存取該網路封包的函式包含一直接存取該網路封包的函式或一間接存取該網路封包的函式。請參閱第四圖B,該直接存取網路封包的函式係利用以下四種方式,一全域變數(亦稱為‘‘已宣告的變數”,Global Variable)44、一函式的參數型態名(Parameter Type)45、一回傳型態名(Return Type)46或一區域定義(Local Definition)47,得以直接存取該網路封包。Since the C language function can access specific data in a variety of ways, the method of function analysis of the present invention includes a method for finding a function for accessing a network packet, the method comprising one source code from the core of the system. Looking for a function to access the network packet, wherein the function for accessing the network packet includes a function for directly accessing the network packet or a function for indirectly accessing the network packet. Referring to FIG. 4B, the function of the direct access network packet utilizes the following four methods: a global variable (also referred to as ''declared variable', Global Variable) 44, a parameter type of a function A Parameter Type 45, a Return Type 46, or a Local Definition 47 allows direct access to the network packet.
另一方面,此間接存取特定資料的函式並未利用以上四種方式,請參閱第五圖,該間接存取網路封包的函式係利用一呼叫存取網路封包之函式(Indirect Caller),以函式E呼叫直接存取網路封包之函式F為例,E藉由一傳址(call by reference)方式,而間接從F得到一指向該網路封包的指標,因此使其得以存取該網路封包。或是如第六圖所示之一被存取網路封包之函式呼叫(Indirect Callee),以H被直接存取網路封包之函式G呼叫為例,H藉由call by reference,而間接從G取得該指向網路封包的指標,使其因此得以存取該網路封包。On the other hand, the function of indirectly accessing specific data does not utilize the above four methods. Referring to FIG. 5, the function of the indirect access network packet utilizes a call access network packet function ( Indirect Caller), for example, the function F of the direct access network packet of the function E calls, and E obtains an index pointing to the network packet indirectly from F by means of a call by reference method. Make it accessible to the network packet. Or, as shown in Figure 6, the Indirect Callee is accessed by the network packet, and the H is referred to as a function G call that directly accesses the network packet, and H is called by reference. The metric that points to the network packet is obtained indirectly from G, thereby enabling access to the network packet.
再就B.部分而言,請參閱第七圖(其原始函式係位於第三圖),若是從另一個可行的角度來看,本發明可以利用上述函式分析方法,找出程式中有存取網路封包的函式,並在這些函式中嵌入指令,亦即本發明為一種追蹤網路封包之處理程序的方法,其中該網路封包係在一系統核心內接受該處理程序,該方法包括如下步驟,提供存取該網路封包的一函式,嵌入一追蹤指令(例如:在第七圖中的大虛線框內者即為一工具原始碼(Instrument Source Code)70,是一插入追蹤技術的指令)於該函式中,開始執行該函式,並進而觸發該追蹤指令,以及記錄該函式之一識別符,俾得以追蹤該處理程序。For the part B, please refer to the seventh picture (the original function is in the third picture). If it is from another feasible point of view, the present invention can use the above function analysis method to find out that there is a program. Accessing a network packet function and embedding instructions in the functions, that is, the present invention is a method for tracking a network packet processing program, wherein the network packet accepts the processing program in a system core, The method includes the following steps: providing a function for accessing the network packet, embedding a tracking instruction (for example, the one in the large dotted frame in the seventh figure is an Instrument Source Code 70, An instruction to insert a tracking technique, in the function, begins executing the function, and in turn triggers the tracking instruction, and records one of the identifiers of the function, so that the processing program can be tracked.
當然,此時的方法之該追蹤指令係可以為一工具原始碼,此些指令碼的功用係可以記錄下函式的執行順序以及所關心的系統內部資料或資源情況,提供開發者追蹤與分析系統的運作狀態,而該識別符為一名稱或一代碼或其他各式各樣的符號。本發明可以應用於網路裝置的開發,目前網路已大量建置,連網裝置也日漸普及,未來再加上雲端計算產業的發展,裝置連網會更加普遍,本發明可以提升網路通訊裝置的軟體開發效率與通訊效能,產業價值極大。Of course, the tracking instruction of the method at this time may be a tool source code, and the functions of the instruction codes may record the execution order of the function and the internal data or resources of the system concerned, and provide developer tracking and analysis. The operational status of the system, and the identifier is a name or a code or other various symbols. The invention can be applied to the development of network devices. At present, the network has been widely built, and the networked devices are becoming more and more popular. In the future, coupled with the development of the cloud computing industry, the device networking will be more common, and the present invention can improve network communication. The software development efficiency and communication efficiency of the device have great industrial value.
又本案進行檢索的關鍵字為:packet processing sequence、packet processing procedure、packet trace、packet flow、packet data type及kernel function等。而當檢索之資料庫為美國專利商標局專利資料庫檢索系統(http://www.uspto.gov/)時,其結果如下:The keywords for searching in this case are: packet processing sequence, packet processing procedure, packet trace, packet flow, packet data type, and kernel function. When the searched database is the United States Patent and Trademark Office Patent Database Search System (http://www.uspto.gov/), the results are as follows:
1. "packet processing sequence" AND "packet data type": 0篇1. "packet processing sequence" AND "packet data type": 0
2. "packet processing sequence" AND "kernel function": 0篇2. "packet processing sequence" AND "kernel function": 0
3. "packet processing procedure" AND "packet data type": 0篇3. "packet processing procedure" AND "packet data type": 0
4. "packet processing procedure" AND "kernel function": 0篇4. "packet processing procedure" AND "kernel function": 0
5. "packet flow" AND "packet data type": 9篇5. "packet flow" AND "packet data type": 9
6. "packet flow" AND "kernel function": 7篇6. "packet flow" AND "kernel function": 7
7. "packet trace" AND "packet data type": 0篇7. "packet trace" AND "packet data type": 0
8. "packet trace" AND "kernel function": 0篇8. "packet trace" AND "kernel function": 0
謹將第5及第6次已檢索到之專利資料臚列如下:The 5th and 6th patent documents retrieved are listed below:
1 US 7,453,8011 US 7,453,801
Admission control and resource allocation in a communication system supporting application flows having quality of service requirementsAdmission control and resource allocation in a communication system supporting application flows having quality of service requirements
2 US 7,305,5112 US 7,305,511
Providing both wireline and wireless connections to a wireline interfaceProviding both wireline and wireless connections to a wireline interface
3 US 7,164,6573 US 7,164,657
Intelligent collaboration across network systemsIntelligent collaboration across network systems
4 US 7,136,9044 US 7,136,904
Wireless cable replacement for computer peripherals using a master adapterWireless cable replacement for computer peripherals using a master adapter
5 US 7,127,5415 US 7,127,541
Automatically establishing a wireless connection between adaptersAutomatically establishing a wireless connection between adapters
6 US 6,963,9556 US 6,963,955
Scattering and gathering data for faster processingScattering and gathering data for faster processing
7 US 6,950,8597 US 6,950,859
Wireless cable replacement for computer peripheralsWireless cable replacement for computer peripherals
8 US 6,894,9728 US 6,894,972
Intelligent collaboration across network systemIntelligent collaboration across network system
9 US 6,665,4959 US 6,665,495
Non-blocking,scalable optical router architecture and method for routing optical trafficNon-blocking,scalable optical router architecture and method for routing optical traffic
10 US 7,685,25410 US 7,685,254
Runtime adaptable search processorRuntime adaptable search processor
11 US 7,631,10711 US 7,631,107
Runtime adaptable protocol processorRuntime adaptable protocol processor
12 US 7,627,69312 US 7,627,693
IP storage processor and engine using RDMAIP storage processor and engine using RDMA
13 US 7,536,46213 US 7,536,462
Memory system for a high performance IP processorMemory system for a high performance IP processor
14 US 7,487,26414 US 7,487,264
High performance IP processorHigh performance IP processor
15 US 7,415,72315 US 7,415,723
Distributed network security system and a hardware processorDistributed network security system and a hardware processor
16 US 7,376,75516 US 7,376,755
TCP/IP processor and engine using RDMATCP/IP processor and engine using RDMA
又當檢索之資料庫為歐洲專利局專利資料庫檢索系統(http://ep.espacenet.com/)時,其結果如下:When the database retrieved is the European Patent Office Patent Database Search System (http://ep.espacenet.com/), the results are as follows:
1. "packet processing sequence" AND "packet data type": 0篇1. "packet processing sequence" AND "packet data type": 0
2. "packet processing sequence" AND "kernel function": 0篇2. "packet processing sequence" AND "kernel function": 0
3. "packet processing procedure" AND "packet data type": 0篇3. "packet processing procedure" AND "packet data type": 0
4. "packet processing procedure" AND "kernel function": 0篇4. "packet processing procedure" AND "kernel function": 0
5. "packet flow" AND "packet data type": 0篇5. "packet flow" AND "packet data type": 0
6. "packet flow" AND "kernel function": 0篇6. "packet flow" AND "kernel function": 0
7. "packet trace" AND "packet data type": 0篇7. "packet trace" AND "packet data type": 0
8. "packet trace" AND "kernel function": 0篇8. "packet trace" AND "kernel function": 0
將上述檢索的技術內容與本案進行比對後的結果,顯示出均與本發明無關或不同,並沒有與本發明類似的專利。The results of comparing the technical contents of the above search with the present case show that the patents are not related to or different from the present invention, and there is no patent similar to the present invention.
綜上所述,本發明確能以一嶄新的設計,藉由利用呼叫函式以傳遞該資料結構,而據以追蹤該處理程序,並且所定義該參數之資料型態名,能實質獲致藉由搜尋該資料型態名以追蹤該處理程序之功效。故凡熟習本技藝之人士,得任施匠思而為諸般修飾,然皆不脫如附申請專利範圍所欲保護者。In summary, the present invention can be used in a new design, by using a call function to transfer the data structure, and thereby tracking the processing procedure, and defining the data type name of the parameter can be substantially borrowed The data type name is searched to track the efficacy of the process. Therefore, anyone who is familiar with this skill can be modified by all kinds of ideas, but they are not protected by the scope of the patent application.
41...別名41. . . Alias
42...客製化資料型態名42. . . Customized data type name
43...巢狀資料結構43. . . Nested data structure
44...全域變數44. . . Global variable
45...參數型態名45. . . Parameter type name
46...回傳型態名46. . . Return type name
47...區域定義47. . . Regional definition
70...工具原始碼70. . . Tool source code
第一圖:是習知的原始工具類之Kernprof核心函式的追蹤畫面;The first picture: is the tracking picture of the Kernprof core function of the original primitive tool class;
第二圖:是本發明的追蹤網路封包之處理程序的方法所利用之資料結構的結構圖;The second figure is a structural diagram of a data structure used by the method for tracking a network packet processing procedure of the present invention;
第三圖:是本發明之使用函式呼叫以傳遞資料結構的較佳實施例之程式設計圖;Third: is a programming diagram of a preferred embodiment of the present invention using a functional call to communicate a data structure;
第四圖A:是本發明之使用C語言的別名、客製化資料型態及巢狀資料結構等規則之較佳實施例的程式設計圖;FIG. 4A is a programming diagram of a preferred embodiment of the present invention using rules of the C language alias, customized data type, and nested data structure;
第四圖B:是直接存取網路封包的函式之全域變數、函式的參數型態名、回傳型態名及區域定義等程式圖;The fourth picture B is a program diagram of the global variable of the function of directly accessing the network packet, the parameter type name of the function, the return type name and the area definition;
第五圖:是利用呼叫存取網路封包之函式的程式設計圖;Figure 5: is a programming diagram of a function that uses a call to access a network packet;
第六圖:是利用被存取網路封包之函式呼叫的程式設計圖;以及Figure 6: is a programming diagram of a function call using the accessed network packet;
第七圖:是第三圖之嵌入指令結果的較佳實施例之程式設計圖。Figure 7 is a block diagram of a preferred embodiment of the embedded instruction result of the third figure.
70...工具原始碼70. . . Tool source code
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW99125188A TWI425795B (en) | 2010-07-29 | 2010-07-29 | Method for tracing processing procedure of network packet |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW99125188A TWI425795B (en) | 2010-07-29 | 2010-07-29 | Method for tracing processing procedure of network packet |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201206120A TW201206120A (en) | 2012-02-01 |
| TWI425795B true TWI425795B (en) | 2014-02-01 |
Family
ID=46761848
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW99125188A TWI425795B (en) | 2010-07-29 | 2010-07-29 | Method for tracing processing procedure of network packet |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI425795B (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TW200405167A (en) * | 2002-05-08 | 2004-04-01 | Intel Corp | Signal aggregation |
| US20040085906A1 (en) * | 2001-04-27 | 2004-05-06 | Hisamichi Ohtani | Packet tracing system |
| CN1937544A (en) * | 2006-11-13 | 2007-03-28 | 陈哲 | IP phone monitoring system |
| TW200849888A (en) * | 2007-03-30 | 2008-12-16 | Ibm | Method and system for resilient packet traceback in wireless mesh and sensor networks |
| TW200919246A (en) * | 2007-10-17 | 2009-05-01 | Synopsys Inc | Enhancing speed of simulation of an IC design while testing scan circuitry |
| US7742414B1 (en) * | 2006-06-30 | 2010-06-22 | Sprint Communications Company L.P. | Lightweight indexing for fast retrieval of data from a flow-level compressed packet trace |
-
2010
- 2010-07-29 TW TW99125188A patent/TWI425795B/en not_active IP Right Cessation
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040085906A1 (en) * | 2001-04-27 | 2004-05-06 | Hisamichi Ohtani | Packet tracing system |
| TW200405167A (en) * | 2002-05-08 | 2004-04-01 | Intel Corp | Signal aggregation |
| US7742414B1 (en) * | 2006-06-30 | 2010-06-22 | Sprint Communications Company L.P. | Lightweight indexing for fast retrieval of data from a flow-level compressed packet trace |
| CN1937544A (en) * | 2006-11-13 | 2007-03-28 | 陈哲 | IP phone monitoring system |
| TW200849888A (en) * | 2007-03-30 | 2008-12-16 | Ibm | Method and system for resilient packet traceback in wireless mesh and sensor networks |
| TW200919246A (en) * | 2007-10-17 | 2009-05-01 | Synopsys Inc | Enhancing speed of simulation of an IC design while testing scan circuitry |
Also Published As
| Publication number | Publication date |
|---|---|
| TW201206120A (en) | 2012-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Zaostrovnykh et al. | A formally verified NAT | |
| Trihinas et al. | Devops as a service: Pushing the boundaries of microservice adoption | |
| US9262300B1 (en) | Debugging computer programming code in a cloud debugger environment | |
| US8627442B2 (en) | Hierarchical rule development and binding for web application server firewall | |
| Wehrle et al. | Modeling and tools for network simulation | |
| Kristensen et al. | Application of coloured petri nets in system development | |
| CN105074672B (en) | Call stack for asynchronous routine | |
| EP2994835B1 (en) | Identifying impacted tests from statically collected data | |
| KR20210076882A (en) | Functions-as-a-Service (FAAS) system enhancements | |
| Guo et al. | Minimum viable device drivers for arm trustzone | |
| US12474939B2 (en) | Sound and clear provenance tracking for microservice deployments | |
| Tang et al. | Xdebloat: Towards automated feature-oriented app debloating | |
| Huang et al. | Dtcraft: A high-performance distributed execution engine at scale | |
| US20180316572A1 (en) | Cloud lifecycle managment | |
| CN117807595B (en) | Rebound shell detection method and device, electronic equipment and storage medium | |
| Zhang et al. | High performance microservice communication technology based on modified remote procedure call | |
| Griggs | Node Cookbook: Discover solutions, techniques, and best practices for server-side web development with Node. js 14 | |
| TWI425795B (en) | Method for tracing processing procedure of network packet | |
| Mostafa et al. | Netdroid: Summarizing network behavior of android apps for network code maintenance | |
| WO2025081782A1 (en) | Code analysis method and related device | |
| CN118427218A (en) | State information configuration method and device, electronic equipment, storage medium and computer program product | |
| TW201546629A (en) | Semantic restriction | |
| Ellis | Emplacing new tracing: Adding opentelemetry to envoy | |
| Yin et al. | A novel method of security requirements development integrated common criteria | |
| Carata | Provenance-based computing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| MM4A | Annulment or lapse of patent due to non-payment of fees |