A gateway-based enhanced network bridging method and system
By establishing a Layer 2 forwarding bridge interface and a Layer 3 routing interface on the gateway device, the problem of traditional home gateways being unable to be intelligent in bridged mode is solved, enabling independent transmission and remote management of local data streams on the gateway, and supporting Mesh networking and efficient data transmission.
Patent Information
- Application Number
- CN202511606001.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-11-05
AI Technical Summary
Traditional home gateways cannot enable smart gateway plugin operation and Mesh networking in bridge mode, and have low forwarding efficiency in routing mode and cannot allow gateway LAN devices to directly access the cloud.
Establish a Layer 2 forwarding bridge interface and a Layer 3 routing interface on the gateway device. Transmit data through the Layer 2 bridge interface and configure a network address for the Layer 3 routing interface to generate a local data transmission channel for the gateway. Set data filtering standards and redirection rules to redirect data that meets the standards to the gateway for local processing and then transmit it to the WAN or LAN side through the Layer 3 routing interface.
It implements an independent transmission channel for local data streams on the gateway, supports the operation of gateway smart plugins and EasyMesh networking, avoids management traffic from crowding out user bandwidth, and ensures data transmission security and management logic isolation.
Smart Images

Figure CN121077852B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application mainly relates to the field of network communication technology, in particular to an enhanced network bridging method and system based on a gateway. BACKGROUND
[0002] There are two mainstream working modes for traditional home gateways:
[0003] Normal bridge mode (BridgeMode): realizing two-layer MAC address forwarding, the gateway local area network side terminal directly obtains an operator IP address, and the cloud directly manages the gateway local area network side terminal.
[0004] Router mode (RouterMode): realizing three-layer forwarding through NAT, supporting advanced services and management functions, supporting gateway intelligent services, and having networking capability and APP control capability.
[0005] However, both of the two mainstream home gateways have certain defects. The working mechanism of the bridge mode is: analyzing the Ethernet header of the incoming data frame, and deciding the forwarding port of the frame according to the destination MAC address and the MAC address forwarding table maintained internally, but it cannot perceive and analyze the content of the higher layer protocol data unit (such as IP packet) encapsulated by the frame, including the key IP address information, so it cannot realize the gateway intelligent plug-in running and Mesh networking and other intelligent services.
[0006] The router mode has the defects of low forwarding efficiency (NAT performance loss) and the inability of the gateway local area network side device to directly enter the cloud. SUMMARY
[0007] The technical problem to be solved by the present application is to provide an enhanced network bridging method and system based on a gateway, aiming to solve the problem that in the normal bridge mode, the gateway local data stream cannot be sent through the bridge interface.
[0008] The technical solution adopted by the present application to solve the above technical problem is:
[0009] On the one hand, the present application provides an enhanced network bridging method based on a gateway, applied to a gateway device, the method comprising:
[0010] Establishing a two-layer forwarding bridge interface and a three-layer routing interface on the gateway device based on the service configuration strategy requirement, transmitting data between the wide area network and the local area network based on the two-layer forwarding bridge interface, and configuring a network address for the three-layer routing interface to generate a gateway local data transmission channel;
[0011] The data filtering standard and the redirection rule are configured for the two-layer bridge, data meeting the data filtering standard is redirected to the gateway local side, the gateway local side generates response data after processing the data, the response data needing to be transmitted to the gateway wide area side is transmitted to the gateway wide area side through the gateway local data transmission channel, and the response data needing to be transmitted to the gateway local area side equipment is transmitted to the gateway local area side equipment through the two-layer bridge interface according to the set routing strategy.
[0012] Further, the service configuration strategy requirement includes that the gateway local data needs to be transmitted to the gateway wide area side, or the local area network side data needs to be managed by the terminal equipment.
[0013] Further, the network address configured for the three-layer routing interface includes that the three-layer routing interface preferentially acquires the management IP address of the gateway through a dynamic host configuration protocol, if a discovery packet is received within a set time, the dynamic host configuration protocol configuration process is continued, otherwise, the management IP address of the gateway is acquired through an Ethernet point-to-point protocol, if a response is received within a set time, the dialing process is continued, otherwise, the management IP address of the gateway is acquired in the order of the dynamic host configuration protocol and the Ethernet point-to-point protocol according to a set time interval.
[0014] Further, the routing strategy includes setting a default route, and all response data is transmitted to the local equipment through the two-layer bridge forwarding interface according to the set default route.
[0015] Further, the routing strategy includes adding a data type identification mark to the response data, and querying a set exclusive routing table according to the added data type identification mark to confirm a data transmission interface, and the exclusive routing table is used to indicate that data meeting the filtering standard is transmitted to the gateway local area side equipment through the two-layer bridge forwarding interface.
[0016] Further, the redirection rule is configured based on an ebtables tool of a Linux kernel.
[0017] Further, the method further includes adding, deleting or modifying the two-layer bridge forwarding interface, the three-layer routing interface, the strategy routing, the filtering rule and the redirection rule based on the service configuration strategy requirement, and converting the ordinary bridge mode, the routing mode and the enhanced bridge mode.
[0018] In another aspect, the application also provides an enhanced network bridge system based on a gateway, the system including an enhanced bridge north module and an enhanced bridge south module.
[0019] Enhanced bridge northward control module: used for establishing a two-layer forwarding bridge interface and a three-layer routing interface on the gateway device, transmitting data between the two-layer forwarding bridge and the local area network interface based on the wide area network interface, and configuring a network address for the three-layer routing interface to generate a gateway local data transmission channel;
[0020] Enhanced bridge southward control module: used for configuring data filtering standards and redirection rules for the two-layer forwarding bridge, redirecting data meeting the data filtering standards to the gateway local, generating response data after the gateway local processes the data, transmitting the response data needing to be transmitted to the gateway wide area side to the gateway wide area side through the gateway local data transmission channel, and transmitting the response data needing to be transmitted to the local device to the local device through the set routing strategy.
[0021] Further, the system further comprises an enhanced bridge management module, which deletes or modifies the established two-layer bridge forwarding interface, three-layer routing interface, policy routing, filtering rule and redirection rule based on the business configuration strategy requirement.
[0022] Further, the system further comprises a cloud platform and a terminal device, wherein the cloud platform is used for processing gateway local data based on the enhanced bridge southward control module, and the terminal device is used for managing local area network side data based on the enhanced bridge southward control module.
[0023] The beneficial effects of the present application are as follows:
[0024] (1) In the present application, the data flow such as operation and maintenance instructions of the gateway local is transmitted through the three-layer routing interface, the data message between the wide area network and the local area network is still transmitted through the two-layer bridge forwarding interface, and the redirection rule is set to redirect the specific service data packet meeting the data filtering standard to the gateway local, so that the management information and the like of the gateway local machine and the devices hung thereunder are independent of the data channel, the gateway can be remotely managed by the cloud platform and the terminal such as a mobile phone APP, and the operation of the gateway local advanced service plug-in and the intelligent networking mode such as EasyMesh are supported.
[0025] (2) The gateway is completely isolated from the transmission of user service data in logic when receiving and transmitting the management instructions, and does not interfere with each other, which not only ensures the safety of data transmission, but also avoids the occupation of user bandwidth by management traffic. BRIEF DESCRIPTION OF DRAWINGS
[0026] Figure 1 It is a northward data control flowchart;
[0027] Figure 2 It is a southward data control flowchart;
[0028] Figure 3 It is an enhanced bridge establishment flowchart;
[0029] Figure 4 a modified procedure for the enhanced bridge;
[0030] Figure 5 a modified procedure for the enhanced bridge. DETAILED DESCRIPTION
[0031] The core of the present application to solve the above technical problems is: on the basis of a two-layer bridge, a three-layer routing interface is established, the high-speed transmission of service data is realized at the data link layer based on the two-layer forwarding bridge interface, at the same time, a separate management channel is opened for the gateway itself at the network layer based on the three-layer routing interface for transmitting the data flow local to the gateway, and the specific service flow is switched between the two-layer forwarding bridge and the three-layer routing interface through the redirection mechanism, so as to realize the functions of running software plug-ins on the gateway, implementing Mesh networking or remotely controlling the gateway to set parameters without destroying the service data transmission function of the two-layer bridge.
[0032] The enhanced network bridge method based on a gateway provided by the present application comprises the following steps: establishing a two-layer forwarding bridge interface and a three-layer routing interface on the gateway device based on the service configuration policy requirement, transmitting the data between the wide area network and the local area network based on the two-layer forwarding bridge interface, configuring a network address for the three-layer routing interface, and generating a data transmission channel local to the gateway.
[0033] The two-layer forwarding bridge is configured with a data filtering standard and a redirection rule, the data meeting the data filtering standard is redirected to the gateway local, the gateway local generates response data after processing the data, the response data needing to be transmitted to the wide area side of the gateway is transmitted to the wide area side of the gateway through the data transmission channel local to the gateway, and the response data needing to be transmitted to the local area side of the gateway is transmitted to the local area side of the gateway through the set routing strategy.
[0034] In the present application, the northward refers to the data flow direction from the gateway local to the wide area side of the gateway or the device, and the southward refers to the data flow direction from the external device or network to the gateway.
[0035] The procedure of northward data control is as shown in Figure 1 The present method realizes the following: when the enhanced bridge is established, a normal two-layer forwarding bridge is first established, the role of the bridge is mainly to transmit the communication data of the cloud and the devices hung under the gateway local area network, including address allocation, service data forwarding, etc.; at the same time of establishing the normal two-layer forwarding bridge, a three-layer routing forwarding interface is established at the network layer, and the three-layer routing forwarding interface acquires the address according to the service mode configuration policy of the enhanced bridge.
[0036] The three-layer routing interface is configured with a network address, which currently supports obtaining a network address through a dynamic host configuration protocol (DHCP) or an Ethernet point-to-point protocol (PPPoE). The module supports protocol detection to automatically select an address configuration protocol mode, and preferentially uses the dynamic host configuration protocol to obtain a management address. After the routing interface is started, a discovery packet of the DHCP is first sent, and if a response packet of a server is received within a specified time (5 seconds by default), then the dynamic host configuration protocol process is continued. Otherwise, the module attempts to use the dial-up mode of the PPPoE to send a PADI, and if a response PADO of the server is received within a specified time (5 seconds by default), the dial-up process is continued. Otherwise, through a backoff strategy, the address acquisition process of the DHCP-PPPoE is repeated starting from a retry interval of 5 s or 10 or 20 or 40 or 60 or 300.
[0037] After the three-layer routing interface obtains the management address, a default route of a gateway is configured, and the default route is used to send gateway local data from the three-layer routing interface. In this case, intelligent plug-in application data in the gateway can be connected to external devices or networks such as a cloud management platform or a mobile APP, and can be managed and controlled by the cloud management platform and the mobile APP.
[0038] In normal ordinary bridging, data of a bridge interface is always directly forwarded through the bridge, that is, the data is directly transmitted. In this case, the data cannot be sent to the gateway local (some functional modules in the gateway, such as intelligent plug-ins, management modules, etc.). The present application implements two-layer bridge forwarding data sent to the local based on a two-layer data flow redirection mechanism of a Linux Netfilter framework.
[0039] The southbound data flow control is as shown in Figure 2 The specified data flow is redirected using the command ebtables. The following command redirects TCP network data with a destination port of [port] to the local:
[0040] ebtables -t nat -p 0x800 --ip-proto tcp --ip-dport [port] -j redirect
[0041] The previous step only sends the data to the gateway local. The reply data of the gateway local needs to be sent to the terminal. To meet this requirement, a policy routing is designed, which specifically includes
[0042] # Create a policy routing table
[0043] ip rule add from all fwmark [mark] lookup [table id]
[0044] # Add policy routing
[0045] ip route add default dev br0 scope link table [table id]
[0046] ip route add [subnet] / 24 dev br0 scope link table [table id]
[0047] # Mark the gateway local response data
[0048] iptables -t mangle -I PREROUTING -p tcp -m tcp --sport=[port]-j MARK--set-mark [mark].
[0049] The gateway-based enhanced network bridge system comprises an enhanced bridge module and an enhanced bridge south module.
[0050] The enhanced bridge management module is configured to create, delete or modify the working mode of the network bridge according to the network configuration strategy, wherein the working mode comprises a normal bridge mode, a routing mode and an enhanced bridge mode; when the enhanced bridge mode is configured, the following modules are initialized:
[0051] In the application, the south refers to the data flow direction from the gateway local to the gateway wide area side or device, and the south in the application refers to the data flow direction from the external device or network to the gateway.
[0052] The enhanced bridge north control module is configured to establish a two-layer forwarding bridge interface and a three-layer routing interface on the gateway device, transmit data between the two-layer forwarding bridge and the wide area network interface and the local area network interface, and configure a network address for the three-layer routing interface to generate a gateway local data transmission channel.
[0053] The enhanced bridge south control module is configured to configure a data filtering standard and a redirection rule for the two-layer forwarding bridge, redirect the data meeting the data filtering standard to the gateway local, generate response data after the gateway local processes the data, transmit the response data needing to be transmitted to the gateway wide area side to the gateway wide area side through the gateway local data transmission channel, and transmit the response data needing to be transmitted to the local device to the local device through the set routing strategy.
[0054] Preferably, the system also includes an enhanced bridge management module, which is used to delete the established Layer 2 bridge forwarding interface and Layer 3 routing interface based on the service configuration policy requirements, and to add, delete or modify policy routing, filtering rules and redirection rules, so as to realize the conversion between normal bridging mode, routing mode and enhanced bridging mode.
[0055] like Figure 3 As shown, the establishment of an enhanced bridge includes first obtaining the network configuration policy, which is mainly based on scenario adaptation, such as whether cloud control or APP management is required. If not, a normal bridging mode is established for data pass-through. If so, an enhanced bridge network is established. After determining that the network configuration is an enhanced bridge, the enhanced bridge southbound control module and the enhanced bridge southbound control module need to be initialized synchronously.
[0056] like Figure 4 As shown, the deletion of an enhanced bridge includes calling the enhanced bridge deletion process when the enhanced bridge is no longer needed. Specifically, this includes deleting the Layer 2 bridge interface, deleting the routing interface, policy routing, and restoring netfilter rules.
[0057] like Figure 5 As shown, the modifications to the enhanced bridge include network configuration changes based on different use cases. Modifying to normal bridging mode involves deleting the Layer 3 routing interface, restoring netfilter rules, and deleting the default route. In this mode, the gateway's LAN-side terminal can obtain the address directly assigned by the cloud through the Layer 2 bridge and forward data streams. However, the gateway cannot be controlled by the cloud management platform, and the mobile app cannot manage the gateway or its connected devices. Modifying to Layer 3 routing forwarding mode involves deleting the bridge interface, restoring netfilter rules, and enabling forwarding functionality. In this mode, the gateway's LAN side obtains the IP address assigned by the gateway and forwards data streams through NAT. The gateway can be controlled by cloud management platforms and other control devices, and the mobile app can manage the gateway.
[0058] The system also includes a cloud platform and terminal devices. The cloud platform is used to receive local gateway data based on the enhanced bridge southbound control module, and the terminal devices manage local area network side data based on the enhanced bridge southbound control module.
Claims
1. A gateway-based enhanced network bridging method, applied to a gateway device, characterized in that, The method includes: Based on business configuration policy requirements, a Layer 2 forwarding bridge interface and a Layer 3 routing interface are established on the gateway device. Data between the WAN and LAN is transparently transmitted through the Layer 2 forwarding bridge interface, and a network address is configured for the Layer 3 routing interface to generate a local data transmission channel for the gateway. The configuration of the network address for the Layer 3 routing interface includes: the Layer 3 routing interface first obtains the gateway's management IP address through Dynamic Host Configuration Protocol (DHCP). If a discovery message is received within a set time, the DHCP configuration process continues; otherwise, the gateway's management IP address is obtained through Ethernet Point-to-Point Protocol (EPP). If a response is received within a set time, the dialing process continues; otherwise, the gateway's management IP address is continuously obtained using the method of first DHCP and then EEPP at set time intervals. Configure data filtering standards and redirection rules for the Layer 2 forwarding bridge. Data that meets the data filtering standards is redirected to the local gateway. The local gateway processes the data and generates response data. The response data that needs to be transmitted to the wide area side of the gateway is transmitted to the wide area side of the gateway through the local gateway data transmission channel. The response data that needs to be transmitted to the local area side device of the gateway is sent to the local area side device of the gateway through the configured routing policy by the Layer 2 forwarding bridge interface.
2. The gateway-based enhanced network bridging method according to claim 1, characterized in that, The service configuration policy requirements include: gateway local data needs to be transmitted to the gateway wide area side, or local area network data needs to be managed by terminal devices.
3. The gateway-based enhanced network bridging method according to claim 1, characterized in that, The routing strategy includes: setting a default route, and sending all response data to the local device via the Layer 2 bridge forwarding interface through the set default route.
4. The gateway-based enhanced network bridging method according to claim 1, characterized in that, The routing strategy includes: adding a data type identification tag to the response data, querying the set dedicated routing table based on the added data type identification tag to confirm the data delivery interface, and the dedicated routing table is used to indicate that data that meets the filtering criteria is delivered to the gateway local area device by the Layer 2 bridge forwarding interface.
5. The gateway-based enhanced network bridging method according to claim 1, characterized in that, The redirection rules are configured using the ebtables tool in the Linux kernel.
6. The gateway-based enhanced network bridging method according to claim 1, characterized in that, The method further includes adding, deleting, or modifying the established Layer 2 bridge forwarding interface, Layer 3 routing interface, policy routing, filtering rules, and redirection rules based on business configuration policy requirements, so as to realize the conversion between normal bridging mode, routing mode, and enhanced bridging mode.
7. A gateway-based enhanced network bridging system for implementing the gateway-based enhanced network bridging method according to any one of claims 1-6, characterized in that, The system includes an enhanced bridge northbound module and an enhanced bridge southbound module; Enhanced bridge northbound control module: used to establish a Layer 2 forwarding bridge interface and a Layer 3 routing interface on the gateway device, pass through the data between the WAN interface and the LAN interface based on the Layer 2 forwarding bridge, configure the network address for the Layer 3 routing interface, and generate a local data transmission channel for the gateway. Enhanced Southbound Control Module: Used to configure data filtering standards and redirection rules for the Layer 2 forwarding bridge. Data that meets the data filtering standards is redirected to the local gateway. The local gateway processes the data and generates response data. The response data that needs to be transmitted to the WAN side of the gateway is transmitted to the WAN side of the gateway through the local gateway data transmission channel. The response data that needs to be transmitted to the local device is sent to the local device by the Layer 2 forwarding bridge according to the configured routing policy.
8. The gateway-based enhanced network bridging system according to claim 7, characterized in that, The system also includes an enhanced bridge management module, which can delete established Layer 2 bridge forwarding interfaces and Layer 3 routing interfaces based on service configuration policy requirements, and add, delete, or modify policy routing, filtering rules, and redirection rules.
9. The gateway-based enhanced network bridging system according to claim 7, characterized in that, The system also includes a cloud platform and terminal devices. The cloud platform is used to process gateway local data based on the enhanced bridge northbound control module, and the terminal devices manage local area network side data based on the enhanced bridge southbound control module.
Citation Information
Patent Citations
Message forwarding method and device in two-layered edge network
CN103546374A
Method and system for realizing three-layer routing forwarding based on network bridge, and gateway equipment
CN112953833A