Wired-based simulation of wireless network traffic

The eBPF-based method efficiently simulates wireless communication by modifying Ethernet frames to include wireless headers, addressing resource inefficiencies in existing simulation methods and enabling seamless integration and testing.

WO2025226170A1PCT designated stage Publication Date: 2025-10-30HUAWEI TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
PCT/RU2024/000143
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2025-10-30

AI Technical Summary

Technical Problem

Existing wireless network simulation methods face challenges in accurately simulating 802.11 packet-based network traffic, particularly in terms of resource efficiency and processing overhead.

Method used

A lightweight simulation method using extended Berkeley Packet Filter (eBPF) virtual machines to process Ethernet frames, modifying them to include wireless headers and protocols without involving real Linux wireless APIs, thereby reducing processing time and resource usage.

Benefits of technology

The method provides efficient simulation of wireless communication with minimal operating system resources, allowing for seamless integration and testing of wireless network architectures without interrupting existing applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure RU2024000143_30102025_PF_FP_ABST
    Figure RU2024000143_30102025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a communication method and related devices. The method includes: determining a first wired frame, where a header of the first wired frame includes a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame; determining, based on the first wired frame, a second wired frame, where a header of the second wired frame includes a second type field, the second type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the second frame, the second wired frame further includes a reference field carrying the first value; determining, based on the second wired frame, a third wired frame, where a header of the third wired frame is a same as the header of the second wired frame, the third wired frame further includes a first information field and a second information field, where the first information filed carries a wireless header, and the second information field carries the first value; transmitting the third wired frame. The embodiments of the present application provide a lightweight solution for simulating wireless communication.
Need to check novelty before this filing date? Find Prior Art

Description

WIRED-BASED SIMULATION OF WIRELESS NETWORK TRAFFICTECHNICAL FIELD[oooi] Embodiments of the present application relate to the field of communication technology, more specifically, related to a communication method and related devices.BACKGROUND|0002] Wireless network simulation is crucial for research and development. It provides a cost-effective and flexible method for assessing a wireless network architecture, protocols, devices, and topology. By utilizing the wireless network simulation, designers and operators can gain insight into system behavior, identify potential problems, and make informed decisions to improve overall performance and reliability. The wireless network simulation allows for thorough testing during the design phase and helps evaluate system performance under different scenarios during operations. It also aids in testing new devices and technologies before deployment, ensuring seamless integration.

[0003] The greatest problem of the wireless network simulation is how to correctly simulate 802.11 packetbased network trafficSUMMARY|0004] Embodiments of the present application provide a communication method and related devices. The embodiments of the present application provide a lightweight solution for simulating wireless communication.(0005] According to a first aspect, an embodiment of the present application provides a communication method. The method includes: determining a first wired frame, where a header of the first wired frame includes a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame; determining, based on the first wired frame, a second wired frame, where a header of the second wired frame includes a second type field, the second type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the second frame,the second protocol is different from the first protocol, the second wired frame further includes a reference field carrying the first value; determining, based on the second wired frame, a third wired frame, where a header of the third wired frame is a same as the header of the second wired frame, the third wired frame further includes a first information field and a second information field, where the first information filed carries a wireless header, and the second information field carries the first value; transmitting the third wired frame.(0006] The present application provides a lightweight solution for simulating wireless communication. For example, the present application does not doesn’t use a real Linux wireless API which does a lot of work to handle both data and management packets. Technical solutions provided by the present application take tiny amount of time and operating system (OS) resources to process the frames and only involves kernel’s inbuilt network stack features.

[0007] In a possible design of the first aspect, the determining, based on the first wired frame, a second wired frame, includes: determining the reference field, where a length of the reference field is a same as a length of the first type field; copying the first value in the first type field into the reference field; replacing the first value in the first type field with the second value.]0008] Optionally, the second frame may be determined by an extend berkely packet filter (eBPF) virtual machine (VM). In other words, the determine, based on the first wired frame, a second wired frame includes: determining , by the eBPF VM, the reference field, where a length of the reference field is a same as a length of the first type field; copying , by the eBPF VM, the first value in the first type field into the reference field; replacing , by the eBPF VM,the first value in the first type field with the second value.]0009] Due to the eBPF is running in isolated environment (eBPF VM). It’s really safe to have this kind of emulation without involving any kernel modules.

[0010] In a possible design of the first aspect, the reference field is located after a payload of the second wired frame.

[0011] In a possible design of the first aspect, the determining, based on the second wired frame, a third wired frame, includes: adding the first information field and the second information filed in the second wired frame; filling the first information field with the wireless header; copying the first value in the reference field into the second information field; removing the reference field.

[0012] In a possible design of the first aspect, the first information field is located after the header of the third wired frame, the second information filed is located after the first information field, and a payload of the third wired frame is located after the second information field.

[0013] According to a second aspect, an embodiment of the present application provides a communication method. The communication method includes: receiving a first wired frame, where a header of the fourth wired frame includes a first type field, the fourth type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame, the first wired frame further includes a first information field and a second information field, where the first information field carries a wireless header, and the second information filed carries a second value, the second value corresponds to a second protocol, and the first protocol is different from the second protocol; determining, based on the first wired frame, a second wired frame, where a header of the second wired frame includes a second type field, the second type field carries the first value, the second wired frame further includes a reference field carrying the second value; determining, based on the second wired frame, a third wired frame, where a header of the third wired includes a third type field, the third type field carries the second value, the second protocol is encapsulated in a payload of the third wired frame.

[0014] The present application provides a lightweight solution for simulating wireless communication. For example, the present application does not doesn’t use a real Linux wireless API which does a lot of work to handle both data and management packets. Technical solutions provided by the present application take tiny amount of time and operating system (OS) resources to process the frames and only involves kernel’s inbuilt network stack features.(0015] In a possible design of the second aspect, the determining, based on the second wired frame, a third wired frame, includes: removing the first value in the second type field; copying the second value in the reference field into the second type field; removing the reference field.

[0016] Optionally, the second frame may be determined by an extend berkely packet filter (eBPF) virtual machine (VM). In other words, the determining, based on the second wired frame, a third wired frame, includes: removing, by the eBPF VM, the first value in the second type field; copying, by the eBPF VM, the second value in the reference field into the second type field; removing, by the eBPF VM, the reference field.J0017] Due to the eBPF is running in isolated environment (eBPF VM). It’s really safe to have this kind of emulation without involving any kernel modules.(0018] In a possible design of the second aspect, the reference field is located after a payload of the fifth wired frame.

[0019] In a possible design of the second aspect, the determining, based on the fourth wired frame, a fifth wired frame, includes: adding the reference field in the fourth wired frame; copying the first value in the second information filed into the reference field; removing the first information field and the second information field.[00201 In a possible design of the second aspect, the first information field is located after the header of the fourth wired frame, the second information filed is located after the first information field, and a payload of the fourth wired frame is located after the second information field.(0021) According to a third aspect, an embodiment of the present application provides an electronic device, and the electronic device has a function of implementing the method in the first aspect or any possible implementation of the first aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware of the software includes one or more modules corresponding to the function.

[0022] According to a fourth aspect, an embodiment of the present application provides an electronic device, and the electronic device has a function of implementing the method in the second aspect or any possible implementation of the second aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware of the software includes one or more modules corresponding to the function.

[0023] According to a fifth aspect, an embodiment of the present application provides a computer readable storage medium, including instructions. When the instructions run on an electronic device, the electronic device is enabled to perform the method in the first aspect or any possible implementation of the first aspect.

[0024] According to a sixth aspect, an embodiment of the present application provides a computer readable storage medium, including instructions. When the instructions run on an electronic device, the electronic device is enabled to perform the method in the second aspect or any possible implementation of the second aspect.

[0025] According to a seventh aspect, an embodiment of the present application provides an electronic device, including a processor and a memory. The processor is connected to the memory. The memory is configured to store instructions, and the processor is configured to execute the instructions. When the processor executes the instructions stored in the memory, the processor is enabled to perform the method in the first aspect or any possible implementation of the first aspect.(0026) According to an eighth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory. The processor is connected to the memory. The memory is configured to store instructions, and the processor is configured to execute the instructions. When the processor executes the instructions stored in the memory, the processor is enabled to perform the method in the second aspect or any possible implementation of the second aspect.]0027] According to a ninth aspect, an embodiment of the present application provides a chip system, wherethe chip system includes a memory and a processor, and the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that an electronic device on which the chip system is disposed performs the method in the first aspect or any possible implementation of the first aspect.

[0028] According to a tenth aspect, an embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that an electronic device on which the chip system is disposed performs the method in the second aspect or any possible implementation of the second aspect.[00291 According to an eleventh aspect, an embodiment of the present application provides a computer program product, where when the computer program product runs on an electronic device, the electronic device is enabled to perform the method in the first aspect or any possible implementation of the first aspect.(0030] According to a twelfth aspect, an embodiment of the present application provides a computer program product, where when the computer program product runs on an electronic device, the electronic device is enabled to perform the method in the second aspect or any possible implementation of the second aspect.(0031] According to a thirteenth aspect, an embodiment of the present application provides an image processing system. The image processing system includes a first electronic device and a second electronic device. The first electronic device is enabled to perform the method in the first aspect or any possible implementation of the first aspect, and the second electronic device is enabled to perform the method in the second aspect or any possible implementation of the second aspect.

[0032] For example, the first electronic device may be the electronic device in the third aspect, and the second electronic device may be the electronic device in the fourth aspect. For another example, the first electronic device may be the electronic device in the seventh aspect, and the second electronic device may be the electronic device in the eighth aspect.

[0033] In addition, an embodiment of the present application provides an electronic device, and the electronic device has a function of implementing the method in the first aspect or any possible implementation of the first aspect and has a function of implementing the method in the second aspect or any possible implementation of the second aspect. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware of the software includes one or more modules corresponding to the function.

[0034] An embodiment of the present application provides a computer readable storage medium, including instructions. When the instructions run on an electronic device, the electronic device is enabled to perform the method in the first aspect or any possible implementation of the first aspect and perform the method in the second aspect or any possible implementation of the second aspect.

[0035] An embodiment of the present application provides an electronic device, including a processor and a memory. The processor is connected to the memory. The memory is configured to store instructions, and the processor is configured to execute the instructions. When the processor executes the instructions stored in the memory, the processor is enabled to perform the method in the first aspect or any possible implementation of the first aspect and perform the method in the second aspect or any possible implementation of the second aspect.

[0036] An embodiment of the present application provides a chip system, where the chip system includes a memory and a processor, and the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that an electronic device on which the chip system is disposed performs the method in the first aspect or any possible implementation of the first aspect and performs the method in the second aspect or any possible implementation of the second aspect.

[0037] According to an eleventh aspect, an embodiment of the present application provides a computer program product, where when the computer program product runs on an electronic device, the electronic device is enabled to perform the method in the first aspect or any possible implementation of the first aspect and perform the method in the second aspect or any possible implementation of the second aspect.DESCRIPTION OF DRAWINGS

[0038] FIG. 1 is a schematic block diagram illustrating a communication system according to some embodiments of the present application.

[0039] FIG. 2 shows a structure of an Ethernet frame.

[0040] FIG. 3 illustrates a diagram of the eBPF.

[0041] FIG. 4 illustrates a communication method according to some embodiments ofthe present application.

[0042] FIG. 5 illustrates a communication method according to some embodiments ofthe present application.

[0043] FIG. 6 shows a system according to the embodiment of the present application.

[0044] FIG. 7 illustrates a single host architecture.

[0045] FIG. 8 illustrates a multi host architecture.

[0046] FIG. 9 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application.

[0047] FIG. 10 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application.

[0048] FIG. 11 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application.]0049] FIG. 12 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application.(0050] FIG. 13 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application.DESCRIPTION OF EMBODIMENTS

[0051] The following describes the technical solutions in the present application with reference to the accompanying drawings.

[0052] FIG. 1 is a schematic block diagram illustrating a communication system according to some embodiments of the present application.(0053] Referring to FIG. 1, a communication system 100 includes a station (STA) 101 and a network device 102. The STA 101 may be a computer, a laptop, a server or the like. The STA 101 is connected to the network device 102 by a wired communication link 103. The wired communication link 103 may be a coaxial cable, a copper wire, an optical fiber or the like. The network device 102 may be a router, an access point or the like.

[0054] A data packet may be transmitted between the STA 101 and the network device 102. The data packet may carry a frame as its payload. The data packet may follow an Ethernet protocol (e.g., institute of electrical and electronic (IEEE) 802.3). Therefore, the data packet may be referred to as an Ethernet packet, and the frame carried by the Ethernet packet may be referred to as an Ethernet frame.

[0055] FIG. 2 shows a structure of an Ethernet frame.]0056) As shown in FIG. 2, the Ethernet frame includes a source media access control (MAC) address (SRCMAC), a destination MAC address (DestMAC), an Ethernet type (EtherType), a payload (Payload), and a frame check sequence (FCS) check bit. The source MAC address and the destination MAC address are forwardingaddresses of the Ethernet frame. The Ethernet type is a two-octet filed. The Ethernet type is used to indicate which protocol is encapsulated in the payload of the Ethernet frame. The payload is data information carried in the Ethernet packet, and a protocol followed by the data information is indicated by the value carried by the EtherType field. An FCS field is located at an end of an Ethernet packet carrying the Ethernet frame, and is used to perform a check on an entire Ethernet packet. If a bit in the Ethernet packet is incorrect, a check result is incorrect, and the entire Ethernet packet is discarded.

[0057] Table 1 shows some examples of EtherType values and their corresponding protocols.Table 1]0058] For example, when an EtherType filed of an Ethernet frame carries a value of 0x0800, a payload of the Ethernet frame carries an IP packet following IPv4. When an EtherType field of an Ethernet frame carries a value of 0x8915, a packet following is encapsulated in a payload of the Ethernet frame.]0059] Extend berkely packet filter (eBPF) is a technology that lets programs run without the need to add modules or modify kernel source code.]0060] FIG. 3 illustrates a diagram of the eBPF.

[0061] As illustrated in FIG. 3, the eBPF may include two parts: a user space program and a kernel space program. The user space program is configured to load eBPF bytecode into the kernel space. Once the eBPF bytecode has been loaded into the kernel space, it is verified by an eBPF verifier to confirm its safety. This verification process ensures that the eBPF bytecode is free from harm. After confirming the eBPF bytecode, an eBPF virtual machine (VM) may execute the eBPF bytecode. eBPF maps may be used to transmit data collected by the eBPF VM executing the eBPF bytecode to the user space via a system call.

[0062] A netfilter queue (NFQ) is a tool for managing network packets. For example, the NFQ may be used to accept, delete, modify the network packets.|0063] FIG. 4 illustrates a communication method according to some embodiments of the present application. The method illustrated in FIG. 4 may be performed by an electronic device. The electronic device may be anSTAtion or a component of the station (e.g., a processing circuit, a chip, a system on chip (SoC) or the like). For convenience, it is assumed that the method illustrated in FIG. 4 is performed by the station.|0064] 401. The station determines a first wired frame. Aheader of the first wired frame includes a type field.The type field carries a first value, and the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame.

[0065] The first protocol may be a correctness-check-required protocol. When a receiver receives a frame and the frame carries data following the correctness-check-required protocol, the receiver may check the correctness of the received frame. The correctness-check-required protocol may be an Internet Protocol (e.g., the IPv4, the IPv6), an address resolution protocol (ARP), a dynamic ARP (DARP), or the like. For example, value of the type filed (hereinafter referred to as EtherType value) may be 0x0800, 0x86DD, 0x0806, 0x0808, 0x8035.

[0066] When the receiver receives a frame or a packet, the receiver may parse the received frame or packet and checks whether it is correct by checking each header of the frame or packet that required to be checked. For example, when the receiver receives an L2 frame, the receiver may check an 802.3 header carried by the L2 frame. For another, example, when the receiver receives an L3 packet, the receiver may check for an 802.3 header and IP header carried by the L3 packet.

[0067] The header of the first wired frame may further includes a field for carrying address information, and the address information may include a destination MAC address and a source MAC address. The first wired frame may further include an FCS check bit.

[0068] 402, The station determines a second wired frame based on the first wired frame. A header of the second wired frame includes a type field. For convenience, the type field in the first wired frame may be referred to as a first type field, while the type field in the second wired frame may be referred to as a second type field. Similarly, the header of the first wired frame may be referred to as a first header, the header of the second wired frame may be referred to as a second header, a payload of the first wired frame may be referred to as a first payload, and a payload of the second wired frame may be referred to as a second payload.

[0069] The second type field carries a second value, and the second value is configured to indicate that a second protocol is encapsulated in a payload of the second wired frame (that is, the second payload). The second protocol is different from the first protocol. Th second protocol may be a correctness-check-free protocol. When a receiver receives a frame and the frame carries data following the correctness-check-free protocol, the receiver does not have to check the correctness of the received frame. For example, the second protocol may be a protocol operating on the layer 2 (L2). For example, the second protocol may be infiniband over Ethernet, and the secondvalue may be 0x8915. For another example, the second protocol may be ATA over Ethernet (AoE), and the second value may be 0x88A2. For another example, the second protocol may be fiber channel over Ethernet, and the second value may be 0x8906. The second wired frame may further include a reference field, and the reference field carries the first value carried by the first yep field in the header of the first wired frame. Consequently, a length of the reference field may be the same as a length of the first type field. While in some other embodiments, the length of the reference field may be longer than the length of the first type field, and additional bits may be reserved bits.

[0070] In some embodiments, the reference field may be located after the second payload. In some other embodiments, the reference field may be located between the second header and the second payload.

[0071] In some embodiments, the second wired frame may be determined by modifying the first wired frame. For example, a modification performed by the station may include the following steps:

[0072] Step 1, the station extends the first wired frame by the length of the first type field after the payload of the first wired frame. The extended field is the reference field (correspondingly, the reference field may also be referred to as the extended field).

[0073] Step 2, the station copies the first value from the first type field to the reference field.

[0074] Step 3, the station replaces the first value in the first type field with the second value.(0075] The station may obtain the second wired frame after the aforementioned modification is finished. Address information carried by the second wired frame (that is, the destination MAC address and the source MAC address) is the same as the address information carried the first wired frame, and the second payload is the same as the first payload.

[0076] In some embodiments, the FCS check bit in the second wired frame is the same as the FCS check bits in the first wired frame. In some other embodiments, the FCS check bits in the second wired frame may be determined according to the second header and the second payload (that is, all fields of the second frame except the FCS check bit.

[0077] In some embodiments, the aforementioned modification may be performed by an eBPF VM running in a kernel of the station. The eBPF VM is configured to determine the second wired frame according to the first wired frame. In other words, the eBPF VM may be configured to extend the first wired frame by the length of the first type field after the payload of the first wired frame; copy the first value from the first type field to the reference field and replace the first value in the first type field with the second value.|0078] 403, The station determines a third wired frame based on the second wired frame.|0079] For convenience, the header of the third wired frame may be referred to as a third header, a type field in the third header may be referred to as a third type field, and a payload of the third frame may be referred to as a third payload.

[0080] The third header is the same as the second header. In other words, address information carried by the third header is the same as the address information carried by the second header, and a value carried by the third type field is the same as the value carried by the second type field, that is, the third type field carries the second value. Compared with the second wired frame, the third wired frame further includes a first information field and a second information field. The first information field is configured to carry a wireless header. The wireless header may be a header following a wireless protocol. For example, the wireless protocol may be an IEEE 802.11 standard (e.g., IEEE 802.11 a, IEEE 802.11 b, IEEE 802.11 g, IEEE 802.11 n, IEEE 802.11 ac, IEEE 802.11 ax or further IEEE standers). When the wireless header follows the IEEE 802.11 stander, the wireless header may be referred to as an 802.11 header. Correspondingly, when a header of the first wired frame, the second wired frame or the third wired frame follows the 802.3 stander, the header may be referred to as an 802.3 header. The second information field is configured to carries the first value, and a location of the second information field is different from a location of the reference field in the second wired frame. The second information field is located after the first information field. In other words, the second wired frame is extended to obtain the first information field and the second information field. Meanwhile, the reference field located after the payload of the second wired frame is removed, and the first value carried by the reference field is copied into the second formation field.(0081] In some embodiments, the first information field may be located after the third header. Address information carried by the wireless header may be determined according to the third header. For example, address1 in the wireless header may be the same as the destination MAC address carried in the third header, and address2 in the wireless header may be the same as the source MAC address carried in the third header.(0082] In some embodiments, the second information field may carry a logical link control (LLC) header. Address information carried by the LLC header may be the same as the address information carried by the third header. For example, a destination MAC address carried by the LLC header may be the same as the destination MAC address carried by the third header, and a source MAC address carried by the LLC header may be the same as the source MAC address carried by the third header. The LLC header may include a type field, and the type field is configured to carry the first value obtained from the reference field in the second wired frame.]0083] In general, the third wired frame may carry three headers: the third header, the wireless header carried by the first information field, and the LLC header carried by the second information field. However, both thewireless header and the LLC header may be regarded as information carried by the third wired frame, and the third header is the header of the third wired frame.

[0084] In some other embodiments, the second information field may only carry the first value. In other words, a length of the second information field may be the same as the length of the reference field, and the first value may be copied from the reference field to the second reference field.]008S] In some embodiments, the second wired frame may be extended to obtain the first information field carrying the wireless header. The reference field carrying the first value may be retained. In other words, the reference field may be regarded as the second information field.

[0086] Netfilter rules that has to be applied to the bridge in order for NFQ to work. For example:1 nft add table bridge filter2 nft add chain bridge filter postrouting '{type filter hook postrouting priority 0;}'3 nft add rule bridge filter postrouting meta obriport br-065e402d39b6 counter queue num 0 bypass[0087J According to the code, a new table with name “filter” is added to bridge tables, a new chain with name “postrouting” is added to the table “filter”, a hook is configured to hook postrouting chain events. At last, a new rule is added into the chain “postrouting”, and the new added rule is used to process events from the interface with name “br-065e402d39b6”.

[0088] 404, The station transmits the third wired frame. A network device may receive the third wired frame.

[0089] After receiving the third wired frame, the network device may remove the third header. After removing the third header, the wireless header carrying by the first information filed may be regarded as a header of reset parts of the third wired frame. The reset parts of the wired frame form a wireless frame. Therefore, the network device may simulate wireless communication based on the wireless frame. In other words, the third wired frame may be regarded as a wired frame carrying a wireless frame. Similarly, the network device may determine a wired frame similar to the third wired frame and transmits the determined wired frame to an STAtion. For convenience, the station may be referred to as a second station, and the station mentioned in FIG. 4 may be referred to as a first station. In some embodiment, the first station may be the second station. In some other embodiments, the first station and the second station may be different stations. The wired frame determined by the network device may be referred to as a fourth wired frame. Details about how to process the fourth wired frame may refer to FIG. 5.

[0090] FIG. 5 illustrates a communication method according to some embodiments of the present application.(0091] 501, The network device determines the fourth wired frame and transmit the fourth wired frame tothe second station.

[0092] The fourth wired frame may include a header, a first information field, a second information field, a payload. The header of the fourth wired frame (hereinafter referred to as a fourth header) includes a fourth type field carrying a second value. The first information filed carries a wireless header (e.g., an 802.11 header), and the second information field carries a first value. A structure of the fourth wired frame may be the same as the aforementioned third wired frame, the second value may be the same as the second value mentioned in the aforementioned embodiments, and the first value may be the same as the first value mentioned in the aforementioned embodiments.

[0093] Details about the first information field, the second information field, the first value and the second value may refer to the aforementioned embodiments and will not be described here.|0094] 502, The second station determines a fifth wired frame according to the fourth wired frame.

[0095] The fifth wired frame may include a header, a payload, and a reference field. Similarly, the header of the fifth wired frame may be referred to as a fifth header, and a payload of the fifth wired frame may be referred to as a fifth payload. The fifth header may include address information. The address information may include a source MAC address and a destination MAC address. The fifth header may further include a fifth type field. The fifth type field may carry the second value. The reference filed may carry the first value. In some embodiments, the reference field may be located after the fifth payload.]0096] The step 502 may be regarded as an inverse operation of the step 403. For example, the second station may add the reference field after the payload of the fourth wired frame, copy the first value in the second information field into the reference field, and remove the first information field and the second information filed. (0097] Similarly, the NFQ may be configured to process the fourth wired fame to obtain the fifth wired frame.

[0098] 503, The second station determines a sixth wired frame according to the fifth wired frame.

[0099] The step 503 may be regarded as an inverse operation of the step 402. For example, the second station may delete the second value in the fifth type field, copy the first value in the reference field into the fifth type field, and remove the reference field. Similar to the step 402, the step 503 may be performed by the eBPF VM running in the kernel of the second station.

[0100] In some embodiments, the electronic device mentioned in the present application may be real electronic devices. Correspondingly, in some other embodiments, the electronic devices mentioned in the present application may be virtual devices. For example, the station may be an STAtion virtual machine (VM) and the APmay be an AP VM. For another example, the station may be an STAtion container and the AP may be an AP container. In some embodiments, the station container may connect to a bridge by using a virtual ethernet pair. Similarly, the AP container may connect to a bridge by using a virtual ethernet pair. The bridge connecting to the statin container may be referred to as an STAtion bridge or an STA bridge, while the bridge connecting to the AP container may be referred to as an AP bridge.

[0101] FIG. 6 shows a system according to the embodiment of the present application.10102] Referring to FIG. 6, solid lines shows a container transmits a frame. A header of a frame determined by an STA container include a real Ethernet type (real eth type). The eBPF modifies the frame. For example, the eBPF extends the frame and copy the real eth type into the extended filed. Further, the eBPF replace the real eth type in the header with ETH P IBOE (that is 0x8915). The STA bridge obtains the modified frame and makes a further modification. For example, the STA bridge adds a field carrying the 802.11 header and a field carrying a LLC header. The real eth type is copied into the LLC type field in the LLC header. Then the STA bridge removes the extended field carrying the real eth type. At last, the STA bridge transmits the modified frame to the AP bridge, and the AP bridge transmits the modified frame to the AP container. The STA container, the eBPF and the STA bridge may be regarded as different functional module in the STA.]O1O3] Dash lines in FIG. 6 shows a receiving procedure. Referring to FIG. 6, the STA bridge receives a frame includes a wireless header and an LLC header. The STA bridge extends the frame and copies the real eth type carrying by the LLC header to the extended filed. Then, the STA bridge removes the 802.11 header and the LLC header. The STA bridge transmits the modified frame to the STA container. The eBPF obtained the modified frame, copies the real eth type from the extended field into the header. The STA container receives the frame modified by the eBPF.

[0104] Embodiments provided by the present application may be applied to simulate different system architectures. For example, embodiments provided by the present application may be used to simulate a single host architecture illustrated in FIG. 7. Embodiments provided by the present application may be used to simulated a multi host architecture illustrated in FIG. 8.

[0105] The present application provides a lightweight solution for simulating wireless communication. For example, the present application does not doesn’t use a real Linux wireless API which does a lot of work to handle both data and management packets. Technical solutions provided by the present application take tiny amount of time and operating system (OS) resources to process the frames and only involves kernel’s inbuilt network stack features.[0106) Further, the technical solutions provided by the present application are able to dynamically create wireless network nodes without interrupting running. Meanwhile, frames are transparent to applications since frames are decapsulated before reaching an STA then it looks like usual 802.3 frame therefore all the default kernel handlers will be applied to it. For an example, when some AP is pinging an STA, it’s able to send an echo-request with the help of a kernel. Or another example is FTP client running on STA doesn’t has to be in charge of wireless packet decapsulation so we don’t need to rebuild it due to frame is already suitable for the socket running in this application and its processing logic.(0107] Embodiments of the present application further provides a communication method. The communication method includes: receiving a first wired frame, where a header of the fourth wired frame includes a first type field, the fourth type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame, the first wired frame further includes a first information field and a second information field, where the first information field carries a wireless header, and the second information filed carries a second value, the second value corresponds to a second protocol, and the first protocol is different from the second protocol; determining, based on the first wired frame, a second wired frame, where a header of the second wired frame includes a second type field, the second type field carries the first value, the second wired frame further includes a reference field carrying the second value; determining, based on the second wired frame, a third wired frame, where a header of the third wired includes a third type field, the third type field carries the second value, the second protocol is encapsulated in a payload of the third wired frame. The first wired frame may be the fourth wired frame mentioned in FIG. 5, the second wired frame may be the fifth wired frame mentioned in FIG. 5, and the third wired frame may be the sixth wired frame mentioned in FIG. 5.[O1O8[ FIG. 9 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application. Referring to FIG. 9, an electronic device 900 includes a processing module 901 and a transmitting module 901.[O1O9[ The processing module 901 is configured to determine a first wired frame, where a header of the first wired frame includes a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame.

[0110] The processing module 901 is further configured to determine, based on the first wired frame, a second wired frame, where a header of the second wired frame includes a second type field, the second type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the second frame, the second protocol is different from the first protocol, the second wired frame further includesa reference field carrying the first value.|O111] The processing module 901 is further configured to determine, based on the second wired frame, a third wired frame, where a header of the third wired frame is a same as the header of the second wired frame, the third wired frame further includes a first information field and a second information field, where the first information filed carries a wireless header, and the second information field carries the first value.(0112] The transmitting module 902 is configured to transmit the third wired frame.

[0113] The electronic device 900 may be the aforementioned station. The processing module 901 may be a processor (e.g., a general purpose processor). The transmitting module 902 may be a transmitter.10114] Details on how to prepare and transmit the third wired frame may refer to the above-mentioned embodiments and will not be described here.

[0115] FIG. 10 illustrates a schematic block diagram of an electronic device according to some embodiments of the present application. Referring to FIG. 10, an electronic device 1000 includes a receiving module 1001 and a processing module 1002.

[0116] The receiving module 1001 is configured to receive a fourth wired frame, where a header of the fourth wired frame includes a fourth type field, the fourth type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the fourth wired frame, the fourth wired frame further includes a first information field and a second information field, where the first information field carries a wireless header, and the second information filed carries a first value, the first value corresponds to a first protocol, and the first protocol is different from the second protocol.

[0117] The processing module 1002 is configured to determine, based on the fourth wired frame, a fifth wired frame, where a header of the fifth wired frame includes a fifth type field, the fifth type field carries the second value, the fifth wired frame further includes a reference field carrying the first value.

[0118] The processing module 1002 is further configured to determine, based on the fifth wired frame, a sixth wired frame, where a header of the sixth wired includes a sixth type field, the sixth type field carries the first value, the first protocol is encapsulated in a payload of the sixth wired frame.

[0119] The electronic device 1000 may be the aforementioned station. The receiving module 1001 may be a receiver, and the processing module 1002 may be a processor (e.g., a general purpose processor).(0120) Details on how to process the received frame may refer to the above-mentioned embodiments and will not be described here. Similarly, in some embodiments, the fourth wired frame may be referred to as a first wired frame, the fifth wired frame may be referred to as a second wired frame, and the sixth wired frame may bereferred to as a third wired frame.[0121J The present application further provides a signal processing system. The signal processing system may include the electronic device 900 and the decoding device 1000.

[0122] In some embodiments, an electronic device may include the signal processing system. In other words, the electronic device may include the electronic device 900 and the decoding device 1000. In this situation, the electronic device 900 and the decoding device 1000 may be regarded as two modules of the electronic device. The processing module 901 and the processing module 1002 may be performed by one or more processors of the electronic device.

[0123] The system may further include a network device. The network device receives the third wired frame and transmits the fourth wired frame.(O124[ For example, as shown in FIG. 11, an electronic device 1100 may include a processor 1101, a transmitter 1102, a memory 1103 and a receiver 1104. The memory 1103 may be configured to store code, instructions, and the like executed by the processor 1101.[0i2S[ The processor 1101 reads information and instructions in the memory 1103 and completes the steps of the foregoing methods. For example, the processor 1101 may be perform steps performed by the processing module 901, the processing module 1001. For example, the processor 1101 may be configured to determine the second wired frame and the third wired frame, and determine the fifth wired frame and the sixth wired frame.[O126[ In some embodiments, the electronic device 1100 may be the station illustrated in FIG. 1. The station may be a mobile phone, a tablet computer, a notebook computer, an augmented reality (AR) device, a virtual reality (VR) device, a digital camera, a digital video camcorder, an action camera, a security camera or the like.[O127[ For example, as shown in FIG. 12, an electronic device 1200 may include a processor 1201, a transmitter 1202, a memory 1203. The memory 1203 may be configured to store code, instructions, and the like executed by the processor 1201.[O128[ The processor 1201 reads information and instructions in the memory 1203 and completes the steps of the foregoing methods. For example, the processor 1201 may be perform steps performed by the processing module 901. For example, the processor 1201 may be configured to determine the second wired frame and the third wired frame.

[0129] The transmitter 1202 may be configured to transmit the third wired frame to a network device, e.g., an AP.[0130[ For example, as shown in FIG. 13, an electronic device 1300 may include a processor 1301, a receiver1302, a memory 1303. The memory 1303 may be configured to store code, instructions, and the like executed by the processor 1301.

[0131] The processor 1301 reads information and instructions in the memory 1303 and completes the steps of the foregoing methods. For example, the processor 1301 may be perform steps performed by the processing module 1002. For example, the processor 1301 may be configured to determine the fifth wired frame and the sixth wired frame.

[0132] The receiver 1202 may be configured to receive the fourth wired frame from a network device, e.g., an AP.

[0133] The processor described this specification may be an integrated circuit chip and has a signal processing capability. In an implementation process, steps of the foregoing method embodiments may be completed by using a hardware integrated logic circuit in the processor, or by using instructions in a form of software. The processor may be a general purpose processor, a central processing unit (CPU), a system on chip (SoC) or another programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The processor may implement or perform the methods, the steps, and the logical block diagrams that are disclosed in the embodiments of the present application. The general purpose processor may be a microprocessor, or the processor may be any conventional processor or the like. The steps of the methods disclosed with reference to the embodiments of the present application may be directly performed and completed by the processor, or may be performed and completed by using a combination of hardware in the processor and a software module. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor reads information in the memory and completes the steps of the foregoing methods in combination with hardware in the processor.

[0134] It may be understood that the memory described this specification may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM) and is used as an external cache. By way of example rather than limitation, many forms of RAMs may be used, and are, for example, a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory(SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DR RAM).

[0135] The present application provides a computer readable storage medium including instructions. When the instructions run on an electronic device, the electronic device is enabled to perform the aforementioned method. ]O136] The present application provides a chip system. The chip system includes a memory and a processor, and the memory is configured to store a computer program, and the processor is configured to invoke the computer program from the memory and run the computer program, so that an electronic device on which the chip system is disposed performs the aforementioned method.(0137] The present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device is enabled to perform the aforementioned method.

[0138] The terms such as "first" and "second" mentioned in the specification are merely for a descriptive purpose, and cannot be understood as indicating or implying relative importance, or implicitly indicating a quantity of indicated technical features. Therefore, the features defined by "first" and "second" can explicitly or implicitly include one or more features.]O139] In the embodiments of the present application, “at least one” means one or more, and “a plurality of’ means two or more. The term “and / or” describes an association relationship between associated objects and represents that three relationships may exist. For example, A and / or B may represent the following three cases: only A exists, both A and B exist, and only B exists, where A and B may be singular or plural. The character “I” generally indicates an “or” relationship between the associated objects. “At least one of the following” and a similar expression thereof refer to any combination of these items, including any combination of one item or a plurality of items. For example, at least one of a, b, and c may indicate: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c may be singular or plural.|O14O] A person of ordinary skill in the art may be aware that, in combination with the examples described in the embodiments disclosed in this specification, units and algorithm steps can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this application.(0141] It may be clearly understood by a person skilled in the art that, for the purpose of convenient andbrief description, for a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiment. Details are not described herein again.[O142| In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, the unit division is merely logical function division and may be other division in actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.

[0143] The units described as separate parts may be or may not be physically separate, and parts displayed as units may be or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.[0144[ In addition, functional units in the embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.

[0145] When the functions are implemented in a form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer readable storage medium. Based on such an understanding, the technical solutions in this application essentially, or the part contributing to the prior art, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for instructing a computer device (which may be a personal computer, a server, a network device, or the like) to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes: any medium that can store program code, such as a USB flash drive, a removable hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disc. The foregoing descriptions are merely specific implementations of this application, but are not intended to limit the protection scope of this application. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims

CLAIMSWhat is claimed is:

1. A communication method, wherein comprising: determining a first wired frame, wherein a header of the first wired frame comprises a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame; determining, based on the first wired frame, a second wired frame, wherein a header of the second wired frame comprises a second type field, the second type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the second frame, the second protocol is different from the first protocol, the second wired frame further comprises a reference field carrying the first value; determining, based on the second wired frame, a third wired frame, wherein a header of the third wired frame is a same as the header of the second wired frame, the third wired frame further comprises a first information field and a second information field, wherein the first information filed carries a wireless header, and the second information field carries the first value; transmitting the third wired frame.

2. The method according to claim 1, wherein the determining, based on the first wired frame, a second wired frame, comprises: determining the reference field, wherein a length of the reference field is a same as a length of the first type field; copying the first value in the first type field into the reference field; replacing the first value in the first type field with the second value.

3. The method according to claim 1 or 2, wherein the reference field is located after a payload of the second wired frame.

4. The method according to any one of claims 1 to 3, wherein the first information field is located after the header of the third wired frame, the second information filed is located after the first information field, and a payload of the third wired frame is located after the second information field.

5. A communication method, wherein comprising: receiving a first wired frame, wherein a header of the fourth wired frame comprises a first type field, thefourth type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame, the first wired frame further comprises a first information field and a second information field, wherein the first information field carries a wireless header, and the second information filed carries a second value, the second value corresponds to a second protocol, and the first protocol is different from the second protocol; determining, based on the first wired frame, a second wired frame, wherein a header of the second wired frame comprises a second type field, the second type field carries the first value, the second wired frame further comprises a reference field carrying the second value; determining, based on the second wired frame, a third wired frame, wherein a header of the third wired comprises a third type field, the third type field carries the second value, the second protocol is encapsulated in a payload of the third wired frame.

6. The method according to claim 5, wherein the determining, based on the second wired frame, a third wired frame, comprises: removing the second value in the second type field; copying the second value in the reference field into the second type field; removing the reference field.

7. The method according to claim 5 or 6, wherein the reference field is located after a payload of the second wired frame.

8. The method according to any one of claims 5 to 7, wherein the first information field is located after the header of the first wired frame, the second information filed is located after the first information field, and a payload of the first wired frame is located after the second information field.

9. An electronic device, wherein comprising: a processing module, configured to determine a first wired frame, wherein a header of the first wired frame comprises a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame; the processing module, further configured to determine, based on the first wired frame, a second wired frame, wherein a header of the second wired frame comprises a second type field, the second type field carries a second value, the second value is configured to indicate a second protocol is encapsulated in a payload of the second frame, the second protocol is different from the first protocol, the second wired frame further comprises a reference field carrying the first value;the processing module, further configured to determine, based on the second wired frame, a third wired frame, wherein a header of the third wired frame is a same as the header of the second wired frame, the third wired frame further comprises a first information field and a second information field, wherein the first information filed carries a wireless header, and the second information field carries the first value; a transmitting module, configured to transmit the third wired frame.

10. The electronic device according to claim 9, wherein the processing module is specifically configured to: determine the reference field, wherein a length of the reference field is a same as a length of the first type field; copy the first value in the first type field into the reference field; replace the first value in the first type field with the second value.

11. The electronic device according to claim 9 or 10, wherein the reference field is located after a payload of the second wired frame.

12. The electronic device according to any one of claims 9 to 11, wherein the first information field is located after the header of the third wired frame, the second information filed is located after the first information field, and a payload of the third wired frame is located after the second information field.

13. An electronic device, wherein comprising: a receiving module, configured to receive a first wired frame, wherein a header of the first wired frame comprises a first type field, the first type field carries a first value, the first value is configured to indicate a first protocol is encapsulated in a payload of the first wired frame, the first wired frame further comprises a first information field and a second information field, wherein the first information field carries a wireless header, and the second information filed carries a second value, the second value corresponds to a second protocol, and the first protocol is different from the second protocol; a processing module, configured to determine, based on the first wired frame, a second wired frame, wherein a header of the second wired frame comprises a second type field, the second type field carries the first value, the second wired frame further comprises a reference field carrying the second value; the processing module, further configured to determine, based on the second wired frame, a third wired frame, wherein a header of the third wired comprises a third type field, the third type field carries the second value, the second protocol is encapsulated in a payload of the third wired frame.

14. The electronic device according to claim 13, wherein the processing module is specifically configured to: remove the first value in the second type field;copy the second value in the reference field into the second type field; remove the reference field.

15. The electronic device according to claim 13 or 14, wherein the reference field is located after a payload of the second wired frame.

16. The electronic device according to any one of claims 13 to 15, wherein the first information field is located after the header of the first wired frame, the second information filed is located after the first information field, and a payload of the first wired frame is located after the second information field.

Citation Information

Patent Citations

  • WLAN Testing Using an RF Abstraction Layer

    US20200162188A1

  • Ethernet frame transmission method and communications device

    US20210344441A1