CN113114565B - Data message forwarding method and device, storage medium and electronic equipment - Google Patents

Data message forwarding method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113114565B
CN113114565B CN202110384947.7A CN202110384947A CN113114565B CN 113114565 B CN113114565 B CN 113114565B CN 202110384947 A CN202110384947 A CN 202110384947A CN 113114565 B CN113114565 B CN 113114565B
Authority
CN
China
Prior art keywords
data
forwarding
data message
message
outbound
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110384947.7A
Other languages
Chinese (zh)
Other versions
CN113114565A (en
Inventor
刘松林
李力
董玢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Beijing Huijun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Huijun Technology Co ltd filed Critical Beijing Huijun Technology Co ltd
Priority to CN202110384947.7A priority Critical patent/CN113114565B/en
Publication of CN113114565A publication Critical patent/CN113114565A/en
Application granted granted Critical
Publication of CN113114565B publication Critical patent/CN113114565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/70Routing based on monitoring results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/2425Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
    • H04L47/2433Allocation of priorities to traffic types
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The present disclosure relates to the field of computers, and in particular, to a data packet forwarding method, a data packet forwarding device, a computer readable storage medium, and an electronic device, where the method includes: obtaining a data message and judging the direction of the data message; when the data message is an incoming data message, forwarding the incoming data message to target terminal equipment according to the routing information corresponding to the incoming data message; when the data message is a forward data message, acquiring a plurality of forwarding gateways corresponding to the forward data message and forwarding priorities corresponding to the forwarding gateways, and determining a target forwarding gateway of the forward data message according to the forwarding priorities; and forwarding the outgoing data message through the target forwarding gateway. Thus, the problem of poor data message forwarding efficiency is solved.

Description

Data message forwarding method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to a data packet forwarding method, a data packet forwarding device, a computer readable storage medium, and an electronic apparatus.
Background
With the rapid development of the internet, terminal devices accessing the network are also increasing. In the current public cloud data scenario, various forwarding gateways (e.g., NAT gateway, EIP gateway, LB gateway, etc.) are provided for access and services by the intra-cloud physical machines to the public network.
In the related art, the business flow forwarding gateway can be matched with different routing strategies to forward in the north-south direction. For example, when the physical machine in the cloud binds to the NAT gateway, all traffic is forwarded to the NAT gateway through the traffic forwarding gateway, and when the physical machine in the cloud binds to the EIP gateway, all traffic is forwarded to the NAT gateway through the traffic forwarding gateway.
However, in the related art, the priority of the forwarding gateway cannot be adjusted, in some application scenarios, a specific forwarding gateway needs to be used (for example, a user needs to use a high bandwidth, a public network IP uses a large amount of resources, and a NAT gateway needs to be used at the moment), if an EIP gateway is physically bound in the current cloud, the user's requirement cannot be met, and using an unsuitable forwarding gateway leads to problems of poor service processing efficiency, large resources consumption, and the like, thereby resulting in poor user experience.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure aims to provide a data message forwarding method, a data message forwarding device, a computer readable storage medium and electronic equipment, so as to solve the problem of poor data message forwarding efficiency.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a data packet forwarding method, including: obtaining a data message and judging the direction of the data message; when the data message is an incoming data message, forwarding the incoming data message to target terminal equipment according to the routing information corresponding to the incoming data message; when the data message is an outgoing data message, a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways are obtained, and a target forwarding gateway of the outgoing data message is determined according to the forwarding priorities; and forwarding the outbound data message through the target forwarding gateway.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, when the data packet is an inbound data packet, before forwarding the inbound data packet to a target terminal device according to routing information corresponding to the inbound data packet, the method further includes: acquiring data message format information corresponding to the data message; and discarding the data message when the data message format information does not comprise the header information.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the determining a direction of the data packet includes: acquiring a data message routing type corresponding to the data message; and determining that the data message is the outgoing data message or the incoming data message according to the data message routing type.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the obtaining a data packet routing type corresponding to the data packet includes: analyzing the data message to obtain IP address data and subnet data corresponding to the data message; and determining the routing type of the data message corresponding to the data message according to the IP address data and the subnet data.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the obtaining a plurality of forwarding gateways corresponding to the outbound data packet and forwarding priorities corresponding to the plurality of forwarding gateways includes: acquiring a plurality of forwarding gateways corresponding to the outbound data message and configuration data corresponding to the outbound data message; and determining the forwarding priorities corresponding to the forwarding gateways according to the configuration data corresponding to the outgoing data message.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the configuration data includes IP address data, subnet data, and outbound port data, and the determining, according to the configuration data corresponding to the outbound data packet, a forwarding priority corresponding to the plurality of forwarding gateways includes: acquiring a forwarding preset condition; the forwarding preset conditions comprise IP address standard data and subnet standard data; and when the IP address data and the subnet data meet the forwarding preset conditions, determining forwarding priorities corresponding to the forwarding gateways according to the outbound port data.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the forwarding preset condition includes first priority port data, and determining, according to the outbound port data, forwarding priorities corresponding to the plurality of forwarding gateways includes: when the outbound port data is matched with the first priority port data, determining the priority of a first forwarding gateway corresponding to the first priority port data as a first priority; and determining the priority of one or more second forwarding gateways except the first forwarding gateway in the plurality of forwarding gateways as a second priority.
In an exemplary embodiment of the disclosure, the matching the outbound port data with the first priority port data includes: acquiring a matching interval of the first priority port data; and when the outbound port data corresponding to the outbound data message is positioned in the matching section, the outbound port data corresponding to the outbound data message is matched with the port data.
According to a second aspect of the present disclosure, there is provided a data packet forwarding apparatus, including: the data message acquisition module is used for acquiring the data message and the port data corresponding to the data message; the incoming message forwarding module is used for forwarding the incoming data message to the target terminal equipment according to the routing information corresponding to the incoming data message when the data message is the incoming data message; the outbound message gateway determining module is used for acquiring a plurality of forwarding gateways corresponding to the outbound data message and forwarding priorities corresponding to the forwarding gateways when the data message is the outbound data message, and determining a target forwarding gateway of the outbound data message according to the forwarding priorities; and the outgoing data message forwarding module is used for forwarding the outgoing data message through the target forwarding gateway.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a data packet forwarding method as described in the first aspect of the above embodiments.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a processor; and
and a memory, configured to store one or more programs, where the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the data packet forwarding method according to the first aspect of the foregoing embodiments.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
in the data message forwarding method provided by an embodiment of the present disclosure, when a data message is obtained, and a direction of the data message is determined, when the data message is an inbound data message, forwarding the inbound data message to a target terminal device according to routing information corresponding to the inbound data message, and when the data message is an outbound data message, obtaining a plurality of forwarding gateways corresponding to the inbound data message and forwarding priorities corresponding to the plurality of forwarding gateways, determining a target forwarding gateway of the inbound data message according to the forwarding priorities, and forwarding the outbound data message through the target forwarding gateway.
According to the scheme disclosed by the invention, the target forwarding gateway can be determined according to the priority of the forwarding gateway. On one hand, the priorities corresponding to different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted according to the demands of users in time, so that the service demands of different users are met, and the application scenes of the forwarding gateways are further enriched; on the other hand, the forwarding gateway adapting to the current scene can be selected according to the current service scene, so that the service can be flexibly and efficiently operated, the service processing efficiency is improved, the resource consumption is reduced, and the use experience of a user is further enhanced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort. In the drawings:
Fig. 1 schematically illustrates a flow chart of a data packet forwarding method in an exemplary embodiment of the present disclosure;
fig. 2 schematically illustrates a flowchart of discarding a datagram when header information is not included in the datagram format information in an exemplary embodiment of the present disclosure;
fig. 3 schematically illustrates a flowchart of determining whether a data packet is an outbound data packet or an inbound data packet according to a data packet routing type in an exemplary embodiment of the present disclosure;
fig. 4 schematically illustrates a flowchart of determining a data message routing type corresponding to a data message according to IP address data and subnet data in an exemplary embodiment of the present disclosure;
fig. 5 schematically illustrates a flowchart for determining forwarding priorities corresponding to a plurality of forwarding gateways according to configuration data corresponding to outgoing data packets in an exemplary embodiment of the present disclosure;
fig. 6 schematically illustrates a flowchart for determining forwarding priorities corresponding to a plurality of forwarding gateways according to output port data in an exemplary embodiment of the present disclosure;
fig. 7 schematically illustrates a flowchart of determining a priority of a first forwarding gateway corresponding to first priority port data as a first priority and determining priorities of one or more second forwarding gateways other than the first forwarding gateway among a plurality of forwarding gateways as second priorities in an exemplary embodiment of the present disclosure;
Fig. 8 schematically illustrates a flowchart of matching outgoing port data corresponding to an outgoing data packet with port data when the outgoing port data corresponding to the outgoing data packet is located in a matching interval in an exemplary embodiment of the disclosure;
FIG. 9 schematically illustrates a schematic diagram of an intra-cloud physical machine network architecture topology in an exemplary embodiment of the present disclosure;
fig. 10 schematically illustrates a flowchart of acquiring a data packet and determining a target forwarding gateway in an exemplary embodiment of the present disclosure;
fig. 11 schematically illustrates a composition diagram of a data packet forwarding device according to an exemplary embodiment of the present disclosure;
fig. 12 schematically illustrates a structural schematic diagram of a computer system suitable for use in implementing the electronic device of the exemplary embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the disclosed aspects may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known structures, methods, devices, implementations, materials, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, or in one or more software-hardened modules, or in different networks and/or processor devices and/or microcontroller devices.
With the development of the internet, terminal devices accessing the network are increasing. In the current public cloud scenario, an overlay network architecture is generally constructed by adopting a VXLAN tunnel encapsulation technology, and access and service capabilities of an indoor physical machine to a public network can be completed through forwarding gateways such as an EIP (Elastic IP Address, elastic public network) gateway, an LB (LoadBalance) gateway, an NAT (Network Address Translation ) gateway and the like.
Specifically, the EIP gateway supports the static conversion function of the elastic public network IP and the cloud physical machine intranet IP, namely the intranet IP of the cloud physical machine and the elastic public network IP are mapped one by one, and in the Internet, the user can log in the cloud physical machine through the bound EIP; the NAT gateway supports sub-network level binding, realizes the function of actively accessing the Internet by a cloud physical machine in a VPC (Virtual Private Cloud ) through public network IP address conversion, but does not support the function of actively accessing the cloud physical machine in the VPC by the Internet, and the cloud physical machine cannot be actively accessed to the cloud physical machine through the Internet because the cloud physical machine and the public network IP are not mapped one by one; the balanced loader/flow distributor uniformly distributes public network IP routes in the data center, supports VXLAN tunnel encapsulation and decapsulation, realizes the distribution of different service flows, and performs functions such as flow charging and speed limiting on the public network IP.
In the related art, the north-south forwarding of the service traffic can be realized through a service traffic forwarding gateway (bmgw), and when the service traffic passes through the service traffic forwarding gateway, the forwarding gateway can be determined according to a routing policy corresponding to the service traffic. For example, when the subnet where the cloud physical machine is located binds the NAT gateway, all Internet traffic is forwarded to the NAT gateway through bmgw; when the cloud physical machine binds the elastic public network IP, because the EIP routing has higher priority than the NAT routing, the traffic actively accessing the Internet by the cloud physical machine is forwarded to the EIP gateway through the traffic forwarding gateway, and in addition, other cloud physical machines which are not bound with the elastic public network IP in the sub-network are forwarded through the NAT gateway.
In the service flow forwarding scheme in the related technology, when the cloud physical machine binds the elastic public network, forwarding can only be performed through the EIP gateway. However, in certain scenarios, the user has certain needs. For example, NAT gateways are required when the user's requirements are ultra-large bandwidth, large public network IP usage, high availability, and security. The existing flow forwarding scheme cannot adjust the forwarding gateway according to the service, so that the service processing efficiency is poor, the resource consumption is high, and the use experience of a user is poor.
According to the data message forwarding method provided in the present exemplary embodiment, when a data message is obtained and a direction of the data message is determined, when the data message is an inbound data message, the inbound data message is forwarded to a target terminal device according to routing information corresponding to the inbound data message, when the data message is an outbound data message, a plurality of forwarding gateways corresponding to the inbound data message and forwarding priorities corresponding to the plurality of forwarding gateways are obtained, a target forwarding gateway of the inbound data message is determined according to the forwarding priorities, and the outbound data message is forwarded through the target forwarding gateway. As shown in fig. 1, the data packet forwarding method may include the following steps:
step S110, obtaining a data message and judging the direction of the data message;
step S120, when the data message is an incoming data message, forwarding the incoming data message to the target terminal device according to the routing information corresponding to the incoming data message;
step S130, when the data message is the outgoing data message, a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways are obtained, and a target forwarding gateway of the outgoing data message is determined according to the forwarding priorities;
And step S140, forwarding the outgoing data message through the target forwarding gateway.
In the data message forwarding method provided in this example embodiment, the target forwarding gateway may be determined according to the priority of the forwarding gateway. On one hand, the priorities corresponding to different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted according to the demands of users in time, so that the service demands of different users are met, and the application scenes of the forwarding gateways are further enriched; on the other hand, the forwarding gateway adapting to the current scene can be selected according to the current service scene, so that the service can be flexibly and efficiently operated, the service processing efficiency is improved, the resource consumption is reduced, and the use experience of a user is further enhanced.
Next, steps S110 to S140 of the data packet forwarding method in the present exemplary embodiment will be described in more detail with reference to the drawings and the embodiments.
Step S110, obtaining a data message and judging the direction of the data message;
in one example embodiment of the present disclosure, a data message during a network transmission may be obtained. Specifically, the data packet may include data units exchanged and transmitted in the network, that is, data blocks to be sent by the station at one time. The message contains the complete data information to be sent, and the length of the message can be inconsistent, and the length is unlimited and variable. Further, during network transmission, the data packets are continuously encapsulated into packets, and frames for transmission, wherein some information segments, such as header, are added, and are organized in a certain format. The package includes various information, such as message type, message version, message length, message entity, etc. Messages may be used to exchange information between systems for requests and responses, and may be required to comply with a prescribed format.
In one example embodiment of the present disclosure, after the data message is acquired, the direction of the data message may be determined. Specifically, when the data message is sent by a client/terminal device and the like and received by a server, the data message is an outgoing data message; the data message is sent by the server and received by the client/terminal equipment, etc., and is an incoming data message. The direction of the data message can be determined by the format of the data message, and the direction of the data message can also be determined by the specific content of the data message. It should be noted that, the determination method of the direction of the data packet in the present disclosure is not limited in particular.
In an example embodiment of the present disclosure, data message format information corresponding to a data message may be acquired, and when header information is not included in the data message format information, the data message is discarded. Referring to fig. 2, when header information is not included in the datagram format information, the datagram is discarded, and the following steps S210 to S220 may be included:
step S210, obtaining data message format information corresponding to the data message;
in one example embodiment of the present disclosure, after the data message is acquired, data message format information of the data message may be acquired. Specifically, the data message format information is the format of the data message, and the type of the data message can be determined according to the data message format information. For example, the VXLAN data message may include information such as an original message, VXLAN Header, outer IP Header, outer MAC Header, UDP Header, etc. It should be noted that, the present disclosure does not limit the format information of the data message corresponding to the data message in particular.
Step S220, discarding the data message when the header information is not included in the data message format information.
In an example embodiment of the present disclosure, after the data message format information is obtained in the above steps, it may be determined whether header information is included in the data message format information, and when the header information is not included in the data message format information, the data message is discarded. Specifically, the header information may include a node address corresponding to the data packet, and when the format information of the data packet does not include the header information, the node address corresponding to the data packet cannot be obtained, and further the data packet cannot be forwarded. For example, for a VXLAN data packet, the IP address of the VTEP may be encapsulated in an Outer IP Header, the source IP address in the VXLAN packet is the VTEP address of the node, the destination IP address in the VXLAN packet is the VTEP address of the peer node, a pair of VTEP addresses corresponds to one VXLAN tunnel, and for a data packet without the VXLAN tunnel, discarding processing may be directly performed.
Through the steps S210 to S220, the data message format information corresponding to the data message can be obtained, and when the data message format information does not include header information, the data message is discarded.
In an example embodiment of the present disclosure, a data message routing type corresponding to a data message may be obtained, and the data message is determined to be an outbound data message or an inbound data message according to the data message routing type. Referring to fig. 3, determining whether a data packet is an outbound data packet or an inbound data packet according to a data packet routing type may include the following steps S310 to S320:
step S310, obtaining the routing type of the data message corresponding to the data message;
in an example embodiment of the present disclosure, a data message routing type corresponding to a data message may be obtained. Specifically, the data message routing type may be used to indicate the classification of the transaction to be performed after the data message is successfully matched with the routing table. A routing table is a spreadsheet (file) or class database stored in a router or networked computer. The routing table stores paths that point to specific network addresses. Further, the routing table contains topology information of the periphery of the network. The main objective of the routing table set-up is to implement routing protocols and static routing. The routing information of the data message corresponding to the data message can be determined through the routing table. For example, for VXLAN data packets, the routing types may include a network type, a NAT type, and an EIP type.
Step S320, determining the data message as an outbound data message or an inbound data message according to the data message routing type.
In an example embodiment of the present disclosure, after the data message routing type corresponding to the data message is obtained through the above steps, the data message may be determined to be an outbound data message or an inbound data message according to the data message routing type. Specifically, the data message routing type may be used to indicate a transaction to be performed after the data message is successfully matched with the routing table, that is, the direction of the data message may be determined by the data message routing type. If the data message routing type is sent by the client/terminal equipment and received by the server, the data message is an outgoing data message; if the data message routing type is sent by the server and received by the client/terminal equipment, the data message is an incoming data message. For example, for VXLAN data messages, the network type is an inbound data message, and the NAT type and the EIP type are outbound data messages.
Through the steps S310 to S320, the data message routing type corresponding to the data message can be obtained, and the data message is determined to be an outgoing data message or an incoming data message according to the data message routing type.
In an example embodiment of the present disclosure, data packets may be parsed to obtain IP address data and subnet data corresponding to the data packets, and a data packet routing type corresponding to the data packets may be determined according to the IP address data and the subnet data. Referring to fig. 4, determining a data packet routing type corresponding to a data packet according to IP address data and subnet data may include the following steps S410 to S420:
step S410, analyzing the data message to obtain IP address data and subnet data corresponding to the data message;
in an example embodiment of the present disclosure, after obtaining the data packet, the data packet may be parsed to obtain IP address data and subnet data corresponding to the data packet. Specifically, in the network transmission process, the data message needs to be encapsulated so as to be transmitted. For example, for VXLAN messages, the original message may be encapsulated according to VXLAN header, UDP header, outer IP header, outer ethernet header. After receiving the data message, the data message needs to be parsed to obtain IP address data and subnet data corresponding to the data message, wherein the IP address data can be used for indicating an intranet IP address of the terminal equipment/client, and the subnet data can be used for indicating a subnet where the terminal equipment/client is located. For example, for a VXLAN message, the IP address data is an IP header in the original message, which represents an intranet IP address of an intra-cloud physical machine, and the subnet data is a VNI in the VXLAN header. It should be noted that, the parsing method of the data message is not particularly limited in this disclosure.
Step S420, determining the routing type of the data message corresponding to the data message according to the IP address data and the subnet data.
In an example embodiment of the present disclosure, after the IP address data and the subnet data corresponding to the data packet are obtained through the above steps, the routing type of the data packet corresponding to the data packet may be determined according to the IP address data and the subnet data. In particular, the IP address data may be the same in different subnets, so that a terminal device/client can be uniquely determined in combination with the IP address data and the subnet data. The IP address data and subnet data may be compared with entries in the routing table, and after determining the terminal device/client, the routing type of the data message corresponding to the data message may be obtained according to the routing table.
Through the steps S410 to S420, the data message may be parsed to obtain the IP address data and the subnet data corresponding to the data message, and the routing type of the data message corresponding to the data message may be determined according to the IP address data and the subnet data.
Step S120, when the data message is an incoming data message, forwarding the incoming data message to the target terminal device according to the routing information corresponding to the incoming data message;
In an example embodiment of the present disclosure, after determining the direction of the data packet through the above steps, it may be obtained whether the data packet is an inbound data packet or an outbound data packet. When the data message is an incoming data message, the incoming data message can be forwarded to the target terminal device according to the routing information corresponding to the incoming data message, wherein the terminal device can comprise an intra-cloud physical machine. Specifically, when the data message is sent by the server and received by the client/terminal device, the data message is an incoming data message. When the data message enters the client/terminal equipment, the data message does not need to pass through a forwarding gateway, and only the data message needs to be forwarded to the corresponding node.
Therefore, the routing information corresponding to the incoming data message can be obtained, the routing information can include routing type, encapsulation information and the like, the routing type can be used for indicating a transaction to be performed after the data message is successfully matched with the routing table, and when the data message is the incoming data message, the data message can be directly forwarded to the target terminal device, or the data message can be filled and then sent to the target terminal device. The specific content of the routing information is not particularly limited in this disclosure.
For example, for the VXLAN message, the IP information on the outer layer, VNI information, and destination MAC information on the inner layer of the VXLAN message may be modified and filled and then forwarded to a tor (Top of Rack, a wiring mode of a data center) of the intra-cloud physical machine, which means forwarding the data message to an upstream switch where the intra-cloud physical machine is located, or directly forwarding the data message to the intra-cloud physical machine.
Step S130, when the data message is the outgoing data message, a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways are obtained, and a target forwarding gateway of the outgoing data message is determined according to the forwarding priorities;
in an example embodiment of the present disclosure, after determining the direction of the data packet through the above steps, it may be obtained whether the data packet is an inbound data packet or an outbound data packet. When the data message is an outbound data message, the outbound data message is required to be forwarded to the server through the forwarding gateway, and a plurality of forwarding gateways corresponding to the outbound data message and forwarding priorities corresponding to the forwarding gateways can be obtained. Specifically, when the data message is sent by the client/terminal device and the like and received by the server, the data message is the outgoing data message. When forwarding the outgoing data message, the outgoing data message can be forwarded through different forwarding gateways. For example, for public cloud service scenarios, when the data packet is an outbound data packet, forwarding may be performed through an EIP gateway or a NAT gateway. At this time, priorities of the plurality of forwarding gateways may be obtained, and a target forwarding gateway may be determined according to the priorities of the forwarding gateways, where the target forwarding gateway may be used to forward the outbound data packet. Further, the forwarding gateway with higher priority may be determined as the target forwarding gateway, or the forwarding gateway with lower priority may be determined as the target forwarding gateway.
In an example embodiment of the present disclosure, a plurality of forwarding gateways corresponding to outbound data packets and configuration data corresponding to the outbound data packets may be obtained, and forwarding priorities corresponding to the plurality of forwarding gateways may be determined according to the configuration data corresponding to the outbound data packets. Referring to fig. 5, determining forwarding priorities corresponding to a plurality of forwarding gateways according to configuration data corresponding to outgoing data packets may include the following steps S510 to S520:
step S510, obtaining a plurality of forwarding gateways corresponding to the outgoing data message and configuration data corresponding to the outgoing data message;
in an example embodiment of the present disclosure, a plurality of forwarding gateways corresponding to outgoing data packets and configuration data corresponding to outgoing data packets may be obtained. Specifically, when forwarding the outbound data message, forwarding can be performed through different forwarding gateways, so that all forwarding gateways and configuration data corresponding to the outbound data message can be obtained. Specifically, after the outbound data message is obtained, the outbound data message may be parsed, and configuration data corresponding to the outbound data message may be obtained. Wherein the configuration data may be used to indicate priorities of the plurality of forwarding gateways.
Step S520, determining the forwarding priority corresponding to the forwarding gateways according to the configuration data corresponding to the outgoing data message.
In an example embodiment of the present disclosure, after the configuration data corresponding to the outbound data packet is obtained, forwarding priorities corresponding to the plurality of forwarding gateways may be determined according to the configuration data corresponding to the outbound data packet. For example, the configuration data may be a priority sequence table, and the priority corresponding to the forwarding gateway may be searched in the table. It should be noted that, the specific content of the configuration data is not particularly limited in this disclosure.
Through the steps S510 to S520, a plurality of forwarding gateways corresponding to the outbound data packet and configuration data corresponding to the outbound data packet can be obtained, and forwarding priorities corresponding to the plurality of forwarding gateways can be determined according to the configuration data corresponding to the outbound data packet.
In an example embodiment of the present disclosure, a forwarding preset condition may be obtained, and when the IP address data and the subnet data satisfy the forwarding preset condition, forwarding priorities corresponding to a plurality of forwarding gateways are determined according to the outbound port data. Referring to fig. 6, determining forwarding priorities corresponding to a plurality of forwarding gateways according to output port data may include the following steps S610 to S620:
Step S610, obtaining forwarding preset conditions; the forwarding preset conditions comprise IP address standard data and subnet standard data;
in an example embodiment of the present disclosure, the configuration data may include IP address data, subnet data, and outbound port data, where the IP address data and subnet data may uniquely identify a terminal device/client, and the outbound port data may be used to represent port information through which the data packet passes. For example, for public cloud scenarios, the IP address data is a three-layer source IP address including an inner layer protocol, the subnet data is a subnet identification, and the outgoing port data is a four-layer destination port of the inner layer protocol. The forwarding preset condition may include a condition that needs to be satisfied when forwarding is performed. The forwarding preset conditions comprise IP address standard data and subnet standard data.
Step S620, when the IP address data and the subnet data meet the preset forwarding conditions, forwarding priorities corresponding to a plurality of forwarding gateways are determined according to the outbound port data.
In an example embodiment of the present disclosure, after the IP address data and the subnet data are acquired through the above steps, it may be determined whether the IP address data and the subnet data satisfy the forwarding preset condition. Specifically, when the IP address data and the subnet data are the same as the IP address standard data and the subnet data are the same as the subnet standard data, a terminal device/client can be uniquely determined when the IP address data and the subnet data satisfy the forwarding preset condition. At this time, forwarding priorities corresponding to the plurality of forwarding gateways may be determined according to the outbound port data in the configuration data. Specifically, a port section corresponding to the port data can be obtained, each forwarding gateway corresponds to a certain section in the port section, and if the port data falls into a certain section, the priority of the forwarding gateway corresponding to the section is set to be higher. The present disclosure is not limited to a specific manner of determining the priority of the plurality of forwarding gateways according to the output port data.
Through the steps S610 to S620, the forwarding preset conditions may be obtained, and when the IP address data and the subnet data meet the forwarding preset conditions, the forwarding priorities corresponding to the forwarding gateways are determined according to the outbound port data.
In one example embodiment of the present disclosure, when the outbound port data matches the first priority port data, a priority of a first forwarding gateway corresponding to the first priority port data is determined as a first priority, and a priority of one or more second forwarding gateways other than the first forwarding gateway among the plurality of forwarding gateways is determined as a second priority. Referring to fig. 7, determining the priority of the first forwarding gateway corresponding to the first priority port data as the first priority and determining the priority of one or more second forwarding gateways other than the first forwarding gateway among the plurality of forwarding gateways as the second priority may include steps S710 to S720:
step S710, when the output port data is matched with the first priority port data, determining the priority of the first forwarding gateway corresponding to the first priority port data as a first priority;
in an example embodiment of the present disclosure, the forwarding preset condition further includes first priority port data, and when the outbound port data in the configuration data matches the first priority port data, the priority of the first forwarding gateway corresponding to the first priority port data may be determined as the first priority. The first priority port data may include a continuous section, a single section, a plurality of separation sections, and the like. For example, the destination port characteristic interval is [1,65535], and in this case, the continuous interval [1,1024] may be set as the first priority port data, the individual interval [1] may be set as the first priority port data, and the plurality of separation intervals [2,22] [3,33] [4,44] may be set as the first priority port data. Since the first priority port data is preset, the priorities of the plurality of forwarding gateways can be determined by setting the first priority port data.
For example, the forwarding gateway includes an EIP gateway and a NAT gateway, and the first priority port data corresponding to the EIP gateway may be set to be [1,65535] (65535 at maximum), where the priority of the EIP gateway is higher than that of the NAT gateway, that is, all outgoing data packets will be forwarded through the EIP, and the EIP gateway may be determined as the target forwarding gateway.
In step S720, priorities of one or more second forwarding gateways other than the first forwarding gateway among the plurality of forwarding gateways are determined as second priorities.
In one example embodiment of the present disclosure, after determining the priority of the first forwarding gateway, the priorities of the remaining forwarding gateways may be set to the second priority. For example, the forwarding gateway includes an EIP gateway and a NAT gateway, where the first priority port data corresponding to the EIP gateway may be set to [1024,65535] (65535 max), the port data corresponding to the NAT gateway is set to [1,1023], and when the priority of the EIP gateway is determined to be the first priority, the priority of the NAT gateway is determined to be the second priority.
At this time, if the outbound port data (i.e., the four-layer destination port of the inner layer protocol) is located between [1024,65535], it indicates that the current outbound data packet is an outbound response data packet matching the EIP gateway. Specifically, the outgoing response data message matched with the EIP gateway is not a data message for actively accessing the Internet by the terminal device/client, and the data message must be forwarded through the EIP gateway, so that a certain port interval needs to be reserved to ensure normal forwarding of the outgoing response data message, i.e. the EIP gateway can be determined as a target forwarding gateway at this time; if the outbound port data is located between [1,1023], then the priority of the EIP gateway is smaller than that of the NAT gateway, and the NAT gateway may be determined to be the target forwarding gateway.
Through the steps S710 to S720, when the outbound port data matches the first priority port data, the priority of the first forwarding gateway corresponding to the first priority port data is determined as the first priority, and the priority of one or more second forwarding gateways other than the first forwarding gateway among the plurality of forwarding gateways is determined as the second priority.
In an example embodiment of the present disclosure, a matching interval of the first priority port data may be obtained, and when the outbound port data corresponding to the outbound data packet is located in the matching interval, the outbound port data corresponding to the outbound data packet is matched with the port data. Referring to fig. 8, when the outbound port data corresponding to the outbound data packet is located in the matching section, the outbound port data corresponding to the outbound data packet is matched with the port data, and the following steps S810 to S820 may be included:
step S810, obtaining a matching section of the first priority port data;
step S820, when the outbound port data corresponding to the outbound data packet is located in the matching section, the outbound port data corresponding to the outbound data packet is matched with the port data.
In an example embodiment of the present disclosure, the first priority port data may include a matching section, when the first priority port data is matched with the outgoing port data, the matching section of the first priority port data may be obtained, and when the outgoing port data corresponding to the outgoing data packet is located in the matching section, the outgoing port data corresponding to the outgoing data packet is matched with the port data. For example, the matching interval of the first priority port data is [1024,65535], the outgoing port data corresponding to the outgoing data packet is 35534, at this time 35534 is at [1024,65535], the outgoing port data is matched with the port data, and if the outgoing port data corresponding to the outgoing data packet is a certain value in [1,1023], the outgoing port data is not matched with the port data.
Through the steps S810 to S820, a matching section of the first priority port data may be obtained, and when the outbound port data corresponding to the outbound data packet is located in the matching section, the outbound port data corresponding to the outbound data packet is matched with the port data.
And step S140, forwarding the outgoing data message through the target forwarding gateway.
In an example embodiment of the present disclosure, the scheme of the present disclosure may be performed by a programmable switch, and matching of forwarding preset conditions may be implemented by an MAU table (Match action unit), that is, performing actions corresponding to a key after matching the key is successful. Specifically, the MAU table includes a subnet identifier, an inner layer protocol three-layer source IP address, and an inner layer protocol four-layer destination port, where the subnet identifier and the inner layer protocol three-layer source IP address need to be matched accurately, the inner layer protocol four-layer destination port may be interval matched, and after the subnet identifier, the inner layer protocol three-layer source IP address, and the inner layer protocol four-layer destination port are all matched successfully, a corresponding action may be executed, for example, at this time, a gateway corresponding to the inner layer protocol four-layer destination port is an EIP gateway, and then the target forwarding gateway is determined as the target forwarding gateway. Further, the programmable switch may modify the MAU table to accommodate current traffic demands.
In an example embodiment of the present disclosure, for data packets of TCP and UDP, priorities of the EIP gateway and NAT gateway may be determined by matching inner layer protocol four layer destination port feature intervals; and for the data message of the ICMP, whether the data message is an outbound data message or an inbound data message can be determined through the first byte in the ICMP header (type), when the first byte of the type is 0, the data message is indicated to be the inbound data message, when the first byte of the type is 8, the data message is indicated to be the outbound data message, when the data message is determined to be the outbound data message, if the priority of the NAT gateway is greater than the priority of the EIP gateway, the outbound data message is forwarded through the NAT gateway, and if the priority of the NAT gateway is less than the priority of the EIP gateway, the outbound data message is forwarded through the EIP gateway.
In one example embodiment of the present disclosure, the priority of the NAT gateway and the EIP gateway may be set according to traffic situation. For example, in the case of a service requiring an ultra-large bandwidth, a large amount of public network IP usage, high availability, and security, the data packets passing through these ports may be forwarded through the NAT gateway; in the service situation that external service is needed to be provided, and the operation and maintenance personnel can conveniently conduct remote operation, the EIP gateway is more suitable for the requirement of a user port, and therefore the EIP gateway can be used for forwarding the user port.
In an example embodiment of the present disclosure, referring to fig. 9, an outbound data packet is sent by an intra-cloud physical machine, and sent to a virtual private network, the virtual private network forwards the outbound data packet to a traffic forwarding gateway, determines a priority of a NAT gateway or an EIP gateway in the traffic forwarding gateway (bmgw), determines a target forwarding network according to the priority of the NAT gateway or the EIP gateway, and then sends the outbound data packet passing through the NAT gateway or the EIP gateway to a traffic distributor, and finally, the traffic distributor sends the outbound data packet to the Internet.
In an example embodiment of the present disclosure, after a data packet is acquired, it may be first determined whether the data packet has a VXLAN tunnel, the data packet without the VXLAN tunnel is discarded, then it is determined whether the data packet satisfies a preset forwarding condition, if the forwarding condition is satisfied, the priority of the EIP gateway is greater than that of the NAT gateway at the time, that is, the routing information of the EIP gateway may be acquired, the direction of the data packet may be determined according to the routing table, when the data packet is an inbound data packet, the neighbor routing information may be acquired, the data packet is forwarded to a tor of an intra-cloud physical machine, when the data packet is an outbound data packet, the data packet may be predetermined to be forwarded to the NAT gateway (default gateway), then it is determined whether the data packet satisfies the preset forwarding condition, if the forwarding condition is satisfied, the priority of the EIP gateway is greater than that of the NAT gateway at the time, and the EIP gateway is determined as a target forwarding gateway, if the forwarding condition is not satisfied, the priority of the EIP gateway is determined as the target NAT gateway. Referring to fig. 10, the steps of acquiring a data packet and determining a target forwarding gateway may include the following steps S1001 to S1023:
Step S1001, obtaining a data message; step S1003, whether the data message has a VXLAN tunnel; step S1005, discarding the data message; step S1007, analyzing the data message and obtaining IP address data and subnet data; step S1009, matching the routing table according to the IP address data and the subnet data; step S1011, determining the direction of the data message according to the route type; step S1013, when the data message is an incoming data message, obtaining neighbor routing information; step S1015, the data message is forwarded to a tor of the physical machine in the cloud; step S1017, when the data message is an outbound data message, the data message is predetermined to be forwarded to the NAT gateway; step S1019, judging whether the data message meets the preset forwarding condition; step S1021, if the forwarding preset condition is met, acquiring the routing information of the EIP; step S1023, the EIP gateway is determined as a target forwarding gateway; step S1025, if the forwarding preset condition is not satisfied, determining the NAT gateway as the target forwarding gateway.
In an example embodiment of the present disclosure, when a data packet is acquired and a direction of the data packet is determined, when the data packet is an inbound data packet, forwarding the inbound data packet to a target terminal device according to routing information corresponding to the inbound data packet, and when the data packet is an outbound data packet, acquiring a plurality of forwarding gateways corresponding to the inbound data packet and forwarding priorities corresponding to the plurality of forwarding gateways, determining a target forwarding gateway of the inbound data packet according to the forwarding priorities, and forwarding the outbound data packet through the target forwarding gateway.
On one hand, the priorities corresponding to different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted according to the demands of users in time, so that the service demands of different users are met, and the application scenes of the forwarding gateways are further enriched; on the other hand, the forwarding gateway adapting to the current scene can be selected according to the current service scene, so that the service can be flexibly and efficiently operated, the service processing efficiency is improved, the resource consumption is reduced, and the use experience of a user is further enhanced.
It is noted that the above-described figures are merely schematic illustrations of processes involved in a method according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
In addition, in an exemplary embodiment of the present disclosure, a data packet forwarding apparatus is also provided. Referring to fig. 11, a data packet forwarding apparatus 1100 includes: the data message acquisition module 1110, the inbound message forwarding module 1120, the outbound message gateway determination module 1130, and the outbound data message forwarding module 1140.
The data message acquisition module is used for acquiring the data message and port data corresponding to the data message; the incoming message forwarding module is used for forwarding the incoming data message to the target terminal equipment according to the routing information corresponding to the incoming data message when the data message is the incoming data message; the outbound message gateway determining module is used for obtaining a plurality of forwarding gateways corresponding to the outbound message and forwarding priorities corresponding to the forwarding gateways when the data message is the outbound data message, and determining a target forwarding gateway of the outbound message according to the forwarding priorities; and the outbound data message forwarding module is used for forwarding the outbound data message through the target forwarding gateway.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, before forwarding, when the data packet is an inbound data packet, the inbound data packet to the target terminal device according to the routing information corresponding to the inbound data packet, the method further includes: obtaining data message format information corresponding to the data message; when the header information is not included in the data message format information, the data message is discarded.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, determining a direction of a data packet includes: obtaining a data message route type corresponding to the data message; and determining the data message as an outgoing data message or an incoming data message according to the routing type of the data message.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, obtaining a data packet routing type corresponding to a data packet includes: analyzing the data message to obtain IP address data and subnet data corresponding to the data message; and determining the routing type of the data message corresponding to the data message according to the IP address data and the subnet data.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, obtaining a plurality of forwarding gateways corresponding to a data packet and forwarding priorities corresponding to the plurality of forwarding gateways includes: obtaining a plurality of forwarding gateways corresponding to the outgoing data messages and configuration data corresponding to the outgoing data messages; and determining the forwarding priorities corresponding to the forwarding gateways according to the configuration data corresponding to the outgoing data messages.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the configuration data includes IP address data, subnet data, and outbound port data, and determining, according to the configuration data corresponding to the outbound data packet, forwarding priorities corresponding to the plurality of forwarding gateways includes: acquiring a forwarding preset condition; the forwarding preset conditions comprise IP address standard data and subnet standard data; when the IP address data and the subnet data meet the preset forwarding conditions, forwarding priorities corresponding to the forwarding gateways are determined according to the output port data.
In an exemplary embodiment of the present disclosure, based on the foregoing solution, the forwarding preset condition includes first priority port data, and determining forwarding priorities corresponding to a plurality of forwarding gateways according to outgoing port data includes: when the output port data is matched with the first priority port data, determining the priority of a first forwarding gateway corresponding to the first priority port data as a first priority; the priority of one or more second forwarding gateways other than the first forwarding gateway of the plurality of forwarding gateways is determined as a second priority.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, matching the outbound port data with the first priority port data includes: acquiring a matching interval of the first priority port data; and when the outbound port data corresponding to the outbound data message is positioned in the matching section, the outbound port data corresponding to the outbound data message is matched with the port data.
Since each functional module of the data packet forwarding device according to the example embodiment of the present disclosure corresponds to a step of the foregoing example embodiment of the data packet forwarding method, for details not disclosed in the embodiment of the present disclosure, please refer to the foregoing embodiment of the data packet forwarding method of the present disclosure.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In addition, in the exemplary embodiment of the present disclosure, an electronic device capable of implementing the above data packet forwarding method is also provided.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 1200 according to such an embodiment of the present disclosure is described below with reference to fig. 12. The electronic device 1200 shown in fig. 12 is merely an example, and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 12, the electronic device 1200 is in the form of a general purpose computing device. Components of electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one memory unit 1220, a bus 1230 connecting the different system components (including the memory unit 1220 and the processing unit 1210), and a display unit 1240.
Wherein the storage unit stores program code that is executable by the processing unit 1210 such that the processing unit 1210 performs steps according to various exemplary embodiments of the present disclosure described in the above-described "exemplary methods" section of the present specification. For example, the processing unit 1210 may perform step S110 shown in fig. 1, acquire a data packet, and determine the direction of the data packet; step S120, when the data message is an incoming data message, forwarding the incoming data message to the target terminal device according to the routing information corresponding to the incoming data message; step S130, when the data message is the outgoing data message, a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways are obtained, and a target forwarding gateway of the outgoing data message is determined according to the forwarding priorities; and step S140, forwarding the outgoing data message through the target forwarding gateway.
As another example, the electronic device may implement the various steps shown in fig. 1.
The storage unit 1220 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 1221 and/or cache memory unit 1222, and may further include Read Only Memory (ROM) 1223.
Storage unit 1220 may also include a program/utility 1224 having a set (at least one) of program modules 1225, such program modules 1225 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 1230 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 1200 may also communicate with one or more external devices 1270 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 1200, and/or any device (e.g., router, modem, etc.) that enables the electronic device 1200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1250. Also, the electronic device 1200 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet through the network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 over bus 1230. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 1200, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification is also provided. In some possible embodiments, the various aspects of the present disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Furthermore, the above-described figures are only schematic illustrations of processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (8)

1. The data message forwarding method is characterized by comprising the following steps:
obtaining a data message and judging the direction of the data message;
when the data message is an incoming data message, forwarding the incoming data message to target terminal equipment according to the routing information corresponding to the incoming data message;
When the data message is an outbound data message, acquiring a plurality of forwarding gateways corresponding to the outbound data message and configuration data corresponding to the outbound data message, wherein the configuration data comprises IP address data, subnet data and outbound port data; acquiring a forwarding preset condition; the forwarding preset conditions comprise IP address standard data, subnet standard data and first priority port data; when the IP address data and the subnet data meet the forwarding preset conditions, determining forwarding priorities corresponding to the forwarding gateways according to the outbound port data, and determining a target forwarding gateway of the outbound data message according to the forwarding priorities; wherein when the outbound port data matches the first priority port data, determining, according to the outbound port data, forwarding priorities corresponding to the plurality of forwarding gateways includes: determining the priority of a first forwarding gateway corresponding to the first priority port data as a first priority; determining priorities of one or more second forwarding gateways except the first forwarding gateway in the plurality of forwarding gateways as second priorities;
And forwarding the outbound data message through the target forwarding gateway.
2. The method according to claim 1, wherein when the data packet is an incoming data packet, before forwarding the incoming data packet to a target terminal device according to routing information corresponding to the incoming data packet, the method further comprises:
acquiring data message format information corresponding to the data message;
and discarding the data message when the data message format information does not comprise the header information.
3. The method of claim 1, wherein determining the direction of the data message comprises:
acquiring a data message routing type corresponding to the data message;
and determining that the data message is the outgoing data message or the incoming data message according to the data message routing type.
4. The method of claim 3, wherein the obtaining the data message routing type corresponding to the data message comprises:
analyzing the data message to obtain IP address data and subnet data corresponding to the data message;
and determining the routing type of the data message corresponding to the data message according to the IP address data and the subnet data.
5. The method of claim 1, wherein the matching the outbound port data with the first priority port data comprises:
acquiring a matching interval of the first priority port data;
and when the outbound port data corresponding to the outbound data message is positioned in the matching section, the outbound port data corresponding to the outbound data message is matched with the port data.
6. A data message forwarding apparatus, the apparatus comprising:
the data message acquisition module is used for acquiring the data message and the port data corresponding to the data message;
the incoming message forwarding module is used for forwarding the incoming data message to the target terminal equipment according to the routing information corresponding to the incoming data message when the data message is the incoming data message;
the outbound message gateway determining module is used for acquiring a plurality of forwarding gateways corresponding to the outbound data message and configuration data corresponding to the outbound data message when the data message is the outbound data message, wherein the configuration data comprises IP address data, subnet data and outbound port data; acquiring a forwarding preset condition; the forwarding preset conditions comprise IP address standard data, subnet standard data and first priority port data; when the IP address data and the subnet data meet the forwarding preset conditions, determining forwarding priorities corresponding to the forwarding gateways according to the outbound port data, and determining a target forwarding gateway of the outbound data message according to the forwarding priorities; wherein when the outbound port data matches the first priority port data, determining, according to the outbound port data, forwarding priorities corresponding to the plurality of forwarding gateways includes: determining the priority of a first forwarding gateway corresponding to the first priority port data as a first priority; determining priorities of one or more second forwarding gateways except the first forwarding gateway in the plurality of forwarding gateways as second priorities;
And the outgoing data message forwarding module is used for forwarding the outgoing data message through the target forwarding gateway.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-5.
8. An electronic device, comprising:
a processor; and
a memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
CN202110384947.7A 2021-04-09 2021-04-09 Data message forwarding method and device, storage medium and electronic equipment Active CN113114565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110384947.7A CN113114565B (en) 2021-04-09 2021-04-09 Data message forwarding method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110384947.7A CN113114565B (en) 2021-04-09 2021-04-09 Data message forwarding method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113114565A CN113114565A (en) 2021-07-13
CN113114565B true CN113114565B (en) 2023-05-12

Family

ID=76715604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110384947.7A Active CN113114565B (en) 2021-04-09 2021-04-09 Data message forwarding method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113114565B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404663A (en) * 2007-10-03 2009-04-08 日立通讯技术株式会社 Data packet transfer system having load distribution function
CN105656796A (en) * 2014-11-25 2016-06-08 杭州华三通信技术有限公司 Method and device for achieving three-layer forwarding of virtual extensible local area network
WO2016119877A1 (en) * 2015-01-30 2016-08-04 Telefonaktiebolaget Lm Ericsson (Publ) Load balancing of data packet flows
CN110557433A (en) * 2019-07-26 2019-12-10 华云超融合科技有限公司 Resource management method, platform, cloud gateway, system and storage medium
CN112333135A (en) * 2020-07-16 2021-02-05 北京京东尚科信息技术有限公司 Gateway determination method, device, server, distributor, system and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101404663A (en) * 2007-10-03 2009-04-08 日立通讯技术株式会社 Data packet transfer system having load distribution function
CN105656796A (en) * 2014-11-25 2016-06-08 杭州华三通信技术有限公司 Method and device for achieving three-layer forwarding of virtual extensible local area network
WO2016119877A1 (en) * 2015-01-30 2016-08-04 Telefonaktiebolaget Lm Ericsson (Publ) Load balancing of data packet flows
CN110557433A (en) * 2019-07-26 2019-12-10 华云超融合科技有限公司 Resource management method, platform, cloud gateway, system and storage medium
CN112333135A (en) * 2020-07-16 2021-02-05 北京京东尚科信息技术有限公司 Gateway determination method, device, server, distributor, system and storage medium

Also Published As

Publication number Publication date
CN113114565A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN112470436B (en) Systems, methods, and computer-readable media for providing multi-cloud connectivity
US10862732B2 (en) Enhanced network virtualization using metadata in encapsulation header
CN107465590B (en) Network infrastructure system, method of routing network traffic and computer readable medium
WO2021136311A1 (en) Method and device for communication between vpcs
CN111131037B (en) Data transmission method, device, medium and electronic equipment based on virtual gateway
US8824506B2 (en) Fragmentation of link layer discovery protocol packets
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
CN109728962B (en) Method and equipment for sending message
CN112583618B (en) Method, device and computing equipment for providing network service for business
CN110971498B (en) Communication method, communication device, electronic apparatus, and storage medium
CN110545230B (en) Method and device for forwarding VXLAN message
CN114518969A (en) Inter-process communication method, system, storage medium and computer device
US11064021B2 (en) Method, device and computer program product for managing network system
CN112398754B (en) Data transmission method, device, medium, electronic equipment and network access equipment
CN107483628B (en) DPDK-based one-way proxy method and system
WO2023186109A1 (en) Node access method and data transmission system
CN113114565B (en) Data message forwarding method and device, storage medium and electronic equipment
CN115834472A (en) Message processing method, forwarding strategy obtaining method and device
CN111988221B (en) Data transmission method, data transmission device, storage medium and electronic equipment
US11743180B2 (en) System and method for routing traffic onto an MPLS network
CN114828140B (en) Service flow message forwarding method and device, storage medium and electronic equipment
CN113973086B (en) Data transmission method, device and storage medium
US20240039832A1 (en) Hitless migration of interconnected data center networks for network virtualization overlay using gateways
CN117527760A (en) VPP-based DHCP server implementation method and device
CN116418794A (en) CDN scheduling method, device, system, equipment and medium suitable for HTTP3 service

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240102

Address after: 601, 6 / F, building 2, No. 18, Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Technology Information Technology Co.,Ltd.

Address before: 100176 room 1004, 10th floor, building 1, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Patentee before: Beijing Huijun Technology Co.,Ltd.

TR01 Transfer of patent right