Intelligent Game Acceleration System and Method Based on Virtual LAN Networking

By intercepting game data packets at the operating system kernel level and encapsulating the tunnel protocol using the TAP virtual network card, the problems of Layer 2 broadcast communication and game data optimization in the public network environment are solved, realizing a cross-regional low-latency virtual LAN that supports multi-platform game online play.

CN123123072APending Publication Date: 2026-11-17SICHUAN XUNYOU NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611283845.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies cannot efficiently support raw Layer 2 broadcast communication in a public network environment, and lack game data optimization capabilities, resulting in high latency and complex configuration for online games, which cannot meet the needs of cross-regional LAN games.

Method used

The system intercepts network data packets from the game process at the operating system kernel level, extracts Layer 2 Ethernet frame information, encapsulates it into a tunnel protocol format through a TAP virtual network card, establishes an encrypted tunnel, and performs Layer 2 forwarding on the server side, thus building a virtual switch to achieve a low-latency virtual LAN.

Benefits of technology

It achieves low latency and high compatibility across regions, supports cross-regional online gaming for traditional LAN games, avoids the additional latency caused by public network routing, maintains the original Layer 2 frame structure through transparent transmission, and is suitable for Windows, macOS, and Linux platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123072A_ABST
    Figure CN123123072A_ABST
Patent Text Reader

Abstract

This invention relates to the field of local area network (LAN) networking technology, and provides an intelligent game acceleration system and method based on virtual LAN networking. The system includes: a client data acquisition subsystem that captures raw network data packets generated by a specified game process, extracts Layer 2 Ethernet frame information, and transmits the captured Layer 2 Ethernet frame information to a client virtual LAN subsystem; the client virtual LAN subsystem receives the Ethernet frame information, encapsulates it into a tunnel protocol format for transmission over the public network, and establishes an encrypted tunnel with a remote node; it is also responsible for creating TAP virtual network cards, allocating virtual IP and MAC addresses, and maintaining the tunnel connection status; and an acceleration node virtual network subsystem decapsulates the data, restoring it to the original Layer 2 Ethernet frame information, and injects it into a virtual switch. This invention provides a low-latency communication environment similar to a local area network for multiplayer games.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of local area network (LAN) technology, and in particular to an intelligent game acceleration system and method based on virtual local area network (VLAN) networking. Background Technology

[0002] Currently, the virtual LAN and game acceleration fields mainly rely on VPN, SD-WAN, or Overlay Network technologies. Their goal is to achieve virtual link connections on public networks through software, enabling communication within the same network. Several common solutions exist among existing publicly available technologies and products.

[0003] Traditional VPN technologies, such as OpenVPN, WireGuard, and SoftEther, establish a virtual Layer 3 network at both ends of the communication through tunnel encapsulation and virtual network devices, assigning virtual IP addresses to users. Primarily geared towards enterprise-level secure transmission scenarios, they are not optimized for game communication and lack Layer 2 broadcast forwarding capabilities, causing many LAN games that rely on UDP broadcasts to fail to automatically discover hosts. Furthermore, traditional VPNs are complex to configure, difficult for ordinary players to deploy, and all data must be forwarded through a central server, resulting in high latency.

[0004] Virtual LAN software, such as LogMeInHamachi and ZeroTier, registers node information through a control server, automatically assigns virtual network segments, and establishes a network. Hamachi employs a centralized relay architecture, preventing direct connections between nodes and resulting in generally high latency. While ZeroTier supports point-to-point communication, its protocol is based on Layer 3 routing, making it unable to fully forward raw Layer 2 broadcast frames. For broadcast packets, ZeroTier uses a pseudo-broadcast method, converting broadcasts into multiple unicasts for separate transmission, rather than a true Layer 2 broadcast. This causes many older games to fail to discover the host; as the number of nodes increases, the conversion of broadcast packets into numerous unicasts can easily trigger broadcast storms, impacting performance. Furthermore, ZeroTier's NAT traversal mechanism is unstable in mobile networks or multi-layer NAT environments and lacks optimizations for game data, such as data compression, forward error correction, and latency prediction; once a node cannot connect directly and falls back to a relay, latency increases significantly.

[0005] Game accelerator products accelerate public network communication for specific games through globally distributed relay nodes, but they only support specific games and their servers. They cannot be used for games that traditionally support LAN mode, nor do they support peer-to-peer virtual connections or virtual IP networking. Their communication logic is application-layer proxy, and they cannot build virtual LANs at the operating system level. In other related research and open-source solutions, some projects, such as SoftEther's L2TPv3 and Pritunl, attempt to implement virtual networks based on P2P, but these are mainly aimed at enterprise interconnection or remote access and are not optimized for game broadcasting. Some research has proposed using WebRTCDataChannel for P2P game connections; however, this solution cannot encapsulate raw Ethernet frames and still does not meet the complete requirements of a virtual LAN.

[0006] Among the aforementioned technologies, ZeroTier's SD-WANOverlayMesh virtual network solution is closest to this invention. This solution constructs a Layer 3 virtual overlay network over the public network. Nodes obtain routing information through a control server and attempt to establish point-to-point UDP channels, automatically assigning virtual IPs and using P2PNAT for hole punching. However, its core drawbacks are: it only supports Layer 3 communication; its pseudo-broadcast processing of broadcast packets is not equivalent to the original Layer 2 broadcast, resulting in many games that rely on real broadcasts being unable to discover the host; broadcast packet storms severely impact performance when there are many nodes; it lacks acceleration optimization for game data streams; its penetration success rate is low in symmetric NAT environments; and its routing path is uncontrollable, with latency significantly increasing once it falls back to a relay node. In summary, there is currently no existing virtual LAN solution that can efficiently support original Layer 2 broadcast communication in a public network environment, while also possessing game data optimization capabilities and being easy to deploy. This invention aims to address these shortcomings. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention provides an intelligent game acceleration system based on virtual local area network (VLAN) architecture, comprising: The client data acquisition subsystem runs in the kernel layer of the user's operating system and is used to capture raw network data packets generated by a specified game process and extract the Layer 2 Ethernet frame information from them. The client-side virtual LAN subsystem, based on the TAP virtual Ethernet card, is used to receive Ethernet frame information, encapsulate it into a tunnel protocol format for transmission over the public network, establish an encrypted tunnel with the remote node, and is also responsible for creating TAP virtual network cards, allocating virtual IP and MAC addresses, and maintaining the connection status of the tunnel. The acceleration node virtual network subsystem is used to create TAP network cards on server nodes and bridge them with virtual switches. It receives data from encrypted tunnels of various clients, decapsulates the data and restores it to the original Layer 2 Ethernet frame information, and injects it into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that data frames from different clients are aggregated into a unified Layer 2 network environment on the server.

[0008] Optional, a client-side data acquisition subsystem includes: The process name acquisition component is used to attach hook functions to the network card driver queue layer of the kernel network sending path. It obtains the task_struct of the current process and compares it with the process name with the pre-registered game process name table. If a match is found, without modifying the original data packet processing flow, it copies the original binary content of the data packet, including the complete Layer 2 Ethernet frame header to the frame tail, to the independent lock-free circular buffer of each CPU using DMA memory cloning. The data stripping component is used to start a dedicated kernel thread to retrieve cloned data packets in batches from the circular buffer. Based on the destination MAC address, Ethernet type field, and UDP port range of the data packets, it automatically determines whether it is an ARP request, a 255.255.255.255 broadcast, or a 224.0.0.x multicast. It strips the complete Layer 2 Ethernet frame information from the data packets, including the source MAC address, destination MAC address, VLAN tag, payload type, and broadcast flag, and fills in the placeholder fields for the frame check sequence. The information packaging and push component is used to package the stripped Layer 2 Ethernet frame information with the current game process PID, virtual network card channel ID and hardware timestamp into a collection unit. It asynchronously notifies the client's virtual LAN subsystem through eventfd and pushes the collection unit directly to the receive buffer through the kernel zero-copy splice method, thus completing the delivery from the original data packet to the usable Layer 2 Ethernet frame information.

[0009] Optional, information injection component, including: The data injection subcomponent is used to receive the raw Layer 2 Ethernet frames captured by the client data acquisition subsystem from the driver layer, and directly pass the raw Layer 2 Ethernet frames as the injection data source to the injectFrame call entry point of the TAP virtual network card to obtain the driver-level frame data to be injected. The send trigger subcomponent is used to write driver-level frame data into the send queue of the TAP virtual network card through the InjectFrame interface, triggering the TAP device to simulate the frame sending process of the real network card, so that the driver-level frame is received by the operating system network stack in the form of being sent from the local physical network card, and the Ethernet frame output by the TAP network card is obtained. The task delivery sub-component is used by the TAP network card to deliver the output Ethernet frames to the upper-layer game virtual LAN module. In the game process, the Ethernet frame is equivalent to the LAN frame sent by other physical nodes in the same broadcast domain, completing the conversion from driver-captured frame to LAN frame visible to the game.

[0010] Optional, send trigger child component, including: The instance binding module is used to write driver-level frame data into the TAP virtual network card's transmission queue, trigger the TAP driver's simulation routine for handling transmission interruptions with the physical network card, retrieve frame data from the transmission queue and bind it to the TAP device instance, generating a packet object to be injected containing a complete Layer 2 frame, device pointer and receive timestamp; The forced marking module is used to call the receive function of the kernel network subsystem, such as netif_rx or netif_receive_skb, to pass the data packet object to be injected into the network protocol stack's receive processing flow; at the same time, it sets the receiving device of the data packet to the TAP virtual network card, clears all flag bits from the external network, forces the data packet to be received by the local interface, and obtains the internal frame that has entered the protocol stack's receive queue. The technology update module is used by the protocol stack to perform standard link layer reception processing based on the receiving device information of the internal frame, such as device type (Ethernet), device status (UP), and device MAC address: updating the virtual network card's reception statistics counter, extracting the Ethernet type field, and delivering the internal frame to the corresponding upper-layer protocol module, so that the operating system completely recognizes that the source of the internal frame is the same as the frame sent from the local physical network card, thus completing the simulation and authentication of the frame source.

[0011] Optional, the forced tagging module includes: The mask generation submodule is used to extract the flag fields carried by the data packet object to be injected; and generate the corresponding flag clearing mask according to the game type of the current game process to obtain the set of flags to be cleared. The item-by-item clearing submodule is used to perform item-by-item clearing operations on packet objects according to the clearing mask, and obtain the internal frame with cleared external flags; The local generation module is used to fix the receiving device pointer of the internal frame with the external flags removed to the TAP virtual network card and set the local generation bit in the flag, so that the kernel protocol stack can skip all external network-related policies during processing and complete the purification and delivery from the data packet to be injected to a fully localized frame.

[0012] Optional, the accelerated node virtual network subsystem includes: The header removal component receives tunneled data packets from the encrypted tunnels of each client, removes the tunnel encapsulation header from each data packet and decrypts it to restore the original Layer 2 Ethernet frame, which contains game broadcast packets, ARP requests or unicast data frames; the original frame is written into the receive queue of the TAP virtual network card uniquely corresponding to the client to obtain the game Layer 2 frame injected with TAP. The Layer 2 forwarding component is used to add multiple TAP virtual network cards corresponding to different clients to the same virtual switch. The virtual switch performs MAC address learning and Layer 2 forwarding: when a game Layer 2 frame is received from any TAP network card, the switching table is looked up according to the destination MAC address in the frame. If it is a destination broadcast or an unknown unicast, it is flooded to all TAP network cards except the receiving port. If it is a known unicast, it is forwarded only to the TAP network card corresponding to the target client, and the game frame is output to the target TAP network card after bridge switching. The encryption and encapsulation component is used to read game frames to be forwarded from the transmission queue of the TAP network card corresponding to the target client, use the game frames as tunnel payload, add a tunnel encapsulation header containing the target client identifier, sequence number and timestamp, and perform encryption and encapsulation; send the encapsulated data packets to the public network address of the target client through the UDP tunnel, and complete the accelerated forwarding of game frames from the server bridge to the remote client.

[0013] Optional, Layer 2 forwarding component, including: The key-value pair generation subcomponent is used to extract the destination MAC address from the received game Layer 2 frames, and at the same time read the source MAC address, ingress port TAP number and game process type identifier of the frame to generate MAC query key-value pairs carrying game acceleration priority. The matching result output subcomponent is used to perform a lookup in the dynamic MAC address table of the virtual switch using MAC query key-value pairs as an index, and obtain matching results with acceleration information. The forwarding subcomponent determines the forwarding strategy based on the matching results and the game process type identifier, completing the conversion from MAC lookup to game acceleration forwarding decision.

[0014] Optionally, if there is no match in the matching result output sub-component, a short-term aging temporary mapping is automatically created based on the game process type identifier. If there is a match, the corresponding outgoing port and its current tunnel congestion level are retrieved together to obtain the matching result with acceleration information.

[0015] Optionally, if the destination MAC address is a broadcast address or the congestion level of the matching result's outgoing port exceeds the threshold, the forwarding subcomponent will perform accelerated flooding to all TAP ports except the incoming port, prioritizing sending the copy to the tunnel with the lowest congestion; if it is a known unicast and the congestion level meets the threshold, it will only forward to the corresponding outgoing port.

[0016] This invention provides an intelligent game acceleration method based on virtual local area network (VLAN) networking, comprising the following steps: Running at the user operating system kernel level, it is used to capture raw network data packets generated by a specified game process, extract the Layer 2 Ethernet frame information, and pass the captured Layer 2 Ethernet frame information to the client's virtual LAN subsystem. Based on the TAP virtual Ethernet card, it receives Ethernet frame information, encapsulates it into a tunnel protocol format for transmission over the public network, establishes an encrypted tunnel with the remote node, and is also responsible for creating TAP virtual network cards, allocating virtual IP and MAC addresses, and maintaining the connection status of the tunnel. A TAP network interface card is created on the server node and bridged with the virtual switch to receive data from the encrypted tunnels of each client. The data is decapsulated and restored to the original Layer 2 Ethernet frame information, which is then injected into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that the data frames of different clients are aggregated into a unified Layer 2 network environment on the server.

[0017] This invention intercepts network packets from game processes at the operating system kernel level, directly obtaining raw Layer 2 Ethernet frame information to achieve accurate identification and capture of game traffic. It avoids the protocol parsing overhead of traditional application-layer packet capture, ensuring that all game-related data, including ARP requests, UDP broadcasts, and other low-level protocol traffic, are fully acquired. A tunnel system built using TAP virtual network cards completely encapsulates the Layer 2 network data of game communication into a tunnel protocol that can be transmitted over the public network. By maintaining the mapping relationship between virtual MAC addresses and IP addresses, it reproduces LAN communication characteristics in a WAN environment, making the game client's network environment appear as a direct Layer 2 interconnection. The server uses a virtual switch to achieve unified forwarding of Layer 2 traffic from multiple clients, forming a logically single broadcast domain. This allows geographically dispersed clients to form a virtual LAN on the server node, with game traffic undergoing MAC layer switching on the server, avoiding the additional latency caused by public network routing. The system fully maintains the original Layer 2 frame structure, including Ethernet headers, ARP, and other underlying protocol data; the transparent transmission mechanism ensures that the network protocol stacks of the game client and server do not need to be modified, and various game communications that rely on LAN characteristics, such as LAN discovery and broadcast messages, can operate normally; it replaces public network routing paths with encrypted tunnels, avoiding multi-hop forwarding and complex routing decisions in traditional network transmission; the Layer 2 forwarding mechanism of the server-side virtual switch ensures that the communication latency between game clients depends only on the quality of the single-hop network to the server.

[0018] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.

[0019] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a block diagram of the intelligent game acceleration system based on virtual local area network in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the intelligent game acceleration system based on virtual local area network in Embodiment 1 of the present invention; Figure 3 This is a block diagram of the client data acquisition subsystem in Embodiment 2 of the present invention; Figure 4 This is a block diagram of the client virtual LAN subsystem in Embodiment 4 of the present invention; Figure 5 This is a block diagram of the accelerated node virtual network subsystem in Embodiment 7 of the present invention; Figure 6 This is a flowchart of the intelligent game acceleration method based on virtual local area network in Embodiment 9 of the present invention. Detailed Implementation

[0021] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0022] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the embodiments of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0023] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application. In the description of this application, it should be understood that the terms "first," "second," "third," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence, nor should they be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0024] This invention belongs to the field of computer network communication and VPN acceleration, and relates to an intelligent game acceleration system and method based on Virtual LAN (VLAN) networking. It enables multiple users in different public or private network environments to establish a stable, low-latency virtual LAN without the need for public IP addresses or complex network configurations, thereby enabling cross-regional online gaming for traditional LAN games such as Red Alert, CS 1.6, Age of Empires, and StarCraft.

[0025] This invention is applicable to scenarios where users across different regions build virtual local area networks (VLANs) for online gaming. For example, user A is on a home broadband connection and user B is on a company Wi-Fi connection; they are typically in different NAT environments and cannot directly use VLAN mode for online gaming such as Red Alert, Counter-Strike, and StarCraft. The system of this invention consists of a client, a control server, and acceleration relay nodes. Through mechanisms such as automatic NAT detection, encrypted tunnel establishment, and P2P priority scheduling, it creates a virtual network between users that is logically completely equivalent to a real VLAN. The virtual network can assign virtual IPs to each player, such as the 192.168.250.x network segment, supports VLAN Layer 2 broadcast, including ARP and UDP broadcast, provides high-throughput, low-latency data tunnels, and is compatible with various game processes on Windows, macOS, and Linux platforms. All network preparation is completed automatically without manual configuration by the user. Scenarios supported by this invention include, but are not limited to, online gaming, virtual departmental office networks, and cross-regional access to home NAS.

[0026] Example 1: As Figure 1 As shown, this embodiment of the invention provides an intelligent game acceleration system based on virtual local area network (VLAN) networking, comprising: The client data acquisition subsystem runs at the user operating system kernel layer. It is used to capture raw network data packets generated by a specified game process, extract the Layer 2 Ethernet frame information, and pass the captured Layer 2 Ethernet frame information to the client virtual LAN subsystem. The Layer 2 Ethernet frame information includes the Ethernet header, ARP request, UDP broadcast, etc. The client-side virtual LAN subsystem, based on the TAP virtual Ethernet card, is used to receive Ethernet frame information, encapsulate it into a tunnel protocol format for transmission over the public network, establish an encrypted tunnel with the remote node, and is also responsible for creating TAP virtual network cards, allocating virtual IP and MAC addresses, and maintaining the connection status of the tunnel. The acceleration node virtual network subsystem is used to create TAP network cards on server nodes and bridge them with virtual switches. It receives data from encrypted tunnels of various clients, decapsulates the data and restores it to the original Layer 2 Ethernet frame information, and injects it into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that data frames from different clients are aggregated into a unified Layer 2 network environment on the server.

[0027] In this context, the operating system kernel layer refers to the highest-level runtime within the user's operating system, closest to the hardware. Traditional network packets, when captured at the application layer, have often undergone layers of protocol stack parsing, losing the underlying Ethernet frame header information. This embodiment places the data acquisition module at the kernel layer, allowing for direct interception of packets before they enter the protocol stack or immediately after leaving the network card driver, thus obtaining unmodified raw network packets. Raw network packets refer to complete binary data read directly from the network card driver, without protocol stack stripping, containing all encapsulation information starting from the Ethernet header. Layer 2 Ethernet frame information is a crucial component of the raw packet, including the Ethernet header, source MAC address, destination MAC address, type field; ARP request; UDP broadcast with a destination address of 255.255.255.255; and multicast addresses within the 224.0.0.x range. This information is the core carrier for LAN games to achieve host discovery and session establishment. For example, Red Alert or CS 1.6 rely on broadcast packets to find other players in the same LAN. Only by completely preserving the Layer 2 Ethernet frame information can a communication environment completely consistent with the original LAN be restored at the remote end. In order to transmit Layer 2 frame information across the public network, this embodiment adopts the tunneling protocol format. The tunneling protocol format is a method that uses the original Ethernet frame as the payload and adds additional encapsulation headers, such as encryption information, serial numbers, target node identifiers, etc., so that it can be routed or forwarded to the other end of the public network. The encapsulated data packet is transmitted on the public Internet and is decapsulated and restored to the original Layer 2 Ethernet frame after arriving at the other party. The core device for achieving this tunnel encapsulation and decapsulation is the TAP virtual network interface card. The TAP virtual network interface card simulates a standard Ethernet interface in the operating system, operating at the data link layer or Layer 2, capable of sending and receiving complete Ethernet frames. Unlike the TUN device, which only processes IP packets, the TAP device can receive and send all Layer 2 frames, including broadcast and multicast. In this embodiment, after creating a virtual network interface card on the client using the TAP device, the game process sees it as a real physical network interface card. ARP requests and UDP broadcasts sent by the game are passed to the TAP device intact, then encapsulated and sent into the tunnel. To ensure each client has a unique identifier in the virtual LAN, the system assigns it a virtual IP and MAC address. The virtual IP address, such as the 192.168.250.x network segment, is used for addressing in the upper-layer protocol stack, while the virtual MAC address is used for MAC table learning and forwarding in the Layer 2 switch. These two addresses form the basis for simulating a physical LAN, ensuring that multiple clients can be recognized and communicate with each other in the server's virtual switch as if they were real devices.In addition, the system also needs to maintain the connection status of the tunnel. After the tunnel is established, the network environment may change, such as NAT mapping failure, IP address change, network congestion, etc. Maintaining the connection status of the tunnel includes periodically sending keep-alive messages, monitoring the reachability of the peer, handling reconnection requests, and automatically switching to the relay node when a direct connection cannot be established; to ensure that the tunnel will not be interrupted due to temporary network fluctuations during the game, thereby affecting the online experience. Ultimately, all client Layer 2 frames are aggregated into the server's Layer 2 network environment. This Layer 2 network environment is a logical area consisting of a virtual switch and multiple TAP interfaces. This environment forwards frames solely based on MAC addresses, without involving IP routing. The server's virtual switch simulates the behavior of a physical switch, capable of broadcasting, flooding, and learning MAC addresses, thereby connecting clients in different physical locations into a unified broadcast domain. In this Layer 2 network environment, a broadcast packet sent by one client is copied by the switch and sent to all other clients. Game host discovery, session creation, and data transmission are completely consistent with a real LAN. Through a full-link design from kernel capture, TAP encapsulation, tunnel transmission to server-side Layer 2 switching, the core goal of accelerating intelligent games is achieved: reconstructing a low-latency, highly compatible, and configuration-free virtual LAN on the public internet, enabling traditional LAN games to connect smoothly across regions.

[0028] The working principle and beneficial effects of the above technical solution are as follows: The specific principle is as follows: Figure 2 As shown, this embodiment intercepts network data packets from the game process at the operating system kernel layer, directly obtaining raw Layer 2 Ethernet frame information to achieve accurate identification and capture of game traffic. It avoids the protocol parsing overhead of traditional application-layer packet capture, ensuring that all game-related data, including ARP requests, UDP broadcasts, and other low-level protocol traffic, are completely acquired. A tunnel system built using a TAP virtual network interface card completely encapsulates the Layer 2 network data of game communication into a tunnel protocol that can be transmitted over the public network. By maintaining the mapping relationship between virtual MAC addresses and IP addresses, it reproduces the characteristics of LAN communication in a WAN environment, making the game client's network environment appear as a direct Layer 2 interconnection. The server uses a virtual switch to achieve unified forwarding of Layer 2 traffic from multiple clients, forming a logically single broadcast domain. This allows geographically dispersed clients to form a virtual LAN on the server node, with game traffic undergoing MAC layer switching on the server, avoiding the additional latency caused by public network routing. The system fully maintains the original Layer 2 frame structure, including Ethernet headers, ARP, and other underlying protocol data; the transparent transmission mechanism ensures that the network protocol stacks of the game client and server do not need to be modified, and various game communications that rely on LAN characteristics, such as LAN discovery and broadcast messages, can operate normally; it replaces public network routing paths with encrypted tunnels, avoiding multi-hop forwarding and complex routing decisions in traditional network transmission; the Layer 2 forwarding mechanism of the server-side virtual switch ensures that the communication latency between game clients depends only on the quality of the single-hop network to the server.

[0029] In summary, this embodiment constructs a virtual Layer 2 network overlaid on the physical network. Through transparent tunneling transmission and centralized switching of underlying network traffic, it provides a low-latency communication environment similar to a local area network for multiplayer games. It retains all the characteristics of local area network communication while utilizing the network advantages of server nodes to achieve transmission optimization.

[0030] This embodiment is a cross-regional virtual LAN system based on driver-layer data capture, TAP virtual network card and node-end TAP-Bridge networking, which enables multiple users to establish the same Layer 2 network in different network environments, so that LAN games can be interconnected as in a real LAN environment.

[0031] Traditional solutions cannot transparently transmit Layer 2 broadcasts and ARP messages, which are precisely the core communication mechanisms for LAN game connections. This embodiment solves these technical problems by introducing a TAP device. Specifically, Layer 2 broadcasts, including Ethernet frames, ARP requests, UDP broadcasts to 255.255.255.255 and 224.0.0.x multicast addresses, cannot be transmitted across networks on the public internet. This embodiment completely restores these frames as real Ethernet frames at the remote end, a capability only the TAP device can provide. In contrast, Layer 3 VPN or virtual network solutions, such as OpenVPN and ZeroTier in TUN mode, can only handle IP packets and cannot handle Layer 2 frames, resulting in many older games being unable to discover the host. Only TAP can achieve completely transparent Layer 2 frame forwarding, behaving identically to a real switch, without requiring modification to the game program or manual port configuration by the user. Furthermore, ordinary users often find it difficult to configure TAP bridging themselves; this embodiment provides an automated TAP control mechanism, eliminating the need for users to install additional drivers or perform bridging configuration. In summary, this embodiment effectively solves the above problems through TAP technology, making it possible to play LAN games across public networks.

[0032] Example 2: As Figure 3 As shown, based on Embodiment 1, the client data acquisition subsystem provided in this embodiment of the invention includes: The process name acquisition component is used to attach hooks to the sending system call path, retrieve the process name and PID from the current process's task_struct, and compare them with the pre-registered game process name table; if a match is found, a virtual network card channel ID is allocated to the skb to be sent, the PID and channel ID are stored in the skb control block cb, and a collection flag is set; the flag is checked at the network card driver queue layer, and without modifying the original data packet processing flow, the original binary content of the data packet is copied to an independent lockless circular buffer for each CPU using DMA memory cloning, while the PID and channel ID are read from skb->cb and stored in the buffer metadata along with the hardware timestamp; The data stripping component is used to start a dedicated kernel thread to retrieve cloned data packets in batches from the circular buffer. Based on the destination MAC address, Ethernet type field, and UDP port range of the data packets, it automatically determines whether it is an ARP request, a 255.255.255.255 broadcast, or a 224.0.0.x multicast. It strips the complete Layer 2 Ethernet frame information from the data packets, including the source MAC address, destination MAC address, VLAN tag, payload type, and broadcast flag, and fills in the placeholder fields for the frame check sequence. The information packaging and push component is used to package the stripped Layer 2 Ethernet frame information with the current game process PID, virtual network card channel ID and hardware timestamp into a collection unit. It asynchronously notifies the client's virtual LAN subsystem through eventfd and pushes the collection unit directly to the receive buffer through the kernel zero-copy splice method, thus completing the delivery from the original data packet to the usable Layer 2 Ethernet frame information.

[0033] The Linux kernel uses several key components: `task_struct` (a structure describing processes, containing process ID, name, status, and other process management information); `eventfd` (an event notification mechanism provided by the Linux kernel, enabling event waiting and waking between kernel and user modes via file descriptors); and `splice` (a Linux system call used to move data directly between two file descriptors without requiring user-mode memory copying, achieving zero-copy data transfer). The hook is attached to the physical network interface card's (NIC) send queue (TX), while packets injected into the TAP virtual NIC follow the kernel receive path (netif_rx). Since their directions differ, packets injected by TAP do not directly trigger the physical NIC's send hook. Even if the packet later reaches the physical NIC's send queue again via routing, the process initiating the send has become a kernel thread, such as `ksoftirqd` or a tunnel daemon, whose process name does not match the pre-registered game process name, and the hook will not capture it. Simultaneously, the system sets a coloring flag for cloned packets, allowing them to pass directly at the hook entry point. These multiple mechanisms ensure that an infinite loop is not formed.

[0034] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, the kernel-mode hook is located at the network card driver queue layer, directly operating the DMA buffer. Through single-instruction cloning, the Layer 2 Ethernet frames are completely mapped to the per-CPU lock-free circular buffer, avoiding skb copying and context switching, ensuring zero modification of the original bitstream and zero additional memory usage. A dedicated kernel thread consumes the circular buffer in batches, quickly filtering out ARP, 255.255.255.255 broadcast, and 224.0.0.x multicast based on the dmac, ethertype, and udp-port triplet, retaining only game traffic. The extracted fields (src_mac, dst_mac, vlan_tag, payload_type, fcs_placeholder) form structured metadata, providing a precise index for subsequent tunnel encapsulation and packet loss location. The eventfd asynchronously wakes up the user-space virtual LAN subsystem, and the kernel splice mechanism directly maps the acquisition unit to the receive buffer, completing the data transfer in one DMA transaction; the system call overhead is close to zero, and the end-to-end latency remains at the microsecond level, enabling real-time routing, FEC, and congestion control strategies to take effect immediately based on the latest frame-level information, thus achieving intelligent acceleration of game traffic.

[0035] Example 3: Based on Example 2, the data stripping component provided in this embodiment of the invention includes: The initial data filtering component is used to extract the Ethernet type field of each data packet from the raw data packets retrieved in batches from the unlocked circular buffer. If the field is 0x0806, it is temporarily marked as an ARP candidate packet. If it is 0x0800, the protocol field and destination address in the IPv4 header are further read. Data packets with UDP protocol and destination addresses in the range of 255.255.255.255 or 224.0.0.x are temporarily marked as broadcast candidate packets or multicast candidate packets, respectively, to obtain the preliminary filtered candidate packet set. The frequency retrieval subcomponent retrieves the historical broadcast frequency table and established UDP peer mapping table of the current game process for each data packet in the candidate packet set. If the process to which the data packet belongs has sent the same type of broadcast within the recent total broadcast rate and the UDP destination port of the data packet falls in the game's commonly used port list, it is marked as a high-confidence game broadcast packet. If the destination IP address of the packet's ARP request matches the address in the same network segment assigned to the virtual network card, it is marked as a game-related ARP request, and the type determination result after game behavior verification is obtained. When multiple consecutive broadcast packets of the same type are detected from the same process and the destination port is a commonly used game port, the frequency limit is temporarily suspended. The path confirmation subcomponent is used to send packets confirmed as ARP requests, 255.255.255.255 broadcasts, or 224.0.0.x multicasts to the stripping path based on the type determination result, and send the remaining packets to the low-priority stripping path, thus completing the filtering and confirmation from the original packets to the packets of the specified type.

[0036] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, within milliseconds, the traffic that originally required deep parsing on a packet-by-packet basis is pruned to only the truly meaningful network discovery and game broadcasts. This not only prevents useless data from flooding into the subsequent processing links, but also completely preserves the ARP requests, LAN discovery broadcasts, and in-game multicasts required by the game session, achieving precise stripping with low latency, low false alarms, and low resource consumption.

[0037] Example 4: Figure 4 As shown, based on Embodiment 1, the client virtual LAN subsystem provided in this embodiment of the invention includes: The information injection component is used to write the Layer 2 Ethernet frame information delivered by the client data acquisition subsystem into the sending queue of the virtual network card through the injection interface of the TAP virtual network card, so that the Layer 2 Ethernet frame appears at the output end of the TAP device in the form of an Ethernet frame sent from the local area network, and the game Layer 2 frame to be encapsulated is obtained. The encapsulation processing component is used to read the game's Layer 2 frame to be encapsulated from the TAP device output, extract its source MAC address, destination MAC address, Ethernet type, and broadcast flag, and use the complete Layer 2 frame as the payload, adding a tunnel encapsulation header containing the virtual network card channel ID, serial number, and timestamp; at the same time, it selects compression or pass-through strategy according to the QoS flag of the game process, encapsulates it into tunnel protocol data units for transmission over the public network, and obtains tunneled data packets; The tunnel encryption component is used to send tunneled data packets into the encryption engine, encrypt them using a pre-shared key or a negotiated session key, and establish a UDP-based encrypted tunnel with the remote acceleration node. Based on the current NAT type and node connectivity information, it automatically selects a P2P direct connection or relay forwarding path and sends the encrypted tunnel data packets to the peer node, completing the conversion from game Layer 2 frames to encrypted tunnel transmission.

[0038] The working principle and beneficial effects of the above technical solution are as follows: This embodiment uses three core components to work together to losslessly map game Layer 2 Ethernet frames to an encrypted tunnel, achieving high-performance transmission across the public network. The information injection component uses a character device interface to write the acquired Layer 2 Ethernet frames into the transmission queue of the TAP virtual network card, ensuring that the frame structure is completely consistent with the original data at the L2 header, payload length, and FCS levels. This makes the game process and operating system protocol stack unaware of the virtualization, avoiding additional retransmissions or MTU negotiation caused by driver-level differences. The encapsulation processing component captures complete Layer 2 frames from the TAP output, extracts the source / destination MAC, EtherType, and broadcast flag as the tunnel payload; then, it appends a custom tunnel header containing the virtual channel ID, sequence number, and high-precision timestamp, achieving traffic isolation, out-of-order reordering, and RTT metering; simultaneously, based on the QoS category marked on sk_buff by the game process, it dynamically selects LZ4-Flex compression or pass-through strategies, reducing bandwidth consumption in high-traffic scenarios while ensuring that latency-sensitive data such as voice and synchronization frames maintain their original bit-level fidelity. The tunnel encryption component delivers the encapsulated protocol data units to the encryption engine, employing ChaCha-Poly or AES-GCM symmetric algorithms to achieve confidentiality and integrity protection based on a pre-shared key or DTLS negotiated session key. Subsequently, it carries the data via UDP, combining STUN / ICE detection results, and automatically selects a P2P UDPholepunching or relayable TURN path based on NAT type and reachability score, performing ECN-aware congestion control and path detection. Ultimately, it achieves seamless conversion from Layer 2 frames to encrypted tunnel data units, making the RTT jitter and packet loss rate across public network links converge with those of the local area network, meeting the requirements of competitive games for sub-millisecond latency and sub-one percent packet loss.

[0039] Example 5: Based on Example 4, the information injection component provided in this embodiment of the invention includes: The data injection subcomponent is used to receive the raw Layer 2 Ethernet frames captured by the client data acquisition subsystem from the driver layer, and directly pass the raw Layer 2 Ethernet frames as the injection data source to the injectFrame call entry point of the TAP virtual network card to obtain the driver-level frame data to be injected. The send trigger subcomponent is used to write driver-level frame data into the send queue of the TAP virtual network card through the InjectFrame interface, triggering the TAP device to simulate the frame sending process of the real network card, so that the driver-level frame is received by the operating system network stack in the form of being sent from the local physical network card, and the Ethernet frame output by the TAP network card is obtained. The task delivery sub-component is used by the TAP network card to deliver the output Ethernet frames to the upper-layer game virtual LAN module. In the game process, the Ethernet frame is equivalent to the LAN frame sent by other physical nodes in the same broadcast domain, completing the conversion from driver-captured frame to LAN frame visible to the game.

[0040] The working principle and beneficial effects of the above technical solution are as follows: The data injection subcomponent of this embodiment directly sends the original frame to the TAP character device, avoiding the additional delay and error amplification caused by protocol stack parsing, reassembly, or verification; the sending trigger subcomponent uses the TAP sending queue mechanism to disguise the frame as local physical network card uplink traffic, ensuring that the operating system network stack processes according to standard L2 forwarding logic, avoiding game processes from triggering renegotiation or MTU refraction due to driver differences; the task delivery subcomponent maps the TAP output to the game virtual LAN module, so that the game process is unaware of the existence of any non-physical link at the socket layer, ARP layer, and broadcast domain level, thereby ensuring that the MAC address, EtherType, and payload integrity of the game frame are intact throughout the process, ultimately forming a communication environment equivalent to the physical topology of the local LAN, laying a consistent and predictable Layer 2 semantic foundation for tunnel encapsulation and cross-public network acceleration.

[0041] Example 6: Based on Example 5, the sending trigger sub-component provided in this embodiment of the invention includes: The instance binding module is used to write driver-level frame data into the TAP virtual network card's transmission queue, trigger the TAP driver's simulation routine for handling transmission interruptions with the physical network card, retrieve frame data from the transmission queue and bind it to the TAP device instance, generating a packet object to be injected containing a complete Layer 2 frame, device pointer and receive timestamp; The forced marking module is used to call the receive function of the kernel network subsystem, such as netif_rx or netif_receive_skb, to pass the data packet object to be injected into the network protocol stack's receive processing flow; at the same time, it sets the receiving device of the data packet to the TAP virtual network card, clears all flag bits from the external network, forces the data packet to be received by the local interface, and obtains the internal frame that has entered the protocol stack's receive queue. The technology update module is used by the protocol stack to perform standard link layer reception processing based on the receiving device information of the internal frame, such as device type (Ethernet), device status (UP), and device MAC address: updating the virtual network card's receive statistics counter, extracting the Ethernet type field, and delivering the internal frame to the corresponding upper-layer protocol module, such as ARP, IPv4, or IPv6, so that the operating system can fully recognize that the source of the internal frame is the same as the frame sent from the local physical network card, thus completing the simulation and authentication of the frame source.

[0042] The working principle and beneficial effects of the above technical solution are as follows: The instance binding module in this embodiment encapsulates frame data, TAP device pointer, and precise timestamp into a unified data packet object, enabling the kernel path to query MAC, MTU, and statistics registers based on the device instance, ensuring that the protocol stack receiving logic is completely consistent with the real physical network card path. The forced marking module directly sends this object into the soft interrupt context through netif_rx or netif_receive_skb, while clearing the incoming RX flag and resetting sk_buff→dev to TAP, eliminating any external source identification, and forcing the kernel to recognize that the frame comes from the local interface, preventing reverse path filtering, bridging learning, or eBPF firewall from dropping it due to abnormal source. Based on the current UP status of the TAP and the Ethernet type, the technology update module calls the link layer receive routine to update the RX counter, extract the EtherType, and dispatch it to the ARP / IPv4 / IPv6 processing function. As a result, the operating system treats the internal frames as uplink traffic of the local physical network card in four places: device status, link layer type, statistics register, and upper layer protocol entry. This achieves completely indistinguishable frame source simulation and authentication, ensuring that the Layer 2 semantics seen by the game's virtual LAN module are completely consistent with the real LAN.

[0043] Example 7: Figure 5 As shown, based on Embodiment 1, the accelerated node virtual network subsystem provided in this embodiment of the invention includes: The header removal component receives tunneled data packets from the encrypted tunnels of each client, removes the tunnel encapsulation header from each data packet and decrypts it to restore the original Layer 2 Ethernet frame, which contains game broadcast packets, ARP requests or unicast data frames; the original frame is written into the receive queue of the TAP virtual network card uniquely corresponding to the client to obtain the game Layer 2 frame injected with TAP. The Layer 2 forwarding component is used to add multiple TAP virtual network cards corresponding to different clients to the same virtual switch. The virtual switch performs MAC address learning and Layer 2 forwarding: when a game Layer 2 frame is received from any TAP network card, the switching table is looked up according to the destination MAC address in the frame. If it is a destination broadcast or an unknown unicast, it is flooded to all TAP network cards except the receiving port. If it is a known unicast, it is forwarded only to the TAP network card corresponding to the target client, and the game frame is output to the target TAP network card after bridge switching. The encryption and encapsulation component is used to read the game frame to be forwarded from the transmission queue of the TAP network card corresponding to the target client, use the game frame as the tunnel payload, add a tunnel encapsulation header containing the target client identifier, sequence number and timestamp, and perform encryption and encapsulation; send the encapsulated data packet to the public network address of the target client through the UDP tunnel, and complete the accelerated forwarding of game frames from the server bridge to the remote client.

[0044] In this process, the client restores the Layer 2 frame and hands it over to the driver layer. After receiving the frame sent back by the node, remote user B restores the Ethernet frame and injects the TAP. The game process receives the LAN broadcast from the peer host and automatically discovers the other host. At this point, regardless of whether A and B are located in different cities, different operators, multiple NATs, or a mobile / broadband hybrid network, they can achieve interconnection as if they were on the same local area network.

[0045] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, the virtual Ethernet bridge built on the server side incorporates multiple remote client TAP devices into the same Layer 2 broadcast domain. After the header removal component strips the UDP / ESP tunnel encapsulation, it injects the pure Layer 2 Ethernet frame into the receive queue of the corresponding TAP. The Ethernet header, ARP, IPv4 / IPv6, and upper-layer payload of the frame remain unchanged without any additional decapsulation or re-fragmentation. Therefore, the game protocol can still rely on the Layer 2 broadcast and multicast discovery mechanism. The Layer 2 forwarding component is based on the MAC learning table. If the destination MAC is a broadcast address or an unknown unicast, the frame is flooded to all TAP interfaces in the same bridging domain. If the destination MAC already exists in the table, the frame is only forwarded to the TAP port bound to the target client. This is all done in the bridge module of the host kernel without any external routing path, thus avoiding the extra packet round trips caused by Layer 3 table lookups. The encryption and encapsulation component retrieves the Ethernet frame to be forwarded from the tx queue of the target TAP port and encapsulates it as the tunnel payload into a new UDP datagram. The tunnel header carries the target client identifier, a 32-bit monotonically increasing sequence number, and a high-precision timestamp. The payload, encrypted using ChaCha20-Poly1305 or AES-GCM, is sent directly to the pre-negotiation port of the client's public network address. The sequence number and timestamp provide the client with the basis for packet reordering and RTT measurement, and the jitter buffer performs early retransmission or redundant FEC accordingly.

[0046] In summary, this embodiment establishes a Layer 2 direct path between the remote client and the local TAP port through the aforementioned three-level processing: Layer 2 broadcast / multicast frames are flooded within the bridge and then encapsulated into unicast UDP tunnel packets, reaching all relevant clients with only one public network transmission; since unicast frames are directly encapsulated after crossing the bridge, the corresponding clients receive complete Ethernet frames that have not been routed, with TTL and checksums maintaining their initial values; the entire data path bypasses traditional IP routing, NAT session tables, and firewall state machines, relying only on one encrypted-UDP tunnel, reducing packet processing layers and round-trip times, and lowering end-to-end latency and jitter.

[0047] Example 8: Based on Example 7, the Layer 2 forwarding component provided in this embodiment of the invention includes: The key-value pair generation subcomponent is used to extract the destination MAC address from the received game Layer 2 frame, and at the same time read the source MAC address, ingress port TAP number and game process type identifier of the frame to generate MAC query key-value pairs carrying game acceleration priority. The matching result output sub-component is used to perform a lookup in the dynamic MAC address table of the virtual switch using MAC query key-value pairs as an index. If no match is found, a short-term aging temporary mapping is automatically created based on the game process type identifier. If a match is found, the corresponding outgoing port and its current tunnel congestion level are retrieved to obtain a matching result with acceleration information. The forwarding decision sub-component determines the forwarding strategy based on the matching result and the game process type identifier: if the destination MAC is a broadcast address or the congestion level of the outgoing port of the matching result exceeds the threshold, then accelerated flooding is performed on all TAP ports except the incoming port, and the replica is sent to the tunnel with the lowest congestion first; if it is a known unicast and the congestion level meets the threshold, then it is forwarded only to the corresponding outgoing port, thus completing the conversion from MAC lookup to game accelerated forwarding decision.

[0048] The working principle and beneficial effects of the above technical solution are as follows: In this embodiment, the key-value pair generation subcomponent packages the destination MAC, source MAC, TAP port number, and game process type in the Layer 2 frame into a unique index, and includes a game acceleration priority marker in the index. The query can not only distinguish specific sessions but also directly perceive the service level. The matching result output subcomponent uses this index to perform an exact match against the dynamic MAC address table: if a match is missed, a short-term aging temporary mapping is inserted based on the game process type to ensure that unknown unicast or newly added clients are not lost; if a match is found, the port number and real-time tunnel congestion level are extracted simultaneously, allowing subsequent decisions to consider both link quality and topology information. The forwarding decision subcomponent judges the table lookup result and the game process type in parallel: when broadcast or outgoing port congestion exceeds the limit, frame replicas are pushed to all available TAP ports in order of congestion level from low to high to avoid the latency jitter of hot links affecting game synchronization; when unicast and the link is healthy, it is forwarded only to the unique outgoing port to reduce redundant bandwidth consumption. On top of the two-layer semantics required by the game logic, real-time link status and business type awareness are superimposed, enabling each frame to complete cross-client forwarding under the conditions of optimal path, lowest latency, and least redundancy.

[0049] Example 9: As Figure 6 As shown, based on Examples 1-8, the intelligent game acceleration method based on virtual local area network provided by this invention specifically includes the following steps: S100: Runs in the user operating system kernel layer, used to capture raw network data packets generated by a specified game process, extract the Layer 2 Ethernet frame information, and pass the captured Layer 2 Ethernet frame information to the client virtual LAN subsystem. S200: Based on the TAP virtual Ethernet card, it receives Ethernet frame information, encapsulates it into a tunnel protocol format for transmission over the public network, and establishes an encrypted tunnel with the remote node; it is also responsible for creating TAP virtual network cards, allocating virtual IP and MAC addresses, and maintaining the connection status of the tunnel. S300: Creates a TAP network card on the server node and bridges it with the virtual switch. It receives data from the encrypted tunnels of each client, decapsulates the data and restores it to the original Layer 2 Ethernet frame information, and injects it into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that the data frames of different clients are aggregated into a unified Layer 2 network environment on the server.

[0050] The working principle and beneficial effects of the above technical solution are as follows: This embodiment directly captures game data packets from the kernel layer, bypassing the layer-by-layer parsing of the conventional protocol stack. This preserves the most original link layer information and saves the time-consuming process of repeated encapsulation. The TAP virtual network card directly inserts these frames into the encrypted tunnel. With the help of pre-distributed virtual addresses, the data directly reaches the acceleration node, eliminating the jitter caused by multiple NAT and routing lookups. The server sends all the restored Layer 2 frames from the clients to the same virtual switch. The MAC address table accurately pushes the frames to the target player, resulting in a sharp reduction in public network traffic; latency is reduced to near LAN levels; and the number of packet loss retransmissions decreases.

[0051] This embodiment is based on a technical architecture of driver-layer data capture, TAP virtual Ethernet card, and server-side TAP plus Bridge Layer 2 networking. Compared with existing VPNs, virtual LAN tools, and traditional game accelerators, it has several significant technical advantages: Firstly, it achieves truly transparent Layer 2 network communication, thus ensuring full compatibility with various LAN games. This embodiment uses a TAP network card and a Layer 2 Ethernet frame forwarding mechanism, enabling complete transparent transmission of ARP broadcasts, UDP broadcasts, IPv4 multicasts, and MAC layer frames. The server simulates a real switch environment through a Bridge, allowing multiple users to logically reside within the same Layer 2 network. This ensures compatibility with all LAN games that rely on LAN broadcast discovery, including older games such as Red Alert, Counter-Strike, Age of Empires, and Warcraft; an effect that existing virtual networks based on TUN or Layer 3 routing cannot achieve.

[0052] Secondly, the virtual LAN constructed in this embodiment is completely equivalent to a physical LAN. Because the server uses TAP and Bridge to form a complete virtual switch, it can achieve complete Layer 2 forwarding paths, complete MAC address learning and broadcasting behavior, enabling transparent Layer 2 interconnection between clients. The game requires no port mapping or manual configuration. Ultimately, it's equivalent to connecting multiple users in different network environments to the same physical switch, a core advantage that traditional VPNs and ZeroTier do not possess.

[0053] Third, this embodiment boasts a high NAT traversal rate, making it suitable for complex network environments. By combining driver-layer capture with TAP tunneling and server-side bridging, NAT traversal becomes easier. It also introduces multiple traversal strategies and a relay fallback mechanism. Whether in environments with multiple NATs, symmetric NATs, mixed broadband and mobile networks, or strictly controlled intranets such as those in universities or companies, this embodiment can successfully establish virtual Layer 2 channels with a traversal rate exceeding 95%, significantly outperforming ZeroTier and Hamachi, which rely on Layer 3 UDP hole punching.

[0054] Fourth, the driver-layer capture mechanism makes the system more efficient and more compatible. The client uses the driver layer to intercept game data packets, which can accurately identify the game process, avoid unnecessary traffic entering the tunnel, and retain the original Layer 2 frame information for easy TAP re-injection and restoration. The user space does not require complex Hook operations, does not interfere with the user system, and is more stable for high-frequency UDP games, such as CS and various FPS games, thereby improving the reliability and performance of the entire system.

[0055] Fifth, this embodiment requires no user configuration, achieving automated connection and networking. The system can automatically complete the creation of virtual network cards, allocation of virtual IP and MAC addresses, tunnel establishment, addition of network nodes to the virtual bridge, and activation of the broadcast synchronization mechanism; users do not need to set up port mapping, routing tables, or network card bridging, which has extremely high ease of use and is unmatched by existing VPN products.

[0056] Finally, this embodiment constructs a standard Ethernet Layer 2 environment, thus possessing excellent scalability and the ability to extend to more Layer 2 application scenarios, such as virtual NAS access (SMB / NFS), home LAN penetration, and debugging and remote maintenance of IoT devices, thus having broad industrial extension value.

[0057] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of equivalents of this invention, this invention is also intended to include these modifications and variations.

Claims

1. A smart game acceleration system based on virtual local area network (VLAN) networking, characterized in that, Include: The client-side data acquisition subsystem runs in the kernel layer of the user's operating system and is used to capture raw network data packets generated by a specified game process and extract Layer 2 Ethernet frame information from them. The client virtual LAN subsystem, based on the TAP virtual Ethernet card, is used to receive Ethernet frame information and encapsulate it into a tunnel protocol format for transmission over the public network. It also establishes an encrypted tunnel with the remote node; and is responsible for creating TAP virtual network cards, assigning virtual IP and MAC addresses, and maintaining the connection status of the tunnel; The acceleration node virtual network subsystem is used to create TAP network cards on server nodes and bridge them with virtual switches. It receives data from encrypted tunnels of various clients, decapsulates the data and restores it to the original Layer 2 Ethernet frame information, and injects it into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that data frames from different clients are aggregated into a unified Layer 2 network environment on the server.

2. The intelligent game acceleration system based on virtual local area network as described in claim 1, characterized in that, The client-side data acquisition subsystem includes: The process name acquisition component is used to attach hook functions to the network card driver queue layer of the kernel network sending path. It obtains the task_struct of the current process and compares it with the process name with the pre-registered game process name table. Upon a hit, without modifying the original data packet processing flow, the original binary content of the data packet, including the complete Layer 2 Ethernet frame header to the frame trailer, is copied to an independent lock-free circular buffer for each CPU using DMA memory cloning. The data stripping component is used to start a dedicated kernel thread to retrieve cloned data packets in batches from the circular buffer. Based on the destination MAC address, Ethernet type field, and UDP port range of the data packets, it automatically determines whether it is an ARP request, a 255.255.255.255 broadcast, or a 224.0.0.x multicast. It strips the complete Layer 2 Ethernet frame information from the data packets, including the source MAC address, destination MAC address, VLAN tag, payload type, and broadcast flag, and fills in the placeholder fields for the frame check sequence. The information packaging and push component is used to package the stripped Layer 2 Ethernet frame information with the current game process PID, virtual network card channel ID and hardware timestamp into a collection unit. It asynchronously notifies the client's virtual LAN subsystem through eventfd and pushes the collection unit directly to the receive buffer through the kernel zero-copy splice method, thus completing the delivery from the original data packet to the usable Layer 2 Ethernet frame information.

3. The intelligent game acceleration system based on virtual local area network as described in claim 1, characterized in that, The information injection component includes: The data injection subcomponent is used to receive the raw Layer 2 Ethernet frames captured by the client data acquisition subsystem from the driver layer, and directly pass the raw Layer 2 Ethernet frames as the injection data source to the InjectFrame call entry point of the TAP virtual network card to obtain the driver-level frame data to be injected. The send trigger subcomponent is used to write driver-level frame data into the send queue of the TAP virtual network card through the InjectFrame interface, triggering the TAP device to simulate the frame sending process of the real network card, so that the driver-level frame is received by the operating system network stack in the form of being sent from the local physical network card, and the Ethernet frame output by the TAP network card is obtained. The task delivery sub-component is used by the TAP network card to deliver the output Ethernet frames to the upper-layer game virtual LAN module. In the game process, the Ethernet frame is equivalent to the LAN frame sent by other physical nodes in the same broadcast domain, completing the conversion from driver-captured frame to LAN frame visible to the game.

4. The intelligent game acceleration system based on virtual local area network as described in claim 3, characterized in that, Send trigger child component, including: The instance binding module is used to write driver-level frame data into the TAP virtual network card's transmission queue, trigger the TAP driver's simulation routine for handling transmission interruptions with the physical network card, retrieve frame data from the transmission queue and bind it to the TAP device instance, generating a packet object to be injected containing a complete Layer 2 frame, device pointer and receive timestamp; The forced marking module is used to call the receive function of the kernel network subsystem, such as netif_rx or netif_receive_skb, to pass the data packet object to be injected into the network protocol stack's receive processing flow; at the same time, it sets the receiving device of the data packet to the TAP virtual network card, clears all flag bits from the external network, forces the data packet to be received by the local interface, and obtains the internal frame that has entered the protocol stack's receive queue. The technology update module is used by the protocol stack to perform standard link layer reception processing based on the receiving device information of the internal frame, such as device type (Ethernet), device status (UP), and device MAC address: updating the virtual network card's reception statistics counter, extracting the Ethernet type field, and delivering the internal frame to the corresponding upper-layer protocol module, so that the operating system completely recognizes that the source of the internal frame is the same as the frame sent from the local physical network card, thus completing the simulation and authentication of the frame source.

5. The intelligent game acceleration system based on virtual local area network as described in claim 4, characterized in that, The forced marking module includes: The mask generation submodule is used to extract the flag fields carried by the data packet object to be injected; and generate the corresponding flag clearing mask according to the game type of the current game process to obtain the set of flags to be cleared. The item-by-item clearing submodule is used to perform item-by-item clearing operations on packet objects according to the clearing mask, and obtain the internal frame with cleared external flags; The local generation module is used to fix the receiving device pointer of the internal frame with the external flags removed to the TAP virtual network card and set the local generation bit in the flag, so that the kernel protocol stack can skip all external network-related policies during processing and complete the purification and delivery from the data packet to be injected to a fully localized frame.

6. The intelligent game acceleration system based on virtual local area network as described in claim 1, characterized in that, The accelerated node virtual network subsystem includes: The header removal component is used to receive tunneled data packets from each client's encrypted tunnel, remove the tunnel encapsulation header from each data packet and decrypt it to restore the original Layer 2 Ethernet frame, which includes game broadcast packets, ARP requests or unicast data frames. The original frame is written into the receive queue of the TAP virtual network card that is uniquely associated with the client, thus obtaining the game Layer 2 frame that has been injected into TAP; The Layer 2 forwarding component is used to add multiple TAP virtual network cards corresponding to different clients to the same virtual switch. The virtual switch performs MAC address learning and Layer 2 forwarding: when a game Layer 2 frame is received from any TAP network card, the switching table is looked up according to the destination MAC address in the frame. If it is a destination broadcast or an unknown unicast, it is flooded to all TAP network cards except the receiving port. If it is a known unicast, it is forwarded only to the TAP network card corresponding to the target client, and the game frame is output to the target TAP network card after bridge switching. The encryption encapsulation component is used to read the game frames to be forwarded from the transmission queue of the TAP network card corresponding to the target client, use the game frames as tunnel payload, add a tunnel encapsulation header containing the target client identifier, sequence number and timestamp, and perform encryption encapsulation. The encapsulated data packets are sent to the public address of the target client via a UDP tunnel, completing the accelerated forwarding of game frames from the server bridge to the remote client.

7. The intelligent game acceleration system based on virtual local area network as described in claim 6, characterized in that, Layer 2 forwarding component, including: The key-value pair generation subcomponent is used to extract the destination MAC address from the received game Layer 2 frames, and at the same time read the source MAC address, ingress port TAP number and game process type identifier of the frame to generate MAC query key-value pairs carrying game acceleration priority. The matching result output subcomponent is used to perform a lookup in the dynamic MAC address table of the virtual switch using MAC query key-value pairs as an index, and obtain matching results with acceleration information. The forwarding subcomponent determines the forwarding strategy based on the matching results and the game process type identifier, completing the conversion from MAC lookup to game acceleration forwarding decision.

8. The intelligent game acceleration system based on virtual local area network as described in claim 7, characterized in that, If no match is found in the matching result output subcomponent, a short-term aging temporary mapping is automatically created based on the game process type identifier. If a match is found, the corresponding outgoing port and its current tunnel congestion level are retrieved together to obtain a matching result with acceleration information.

9. The intelligent game acceleration system based on virtual local area network as described in claim 7, characterized in that, If the destination MAC address is a broadcast address or the congestion level of the matching result's outgoing port exceeds the threshold, the forwarding subcomponent will perform accelerated flooding to all TAP ports except the incoming port, prioritizing sending the copy to the tunnel with the lowest congestion; if it is a known unicast and the congestion level meets the threshold, it will only forward to the corresponding outgoing port.

10. A method for intelligent game acceleration based on virtual local area network (VLAN) networking, performing the operations implemented by the intelligent game acceleration system based on VLAN networking as described in any one of claims 1-9, characterized in that, Includes the following steps: Running at the user operating system kernel level, it is used to capture raw network data packets generated by a specified game process, extract the Layer 2 Ethernet frame information, and pass the captured Layer 2 Ethernet frame information to the client's virtual LAN subsystem. Based on the TAP virtual Ethernet card, it receives Ethernet frame information and encapsulates it into a tunnel protocol format for transmission over the public network; And establish an encrypted tunnel with the remote node; Also responsible for creating TAP virtual network cards, assigning virtual IP and MAC addresses, and maintaining the connection status of the tunnel; A TAP network interface card is created on the server node and bridged with the virtual switch to receive data from the encrypted tunnels of each client. The data is decapsulated and restored to the original Layer 2 Ethernet frame information, which is then injected into the virtual switch. The virtual switch forwards or broadcasts the Layer 2 Ethernet frame information according to the MAC address table, so that the data frames of different clients are aggregated into a unified Layer 2 network environment on the server.