Communication method, communication system, storage medium, access device and switch

By applying MACVLAN technology to access devices and switches, the problem of complex communication in LAN topology is solved, achieving efficient WAN and LAN port communication and improving communication performance.

CN115865838BActive Publication Date: 2025-12-30SHENZHEN MEIKEXING COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211510196.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-29
Publication Date
2025-12-30
Estimated Expiration
2042-11-29

AI Technical Summary

Technical Problem

In existing technologies, devices with dial-up capabilities cannot communicate effectively in local area network topologies, resulting in complex processing and poor communication performance.

Method used

By applying MACVLAN technology in access devices and switches, MACVLAN sub-interfaces are created, and tag information is added or removed from packets to enable communication between WAN and LAN ports, simplifying the processing flow.

Benefits of technology

It improved communication performance, simplified the processing procedure, and increased communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865838B_ABST
    Figure CN115865838B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of communication, and particularly relates to a communication method, a communication system, a computer readable storage medium, an access access device and a switch. The communication method is applied to a first access access device, the first access access device creates a MACVLAN sub-interface with a WAN port as a MACVLAN parent interface, the WAN port is connected with a first port of a first switch, and a second port of the first switch is connected with a LAN port of a second access access device; the communication method comprises the following steps: receiving a message from the first port through the WAN port, and extracting label information in the message; if the label information in the message is first label information, sending the message from the WAN port to the parent interface; stripping the first label information from the message through the parent interface; transferring the message from the parent interface to the sub-interface; sending the message from the sub-interface to the WAN port; and sending the message from the WAN port to the LAN port through the first port and the second port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, and in particular relates to a communication method, a communication system, a computer-readable storage medium, an access device, and a switch. Background Technology

[0002] In such Figure 1 In the LAN topology shown, other devices that do not have dial-up capabilities (such as routers) are connected to the same level switch as the router's WAN port. Figure 1 The access point (AP) in the lower right corner will be unable to access the internet. To address this issue, a networking scheme combining a leader AP and a slave AP (FIT AP) has been proposed in existing technology. In this scheme, a Control and Provisioning of Wireless Access Points Protocol Specification (CAPWAP) channel is established between the FIT AP and the leader AP, and communication between them is based on this CAPWAP channel. While this method allows the FIT AP to access the internet, it requires a series of complex processing steps, including repackaging, parsing, fragmentation, and reassembly, resulting in poor communication performance. Summary of the Invention

[0003] In view of this, embodiments of this application provide a communication method, a communication system, a computer-readable storage medium, an access device, and a switch to solve the problems of complex processing and poor communication performance in the prior art.

[0004] The first aspect of this application provides a communication method applied to a first access device, wherein the first access device creates a MACVLAN sub-interface with the WAN port as the MACVLAN parent interface, the WAN port of the first access device is connected to a first port of a first switch, the second port of the first switch is connected to the LAN port of a second access device, and the first switch is a managed switch.

[0005] The communication method may include:

[0006] The packet is received from the first port through the WAN port, and the tag information in the packet is extracted;

[0007] If the tag information in the message is a preset first tag information, then the message is sent from the WAN port to the MACVLAN parent interface; wherein, the first tag information is the tag information corresponding to the MACVLAN parent interface;

[0008] The first tag information is stripped from the packet through the MACVLAN parent interface;

[0009] The message is forwarded from the MACVLAN parent interface to the MACVLAN child interface;

[0010] The message is sent from the MACVLAN sub-interface to the WAN port;

[0011] The message is sent to the LAN port via the WAN port through the first port and the second port.

[0012] In one specific implementation of the first aspect, the third port of the first switch is connected to the Internet port of the optical modem;

[0013] After extracting the tag information from the message, the communication method may further include:

[0014] If the tag information in the message is empty, the message will be sent from the WAN port to the MACVLAN sub-interface;

[0015] The message is forwarded from the MACVLAN sub-interface to the MACVLAN parent interface;

[0016] The first tag information is added to the packet through the MACVLAN parent interface;

[0017] The message is sent from the MACVLAN parent interface to the WAN port;

[0018] The message is sent to the Internet port via the WAN port through the first port and the third port.

[0019] A second aspect of this application provides a communication method applied in a first switch. The first switch includes a first port, a second port, and a third port. The first port is connected to the WAN port of a first access device, the second port is connected to the LAN port of a second access device, and the third port is connected to the internet port of an optical modem. The first switch is a managed switch.

[0020] The communication method may include:

[0021] The first packet is received from the Internet port through the third port, the first tag information is added to the first packet, and the first packet is sent to the WAN port through the first port.

[0022] The first packet is received from the WAN port through the first port, and the tag information in the first packet is extracted; if the tag information in the first packet is empty, the first packet is sent to the LAN port through the second port.

[0023] In one specific implementation of the second aspect, the communication method may further include:

[0024] The second message is received from the LAN port through the second port, and the second message is sent to the WAN port via the first port.

[0025] The second packet is received from the WAN port through the first port, and the tag information in the second packet is extracted; if the tag information in the second packet is the first tag information, the second packet is sent to the third port through the first port; the second packet is sent to the Internet port through the third port.

[0026] A third aspect of this application provides a communication method applied to a first access device, wherein the first access device creates a MACVLAN sub-interface with its WAN port as the MACVLAN parent interface, the WAN port of the first access device is connected to a first port of a second switch, and the second port of the second switch is connected to the LAN port of the second access device.

[0027] The communication method may include:

[0028] The packet is received from the first port through the WAN port, and the tag information in the packet is extracted;

[0029] If the tag information in the message is empty, the message will be sent from the WAN port to the MACVLAN parent interface;

[0030] The message is forwarded from the MACVLAN parent interface to the MACVLAN child interface;

[0031] The MACVLAN sub-interface adds verification information and second tag information to the packet; wherein, the second tag information is the tag information corresponding to the MACVLAN sub-interface.

[0032] The message is sent from the MACVLAN sub-interface to the WAN port;

[0033] The message is sent to the LAN port via the WAN port through the first port and the second port.

[0034] In one specific implementation of the third aspect, the third port of the second switch is connected to the Internet port of the optical modem;

[0035] After extracting the tag information from the message, the communication method may further include:

[0036] If the tag information in the message is the preset second tag information, then the message is sent from the WAN port to the MACVLAN sub-interface; the verification information in the message is extracted through the MACVLAN sub-interface, and the message is verified according to the verification information; if the verification is successful, the verification information and the second tag information are removed from the message.

[0037] The message is forwarded from the MACVLAN sub-interface to the MACVLAN parent interface;

[0038] The message is sent from the MACVLAN parent interface to the WAN port;

[0039] The message is sent to the Internet port via the WAN port through the first port and the third port.

[0040] A fourth aspect of this application provides a communication method applied in a second access device, wherein the LAN port of the second access device is connected to a second port of a second switch.

[0041] The communication method may include:

[0042] The first message is received from the second port through the LAN port, and the tag information in the first message is extracted.

[0043] If the tag information in the first message is the preset second tag information, then the verification information in the first message is extracted, and the first message is verified according to the verification information;

[0044] If the verification is successful, the verification information and the second tag information are separated from the first message, and the first message is sent to the terminal device connected to the second access device.

[0045] In one specific implementation of the fourth aspect, the communication method may further include:

[0046] Receive the second message sent by the terminal device;

[0047] The verification information and the second tag information are added to the second message, and the second message is sent to the second port through the LAN port.

[0048] A fifth aspect of this application provides a communication system that may include: an optical modem, a first switch, a first access device, and a second access device; the first switch includes a first port, a second port, and a third port, the first port being connected to the WAN port of the first access device, the second port being connected to the LAN port of the second access device, and the third port being connected to the internet port of the optical modem; the first access device creates a MACVLAN sub-interface with the WAN port as the MACVLAN parent interface; and the first switch is a managed switch.

[0049] The first switch receives a first packet from the Internet port through the third port, adds first tag information to the first packet, and sends the first packet to the WAN port through the first port; wherein, the first tag information is the tag information corresponding to the MACVLAN parent interface;

[0050] The first access device receives the first packet from the first port through the WAN port and extracts the tag information from the first packet; if the tag information in the first packet is the first tag information, the first packet is sent from the WAN port to the MACVLAN parent interface; the first tag information is stripped from the first packet through the MACVLAN parent interface; the first packet is forwarded from the MACVLAN parent interface to the MACVLAN sub-interface; the first packet is sent from the MACVLAN sub-interface to the WAN port; and the first packet is sent from the WAN port to the first port.

[0051] The first switch receives the first packet from the WAN port through the first port and extracts the tag information from the first packet; if the tag information in the first packet is empty, the first packet is sent to the LAN port through the second port.

[0052] In one specific implementation of the fifth aspect, the second access device sends the second message to the second port through the LAN port;

[0053] The first switch sends the second message to the WAN port via the first port;

[0054] The first access device receives the second packet from the first port through the WAN port and extracts the tag information from the second packet; if the tag information in the second packet is empty, the second packet is sent from the WAN port to the MACVLAN sub-interface; the second packet is forwarded from the MACVLAN sub-interface to the MACVLAN parent interface; the first tag information is added to the second packet through the MACVLAN parent interface; the second packet is sent from the MACVLAN parent interface to the WAN port; and the second packet is sent from the WAN port to the first port.

[0055] The first switch receives the second packet from the WAN port through the first port and extracts the tag information from the second packet; if the tag information in the second packet is the first tag information, the second packet is sent to the third port through the first port; the second packet is then sent to the Internet port through the third port.

[0056] A sixth aspect of this application provides a communication system, which may include: an optical modem, a second switch, a first access device, and a second access device; the second switch includes a first port, a second port, and a third port, the first port being connected to the WAN port of the first access device, the second port being connected to the LAN port of the second access device, and the third port being connected to the Internet port of the optical modem; the first access device creates a MACVLAN sub-interface with the WAN port as the MACVLAN parent interface.

[0057] The second switch receives the first packet from the Internet port through the third port and sends the first packet to the WAN port via the first port;

[0058] The first access device receives the first packet from the first port through the WAN port and extracts the tag information from the first packet; if the tag information in the first packet is empty, the first packet is sent from the WAN port to the MACVLAN parent interface; the packet is forwarded from the MACVLAN parent interface to the MACVLAN sub-interface; verification information and second tag information are added to the first packet through the MACVLAN sub-interface; the first packet is sent from the MACVLAN sub-interface to the WAN port; and the first packet is sent from the WAN port to the first port; wherein, the second tag information is the tag information corresponding to the MACVLAN sub-interface;

[0059] The second switch receives the first packet from the WAN port through the first port and sends the first packet to the LAN port via the second port.

[0060] In one specific implementation of the sixth aspect, the second access device adds the verification information and the second tag information to the second message, and sends the second message to the second port through the LAN port;

[0061] The second switch sends the second message to the WAN port via the first port;

[0062] The first access device receives the second packet from the first port through the WAN port and extracts the tag information from the second packet. If the tag information in the first packet is the second tag information, the second packet is sent from the WAN port to the MACVLAN sub-interface. The verification information in the second packet is extracted through the MACVLAN sub-interface, and the second packet is verified according to the verification information. If the verification is successful, the verification information and the second tag information are separated from the second packet. The second packet is forwarded from the MACVLAN sub-interface to the MACVLAN parent interface. The second packet is sent from the MACVLAN parent interface to the WAN port. The second packet is sent from the WAN port to the first port.

[0063] The second switch receives the second packet from the WAN port through the first port and sends the second packet to the Internet port via the third port.

[0064] A seventh aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above-described communication methods.

[0065] An eighth aspect of this application provides an access device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described communication methods.

[0066] A ninth aspect of this application provides a switch, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described communication methods.

[0067] The tenth aspect of this application provides a computer program product that, when run on an access device or switch, causes the access device or switch to perform the steps of any of the above-described communication methods.

[0068] The beneficial effects of this application embodiment compared with the prior art are as follows: This application embodiment realizes access to the local area network through the WAN port by using MACVLAN technology. The entire solution only processes the tag information of the packets and does not involve other complex processing procedures. Compared with the prior art based on CAPWAP channel for communication, it greatly improves the communication performance. Attached Figure Description

[0069] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0070] Figure 1 A schematic diagram of a local area network (LAN) topology;

[0071] Figure 2 This is a schematic diagram of one embodiment of a communication system according to the present application.

[0072] Figure 3 This is a schematic diagram of the transmission path of the first message;

[0073] Figure 4 This is a schematic diagram of the transmission path for the second message;

[0074] Figure 5 This is a flowchart of one embodiment of a communication method in this application.

[0075] Figure 6 This is a flowchart illustrating the processing when the tag information in the message is empty.

[0076] Figure 7 This is a schematic diagram of another embodiment of a communication system according to the present application.

[0077] Figure 8 This is a flowchart of another embodiment of a communication method in this application;

[0078] Figure 9 The flowchart shows the processing flow when the tag information in the message is the preset second tag information.

[0079] Figure 10 This is a schematic block diagram of an access device according to an embodiment of this application. Detailed Implementation

[0080] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0081] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0082] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0083] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0084] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if [described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [described condition or event] is detected," or "in response to detection of [described condition or event]."

[0085] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0086] Figure 2 The figure shows a schematic diagram of an embodiment of a communication system according to the present application. As shown in the figure, the communication system may include: an optical modem, a first switch, a first access device, and a second access device.

[0087] The first switch may include a first port, a second port, and a third port, wherein the first port is connected to the WAN port of the first access device, the second port is connected to the LAN port of the second access device, and the third port is connected to the Internet port of the optical modem.

[0088] The first switch can be a managed switch. By configuring the first switch's Virtual Local Area Network (VLAN), isolation between the Local Area Network (LAN) and the Wide Area Network (WAN) can be achieved, ensuring information security. Specifically, WAN communication can use VLAN N, with the corresponding identifier (Port-base VLAN ID, PVID) being PVID N; while LAN communication can use VLAN 1, with the corresponding identifier being PVID 1.

[0089] Under this configuration, the communication configuration between the first port and the WAN port can be: VLAN N, with tag information; VLAN 1, without tag information, PVID 1. The communication configuration between the second port and the LAN port can be: VLAN 1, untag, PVID 1. The communication configuration between the third port and the network port can be: VLAN N, untag, PVID N.

[0090] The WAN port of the first access device can generate a MACVLAN sub-interface based on network card virtualization (MACVLAN) technology. The MACVLAN sub-interface is connected to the WAN port physical device (i.e., the MACVLAN parent interface) through a bridge and protocol stack, so that the same physical port can logically be used as both a WAN port and a LAN port.

[0091] Taking the first message transmitted from the optical modem to the terminal device (STA) connected to the second access device as an example, its specific processing in the system may include:

[0092] (1) Processing procedure on the optical modem side:

[0093] The optical modem can send the first message to the third port through the Internet port.

[0094] (2) Processing procedure on the first switch side:

[0095] The first switch can receive the first packet from the network port through the third port, add the first tag information (i.e., VLAN N) to the first packet, and send the first packet to the WAN port through the first port. The first tag information is the tag information corresponding to the MACVLAN parent interface.

[0096] (3) Processing procedure on the first access device side:

[0097] The first access device can receive the first packet from the first port through the WAN port and extract the tag information from the first packet. If the tag information in the first packet is the first tag information, the first packet can be sent from the WAN port to the MACVLAN parent interface. The MACVLAN parent interface will then remove the first tag information from the first packet. After the first tag information is removed, the first packet can be transferred from the MACVLAN parent interface to the MACVLAN sub-interface via the protocol stack and bridge. The first packet will then be sent from the MACVLAN sub-interface to the WAN port, and finally sent from the WAN port to the first port.

[0098] (4) Processing procedure on the first switch side:

[0099] The first switch can receive the first packet from the WAN port through the first port and extract the tag information from the first packet. If the tag information in the first packet is empty, the first packet can be sent to the LAN port through the second port.

[0100] (5) Processing procedure on the second access device side:

[0101] The second access device can receive the first message from the second port through the LAN port and send the first message to the terminal device connected to it.

[0102] Figure 3 The diagram shows the transmission path of the first message. As shown in the figure, the transmission path of the first message is: Internet port → third port → first port → WAN port → MACVLAN parent interface → protocol stack → bridge → MACVLAN sub-interface → WAN port → first port → second port → LAN port.

[0103] Taking the second message transmitted from a terminal device connected to the second access device to the optical modem as an example, its specific processing in the system may include:

[0104] (1) Processing procedure on the second access device side:

[0105] The second access device can receive the second message sent by the terminal device connected to it, and send the second message to the second port through the LAN port.

[0106] (2) Processing procedure on the first switch side:

[0107] The first switch can receive the second message from the LAN port through the second port, and send the second message to the WAN port through the first port.

[0108] (3) Processing procedure on the first access device side:

[0109] The first access device can receive the second packet from the first port via the WAN port and extract the tag information from the second packet. If the tag information in the second packet is empty, the second packet can be sent from the WAN port to the MACVLAN sub-interface, and then from the MACVLAN sub-interface to the MACVLAN parent interface via a bridge and protocol stack. Then, the first tag information can be added to the second packet through the MACVLAN parent interface. After adding the first tag information, the second packet can be sent from the MACVLAN parent interface to the WAN port, and then from the WAN port to the first port.

[0110] (4) Processing procedure on the first switch side:

[0111] The first switch can receive the second packet from the WAN port through the first port and extract the tag information from the second packet. If the tag information in the second packet is the same as the first tag information, the second packet can be sent to the third port through the first port, and then sent to the Internet port through the third port.

[0112] (5) Processing procedure on the optical modem side:

[0113] The optical modem can receive the second message from the third port through the Internet port.

[0114] Figure 4 The diagram shows the transmission path of the second message. As shown in the figure, the transmission path of the second message is: LAN port → second port → first port → WAN port → MACVLAN sub-interface → bridge → protocol stack → MACVLAN parent interface → WAN port → first port → third port → Internet access port.

[0115] Corresponding to Figure 2 The communication system shown in the application provides a communication method for use in a first access device, which may include, for example, Figure 5 The process shown:

[0116] Step S501: Receive packets from the first port through the WAN port and extract the tag information from the packets.

[0117] Step S502: Determine whether the tag information in the message is the first tag information.

[0118] If the tag information in the message is the first tag information, then it can be determined that the message is the first message transmitted from the optical modem to the terminal device connected under the second access device. At this time, steps S503 to S507 can be executed.

[0119] Step S503: Send the message from the WAN port to the MACVLAN parent interface.

[0120] Step S504: Remove the first tag information from the packet through the MACVLAN parent interface.

[0121] Step S505: Transfer the packet from the MACVLAN parent interface to the MACVLAN sub-interface via the protocol stack and bridge.

[0122] Step S506: Send the message from the MACVLAN sub-interface to the WAN port.

[0123] Step S507: Send the packet to the LAN port via the first port and the second port through the WAN port.

[0124] If the tag information in the message is empty, it can be determined that the message is a second message transmitted from a terminal device connected to the second access device to the optical modem. At this time, the following can be performed: Figure 6 The process shown:

[0125] Step S508: Send the message from the WAN port to the MACVLAN sub-interface.

[0126] Step S509: Transfer the packet from the MACVLAN sub-interface to the MACVLAN parent interface via the bridge and protocol stack.

[0127] Step S510: Add the first tag information to the packet through the MACVLAN parent interface.

[0128] Step S511: Send the message from the MACVLAN parent interface to the WAN port.

[0129] Step S512: Send the packet to the Internet port via the first port and the third port through the WAN port.

[0130] It should be noted that the aforementioned communication system and communication method mainly rely on MACVLAN technology to enable access to the local area network from the WAN port. VLANs are divided by the switch to achieve isolation between the LAN and WAN and ensure information security. Therefore, the switch must be a managed switch.

[0131] If a regular switch, i.e. an unmanaged switch, is used, or even if a managed switch is used but its VLAN management function is not used, further special processing of the packets is required to ensure that packets do not arbitrarily penetrate the WAN port. Figure 7 The figure shows another embodiment of a communication system according to the present application. As shown, the communication system may include: an optical modem, a second switch, a first access device, and a second access device.

[0132] The second switch may include a first port, a second port, and a third port. The first port is connected to the WAN port of the first access device, the second port is connected to the LAN port of the second access device, and the third port is connected to the Internet port of the optical modem.

[0133] The second switch can be an unmanaged switch (without VLAN management functionality) or a managed switch (with VLAN management functionality but not used). In this case, LAN-side communication between the first and second access devices can be controlled by adding a private VLAN for forwarding. WAN-side communication is not specially processed, while LAN-side communication is tagged with VLAN M. To ensure information security, verification information can be added to messages during internal LAN communication. The specific verification information used can be configured according to the actual situation; for example, the MD5 value calculated from the protocol header and payload can be appended to the end of the message as verification information.

[0134] The WAN port of the first access device can generate a MACVLAN sub-interface based on network card virtualization (MACVLAN) technology. The MACVLAN sub-interface is connected to the WAN port physical device (i.e., the MACVLAN parent interface) through a bridge and protocol stack, so that the same physical port can logically be used as both a WAN port and a LAN port.

[0135] Taking the first message transmitted from the optical modem to the terminal device connected to the second access device as an example, its specific processing in the system may include:

[0136] (1) Processing procedure on the optical modem side:

[0137] The optical modem can send the first message to the third port through the Internet port.

[0138] (2) Processing procedure on the second switch side:

[0139] The second switch can receive the first packet from the network port through the third port and send the first packet to the WAN port through the first port.

[0140] (3) Processing procedure on the first access device side:

[0141] The first access device can receive the first packet from the first port via the WAN port and extract the tag information from the first packet. If the tag information in the first packet is empty, the first packet can be sent from the WAN port to the MACVLAN parent interface, and then the packet can be relayed from the MACVLAN parent interface to the MACVLAN sub-interface via the protocol stack and bridge. Then, the MACVLAN sub-interface can add checksum information and second tag information (i.e., VLAN M) to the first packet. After adding the second tag information, the first packet can be sent from the MACVLAN sub-interface to the WAN port, and then sent from the WAN port to the first port. The second tag information is the tag information corresponding to the MACVLAN sub-interface.

[0142] (4) Processing procedure on the second switch side:

[0143] The second switch can receive the first packet from the WAN port through the first port and send the first packet to the LAN port through the second port.

[0144] (5) Processing procedure on the second access device side:

[0145] The second access device can receive the first packet from the second port via the LAN port and extract the tag information from the first packet. If the tag information in the first packet is empty, the first packet can be discarded. If the tag information in the first packet is the second tag information, the verification information in the first packet can be extracted, and the first packet can be verified according to the verification information. If the verification fails, the first packet can be discarded. If the verification succeeds, the verification information and the second tag information can be separated from the first packet, and the first packet can be sent to the terminal device connected to it.

[0146] Taking the second message transmitted from a terminal device connected to the second access device to the optical modem as an example, its specific processing in the system may include:

[0147] (1) Processing procedure on the second access device side:

[0148] The second access device can receive the second message sent by the terminal device connected to it, add verification information and second tag information to the second message, and send the second message to the second port through the LAN port.

[0149] (2) Processing procedure on the second switch side:

[0150] The second switch can receive the second message from the LAN port through the second port, and send the second message to the WAN port through the first port.

[0151] (3) Processing procedure on the first access device side:

[0152] The first access device can receive the second packet from the first port via the WAN port and extract the tag information from the second packet. If the tag information in the first packet is the same as the second tag information, the second packet can be sent from the WAN port to the MACVLAN sub-interface. The MACVLAN sub-interface extracts the verification information from the second packet and verifies the second packet based on the verification information. If the verification fails, the second packet can be discarded. If the verification succeeds, the verification information and the second tag information can be separated from the second packet, and the second packet can be forwarded from the MACVLAN sub-interface to the MACVLAN parent interface via the bridge and protocol stack. Then, the second packet can be sent from the MACVLAN parent interface to the WAN port, and then from the WAN port to the first port.

[0153] (4) Processing procedure on the second switch side:

[0154] The second switch can receive the second packet from the WAN port through the first port and send the second packet to the Internet port through the third port.

[0155] (5) Processing procedure on the optical modem side:

[0156] The optical modem can receive the second message from the third port through the Internet port.

[0157] Corresponding to Figure 7 The communication system shown in the application provides a communication method for use in a first access device, which may include, for example, Figure 8 The process shown:

[0158] Step S801: Receive packets from the first port through the WAN port and extract the tag information from the packets.

[0159] Step S802: Determine whether the tag information in the message is the second tag information.

[0160] If the tag information in the message is empty, it can be determined that the message is the first message transmitted from the optical modem to the terminal device connected under the second access device. At this time, steps S803 to S807 can be executed.

[0161] Step S803: Send the message from the WAN port to the MACVLAN parent interface.

[0162] Step S804: Transfer the packet from the MACVLAN parent interface to the MACVLAN sub-interface via the protocol stack and bridge.

[0163] Step S805: Add verification information and second tag information to the packet through the MACVLAN sub-interface.

[0164] Step S806: Send the message from the MACVLAN sub-interface to the WAN port.

[0165] Step S807: Send the packet to the LAN port via the first port and the second port through the WAN port.

[0166] If the tag information in the message is the second tag information, then it can be determined that the message is a second message transmitted from a terminal device connected to the second access device to the optical modem. At this time, the following can be performed: Figure 9 The process shown:

[0167] Step S808: Send the message from the WAN port to the MACVLAN sub-interface.

[0168] Step S809: Extract the verification information from the packet through the MACVLAN sub-interface, and verify the packet based on the verification information.

[0169] If the verification is successful, steps S810 to S813 can be continued; if the verification fails, the second message can be discarded and subsequent steps can be stopped.

[0170] Step S810: Remove the verification information and the second tag information from the message.

[0171] Step S811: Transfer the packet from the MACVLAN sub-interface to the MACVLAN parent interface via the bridge and protocol stack.

[0172] Step S812: Send the message from the MACVLAN parent interface to the WAN port.

[0173] Step S813: Send the packet to the Internet port via the first port and the third port through the WAN port.

[0174] In summary, the embodiments of this application enable WAN port access to the local area network through MACVLAN technology. The entire solution only processes the tag information of the packets without involving other complex processing procedures, which greatly improves communication performance compared with the existing technology based on CAPWAP channel communication.

[0175] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0176] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0177] Figure 10A schematic block diagram of an access device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0178] like Figure 10 As shown, the access device 10 in this embodiment includes: a processor 100, a memory 101, and a computer program 102 stored in the memory 101 and executable on the processor 100. When the processor 100 executes the computer program 102, it implements the steps in the various communication method embodiments described above, for example... Figure 5 Steps S501 to S507 shown, or Figure 8 Steps S801 to S807 are shown.

[0179] For example, the computer program 102 may be divided into one or more modules / units, which are stored in the memory 101 and executed by the processor 100 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 102 in the access device 10.

[0180] Those skilled in the art will understand that Figure 10 This is merely an example of access device 10 and does not constitute a limitation on access device 10. It may include more or fewer components than shown, or combine certain components, or different components. For example, access device 10 may also include input / output devices, network access devices, buses, etc.

[0181] The processor 100 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0182] The memory 101 can be an internal storage unit of the access device 10, such as a hard disk or memory of the access device 10. The memory 101 can also be an external storage device of the access device 10, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the access device 10. Furthermore, the memory 101 can include both internal and external storage units of the access device 10. The memory 101 is used to store the computer program and other programs and data required by the access device 10. The memory 101 can also be used to temporarily store data that has been output or will be output.

[0183] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0184] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0185] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0186] In the embodiments provided in this application, it should be understood that the disclosed apparatus / access device and method can be implemented in other ways. For example, the apparatus / access device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0187] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0188] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0189] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0190] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A communication method characterized by comprising: The application is applied to a first access access device, the first access access device creates a MACVLAN sub-interface with a WAN port as a MACVLAN parent interface, the WAN port of the first access access device is connected with a first port of a first switch, a second port of the first switch is connected with a LAN port of a second access access device, a third port of the first switch is connected with an online port of an optical modem, and the first switch is a managed switch; The communication method comprises: receiving a message from the first port through the WAN port and extracting label information in the message; if the label information in the message is preset first label information, sending the message from the WAN port to the MACVLAN parent interface; wherein the first label information is label information corresponding to the MACVLAN parent interface; stripping the first label information from the message through the MACVLAN parent interface; transferring the message from the MACVLAN parent interface to the MACVLAN sub-interface; sending the message from the MACVLAN sub-interface to the WAN port; and sending the message from the WAN port to the LAN port through the first port and the second port; if the label information in the message is empty, sending the message from the WAN port to the MACVLAN sub-interface; transferring the message from the MACVLAN sub-interface to the MACVLAN parent interface; adding the first label information to the message through the MACVLAN parent interface; sending the message from the MACVLAN parent interface to the WAN port; and sending the message from the WAN port to the online port through the first port and the third port.

2. A communication method characterized by comprising: The application is applied to a first switch, the first switch comprises a first port, a second port and a third port, the first port is connected with a WAN port of a first access access device, the second port is connected with a LAN port of a second access access device, the third port is connected with an online port of an optical modem, and the first switch is a managed switch; The communication method comprises: receiving a first message from the online port through the third port, adding first label information to the first message, and sending the first message to the WAN port through the first port; receiving the first message from the WAN port through the first port and extracting label information in the first message; if the label information in the first message is empty, sending the first message to the LAN port through the second port.

3. The communication method according to claim 2, characterized by, The communication method further comprises: receiving a second message from the LAN port through the second port and sending the second message to the WAN port through the first port. receive the second packet from the WAN port through the first port, and extract label information in the second packet; if the label information in the second packet is the first label information, send the second packet to the third port through the first port; and send the second packet to the uplink port through the third port.

4. A communication method characterized by comprising: The first access access device creates a MACVLAN child interface with a WAN port as a MACVLAN parent interface, the WAN port of the first access access device is connected with a first port of a second switch, and a second port of the second switch is connected with a LAN port of a second access access device. The communication method comprises: receiving a packet from the first port through the WAN port, and extracting label information in the packet; if the label information in the packet is empty, sending the packet from the WAN port to the MACVLAN parent interface; transferring the packet from the MACVLAN parent interface to the MACVLAN child interface; adding check information and second label information to the packet through the MACVLAN child interface; the second label information is label information corresponding to the MACVLAN child interface; sending the packet from the MACVLAN child interface to the WAN port; sending the packet from the WAN port to the LAN port through the first port and the second port.

5. The communication method according to claim 4, wherein, The third port of the second switch is connected with an uplink port of an optical modem; After extracting the label information in the packet, the communication method further comprises: if the label information in the packet is preset second label information, sending the packet from the WAN port to the MACVLAN child interface; extracting check information in the packet through the MACVLAN child interface, and checking the packet according to the check information; if the check is successful, stripping the check information and the second label information from the packet; transferring the packet from the MACVLAN child interface to the MACVLAN parent interface; sending the packet from the MACVLAN parent interface to the WAN port; sending the packet from the WAN port to the uplink port through the first port and the third port.

6. A communication method characterized by comprising: The LAN port of the second access access device is connected with a second port of a second switch. The communication method comprises: receiving a first packet from the second port through the LAN port, and extracting label information in the first packet; if the label information in the first packet is preset second label information, extracting check information in the first packet, and checking the first packet according to the check information; if the check is successful, stripping the check information and the second label information from the first packet, and sending the first packet to a terminal device connected with the second access access device.

7. The communication method according to claim 6, wherein, The communication method further comprises: receiving a second packet sent by the terminal device; Add the check information and the second label information to the second packet, and send the second packet to the second port through the LAN port.

8. A communication system, characterized by Comprise: An optical modem, a first switch, a first access access device and a second access access device; the first switch comprises a first port, a second port and a third port, the first port is connected with a WAN port of the first access access device, the second port is connected with a LAN port of the second access access device, and the third port is connected with an online port of the optical modem; the first access access device creates a MACVLAN child interface with the WAN port as a MACVLAN parent interface; the first switch is a managed switch; The first switch receives a first packet from the online port through the third port, adds first label information to the first packet, and sends the first packet to the WAN port through the first port; wherein the first label information is label information corresponding to the MACVLAN parent interface; The first access access device receives the first packet from the first port through the WAN port, and extracts the label information in the first packet; if the label information in the first packet is the first label information, the first packet is sent from the WAN port to the MACVLAN parent interface; the first label information is stripped from the first packet through the MACVLAN parent interface; the first packet is transferred from the MACVLAN parent interface to the MACVLAN child interface; the first packet is sent from the MACVLAN child interface to the WAN port; and the first packet is sent to the first port through the WAN port. The first switch receives the first packet from the WAN port through the first port, and extracts the label information in the first packet; if the label information in the first packet is empty, the first packet is sent to the LAN port through the second port.

9. The communication system of claim 8, wherein: The second access access device sends a second packet to the second port through the LAN port; The first switch sends the second packet to the WAN port through the first port; The first access access device receives the second packet from the first port through the WAN port, and extracts the label information in the second packet; If the label information in the second packet is empty, the second packet is sent from the WAN port to the MACVLAN child interface; The second packet is transferred from the MACVLAN child interface to the MACVLAN parent interface; The first label information is added to the second packet through the MACVLAN parent interface; The second packet is sent from the MACVLAN parent interface to the WAN port; The second packet is sent to the first port through the WAN port; The first switch receives the second packet from the WAN port through the first port and extracts label information in the second packet; If the label information in the second packet is the first label information, the second packet is sent to the third port through the first port; The second packet is sent to the online port through the third port.

10. A communication system, characterized by Comprise: An optical modem, a second switch, a first access access device and a second access access device; the second switch comprises a first port, a second port and a third port, the first port is connected with the WAN port of the first access access device, the second port is connected with the LAN port of the second access access device, the third port is connected with the online port of the optical modem, and the first access access device creates a MACVLAN sub-interface with the WAN port as a MACVLAN parent interface; The second switch receives a first packet from the online port through the third port and sends the first packet to the WAN port through the first port; The first access access device receives the first packet from the first port through the WAN port and extracts label information in the first packet; If the label information in the first packet is empty, the first packet is sent from the WAN port to the MACVLAN parent interface; The packet is transferred from the MACVLAN parent interface to the MACVLAN sub-interface; The first packet is added with check information and second label information through the MACVLAN sub-interface, and the first packet is sent from the MACVLAN sub-interface to the WAN port; The first packet is sent to the first port through the WAN port; wherein the second label information is label information corresponding to the MACVLAN sub-interface; The second switch receives the first packet from the WAN port through the first port and sends the first packet to the LAN port through the second port.

11. The communication system according to claim 10, characterized in that: The second access access device adds the check information and the second label information to a second packet and sends the second packet to the second port through the LAN port; The second switch sends the second packet to the WAN port through the first port; The first access access device receives the second packet from the first port through the WAN port and extracts label information in the second packet; If the label information in the first packet is the second label information, the second packet is sent from the WAN port to the MACVLAN sub-interface; The check information in the second packet is extracted through the MACVLAN sub-interface, and the second packet is checked according to the check information; If the check is successful, the check information and the second label information are stripped from the second packet; The second packet is transferred from the MACVLAN sub-interface to the MACVLAN parent interface; sending the second packet by the MACVLAN parent interface to the WAN port; sending the second packet by the WAN port to the first port; receiving the second packet by the second switch from the WAN port through the first port, and sending the second packet to the uplink port via the third port.

12. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the communication method according to any one of claims 1 to 7.

13. An access device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, The processor, when executing the computer program, implements the steps of the communication method according to any one of claims 1 or 4 to 7.

14. A switch comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, The processor, when executing the computer program, implements the steps of the communication method according to any one of claims 2 to 3.

Citation Information

Patent Citations

  • IPTV networking method and device, network equipment and storage medium

    CN114500172A