Message forwarding method and related equipment for virtual switch

By storing user account information of virtual client devices in a virtual switch and directly converting network address in a virtual switch, the problem of excessive forwarding path of virtual switch is solved, which improves forwarding efficiency and enhances fault tolerance.

CN115987915BActive Publication Date: 2025-03-28WUHAN GREENET INFORMATION SERVICE
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211714809.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2025-03-28
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

The forwarding path of a virtual switch (vSwitch) is too long and has low forwarding efficiency, which cannot meet the needs of large traffic scenarios.

Method used

By storing user account information in the virtual client device in the virtual switch, network address conversion is performed directly in the virtual switch, reducing the message forwarding path.

Benefits of technology

The traffic forwarding path of the virtual switch is shortened, the traffic forwarding efficiency is improved, and the fault tolerance is high. If the virtual client device is abnormal, it will not affect the existing users' Internet access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115987915B_ABST
    Figure CN115987915B_ABST
Patent Text Reader

Abstract

The present application provides a message forwarding method and related equipment for a virtual switch, the method is applied to the virtual switch, including: receiving a first message sent by a user end; detecting whether the virtual switch stores user account information corresponding to the user end, the user account information is used for network address conversion, and the user account information is obtained from a virtual client device connected to the virtual switch; if the virtual switch stores user account information corresponding to the user end, based on the user account information, performing network address conversion processing on the first message to obtain a second message; and sending the second message to an external network. The embodiment of the present application stores the user account information in the virtual client device in the virtual switch for the virtual switch to perform network address conversion, without sending the message to the virtual client device for network address conversion, thereby shortening the traffic forwarding path of the virtual switch and improving the traffic forwarding efficiency of the virtual switch.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of message forwarding, and in particular to a message forwarding method and related equipment for a virtual switch. Background Art

[0002] vSwitch (Virtual Switch) refers to a virtual switch or virtual network switch, which works in the Layer 2 data network and implements the Layer 2 (and some Layer 3) network functions of a physical switch through software. For a vSwitch, the most critical performance indicator is forwarding performance, that is, throughput.

[0003] When users access the Internet through vSwitch, vSwitch will first forward user traffic to vCPE (Virtual Customer Premise Equipment) for NAT (Network Address Translation) and other processing before forwarding it back to vSwitch to forward user traffic to the external network. It can be seen that the forwarding path of vSwitch is too long and the forwarding efficiency is low, which cannot meet the needs of large traffic scenarios. Summary of the invention

[0004] The present application provides a message forwarding method and related devices for a virtual switch, aiming to improve the traffic forwarding efficiency of the vSwitch.

[0005] On the one hand, the present application provides a message forwarding method for a virtual switch, the method being applied to the virtual switch, comprising:

[0006] Receiving a first message sent by a user terminal;

[0007] Detecting whether user account information corresponding to the user terminal is stored in the virtual switch, the user account information is used for network address translation, and the user account information is obtained from a virtual client device connected to the virtual switch;

[0008] If the virtual switch stores user account information corresponding to the user terminal, based on the user account information, perform network address translation processing on the first message to obtain a second message;

[0009] The second message is sent to the external network.

[0010] In some embodiments, after receiving the first message sent by the user terminal, the method further includes:

[0011] Determine a message type of the first message, where the message type includes at least one of a forwarding message and a control message;

[0012] If the message type of the first message is a forwarding message, the step of detecting whether the virtual switch stores user account information corresponding to the user terminal is performed.

[0013] In some embodiments, after detecting whether the virtual switch stores user account information corresponding to the user terminal, the method further includes:

[0014] If the user account information corresponding to the user terminal is not stored in the virtual switch, a prompt message indicating abnormal network connection is fed back to the user terminal so that the virtual client device can dial up to the Internet.

[0015] In some embodiments, after determining the message type of the first message, the method further includes:

[0016] If the message type of the first message is a control message, the control message is sent to the virtual client device to control the virtual client device to perform Internet dial-up based on the control message.

[0017] In some embodiments, the detecting whether the virtual switch stores user account information corresponding to the user terminal includes:

[0018] Obtaining the virtualized network tunnel identifier and user terminal attribute information in the first message;

[0019] Among the multiple account information stored in the virtual switch, whether there is account information including the virtualized network tunnel identifier and the user terminal attribute information is detected to determine whether the virtual switch stores user account information corresponding to the user terminal.

[0020] On the other hand, the present application provides a message forwarding method for a virtual switch, the method being applied to a virtual client device, the virtual client device being connected to any of the virtual switches described above, the method comprising:

[0021] Get the user account information assigned to the client;

[0022] The user account information is sent to the virtual switch, wherein the virtual switch stores the user account information, performs network address translation on the first message sent by the user terminal based on the user account information to obtain a second message, and sends the second message to an external network.

[0023] In some embodiments, the user account information includes Internet dial-up information and IP allocation information of the user terminal, and the acquiring of the user account information allocated to the user terminal includes:

[0024] Based on the control message for Internet dialing sent by the user terminal, Internet dialing processing is performed to obtain Internet dialing information of the user terminal;

[0025] An IP address is allocated to the user terminal to obtain IP allocation information of the user terminal.

[0026] On the other hand, the present application provides a message forwarding device for a virtual switch, the device comprising:

[0027] A receiving unit, configured to receive a first message sent by a user terminal;

[0028] A detection unit, configured to detect whether user account information corresponding to the user terminal is stored in the virtual switch, the user account information being used for network address translation and being obtained from a virtual client device connected to the virtual switch;

[0029] a conversion unit, configured to perform network address translation processing on the first message based on the user account information to obtain a second message if the user account information corresponding to the user terminal is stored in the virtual switch;

[0030] A sending unit is used to send the second message to an external network.

[0031] On the other hand, the present application provides a message forwarding device for a virtual switch, the device comprising:

[0032] An account management unit, used to obtain user account information assigned to a user terminal;

[0033] An account sending unit is used to send the user account information to the virtual switch, wherein the virtual switch stores the user account information, performs network address translation processing on the first message sent by the user terminal based on the user account information to obtain a second message, and sends the second message to the external network.

[0034] On the other hand, the present application also provides a computer device, the computer device comprising:

[0035] one or more processors;

[0036] Memory; and

[0037] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the packet forwarding method for the virtual switch.

[0038] On the other hand, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in the message forwarding method for a virtual switch.

[0039] The message forwarding method and related equipment for a virtual switch provided in an embodiment of the present application are applied to a virtual switch, and include: receiving a first message sent by a user end; detecting whether user account information corresponding to the user end is stored in the virtual switch, the user account information is used for network address conversion, and the user account information is obtained from a virtual client device connected to the virtual switch; if user account information corresponding to the user end is stored in the virtual switch, based on the user account information, performing network address conversion processing on the first message to obtain a second message; and sending the second message to an external network. The embodiment of the present application shortens the traffic forwarding path of the virtual switch and improves the traffic forwarding efficiency of the virtual switch by storing the user account information in the virtual client device in the virtual switch for the virtual switch to perform network address conversion without sending the message to the virtual client device for network address conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 It is a scenario diagram of a message forwarding system for a virtual switch provided in an embodiment of the present application;

[0042] Figure 2 It is a flow chart of an embodiment of a message forwarding method for a virtual switch provided in an embodiment of the present application;

[0043] Figure 3 It is a flowchart of another embodiment of the message forwarding method for a virtual switch provided in an embodiment of the present application;

[0044] Figure 4 It is another scenario schematic diagram of the message forwarding system for a virtual switch provided in an embodiment of the present application;

[0045] Figure 5 It is a schematic diagram of the structure of an embodiment of a message forwarding device for a virtual switch provided in an embodiment of the present application;

[0046] Figure 6 It is a schematic diagram of the structure of an embodiment of a computer device provided in the embodiments of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0048] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0049] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0050] The embodiments of the present application provide a message forwarding method and related devices for a virtual switch, which are described in detail below.

[0051] like Figure 1 As shown, Figure 11 is a schematic diagram of a scenario of a message forwarding system for a virtual switch provided in an embodiment of the present application. The message forwarding system for a virtual switch may include a computer device 100, in which a message forwarding device for a virtual switch is integrated, such as Figure 1 A computer device 100 in FIG.

[0052] In the embodiment of the present application, the computer device 100 may be a terminal or a server. When the computer device 100 is a server, it may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server constructed by a plurality of servers. The cloud server is constructed by a large number of computers or network servers based on cloud computing.

[0053] It is understandable that when the computer device 100 in the embodiment of the present application is a terminal, the terminal used may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be one of a mobile phone, a tablet computer, a laptop computer, etc.

[0054] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution, and is not intended to limit the application scenario of the present application solution. Other application environments may also include Figure 1 More or less computer equipment as shown in Figure 1 Only one computer device is shown in the figure. It can be understood that the message forwarding system for the virtual switch can also include one or more other computer devices, which are not specifically limited here.

[0055] In addition, if Figure 1 As shown, the message forwarding system for the virtual switch may further include a memory 200 for storing data, such as storing user account information corresponding to the user terminal.

[0056] It should be noted that Figure 1The scenario diagram of the message forwarding system for the virtual switch shown is only an example. The message forwarding system and scenario for the virtual switch described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can know that with the evolution of the message forwarding system for the virtual switch and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.

[0057] For example, refer to Figure 4 , Figure 4 FIG. 1 is another schematic diagram of a message forwarding system for a virtual switch. Figure 4 In the example, the message sent by UE (User Equipment) is transmitted to vSwitch (Virtual Switch) via DCSW (Data Center SWitches). vSwitch generally needs to send the user message to vCPE (Virtual Customer Premise Equipment) for NAT (Network Address Translation) and other processing, and then transfer it back to vSwitch. vSwitch transmits the message processed by NAT and other processing to the external network via DCSW and BRAS (Broadband Remote Access Server) to achieve the purpose of user end surfing the Internet. It can be seen that the forwarding path of vSwitch is too long and the forwarding efficiency is low. Among them, the user end is in the intranet, that is, the local area network, and the external network is the wide area network. The communication between DCSW and vSwitch is based on VXLAN (Virtual Extensible Local Area Network) technology.

[0058] Next, a message forwarding method for a virtual switch provided in an embodiment of the present application is introduced.

[0059] In the embodiment of the message forwarding method for a virtual switch of the present application embodiment, a message forwarding device for a virtual switch is used as an execution subject. For the sake of simplicity and ease of description, the execution subject will be omitted in the subsequent method embodiments. The message forwarding device for a virtual switch is applied to a computer device.

[0060] See also Figure 2 , Figure 2 The present invention provides a flow chart of an embodiment of a method for forwarding a message for a virtual switch provided in an embodiment of the present application. The method for forwarding a message for a virtual switch is applied to the above-mentioned virtual switch, including:

[0061] 201. Receive a first message sent by a user terminal;

[0062] In an embodiment of the present application, the user terminal can access the external network by sending a first message, so the virtual switch can receive the first message.

[0063] In some embodiments of the present application, after receiving the first message sent by the user terminal, it may also include: determining the message type of the first message, the message type includes at least one of a forwarding message and a control message, the forwarding message is a user data message, and the control message is a protocol message; if the message type of the first message is a forwarding message, executing the step of detecting whether the virtual switch stores user account information corresponding to the user terminal. Among them, the forwarding message refers to the user traffic that needs to be forwarded to the external network, and the control message refers to the instruction for controlling the network connection with the external network, for example, the control message can be a dial-up Internet access instruction.

[0064] In some embodiments of the present application, after determining the message type of the first message, the method may further include: if the message type of the first message is a control message, sending the control message to the virtual client device to control the virtual client device to perform Internet dial-up control based on the control message. The control of Internet dial-up includes the establishment and disconnection of Internet dial-up, etc. It can be seen that this embodiment separates control messages from forwarding messages, that is, the virtual switch sends the control message to the virtual client device for processing, while the forwarding message does not need to be processed by the virtual client device, and is processed by the virtual switch and then sent to the external network, thereby realizing the separation of the forwarding plane and the control plane.

[0065] 202. Detect whether the virtual switch stores user account information corresponding to the user terminal, the user account information is used for network address translation, and the user account information is obtained from a virtual client device connected to the virtual switch;

[0066] In an embodiment of the present application, at least one user account information is stored in the virtual switch, and the user account information is obtained from the virtual client device. For example, after obtaining the user account information, the virtual client device can actively send the user account information to the virtual switch so that the virtual switch can store the user account information. Among them, the user account information is used to perform network address translation in the virtual client device. In an embodiment of the present application, the user account information is stored in the virtual switch in advance so that the virtual switch can perform network address translation processing instead of the virtual client device.

[0067] In some embodiments of the present application, the user account information is the relevant information on the user's dial-up network. For example, the user information includes the user's Internet dial-up information and IP allocation information. The IP allocation information may include the NAT IP information corresponding to the user, and the Internet dial-up information may be the outgoing sub-interface information. Of course, the user account information may also include some basic configuration information of the user account.

[0068] In some embodiments of the present application, detecting whether user account information corresponding to the user terminal is stored in the virtual switch may include: obtaining the virtualized network tunnel identifier (VNI, VXLAN Network Identifier) ​​and user terminal attribute information (i.e., qinq information, including CVLAN tag and SVLAN tag) in the first message; and detecting whether account information having the virtualized network tunnel identifier and user terminal attribute information is present in the multiple account information stored in the virtual switch to determine whether user account information corresponding to the user terminal is stored in the virtual switch. That is, based on the virtualized network tunnel identifier and the user terminal attribute information, the user account information is searched in the multiple account information.

[0069] 203. If the virtual switch stores user account information corresponding to the user terminal, perform network address translation on the first message based on the user account information to obtain a second message;

[0070] In the embodiment of the present application, if the virtual switch stores the user account information corresponding to the user terminal, it means that the first message does not need to be sent to the virtual client device, but the virtual switch directly performs network address translation and other processing to obtain the second message. It should be noted that in the process of obtaining the second message from the first message, in addition to the network address translation processing, it can also include the replacement of the outer tunnel header, inner header and other information in the first message.

[0071] In some embodiments of the present application, after detecting whether the user account information corresponding to the user terminal is stored in the virtual switch, the method may further include: if the user account information corresponding to the user terminal is not stored in the virtual switch, feedback of prompt information of abnormal network connection is sent to the user terminal, so that the virtual client device can dial up to the Internet. It is understandable that if the user account information corresponding to the user terminal is not stored in the virtual switch, it indicates that the Internet dial-up processing of the virtual client device is unsuccessful or the virtual client device fails, so the prompt information of abnormal network connection can be fed back to the user terminal, so that the user terminal can re-trigger the control message for Internet dial-up, so that the virtual client device can re-dial up to the Internet.

[0072] 204. Send the second message to the external network.

[0073] In the embodiment of the present application, the virtual switch transmits the second message to the external network via the DCSW and the BRAS, thereby enabling the user end to access the external network.

[0074] The message forwarding method for a virtual switch provided in the embodiment of the present application, by synchronizing the user account information in the virtual client device to the virtual switch for the virtual switch to perform network address translation, does not need to send the message to the virtual client device for network address translation, shortens the flow forwarding path of the virtual switch, and improves the flow forwarding efficiency of the virtual switch. It also has high fault tolerance, and the abnormality of the virtual client device will not affect the existing users' Internet access.

[0075] See also Figure 3 , Figure 3 This is a flow chart of another embodiment of a message forwarding method for a virtual switch provided in an embodiment of the present application. The message forwarding method for a virtual switch is applied to the above-mentioned virtual client device, including:

[0076] 301. Obtain user account information assigned to the client;

[0077] In an embodiment of the present application, the virtual client device is used to realize the connection between the access network (ie, the external network) and the user terminal. When establishing the connection between the access network and the user terminal, the virtual client device can automatically generate the user account information of the user terminal.

[0078] In some embodiments of the present application, obtaining user account information assigned to a user terminal may include: performing PPPOE Internet dial-up processing based on a control message sent by the user terminal for Internet dial-up to obtain Internet dial-up information of the user terminal; allocating an IP address to the user terminal to obtain IP allocation information of the user terminal, wherein the user terminal may request a virtual client device to allocate an IP address through DHCP (Dynamic Host Configuration Protocol).

[0079] 302. Send the user account information to the virtual switch, wherein the virtual switch stores the user account information, performs network address translation on the first message sent by the user terminal based on the user account information to obtain a second message, and sends the second message to the external network.

[0080] In an embodiment of the present application, after obtaining the user account information, the virtual client device may publish the user account information to the virtual switch through Redis (Remote Dictionary Server) to implement network address translation processing in the virtual switch.

[0081] The solution disclosed in the embodiment of the present application stores the user account information in the virtual client device in the virtual switch for the virtual switch to perform network address translation, without sending the message to the virtual client device for network address translation, thereby shortening the traffic forwarding path of the virtual switch and improving the traffic forwarding efficiency of the virtual switch.

[0082] The following is an example of the data processing flow of the virtual switch:

[0083] 1. The virtual switch receives the first message from the physical port;

[0084] 2. The virtual switch parses the outer tunnel header of the first message and extracts the VNI;

[0085] 3. The virtual switch parses the inner double-layer VLAN header of the first message and extracts the QinQ information;

[0086] 4. The virtual switch finds the user account information locally based on the vni+qinq information and exits the tunnel;

[0087] 5. The virtual switch directly uses the encapsulated message information under the user account information to fill the outer tunnel header and inner header (eth header + double-layer vlan header + PPPOE header) of the first message, where the Eth header includes the source MAC address and the destination MAC address, and PPPOE refers to the Ethernet-based point-to-point communication protocol);

[0088] 6. The virtual switch searches the flow table and performs the NAT function to replace the inner IP and port of the first message to obtain the second message.

[0089] 7. The virtual switch forwards the second message to the outgoing tunnel and sends it to the external network.

[0090] The following is an example of the data processing flow of a virtual client device:

[0091] 1. After the virtual client device configures the account information table, it publishes the basic account information to the virtual switch through redis;

[0092] 2. After the virtual client device successfully performs PPPOE dial-up based on the basic account information, it publishes Internet dial-up information to the virtual switch through redis;

[0093] 3. After the user requests the virtual client device to allocate an IP address through DHCP, the virtual client device publishes the account IP allocation information to the virtual switch through redis.

[0094] In order to better implement the message forwarding method for a virtual switch in the embodiment of the present application, based on the message forwarding method for a virtual switch, the embodiment of the present application also provides a message forwarding device for a virtual switch, such as Figure 5 As shown, the message forwarding device 500 for the virtual switch includes:

[0095] The receiving unit 501 is configured to receive a first message sent by a user terminal;

[0096] A detection unit 502 is used to detect whether the virtual switch stores user account information corresponding to the user terminal, the user account information is used for network address translation, and the user account information is obtained from the virtual client device connected to the virtual switch;

[0097] The conversion unit 503 is configured to perform network address translation processing on the first message based on the user account information to obtain a second message if the user account information corresponding to the user terminal is stored in the virtual switch;

[0098] The sending unit 504 is used to send the second message to the external network.

[0099] The message forwarding device for a virtual switch provided in an embodiment of the present application stores user account information in a virtual client device in the virtual switch for the virtual switch to perform network address translation, without the need to send the message to the virtual client device for network address translation, thereby shortening the traffic forwarding path of the virtual switch and improving the traffic forwarding efficiency of the virtual switch.

[0100] In order to better implement the message forwarding method for a virtual switch in the embodiment of the present application, based on the message forwarding method for a virtual switch, the embodiment of the present application also provides a message forwarding device for a virtual switch, and the message forwarding device for a virtual switch includes:

[0101] An account management unit, used to obtain user account information assigned to a user terminal;

[0102] The account sending unit is used to send the user account information to the virtual switch, wherein the virtual switch stores the user account information, performs network address translation processing on the first message sent by the user terminal based on the user account information, obtains a second message, and sends the second message to the external network.

[0103] The message forwarding device for a virtual switch provided in an embodiment of the present application stores user account information in a virtual client device in the virtual switch for the virtual switch to perform network address translation, without the need to send the message to the virtual client device for network address translation, thereby shortening the traffic forwarding path of the virtual switch and improving the traffic forwarding efficiency of the virtual switch.

[0104] In addition to the above-described message forwarding method and device for a virtual switch, an embodiment of the present application further provides a computer device, which integrates any one of the message forwarding devices for a virtual switch provided in the embodiment of the present application, and the computer device includes:

[0105] one or more processors;

[0106] Memory; and

[0107] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by a processor to execute any step in any embodiment of the above-mentioned method for forwarding a message for a virtual switch.

[0108] The embodiment of the present application also provides a computer device, which integrates any of the message forwarding devices for virtual switches provided in the embodiment of the present application. Figure 6 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:

[0109] The computer device may include one or more processing core processors 601, one or more computer readable storage medium storage units 602, a power supply 603, an input unit 604 and other components. Those skilled in the art will understand that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0110] The processor 601 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the storage unit 602 and calling data stored in the storage unit 602, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.

[0111] The storage unit 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the storage unit 602. The storage unit 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the storage unit 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the storage unit 602 may also include a memory controller to provide the processor 601 with access to the storage unit 602.

[0112] The computer device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0113] The computer device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0114] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in the embodiment of the present application, the processor 601 in the computer device will load the executable file corresponding to the process of one or more application programs into the storage unit 602 according to the following instructions, and the processor 601 will run the application program stored in the storage unit 602, thereby realizing various functions, as follows:

[0115] Receive a first message sent by a user terminal; detect whether the virtual switch stores user account information corresponding to the user terminal, the user account information is used for network address translation, and the user account information is obtained from a virtual client device connected to the virtual switch; if the virtual switch stores user account information corresponding to the user terminal, perform network address translation on the first message based on the user account information to obtain a second message; send the second message to an external network;

[0116] Alternatively, obtain user account information assigned to the user terminal; and send the user account information to the virtual switch.

[0117] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. The computer-readable storage medium stores multiple instructions, which can be loaded by a processor to execute the steps of any of the message forwarding methods for a virtual switch provided in the embodiment of the present application. For example, the instruction can execute the following steps:

[0118] Receive a first message sent by a user terminal; detect whether the virtual switch stores user account information corresponding to the user terminal, the user account information is used for network address translation, and the user account information is obtained from a virtual client device connected to the virtual switch; if the virtual switch stores user account information corresponding to the user terminal, perform network address translation on the first message based on the user account information to obtain a second message; send the second message to an external network;

[0119] Alternatively, obtain user account information assigned to the user terminal; and send the user account information to the virtual switch.

[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] The above is a detailed introduction to a message forwarding method and related equipment for a virtual switch provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A message forwarding method for a virtual switch, characterized in that: The method is applied to a virtual switch, comprising: Receive a first message sent by a user terminal via a data center switch; Determine a message type of the first message, where the message type includes at least one of a forwarding message and a control message; If the message type of the first message is a forwarding message, detecting whether the virtual switch stores user account information corresponding to the user end, the user account information is used for network address translation, and the user account information is obtained from a virtual client device connected to the virtual switch; if the virtual switch stores user account information corresponding to the user end, performing network address translation processing on the first message based on the user account information to obtain a second message; and sending the second message to the external network via the data center switch and the broadband access server in sequence; If the message type of the first message is a control message, the control message is sent to the virtual client device to control the virtual client device to perform Internet dial-up based on the control message.

2. The message forwarding method for a virtual switch according to claim 1, characterized in that: After detecting whether the virtual switch stores the user account information corresponding to the user terminal, the method further includes: If the user account information corresponding to the user terminal is not stored in the virtual switch, a prompt message indicating abnormal network connection is fed back to the user terminal so that the virtual client device can dial up to the Internet.

3. The message forwarding method for a virtual switch according to claim 1, characterized in that: The detecting whether the virtual switch stores user account information corresponding to the user terminal includes: Obtaining the virtualized network tunnel identifier and user terminal attribute information in the first message; Among the multiple account information stored in the virtual switch, whether there is account information including the virtualized network tunnel identifier and the user terminal attribute information is detected to determine whether the virtual switch stores user account information corresponding to the user terminal.

4. A message forwarding method for a virtual switch, characterized in that: The method is applied to a virtual client device, the virtual client device is connected to a virtual switch according to any one of claims 1 to 3, and the method comprises: Get the user account information assigned to the client; The user account information is sent to the virtual switch, wherein the virtual switch stores the user account information, performs network address translation on the first message sent by the user terminal based on the user account information to obtain a second message, and sends the second message to an external network.

5. The message forwarding method for a virtual switch according to claim 4, characterized in that: The user account information includes Internet dial-up information and IP allocation information of the user terminal, and the acquiring of the user account information allocated to the user terminal includes: Based on the control message for Internet dialing sent by the user terminal, Internet dialing processing is performed to obtain Internet dialing information of the user terminal; An IP address is allocated to the user terminal to obtain IP allocation information of the user terminal.

6. A message forwarding system for a virtual switch, characterized in that: The system includes a virtual switch and a virtual client device, the virtual switch is connected to the virtual client device, the virtual switch is used to execute the message forwarding method for the virtual switch described in any one of claims 1 to 3, and the virtual client device is used to execute the message forwarding method for the virtual switch described in any one of claims 4 to 5.

7. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the message forwarding method for a virtual switch according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the message forwarding method for a virtual switch as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for transmitting message

    CN104601432A