CN111327530A - Data sending method and device, network system and switch - Google Patents

Data sending method and device, network system and switch Download PDF

Info

Publication number
CN111327530A
CN111327530A CN201811540294.1A CN201811540294A CN111327530A CN 111327530 A CN111327530 A CN 111327530A CN 201811540294 A CN201811540294 A CN 201811540294A CN 111327530 A CN111327530 A CN 111327530A
Authority
CN
China
Prior art keywords
routing information
data packet
destination address
switch
gateway
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
CN201811540294.1A
Other languages
Chinese (zh)
Other versions
CN111327530B (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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201811540294.1A priority Critical patent/CN111327530B/en
Publication of CN111327530A publication Critical patent/CN111327530A/en
Application granted granted Critical
Publication of CN111327530B publication Critical patent/CN111327530B/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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

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

Abstract

The invention provides a data sending method, a data sending device, a network system and a switch, which relate to the technical field of network communication, and the method comprises the following steps: receiving a data packet sent by first equipment, analyzing the data packet, and obtaining a destination address corresponding to the data packet; determining whether first routing information matched with a destination address exists; under the condition that the determination result is negative, second pre-stored routing information is acquired; and forwarding the data packet according to the second routing information. The data sending method, the data sending device, the network system and the switch solve the technical problem that communication between networks is possibly blocked, and further improve the experience degree of users.

Description

Data sending method and device, network system and switch
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a data transmission method, an apparatus, a network system, and a switch.
Background
In the related art, communication between network subnets usually adopts a centralized communication mode, communication of all subnets needs to pass through a gateway, and meanwhile, a network controller configures routing information of all physical machines and routing information of virtual machines in a network for the gateway, so that communication between the physical machines and communication between the virtual machines need to be realized through the gateway.
Fig. 1 shows a network architecture diagram in the prior art, wherein the network architecture is a centralized network architecture. As shown in fig. 1, the system comprises a plurality of physical machines and a plurality of virtual machines, wherein each physical machine is connected with a corresponding server and is connected to a switch through the corresponding server, each virtual machine is connected with a gateway, and the switch and the gateway are connected through a core node.
For example, when one physical machine 1 in the subnet managed by the server 1 communicates with the virtual machine 1, the flow direction of the data packet is sequentially: physical machine 1-server 1-switch 1-core node-gateway-virtual machine 1; when communication is performed between one physical machine 1 in the subnet managed by the server 1 and one physical machine 2 in the subnet managed by the server 2, the flow direction of the data packet is as follows in sequence: physical machine 1-server 1-exchanger 1-core node-gateway-core node-exchanger 2-server 2-physical machine 2, etc.; in this way, as the communication traffic of the subnets and across the subnets increases, the burden of the gateway is larger, which may further cause that the communication between the virtual machines and the physical machines between the subnets or between the physical machines between the subnets is blocked, or even a network interruption occurs, thereby reducing the experience of the user.
An effective solution is not provided at present for the technical problem that communication between networks is possibly blocked in the related art.
Disclosure of Invention
In view of the above, the present invention provides a data transmission method, an apparatus, a network system and a switch, so as to alleviate the technical problem of communication blocking.
In a first aspect, an embodiment of the present invention provides a data sending method, where the method includes: receiving a data packet sent by first equipment, analyzing the data packet, and obtaining a destination address corresponding to the data packet; determining whether first routing information matched with a destination address exists; under the condition that the determination result is negative, second pre-stored routing information is acquired; and forwarding the data packet according to the second routing information.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where before receiving a data packet sent by a first device, and analyzing the data packet to obtain a destination address corresponding to the data packet, the method further includes: acquiring second routing information broadcasted by a routing reflector, wherein the second routing information and routing information corresponding to each physical device are stored in the routing reflector; the second routing information is acquired by the route reflector through the border gateway protocol stack; the second routing information is stored.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the second routing information is default routing information that a switch to which the first device belongs points to a gateway.
With reference to the second possible implementation manner of the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where forwarding the data packet according to the second routing information includes: according to the second routing information, sending the data packet to a gateway pointed by the second routing information; and sending the data packet to the equipment corresponding to the destination address through the gateway according to the destination address.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where the subnet to which the first device belongs supports an EVPN protocol, and the subnet to which the device corresponding to the destination address belongs does not support the EVPN protocol.
In a second aspect, an embodiment of the present invention further provides a data transmitting apparatus, where the apparatus includes: the receiving module is used for receiving the data packet sent by the first equipment, analyzing the data packet and obtaining a destination address corresponding to the data packet; the determining module is used for determining whether first routing information matched with the destination address exists or not; the first obtaining module is used for obtaining the second pre-stored routing information under the condition that the determining result is negative; and the forwarding module is used for forwarding the data packet according to the second routing information.
With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the apparatus further includes: a second obtaining module, configured to obtain second routing information broadcast by a route reflector before receiving a data packet sent by a first device, analyzing the data packet, and obtaining a destination address corresponding to the data packet, where the route reflector stores the second routing information and routing information corresponding to each physical device; the second routing information is acquired by the route reflector through the border gateway protocol stack; and the storage module is used for storing the second routing information.
With reference to the second aspect, an embodiment of the present invention provides a second possible implementation manner of the second aspect, where the second routing information is default routing information that a switch to which the first device belongs points to a gateway.
With reference to the second possible implementation manner of the second aspect, an embodiment of the present invention provides a third possible implementation manner of the second aspect, where the forwarding module is configured to: according to the second routing information, sending the data packet to a gateway pointed by the second routing information; and sending the data packet to the equipment corresponding to the destination address through the gateway according to the destination address.
With reference to the second aspect, an embodiment of the present invention provides a fourth possible implementation manner of the second aspect, where the subnet to which the first device belongs supports the EVPN protocol, and the subnet to which the device corresponding to the destination address belongs does not support the EVPN protocol.
In a third aspect, an embodiment of the present invention further provides a network system, where the network system includes one or more switches, a gateway, one or more physical machines, and one or more virtual machines; the gateway is connected with one or more virtual machines, the switches are connected with the physical machines corresponding to the switches, and the route information pointing to all the physical machines in the network system and the default route information pointing to the gateway are stored in each switch in advance; the physical machine is used for sending the data packet to the switch corresponding to the physical machine; the switch is used for analyzing the data packet under the condition of receiving the data packet sent by the physical machine to obtain a destination address corresponding to the data packet; determining whether routing information matched with the destination address exists in the switch or not; acquiring default routing information under the condition that the determination result is negative; sending the data packet to the gateway according to the default routing information; and the gateway is used for receiving the data packet and forwarding the data packet to the virtual machine corresponding to the destination address according to the destination address.
With reference to the third aspect, an embodiment of the present invention provides a first possible implementation manner of the third aspect, where the system further includes: the routing reflector is connected with the border gateway protocol stack and one or more switches; the border gateway protocol stack is used for acquiring default routing information and sending the default routing information to the route reflector; the route reflector is used for receiving route information which is sent by each switch in the one or more switches and points to the corresponding physical machine and receiving default route information; and transmits the received routing information to one or more switches.
With reference to the third aspect, an embodiment of the present invention provides a second possible implementation manner of the third aspect, where the switch is further configured to, if the determination result is yes, obtain routing information matching the destination address, and send the packet to a physical machine corresponding to the destination address according to the routing information matching the destination address.
In a fourth aspect, an embodiment of the present invention further provides a switch, including a memory and a processor, where the memory is used to store a computer program; a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In a fifth aspect, an embodiment of the present invention further provides a computer storage medium for storing computer program instructions, where the computer program instructions, when executed by a computer, perform the method described in the first aspect.
The embodiment of the invention has the following beneficial effects:
the data transmission method, the data transmission device, the network system and the switch provided by the embodiment of the invention can receive the data packet sent by the first equipment, analyze the data packet to obtain the destination address corresponding to the data packet, further determine whether the first routing information matched with the destination address exists, and acquire the prestored second routing information under the condition that the determination result is negative; the data packet is forwarded according to the second routing information, that is, the data packet is forwarded through the second routing information stored in advance under the condition that the switch detects that the first routing information matched with the destination address does not exist in the switch, so that communication between the first device and the device corresponding to the destination address can be realized, the technical problem that communication between networks is possibly blocked is solved, and the user experience degree is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a diagram of a prior art network architecture;
FIG. 2 is a diagram of another prior art network architecture;
fig. 3 is a flowchart of a data transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a network architecture of a network system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data transmitting apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of another data transmission apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a switch according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, communication between subnets usually adopts a centralized communication mode, and communication between a physical machine and a physical machine or between a physical machine and a virtual machine needs to be realized by means of a gateway, so that the burden of the gateway is greatly increased, and communication is blocked.
For the above situation, in the related art, a way of adding a reflector on the basis of the original network architecture is generally adopted to relieve the network burden of the gateway. Specifically, as shown in fig. 2, in another Network architecture diagram in the related art, on the basis of fig. 1, a routing reflector is added, and the routing reflector is in communication connection with a plurality of switches in the Network architecture, and can acquire routing information of all physical machines corresponding to each switch, and then each switch can acquire routing information of all physical machines corresponding to all switches through an EVPN (ethernet virtual Private Network) protocol, so that communication between physical machines of different subnets can be realized in this way; however, since the network controller does not support the EVPN protocol and cannot configure the routing information of the virtual machine to the route reflector, the switch can synchronize only the routing information to the physical machine and cannot synchronize the routing information to the virtual machine in this way, that is, although the load of the gateway can be reduced, only the communication between the physical machines can be realized, and the communication between the virtual machine and the physical machine cannot be realized. Therefore, the communication between the physical machine and the virtual machine needs to be realized by the gateway, and when there are many virtual machines in the network architecture, the communication is also blocked.
Based on this, the data sending method, the data sending device, the network system and the switch provided by the embodiments of the present invention can effectively alleviate the above technical problems.
To facilitate understanding of the embodiment, a detailed description is first given of a data transmission method disclosed in the embodiment of the present invention.
In a possible implementation manner, an embodiment of the present invention provides a data sending method, which may be applied to a switch in a network system, such as a flowchart of the data sending method shown in fig. 3, where the method includes the following steps:
step S302, receiving a data packet sent by a first device, analyzing the data packet, and obtaining a destination address corresponding to the data packet;
generally, the data packet may be a data packet forwarded during communication between a physical machine and a physical machine in a network architecture, or may be a data packet forwarded during communication between a physical machine and a virtual machine.
Specifically, in order to facilitate forwarding of the data packet, the data packet at least includes a destination IP address, a source IP address, a destination MAC address, and a source MAC address, where the destination address is usually, but not limited to, the destination MAC address carried in the data packet.
Step S304, determining whether first routing information matched with the destination address exists;
step S306, under the condition that the determination result is negative, second pre-stored routing information is acquired;
in actual use, the determination process in step S304 is usually implemented on a switch, and optionally, the first routing information may be routing information corresponding to a physical machine, for example, if the packet is a packet forwarded from the physical machine 1 to the physical machine 2 in fig. 1 or fig. 2, the switch may match the first routing information for the destination address, that is, the routing information matched by the destination address is the first routing information corresponding to the physical machine 2. If the data packet is a data packet sent by the physical machine 1 to any virtual machine, the destination address may be a destination MAC address of the virtual machine, and since the switch stores routing information corresponding to the physical machine, the switch does not store routing information corresponding to the virtual machine; therefore, at this time, the switch cannot match the first routing information corresponding to the destination address; therefore, the second routing information stored in advance can be acquired through the step S306; and then proceeds to step S308.
Step 308, forwarding the data packet according to the second routing information.
The data transmission method, the data transmission device, the network system and the switch provided by the embodiment of the invention can receive the data packet sent by the first equipment, analyze the data packet to obtain the destination address corresponding to the data packet, further determine whether the first routing information matched with the destination address exists, and acquire the prestored second routing information under the condition that the determination result is negative; and forwarding the data packet according to the second routing information, namely forwarding the data packet through the prestored second routing information under the condition that the switch detects that the first routing information matched with the destination address does not exist in the switch, so that the communication between the first equipment and the equipment corresponding to the destination address can be realized, and the technical problem that the communication between the networks is possibly blocked is solved.
In a specific implementation, the pre-stored second routing information generally refers to default routing information that a switch to which the first device belongs points to a gateway, and the default routing information may be configured to a protocol stack by a network controller, and specifically, a protocol stack may be added to a network architecture, and the second routing information configured by the network controller is obtained through the protocol stack. The Protocol stack may be a BGP (Border Gateway Protocol) Border Gateway Protocol stack, and the second routing information is configured by the Border Gateway Protocol; and sending the second routing information to the route reflector, so that the route reflector broadcasts the second routing information to a switch in communication connection with the route reflector, and the second routing information is stored by the switch.
Therefore, before step S302, the data transmission method may further include the following steps: acquiring second routing information broadcasted by a routing reflector, wherein the second routing information and routing information corresponding to each physical device are stored in the routing reflector; the second routing information is acquired by the route reflector through the border gateway protocol stack; the second routing information is stored.
For convenience of understanding, fig. 4 is a schematic diagram of a network architecture based on the data transmission method provided by the embodiment of the present invention. In addition, in other embodiments, the protocol stack may also be a protocol stack of another protocol, and particularly, the actual use condition is taken as a standard, and the embodiment of the present invention is not limited in this respect.
Specifically, similar to the network architecture shown in fig. 1 or fig. 2, the network architecture shown in fig. 4 also includes a plurality of physical machines, a plurality of virtual machines, each physical machine is connected to a server and connected to a switch through the server, each virtual machine is connected to a gateway, and the switch and the gateway are connected through a core node.
It should be understood that in the network architecture shown in fig. 4, the number of the physical machines and the number of the virtual machines may be multiple, for convenience of explanation, only three physical machines and virtual machines are shown in fig. 4, in other embodiments, the numbers of the physical machines and the virtual machines, and the numbers of the servers and the switches may be set according to an actual use situation, and this is not limited in the embodiment of the present invention.
Specifically, the BGP Protocol stack is a Protocol stack based on a BGP Protocol, where the BGP Protocol is also called a border gateway Protocol and is a routing Protocol of an autonomous system running on a TCP (Transmission Control Protocol). Specifically, the primary function of the BGP protocol is to exchange network reachability information, including information for listed autonomous systems, with other BGP protocol-based network systems. This information effectively constructs a topology map of the autonomous system interconnect to properly handle multi-path connections between unrelated routing domains.
In actual use, the second routing information described in the embodiment of the present invention is generally network reachable information formed by default routing information pointing to a gateway, and specifically, the network architecture shown in fig. 4 may obtain the network reachable information pointing to the gateway through a BGP protocol stack, set the network reachable information pointing to the gateway as default routing information, and send the default routing information to a route reflector, where each switch is used as a BGP neighbor of the route reflector, and may obtain the default routing information from the route reflector, and store the default routing information as the second routing information in advance, so that each switch not only obtains routing information of physical machines under other switches, but also obtains the default routing information pointing to the gateway.
Therefore, in step S308, the step of forwarding the packet according to the second routing information may include: according to the second routing information, sending the data packet to a gateway pointed by the second routing information; and sending the data packet to the device corresponding to the destination address through the gateway according to the destination address, wherein the device at this time can be a virtual device, namely each virtual machine in fig. 4.
In the following, with reference to fig. 4, taking communication between the physical machine 1 in the server 1 and the virtual machine 1, and communication between the physical machine 1 in the server 1 and the physical machine 2 in the server 2 as an example, the following processes are included:
(1) the physical machine 1 sends a data packet to the server 1, wherein the data packet at least comprises: a destination IP address, a source IP address, a destination MAC address, a source MAC address;
(2) the server 1 sends the received data packet to the switch 1, the switch 1 analyzes the data packet after receiving the data packet to obtain a destination MAC address corresponding to the data packet, and matches corresponding routing information according to the destination MAC address;
if the destination MAC address is the MAC address of the physical machine 2, the matched routing information is the routing information corresponding to the physical machine 2, that is, the first routing information, and at this time, the switch 1 sends the data packet to the physical machine 2 via the switch 2 and the server 2 according to the matched routing information; that is, when the destination address has the first routing information matched with the destination address, the data packet can be directly forwarded according to the first routing information;
if the destination MAC address is the MAC address of the virtual machine 1, when the switch 1 matches the destination MAC address, the corresponding routing information may not be matched, that is, there is no first routing information matching the destination address, the switch 1 may directly use the second routing information, that is, the default routing information, as the routing information corresponding to the destination MAC address, at this time, the switch 1 sends the packet to the gateway according to the default routing information, and the gateway sends the packet to the virtual machine 1 according to the destination MAC address or the destination IP address of the packet.
The second routing information, namely, the default routing information is prestored in the switch in a mode of adding the BGP protocol stack, and is broadcasted through the reflector to inform all switches, so that the communication between the virtual machine and the physical machine is realized.
In practical use, the broadcast process by the route reflector is carried out by an EVPN protocol, each switch can acquire the routing information of all physical machines corresponding to all switches, but the switch cannot acquire the routing information corresponding to the virtual machines or the physical machines in the subnet which does not support the EVPN protocol, and the above-mentioned manner of configuring the second routing information by the border gateway protocol can configure the routing information pointing to the gateway to the route reflector, and the route reflector broadcasts the route reflector to the switch which is in communication connection with the route reflector, so that the switch can send the data packet of which the destination address is a virtual machine or a physical machine in the subnet which does not support the EVPN protocol to the gateway through the second route information, and then the data packet is sent to the virtual machine or the physical machine in the subnet which does not support the EVPN protocol by the gateway, and the forwarding process of the data packet is effectively realized. Therefore, in the embodiment of the present invention, the subnet to which the first device belongs generally supports the EVPN protocol, and the subnet to which the device corresponding to the destination address belongs may not support the EVPN protocol, but may also forward the data packet according to the second routing information.
Therefore, the data sending method provided in the embodiment of the present invention is not limited to the communication between the virtual machine and the physical machine, and may also be applied to a network architecture that does not support the EVPN protocol, so as to implement the communication between the physical machine or the virtual machine and the physical machine in the network architecture that supports the EVPN protocol.
Corresponding to the data transmission method described in the foregoing embodiment, an embodiment of the present invention further provides a data transmission apparatus, which may be located in a switch, and as shown in fig. 5, the data transmission apparatus includes:
a receiving module 50, configured to receive a data packet sent by a first device, and analyze the data packet to obtain a destination address corresponding to the data packet;
a determining module 52 for determining whether there is first routing information matching the destination address;
a first obtaining module 54, configured to obtain pre-stored second routing information if the determination result is negative;
and a forwarding module 56, configured to forward the data packet according to the second routing information.
The data sending device provided by the embodiment of the invention can receive the data packet sent by the first equipment, analyze the data packet to obtain the destination address corresponding to the data packet, further determine whether the first routing information matched with the destination address exists, and obtain the second routing information stored in advance under the condition that the determination result is negative; the data packet is forwarded according to the second routing information, that is, the data packet is forwarded through the second routing information stored in advance under the condition that the switch detects that the first routing information matched with the destination address does not exist in the switch, so that communication between the first device and the device corresponding to the destination address can be realized, the technical problem that communication between networks is possibly blocked is solved, and the user experience degree is improved.
Further, fig. 6 is a schematic structural diagram of another data transmission apparatus, and in addition to the structure shown in fig. 5, the apparatus further includes:
a second obtaining module 58, configured to obtain second routing information broadcast by a route reflector before receiving a data packet sent by the first device, analyzing the data packet, and obtaining a destination address corresponding to the data packet, where the route reflector stores the second routing information and routing information corresponding to each physical device; the second routing information is acquired by the route reflector through the border gateway protocol stack;
and a storage module 60, configured to store the second routing information.
Specifically, the second routing information is default routing information that a switch to which the first device belongs points to a gateway.
The forwarding module is configured to: according to the second routing information, sending the data packet to a gateway pointed by the second routing information; and sending the data packet to the equipment corresponding to the destination address through the gateway according to the destination address.
The subnet to which the first device belongs supports the EVPN protocol, and the subnet to which the device corresponding to the destination address belongs does not support the EVPN protocol.
The data transmission device provided by the embodiment of the invention has the same technical characteristics as the data transmission method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The embodiment of the invention also provides a network system, which comprises one or more switches, a gateway, one or more physical machines and one or more virtual machines; the network system may refer to the network architecture diagram shown in fig. 4.
Specifically, a gateway is connected with one or more virtual machines, switches are connected with physical machines corresponding to the switches, and routing information pointing to all the physical machines in a network system and default routing information pointing to the gateway are stored in each switch in advance;
the physical machine is used for sending the data packet to the switch corresponding to the physical machine;
the switch is used for analyzing the data packet under the condition of receiving the data packet sent by the physical machine to obtain a destination address corresponding to the data packet; determining whether routing information matched with the destination address exists in the switch or not; acquiring default routing information under the condition that the determination result is negative; sending the data packet to the gateway according to the default routing information;
and the gateway is used for receiving the data packet and forwarding the data packet to the virtual machine corresponding to the destination address according to the destination address.
Further, the system further comprises: the routing reflector is connected with the border gateway protocol stack and one or more switches;
the border gateway protocol stack is used for acquiring default routing information and sending the default routing information to the route reflector;
the route reflector is used for receiving the route information which is sent by each switch in one or more switches and is directed to the corresponding physical machine and receiving the default route information; and transmits the received routing information to one or more switches.
The switch is further configured to, if the determination result is yes, that is, if it is determined that the switch has routing information matching the destination address, acquire the routing information matching the destination address, and transmit the packet to the physical machine corresponding to the destination address according to the routing information matching the destination address.
The embodiment of the invention also provides a switch, which comprises a memory and a processor, wherein the memory is used for storing the computer program; the processor is configured to implement the steps of the data transmission method provided in the foregoing embodiment when executing the program stored in the memory.
The embodiment of the invention also provides a computer storage medium for storing computer program instructions, and when the computer executes the computer program instructions, the data transmission method is executed.
Referring to fig. 7, an embodiment of the present invention further provides a schematic structural diagram of a switch, including: the processor 700, the memory 701, the bus 702 and the communication interface 703, wherein the processor 700, the communication interface 703 and the memory 701 are connected through the bus 702; the processor 700 is adapted to execute executable modules, such as computer programs, stored in the memory 701. The Memory 701 may include a high-speed Random Access Memory (RAM) and may further include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 703 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like may be used. Bus 702 can be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 7, but this does not indicate only one bus or one type of bus. The memory 701 is used for storing a program, and the processor 700 executes the program after receiving an execution instruction, and the method executed by the data transmission apparatus disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 700, or implemented by the processor 700. The processor 700 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 700. The Processor 700 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 701, and the processor 700 reads the information in the memory 701, and completes the steps of the method in combination with the hardware thereof.
The data transmission method, the data transmission device, the network system, and the computer program product of the switch provided in the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the network system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A data transmission method applied to a switch, the method comprising:
receiving a data packet sent by first equipment, analyzing the data packet, and obtaining a destination address corresponding to the data packet;
determining whether first routing information matched with the destination address exists;
under the condition that the determination result is negative, second pre-stored routing information is acquired;
and forwarding the data packet according to the second routing information.
2. The method according to claim 1, wherein before receiving a packet sent by a first device, and parsing the packet to obtain a destination address corresponding to the packet, the method further comprises:
acquiring the second routing information broadcasted by a route reflector, wherein the second routing information and routing information corresponding to each physical device are stored in the route reflector; the second routing information is acquired by the route reflector through a border gateway protocol stack;
and storing the second routing information.
3. The method of claim 1, wherein the second routing information is default routing information that a switch to which the first device belongs points to a gateway.
4. The method of claim 3, wherein forwarding the packet according to the second routing information comprises:
sending the data packet to a gateway pointed by the second routing information according to the second routing information;
and sending the data packet to equipment corresponding to the destination address through the gateway according to the destination address.
5. The method of claim 1, wherein the subnet to which the first device belongs supports EVPN protocol, and wherein the subnet to which the device corresponding to the destination address belongs does not support EVPN protocol.
6. A data transmission apparatus, characterized in that the apparatus comprises:
the receiving module is used for receiving a data packet sent by first equipment, analyzing the data packet and obtaining a destination address corresponding to the data packet;
a determining module, configured to determine whether there is first routing information matching the destination address;
the first obtaining module is used for obtaining the second pre-stored routing information under the condition that the determining result is negative;
and the forwarding module is used for forwarding the data packet according to the second routing information.
7. The apparatus of claim 6, further comprising
A second obtaining module, configured to obtain the second routing information broadcast by a route reflector before receiving a data packet sent by a first device, analyzing the data packet, and obtaining a destination address corresponding to the data packet, where the route reflector stores the second routing information and routing information corresponding to each physical device; the second routing information is acquired by the route reflector through a border gateway protocol stack;
and the storage module is used for storing the second routing information.
8. The apparatus of claim 6, wherein the second routing information is default routing information pointing to a gateway for a switch to which the first device belongs.
9. A network system comprising one or more switches, gateways, one or more physical machines, one or more virtual machines; the gateway is connected with one or more virtual machines, the switches are connected with physical machines corresponding to the switches, and routing information pointing to all the physical machines in the network system and default routing information pointing to the gateway are stored in each switch in advance;
the physical machine is used for sending a data packet to a switch corresponding to the physical machine;
the switch is used for analyzing the data packet to obtain a destination address corresponding to the data packet under the condition of receiving the data packet sent by the physical machine; determining whether routing information matched with the destination address exists in the switch or not; under the condition that the determination result is negative, acquiring the default routing information; and sending the data packet to the gateway according to the default routing information;
and the gateway is used for receiving the data packet and forwarding the data packet to the virtual machine corresponding to the destination address according to the destination address.
10. The system of claim 9, further comprising: a route reflector and a border gateway protocol stack, wherein the route reflector is connected to the border gateway protocol stack and the one or more switches;
the border gateway protocol stack is used for acquiring the default routing information and sending the default routing information to the route reflector;
the route reflector is used for receiving route information which is sent by each switch of the one or more switches and is directed to a corresponding physical machine and receiving the default route information; and transmitting the received routing information to the one or more switches.
11. A switch comprising a memory and a processor, the memory for storing a computer program; the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-5.
12. A computer storage medium storing computer program instructions for performing the method of any one of claims 1 to 5 when executed by a computer.
CN201811540294.1A 2018-12-14 2018-12-14 Data sending method and device, network system and switch Active CN111327530B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811540294.1A CN111327530B (en) 2018-12-14 2018-12-14 Data sending method and device, network system and switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811540294.1A CN111327530B (en) 2018-12-14 2018-12-14 Data sending method and device, network system and switch

Publications (2)

Publication Number Publication Date
CN111327530A true CN111327530A (en) 2020-06-23
CN111327530B CN111327530B (en) 2022-02-25

Family

ID=71168737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811540294.1A Active CN111327530B (en) 2018-12-14 2018-12-14 Data sending method and device, network system and switch

Country Status (1)

Country Link
CN (1) CN111327530B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726649A (en) * 2021-09-07 2021-11-30 新华三大数据技术有限公司 Routing information processing method and system
CN115442297A (en) * 2022-09-06 2022-12-06 中电云数智科技有限公司 System and method for realizing EIP intelligent access based on BGP

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100085957A1 (en) * 2008-10-03 2010-04-08 Elias Mark A Methods and Apparatus to Form Secure Cross-Virtual Private Network Communications Sessions
US20100115604A1 (en) * 2008-10-31 2010-05-06 Alexandre Gerber Methods and apparatus to dynamically control access from virtual private networks to network-based shared resources
US7856509B1 (en) * 2004-04-09 2010-12-21 Juniper Networks, Inc. Transparently providing layer two (L2) services across intermediate computer networks
US20140177640A1 (en) * 2012-12-20 2014-06-26 Cisco Technology, Inc. Intelligent Host Route Distribution for Low Latency Forwarding and Ubiquitous Virtual Machine Mobility in Interconnected Data Centers
CN104506548A (en) * 2014-12-31 2015-04-08 北京天融信科技有限公司 Data packet redirecting device as well as safety protection method and system for virtual machine
US20160182290A1 (en) * 2006-04-20 2016-06-23 At&T Intellectual Property I, L.P. Method for updating a virtual private network in a multi-protocol label switching network
US9397931B1 (en) * 2013-08-16 2016-07-19 Juniper Networks, Inc. Fast convergence in singly-homed ethernet virtual private networks
CN106878166A (en) * 2017-01-22 2017-06-20 新华三技术有限公司 Route advertising method and device
CN106911549A (en) * 2017-02-28 2017-06-30 新华三技术有限公司 A kind of data message processing method and device
EP3188416A1 (en) * 2015-12-30 2017-07-05 Juniper Networks, Inc. Media access control address and internet protocol address binding proxy advertisement for network devices of a network
CN107181691A (en) * 2013-12-06 2017-09-19 华为技术有限公司 The method, apparatus and system of message routing are realized in a kind of network
CN107547335A (en) * 2016-06-27 2018-01-05 丛林网络公司 The method and the network equipment of signal notice IP address movement in EVPN
CN107800625A (en) * 2016-08-30 2018-03-13 新华三技术有限公司 A kind of message forwarding method and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7856509B1 (en) * 2004-04-09 2010-12-21 Juniper Networks, Inc. Transparently providing layer two (L2) services across intermediate computer networks
US20160182290A1 (en) * 2006-04-20 2016-06-23 At&T Intellectual Property I, L.P. Method for updating a virtual private network in a multi-protocol label switching network
US20100085957A1 (en) * 2008-10-03 2010-04-08 Elias Mark A Methods and Apparatus to Form Secure Cross-Virtual Private Network Communications Sessions
US20100115604A1 (en) * 2008-10-31 2010-05-06 Alexandre Gerber Methods and apparatus to dynamically control access from virtual private networks to network-based shared resources
US20140177640A1 (en) * 2012-12-20 2014-06-26 Cisco Technology, Inc. Intelligent Host Route Distribution for Low Latency Forwarding and Ubiquitous Virtual Machine Mobility in Interconnected Data Centers
US9397931B1 (en) * 2013-08-16 2016-07-19 Juniper Networks, Inc. Fast convergence in singly-homed ethernet virtual private networks
CN107181691A (en) * 2013-12-06 2017-09-19 华为技术有限公司 The method, apparatus and system of message routing are realized in a kind of network
CN104506548A (en) * 2014-12-31 2015-04-08 北京天融信科技有限公司 Data packet redirecting device as well as safety protection method and system for virtual machine
EP3188416A1 (en) * 2015-12-30 2017-07-05 Juniper Networks, Inc. Media access control address and internet protocol address binding proxy advertisement for network devices of a network
CN107547335A (en) * 2016-06-27 2018-01-05 丛林网络公司 The method and the network equipment of signal notice IP address movement in EVPN
CN107800625A (en) * 2016-08-30 2018-03-13 新华三技术有限公司 A kind of message forwarding method and device
CN106878166A (en) * 2017-01-22 2017-06-20 新华三技术有限公司 Route advertising method and device
CN106911549A (en) * 2017-02-28 2017-06-30 新华三技术有限公司 A kind of data message processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726649A (en) * 2021-09-07 2021-11-30 新华三大数据技术有限公司 Routing information processing method and system
CN113726649B (en) * 2021-09-07 2023-06-13 新华三大数据技术有限公司 Routing information processing method and system
CN115442297A (en) * 2022-09-06 2022-12-06 中电云数智科技有限公司 System and method for realizing EIP intelligent access based on BGP
CN115442297B (en) * 2022-09-06 2023-08-22 中电云数智科技有限公司 System and method for realizing EIP intelligent access based on BGP

Also Published As

Publication number Publication date
CN111327530B (en) 2022-02-25

Similar Documents

Publication Publication Date Title
CN107026791B (en) Virtual private network VPN service optimization method and device
EP3125476B1 (en) Service function chaining processing method and device
US9654482B2 (en) Overcoming circular dependencies when bootstrapping an RPKI site
US20210075590A1 (en) Method and apparatus for establishing blockchain node connection, and device
WO2014116148A1 (en) Methods and arrangements for checking connectivity and detecting connectivity failure
CN112654049B (en) Method, system, node and medium for configuring a wireless communication coverage extension system
CN111327545B (en) Data sending method and device, network system and switch
CN111030929A (en) Route processing method, equipment and system
CN113595891B (en) Data communication method and device and electronic equipment
JP7124206B2 (en) Packet processing methods and gateway devices
JP7389091B2 (en) METHODS, APPARATUS AND SYSTEM FOR CONTROLLING TRAFFIC FORWARDING
EP4191966A1 (en) Method and device for processing data message, storage medium, and electronic device
CN111327530B (en) Data sending method and device, network system and switch
US11463349B2 (en) Fault diagnosis method and apparatus thereof
CN116260618A (en) Method and device for blocking IP address, electronic equipment and storage medium
CN113366804A (en) Method and system for preventing micro-loops during network topology changes
CN116319336B (en) Service message forwarding method, SR strategy sending method, equipment and system
CN107786441B (en) Communication method, OpenFlow switch and communication system
CN113037691A (en) Message processing method, device and system
EP3068075B1 (en) Trace feature across the network (depth & breadth)-wise
WO2014180363A1 (en) Openflow signaling control method and device
US20190268239A1 (en) Bgp logical topology generation method, and device
CN110912853A (en) Method, equipment and system for checking anti-counterfeiting attack
CN110601982B (en) Route transmission method and device and router
CN110932970B (en) Processing method and device of Transmission Control Protocol (TCP) session

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