CN113114565A - 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
CN113114565A
CN113114565A CN202110384947.7A CN202110384947A CN113114565A CN 113114565 A CN113114565 A CN 113114565A CN 202110384947 A CN202110384947 A CN 202110384947A CN 113114565 A CN113114565 A CN 113114565A
Authority
CN
China
Prior art keywords
data
forwarding
data message
outgoing
data packet
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.)
Granted
Application number
CN202110384947.7A
Other languages
Chinese (zh)
Other versions
CN113114565B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure relates to the field of computers, and in particular, to a data packet forwarding method, a data packet forwarding apparatus, a computer-readable storage medium, and an electronic device, where the method includes: acquiring 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 a target terminal device according to the routing information corresponding to the incoming data message; when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways, and determining a target forwarding gateway for the outgoing data message according to the forwarding priorities; and forwarding the outgoing data message through the target forwarding gateway. Therefore, 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 apparatus, a computer-readable storage medium, and an electronic device.
Background
With the rapid development of the internet, the number of terminal devices accessing the network is also increasing. In the current public cloud data scenario, various forwarding gateways (e.g., NAT gateway, EIP gateway, LB gateway, etc.) are provided to facilitate access and service to the public network by the physical machines within the cloud.
In the related art, the service traffic forwarding gateway can match different routing strategies to perform the north-south forwarding. For example, when the physical machine in the cloud is bound to the NAT gateway, all traffic will be forwarded to the NAT gateway through the traffic forwarding gateway, and when the physical machine in the cloud is bound to the EIP gateway, all traffic will be forwarded to the NAT gateway through the traffic forwarding gateway.
However, in the traffic forwarding scheme 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, the user needs to have a high bandwidth, the usage amount of the public network IP is large, and the public network IP is highly available, and at this time, the NAT gateway needs to be used).
It is to be noted that the information disclosed in the above background section is only for enhancement of 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 present disclosure aims to provide a data packet forwarding method, a data packet forwarding apparatus, a computer-readable storage medium, and an electronic device, so as to solve the problem of poor data packet forwarding efficiency.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a data message forwarding method, including: acquiring 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 a target terminal device according to routing information corresponding to the incoming data message; when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways, and determining a target forwarding gateway of the outgoing data message according to the forwarding priorities; and forwarding the outgoing data message through the target forwarding gateway.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, before forwarding the incoming data packet to the target terminal device according to the routing information corresponding to the incoming data packet when the data packet is the incoming data packet, the method further includes: acquiring data message format information corresponding to the data message; and when the data message format information does not comprise the header information, discarding the data message.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining the direction of the data packet includes: acquiring a data message routing type corresponding to the data message; and determining the data message as the outgoing data message or the incoming data message according to the routing type of the data message.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, 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 scheme, the obtaining multiple forwarding gateways corresponding to the outgoing data packet and forwarding priorities corresponding to the multiple forwarding gateways includes: acquiring a plurality of forwarding gateways corresponding to the outgoing data messages and configuration data corresponding to the outgoing data messages; and determining 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 scheme, the determining, by the configuration data corresponding to the outgoing data packet, forwarding priorities corresponding to the multiple forwarding gateways includes: acquiring a forwarding preset condition; the preset forwarding condition comprises IP address standard data and subnet standard data; and when the IP address data and the subnet data meet the preset forwarding condition, determining forwarding priorities corresponding to the forwarding gateways according to the outgoing port data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining, by the forwarding preset condition, forwarding priorities corresponding to the multiple forwarding gateways according to the outgoing port data includes: when the outgoing 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 present disclosure, said matching said outgoing port data with said first priority port data comprises: acquiring a matching interval of the first priority port data; and when the outgoing port data corresponding to the outgoing data message is located in the matching interval, matching the outgoing port data corresponding to the outgoing data message 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 a data message and port data corresponding to the data message; an incoming packet forwarding module, configured to forward the incoming packet to a target terminal device according to routing information corresponding to the incoming packet when the packet is an incoming packet; an outgoing message gateway determining module, configured to, when the data message is an outgoing data message, obtain multiple forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the multiple forwarding gateways, and determine a target forwarding gateway of the outgoing 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 embodiments above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a processor; and
memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of data message forwarding as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the data packet forwarding method provided in an embodiment of the present disclosure, when a data packet is obtained and a direction of the data packet is determined, when the data packet is an incoming data packet, the incoming data packet is forwarded to a target terminal device according to routing information corresponding to the incoming data packet, when the data packet is an outgoing data packet, a plurality of forwarding gateways corresponding to the incoming data packet and forwarding priorities corresponding to the plurality of forwarding gateways are obtained, a target forwarding gateway for the data packet is determined according to the forwarding priorities, and the outgoing data packet is forwarded through the target forwarding gateway.
According to the scheme, the target forwarding gateway can be determined according to the priority of the forwarding gateway. On one hand, the corresponding priorities of different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted in time according to the requirements of users, so that the service requirements of different users are met, and the application scenes of the forwarding gateways are enriched; on the other hand, the forwarding gateway which is suitable for 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 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 present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. 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 flow chart for discarding a data packet when header information is not included in the data packet format information in an exemplary embodiment of the present disclosure;
fig. 3 schematically illustrates a flow chart of determining whether a data packet is an outgoing data packet or an incoming data packet according to a data packet routing type in an exemplary embodiment of the present disclosure;
fig. 4 schematically illustrates a flowchart for determining a datagram routing type corresponding to a datagram 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 outbound 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 a priority of one or more second forwarding gateways other than the first forwarding gateway among the plurality of forwarding gateways as a second priority in an exemplary embodiment of the present disclosure;
fig. 8 schematically illustrates a flowchart of matching outbound port data corresponding to an outbound data packet with port data when the outbound port data corresponding to the outbound data packet is located in a matching interval in the exemplary embodiment of the present disclosure;
FIG. 9 is a schematic diagram that schematically illustrates a topology of an intra-cloud physical machine network architecture in an exemplary embodiment of the disclosure;
FIG. 10 is a flow chart that schematically illustrates the acquisition of a data packet and the determination of a target forwarding gateway in an exemplary embodiment of the present disclosure;
fig. 11 is a schematic diagram illustrating a composition of a data packet forwarding apparatus according to an exemplary embodiment of the present disclosure;
fig. 12 schematically shows a schematic structural diagram of a computer system of an electronic device suitable for implementing an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different 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 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 subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. 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 shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of 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, the number of terminal devices accessing the network is increasing. In the current public cloud scenario, a Network architecture based on an overlay is usually constructed by using a VXLAN tunnel encapsulation technology, and access and service capabilities of a physical machine in a user cloud to a public Network can be completed through forwarding gateways such as an EIP (Elastic IP Address) gateway, an LB (load balancer) gateway, and an NAT (Network Address Translation) gateway.
Specifically, the EIP gateway supports a static conversion function of an elastic public network IP and an elastic public network IP of a cloud physical machine, namely the internal network IP and the elastic public network IP of the cloud physical machine are mapped one by one, and the cloud physical machine can be logged in through the bound EIP in the internet; the NAT gateway supports subnet level binding, realizes that a Cloud physical machine in a VPC (Virtual Private Cloud) actively accesses an Internet function through public network IP address conversion, but does not support the function of actively accessing the Cloud physical machine in the VPC, and the Cloud physical machine actively accesses the gateway of the address conversion of the Internet, and cannot actively access the Cloud physical machine through the Internet because the Cloud physical machine and the public network IP are not mapped one by one; the balance load device/flow distributor uniformly distributes public network IP routes in a data center, supports VXLAN tunnel encapsulation and decapsulation, realizes distribution of different service flows, and performs functions of flow charging, speed limiting and the like on the public network IP.
In the related art, the service traffic can be forwarded in the north-south direction 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 a subnet where the cloud physical machine is located is bound with the NAT gateway, all access Internet traffic is forwarded to the NAT gateway through bmgw; when the cloud physical machine is bound with the elastic public network IP, the EIP route has higher priority than the NAT route, so that the flow of the cloud physical machine actively accessing the Internet is forwarded to the EIP gateway through the service flow forwarding gateway, and in addition, other cloud physical machines which are not bound with the elastic public network IP in the subnet are also forwarded through the NAT gateway.
In the service flow forwarding scheme in the related art, when the cloud physical machine is bound to the elastic public network, forwarding can be performed only through the EIP gateway. However, in certain scenarios, the user has certain needs. For example, when the user's demand is very large bandwidth, large public network IP usage, high availability, and security, a NAT gateway is needed. The existing flow forwarding scheme cannot adjust a 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 packet forwarding method provided in this exemplary embodiment, when a data packet is obtained and the direction of the data packet is determined, when the data packet is an incoming data packet, the incoming data packet is forwarded to a target terminal device according to routing information corresponding to the incoming data packet, when the data packet is an outgoing data packet, a plurality of forwarding gateways corresponding to the incoming data packet and forwarding priorities corresponding to the plurality of forwarding gateways are obtained, a target forwarding gateway for the data packet is determined according to the forwarding priorities, and the outgoing data packet is forwarded through the target forwarding gateway. As shown in fig. 1, the data message forwarding method may include the following steps:
step S110, acquiring 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 a target terminal device according to the routing information corresponding to the incoming data message;
step S130, when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the plurality of forwarding gateways, and determining a target forwarding gateway of the outgoing data message according to the forwarding priorities;
step S140, forward the outgoing data packet through the target forwarding gateway.
In the data packet 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 corresponding priorities of different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted in time according to the requirements of users, so that the service requirements of different users are met, and the application scenes of the forwarding gateways are enriched; on the other hand, the forwarding gateway which is suitable for 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 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, acquiring a data message and judging the direction of the data message;
in an example embodiment of the present disclosure, a data packet in a network transmission process may be acquired. Specifically, the data packet may include data units exchanged and transmitted in the network, that is, a data block to be sent by the station at one time. The message contains complete data information to be sent, and the length of the message can be inconsistent, and is unlimited and variable. Further, in the network transmission process, the data packet is continuously encapsulated into packets, and frames for transmission, and the encapsulation means is to add some information segments, such as a packet header, and organize the information segments in a certain format. The encapsulated packet includes various information, such as message type, message version, message length, message entity, etc. Messages may be used to exchange information when making requests and responses between various systems and need to conform to a well-defined format.
In an example embodiment of the present disclosure, after obtaining the data packet, a direction of the data packet may be determined. Specifically, when a data packet is sent by a client/terminal device or the like and received by a server, the data packet is an outgoing data packet; when the data message is sent by the server and received by the client/terminal equipment, the data message is an incoming data message. The direction of the data message can be determined by the format of the data message, and can also be determined by the specific content of the data message. It should be noted that, the determining method of the direction of the data packet in the present disclosure is not particularly limited.
In an example embodiment of the present disclosure, data packet format information corresponding to a data packet may be obtained, and when the data packet format information does not include header information, the data packet is discarded. Referring to fig. 2, when the data packet format information does not include header information, discarding the data packet may include the following steps S210 to S220:
step S210, obtaining data message format information corresponding to the data message;
in an example embodiment of the present disclosure, after the data packet is acquired, data packet format information of the data packet may be acquired. Specifically, the format information of the data packet is the format of the data packet, and the type of the data packet may be determined according to the format information of the data packet. For example, the VXLAN data packet may include information such as an original packet, VXLAN Header, Outer IP Header, Outer MAC Header, and UDP Header. It should be noted that, the present disclosure does not make any special limitation on the format information of the data packet corresponding to the data packet.
Step S220, when the data packet format information does not include the header information, the data packet is discarded.
In an example embodiment of the present disclosure, after the data packet format information is obtained through the above steps, it may be determined whether the data packet format information includes header information, and when the data packet format information does not include the header information, the data packet is discarded. Specifically, the header information may include a node address corresponding to the data packet, and when the header information is not included in the data packet format information, the node address corresponding to the data packet cannot be obtained, and thus 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 local node, the destination IP address in the VXLAN packet is the VTEP address of the peer node, a pair of VTEP addresses corresponds to a VXLAN tunnel, and the data packet without the VXLAN tunnel may be directly discarded.
Through the steps S210 to S220, the data packet format information corresponding to the data packet can be obtained, and the data packet is discarded when the data packet format information does not include the header information.
In an example embodiment of the present disclosure, a data packet routing type corresponding to a data packet may be obtained, and the data packet is determined to be an outgoing data packet or an incoming data packet according to the data packet routing type. Referring to fig. 3, determining whether the data packet is an outgoing data packet or an incoming data packet according to the routing type of the data packet may include the following steps S310 to S320:
step S310, obtaining a data message routing type corresponding to the data message;
in an example embodiment of the present disclosure, a data packet routing type corresponding to a data packet may be obtained. Specifically, the data packet routing type may be used to indicate a classification of a transaction to be performed after the data packet 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 network periphery. The main goal of routing table establishment 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 datagrams, the routing type may include a neighbor type, a NAT type, and an EIP type.
Step S320, determining the data packet as an outgoing data packet or an incoming data packet according to the data packet routing type.
In an example embodiment of the present disclosure, after the data packet routing type corresponding to the data packet is obtained through the above steps, the data packet may be determined to be an outgoing data packet or an incoming data packet according to the data packet routing type. Specifically, the data packet routing type may be used to indicate a transaction to be performed after the data packet is successfully matched with the routing table, that is, the direction of the data packet may be determined by the data packet routing type. If the routing type of the data message is sent by the client/terminal equipment and received by the server, the data message is an outgoing data message; and if the routing type of the data message is sent by the server and received by the client/terminal equipment, the data message is an incoming data message. For example, for a VXLAN data message, the neighbor 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 packet routing type corresponding to the data packet can be obtained, and the data packet is determined to be an outgoing data packet or an incoming data packet according to the data packet routing type.
In an example embodiment of the present disclosure, the data packet may be analyzed to obtain IP address data and subnet data corresponding to the data packet, and a data packet routing type corresponding to the data packet is determined according to the IP address data and the subnet data. Referring to fig. 4, determining a datagram routing type corresponding to a datagram 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 analyzed to obtain IP address data and subnet data corresponding to the data packet. Specifically, in the network transmission process, the data packet needs to be encapsulated, so as to facilitate transmission of the data packet. For example, for a VXLAN message, the original message may be encapsulated according to a VXLAN header, a UDP header, an outer IP header, and an outer ethernet header. After the data message is received, the data message needs to be analyzed to obtain IP address data and subnet data corresponding to the data message, where the IP address data may be used to indicate an intranet IP address of the terminal device/client, and the subnet data may be used to indicate a subnet where the terminal device/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 a physical machine in the cloud, and the subnet data is a VNI in the VXLAN header. It should be noted that, the parsing method of the data packet is not particularly limited in this disclosure.
Step S420, determining a data packet routing type corresponding to the data packet 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 data packet routing type corresponding to the data packet may be determined according to the IP address data and the subnet data. Specifically, the IP address data may be the same in different subnets, and thus, in combination with the IP address data and the subnet data, a terminal device/client may be uniquely determined. The IP address data and subnet data may be compared with entries in the routing table, and after the terminal device/client is determined, the data packet routing type corresponding to the data packet may be obtained according to the routing table.
Through the steps S410 to S420, the data packet may be analyzed to obtain the IP address data and the subnet data corresponding to the data packet, and the data packet routing type corresponding to the data packet is 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 a target terminal device according to the routing information corresponding to the incoming data message;
in an example embodiment of the present disclosure, after the direction of the data packet is determined through the above steps, whether the data packet is an incoming data packet or an outgoing data packet may be obtained. When the data packet is an incoming data packet, the incoming data packet may be forwarded to a target terminal device according to routing information corresponding to the incoming data packet, where the terminal device may include a physical machine in the cloud. Specifically, when the data packet is sent by the server and received by the client/terminal device, the data packet is an incoming data packet. When the data message enters the client/terminal device, the data message only needs to be forwarded to the corresponding node without passing through a forwarding gateway.
Therefore, the routing information corresponding to the incoming data packet can be obtained, the routing information can include a routing type and encapsulation information, and the like, the routing type can be used for indicating a transaction to be performed after the data packet is successfully matched with the routing table, and when the data packet is the incoming data packet, the data packet can be directly forwarded to the target terminal device, or the data packet can be filled and then sent to the target terminal device. It should be noted that the specific content of the routing information in the present disclosure is not particularly limited.
For example, for a VXLAN packet, the Top of Rack (wiring manner of data center) may be used to modify and fill the outer layer IP information, VNI information, inner layer destination MAC information, and the like of the VXLAN packet and forward the modified and filled information to the physical machine in the cloud, which means that the data packet is forwarded to the uplink switch where the physical machine in the cloud is located, or the data packet may be directly forwarded to the physical machine in the cloud.
Step S130, when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the plurality of forwarding gateways, and determining a target forwarding gateway of the outgoing data message according to the forwarding priorities;
in an example embodiment of the present disclosure, after the direction of the data packet is determined through the above steps, whether the data packet is an incoming data packet or an outgoing data packet may be obtained. When the data message is an outgoing data message, it indicates that the outgoing data message needs to be forwarded to the server through the forwarding gateways, and multiple forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the multiple forwarding gateways can be obtained. Specifically, when a data packet is sent by a client/terminal device or the like and received by a server, the data packet is an outgoing data packet. When forwarding the outgoing data message, the forwarding can be performed through different forwarding gateways. For example, for a public cloud service scenario, when the data packet is an outgoing data packet, the data packet may be forwarded through an EIP gateway or an NAT gateway. At this time, the priorities of the multiple forwarding gateways may be obtained, and the target forwarding gateway may be determined according to the priorities of the forwarding gateways, where the target forwarding gateway may be configured to forward the outgoing 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 outgoing data packets and configuration data corresponding to the outgoing 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 outgoing data packets. Referring to fig. 5, determining the forwarding priorities corresponding to the multiple forwarding gateways according to the configuration data corresponding to the outgoing data packet may include the following steps S510 to S520:
step S510, obtaining a plurality of forwarding gateways corresponding to outgoing data messages and configuration data corresponding to the outgoing data messages;
in an example embodiment of the present disclosure, a plurality of forwarding gateways corresponding to outgoing data packets and configuration data corresponding to the outgoing data packets may be obtained. Specifically, when forwarding the outgoing data packet, forwarding may be performed through different forwarding gateways, and all forwarding gateways and configuration data corresponding to the outgoing data packet may be obtained. Specifically, after the outbound data packet is obtained, the outbound data packet may be analyzed to obtain configuration data corresponding to the outbound data packet. Wherein the configuration data may be used to indicate the priority of the plurality of forwarding gateways.
Step S520, determining forwarding priorities corresponding to the multiple forwarding gateways according to the configuration data corresponding to the outbound data packet.
In an example embodiment of the present disclosure, after the configuration data corresponding to the outgoing data packet is obtained, the forwarding priorities corresponding to the multiple forwarding gateways may be determined according to the configuration data corresponding to the outgoing data packet. For example, the configuration data may be a priority sequence table, and the priority corresponding to the forwarding gateway may be looked up in the table. It should be noted that the present disclosure is not limited to the specific content of the configuration data.
Through the steps S510 to S520, the multiple forwarding gateways corresponding to the outgoing data packet and the configuration data corresponding to the outgoing data packet can be obtained, and the forwarding priorities corresponding to the multiple forwarding gateways are determined according to the configuration data corresponding to the outgoing 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, the forwarding priorities corresponding to the multiple forwarding gateways are determined according to the outbound port data. Referring to fig. 6, determining the forwarding priorities corresponding to the multiple forwarding gateways according to the outbound port data may include the following steps S610 to S620:
step S610, acquiring a forwarding preset condition; 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 the subnet data may uniquely identify a terminal device/client, and the outbound port data may be used to represent port information of a data packet passing through. For example, for a public cloud scenario, the IP address data includes an inner layer protocol three-layer source IP address, the subnet data is a subnet identifier, and the egress port data is an inner layer protocol four-layer destination port. The forwarding preset condition may include a condition that needs to be satisfied when forwarding is performed. The preset forwarding condition comprises standard IP address data and standard subnet data.
Step S620, when the IP address data and the subnet data satisfy the forwarding preset condition, determining the forwarding priorities corresponding to the multiple forwarding gateways 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 a forwarding preset condition. Specifically, when the IP address data is the same as the IP address standard data and the subnet data is the same as the subnet standard data, and the IP address data and the subnet data satisfy the forwarding preset condition, one terminal device/client may be uniquely determined. At this time, the forwarding priorities corresponding to the multiple forwarding gateways may be determined according to the outbound port data in the configuration data. Specifically, a port interval corresponding to the outgoing port data may be obtained, each forwarding gateway corresponds to a certain block section in the port interval, and if the outgoing port data falls into a certain block section, the priority of the forwarding gateway corresponding to the block section is set to be a higher priority. It should be noted that the present disclosure is not limited to a specific manner of determining the priorities of the multiple forwarding gateways according to the outbound port data.
Through the steps S610 to S620, the forwarding preset condition may be obtained, and when the IP address data and the subnet data satisfy the forwarding preset condition, the forwarding priorities corresponding to the multiple forwarding gateways are determined according to the outbound port data.
In an example embodiment of the present disclosure, 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. Referring to fig. 7, determining the priority of the 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 among the multiple forwarding gateways as a second priority may include steps S710 to S720:
step S710, when the outgoing 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 interval, a single interval, a plurality of separate intervals, and the like. For example, the destination port characteristic interval is [1,65535], in this case, the consecutive interval [1,1024] may be set as the first priority port data, the single interval [1] may be set as the first priority port data, and a plurality of partition 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 an NAT gateway, the first priority port data corresponding to the EIP gateway may be set to [1,65535] (maximum 65535), at this time, the priority of the EIP gateway is higher than that of the NAT gateway, that is, all outgoing data packets are forwarded through the EIP, and the EIP gateway may be determined as the target forwarding gateway.
Step S720, determining the priority of one or more second forwarding gateways except the first forwarding gateway among the plurality of forwarding gateways as a second priority.
In an example embodiment of the present disclosure, after the priority of the first forwarding gateway is determined, 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, the first priority port data corresponding to the EIP gateway may be set to [1024,65535] (max 65535), the port data corresponding to the NAT gateway may be 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 outgoing port data (i.e. the destination port of the four layers of the inner layer protocol) is located between [1024,65535], it indicates that the current outgoing datagram is an outgoing response datagram of the matching EIP gateway. Specifically, the outbound response data packet matching the EIP gateway is not a data packet in which the terminal device/client actively accesses the Internet, and must be forwarded through the EIP gateway, so that a certain port interval needs to be reserved to ensure normal forwarding of the outbound response data packet, that is, the EIP gateway can be determined as the target forwarding gateway; if the outgoing port data is located between [1,1023], the priority of the EIP gateway is lower than that of the NAT gateway at this time, and the NAT gateway can be determined as the target forwarding gateway.
Through the above 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 priorities of one or more second forwarding gateways except the first forwarding gateway among the multiple forwarding gateways are 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 egress port data corresponding to the egress data packet is located in the matching interval, the egress port data corresponding to the egress 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 interval, the matching between the outbound port data corresponding to the outbound data packet and the port data may include the following steps S810 to S820:
step S810, acquiring a matching interval of the first priority port data;
in step S820, 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 matches with the port data.
In an example embodiment of the present disclosure, the first priority port data may include a matching interval, the matching interval of the first priority port data may be obtained when the first priority port data is matched with the outgoing port data, and the outgoing port data corresponding to the outgoing data packet is matched with the port data when the outgoing port data corresponding to the outgoing data packet is located in the matching interval. For example, the matching interval of the first priority port data is [1024,65535], the outbound port data corresponding to the outbound data packet is 35534, at this time, 35534 is located at [1024,65535], the outbound port data is matched with the port data, and if the outbound port data corresponding to the outbound data packet is a certain value in [1,1023], the outbound port data is not matched with the port data.
Through the steps S810 to S820, the 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 matches the port data.
Step S140, forward the outgoing data packet through the target forwarding gateway.
In an example embodiment of the present disclosure, the scheme of the present disclosure may be executed by a programmable switch, and matching of forwarding preset conditions may be implemented by an MAU table (Match action unit), that is, an action corresponding to a key is executed after the key is successfully matched. Specifically, the MAU table includes a subnet identifier, an inner protocol three-layer source IP address, and an inner protocol four-layer destination port, where the subnet identifier and the inner protocol three-layer source IP address need to be accurately matched, the inner protocol four-layer destination port may be interval matched, and after the subnet identifier, the inner protocol three-layer source IP address, and the inner protocol four-layer destination port are all successfully matched, a corresponding action may be executed, for example, if a gateway corresponding to the inner protocol four-layer destination port is an EIP gateway, the target forwarding gateway is determined to be the target forwarding gateway. Further, the programmable switch may modify the MAU table to accommodate current business requirements.
In an exemplary embodiment of the present disclosure, for data packets of TCP and UDP, priorities of an EIP gateway and an NAT gateway may be determined by matching a destination port characteristic interval of four layers of an inner layer protocol; and for the ICMP data message, determining whether the data message is an outgoing data message or an incoming data message according to a first byte in an ICMP header (type), when the first byte of the type is 0, indicating that the data message is an incoming data message, when the first byte of the type is 8, indicating that the data message is an outgoing data message, when the data message is determined to be an outgoing data message, if the priority of the NAT gateway is greater than that of the EIP gateway, forwarding the outgoing data message through the NAT gateway, and if the priority of the NAT gateway is less than that of the EIP gateway, forwarding the outgoing data message through the EIP gateway.
In an example embodiment of the present disclosure, the priority of the NAT gateway and the EIP gateway may be set according to a traffic situation. For example, in the case of services requiring ultra-large bandwidth, large public network IP usage, high availability, and security, data packets passing through these ports can be forwarded through the NAT gateway; and in the service situation that external service needs to be provided and operation and maintenance personnel can conveniently carry out remote operation, the EIP gateway is more suitable for the requirement of a user port, so that the EIP gateway can be used for forwarding the service.
In an example embodiment of the present disclosure, referring to fig. 9, an outgoing data packet is sent by a physical machine in the cloud and sent to a virtual private network, the virtual private network forwards the outgoing data packet to a service traffic forwarding gateway (bmgw), a priority of an NAT gateway or an EIP gateway is determined in the service traffic forwarding gateway (bmgw), a target forwarding network is determined according to the priority of the NAT gateway or the EIP gateway, the outgoing data packet passing through the NAT gateway or the EIP gateway is sent to a traffic distributor, and finally the traffic distributor sends the outgoing data packet to the Internet.
In an exemplary embodiment of the disclosure, after the data packet is acquired, it may be determined whether there is a VXLAN tunnel in the data packet, the data packet without the VXLAN tunnel is discarded, the inbound data packet is parsed, the IP address data and the subnet data are acquired, the routing table is matched according to the IP address data and the subnet data, the routing type may be determined according to the routing table, the direction of the data packet may be determined according to the routing type, when the data packet is the inbound data packet, neighbor routing information may be acquired, the data packet is forwarded to a tor of the cloud physical engine, when the data packet is the outbound data packet, it may be predetermined to forward the data packet to a NAT gateway (default gateway), then it is determined whether the data packet satisfies a predetermined forwarding condition, if the predetermined forwarding condition is satisfied, then the priority of the EIP gateway is greater than the NAT gateway, i.e. the routing information of the EIP may be acquired, and determining the EIP gateway as a target forwarding gateway, if the EIP gateway does not meet the preset forwarding condition, determining that the priority of the EIP gateway is smaller than that of the NAT gateway at the moment, and determining the NAT gateway as the target forwarding gateway. Referring to fig. 10, acquiring the data packet and determining the target forwarding gateway may include the following steps S1001 to S1023:
step S1001, acquiring a data message; step S1003, whether the data message has a VXLAN tunnel or not is judged; 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 routing 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 outgoing data message, the data message is predetermined to be forwarded to the NAT gateway; step S1019, judging whether the data message meets a preset forwarding condition; step S1021, if the preset forwarding condition is met, acquiring routing information of the EIP; step S1023, the EIP gateway is determined as a target forwarding gateway; and step S1025, if the preset forwarding condition is not met, determining the NAT gateway as a target forwarding gateway.
In an example embodiment of the present disclosure, when a data packet is obtained and a direction of the data packet is determined, when the data packet is an incoming data packet, the incoming data packet is forwarded to a target terminal device according to routing information corresponding to the incoming data packet, when the data packet is an outgoing data packet, a plurality of forwarding gateways corresponding to the incoming data packet and forwarding priorities corresponding to the plurality of forwarding gateways are obtained, a target forwarding gateway for the data packet is determined according to the forwarding priorities, and the outgoing data packet is forwarded through the target forwarding gateway.
On one hand, the corresponding priorities of different forwarding gateways can be adjusted in real time, and the forwarding gateways are adjusted in time according to the requirements of users, so that the service requirements of different users are met, and the application scenes of the forwarding gateways are enriched; on the other hand, the forwarding gateway which is suitable for 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 enhanced.
It is noted that the above-mentioned figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
In addition, in the exemplary embodiment of the present disclosure, a data message forwarding apparatus is also provided. Referring to fig. 11, a data packet forwarding apparatus 1100 includes: a data packet obtaining module 1110, an ingress packet forwarding module 1120, an egress packet gateway determining module 1130, and an egress data packet 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 device according to the routing information corresponding to the incoming data message when the data message is the incoming data message; the outgoing message gateway determining module is used for acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways when the data message is the outgoing data message, and determining a target forwarding gateway of the outgoing 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.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, before forwarding the incoming data packet to the target terminal device according to the routing information corresponding to the incoming data packet when the data packet is the incoming data packet, the method further includes: acquiring data message format information corresponding to the data message; and when the data message format information does not comprise the header information, discarding the data message.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining a direction of a data packet includes: acquiring a data message routing 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 scheme, 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 scheme, obtaining multiple forwarding gateways corresponding to data packets and forwarding priorities corresponding to the multiple forwarding gateways includes: acquiring a plurality of forwarding gateways corresponding to outgoing data messages and configuration data corresponding to the outgoing data messages; and determining forwarding priorities corresponding to the multiple 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 scheme, the determining, by the configuration data corresponding to the outbound data packet, forwarding priorities corresponding to the multiple 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 preset forwarding condition, determining forwarding priorities corresponding to the forwarding gateways according to the outgoing port data.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the determining, by the forwarding preset condition, that the forwarding priority includes first priority port data, and determining, according to the outgoing port data, forwarding priorities corresponding to multiple forwarding gateways includes: when outgoing port data is matched with 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 present disclosure, based on the foregoing scheme, the matching between the outgoing port data and the first priority port data includes: acquiring a matching interval of first priority port data; and when the outgoing port data corresponding to the outgoing data message is located in the matching interval, matching the outgoing port data corresponding to the outgoing data message with the port data.
As each functional module of the data packet forwarding device in the exemplary embodiment of the present disclosure corresponds to the step of the exemplary embodiment of the data packet forwarding method, please refer to the embodiment of the data packet forwarding method in the present disclosure for details that are not disclosed in the embodiment of the present disclosure.
It should be noted that although in the above detailed description several modules or units of the 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, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the data packet forwarding method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally 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 only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 12, the electronic device 1200 is embodied in the form of a general purpose computing device. The components of the electronic device 1200 may include, but are not limited to: the at least one processing unit 1210, the at least one memory unit 1220, the bus 1230 connecting the various system components (including the memory unit 1220 and the processing unit 1210), and the display unit 1240.
Where the memory unit stores program code, the program code may be executed by the processing unit 1210 such that the processing unit 1210 performs the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary methods" section of this specification. For example, the processing unit 1210 may execute step S110 shown in fig. 1, obtain a data packet, and determine a direction of the data packet; step S120, when the data message is an incoming data message, forwarding the incoming data message to a target terminal device according to the routing information corresponding to the incoming data message; step S130, when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the plurality of forwarding gateways, and determining a target forwarding gateway of the outgoing data message according to the forwarding priorities; step S140, forward the outgoing data packet through the target forwarding gateway.
As another example, an electronic device may implement the various steps shown in FIG. 1.
The storage unit 1220 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1221 and/or a cache memory unit 1222, and may further include a read only memory unit (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 of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1230 may be 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 a local bus 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.), with one or more devices that enable a user to interact with the electronic device 1200, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1200 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 1250. Also, the electronic device 1200 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 1260. As shown, the network adapter 1260 communicates with the other modules of the electronic device 1200 via the bus 1230. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, 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 (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the above-mentioned "exemplary methods" section of this specification, when the program product is run on the terminal device.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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 for 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 and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple 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 variations, 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 (11)

1. A method for forwarding a data message, comprising:
acquiring 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 a target terminal device according to routing information corresponding to the incoming data message;
when the data message is an outgoing data message, acquiring a plurality of forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the forwarding gateways, and determining a target forwarding gateway of the outgoing data message according to the forwarding priorities;
and forwarding the outgoing 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 when the data message format information does not comprise the header information, discarding the data message.
3. The method of claim 1, wherein the determining the direction of the data packet comprises:
acquiring a data message routing type corresponding to the data message;
and determining the data message as the outgoing data message or the incoming data message according to the routing type of the data message.
4. The method according to claim 3, wherein the obtaining the data packet routing type corresponding to the data packet 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 according to claim 1, wherein the obtaining of the forwarding gateways and the forwarding priorities thereof corresponding to the outgoing data packets comprises:
acquiring a plurality of forwarding gateways corresponding to the outgoing data messages and configuration data corresponding to the outgoing data messages;
and determining forwarding priorities corresponding to the forwarding gateways according to the configuration data corresponding to the outgoing data messages.
6. The method of claim 5, wherein the configuration data comprises IP address data, subnet data, and egress port data, and wherein determining the forwarding priorities corresponding to the forwarding gateways according to the configuration data corresponding to the egress data packet comprises:
acquiring a forwarding preset condition; the preset forwarding condition comprises IP address standard data and subnet standard data;
and when the IP address data and the subnet data meet the preset forwarding condition, determining forwarding priorities corresponding to the forwarding gateways according to the outgoing port data.
7. The method according to claim 6, wherein the preset forwarding condition includes first priority port data, and the determining the forwarding priorities corresponding to the plurality of forwarding gateways according to the outgoing port data includes:
when the outgoing 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.
8. The method of claim 7, wherein the matching the outgoing port data with the first priority port data comprises:
acquiring a matching interval of the first priority port data;
and when the outgoing port data corresponding to the outgoing data message is located in the matching interval, matching the outgoing port data corresponding to the outgoing data message with the port data.
9. An apparatus for forwarding data messages, the apparatus comprising:
the data message acquisition module is used for acquiring a data message and port data corresponding to the data message;
an incoming packet forwarding module, configured to forward the incoming packet to a target terminal device according to routing information corresponding to the incoming packet when the packet is an incoming packet;
an outgoing message gateway determining module, configured to, when the data message is an outgoing data message, obtain multiple forwarding gateways corresponding to the outgoing data message and forwarding priorities corresponding to the multiple forwarding gateways, and determine a target forwarding gateway of the outgoing 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.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
11. An electronic device, comprising:
a processor; and
memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
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 true CN113114565A (en) 2021-07-13
CN113114565B 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
CN113114565B (en) 2023-05-12

Similar Documents

Publication Publication Date Title
US11283707B2 (en) Segment routing with fast reroute for container networking
CN112470436B (en) Systems, methods, and computer-readable media for providing multi-cloud connectivity
US11563681B2 (en) Managing communications using alternative packet addressing
US11150963B2 (en) Remote smart NIC-based service acceleration
CN107465590B (en) Network infrastructure system, method of routing network traffic and computer readable medium
EP4258598A1 (en) Computing power application traffic forwarding method and apparatus
US9246819B1 (en) System and method for performing message-based load balancing
CN111131037B (en) Data transmission method, device, medium and electronic equipment based on virtual gateway
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
US20130176892A1 (en) Fragmentation of link layer discovery protocol packets
CN109547354B (en) Load balancing method, device, system, core layer switch and storage medium
CN112583618B (en) Method, device and computing equipment for providing network service for business
US20230208721A1 (en) Determining network topology based on packet traffic
EP3588906A1 (en) Multi-path management
CN110545230B (en) Method and device for forwarding VXLAN message
US20220166715A1 (en) Communication system and communication method
CN116633934A (en) Load balancing method, device, node and storage medium
CN114828140B (en) Service flow message forwarding method and device, storage medium and electronic equipment
US11064021B2 (en) Method, device and computer program product for managing network system
CN113765801B (en) Message processing method and device applied to data center, electronic equipment and medium
CN112968965A (en) Metadata service method, server and storage medium for NFV network node
WO2023186109A1 (en) Node access method and data transmission system
CN113114565B (en) Data message forwarding method and device, storage medium and electronic equipment
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

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
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.