CN111641623A - AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap - Google Patents

AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap Download PDF

Info

Publication number
CN111641623A
CN111641623A CN202010439766.5A CN202010439766A CN111641623A CN 111641623 A CN111641623 A CN 111641623A CN 202010439766 A CN202010439766 A CN 202010439766A CN 111641623 A CN111641623 A CN 111641623A
Authority
CN
China
Prior art keywords
afdx
winpcap
data frame
pcap
data
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202010439766.5A
Other languages
Chinese (zh)
Inventor
周卓
程培
李天赋
张玉杰
姜轶
彭俊
潘超军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Aeronautical Radio Electronics Research Institute
Original Assignee
China Aeronautical Radio Electronics Research Institute
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 China Aeronautical Radio Electronics Research Institute filed Critical China Aeronautical Radio Electronics Research Institute
Priority to CN202010439766.5A priority Critical patent/CN111641623A/en
Publication of CN111641623A publication Critical patent/CN111641623A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an AFDX protocol stack construction method based on WinPcap, which is characterized in that when an AFDX data frame is transmitted and received, network card equipment of target equipment is searched by using WinPcap library function pcap _ findalldevs _ ex () firstly; opening the selected network card through the pcap _ open () and setting parameters such as effective retention length, reading time and the like of the captured data packet; and calling pcap _ sendpack () to send the AFDX data frame and calling pcap _ next _ ex () to receive the AFDX data frame on the basis of successful opening of the network card. The invention utilizes the WinPcap of the common commercial computer to capture the data frame in the network card, and can complete the sending of the data frame conforming to the AFDX protocol on the basis of not using the AFDX board card.

Description

AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap
Technical Field
The invention relates to the field of Avionics Full-duplex switched Ethernet (AFDX for short), in particular to a method for constructing an AFDX protocol stack based on WinPcap.
Background
The AFDX network is an aviation data switching network technology based on IEEE802.3 commercial Ethernet, the AFDX network adopts Virtual Link (VL) to carry out effective and reasonable distribution and isolation on the Bandwidth of data transmission on the network, and Bandwidth distribution interval (BAG) is used for controlling the minimum time interval of Ethernet data frames on the same Virtual Link, thereby increasing the certainty of the network and effectively preventing the problems of network blockage and congestion.
WinPcap (windows packet capture) is a free and public network access system under a windows platform. WinPcap can provide the application program with the capability of accessing the network bottom layer, and the WinPcap is used for directly programming a network under a windows system. WinPcap is particularly suitable for the fields of network and protocol analysis, network monitoring and the like. The WinPcap interface is called to realize the transceiving of the original data stream, and the application can directly control some information of the MAC layer. The Windows operating system provides an ndis (network Driver Interface specification) Interface so that a developer can control network communication by writing a kernel Driver.
In the current stage, for testing an AFDX network, professional AFDX testing equipment generally needs to be customized, data are sent and received through an AFDX board card, and a commercial board card is arranged on a desktop host to work depending on a traditional slot type interface, so that the movement is inconvenient, the price is high, and the upgrading service is difficult.
The AFDX protocol carries out a lot of customization work based on the Ethernet protocol, from the view of a MAC layer, a Sequence Number is added in the AFDX protocol for checking the integrity and the orderliness of frame transmission, and a VL (virtual link) Number is introduced for constructing a destination MAC address, which means that a TCP/IP (transmission control protocol/Internet protocol) interface carried by the original system cannot be used and a complete protocol stack needs to be automatically reconstructed.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide an AFDX protocol stack construction method based on WinPcap. Through reasonable configuration of AFDX quintuple information, Payload and SN, the sending of data frames conforming to the AFDX protocol can be completed on the basis of not using an AFDX board card, and interference frame filtering is carried out through NDIS Filter, so that the system only sends the data frames conforming to the AFDX protocol. The method comprises the steps of capturing data frames in a network card by utilizing WinPcap, filtering interference frames through an NDIS Filter, enabling the data frames received by a system to meet the AFDX requirement, and analyzing information in the data frames. The cost of purchasing a professional AFDX board card is saved, the portability is improved, and a universal, flexible, convenient and low-cost way is provided for testing an AFDX network.
The invention aims to be realized by the following technical scheme:
an AFDX protocol stack construction method based on WinPcap completes construction, sending, receiving and analysis of an AFDX data frame on an application layer. When an AFDX data frame is sent and received, firstly, a WinPcap library function pcap _ findalldevs _ ex () is used for searching a network card device of a target device; opening the selected network card through the pcap _ open () and setting parameters such as effective retention length, reading time and the like of the captured data packet; and calling pcap _ sendpack () to send the AFDX data frame and calling pcap _ next _ ex () to receive the AFDX data frame on the basis of successful opening of the network card.
Calculating length information in a load, a UDP (user Datagram protocol) header, an IP (Internet protocol) header and a MAC (media access control) header when AFDX (avionics full Duplex switched Ethernet) data frames are constructed, meanwhile, enabling the Sequence Number of a first AFDX data frame on each virtual link to be 0, continuously circulating from 1 to 255, storing the Sequence Number of each VL (virtual Link) by maintaining a hash table, and adding the Sequence Number by looking up the hash table and adding 1 each time when a sending function of WinPcap is called.
And when the AFDX data frame is analyzed, data analysis is performed layer by layer from the MAC layer according to the format of the AFDX data frame, and finally quintuple information and effective load information of the received AFDX data frame are obtained.
And one part of the kernel layer supports the API function of the application layer, and the other part of the kernel layer completes NDIS Filter filtering.
When the NDIS Filter filters, for each Ethernet frame which is sent and received, whether the Ethernet frame is an AFDX frame is determined by judging the first four bytes, if so, the API is continuously called to receive and transmit the next layer, and if not, the API is called to disguise that the receiving and transmitting are finished.
And realizing Ethernet data transmission on a physical layer through a network card and a network cable of the target equipment.
The invention has the beneficial effects that:
the invention can complete the receiving and sending of the data frame conforming to the AFDX protocol on the basis of not using the AFDX board card, complete the test verification activity of the AFDX network, save the cost of purchasing a professional AFDX board card, increase the portability, and provide a universal, flexible, convenient and low-cost approach for the test of the AFDX network.
The invention is convenient to deploy, does not need extra hardware cost, and can be widely deployed in common notebook computers and desktop computers. The unit price of the commercial board card is more than one hundred thousand RMB, the software needs to be charged additionally, a single set of software charges more than one hundred thousand RMB, the software and the hardware are bound with each other, free migration is not allowed, and high cost is consumed by large-scale deployment, so that the cost related to purchasing the AFDX special board card and the matched software can be saved.
Drawings
FIG. 1 is a diagram of a construction method of an AFDX protocol stack based on WinPcap;
FIG. 2 is a schematic diagram of AFDX protocol stack construction;
FIG. 3 is a flow chart of WinPcap operation;
FIG. 4 NDIS Filter operational flow diagram.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
The present embodiment relates to a method for constructing an AFDX protocol stack based on WinPcap, and the structure of the AFDX protocol stack is shown in fig. 1, and the AFDX protocol stack may be divided into an application layer, a kernel layer, and a physical layer.
First, application layer
And the application layer completes the functions of constructing, sending, receiving, analyzing and the like of the AFDX data frame.
Constructing an AFDX data frame:
referring to the structure of the AFDX data frame shown in fig. 2, the source MAC address contains three parts: a fixed bit, a user defined bit and an A/B network identification bit. For the identification of the interface a/B network, 001 identifies the a network data and 010 identifies the B network data. The source MAC address may be designed as: 02: 00: 00: XX: XX: 00: 20 or 02: 00: 00: XX: XX: 00: 40. the destination MAC address contains two parts, a fixed domain and a virtual link identification. The hexadecimal setting of the fixed field is: 03: 00: 00: 00, the virtual link number is set by each transmitting port. The destination MAC address may be designed as 03: 00: 00: 00: XX: XX. The IP source address can be designed as: 0A: XX: XX: XX, the IP destination address is designed as: 0A: XX: XX: XX. For UDP source and destination ports are given by the user. XX in the address is determined by the configuration information.
The five-tuple information of the AFDX network comprises a source port, a destination port, a source IP address, a destination IP address and a virtual link number. The AFDX data frame quintuple information and data payload can be either manually filled in or selected in an option box. When information is input, all input contents need to be checked, including whether the input information such as IP (Internet protocol) meets format specifications or not and whether a numerical value exceeds a boundary or not, whether input load information meets protocol specifications or not is checked, and a prompt is given aiming at a problem; when the input content is valid, the system automatically calculates the length information in the payload, as well as the UDP header, IP header, and MAC header, and automatically composes a complete AFDX data frame. The information of the MAC header, IP header and UDP header is stored using the following structure:
typedefstruct
{
quint8DesMAC[6];
quint8SrcMAC[6];
quint8NetType[2];
}MACHEADER;
typedefstruct
{
quint8VersionAndHeaderLen;
quint8ServiceType;
quint8TotalLenOfPacket[2];
quint8 Identifier[2];
quint8FlagAndFragmentOffset[2];
quint8TimeToLive;
quint8HigherLayerProtocol;
quint8HeaderCheckSum[2];
quint8SrcIP[4];
quint8DstIP[4];
}IPHEADER;
Figure BDA0002503642550000051
according to the ARINC 664 protocol, Sequence numbers vary from VL to VL, with the first frame Sequence Number on each VL being 0, followed by a cycle from 1-255. The Sequence Number of each VL is stored by maintaining a hash table, and is added in a mode of looking up a table and adding 1 each time a sending function of WinPcap is called.
And checking the data frame, and filling by program calculation. Other fields that are not changed fill in the default values.
And (3) transmitting and receiving an AFDX data frame:
referring to fig. 3, first, a network card device (wireless connection, local connection, etc.) of the test device is searched using a WinPcap library function pcap _ findalldevs _ ex (); opening the selected network card through pcap _ open () and setting parameters such as effective retention length and reading time of the captured data packet; calling pcap _ sendpack () to send an AFDX data frame on the basis of successful opening of a network card, wherein in order to facilitate the packet data to be packaged, information such as an MAC (media access control) header, an IP (Internet protocol) header and a UDP (user Datagram protocol) header are separately defined, and before sending, the data needs to be packaged into a packet in sequence to be sent; data received by utilizing pcap _ next _ ex () is a completion packet, and data packet analysis is carried out according to the format of an AFDX protocol stack and the byte length of each section, so as to finally obtain quintuple information and payload of the received data.
And (3) resolving the AFDX data frame: the format of the strict AFDX data frame is characterized in that data analysis is carried out layer by layer from an MAC layer, and finally quintuple information and effective load information of a received data frame are obtained.
Second, inner core layer
The kernel layer partially supports the API function of the application layer and partially completes the filtering function of the NDIS Filter.
NDIS Filter filtration: during network communication, an application can automatically call a related service to perform operations such as server searching and the like, and a plurality of Ethernet frames are generated in the process. In order to avoid network congestion and transmission and reception of error information, filtering of interference frames is performed by the NDISFilter. And for each Ethernet frame which is sent and received, judging whether the Ethernet frame is an AFDX frame or not by judging the first four bytes, if so, continuing to call the API to transmit and receive the next layer, and if not, calling the API to disguise that the transmitting and receiving are finished, namely skipping the next layer and directly returning.
As shown in the NDIS Filter operation flowchart of fig. 4, filtering the network frame using the Filter Driver requires filtering the transmission frame in the Filter sendnetbuffersists () function provided by the frame, and for each ethernet frame to be transmitted, determining whether the ethernet frame is an AFDX frame by determining whether the first four bytes are {0x03,0x00,0x00,0x00}, if so, continuing to call ndissfsendnetbuffersists () to transmit the next layer, and if not, calling ndissnetbufferscomplete () to disguise that transmission is completed, i.e., skipping transmission of the next layer and returning directly. The NDIS filter operates similarly to the transmission during reception.
Three, physical layer
The physical layer is an ethernet network for actually transmitting data, and the transmission and reception of the ethernet data are realized through a network card and a network cable of the target device.
It should be understood that equivalents and modifications of the technical solution and inventive concept thereof may occur to those skilled in the art, and all such modifications and alterations should fall within the scope of the appended claims.

Claims (6)

1. An AFDX protocol stack construction method based on WinPcap is characterized in that when AFDX data frames are transmitted and received, network card equipment of target equipment is searched by using WinPcap library function pcap _ findalldevs _ ex () firstly; opening the selected network card through the pcap _ open () and setting the effective retention length and the reading time of the captured data packet; and calling pcap _ sendpack () to send the AFDX data frame and calling pcap _ next _ ex () to receive the AFDX data frame on the basis of successful opening of the network card.
2. The method as claimed in claim 1, wherein length information in the payload, UDP header, IP header and MAC header are calculated during the construction of AFDX data frames, and meanwhile, the Sequence Number of the first AFDX data frame on each virtual link is set to 0, and then the Sequence Number of each VL is stored by maintaining a hash table, and is added by looking up the hash table and adding 1 each time the transmission function of WinPcap is called, continuously looping from 1 to 255.
3. The method as claimed in claim 1, wherein the AFDX protocol stack is constructed based on WinPcap, and the method is characterized in that data parsing is performed layer by layer from the MAC layer according to the format of the AFDX data frame during parsing of the AFDX data frame, and finally quintuple information and payload information of the received AFDX data frame are obtained.
4. The method of claim 1, wherein the core layer supports API functions of the application layer and the core layer performs NDIS Filter filtering.
5. The method as claimed in claim 4, wherein in NDISFilter filtering, the Ethernet frames are each sent and received, and the judgment is made by judging the first four bytes to determine whether the Ethernet frame is an AFDX frame, if yes, the API is called to continue to send and receive data in the next layer, and if not, the API is called to disguise that the sending and receiving are completed.
6. The method for constructing an AFDX protocol stack according to claim 1, wherein ethernet data transmission is implemented on a physical layer through a network card and a network cable of a target device.
CN202010439766.5A 2020-05-22 2020-05-22 AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap Pending CN111641623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010439766.5A CN111641623A (en) 2020-05-22 2020-05-22 AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010439766.5A CN111641623A (en) 2020-05-22 2020-05-22 AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap

Publications (1)

Publication Number Publication Date
CN111641623A true CN111641623A (en) 2020-09-08

Family

ID=72332794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010439766.5A Pending CN111641623A (en) 2020-05-22 2020-05-22 AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap

Country Status (1)

Country Link
CN (1) CN111641623A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518015A (en) * 2021-04-08 2021-10-19 重庆长安汽车股份有限公司 Automatic realization method based on vehicle machine CAN network signal test

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510383A (en) * 2011-11-21 2012-06-20 北京航空航天大学 Middleware system with network traffic shaping function for aircraft electronic communication
CN103024042A (en) * 2012-12-13 2013-04-03 中国航空无线电电子研究所 Avionics full duplex switched Ethernet (AFDX) terminal protocol stack, and data receiving and sending method thereof
CN103281335A (en) * 2013-06-18 2013-09-04 东华大学 Embedded network protocol stack development method based on WinPcap

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102510383A (en) * 2011-11-21 2012-06-20 北京航空航天大学 Middleware system with network traffic shaping function for aircraft electronic communication
CN103024042A (en) * 2012-12-13 2013-04-03 中国航空无线电电子研究所 Avionics full duplex switched Ethernet (AFDX) terminal protocol stack, and data receiving and sending method thereof
CN103281335A (en) * 2013-06-18 2013-09-04 东华大学 Embedded network protocol stack development method based on WinPcap

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GAO TAO, YANG BO, AND CHEN XI: "An AFDX Monitor System Introducing Data Analysis based in ICD", 《2016 IEEE/CSAA INTERNATIONAL CONFERENCE ON AIRCRAFT UTILITY SYSTEM(AUS)》 *
张瀚文 何锋: "基于 WinPcap 的 AFDX 网络监视及误差分析", 《电子技术与软件工程》 *
许燕婷: "AFDX端系统协议栈虚拟链路层分析及仿真研究", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518015A (en) * 2021-04-08 2021-10-19 重庆长安汽车股份有限公司 Automatic realization method based on vehicle machine CAN network signal test

Similar Documents

Publication Publication Date Title
Rosen Linux kernel networking: Implementation and theory
US7561573B2 (en) Network adaptor, communication system and communication method
EP3143714B1 (en) Method to enable deep packet inspection (dpi) in openflow-based software defined network (sdn)
EP1482712B1 (en) Virtual network addresses
CN102387045B (en) Embedded point to point (P2P) flow monitoring system and method thereof
US20100287455A1 (en) Enforcing network bandwidth partitioning for virtual execution environments with direct access to network hardware
CN104750588A (en) Serial port communication based pressure testing method
US8447880B2 (en) Network stack instance architecture with selection of transport layers
CN113746692A (en) Network flow statistical method, electronic equipment and storage medium
CN104539483A (en) Network testing system
JP6665190B2 (en) Network sharing implementation method and apparatus
RU2602333C2 (en) Network system, packet processing method and storage medium
EP2432192B1 (en) Control method, apparatus and system
CN111641623A (en) AFDX (avionics full Duplex switched Ethernet) protocol stack construction method based on WinPcap
CN104570967B (en) Long-range control method and system based on android system
US8050266B2 (en) Low impact network debugging
CN103916331A (en) Connection method for analyzing data packet to select connection path
WO2015001392A1 (en) Methods and systems for sending and receiving information data
US20040143781A1 (en) System and method for non-intrusive loopback testing
CN115277450A (en) OPNET-based virtual-real combined heterogeneous communication network fusion system and application
CN104768176A (en) SFlow sampling method and device in wireless network
Cisco Release Notes for SwitchProbe Release 4.2 and 4.1
CN107181701A (en) The collection method and device of CGI data
CN109639525B (en) Network interface detection method based on homemade operating system
Zanna et al. WP4: A P4 Programmable IEEE 802.11 Data Plane

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200908

RJ01 Rejection of invention patent application after publication