WO2019113728A1 - 一种网络及网络管理方法 - Google Patents
一种网络及网络管理方法 Download PDFInfo
- Publication number
- WO2019113728A1 WO2019113728A1 PCT/CN2017/115419 CN2017115419W WO2019113728A1 WO 2019113728 A1 WO2019113728 A1 WO 2019113728A1 CN 2017115419 W CN2017115419 W CN 2017115419W WO 2019113728 A1 WO2019113728 A1 WO 2019113728A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- switch
- flow table
- port
- arp
- controller
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-2 addresses, e.g. medium access control [MAC] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/64—Routing or path finding of packets in data switching networks using an overlay routing layer
Definitions
- the present application relates to the field of computer technologies, and in particular, to a network and a method for managing the network.
- the connection between the control plane of the switch and the controller usually adopts a network, which is called a control network.
- the connection between the forwarding planes of different switches usually adopts another network, which is called a forwarding network.
- the controller needs to direct various types of devices in the network, including controllers, switches, and servers, from a state of out-of-control and disorder to a controlled, ordered state.
- the boot phase includes device resources, such as the allocation of Internet Protocol IP addresses, and the discovery of topological relationships between devices.
- a message such as a Dynamic Host Configuration Protocol (Acronym: DHCP) message, is sent to the destination.
- DHCP Dynamic Host Configuration Protocol
- the present application provides a network and a management method applied to the network to reduce broadcast messages during the boot process and improve boot efficiency.
- a first aspect of the present application provides a network comprising a plurality of switches and controllers, each switch comprising a management port and a plurality of available forwarding ports.
- the first switch is connected to the DHCP server, and the remaining switches communicate with the DHCP server through the first switch.
- the guiding process of the network is spread layer by layer.
- the next hop switch of the first switch starts the booting process, and so on, until all the switches in the network are controlled.
- the first forwarding port, the second forwarding port, the third forwarding port, the fourth forwarding port, the fifth forwarding port, the sixth forwarding port, and the seventh forwarding port in the present application are all available forwarding ports.
- the management port of the first switch is connected to the first forwarding port of the first switch, and the third forwarding port of the first switch is connected to the fourth forwarding port of the second switch.
- the second forwarding port of the first switch is connected to the DHCP server and the controller, that is, the controller and the DHCP server are deployed on the same physical server. Therefore, the DHCP request generated by the second switch needs to be sent to the DHCP server through the first switch.
- Each switch is preset with its own first preset flow table and second preset flow table.
- the first switch is configured to generate a first DHCP request, and match the first preset flow table of the first switch and the first DHCP request. And sending the first DHCP request from all available forwarding ports of the first switch according to the first preset flow table, including sending from the second forwarding port and sending the third forwarding port.
- the second switch is configured to receive the first DHCP request, determine that the first DHCP request cannot match the preset flow table of the second switch, discard the first DHCP request, and generate a second DHCP request, where the second The DHCP request is used to request the DHCP server to obtain the IP address of the second switch, and send the second DHCP request to the third forwarding port of the first switch through the fourth forwarding port.
- the DHCP server is configured to receive the first DHCP request sent from the second forwarding port.
- a first DHCP reply is generated according to the first DHCP request. Sending the first DHCP reply to the first switch.
- the first switch is configured to receive the first DHCP reply from the third forwarding port. Matching the second preset flow table of the first switch and the first DHCP reply. And transmitting the first DHCP reply from all available forwarding ports of the first switch according to the second preset flow table, including sending from the first forwarding port.
- the first DHCP reply sent from the first forwarding port is received by a management port of the first switch.
- the management plane of the first switch acquires the IP address of the first switch allocated by the DHCP server carried in the first DHCP reply.
- the first switch is configured to receive the second DHCP request from the third port.
- the second DHCP request is matched with the preset flow table stored by the first switch, and includes the first preset flow table and the second preset flow table. Subsequently, the first switch determines that the second DHCP request cannot match the first preset flow table and the second preset flow table, and discards the second DHCP request.
- the first switch can obtain the IP address assigned to itself, and realizes partial control of the first switch. Moreover, at this stage, the DHCP request generated by the second switch (any switch adjacent to the first switch) cannot match the preset flow table on the other switches of the first switch or the second switch. Therefore, the DHCP request generated by the second switch will not be further broadcasted in the network, which greatly reduces the broadcast traffic in the network.
- the source MAC address of the first DHCP request is the MAC address of the first switch; the first preset flow table indicates that the source MAC address is the MAC address of the first switch from the All available forwarding ports of the first switch are issued.
- the destination MAC address of the first DHCP reply is the MAC address of the first switch; the second preset flow table indicates that the packet whose destination MAC address is the MAC address of the first switch is from the All available forwarding ports of the first switch are issued.
- the preset flow table stored on one switch in the network can only match the DHCP packets with the source address or the destination address as its own address, and cannot match the DHCP packets sent by the other switches.
- the broadcast range of DHCP packets generated by the switch reduces broadcast traffic on the network.
- the controller controls the switches in the network, that is, the controller learns the connection relationship and address information of the forwarding ports of the switches in the network.
- the first switch is configured to establish a transmission control protocol TCP connection with the controller according to the IP address of the first switch carried in the first DHCP reply.
- the controller is configured to generate a first flow table, and send the first flow table to the first switch, where the first flow table indicates that a packet destined for the first switch is sent from the first forwarding port. Moreover, the controller sets the priority of the first flow table to be higher than the second preset flow table, or the controller instructs the first switch to delete the second preset flow table after receiving the first flow table.
- the forwarding surface of the first switch can match the packet with the first flow table when receiving the packet destined for the first switch (that is, the control plane of the first switch) by using the first flow table. And sending the packet from the first forwarding port to the management port of the first switch to enter the control plane of the first switch. Therefore, the first switch does not need to broadcast the packet from all available forwarding ports, which improves the processing efficiency of the packet.
- the specific process of generating the first flow table is as follows.
- the controller is configured to generate a first address resolution protocol ARP probe flow table, where the first ARP probe flow table indicates The controller reports the ARP type packet whose source IP address is the IP address of the first switch; sends the first ARP probe flow table to the first switch; generates a first ARP request, and the purpose of the first ARP request
- the IP address is an IP address of the first switch; the first ARP request is sent to the first switch; and the first switch is instructed to send the first ARP request from all available forwarding ports of the first switch.
- the first switch is configured to receive the first ARP probe flow table, receive the first ARP request sent by the first forwarding port by using a management port of the first switch, and generate a first ARP reply according to the first ARP request
- the source IP address of the first ARP reply is an IP address of the first switch; the first ARP reply is sent to the first forwarding port by using a management port of the first switch; and the first ARP probe flow table is matched and The first ARP reply, reporting the first ARP reply and the port number of the first forwarding port according to the first ARP probe flow table.
- the controller is configured to generate the first flow table according to the first ARP reply and the port number of the first forwarding port.
- the controller learns the address information of the first switch and the port number of the first forwarding port, and learns that the first forwarding port is connected to the management port of the first switch, thereby implementing further control on the first switch. .
- the first switch is configured to establish a TCP connection with the controller according to the IP address of the first switch carried in the first DHCP reply.
- the controller is configured to generate a second flow table, and send the second flow table to the first switch, where the second flow table indicates that a packet destined for the controller or the DHCP server is sent from the second forwarding port issue. And the controller sets the priority of the second flow table to be higher than the first preset flow table, or the controller instructs the first switch to delete the first preset flow table after receiving the second flow table. .
- the forwarding surface of the second switch can match the packet with the second flow table by receiving the packet destined for the controller or the DHCP server by using the second flow table, and the packet is matched with the second flow table.
- the second forwarding port sends the message to the controller or the DHCP server. Therefore, the second switch does not need to broadcast the packet from all available forwarding ports, which improves the processing efficiency of the packet.
- the specific process of generating the second flow table is as follows.
- the controller is configured to generate a second ARP probe flow table, where the second ARP probe flow table indicates that the ARP type packet whose source IP address is the IP address of the controller is reported to the controller; Sending a flow table to the first switch; generating a second ARP request, the destination IP address of the second ARP request is an IP address of the controller; sending the second ARP request to the first switch; indicating that the first switch The second ARP request is sent from all available forwarding ports of the first switch.
- the first switch is configured to receive the second ARP probe flow table, and send the second ARP request to the controller by using the second forwarding port.
- the controller is configured to generate a second ARP reply according to the second ARP request, where a source IP address of the second ARP reply is an IP address of the controller, and send the second ARP reply to the first switch.
- the first switch is configured to receive the second ARP reply by using the second forwarding port, match the second ARP probe flow table and the second ARP reply, and report the second ARP reply according to the second ARP probe flow table.
- the port number of the second forwarding port is configured to receive the second ARP reply by using the second forwarding port, match the second ARP probe flow table and the second ARP reply, and report the second ARP reply according to the second ARP probe flow table.
- the controller is configured to generate the second flow table according to the second ARP reply and the port number of the second forwarding port.
- the controller learns the port number of the second forwarding port, and learns that the second forwarding port leads to the controller or the DHCP server, and further control of the first switch is implemented.
- the management port of the second switch is connected to the fifth forwarding port of the second switch.
- the controller further controls the first switch and the second switch.
- the control process is divided into three phases, namely, learning of the third forwarding port, learning of the fourth forwarding port, and learning of the fifth forwarding port.
- the controller generates a third flow table, and sends the third flow table to the first switch, where the third flow table indicates that the packet destined for the second switch is forwarded from the third The port is issued.
- the forwarding surface of the first switch when receiving the packet destined for the second switch, may match the packet with the third flow table, and from the third forwarding port. Sending the message to the second switch. Therefore, the first switch does not need to broadcast the packet from all available forwarding ports, which improves the processing efficiency of the packet.
- the specific process of generating the third flow table is as follows.
- the controller is configured to generate a first port detection flow table, where the first port detection flow table indicates that a port reply message is reported to the controller; the first port detection flow table is sent to the first switch; The port detection packet is sent to the second switch by using the first port detection packet.
- the second switch is configured to match the third preset flow table of the second switch and the first port detection message; generate a first port reply message according to the third preset flow table; The message is sent to the first switch.
- the matching field of the third preset flow table includes: the source MAC address of the packet is the source MAC address of the first port detection packet.
- the source MAC address of the first port detection packet may be specifically set, for example, all 0s, in order to avoid the mismatch between the third preset flow table and other packets.
- the action field of the third preset flow table indicates that the source MAC address of the first port probe message is modified to the MAC address of the second switch to generate the first port reply message.
- the first switch is configured to receive the first port reply message by using the third port, and match the first port probe flow table and the first port reply message; and report the first packet according to the first port detection flow table.
- the controller is configured to generate the third flow table according to the first port reply message and the port number of the third forwarding port.
- the controller learns the port number of the third forwarding port, and learns that the third forwarding port leads to the second switch, thereby implementing further control of the first switch.
- the first switch receives a second DHCP request (the second DHCP request is the same as the second DHCP request), and matches the second DHCP request with the second flow.
- the second DHCP request is sent from the second forwarding port to the DHCP server according to the action field of the second flow table; and the second DHCP reply returned by the DHCP server is received, and the destination of the second DHCP reply is
- the second switch and the second DHCP reply carries the IP address of the second switch, and the second DHCP reply is generated by the DHCP server according to the second DHCP request; matching the second DHCP reply with the third flow table; Sending the second DHCP reply to the second switch through the third forwarding port.
- the second switch is configured to receive the second DHCP reply, obtain an IP address of the second switch, and establish a TCP connection with the controller according to the IP address of the second switch.
- the second switch can obtain the IP address of the second switch from the DHCP server, and establish a TCP connection with the controller according to the IP address of the second switch, for the subsequent generation process of the fourth flow table and the fifth flow table.
- the second switch communicates with the controller.
- the controller generates a fourth flow table, and sends the fourth flow table to the second switch.
- the fourth flow table indicates that a message destined for the second switch is sent from the fifth forwarding port.
- the forwarding surface of the second switch may receive the packet and the fourth flow table when receiving the packet destined for the second switch (that is, the control plane of the second switch) by using the fourth flow table. A matching is performed, and the packet is sent from the fifth forwarding port to the management port of the second switch to enter the control plane of the second switch. Therefore, the second switch does not need to broadcast the packet from all available forwarding ports, which improves the processing efficiency of the packet.
- the controller is configured to generate a third ARP probe flow table, where the third ARP probe flow table indicates that the ARP type packet whose source IP address is the IP address of the second switch is reported to the controller; Sending a probe flow table to the second switch; generating a third ARP request, the destination IP address of the third ARP request is an IP address of the second switch; sending the third ARP request to the second switch; indicating the second The switch issues the second ARP request from all available forwarding ports of the second switch.
- the second switch is configured to receive the second ARP probe flow table, receive the third ARP request sent by the fifth forwarding port by using a management port of the second switch, and generate a third ARP reply according to the third ARP request
- the source IP address of the third ARP reply is the IP address of the second switch; the third ARP reply is sent to the fifth forwarding port by the management port of the second switch; and the third ARP probe flow table is matched and And the third ARP reply, reporting the third ARP reply and the port number of the fifth forwarding port according to the third ARP probe flow table.
- the controller is configured to generate the fourth flow table according to the third ARP reply and the port number of the fifth forwarding port.
- the controller learns the port number of the fifth forwarding port, and learns that the fifth forwarding port is connected to the management port of the second switch, thereby implementing further control of the second switch.
- the controller generates a fifth flow table, and sends the fifth flow table to the second switch, the fifth flow table indicating that the destination is the controller or the DHCP server or the first switch The message is sent from the fourth forwarding port.
- the forwarding surface of the second switch can match the packet with the fifth flow table by receiving the packet destined for the controller or the DHCP server by using the fifth flow table, and the packet is matched with the fifth flow table.
- the four forwarding ports send the message. Therefore, the second switch does not need to broadcast the packet from all available forwarding ports, which improves the processing efficiency of the packet.
- the controller is configured to generate a second port detection flow table, where the second port detection flow table indicates that the port detection message is reported to the controller; the second port detection flow table is sent to the second switch; The port detection packet is sent to the second switch by using the first port.
- the second port detection packet carries the address information of the first switch, so that the controller identifies the connection relationship between the fourth forwarding port and the first switch.
- the second switch is configured to receive the second port detection packet by using the fourth port, and the second port detection flow table and the second port detection message are matched; and the second port detection flow table is reported according to the second port The port number of the second port probe packet and the fourth forwarding port.
- the controller is configured to generate the fifth flow table according to the second port detection packet and the port number of the fourth forwarding port.
- the controller learns the port number of the fourth forwarding port, and learns that the fourth forwarding port leads to the first switch and the DHCP server and the controller, thereby implementing further control of the second switch.
- a second aspect of the present application provides a network. Unlike the network provided by the first aspect, the controller and the DHCP server are disposed on different physical servers, and the first switch passes the second forwarding port and the controller. Even The first switch is connected to the DHCP server through a sixth forwarding port. After obtaining the first DHCP reply in the same manner as in the network provided by the first aspect, the first switch establishes a TCP connection with the controller according to the IP address of the first switch carried in the first DHCP reply.
- the controller is configured to generate a fourth ARP probe flow table, where the fourth ARP probe flow table indicates that the ARP type packet whose source IP address is the IP address of the DHCP server is reported to the controller; the fourth ARP probe is detected.
- the fourth ARP request is sent from all available forwarding ports of the first switch.
- the first switch is configured to receive the fourth ARP probe flow table and the fourth ARP request, send the fourth ARP request by using all available forwarding ports of the first switch, and receive the fourth ARP from the sixth forwarding port.
- the source IP address of the fourth ARP reply is an IP address of the DHCP server
- the fourth ARP reply is generated by the DHCP server according to the fourth ARP request; matching the fourth ARP probe flow table and the fourth ARP reply And reporting the fourth ARP reply and the port number of the sixth forwarding port according to the fourth ARP probe flow table.
- the controller is configured to generate, according to the fourth ARP probe flow table and the port number of the sixth forwarding port, a sixth flow table, where the sixth flow table indicates that the packet destined for the DHCP server is from the sixth The forwarding port sends out; sends the sixth flow table to the first switch.
- the packet forwarding destination is the DHCP server and improves the forwarding efficiency of packets.
- the controller identifies the first forwarding port (ie, the generation of the first flow table), the controller identifies the second forwarding port (ie, generates the second flow table), and the controller identifies the third forwarding port. (ie, the generation of the third flow table), the identification of the fifth forwarding port by the controller (ie, the generation of the fourth flow table), the identification of the fourth forwarding port by the controller (ie, the generation of the fifth flow table) and the first The network provided by the parties is the same.
- a network management method is provided, which is applied to a network provided by the first aspect.
- the method is the method performed by the controller side in the network provided by the first aspect.
- the method includes: the controller generates a first ARP probe flow table, where the first ARP probe flow table indicates that the ARP type packet whose source IP address is the IP address of the first switch is reported to the controller; the controller The first ARP probe flow table is sent to the first switch; the controller generates a first ARP request, the destination IP address of the first ARP request is an IP address of the first switch; the controller sends the first ARP request To the first switch; the controller instructs the first switch to send the first ARP request from all available forwarding ports of the first switch; the controller obtains the forwarding plane of the first switch according to the first ARP detection flow a first ARP reply reported by the table and a port number of the first forwarding port, where the first ARP reply is generated by the control plane of the first switch according to the first ARP request, and sent to the first through the first forwarding port a forwarding plane of the switch, the source IP address of the first ARP reply is an IP address of the first switch; the controller generates a first flow table according to the first
- the method includes: the controller generates a second ARP probe flow table, and the second ARP probe flow table indicates that the ARP type report that the source IP address is the IP address of the controller is reported to the controller.
- the controller sends the second ARP probe flow table to the first switch; the controller generates a second ARP request, the second The destination IP address of the ARP request is the IP address of the controller; the controller sends the second ARP request to the first switch; the controller instructs the first switch to request the second ARP request from the first switch Is sent by the forwarding port; the controller receives the second ARP request sent by the first switch from the second forwarding port; the controller generates a second ARP reply according to the second ARP request, the source IP of the second ARP reply The address is the IP address of the controller; the controller sends the second ARP reply to the forwarding plane of the first switch by using the second forwarding port; the controller obtains the forwarding plane of the first switch according to the second ARP Detecting the second ARP reply reported by
- the method includes: the controller generates a first port detection flow table, the first port detection flow table indicates that a port reply message is reported to the controller; the controller detects the first port detection flow Sending to the first switch; the controller generates a first port detection packet; the controller sends the first port detection packet to the second switch by using the first switch; the controller acquires the first switch According to the first port reply message reported by the first port detection flow table and the port number of the third forwarding port, the first port reply message is controlled by the control plane of the second switch according to the first port detection report.
- the controller Generating and transmitting to the forwarding plane of the first switch by using the third forwarding port; the controller generates a third flow table according to the first port reply message and the port number of the third forwarding port, the third The flow table indicates that a message destined for the second switch is sent from the third forwarding port; the controller sends the third flow table to the first switch.
- the second switch establishes a TCP connection with the controller, and the method includes: the controller generates a third ARP probe flow table, where the third ARP probe flow table indicates that the source IP address is reported to the controller.
- An ARP type packet of the IP address of the second switch the controller sends the third ARP probe flow table to the second switch; the controller generates a third ARP request, and the destination IP of the third ARP request
- the address is an IP address of the second switch; the controller sends the third ARP request to the second switch, instructing the second switch to send the third ARP request from all available forwarding ports of the second switch;
- the controller obtains a third ARP reply reported by the forwarding face of the second switch according to the third ARP probe flow table and a port number of the fifth forwarding port, where the third ARP reply is controlled by the control plane of the second switch.
- the third ARP request is generated and sent to the forwarding plane of the second switch by using the fifth forwarding port, where the source IP address of the third ARP reply is an IP address of the second switch; the controller replies according to the third ARP And generating, by the port number of the fifth forwarding port, a fourth flow table, where the fourth flow table indicates that the packet destined for the second switch is sent from the fifth forwarding port; the controller sends the fourth flow table To the second switch.
- the method includes: the controller generates a second port detection flow table, the second port detection flow table indicates that a port detection message is reported to the controller; and the controller detects the second port detection flow Sending to the second switch; the controller generates a second port detection packet; the controller sends the second port detection packet to the forwarding surface of the second switch by using the fourth forwarding port of the second switch The controller obtains the second port detection packet reported by the forwarding surface of the second switch according to the second port detection flow table and the port number of the fourth forwarding port; the controller detects the packet according to the second port.
- a fourth aspect of the present application provides a network management method for use in a network provided by the second aspect.
- the method is the method performed by the controller side in the network provided by the second aspect.
- the method includes: the controller generates a fourth ARP probe flow table, where the fourth ARP probe flow table indicates that the ARP type packet whose source IP address is the IP address of the DHCP server is reported to the controller; the controller The fourth ARP probe flow table is sent to the first switch; the controller generates a fourth ARP request, the destination IP address of the fourth ARP request is an IP address of the DHCP server; the controller sends the fourth ARP request to the a first switch; the controller instructs the first switch to send the fourth ARP request from all available forwarding ports of the first switch; the controller obtains a forwarding plane of the first switch, and reports the flow according to the fourth ARP detection flow table a fourth ARP reply and a port number of the sixth forwarding port, the fourth ARP reply is generated by the DHCP server according to the fourth ARP request and sent to the first switch by the sixth forwarding port of the first switch
- the source IP address of the fourth ARP reply is an IP address of the DHCP server; the controller generates a sixth flow
- the controller identifies the first forwarding port (that is, generates the first flow table), and the controller identifies the second forwarding port (that is, generates the second flow table), and the controller pairs
- the identification of the third forwarding port ie, the generation of the third flow table
- the identification of the fifth forwarding port by the controller ie, the generation of the fourth flow table
- the identification of the fourth forwarding port by the controller ie, the fifth flow table Generated
- a fifth aspect of the present application provides a controller, including a processor and a memory, the processor and the memory establish communication; the processor is configured to perform any of the third aspect or the third aspect Methods.
- a sixth aspect of the present application provides a controller comprising a processor and a memory, the processor establishing communication with the memory; the processor for performing the method provided by the fourth aspect.
- a seventh aspect of the present application provides a management method of a switch, the management method being performed by a first switch in a network provided by the first aspect.
- the method includes: the control plane of the first switch generates a first DHCP request, and sends the first DHCP request to a forwarding plane of the first switch by using a management port of the first switch; a preset flow table and the first DHCP request; the forwarding plane of the first switch sends the first DHCP request from all available forwarding ports of the first switch according to the first preset flow table; the first switch Receiving, by the forwarding plane, the first DHCP reply, the DHCP reply is generated by the DHCP server according to the first DHCP request; the forwarding face of the first switch matches the second preset flow table and the first DHCP reply; Transmitting surface sends the first DHCP reply from all available forwarding ports of the first switch according to the second preset flow table; the control plane of the first switch receives from the first forwarding port through a management port
- the method includes: the forwarding plane of the first switch receives a first ARP probe flow table from the controller, and the first ARP probe flow table indicates that the source IP address is reported to the controller as the first The ARP type packet of the IP address of the first switch carried in the DHCP reply; the forwarding plane of the first switch receives the first ARP request from the controller, and the destination IP address of the first ARP request is the first switch IP address; the forwarding plane of the first switch sends the first ARP request from all available forwarding ports of the first switch according to the instruction of the controller; the control plane of the first switch passes the management port of the first switch Receiving the first ARP request sent from the first forwarding port; the control plane of the first switch generates a first ARP reply according to the first ARP request, where The source IP address of the first ARP reply is an IP address of the first switch; the control plane of the first switch sends the first ARP reply to the forwarding plane of the first switch by using the first forwarding port; the first switch The forwarding
- the forwarding plane of the first switch receives a first flow table from the controller, where the first flow table indicates that a packet destined for the first switch is sent from the first forwarding port, and the priority of the first flow table
- the second preset flow table is deleted or the first switch deletes the second preset flow table after receiving the first flow table.
- the method includes: the forwarding plane of the first switch receives a second ARP probe flow table from the controller, and the second ARP probe flow table indicates that the source IP address is reported to the controller as the controller
- the forwarding plane of the first switch receives the second ARP request from the controller, and the destination IP address of the second ARP request is the IP address of the controller;
- the forwarding of the first switch The second ARP request is sent from all available forwarding ports of the first switch according to the instruction of the controller;
- the forwarding plane of the first switch receives the second ARP reply by using the second forwarding port, and the second ARP reply is
- the source IP address of the second ARP reply is generated by the controller according to the second ARP request, and the forwarding plane of the first switch reports the second ARP reply according to the second ARP probe flow table.
- the forwarding plane of the first switch receives a second flow table from the controller, where the second flow table indicates that the message destined for the controller or the DHCP server is from the first Second forwarding And sending, the second flow table has a higher priority than the first preset flow table or the first switch deletes the first preset flow table after receiving the first flow table.
- the method includes: the forwarding surface of the first switch receives a first port detection flow table from the controller, and the first port detection flow table indicates that a port reply message is reported to the controller;
- the forwarding plane of the switch receives the first port detection packet from the controller, and sends the first port detection packet to the second switch;
- the forwarding surface of the first switch receives the second switch through the third forwarding port
- the forwarding surface of the first switch reports the first port reply message and the third forwarding port to the controller according to the first port probe flow table.
- the port number of the first switch receives a third flow table from the controller, the third flow table indicating that a message destined for the second switch is sent from the third forwarding port.
- An eighth aspect of the present application provides a management method of a switch, which is performed by a first switch in a network provided by the second aspect.
- the method includes: the forwarding plane of the first switch receives a fourth ARP probe flow table from the controller, and the fourth ARP probe flow table indicates to the controller that the source IP address is an ARP type of the IP address of the DHCP server.
- the forwarding plane of the first switch receives a fourth ARP request from the controller, and the destination IP address of the fourth ARP request is an IP address of the DHCP server; the forwarding face of the first switch sends the fourth ARP request Sending to the DHCP server through the sixth forwarding port; the forwarding surface of the first switch receives a fourth ARP reply by using the sixth forwarding port, where the fourth ARP reply is generated by the DHCP server according to the fourth ARP request, The source IP address of the fourth ARP reply is the IP address of the DHCP server; the forwarding plane of the first switch reports the fourth ARP reply and the port number of the sixth forwarding port to the controller according to the fourth ARP probe flow table.
- the forwarding plane of the first switch receives a sixth flow table from the controller, the sixth flow table indicating that a message destined for the DHCP server is sent from the sixth forwarding port.
- the management method of the switch provided by the first aspect, the obtaining of the first flow table, the obtaining of the second flow table, the obtaining of the third flow table, the obtaining of the fourth flow table, the obtaining of the fifth flow table, and the method provided by the seventh aspect the same.
- a ninth aspect of the present application provides a switch comprising a processor and a memory, the processor establishing communication with the memory; the processor for performing the possible design provided by any one of the seventh aspect or the seventh aspect method.
- a tenth aspect of the present application provides a switch comprising a processor and a memory, the processor establishing communication with the memory; the processor for performing the method provided by the eighth aspect.
- An eleventh aspect of the present application provides a management method of a switch, which is performed by a network provided by the first aspect or a second switch in a network provided by the second aspect.
- the second switch establishes a TCP connection with the controller.
- the method includes: the forwarding surface of the second switch receives a second port detection flow table from the controller, and the second port detection flow table indicates that the port detection message is reported to the controller; the forwarding surface of the second switch passes the The fourth forwarding port receives the second port detection packet sent by the first switch from the controller; the forwarding surface of the second switch reports the second port detection report to the controller according to the second port detection flow table. And a port number of the fourth forwarding port; the forwarding plane of the second switch receives a fifth flow table from the controller, the fifth flow table indicating that the destination is the first switch or the controller The fourth forwarding port is sent.
- the forwarding plane of the second switch receives a third ARP probe flow table from the controller, and the third ARP probe flow table indicates that the source IP address is reported to the controller as the IP address of the second switch.
- the control plane of the second switch generates a third ARP reply according to the third ARP request, and the source IP address of the third ARP reply is the IP address of the third switch; the control plane of the second switch passes the fifth forwarding port
- the third ARP reply is sent to the forwarding plane of the second switch; the forwarding plane of the second switch matches the third ARP probe flow table and the third ARP reply;
- the method further includes: the forwarding plane of the second switch receives the first port detection packet from the controller; the forwarding surface of the second switch matches the first port detection packet and the third preset a flow table, according to the third preset flow table, modifying a source MAC address of the first port detection packet to a MAC address of the second switch to generate a first port reply message; the second switch is to be the first The port reply message is sent to the third forwarding port of the first switch.
- a twelfth aspect of the present application provides a switch comprising a processor and a memory, the processor establishing communication with the memory; the processor for performing the method provided by the eleventh aspect.
- a thirteenth aspect of the present application provides a storage medium storing a program, the controller executing any one of the foregoing third aspect or the third aspect of the possible design when the program is executed by the controller Methods.
- the storage medium and the storage medium provided by the following aspects include, but are not limited to, a read only memory, a random access memory, a flash memory, a hard disk (English: hard disk drive, abbreviated as HDD) or a solid state hard disk (English: solid state drive, abbreviation :SSD).
- a fourteenth aspect of the present application provides a storage medium in which a program is stored, the controller executing the method provided in the aforementioned fourth aspect when the program is executed by the controller.
- a fifteenth aspect of the present application provides a storage medium storing a program, the first switch performing any one of the foregoing seventh aspect or the seventh aspect when the program is operated by the first switch The method provided by the design.
- a sixteenth aspect of the present application provides a storage medium in which a program is stored, the first switch executing the method provided in the foregoing eighth aspect when the program is run by the first switch.
- a seventeenth aspect of the present application provides a storage medium storing a program, the second switch performing any one of the foregoing eleventh or eleventh aspects when the program is operated by the second switch Possible design methods provided.
- An eighteenth aspect of the present application provides a computer program product, comprising: program instructions, when executed by a controller, the controller performs any of the foregoing third or third aspect Possible design methods provided.
- the computer program product can be a software installation package, and the computer program product can be downloaded and executed on the controller if the method provided by any of the foregoing third aspect or any of the possible aspects of the third aspect is required. Program product.
- a nineteenth aspect of the present application provides a computer program product comprising program instructions which, when executed by a controller, perform the method provided by the aforementioned fourth aspect.
- the computer program product can be a software installation package that can be downloaded and executed on a controller if the method provided by the aforementioned fourth aspect is required.
- a twentieth aspect of the present application provides a computer program product comprising program instructions for performing any of the aforementioned seventh aspect or seventh aspect when the computer program product is executed by a first switch A possible design approach.
- the computer program product may be a software installation package, and if the method provided by any of the foregoing seventh aspect or any of the possible aspects of the seventh aspect is required, the computer program product may be downloaded and executed on the first switch. Computer program product.
- a twenty-first aspect of the present application provides a computer program product comprising program instructions that, when executed by a first switch, perform the method provided by the aforementioned eighth aspect.
- the computer program product can be a software installation package that can be downloaded and executed on a first switch if the method provided by the aforementioned eighth aspect is required.
- a twenty-second aspect of the present application provides a computer program product comprising program instructions which, when executed by a second switch, perform the method of the eleventh aspect.
- the computer program product can be a software installation package that can be downloaded and executed on a second switch if the method provided in the eleventh aspect above is required.
- a twenty-third aspect of the present application provides a storage medium in which the first preset stream table introduced in the foregoing aspect is stored.
- the action domain of the first preset flow table includes: issuing from all available forwarding ports of the first switch.
- a twenty-fourth aspect of the present application provides a computer program product comprising program instructions for implementing the first preset flow table introduced in the foregoing aspects.
- a twenty-fifth aspect of the present application provides a storage medium in which the second preset flow table introduced in the foregoing aspect is stored.
- the action domain of the first preset flow table includes: issuing from all available forwarding ports of the first switch.
- a twenty-sixth aspect of the present application provides a computer program product, the program comprising the program
- the program instructions are used to implement the second preset flow table described in the preceding aspects.
- a twenty-seventh aspect of the present application provides a storage medium in which the third preset stream table introduced in the foregoing aspect is stored.
- the source MAC address of the first port probe packet can be all 0s.
- the action field of the third preset flow table includes: changing the source MAC address of the packet to the MAC address of the second switch, and sending the changed packet from the entry port of the first port detection packet.
- a twenty-eighth aspect of the present application provides a computer program product comprising program instructions for implementing the third preset flow table introduced in the foregoing aspects.
- a twenty-ninth aspect of the present application provides a network including a first switch, a second switch, and a controller.
- the first forwarding port of the first switch is connected to the management port of the first switch.
- the second forwarding port of the first switch is connected to the controller.
- the third forwarding port of the first switch is connected to the fourth forwarding port of the second switch.
- the seventh forwarding port of the second switch is connected to the DHCP server.
- the first switch is configured to generate a first DHCP request, match the first DHCP request and the first preset flow table, and send the first DHCP request from all available forwarding ports of the first switch according to the first preset flow table.
- a second switch configured to receive the first DHCP request by using a fourth forwarding port; matching the first DHCP request and the fourth preset flow table, and using the fourth preset flow table to all the first DHCP request from the second switch
- the first DHCP reply is sent by the forwarding port; the first DHCP reply is generated by the DHCP server according to the first DHCP request; the first DHCP reply and the fifth preset flow table are matched, and the first DHCP is selected according to the fifth preset flow table.
- a first switch configured to receive a first DHCP reply, match a second preset flow table of the first switch, and the first DHCP request; and send the first DHCP request from the first switch according to the second preset flow table All available forwarding ports are issued.
- the controller identifies the first forwarding port (ie, the generation of the first flow table), the controller identifies the second forwarding port (ie, generates the second flow table), and the controller identifies the third forwarding port. (ie, the generation of the third flow table), the identification of the fifth forwarding port by the controller (ie, the generation of the fourth flow table), the identification of the fourth forwarding port by the controller (ie, the generation of the fifth flow table) and the first The network provided by the parties is the same.
- the first switch can obtain the IP address assigned to itself, and realizes partial control of the first switch.
- FIG. 1 is a schematic diagram of a network architecture provided by the present application.
- FIG. 2a is a schematic diagram of a network architecture provided by the present application.
- 2b is a schematic diagram of a network architecture provided by the present application.
- FIG. 3 is a schematic structural diagram of a switch provided by the present application.
- FIG. 4a is a schematic diagram of an internal structure of a switch provided by the present application.
- 4b is a schematic diagram of an internal structure of a switch provided by the present application.
- FIG. 5 is a schematic diagram of a connection relationship between a switch, a controller, and a DHCP server provided by the present application;
- FIG. 7 is a schematic diagram of a connection relationship between a switch, a controller, and a DHCP server provided by the present application;
- FIG. 9 is a schematic diagram of a connection relationship between a switch, a controller, and a DHCP server provided by the present application.
- FIG. 11 is a schematic diagram of a connection relationship between a switch, a controller, and a DHCP server provided by the present application;
- FIG. 13 is a schematic structural diagram of a controller provided by the present application.
- FIG. 14 is a schematic structural diagram of a switch provided by the present application.
- a switch refers to a device that implements routing of messages under the control of a controller.
- the switch can process the packet according to the flow table sent by the controller.
- the switch can support the OpenFlow protocol.
- the switch can be implemented by running software on the server, by an integrated circuit, or by a combination of a server and an integrated circuit.
- the integrated circuit may be an application-specific integrated circuit (ASIC) or a programmable logic device (abbreviated as PLD) or a network processing unit (English: network process unit).
- ASIC application-specific integrated circuit
- PLD programmable logic device
- the above PLD may be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), a field programmable gate array (English: field programmable gate array, abbreviated: FPGA), general array logic (English: general array logic, Abbreviation: GAL).
- connection refers to the adjacent switch, the switch and the controller, the direct connection between the switch and the DHCP server is not set, or the adjacent switch, the switch and the controller, the switch and the DHCP server pass through other devices. Indirect connection.
- the flow table in this specification is a message processing rule for the switch to execute.
- Each message processing rule includes a matching part and an executing part. If the switch can match a packet to the matching part of the previous packet processing rule, the switch processes the packet according to the execution part of the packet processing rule.
- the matching field and the execution domain used in this specification are one implementation of the message processing rule.
- the matching domain is also the matching part, and the execution domain is the execution part.
- the format and name of the flow table are not limited in this specification.
- a controller refers to a device that controls the switch.
- the controller can send a flow table to the switch and control the action of the switch through the flow table.
- the controller can communicate with the switch via the OpenFlow protocol.
- the controller sends the content to the switch for generating a flow table, so that the switch generates a corresponding flow table according to the content.
- the controller can define a network controller, or a network management device, etc. for the software.
- the controller can be implemented in a centralized manner, such as using a physical server, or in a distributed manner, such as using multiple physical servers.
- the controller and the DHCP server can be located on the same physical server.
- the controller and the DHCP server run on two different virtual machines on the same physical server.
- the controller and DHCP server can also be located on different physical servers.
- a physical server is a computing device for executing one or more software programs.
- the physical server can function as a DHCP server or controller, that is, software that supports the DHCP service and software that supports the controller on the physical server.
- a software supporting DHCP service and software supporting the controller are deployed on a physical server, the physical server is both a DHCP server and a controller.
- the business server is used to run the business.
- FIG. 1 illustrates a network architecture provided by an embodiment of the present application.
- the controller and the DHCP server run on the same server.
- the server is connected to switch 1, and the remaining switches in the network need to communicate with the DHCP server or controller through switch 1.
- FIG. 1 shows only a part of the switches, and the switch 1, the switch 2, the switch 3, the switch 4, and the switch 5 can also be connected to other switches.
- FIG. 2a illustrates another network architecture provided by the embodiment of the present application.
- the controller and the DHCP server are running on different servers, and the controller and the DHCP server are both connected to the switch 1. The remaining switches in the network are required. Communicate with the DHCP server and controller through switch 1.
- FIG. 2b illustrates another network architecture provided by the embodiment of the present application.
- the controller and the DHCP server are running on two different servers, and the two servers are connected to different switches, such as this implementation.
- the controller is connected to the switch 1
- the DHCP server is connected to the switch 2.
- the remaining switches in the network need to communicate with the controller through switch 1.
- the remaining switches in the network need to communicate with the DHCP server through switch 2.
- FIG. 3 is a schematic structural diagram of a switch provided by an embodiment of the present application.
- the switch includes a host (English: host), and the host has a media access control (English: Media Access Control, MAC address) address, that is, a MAC address of the switch.
- the host communicates with the controller through the management port.
- the management port of the host is connected to at least one forwarding port of the switch.
- the packets sent by the management port are sent to other switches, DHCP servers, or controllers through the forwarding port. Packets sent by other switches, DHCP servers, or controllers destined for the switch are sent to the management port through the forwarding port of the switch and then sent to the host of the switch.
- the management port can be a hardware port or a logical port.
- FIG. 4 is a schematic diagram of an internal structure of a switch according to an embodiment of the present invention.
- an operating system is run on a host of the switch, and the operating system includes a network and a management protocol stack. Stack).
- the operating system is connected to the forwarding port of the switch through the management port of the network and the management protocol stack.
- the management port is also called a local port (English: local port).
- FIG. 4 is a schematic diagram of an internal structure of a switch according to an embodiment of the present invention.
- the switch includes a control plane and a forwarding plane.
- the host supports the operation of the control plane.
- the control plane is responsible for managing the switch, including initiating a DHCP request, generating a DHCP reply, generating an ARP reply, generating a port reply message, receiving content for generating a flow table sent by the controller, and generating a corresponding flow table according to the content. Enter the forwarding surface, etc.
- the forwarding plane is responsible for receiving packets, sending outgoing packets, matching the packets with the flow table, and processing the matched packets.
- the forwarding plane of the switch can perform a report operation on the packet.
- the reporting action includes sending the packet and the inport port of the packet to the controller.
- the inport port of the packet is the forwarding port used when the packet enters the forwarding plane of the switch.
- the control plane of the switch 1 sends the packet A to the forwarding plane of the switch 1 through the port 1
- the port 1 reports the packet to the controller.
- the switch 1 receives the packet B sent by the controller/DHCP server through the port 2
- the forwarding plane of the switch 1 reports the packet B
- the port 2 also reports to the controller.
- the control plane is connected to the forwarding port through the management port, and the forwarding plane is connected to the forwarding port. Therefore, the control plane communicates with the forwarding plane through the forwarding port.
- the management port of the switch Take the management port of the switch through port X and the forwarding plane as an example. If a packet is sent to a forwarding port of the switch, the packet enters the forwarding plane of the switch through the forwarding port. If the packet needs to be sent to the control plane, the forwarding plane needs to send the packet from port X.
- the packet can be a DHCP request, an ARP request, or a port detection packet.
- control plane If the control plane receives the packet from the management port and generates a corresponding reply message according to the packet, such as a DHCP reply, an ARP reply, and a port probe reply, the control plane sends the reply packet from the management port.
- X is sent to the forwarding plane and sent to the outside through the forwarding plane.
- the switch in the network After the switch in the network starts, it requests the DHCP server to assign an IP address.
- the controller does not know the connection relationship between the switches and the address information of the switch. Therefore, the flow table that accurately controls the flow of DHCP requests cannot be sent to each switch.
- each switch sends the received DHCP request from all forwarding ports.
- switch 4 generates a DHCP request and sends a DHCP request to all switches connected to switch 4, including switch 2, switch 3, and switch 5.
- the switch 5 sends the DHCP request to all switches connected to the switch 5, including the switch 3 and the switch 4.
- the DHCP request forms a broadcast storm within the network, causing great pressure on the network.
- the solution provided by the present application sets a flow table in the switch. This setting is done before the switch or controller initiates a DHCP request.
- a flow table can be pre-stored on each switch and set to load the flow table when the switch starts.
- the process of this setup can be performed by an administrator before the controlled process of the switch begins. According to the MAC address of each switch, the administrator designs a corresponding preset flow table for each switch and stores the designed preset flow table into the memory of the switch.
- the first preset flow table and the second preset flow table are set in each switch in the network.
- the available forwarding port in the action domain of the preset flow table may be part of the forwarding port of the switch.
- the available forwarding port can be the forwarding port used during network booting. Ports 1-7 mentioned in this document are available forwarding ports. For example, part of the forwarding port that the switch can reserve is not used for the controlled process of the switch, and the action domain of the preset flow table does not need to send the message from these reserved partial forwarding ports.
- the forwarding port connected to the management port in the switch 1 is port 1, and the switch 1 establishes a connection between the DHCP server and the controller through the port 2, as shown in FIG. the way.
- the switch 2 can also be included in the network, and the switch 2 is connected to the port 3 of the switch 1 through the port 4.
- the management port of switch 2 is connected to port 5 of switch 2, refer to FIG.
- FIG. 6 is a schematic diagram of a process based on the control of the switch 1 in FIG. 5 according to an embodiment of the present invention. It should be noted that the execution order of each step in FIG. 6 is not limited, and multiple steps may be performed in parallel.
- the switch 1 acquires the first preset flow table and the second preset flow table.
- the port is sent;
- the action domain of the second preset flow table of switch 1 includes: issuing from all available forwarding ports of switch 1.
- the forwarding plane of the switch 1 acquires and stores the first preset flow table and the second preset flow table.
- the switch 2 acquires the first preset flow table and the second preset flow table.
- the action domain of the first preset flow table of the switch 2 and the action domain of the second preset flow table include: being issued from all available forwarding ports of the switch 2.
- the switch 1 generates a first DHCP request.
- the switch 1 only knows its own MAC address at this time, so the control plane of the switch 1 generates a first DHCP request to request the DHCP server to allocate the Internet Protocol (English: Internet Protocol, IP address) address of the switch 1, that is, the IP of the switch 1. address.
- the source MAC address in the first DHCP request is the MAC address of the switch 1.
- the forwarding plane of the switch 1 matches the first DHCP request and the first preset flow table, and sends the first DHCP request from all available forwarding ports of the switch 1 according to the action domain of the first preset flow table.
- the forwarding plane sends the first DHCP request from all available forwarding ports of the switch 1 according to the action domain indication of the first preset flow table.
- the DHCP server receives the first DHCP request from switch 1.
- the switch 1 also sends the first DHCP request to other switches connected to the switch 1, such as switch 2, switch 3, but since switch 2 and switch 3 cannot match the first DHCP request to any flow table at this time, switch 2 and Switch 3 will discard the first DHCP request without causing a broadcast storm and reducing the load on the network.
- switch 2 receives the number issued by switch 1.
- the switch 2 obtains the first DHCP request through the port 4.
- the forwarding plane of switch 2 attempts to match the first DHCP request with the first preset flow table of switch 2 and the second preset flow table of switch 2.
- the switch 2 determines that the first DHCP request cannot match the matching field of the first preset flow table of the switch 2 or the second preset flow table of the switch 2, and discards the first DHCP request.
- S205 to s207 are executed at any time after s206, and can be performed in parallel with s208 and its subsequent steps.
- the DHCP server allocates IP1 as the IP address of the switch 1 according to the first DHCP request.
- a first DHCP reply is generated and sent to port 2 of switch 1.
- the destination MAC address of the first DHCP reply is the MAC address of switch 1, and the first DHCP reply carries IP 1.
- the DHCP server can notify controller 1 that the IP address of the switch 1 is IP 1 for the controller to record.
- the switch 1 obtains the first DHCP reply through the port 2.
- the forwarding plane of the switch 1 matches the first DHCP reply and the second preset flow table, and the first DHCP reply is sent from all available forwarding ports of the switch 1 according to the action field of the second preset flow table. Since the management port of the switch 1 is connected to the forwarding port port 1, the control plane of the switch 1 can receive the first DHCP reply sent from the port 1, and obtain the IP 1 from the first DHCP reply.
- the switch 1 establishes a Transmission Control Protocol (TCP) connection with the controller.
- TCP Transmission Control Protocol
- the IP address of the controller is preset in the switch 1.
- the control plane of the switch 1 establishes a TCP connection (connection) with the controller.
- the controller knows the correspondence between the switch 1 and the IP 1.
- the setup process includes multiple control of the control plane of the switch 1 and the controller.
- the message sent to the controller is sent from all available forwarding ports of switch 1 by matching the first preset flow table, refer to s206.
- the message sent to the control plane of switch 1 is sent from all available forwarding ports of switch 1 by matching the second preset flow table, with reference to s210.
- the controller generates a first address resolution protocol (ARP) probe flow table and a second ARP probe flow table, and sends a first ARP probe flow table and a second ARP probe flow table to the switch 1.
- ARP address resolution protocol
- the action domain of the first ARP probe flow table includes: reporting to the controller.
- the action domain of the second ARP probe flow table includes: reporting to the controller. In the reported action, the inport port, that is, the port that the packet enters, is sent to the controller.
- the controller may send the first ARP probe flow table and the second ARP probe flow table to the control plane of the switch 1 in multiple times, and the control plane of the switch 1 sends the first ARP probe flow table and the second ARP probe flow table to the forwarding.
- the first ARP probe flow table and the second ARP probe flow table are stored in the forwarding plane.
- the controller generates a first ARP request and a second ARP request, and sends the first ARP request and the second ARP request to the switch 1. And, the controller instructs the switch 1 to issue the first ARP request and the second ARP request from all available forwarding ports of the switch 1, such as a PacketOut first ARP request and a second ARP request.
- the controller may send the first ARP request and the second ARP request to the switch 1 in multiple times.
- the source IP address of the first ARP request is the IP address of the gateway, and the destination IP address is IP 1.
- the gateway is simulated by the controller, and the IP address of the gateway is different from the IP address of the controller.
- the source IP address of the second ARP request is the IP address of the gateway.
- the destination IP address is the IP address of the controller.
- the forwarding plane of the switch 1 After receiving the first ARP request and the second ARP request, the forwarding plane of the switch 1 sends the first ARP request and the second ARP request from all available forwarding ports. Since the management port of the switch 1 is connected to the forwarding port port 1, the control plane of the switch 1 can receive the first ARP request sent from the port 1. After receiving the first ARP request, the control plane of the switch 1 confirms that the destination IP address in the first ARP request is its own IP address. Therefore, the control plane of the switch 1 generates a first ARP reply according to the first ARP request, and refers to s218. The forwarding plane of switch 1 sends a second ARP request from port 2 to the controller, see s226. After receiving the second ARP request, the controller confirms that the destination IP address in the second ARP request is its own IP address, so the controller generates a second ARP reply according to the second ARP request, refer to s228.
- the switch 1 receives the first ARP request, and generates a first ARP reply.
- the source IP address of the first ARP reply is IP 1
- the destination IP address is the IP address of the gateway.
- the control plane of the switch 1 After the control plane of the switch 1 obtains the first ARP request sent from the port 1 through the management port, the first ARP reply is generated.
- the first ARP reply is sent from the management port and sent to the forwarding plane of the switch 1 via the port 1. Therefore, the inport port number of the first ARP reply in s220 is port 1.
- the forwarding plane of the switch 1 matches the first ARP reply and the first ARP probe flow table, and reports the first ARP reply to the controller according to the action domain of the first ARP probe flow table.
- the inport port that is reported to the controller in addition to the first ARP reply has the first ARP reply, that is, the forwarding port port 1 connected to the management port of the switch 1. Since the switch 1 does not know that the controller is connected to itself through that forwarding port at this time, the switch 1 can issue the first ARP reply and port 1 from all available forwarding ports to report the first ARP reply to the controller.
- the controller receives the reported first ARP reply and port 1.
- the controller records port 1 of switch 1. And generate a first flow table according to port 1.
- the first flow table indicates that a message destined for switch 1 (ie, the destination is the control plane of switch 1) is sent from port 1.
- the matching field of the first flow table includes: the destination is switch 1.
- the action field of the first flow table includes: issued from port 1.
- the first flow table may be composed of one or more flow tables.
- the action fields of the multiple flow tables are: sent from port 1.
- the matching field of each flow table may include any one or more of the following combinations:
- the destination MAC address of the packet is the MAC address of Switch 1; the destination IP address of the packet is IP 1; other fields that can determine Switch 1.
- the controller In s222, the controller generates a first flow table for unicast according to the connection relationship between the management port of the switch 1 and the forwarding port port 1.
- the controller instructs the switch 1 to set the first flow table with a higher priority than the second preset flow table, or the controller instructs the switch 1 to delete the second preset flow table after receiving the first flow table. Therefore, in the case that the switch 1 subsequently receives the destination of the packet as the switch 1, the packet does not need to be sent from all available forwarding ports according to the second preset flow table, and the packet can be accurately received according to the first flow table. Port 1 is sent to the management port of switch 1, reducing network stress.
- the control plane of the switch 1 receives the first flow table and stores the first flow table in the forwarding plane of the switch 1.
- the first flow table has a higher priority than the second preset flow table, or the second preset flow table is deleted after storing the first flow table according to the instruction of the controller.
- the switch adjacent to the switch 1 Before s224, if the switch adjacent to the switch 1 generates the DHCP request scenario reference s209 to s213, the s209 to s213 may be executed at any time before the switch 1 acquires the first flow table, and the switch 2 generates the second DHCP request as an example.
- the switch 2 generates a second DHCP request, and the source MAC address of the second DHCP request is the MAC address of the switch 2.
- the switch 2 since the second DHCP request can match the first preset flow table of the switch 2, the switch 2 sends the second DHCP request from all available forwarding ports according to the action domain of the first preset flow table of the switch 2.
- the switch 1 receives the second DHCP request from the forwarding port 3, and attempts to match the second DHCP request with the first preset flow table of the switch 1 and the second preset flow table of the switch 1. After the switch 1 determines that the second DHCP request cannot match the matching field of the first preset flow table of the switch 1 or the second preset flow table of the switch 1, the switch 1 discards the second DHCP request, limiting the broadcast range of the second DHCP request. , reducing the network load.
- the switch 1 sends a second ARP request to the controller.
- the controller in s216 instructs the switch 1 that the second ARP request is sent from all available forwarding ports of the switch 1, and the forwarding plane of the switch 1 sends the second ARP request to the controller through the port 2.
- the controller After receiving the second ARP request, the controller generates a second ARP reply.
- the source IP address of the second ARP reply is the IP address of the controller, and the destination IP address is the IP address of the gateway.
- the controller sends a second ARP reply to the switch 1.
- the forwarding plane of the switch 1 matches the second ARP reply and the second ARP probe flow table, and reports the second ARP reply to the controller according to the action domain of the second ARP probe flow table.
- the second ARP reply enters the forwarding plane of switch 1 through port 2.
- the inport port that is reported to the controller in addition to the second ARP reply has a second ARP reply, that is, the forwarding port port 2 to which the switch 1 is connected to the controller. Since the switch 1 does not know at this time that the controller is specifically connected to itself through that forwarding port, the switch 1 can issue a second ARP reply from all available forwarding ports to report the second ARP reply to the controller.
- the controller records the port 2 of the switch 1, and generates a second flow table.
- the second flow table indicates that a message destined for the controller or DHCP server is sent from port 2.
- the matching field of the second flow table includes: the destination is a controller or a DHCP server.
- the action field of the second flow table includes: issued from port 2.
- the second flow table may be composed of one or more flow tables.
- the action fields of the multiple flow tables are: issued from port 2.
- the matching field of each flow table may be a combination of any one or more of the following:
- Packet type DHCP
- the controller knows the connection relationship between the forwarding port port 2 of the switch 1 and the controller, and can generate a second flow table for unicast.
- the controller may instruct the switch 1 to set the second flow table with a higher priority than the first preset flow table. Or the controller instructs the switch 1 to delete the first preset flow table after receiving the second flow table. Therefore, in the case that the switch 1 subsequently receives the packet destined for the DHCP server or the controller, the packet can be accurately sent from the port 2 to the DHCP server or the controller according to the second flow table.
- the switch 1 After the switch 1 obtains the second flow table, if the DHCP request generated by the neighboring switch is received, the DHCP request generated by the neighboring switch may be sent to the DHCP server according to the second flow table. Therefore, the layer-by-layer control of the switches in the network is ensured, that is, the switch 1 is controlled first (the forwarding port of the switch 1 is recognized by the controller), and then the switch adjacent to the switch 1 is controlled.
- the controller sends the second flow table to the switch 1.
- the switch 1 receives and stores the second flow table.
- the second flow table has a higher priority than the first preset flow table, or the controller instructs the switch 1 to delete the first preset flow table after storing the second flow table.
- the order of execution of s226 to s236 and s218 to s224 is not sequential, and the switch 1 can also perform s226 and s218 in parallel.
- the switch 1 does not broadcast DHCP packets sent by other switches during the process of obtaining IP 1.
- the controller controls the next-hop switch layer by layer to reduce the broadcast in the network.
- the number of messages has improved the efficiency of the guide.
- the control plane sent to the switch 1 and the message sent to the DHCP server and the controller are changed from the initial broadcast flow table (the first preset flow table and the second preset flow table) to the unicast flow table ( The first flow table and the second flow table) greatly reduce the efficiency of the subsequent switch 1 to send messages.
- the connection relationship between the IP address, the MAC address, and the forwarding port of the switch 1 is known by the controller, and the control plane of the switch 1 establishes a connection with the controller and is controlled by the controller.
- the switch 1 does not need the port learning function, and the control plane and the forwarding plane of the switch 1 are combined into one network, which reduces the requirement on the switch 1, that is, reduces the cost of the network architecture.
- FIG. 8 is a schematic diagram of the controlled process of the switch 2 by using the switch 2 as an example.
- Example. FIG. 7 is an embodiment of the present application. The connection relationship between the forwarding port of the switch 2 and the switch 1 is introduced in this embodiment. The order of execution of the steps in FIG. 8 is not limited, and a plurality of steps may be performed in parallel.
- the switch 2 acquires the first preset flow table, the second preset flow table, and the third preset flow table.
- the forwarding plane of the switch 2 acquires and stores the first preset flow table, the second preset flow table, and the third preset flow table. For details, refer to step s201 in FIG. 6 above, and details are not described herein again.
- the action field of the third preset flow table includes: changing the source MAC address of the packet to the MAC address of the switch (that is, the MAC address of the switch 2), and sending the changed packet from the inport port.
- the source MAC address of the packet in the matching domain of the third preset flow table can be flexibly set except for all 0s.
- the source MAC address of the packet in the matching domain of the third preset flow table is the same as the first port probe packet in s406.
- S404 The controller generates a first port detection flow table, and sends a first port detection flow table to the switch 1.
- the action domain of the first port detection flow table includes: reporting the controller.
- S406 The controller generates a first port detection packet, and sends a first port detection packet to the switch 1. And, the controller instructs the switch 1 to send the first port probe message from all available forwarding ports of the switch 1, for example PacketOut first port detection packet.
- the packet type of the first port detection packet can be LLDP.
- the source MAC address of the first port probe packet can be all 0s.
- the switch 1 sends the first port detection packet to the port 4 of the switch 2 through the port 3.
- the forwarding plane of the switch 2 matches the first port detection packet with the third preset flow table. And changing the source MAC address of the first port detection packet to the MAC address of the switch 2 to generate the first port reply message according to the action field of the third preset flow table.
- the switch 2 sends the first port reply message from the port 4 to the port 3 of the switch 1 according to the action field of the third preset flow table.
- the forwarding plane of the switch 1 receives the first port reply message through the port 3.
- the forwarding plane of the switch 1 matches the first port reply packet with the first port probe flow table, and reports the first port reply message to the controller according to the matching field of the first port probe flow table. In the reported action, the inport port port3 of the first port reply message is sent to the controller.
- the controller records the correspondence between the MAC addresses of the port 3 and the switch 2, and generates a third flow table.
- the controller responds to the MAC address of the switch 2 and the port 3 carried in the packet by the first port, and determines that the switch 1 is connected to the switch 2 through the port 3 to generate a third flow table.
- the matching field of the third flow table includes: the destination is switch 2.
- the action field of the third flow table includes: issued from port 3.
- the matching field of the third flow table may include: the destination MAC address of the packet is the MAC address of the switch 2.
- the forwarding plane of switch 1 receives and stores the third flow table. Through the third flow table, when the switch 1 subsequently receives the packet destined for the switch 2, the switch can accurately send the packet from the port 3 to the switch 2, reducing the broadcast and reducing the network load.
- the execution of s404 to s418 can also be performed after or during s420 to s448.
- the control plane of the switch 2 generates a second DHCP request, and sends the second DHCP request to the forwarding plane of the switch 2 through the management port of the switch 2.
- the source MAC address of the second DHCP request is the MAC address of the switch 2.
- the forwarding plane of the switch 2 matches the second DHCP request and the first preset flow table, and sends the second DHCP request from all available forwarding ports of the switch 2 according to the action domain of the first preset flow table.
- the switch 1 receives the second DHCP request from the port 3, and sends the second DHCP request to the DHCP server.
- the switch 1 matches the second DHCP request and the second flow table, and sends the second DHCP request to the DHCP server through the port 2.
- the second flow table can be matched.
- the DHCP server allocates IP 2 as the IP address of the switch 2 according to the second DHCP request.
- the DHCP server generates a second DHCP reply and sends it to switch 2 through switch 1.
- the destination MAC address of the second DHCP reply is the MAC address of switch 2, and the second DHCP reply carries IP 2.
- switch 2 obtains a second DHCP reply.
- the forwarding plane of switch 2 matches the second DHCP reply and the second
- the preset flow table sends the second DHCP reply from all available forwarding ports of the switch 2 according to the action field of the second preset flow table. Since the management port of the switch 2 is connected to the forwarding port port 5, the control plane of the switch 2 can receive the second DHCP reply and acquire the IP 2.
- switch 2 establishes a TCP connection with the controller.
- the process of establishing the TCP connection refers to s212 of FIG.
- the controller generates a third ARP probe flow table and a second port probe flow table, and sends the switch to the switch 2 through the switch 1.
- the action domain of the third ARP probe flow table includes: reporting the controller.
- the action domain of the second port detection flow table includes: reporting the controller.
- the controller may send the third ARP probe flow table and the second port probe flow table to the switch 2 in two steps.
- the controller generates a third ARP request and a second port detection message, and sends the switch to the switch 2 through the switch 1. And, the controller instructs the switch 2 to issue a third ARP request from all available forwarding ports of the switch 2, such as a PacketOut third ARP request.
- the packet type of the second port detection packet can be LLDP.
- the source MAC address of the second port detection packet may be the MAC address of the switch 1.
- the destination IP address of the third ARP request is IP 2.
- the controller can send the third ARP request and the second port probe message to the switch 2 in two times.
- the control plane of the switch 2 receives the third ARP request sent from the port 5 through the management port, and generates a third ARP reply.
- the source IP address of the third ARP reply is IP 2.
- the forwarding plane of the switch 2 obtains the third ARP reply through the port 5, matches the third ARP probe flow table and the third ARP reply, and reports the third ARP reply to the controller according to the action domain of the third ARP probe flow table.
- the inport port that is reported to the controller and includes the third ARP reply that is, the forwarding port port 5 that is connected to the management port of the switch 2.
- the controller records port 5 of switch 2. And generate a fourth flow table according to port 5.
- the fourth flow table indicates that a message destined for switch 2 is sent from port 5.
- the fourth flow table may be composed of one or more flow tables.
- the action fields of the multiple flow tables are: issued from port 5.
- the matching field of each flow table may include any one or more of the following combinations:
- the destination MAC address of the packet is the MAC address of Switch 2; the destination IP address of the packet is IP 2; other fields that can determine Switch 2.
- the controller sends the fourth flow table to the switch 2 through the switch 1.
- the forwarding plane of switch 2 stores a fourth flow table.
- the fourth flow table has a higher priority than the second preset flow table of the switch 2, or the controller instructs the switch 2 to delete the second preset flow table of the switch 2 after storing the fourth flow table.
- the forwarding plane of the switch 2 matches the second port detection packet and the second port detection flow table, and reports the second port detection packet to the controller according to the action domain of the second port detection flow table.
- the second port detection packet enters the forwarding plane of the switch 2 from the port 4, and is reported to the inport port of the controller including the second port detection packet, that is, the port. 4.
- the controller records the forwarding port port 4 of the switch 2 connected to the switch 1, and generates a fifth flow table according to the port 4.
- the fifth flow table indicates that the message from the destination DHCP server or controller or switch 1 is sent from port 4.
- the controller When the s446 is executed, the controller has obtained the identifier information of the switch 1 such as the MAC address and the IP address information of the switch 1. Therefore, the identifier information of the switch 1 can be carried in the second port detection packet.
- the controller can learn that the port 4 carried in the second port detection packet is sent to the switch 1 in the s444, and the controller can generate the fifth flow table.
- the controller sends the fifth flow table to the switch 2 through the switch 1.
- the forwarding plane of the switch 2 stores the fifth flow table.
- the fifth flow table may be composed of one or more flow tables.
- the action fields of the multiple flow tables are: issued from port 4.
- the matching field of each flow table may be a combination of any one or more of the following:
- S436 to s442 and s444 to s448 are respectively used for locating the forwarding port of the control plane connection of the switch 2 and the forwarding port of the positioning switch 2 and the switch 1.
- the order of execution of s436 to s442 and s444 to s448 is not sequential, and both can be performed in parallel.
- the ARP probe flow table and the ARP type packet are used to locate the inport port (for example, port 1 and port 5) and the controller of the control plane of the switch. Connect to the inport port of the switch (for example, port 2) with the DHCP server. At the same time, the port detection flow table, the port detection packet, and the port reply packet are used to locate the forwarding port (for example, port 3 and port 4) connected between the switches.
- the forwarding port for example, port 3 and port 4
- Multi-Protocol Label Switching (English: Multi-Protocol Label Switching; abbreviation: MPLS).
- MPLS Multi-Protocol Label Switching
- the packet type in the matching field of the port detection flow table is MPLS
- the packet type of the port detection packet sent by the controller is MPLS
- the packet generated by the switch replies to the packet.
- the type is MPLS.
- the switch 2 processes the control plane sent to the switch 2 and the message sent to the DHCP server and the controller by the initial broadcast flow table (the first preset flow table and the second pre- The flow table is changed based on the unicast flow table (the third flow table and the fourth flow table), which greatly reduces the efficiency of the subsequent switch 2 to send such messages.
- the connection relationship between the IP address, the MAC address, and the forwarding port of the switch 2 is known by the controller, and the control plane of the switch 2 establishes a connection with the controller and is controlled by the controller.
- the switch 2 does not need the port learning function, and the control plane and the forwarding plane of the switch 2 are combined into one network, which reduces the requirement on the switch 2, that is, reduces the cost of the network architecture.
- the controlled process of other switches in the network refers to the process of Figure 6 and Figure 8.
- the switches in the network are controlled layer by layer from the switches connected to the controller.
- the switch directly connected to the controller is controlled by the flow shown in Figure 6, the controlled switch
- the next hop switch is controlled by the flow shown in Figure 8, and then spreads down to the next hop switch until all switches in the network are controlled by the controller.
- the controller knows the port connection status of each switch. Therefore, the controller can deliver a flow table that precisely controls the flow of packets to the controlled switch, reducing the broadcast of packets on the network and reducing network pressure.
- FIG. 6 and FIG. 8 describe the process controlled by each switch in the network in the scenario of FIG. 1.
- the process controlled by the switch is similar to the scenario of Figure 1, which is described separately below.
- the DHCP server and the controller are respectively located on different servers, that is, connected to the switch 1 through different ports. Therefore, in addition to the processes of FIGS. 6 and 8, it is also necessary to locate the port to which the DHCP server is connected to the switch 1. As shown in FIG. 9, the DHCP server is connected to the port 6 of the switch 1.
- the order of execution of the steps in FIG. 10 is not limited, and a plurality of steps may be performed in parallel.
- s602 to s636 correspond to the steps of s202 to s236.
- the steps and new steps of Figure 10 compared to Figure 6 are highlighted below.
- the controller in s614 also needs to generate a fourth ARP probe flow table, and send the fourth ARP probe flow table to the switch 1.
- the action field of the ARP probe flow table includes: reporting to the controller.
- the controller also generates a fourth ARP request, and sends a fourth ARP request to the switch 1. And, the controller instructs the switch 1 to issue the fourth ARP request from all available forwarding ports of the switch 1.
- the source IP address of the fourth ARP request is the IP address of the gateway, and the destination IP address is the IP address of the DHCP server.
- the switch 1 in s638 sends the fourth ARP request to the DHCP server.
- the s640 DHCP server sends a fourth ARP reply to switch 1.
- the DHCP server Since the destination IP address in the fourth ARP request is the IP address of the DHCP server, the DHCP server generates a fourth ARP reply according to the fourth ARP request.
- the source IP address of the fourth ARP reply is the IP address of the DHCP server.
- the forwarding plane of the switch 1 matches the fourth ARP probe flow table and the fourth ARP reply, and reports the fourth ARP reply to the controller according to the action domain of the fourth ARP probe flow table, and the fourth ARP reply is also reported.
- the controller records the port 6 of the switch 1 and the DHCP server connection, and generates a sixth flow table.
- the sixth flow table indicates that a message destined for the DHCP server is sent from port 6.
- the matching of the sixth flow table includes: the destination is a DHCP server.
- the action field of the sixth flow table includes: issued from port 6.
- the controller sends the sixth flow table to switch 1.
- the forwarding plane of the switch 1 can accurately process the subsequent received packets destined for the DHCP server, improving the processing efficiency of the packets.
- the execution order of s626 to s236, s618 to -s224, and s638 to s648 is not sequential, and the switch 1 can also perform s626, s618, and s638 in parallel.
- the DHCP server and controller are on different servers and are connected to different switches. Therefore, in addition to the processes of FIGS. 6 and 8, it is also necessary to locate the port to which the DHCP server is connected to the switch 2. As shown in FIG. 11, the DHCP server is connected to the port 7 of the switch 2.
- the order of execution of the steps in FIG. 12 is not limited, and a plurality of steps may be performed in parallel.
- the forwarding plane of the switch 1 acquires the first preset flow table of the switch 1 and the second preset flow table of the switch 1.
- the forwarding plane of the switch 2 acquires the fourth preset flow table and the fifth preset flow table.
- the action domain of the fourth preset flow table and the action domain of the fifth preset flow table both include: are issued from all available forwarding ports of the switch 2.
- the control plane of the switch 1 generates a first DHCP request, and sends the first DHCP request to the forwarding plane through the management port.
- the source MAC address of the first DHCP request is the MAC address of the switch 1.
- the forwarding plane of the switch 1 matches the first DHCP request and the first preset flow table, and sends the first DHCP request from all available forwarding ports of the switch 1 according to the action domain of the first preset flow table.
- the switch 2 receives the first DHCP request through the port 4, the forwarding plane of the switch 2 matches the first DHCP request and the fourth preset flow table, and the first DHCP request is received from the switch 2 according to the action domain of the fourth preset flow table. All available forwarding ports are issued. This includes sending a first DHCP request to the DHCP server over port 7.
- the DHCP server receives the first DHCP request sent by the port 7, and allocates IP1 as the IP address of the switch 1 according to the first DHCP request.
- the DHCP server generates a first DHCP reply and sends it to port 7 of switch 2.
- the destination MAC address of the first DHCP reply is the MAC address of switch 1, and the first DHCP reply carries IP 1.
- switch 2 obtains the first DHCP reply through port 7.
- the forwarding plane of the switch 2 matches the first DHCP reply and the fifth preset flow table, and the first DHCP reply is sent from all available forwarding ports of the switch 2 according to the action field of the fifth preset flow table.
- the switch 1 receives the first DHCP reply sent from the port 3 of the switch 2 through the port 3, and sends the first DHCP reply to the switch according to the second preset flow table of the switch 1.
- the control plane of 1 causes the control plane of switch 1 to acquire IP 1.
- switch 1 establishes a TCP connection with the controller.
- s816 refers to s212.
- the location of port 1 and port 2 of switch 1 and the unicast flow table (the first flow table and the second flow table in the flow corresponding to FIG. 6) are generated with reference to s214 to s236, port 3 of switch 1, and switch 1
- the location of port 4 and port 5 and the generation of the unicast flow table (the third flow table, the fourth flow table, and the fifth flow table in the flow corresponding to FIG. 8) are referred to s402 to s448.
- the controller generates a fifth ARP probe flow table, and sends the fifth ARP probe flow table to the switch 2.
- the action field of the ARP probe flow table includes: reporting to the controller.
- the controller also generates a fifth ARP request, sends the fifth ARP request to the switch 2 through the switch 1, and the controller instructs the switch 2 to send the fifth ARP request from all available forwarding ports of the switch 2.
- the source IP address of the fifth ARP request is the IP address of the gateway, and the destination IP address is the IP address of the DHCP server.
- the DHCP server generates a fifth ARP reply according to the fifth ARP request.
- the source IP address of the fifth ARP reply is the IP address of the DHCP server.
- the DHCP server sends a fifth ARP reply to switch 2.
- the forwarding plane of the switch 2 matches the fifth ARP probe flow table and the fifth ARP reply, and reports the fifth ARP reply to the controller, and the fifth ARP reply is sent to the inport port of the switch 2, that is, the port 7.
- the controller records the port 7 of the switch 2 and the DHCP server connection, and generates a seventh flow table.
- the seventh flow table indicates that a message destined for the DHCP server is sent from port 7.
- the matching of the seventh flow table includes: the destination is a DHCP server.
- the action field of the seventh flow table includes: issued from port 7.
- the controller sends the seventh flow table to the switch 2.
- the forwarding plane of the switch 2 can accurately process the subsequent received packets destined for the DHCP server, improving the processing efficiency of the packets.
- s818 to s828 may be performed in parallel with the positioning of port 1 and port 2 of the foregoing switch 1 and the positioning of port 3, port 4, and port 5 of the switch 2 or in any order.
- the switches in the network can be automatically controlled without the intervention of the administrator. Reduce the difficulty of network operation and maintenance and management.
- FIG. 13 provides a controller 1000.
- the controller 1000 includes a bus 1002, a processor 1004, a communication interface 1006, and a memory 1008.
- the processor 1004, the memory 1008, and the communication interface 1006 communicate via the bus 1002.
- Communication interface 1006 is used to communicate with the switch.
- the processor 1004 can be a central processing unit (English: central processing unit, abbreviation: CPU).
- the memory 1008 may include a volatile memory (English: volatile memory) (English: random access memory, abbreviation: RAM).
- the memory 1008 may also include a non-volatile memory, such as a read-only memory (English: read-only memory, abbreviated as ROM), a flash memory, an HDD or an SSD.
- the controller 1000 communicates with the switch managed by the controller 1000 through the communication interface 1006, for example, sending a flow table to the switch, receiving a message from the switch, or transmitting a message to the switch.
- the executable code is stored in the memory 1008, and the processor 1004 executes the executable code to perform the action on the controller side in the above flow.
- the memory 1008 stores an operating system, a gateway, a flow table generating module, and a message processing module.
- the operating system may be LINUX, UNIX, WINDOWS, etc.
- the processor 1004 executes an operating system to control the controller 1000.
- the gateway, the flow table generation module, and the message generation module run on the operating system.
- the flow table generating module is configured to record the management port and the forwarding port of the switch, and generate a corresponding flow table to send to the corresponding switch through the communication interface 1006.
- the packet generation module is configured to generate various types of packets, including ARP requests and port detection packets.
- FIG. 14 provides a switch 1200.
- the switch 1200 includes a bus 1202, a processor 1204, a communication interface 1206, and a memory 1208.
- the processor 1204, the memory 1208, and the communication interface 1206 communicate via a bus 1202.
- Each switch in the foregoing network can adopt the architecture of the exchange 1200.
- the processor 1204 is configured to perform the actions on the switch side in the above-described flow.
- Communication interface 1206 includes a forwarding port. Executable code is stored in memory 1208.
- the processor 1204 can be implemented by a combination of the processing chip 1210 and the CPU.
- the processing chip 1210 is implemented by an integrated circuit and may be a combination of one or more of an ASIC or a PLD or a network processing unit.
- the above PLD may be a combination of any one or more of CPLD, FPGA, and GAL.
- Memory 608 can include volatile memory, such as RAM.
- Memory 1208 may also include non-volatile memory such as ROM, flash memory, HDD or SSD.
- the CPU of the processor 1204 When the CPU of the processor 1204 operates, it supports the control plane of the switch 1200, that is, the host of the switch.
- the control plane communicates with the controller, receives the content sent by the controller for generating the flow table, generates a corresponding flow table, and sends the corresponding flow table to the processing chip 1210.
- An executable code is stored in the memory 1208, and the processor 1204 executes the executable code to perform the action on the controller side in the above-described flow.
- the operating system and the message processing module are stored in the memory 1208.
- the operating system may be LINUX, UNIX, WINDOWS, etc., and the processor 1204 executes an operating system to control the switch 1200.
- the gateway and message processing module runs on top of the operating system.
- the packet processing module can be used to generate a DHCP request, generate an ARP reply, generate a port reply message, and the like.
- the processing chip 1210 When the processing chip 1210 is in operation, the forwarding plane of the switch 1200 is supported.
- the processing chip 1210 is provided with a memory for storing a flow table sent by the processor 1204, and the memory may be any of RAM, ROM, flash memory, HDD, SSD, and ternary content addressable memory. A combination of one or more.
- the processor 1204 can also be implemented only by the CPU. In this case, when the CPU of the processor 1204 operates, the control plane and the forwarding plane of the switch 1200 are supported.
- the processor 1204 receives the content sent by the controller for generating the flow table through the communication interface 1206, and generates a corresponding flow table and sends it to the memory 1208.
- the memory 1208 further stores a flow table matching module, and the processor 1204 matches the message with the flow table according to the flow table matching module, and processes the message according to the action field of the flow table.
- the above embodiments it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof.
- software it may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions.
- the computer program instructions When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present invention are generated in whole or in part.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
- the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wire (eg, coaxial cable, fiber optic, digital subscriber line, or wireless (eg, infrared, wireless, microwave, etc.).
- the computer readable storage medium may be a computer Any available media that can be accessed is a data storage device such as a server, data center, or the like that includes one or more available media integrations.
- the available media can be magnetic media (eg, floppy disk, hard disk, tape), optical media (eg, , DVD), or a semiconductor medium (such as SSD).
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请公开了一种网络,包括第一交换机第二交换机和控制器。该第一交换机的管理端口与该第一交换机的第一转发端口连接,该第一交换机的第三转发端口与该第二交换机的第四转发端口连接。该网络的引导阶段,该第一交换机通过预置流表与DHCP服务器通信,获取自己的IP地址。随后控制器通过探测报文和探测流表学习该第一交换机和该第二交换机的各个转发端口的连接关系,以对该第一交换机和该第二交换机进行控制。
Description
本申请涉及计算机技术领域,尤其涉及一种网络和对该网络的管理方法。
网络中,交换机的控制面和控制器之间的连接通常采用一张网络,称之为控制网络,不同交换机的转发面之间的连接通常采用另一张网络,称之为转发网络。网络引导阶段,控制器需要将网络中的各类设备,包括控制器、交换机、服务器等,从失控、无序的状态引导至受控、有序的状态。引导阶段包括设备资源,例如互联网协议IP地址的分配,设备之间拓扑关系的发现等。
在引导阶段,由于交换机的端口连接关系,网络拓扑结构等信息的缺失,控制器无法精确设计报文的转发路径。因此,在引导阶段一般采用广播的方式将报文,例如动态主机配置协议(英文全称:Dynamic Host Configuration Protocol,缩写:DHCP)报文,发送至目的地。该过程中会产生大量的广播报文,影响网络的引导效率。
发明内容
本申请提供了一种网络和运用于该网络的管理方法,以减少引导过程中的广播报文,提升引导效率。
本申请的第一方面提供了一种网络,该网络包括多台交换机和控制器,每台交换机包括管理端口和多个可用转发端口。这多台交换机中,第一交换机与DHCP服务器连接,其余交换机通过第一交换机与DHCP服务器通信。以第一交换机为起点,该网络的引导过程逐层扩散,第一交换机受控后,第一交换机的下一跳交换机开始引导过程,依次类推,直至网络中全部交换机受控。本申请中的第一转发端口、第二转发端口、第三转发端口、第四转发端口、第五转发端口、第六转发端口和第七转发端口均为可用转发端口。
该第一交换机的管理端口与该第一交换机的第一转发端口连接,该第一交换机的第三转发端口与该第二交换机的第四转发端口连接。该第一交换机的第二转发端口与该DHCP服务器和该控制器连接,也即该控制器和该DHCP服务器部署在同一物理服务器上。因此,第二交换机生成的DHCP请求需要通过第一交换机才能发送至DHCP服务器。每台交换机中均预置有属于自己的第一预置流表和第二预置流表。
该第一交换机,用于生成第一DHCP请求;匹配该第一交换机的第一预置流表和该第一DHCP请求。根据该第一预置流表将该第一DHCP请求从该第一交换机的所有可用转发端口发出,包括从该第二转发端口发出和该第三转发端口发出。
该第二交换机,用于接收所述第一DHCP请求;确定第一DHCP请求无法匹配所述第二交换机的预置流表后,丢弃所述第一DHCP请求;生成第二DHCP请求,该第二DHCP请求用于向该DHCP服务器请求获取第二交换机的IP地址,并通过该第四转发端口发送该第二DHCP请求至该第一交换机的第三转发端口。
该DHCP服务器,用于接收从该第二转发端口发出的该第一DHCP请求。根据该第一DHCP请求生成第一DHCP答复。将该第一DHCP答复发送至该第一交换机。
该第一交换机,用于从该第三转发端口接收该第一DHCP答复。匹配该第一交换机的第二预置流表和该第一DHCP答复。根据该第二预置流表将该第一DHCP答复从该第一交换机的所有可用转发端口发出,包括从该第一转发端口发出。通过该第一交换机的管理端口接收从该第一转发端口发出的该第一DHCP答复。至此,该第一交换机的管理面获取了该第一DHCP答复中携带的由DHCP服务器分配的第一交换机的IP地址。
同时,该第一交换机,用于从该第三端口接收该第二DHCP请求。将该第二DHCP请求与第一交换机存储的预置流表进行匹配,包括该第一预置流表和该第二预置流表。随后,该第一交换机确定该第二DHCP请求无法匹配该第一预置流表和该第二预置流表,并丢弃该第二DHCP请求。
以上提供的网络在引导过程中,第一交换机能够获取分配给自己的IP地址,实现了第一交换机的部分受控。并且,在此阶段第二交换机(第一交换机相邻的任意交换机)生成的DHCP请求由于无法在第一交换机或第二交换机的其他相邻的交换机上匹配上预置流表。因此,第二交换机生成的DHCP请求将无法在网络中进一步广播,极大的降低了网络中的广播流量。
在一个可能的设计中,该第一DHCP请求的源MAC地址为该第一交换机的MAC地址;该第一预置流表指示将源MAC地址为该第一交换机的MAC地址的报文从该第一交换机的所有可用转发端口发出。
在一个可能的设计中,该第一DHCP答复的目的MAC地址为该第一交换机的MAC地址;该第二预置流表指示将目的MAC地址为该第一交换机的MAC地址的报文从该第一交换机的所有可用转发端口发出。
因此,该网络中的一个交换机上存储的预置流表只能匹配上源地址或目的地址为自己的地址的DHCP报文,无法匹配上其余交换机发送来的DHCP报文,阻断了相邻交换机生成的DHCP报文的广播范围,降低了网络中的广播流量。
在一个可能的设计中,该控制器对网络中的交换机进行控制,也即让该控制器学习到网络中交换机的转发端口的连接关系和地址信息等。
该第一交换机,用于根据该第一DHCP答复中携带的该第一交换机的IP地址与该控制器建立传输控制协议TCP连接。
该控制器,用于生成第一流表,发送该第一流表至该第一交换机,该第一流表指示将目的地为该第一交换机的报文从该第一转发端口发出。并且,该控制器设置该第一流表的优先级高于该第二预置流表,或该控制器指示该第一交换机在收到该第一流表后删除该第二预置流表。
通过该第一流表,该第一交换机的转发面在接收到目的地为该第一交换机(也即第一交换机的控制面)的报文时,可以将该报文和该第一流表进行匹配,并从该第一转发端口将该报文发送至该第一交换机的管理端口以进入该第一交换机的控制面。因此,该第一交换机无须将该报文从所有可用转发端口广播,提升了报文的处理效率。
在一个可能的设计中,生成该第一流表的具体过程如下。
该控制器,用于生成第一地址解析协议ARP探测流表,该第一ARP探测流表指示向
该控制器上报源IP地址为该第一交换机的IP地址的ARP类型的报文;将该第一ARP探测流表发送至该第一交换机;生成第一ARP请求,该第一ARP请求的目的IP地址为该第一交换机的IP地址;发送该第一ARP请求至该第一交换机;指示该第一交换机将该第一ARP请求从该第一交换机的所有可用转发端口发出。
该第一交换机,用于接收该第一ARP探测流表;通过该第一交换机的管理端口接收从该第一转发端口发出的该第一ARP请求;根据该第一ARP请求生成第一ARP答复,该第一ARP答复的源IP地址为该第一交换机的IP地址;通过该第一交换机的管理端口将该第一ARP答复发送至该第一转发端口;匹配该第一ARP探测流表和该第一ARP答复;根据该第一ARP探测流表上报该第一ARP答复以及该第一转发端口的端口号。
该控制器,用于根据该第一ARP答复和该第一转发端口的端口号,生成该第一流表。
以上过程中,该控制器学习到了该第一交换机的地址信息和第一转发端口的端口号,得知该第一转发端口连接该第一交换机的管理端口,实现了对第一交换机的进一步控制。
在一个可能的设计中,该第一交换机,用于根据该第一DHCP答复中携带的该第一交换机的IP地址与该控制器建立TCP连接。
该控制器,用于生成第二流表,发送该第二流表至该第一交换机,该第二流表指示将目的地为该控制器或该DHCP服务器的报文从该第二转发端口发出。并且,该控制器设置该第二流表的优先级高于该第一预置流表,或该控制器指示该第一交换机在收到该第二流表后删除该第一预置流表。
通过该第二流表,该第二交换机的转发面在接收到目的地为该控制器或该DHCP服务器的报文时,可以将该报文和该第二流表进行匹配,并从该第二转发端口将该报文发送至该控制器或该DHCP服务器。因此,该第二交换机无须将该报文从所有可用转发端口广播,提升了报文的处理效率。
在一个可能的设计中,生成该第二流表的具体过程如下。
该控制器,用于生成第二ARP探测流表,该第二ARP探测流表指示向该控制器上报源IP地址为该控制器的IP地址的ARP类型的报文;将该第二ARP探测流表发送至该第一交换机;生成第二ARP请求,该第二ARP请求的目的IP地址为该控制器的IP地址;发送该第二ARP请求至该第一交换机;指示该第一交换机将该第二ARP请求从该第一交换机的所有可用转发端口发出。
该第一交换机,用于接收该第二ARP探测流表;将该第二ARP请求通过该第二转发端口发送至该控制器。
该控制器,用于根据该第二ARP请求生成第二ARP答复,该第二ARP答复的源IP地址为该控制器的IP地址;发送该第二ARP答复至该第一交换机。
该第一交换机,用于通过该第二转发端口接收该第二ARP答复;匹配该第二ARP探测流表和该第二ARP答复;根据该第二ARP探测流表上报该第二ARP答复以及该第二转发端口的端口号。
该控制器,用于根据该第二ARP答复和该第二转发端口的端口号,生成该第二流表。
以上过程中,控制器学习到了第二转发端口的端口号,得知该第二转发端口通向该控制器或该DHCP服务器,实现了对第一交换机的进一步控制。
在一个可能的设计中,该第二交换机的管理端口与该第二交换机的第五转发端口连
接。控制器进一步的对第一交换机和第二交换机进行控制。控制过程分为三个阶段,即第三转发端口的学习,第四转发端口的学习和第五转发端口的学习。
在一个可能的设计中,该控制器生成第三流表,发送该第三流表至该第一交换机,该第三流表指示将目的地为该第二交换机的报文从该第三转发端口发出。
通过该第三流表,该第一交换机的转发面在接收到目的地为该第二交换机的报文时,可以将该报文和该第三流表进行匹配,并从该第三转发端口将该报文发送至该第二交换机。因此,该第一交换机无须将该报文从所有可用转发端口广播,提升了报文的处理效率。
在一个可能的设计中,生成该第三流表的具体过程如下。
该控制器,用于生成第一端口探测流表,该第一端口探测流表指示向该控制器上报端口答复报文;将该第一端口探测流表发送至该第一交换机;生成第一端口探测报文;将该第一端口探测报文通过该第一交换机发送至该第二交换机。
该第二交换机,用于匹配该第二交换机的第三预置流表和该第一端口探测报文;根据该第三预置流表生成第一端口答复报文;将该第一端口答复报文发送至该第一交换机。
在一个可能的设计中,第三预置流表的匹配域包括:报文的源MAC地址为该第一端口探测报文的源MAC地址。为了避免第三预置流表与其他报文的误匹配,第一端口探测报文的源MAC地址可以特别设置,例如全为0。第三预置流表的动作域指示将该第一端口探测报文的源MAC地址修改为第二交换机的MAC地址以生成该第一端口答复报文。
该第一交换机,用于通过该第三转发端口接收该第一端口答复报文;匹配该第一端口探测流表和该第一端口答复报文;根据该第一端口探测流表上报该第一端口答复报文以及该第三转发端口的端口号。
该控制器,用于根据该第一端口答复报文和该第三转发端口的端口号,生成该第三流表。
以上过程中,控制器通过学习到了第三转发端口的端口号,得知该第三转发端口通向该第二交换机,实现了对第一交换机的进一步控制。
在一个可能的设计中,该第一交换机,接收第二DHCP请求(该第二DHCP请求与前述第二DHCP请求为两个内容相同的报文),匹配该第二DHCP请求与该第二流表;根据第二流表的动作域,将该的第二DHCP请求从该第二转发端口发送至该DHCP服务器;接收该DHCP服务器返回的第二DHCP答复,该第二DHCP答复的目的地为该第二交换机且该第二DHCP答复中携带该第二交换机的IP地址,该第二DHCP答复由该DHCP服务器根据该第二DHCP请求生成;匹配该第二DHCP答复与该第三流表;通过该第三转发端口向该第二交换机发送该第二DHCP答复。
该第二交换机,用于接收该第二DHCP答复,获取该第二交换机的IP地址;根据该第二交换机的IP地址与该控制器建立TCP连接。
第一交换机获取该第二流表和该第三流表后,第二交换机和DHCP服务器之间的通信通路被打通。因此,第二交换机可以从DHCP服务器处获得第二交换机的IP地址,并根据第二交换机的IP地址与控制器建立TCP连接,以供后续第四流表、第五流表的生成过程中,第二交换机和该控制器的通信。
在一个可能的设计中,该控制器生成第四流表,发送该第四流表至该第二交换机,
该第四流表指示将目的地为该第二交换机的报文从该第五转发端口发出。
通过该第四流表,该第二交换机的转发面在接收到目的地为该第二交换机(也即第二交换机的控制面)的报文时,可以将该报文和该第四流表进行匹配,并从该第五转发端口将该报文发送至该第二交换机的管理端口以进入第二交换机的控制面。因此,该第二交换机无须将该报文从所有可用转发端口广播,提升了报文的处理效率。
在一个可能的设计中,生成该第四流表的具体过程如下。
该控制器,用于生成第三ARP探测流表,该第三ARP探测流表指示向该控制器上报源IP地址为该第二交换机的IP地址的ARP类型的报文;将该第二ARP探测流表发送至该第二交换机;生成第三ARP请求,该第三ARP请求的目的IP地址为该第二交换机的IP地址;发送该第三ARP请求至该第二交换机;指示该第二交换机将该第二ARP请求从该第二交换机的所有可用转发端口发出。
该第二交换机,用于接收该第二ARP探测流表;通过该第二交换机的管理端口接收从该第五转发端口发出的该第三ARP请求;根据该第三ARP请求生成第三ARP答复,该第三ARP答复的源IP地址为该第二交换机的IP地址;通过该第二交换机的管理端口将该第三ARP答复发送至该第五转发端口;匹配该第三ARP探测流表和该第三ARP答复;根据该第三ARP探测流表上报该第三ARP答复和该第五转发端口的端口号。
该控制器,用于根据该第三ARP答复和该第五转发端口的端口号,生成该第四流表。
以上过程中,控制器学习到了第五转发端口的端口号,得知该第五转发端口连接该第二交换机的管理端口,实现了对第二交换机的进一步控制。
在一个可能的设计中,该控制器生成第五流表,发送该第五流表至该第二交换机,该第五流表指示将目的地为该控制器或该DHCP服务器或该第一交换机的报文从该第四转发端口发出。
通过该第五流表,该第二交换机的转发面在接收到目的地为该控制器或该DHCP服务器的报文时,可以将该报文和该第五流表进行匹配,并从该第四转发端口将该报文发出。因此,该第二交换机无须将该报文从所有可用转发端口广播,提升了报文的处理效率。
在一个可能的设计中,生成该第五流表的具体过程如下。
该控制器,用于生成第二端口探测流表,该第二端口探测流表指示向该控制器上报端口探测报文;将该第二端口探测流表发送至该第二交换机;生成第二端口探测报文;将该第二端口探测报文通过第一交换机发送至该第二交换机。其中,第二端口探测报文携带该第一交换机的地址信息,以供控制器识别第四转发端口和第一交换机的连接关系。
该第二交换机,用于通过该第四转发端口接收该第二端口探测报文;匹配该第二端口探测流表和该第二端口探测报文;根据该第二端口探测流表上报该第二端口探测报文和该第四转发端口的端口号。
该控制器,用于根据该第二端口探测报文和该第四转发端口的端口号,生成该第五流表。
以上过程中,控制器学习到了第四转发端口的端口号,得知该第四转发端口通向该第一交换机以及DHCP服务器和控制器,实现了对第二交换机的进一步控制。
本申请的第二方面提供了一种网络,与第一方面提供的网络不同的是,该控制器和该DHCP服务器设置在不同物理服务器,该第一交换机通过该第二转发端口与该控制器连
接,该第一交换机通过第六转发端口与该DHCP服务器连接。第一交换机通过与第一方面提供的网络中相同的方法获取第一DHCP答复后,根据该第一DHCP答复中携带的该第一交换机的IP地址与该控制器建立TCP连接。
该控制器,用于生成第四ARP探测流表,该第四ARP探测流表指示向该控制器上报源IP地址为该DHCP服务器的IP地址的ARP类型的报文;将该第四ARP探测流表发送至该第一交换机;生成第四ARP请求,该第四ARP请求的目的IP地址为该DHCP服务器的IP地址;发送该第四ARP请求至该第一交换机;指示该第一交换机将该第四ARP请求从该第一交换机的所有可用转发端口发出。
该第一交换机,用于接收该第四ARP探测流表和该第四ARP请求;将该第四ARP请求通过该第一交换机的所有可用转发端口发出;从该第六转发端口接收第四ARP答复,该第四ARP答复的源IP地址为该DHCP服务器的IP地址,该第四ARP答复由该DHCP服务器根据该第四ARP请求生成;匹配该第四ARP探测流表和该第四ARP答复;根据该第四ARP探测流表上报该第四ARP答复和该第六转发端口的端口号。
该控制器,用于根据该第四ARP探测流表和该第六转发端口的端口号,生成第六流表,该第六流表指示将目的地为该DHCP服务器的报文从该第六转发端口发出;发送该第六流表至该第一交换机。
由于该网络中DHCP服务器和控制器通过不同转发端口接入第一交换机,因此第一交换机的受控过程中,控制器还需要学习第六转发端口与DHCP服务器的连接关系,以便第一交换机可以精确的转发目的地为DHCP服务器的报文,提升报文的转发效率。
该网络中,控制器对第一转发端口的识别(即第一流表的生成),控制器对第二转发端口的识别(即第二流表的生成),控制器对第三转发端口的识别(即第三流表的生成),控制器对第五转发端口的识别(即第四流表的生成),控制器对第四转发端口的识别(即第五流表的生成)与第一方面提供的网络相同。
本申请的第三方面,提供了一种网络管理方法,该方法运用于第一方面提供的网络。该方法即第一方面提供的网络中控制器侧执行的方法。
该方法包括:该控制器生成第一ARP探测流表,该第一ARP探测流表指示向该控制器上报源IP地址为该第一交换机的IP地址的ARP类型的报文;该控制器将该第一ARP探测流表发送至该第一交换机;该控制器生成第一ARP请求,该第一ARP请求的目的IP地址为该第一交换机的IP地址;该控制器发送该第一ARP请求至该第一交换机;该控制器指示该第一交换机将该第一ARP请求从该第一交换机的所有可用转发端口发出;该控制器获取该第一交换机的转发面根据该第一ARP探测流表上报的第一ARP答复和该第一转发端口的端口号,该第一ARP答复由该第一交换机的控制面根据该第一ARP请求生成,并通过该第一转发端口发送至该第一交换机的转发面,该第一ARP答复的源IP地址为该第一交换机的IP地址;该控制器根据该第一ARP答复和该第一转发端口的端口号,生成第一流表,该第一流表指示将目的地为该第一交换机的报文从该第一转发端口发出;该控制器发送该第一流表至该第一交换机。
在一个可能的设计中,该方法包括:该控制器生成第二ARP探测流表,该第二ARP探测流表指示向该控制器上报源IP地址为该控制器的IP地址的ARP类型的报文;该控制器将该第二ARP探测流表发送至该第一交换机;该控制器生成第二ARP请求,该第二
ARP请求的目的IP地址为该控制器的IP地址;该控制器发送该第二ARP请求至该第一交换机;该控制器指示该第一交换机将该第二ARP请求从该第一交换机的所有可用转发端口发出;该控制器接收该第一交换机从该第二转发端口发出的该第二ARP请求;该控制器根据该第二ARP请求生成第二ARP答复,该第二ARP答复的源IP地址为该控制器的IP地址;该控制器通过该第二转发端口将该第二ARP答复发送至该第一交换机的转发面;该控制器获取该第一交换机的转发面根据该第二ARP探测流表上报的该第二ARP答复和该第二转发端口的端口号;该控制器根据该第二ARP答复和该第二转发端口的端口号生成第二流表,该第二流表指示将目的地为该控制器的报文从该第二转发端口发出;该控制器发送该第二流表至该第一交换机。
在一个可能的设计中,该方法包括:该控制器生成第一端口探测流表,该第一端口探测流表指示向该控制器上报端口答复报文;该控制器将该第一端口探测流表发送至该第一交换机;该控制器生成第一端口探测报文;该控制器将该第一端口探测报文通过该第一交换机发送至该第二交换机;该控制器获取该第一交换机的转发面根据该第一端口探测流表上报的第一端口答复报文和该第三转发端口的端口号,该第一端口答复报文由第二交换机的控制面根据该第一端口探测报文生成,并通过该第三转发端口发送至该第一交换机的转发面;该控制器根据该第一端口答复报文和该第三转发端口的端口号,生成第三流表,该第三流表指示将目的地为该第二交换机的报文从该第三转发端口发出;该控制器发送该第三流表至该第一交换机。
在一个可能的设计中,该第二交换机与该控制器建立TCP连接,该方法包括:该控制器生成第三ARP探测流表,该第三ARP探测流表指示向该控制器上报源IP地址为该第二交换机的IP地址的ARP类型的报文;该控制器将该第三ARP探测流表发送至该第二交换机;该控制器生成第三ARP请求,该第三ARP请求的目的IP地址为该第二交换机的IP地址;该控制器发送该第三ARP请求至该第二交换机,指示该第二交换机将该第三ARP请求从该第二交换机的所有可用转发端口发出;
该控制器获取该第二交换机的转发面根据该第三ARP探测流表上报的第三ARP答复和该第五转发端口的端口号,该第三ARP答复由该第二交换机的控制面根据该第三ARP请求生成,并通过该第五转发端口发送至该第二交换机的转发面,该第三ARP答复的源IP地址为该第二交换机的IP地址;该控制器根据该第三ARP答复和该第五转发端口的端口号,生成第四流表,该第四流表指示将目的地为该第二交换机的报文从该第五转发端口发出;该控制器发送该第四流表至该第二交换机。
在一个可能的设计中,该方法包括:该控制器生成第二端口探测流表,该第二端口探测流表指示向该控制器上报端口探测报文;该控制器将该第二端口探测流表发送至该第二交换机;该控制器生成第二端口探测报文;该控制器将该第二端口探测报文通过该第二交换机的该第四转发端口发送至该第二交换机的转发面;该控制器获取该第二交换机的转发面根据该第二端口探测流表上报的该第二端口探测报文和该第四转发端口的端口号;该控制器根据该第二端口探测报文和该第四转发端口的端口号,生成第五流表,该第五流表指示将目的地为该第一交换机或该控制器的报文从该第四转发端口发出;该控制器发送该第五流表至该第二交换机。
本申请的第四方面提供了一种网络管理方法,该方法运用于第二方面提供的网络中。
该方法即第二方面提供的网络中控制器侧执行的方法。
该方法包括:该控制器生成第四ARP探测流表,该第四ARP探测流表指示向该控制器上报源IP地址为该DHCP服务器的IP地址的ARP类型的报文;该控制器将该第四ARP探测流表发送至该第一交换机;该控制器生成第四ARP请求,该第四ARP请求的目的IP地址为该DHCP服务器的IP地址;该控制器发送该第四ARP请求至该第一交换机;该控制器指示该第一交换机将该第四ARP请求从该第一交换机的所有可用转发端口发出;该控制器获取该第一交换机的转发面根据该第四ARP探测流表上报的第四ARP答复和该第六转发端口的端口号,该第四ARP答复由该DHCP服务器根据该第四ARP请求生成并通过该第一交换机的第六转发端口发送至该第一交换机的转发面,该第四ARP答复的源IP地址为该DHCP服务器的IP地址;该控制器根据该第四ARP答复和该第六转发端口的端口号生成第六流表,该第六流表指示将目的地为该DHCP服务器的报文从该第六转发端口发出;该控制器发送该第六流表至该第一交换机。
本方面提供的网络管理方法中,控制器对第一转发端口的识别(即第一流表的生成),控制器对第二转发端口的识别(即第二流表的生成),控制器对第三转发端口的识别(即第三流表的生成),控制器对第五转发端口的识别(即第四流表的生成),控制器对第四转发端口的识别(即第五流表的生成)与第三方面提供的方法相同。
本申请的第五方面提供了一种控制器,包括处理器和存储器,该处理器和该存储器建立通信;该处理器,用于执行第三方面或第三方面中任一种可能的设计提供的方法。
本申请的第六方面提供了一种控制器,包括处理器和存储器,该处理器和该存储器建立通信;该处理器,用于执行第四方面提供的方法。
本申请的第七方面提供了一种交换机的管理方法,该管理方法由第一方面提供的网络中的第一交换机执行。该方法包括:该第一交换机的控制面生成第一DHCP请求,通过该第一交换机的管理端口将该第一DHCP请求发送至该第一交换机的转发面;该第一交换机的转发面匹配第一预置流表和该第一DHCP请求;该第一交换机的转发面根据该第一预置流表将该第一DHCP请求从该第一交换机的所有可用转发端口发出;该第一交换机的转发面接收该第一DHCP答复,该DHCP答复由该DHCP服务器根据该第一DHCP请求生成;该第一交换机的转发面匹配第二预置流表和该第一DHCP答复;该第一交换机的转发面根据该第二预置流表将该第一DHCP答复从该第一交换机的所有可用转发端口发出;该第一交换机的控制面通过该第一交换机的管理端口接收从该第一转发端口发出的该第一DHCP答复;该第一交换机的转发面从该第三端口接收该第二交换机发出的第二DHCP请求;该第一交换机的转发面确定该第二DHCP请求无法匹配该第一预置流表和该第二预置流表;该第一交换机的转发面丢弃该第二DHCP请求。
在一个可能的设计中,该方法包括:该第一交换机的转发面从该控制器接收第一ARP探测流表,该第一ARP探测流表指示向该控制器上报源IP地址为该第一DHCP答复中携带的该第一交换机的IP地址的ARP类型的报文;该第一交换机的转发面从该控制器接收第一ARP请求,该第一ARP请求的目的IP地址为该第一交换机的IP地址;该第一交换机的转发面根据该控制器的指示将该第一ARP请求从该第一交换机的所有可用转发端口发出;该第一交换机的控制面通过该第一交换机的管理端口接收从该第一转发端口发出的该第一ARP请求;该第一交换机的控制面根据该第一ARP请求生成第一ARP答复,该
第一ARP答复的源IP地址为该第一交换机的IP地址;该第一交换机的控制面通过该第一转发端口将该第一ARP答复发送至该第一交换机的转发面;该第一交换机的转发面匹配该第一ARP探测流表和该第一ARP答复;该第一交换机的转发面根据该第一ARP探测流表向该控制器上报该第一ARP答复和该第一转发端口的端口号;该第一交换机的转发面从该控制器接收第一流表,该第一流表指示将目的地为该第一交换机的报文从该第一转发端口发出,该第一流表的优先级高于该第二预置流表或该第一交换机在收到该第一流表后删除该第二预置流表。
在一个可能的设计中,该方法包括:该第一交换机的转发面从该控制器接收第二ARP探测流表,该第二ARP探测流表指示向该控制器上报源IP地址为该控制器的IP地址的ARP类型的报文;该第一交换机的转发面从该控制器接收第二ARP请求,该第二ARP请求的目的IP地址为该控制器的IP地址;该第一交换机的转发面根据该控制器的指示将该第二ARP请求从该第一交换机的所有可用转发端口发出;该第一交换机的转发面通过该第二转发端口接收第二ARP答复,该第二ARP答复为该控制器根据该第二ARP请求生成的,该第二ARP答复的源IP地址为该控制器的IP地址;该第一交换机的转发面根据该第二ARP探测流表上报该第二ARP答复和该第二转发端口的端口号;该第一交换机的转发面从该控制器接收第二流表,该第二流表指示将目的地为该控制器或该DHCP服务器的报文从该第二转发端口发出,该第二流表的优先级高于该第一预置流表或该第一交换机在收到该第一流表后删除该第一预置流表。
在一个可能的设计中,该方法包括:该第一交换机的转发面从该控制器接收第一端口探测流表,该第一端口探测流表指示向该控制器上报端口答复报文;该第一交换机的转发面从该控制器接收第一端口探测报文,将该第一端口探测报文发送至该第二交换机;该第一交换机的转发面通过该第三转发端口接收该第二交换机根据该第一端口探测报文生成的第一端口答复报文;该第一交换机的转发面根据该第一端口探测流表向该控制器上报该第一端口答复报文和该第三转发端口的端口号;该第一交换机的转发面从该控制器接收第三流表,该第三流表指示将目的地为该第二交换机的报文从该第三转发端口发出。
本申请的第八方面提供了一种交换机的管理方法,该方法由第二方面提供的网络中的第一交换机执行。该方法包括:该第一交换机的转发面从该控制器接收第四ARP探测流表,该第四ARP探测流表指示向该控制器上报源IP地址为该DHCP服务器的IP地址的ARP类型的报文;该第一交换机的转发面从该控制器接收第四ARP请求,该第四ARP请求的目的IP地址为该DHCP服务器的IP地址;该第一交换机的转发面将该第四ARP请求通过该第六转发端口发送至该DHCP服务器;该第一交换机的转发面通过该第六转发端口接收第四ARP答复,该第四ARP答复为该DHCP服务器根据该第四ARP请求生成的,该第四ARP答复的源IP地址为该DHCP服务器的IP地址;该第一交换机的转发面根据该第四ARP探测流表向该控制器上报该第四ARP答复和该第六转发端口的端口号;该第一交换机的转发面从该控制器接收第六流表,该第六流表指示将目的地为该DHCP服务器的报文从该第六转发端口发出。
本方面提供的交换机的管理方法中,第一流表的获取,第二流表的获取,第三流表的获取,第四流表的获取,第五流表的获取与第七方面提供的方法相同。
本申请的第九方面提供了一种交换机,包括处理器和存储器,该处理器和该存储器建立通信;该处理器,用于执行第七方面或第七方面中任一种可能的设计提供的方法。
本申请的第十方面提供了一种交换机,包括处理器和存储器,该处理器和该存储器建立通信;该处理器,用于执行第八方面提供的方法。
本申请的第十一方面提供了一种交换机的管理方法,该管理方法由第一方面提供的网络或第二方面提供的网络中的第二交换机执行。该第二交换机与该控制器建立TCP连接。
该方法包括:该第二交换机的转发面从该控制器接收第二端口探测流表,该第二端口探测流表指示向该控制器上报端口探测报文;该第二交换机的转发面通过该第四转发端口接收该第一交换机发送的来自于该控制器的第二端口探测报文;该第二交换机的转发面根据该第二端口探测流表向该控制器上报该第二端口探测报文和该第四转发端口的端口号;该第二交换机的转发面从该控制器接收第五流表,该第五流表指示将目的地为该第一交换机或该控制器的报文从该第四转发端口发出。
在一个可能的设计中,该第二交换机的转发面从该控制器接收第三ARP探测流表,该第三ARP探测流表指示向该控制器上报源IP地址为该第二交换机的IP地址的ARP类型的报文;该第二交换机的转发面从该控制器接收第三ARP请求,该第三ARP请求的目的IP地址为该第二交换机的IP地址;该第二交换机的转发面根据指示将该第二ARP请求从该第二交换机的所有可用转发端口发出;该第二交换机的控制面通过该第二交换机的管理端口接收从该第五转发端口发出的该第三ARP请求;该第二交换机的控制面根据该第三ARP请求生成第三ARP答复,该第三ARP答复的源IP地址为该第三交换机的IP地址;该第二交换机的控制面通过该第五转发端口将该第三ARP答复发送至该第二交换机的转发面;该第二交换机的转发面匹配该第三ARP探测流表和该第三ARP答复;该第三交换机的转发面根据该第三ARP探测流表向该控制器上报该第三ARP答复和该第五转发端口的端口号;该第三交换机的转发面从该控制器接收第三流表,该第三流表指示将目的地为该第二交换机的报文从该第五转发端口发出。
在一个可能的设计中,该方法还包括:该第二交换机的转发面从该控制器接收第一端口探测报文;该第二交换机的转发面匹配第一端口探测报文和第三预置流表,根据该第三预置流表,将该第一端口探测报文的源MAC地址修改为该第二交换机的MAC地址以生成第一端口答复报文;该第二交换机将该第一端口答复报文发送至该第一交换机的该第三转发端口。
本申请的第十二方面提供了一种交换机,包括处理器和存储器,该处理器和该存储器建立通信;该处理器,用于执行第十一方面提供的方法。
本申请的第十三方面提供了一种存储介质,该存储介质中存储了程序,该程序被控制器运行时,该控制器执行前述第三方面或第三方面的任一种可能的设计提供的方法。该存储介质和以下各个方面提供的存储介质包括但不限于只读存储器,随机访问存储器,快闪存储器、硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid state drive,缩写:SSD)。
本申请的第十四方面提供了一种存储介质,该存储介质中存储了程序,该程序被控制器运行时,该控制器执行前述第四方面提供的方法。
本申请的第十五方面提供了一种存储介质,该存储介质中存储了程序,该程序被第一交换机运行时,该第一交换机执行前述第七方面或第七方面的任一种可能的设计提供的方法。
本申请的第十六方面提供了一种存储介质,该存储介质中存储了程序,该程序被第一交换机运行时,该第一交换机执行前述第八方面提供的方法。
本申请的第十七方面提供了一种存储介质,该存储介质中存储了程序,该程序被第二交换机运行时,该第二交换机执行前述第十一方面或第十一方面的任一种可能的设计提供的方法。
本申请的第十八方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,当该计算机程序产品被控制器执行时,该控制器执行前述第三方面或第三方面的任一种可能的设计提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第三方面或第三方面的任一种可能的设计提供的方法的情况下,可以下载该计算机程序产品并在控制器上执行该计算机程序产品。
本申请的第十九方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,当该计算机程序产品被控制器执行时,该控制器执行前述第四方面提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第四方面提供的方法的情况下,可以下载该计算机程序产品并在控制器上执行该计算机程序产品。
本申请的第二十方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,当该计算机程序产品被第一交换机执行时,该控制器执行前述第七方面或第七方面的任一种可能的设计提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第七方面或第七方面的任一种可能的设计提供的方法的情况下,可以下载该计算机程序产品并在第一交换机上执行该计算机程序产品。
本申请的第二十一方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,当该计算机程序产品被第一交换机执行时,该控制器执行前述第八方面提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第八方面提供的方法的情况下,可以下载该计算机程序产品并在第一交换机上执行该计算机程序产品。
本申请的第二十二方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,当该计算机程序产品被第二交换机执行时,该控制器执行前述第十一方面提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第十一方面提供的方法的情况下,可以下载该计算机程序产品并在第二交换机上执行该计算机程序产品。
本申请的第二十三方面提供了一种存储介质,该存储介质中存储了前述方面中介绍的第一预置流表。该第一预置流表的匹配域包括:报文的源MAC地址=第一交换机的MAC地址。该第一预置流表的动作域包括:从第一交换机所有可用转发端口发出。
本申请的第二十四方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,该程序指令用于实现前述方面中介绍的第一预置流表。
本申请的第二十五方面提供了一种存储介质,该存储介质中存储了前述方面中介绍的第二预置流表。该第二预置流表的匹配域包括:报文的目的MAC地址=第一交换机的MAC地址。该第一预置流表的动作域包括:从第一交换机所有可用转发端口发出。
本申请的第二十六方面提供了一种计算机程序产品,该计算机程序产品包括程序指
令,该程序指令用于实现前述方面中介绍的第二预置流表。
本申请的第二十七方面提供了一种存储介质,该存储介质中存储了前述方面中介绍的第三预置流表。该第三预置流表的匹配域包括:报文类型=LLDP,报文的源MAC地址为第一端口探测报文的源MAC地址。第一端口探测报文的源MAC地址可以全为0。第三预置流表的动作域包括:将报文的源MAC地址变更为第二交换机的MAC地址,将变更后的报文从第一端口探测报文的进入端口发出。
本申请的第二十八方面提供了一种计算机程序产品,该计算机程序产品包括程序指令,该程序指令用于实现前述方面中介绍的第三预置流表。
本申请的第二十九方面提供了一种网络,包括第一交换机、第二交换机和控制器。第一交换机的第一转发端口与第一交换机的管理端口连接。第一交换机的第二转发端口和控制器连接。第一交换机的第三转发端口和第二交换机的第四转发端口连接。第二交换机的第七转发端口与DHCP服务器连接。
第一交换机,用于生成第一DHCP请求;匹配第一DHCP请求和第一预置流表,根据第一预置流表将第一DHCP请求从第一交换机的所有可用转发端口发出。
第二交换机,用于通过第四转发端口接收所述第一DHCP请求;匹配第一DHCP请求和第四预置流表,根据第四预置流表将第一DHCP请求从第二交换机的所有可用转发端口发出;接收第一DHCP答复,第一DHCP答复为DHCP服务器根据第一DHCP请求生成的;匹配第一DHCP答复和第五预置流表,根据第五预置流表将第一DHCP答复从第二交换机的所有可用转发端口发出,其中,第四预置流表的匹配域包括:报文的源MAC地址=第一交换机的MAC地址,第五预置流表的匹配域包括:报文的目的MAC地址=第一交换机的MAC地址,第四预置流表的动作域和第五预置流表的动作域均包括:从第二交换机的所有可用转发端口发出。
第一交换机,用于接收第一DHCP答复,匹配该第一交换机的第二预置流表和该第一DHCP请求;根据该第二预置流表将该第一DHCP请求从该第一交换机的所有可用转发端口发出。
该网络中,控制器对第一转发端口的识别(即第一流表的生成),控制器对第二转发端口的识别(即第二流表的生成),控制器对第三转发端口的识别(即第三流表的生成),控制器对第五转发端口的识别(即第四流表的生成),控制器对第四转发端口的识别(即第五流表的生成)与第一方面提供的网络相同。
以上提供的网络在引导过程中,第一交换机能够获取分配给自己的IP地址,实现了第一交换机的部分受控。
为了更清楚地说明本申请实施例的技术方法,下面将对实施例中所需要使用的附图作以简单地介绍。
图1为本申请提供的网络架构示意图;
图2a为本申请提供的网络架构示意图;
图2b为本申请提供的网络架构示意图;
图3为本申请提供的交换机的结构示意图;
图4a为本申请提供的交换机的内部结构示意图;
图4b为本申请提供的交换机的内部结构示意图;
图5为本申请提供的交换机、控制器、DHCP服务器的连接关系示意图;
图6为本申请提供的交换机的受控流程图;
图7为本申请提供的交换机、控制器、DHCP服务器的连接关系示意图;
图8为本申请提供的交换机的受控流程图;
图9为本申请提供的交换机、控制器、DHCP服务器的连接关系示意图;
图10为本申请提供的交换机的受控流程图;
图11为本申请提供的交换机、控制器、DHCP服务器的连接关系示意图;
图12为本申请提供的交换机的受控流程图;
图13为本申请提供的控制器的结构示意图;
图14为本申请提供的交换机的结构示意图。
下面结合本申请实施例中的附图,对本申请实施例中的技术方法进行描述。
本申请中各个“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系。
本说明书中,交换机指代在控制器的控制下实现报文的路由的设备。例如,交换机可以根据该控制器下发的流表(英文:flow table)对报文进行处理。例如,交换机可以支持OpenFlow协议。
该交换机可以通过在服务器上运行软件实现,也可以通过集成电路实现,也可以通过服务器和集成电路组合实现。该集成电路可以为专用集成电路(英文:application-specific integrated circuit,缩写:ASIC)或可编程逻辑器件(英文:programmable logic device,缩写:PLD)或网络处理单元(英文:network process unit)。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程门阵列(英文:field programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic array logic,缩写:GAL)。
本说明书中,连接指代相邻交换机,交换机和控制器,交换机和DHCP服务器之间不设置其他设备的直接连接,或相邻交换机,交换机和控制器,交换机和DHCP服务器之间通过其他设备的间接连接。
本说明书中的流表为供交换机执行的报文处理规则。每一条报文处理规则均包括匹配部分和执行部分。如果交换机能够将一个报文匹配上一条报文处理规则的匹配部分,则该交换机按照该条报文处理规则的执行部分处理该报文。本说明书中采用的匹配域和执行域为报文处理规则的一种实现方式,匹配域也即匹配部分,执行域也即执行部分。本说明书中对流表的格式和名称不做限定。
本说明书中,控制器指代对该交换机进行控制的设备。例如,该控制器可以向交换机发送流表,并通过流表控制交换机的动作。例如,该控制器可以通过OpenFlow协议与交换机通信。控制器向交换机发送的可以是用于生成流表的内容,以便交换机根据该内容生成对应的流表。控制器可以为软件定义网络控制器,或网络管理设备等。
该控制器可以采用集中式的实现,如采用一台物理服务器来实现,也可以采用分布式的方式实现,如采用多台物理服务器来实现。该控制器和DHCP服务器可以位于同一台物理服务器,例如,该控制器和DHCP服务器运行于同一台物理服务器上的两台不同的虚拟机。该控制器和DHCP服务器也可以位于不同物理服务器。
本说明书中,物理服务器是用于执行一个或多个软件程序的计算设备。物理服务器类型有多种,例如,机架服务器、塔式服务器、刀片服务器。该物理服务器可以作为DHCP服务器或控制器,也即在该物理服务器上运行支持DHCP服务的软件和支持控制器的软件。当一台物理服务器上部署了支持DHCP服务的软件和支持控制器的软件的情况下,该物理服务器既是DHCP服务器,又是控制器。业务服务器用于运行业务。
网络架构
图1介绍了本申请实施例提供的一种网络架构。在该实施例中,控制器和DHCP服务器运行于同一台服务器上。该服务器与交换机1连接,网络中其余交换机需要通过交换机1跟DHCP服务器或控制器通信。图1仅示出了一部分的交换机,交换机1、交换机2、交换机3、交换机4、交换机5还可以连接其他交换机。
图2a介绍了本申请实施例提供的另一种网络架构,在该实施例中,控制器和DHCP服务器运行于不同服务器上,控制器和DHCP服务器都连接到交换机1上,网络中其余交换机需要通过交换机1跟DHCP服务器和控制器通信。
图2b介绍了本申请实施例提供的另一种网络架构,在该实施例中,控制器和DHCP服务器运行于两个不同的服务器上,且这两个服务器连接于不同的交换机,如本实施例中,控制器连接交换机1,DHCP服务器连接交换机2。网络中其余交换机需要通过交换机1跟控制器通信。网络中其余交换机需要通过交换机2跟DHCP服务器通信。
交换机结构
图3介绍了本申请实施例提供的交换机的结构示意图。在该实施例中,该交换机包括主机(英文:host),主机有媒体访问控制(英文:Media Access Control,缩写:MAC)地址,也即交换机的MAC地址。主机通过管理端口与控制器通信。主机的管理端口与交换机的至少一个转发端口连接。管理端口发出的报文,经过转发端口发送至其他交换机、DHCP服务器或控制器。其他交换机、DHCP服务器或控制器发送的目的地为交换机的主机的报文,经过交换机的转发端口发送至管理端口,然后发送至交换机的主机。
管理端口可以为硬件端口或逻辑端口。如图4a所示,为本发明实施例提供的一种交换机内部结构示意图,在该实施例中,交换机的主机上运行有操作***,该操作***包括网络与管理协议栈(英文:networking and management stack)。操作***通过网络与管理协议栈的管理端口与交换机的转发端口连接,该管理端口也称之为本地端口(英文:local port)。
如图4b所示,为本发明实施例提供的一种交换机内部结构示意图,在该实施例中,
交换机包括控制面和转发面。主机支持控制面的运行。控制面负责对交换机进行管理,包括发起DHCP请求,生成DHCP答复,生成ARP答复,生成端口答复报文,接收控制器发送的用于生成流表的内容并根据该内容生成对应的流表并存入转发面等。转发面负责接收报文,外发报文,将报文与流表进行匹配,对匹配上的报文进行处理等。
交换机的转发面能够对报文执行上报(report)动作,上报动作包括将报文以及报文的inport端口发送至控制器。报文的inport端口也即报文进入交换机的转发面时使用的转发端口。以图5为例,交换机1的控制面将报文A通过port 1发送至交换机1的转发面后,如果交换机1的转发面将报文A上报,则port 1也会上报至控制器。交换机1通过port 2接收到了控制器/DHCP服务器发送的报文B后,如果交换机1的转发面将报文B上报,则port 2也会上报至控制器。
控制面通过管理端口与转发端口连接,转发面与转发端口连接。因此,控制面通过转发端口与转发面通信。以交换机的管理端口通过port X与转发面通信为例。如果一个报文发送至交换机的某个转发端口,该报文通过该转发端口进入交换机的转发面后,如果该报文需要被发往控制面,则转发面需要将该报文从port X发送至管理端口,该报文可以是DHCP请求、ARP请求、端口探测报文。如果控制面从管理端口接收到该报文,并根据该报文生成了对应的答复报文后,例如DHCP答复、ARP答复、端口探测答复,控制面从管理端口发出该答复报文,经由port X发送至转发面,再通过转发面发往外部。
该网络中的交换机在启动后,请求DHCP服务器分配IP地址。由于此时控制器既不清楚交换机之间的连接关系,也不清楚交换机的地址信息,因此无法向各个交换机下发精确控制DHCP请求流向的流表。
对此,现有技术中采取的做法是每个交换机均将接收到的DHCP请求从所有转发端口发出。例如,在上述网络架构中,交换机4生成DHCP请求,将DHCP请求发送至所有与交换机4连接的交换机,包括交换机2、交换机3和交换机5。交换机5接收该DHCP请求后,将该DHCP请求发送至所有与交换机5连接的交换机,包括交换机3和交换机4。该DHCP请求在网络内形成广播风暴,给网络造成极大压力。
为此,本申请提供的方案在交换机中设置了流表。该设置在交换机或控制器发起DHCP请求之前完成。例如,可以在每个交换机上预存储了流表,并设定交换机启动时加载该流表。该设置的过程可以在交换机的受控流程开始前,由管理人员执行。管理人员根据每台交换机的MAC地址的不同,为每台交换机设计对应的预置流表并将设计的预置流表存入该交换机的存储器。
如表1所示,网络中每个交换机中设置了第一预置流表和第二预置流表。
表1
一个交换机中设置的第一预置流表的匹配域包括:报文的源MAC地址=该交换机的MAC地址。该交换机中设置的第二预置流表的匹配域包括:报文的目的MAC地址=该交换机的MAC地址。由于每个交换机的MAC地址不同,不同交换机设置的第一预置流表不同,不同交换机设置的第二预置流表的匹配域也不同。预置流表的动作域中的可用转发端口,可以为交换机的转发端口的一部分。可用转发端口可以为网络引导过程中使用的转发端口,本文中提及的port 1-7均为可用转发端口。例如交换机可以预留的部分转发端口不用于交换机的受控过程,则预置流表的动作域中无须将报文从这些预留的部分转发端口发出。
在图1所示的网络架构中,以交换机1中与管理端口连接的转发端口为port 1,且交换机1通过port 2与DHCP服务器和控制器建立连接为例,如图5所示的端口连接方式。网络中还可以包括交换机2,交换机2通过port 4和交换机1的port 3连接。交换机2的管理端口和交换机2的port 5连接,参考图7。
图6为本发明实施例提供的一种基于图5中交换机1受控的过程实施例。需要说明的是,图6中各步骤的执行顺序不限定,多个步骤也可以并行执行。
s202,交换机1获取第一预置流表和第二预置流表。
其中,交换机1的第一预置流表的匹配域包括:报文的源MAC地址=交换机1的MAC地址,交换机1的第一预置流表的动作域包括:从交换机1的所有可用转发端口发出;交换机1的第二预置流表的匹配域包括:报文的目的MAC地址=交换机1的MAC地址。交换机1的第二预置流表的动作域包括:从交换机1的所有可用转发端口发出。交换机1的转发面获取并存储第一预置流表和第二预置流表。
s203,交换机2获取第一预置流表和第二预置流表。
其中,交换机2的第一预置流表的匹配域包括:报文的源MAC地址=交换机2的MAC地址;交换机2的第二预置流表的匹配域包括:报文的目的MAC地址=交换机2的MAC地址。交换机2的第一预置流表的动作域和第二预置流表的动作域包括:从交换机2的所有可用转发端口发出。
s204,交换机1生成第一DHCP请求。
交换机1此时仅知道自己的MAC地址,因此交换机1的控制面生成第一DHCP请求向DHCP服务器请求分配交换机1的互联网协议(英语:Internet Protocol,缩写:IP)地址,也即交换机1的IP地址。第一DHCP请求中的源MAC地址为交换机1的MAC地址。
s206,交换机1的转发面匹配第一DHCP请求和第一预置流表,根据第一预置流表的动作域将第一DHCP请求从交换机1的所有可用转发端口发出。
由于第一DHCP请求的源MAC地址为交换机1的MAC地址,因此第一DHCP请求能够匹配第一预置流表的匹配域。从而转发面根据第一预置流表的动作域指示将该第一DHCP请求从交换机1的所有可用转发端口发出。
DHCP服务器接收交换机1发出的第一DHCP请求。交换机1还将第一DHCP请求发送至与交换机1相连的其他交换机,例如交换机2、交换机3,但由于此时交换机2和交换机3无法将第一DHCP请求匹配上任何流表,因此交换机2和交换机3将丢弃第一DHCP请求,不会造成广播风暴,减少了网络的负载。例如,交换机2接收交换机1发出的第
一DHCP请求,如s205。
s207,交换机2通过port 4获取第一DHCP请求。交换机2的转发面尝试将第一DHCP请求与交换机2的第一预置流表和交换机2的第二预置流表进行匹配。交换机2确定第一DHCP请求无法匹配上交换机2的第一预置流表或交换机2的第二预置流表的匹配域后,将第一DHCP请求丢弃。
s205至s207在s206后任意时刻执行,且可以与s208及其后续步骤并列执行。
s208,DHCP服务器根据第一DHCP请求,分配IP 1作为交换机1的IP地址。生成第一DHCP答复,并发送至交换机1的port 2。
第一DHCP答复的目的MAC地址为交换机1的MAC地址,第一DHCP答复携带IP 1。
DHCP服务器可以通知控制器交换机1的IP地址为IP 1,以便控制器记录。
s210,交换机1通过port 2获取第一DHCP答复。交换机1的转发面匹配第一DHCP答复和第二预置流表,根据第二预置流表的动作域将第一DHCP答复从交换机1的所有可用转发端口发出。由于交换机1的管理端口与转发端口port 1连接,因此交换机1的控制面能够接收到从port 1发出的第一DHCP答复,并从第一DHCP答复中获取IP 1。
s212,交换机1与控制器建立传输控制协议(英文:Transmission Control Protocol,TCP)连接。
交换机1内预置有控制器的IP地址,获取IP 1后,交换机1的控制面与控制器建立TCP连接(connection),建立过程中,控制器得知交换机1与IP 1的对应关系。建立过程包括交换机1的控制面和控制器的多次握手。发往控制器的报文通过匹配第一预置流表,从交换机1的所有可用转发端口发出,参考s206。发往交换机1的控制面的报文通过匹配第二预置流表,从交换机1的所有可用转发端口发出,参考s210。
s214,控制器生成第一地址解析协议(英文:Address Resolution Protocol,ARP)探测流表和第二ARP探测流表,并发送第一ARP探测流表和第二ARP探测流表至交换机1。
第一ARP探测流表的匹配域包括:报文类型=ARP,报文的源IP地址=IP 1。第一ARP探测流表的动作域包括:上报至控制器。
第二ARP探测流表的匹配域包括:报文类型=ARP,报文的源IP地址=控制器的IP地址。第二ARP探测流表的动作域包括:上报至控制器。上报的动作中,会将inport端口,也即报文进入的端口,一并发送至控制器。
控制器可以分多次将第一ARP探测流表和第二ARP探测流表发送至交换机1的控制面,交换机1的控制面将第一ARP探测流表和第二ARP探测流表发送至转发面,以供转发面存储第一ARP探测流表和第二ARP探测流表。
s216,控制器生成第一ARP请求和第二ARP请求,并将第一ARP请求和第二ARP请求发送至交换机1。并且,控制器指示交换机1将第一ARP请求和第二ARP请求从交换机1的所有可用转发端口发出,例如PacketOut第一ARP请求和第二ARP请求。
控制器可以分多次将第一ARP请求和第二ARP请求发送至交换机1。
第一ARP请求的源IP地址为网关的IP地址,目的IP地址为IP 1。网关由控制器模拟,网关的IP地址和控制器的IP地址不同。第二ARP请求的源IP地址为网关的IP地
址,目的IP地址为控制器的IP地址。
交换机1的转发面接收到第一ARP请求和第二ARP请求后,将第一ARP请求和第二ARP请求从所有可用转发端口发出。由于交换机1的管理端口与转发端口port 1连接,因此交换机1的控制面能够接收到从port 1发出的第一ARP请求。交换机1的控制面接收到第一ARP请求后,确认第一ARP请求中的目的IP地址为自身的IP地址,因此交换机1的控制面根据第一ARP请求生成第一ARP答复,参考s218。交换机1的转发面从port2发出第二ARP请求至控制器,参考s226。控制器接收到第二ARP请求后,确认第二ARP请求中的目的IP地址为自身的IP地址,因此控制器根据第二ARP请求生成第二ARP答复,参考s228。
s218,交换机1接收第一ARP请求,生成第一ARP答复。第一ARP答复的源IP地址为IP 1,目的IP地址为网关的IP地址。
交换机1的控制面通过管理端口获取从port 1发出的第一ARP请求后,生成第一ARP答复。第一ARP答复从管理端口发出,经由port 1发送至交换机1的转发面,因此,s220中第一ARP答复的inport端口号为port 1。
s220,交换机1的转发面匹配第一ARP答复和第一ARP探测流表,根据第一ARP探测流表的动作域将第一ARP答复上报控制器。
上报至控制器的除了第一ARP答复还有第一ARP答复的inport端口,即与交换机1的管理端口连接的转发端口port 1。由于此时交换机1并不清楚控制器具体通过那个转发端口与自己连接,因此,交换机1可以将第一ARP答复和port 1从所有可用转发端口发出以将第一ARP答复上报至控制器。
s222,控制器接收上报的第一ARP答复以及port 1。控制器记录交换机1的port 1。并根据port 1生成第一流表。第一流表指示将目的地为交换机1,(也即目的地为交换机1的控制面)的报文从port 1发出。
第一流表的匹配域包括:目的地为交换机1。第一流表的动作域包括:从port 1发出。
具体的,第一流表可以由一条或多条流表构成。这多条流表的动作域均为:从port 1发出。每条流表的匹配域可以包括以下任意一种或多种的组合:
报文的目的MAC地址为交换机1的MAC地址;报文的目的IP地址为IP 1;其他能够确定交换机1的字段。
s222中,控制器根据交换机1的管理端口和转发端口port 1的连接关系生成用于单播的第一流表。
控制器指示交换机1设置第一流表的优先级高于第二预置流表,或者控制器指示交换机1接收到第一流表后可以删除第二预置流表。因此,交换机1后续接收到报文的目的地为交换机1的情况下,无须根据第二预置流表将该报文从所有可用转发端口发出,而可以根据第一流表精确的将报文从port 1发送至交换机1的管理端口,减轻了网络压力。
s224,控制器将第一流表发送至交换机1。
随后,交换机1的控制面接收第一流表,将第一流表存入交换机1的转发面。第一流表的优先级高于第二预置流表,或者根据控制器的指示在存储第一流表后删除第二预置流表。
s224之前,如果与交换机1相邻的交换机生成了DHCP请求的场景参考s209至s213,s209至s213可以在交换机1获取第一流表前任意时刻执行,以交换机2生成第二DHCP请求为例。
s209,交换机2生成第二DHCP请求,第二DHCP请求的源MAC地址为交换机2的MAC地址。
s211,由于第二DHCP请求能够匹配交换机2的第一预置流表,因此交换机2根据交换机2的第一预置流表的动作域,将第二DHCP请求从所有可用转发端口发出。
s213,交换机1从转发端口3接收第二DHCP请求,尝试将第二DHCP请求与交换机1的第一预置流表和交换机1的第二预置流表进行匹配。交换机1确定第二DHCP请求无法匹配上交换机1的第一预置流表或交换机1的第二预置流表的匹配域后,将第二DHCP请求丢弃,限制了第二DHCP请求的广播范围,降低了网络负载。
s226,交换机1将第二ARP请求发送至控制器。
s216中控制器指示交换机1第二ARP请求从交换机1的所有可用转发端口发出,交换机1的转发面将第二ARP请求通过port 2发送至控制器。
s228,控制器接收第二ARP请求后,生成第二ARP答复。第二ARP答复的源IP地址为控制器的IP地址,目的IP地址为网关的IP地址。
s230,控制器发送第二ARP答复至交换机1。
s232,交换机1的转发面匹配第二ARP答复和第二ARP探测流表,根据第二ARP探测流表的动作域将第二ARP答复上报控制器。
第二ARP答复通过port 2进入交换机1的转发面。上报至控制器的除了第二ARP答复还有第二ARP答复的inport端口,即交换机1与控制器相连的转发端口port 2。由于此时交换机1并不清楚控制器具体通过那个转发端口与自己连接,因此,交换机1可以将第二ARP答复从所有可用转发端口发出以将第二ARP答复上报至控制器。
s234,控制器记录交换机1的port 2,并生成第二流表。第二流表指示将目的地为控制器或DHCP服务器的报文从port 2发出。
第二流表的匹配域包括:目的地为控制器或DHCP服务器。第二流表的动作域包括:从port 2发出。
具体的,第二流表可以由一条或多条流表构成。这多条流表的动作域均为:从port 2发出。每条流表的匹配域可以为采用以下任意一种或多种的组合:
报文类型=DHCP;报文类型=用户数据报协议(英文:User Datagram Protocol,缩写:UDP),目的端口=67;目的MAC地址为控制器的MAC地址;目的IP地址为控制器的IP地址;其他能够确定DHCP服务器的字段;其他能够确定控制器的字段。
s234中,控制器得知交换机1的转发端口port 2和控制器的连接关系,可以生成用于单播的第二流表。控制器可以指示交换机1设置第二流表的优先级高于第一预置流表,
或者控制器指示交换机1接收到第二流表后可以删除第一预置流表。因此,交换机1后续接收到目的地为DHCP服务器或控制器的报文的情况下,可以根据第二流表精确的将报文从port 2发送至DHCP服务器或控制器。交换机1获取第二流表后,如果接收到相邻交换机生成的DHCP请求,将可以根据第二流表将相邻交换机生成的DHCP请求发送至DHCP服务器。因此,保证了网络中交换机的逐层受控,也即交换机1先受控(交换机1的转发端口被控制器识别),然后与交换机1相邻的交换机受控。
s236,控制器将第二流表发送至交换机1。
随后,交换机1接收并存储第二流表。第二流表的优先级高于第一预置流表,或者控制器指示交换机1在存储第二流表后删除第一预置流表。
s226至s236和s218至s224的执行顺序没有先后之分,交换机1也可以并列执行s226和s218。
通过图6对应的流程,交换机1获取IP 1的过程中不会广播其他交换机发来的DHCP报文,交换机1受控后,控制器再逐层控制下一跳交换机,降低了网络中的广播报文的数量,提升了引导效率。同时,发往交换机1的控制面和发往DHCP服务器以及控制器的报文都由初始的广播流表(第一预置流表和第二预置流表),变为单播流表(第一流表和第二流表),大幅降低了后续交换机1发送报文的效率。同时,通过该流程,交换机1的IP地址、MAC地址、转发端口的连接关系均被控制器得知,交换机1的控制面与控制器建立连接,接受控制器控制。该流程中,交换机1无须端口学习功能,交换机1的控制面和转发面合并为一张网络,降低了对交换机1的要求,也即降低了网络架构的成本。
交换机1受控制器控制后,交换机1的下一跳交换机(交换机2和交换机3)开始受控流程,图8为本申请提供的一种以交换机2为例进行介绍交换机2的受控流程的实施例。图7为本申请提供的一种实施例,该实施例中介绍了交换机2和交换机1的转发端口的连接关系。图8中各步骤的执行顺序不限定,多个步骤也可以并行执行。
s402,交换机2获取第一预置流表、第二预置流表和第三预置流表。
交换机2的转发面获取并存储第一预置流表,第二预置流表和第三预置流表。具体可以参考上述图6中的步骤s201,此处不再赘述。
第三预置流表的匹配域包括:报文类型=链路层发现协议(英文:Link Layer Discovery Protocol,缩写:LLDP),报文的源MAC地址全为0。第三预置流表的动作域包括:将报文的源MAC地址变更为本交换机的MAC地址(也即交换机2的MAC地址),将变更后的报文从进入(inport)端口发出。
第三预置流表的匹配域中报文的源MAC地址除了全为0外,还可以灵活设置。例如,第三预置流表的匹配域中报文的源MAC地址与s406中第一端口探测报文相同。
s404,控制器生成第一端口探测流表,发送第一端口探测流表至交换机1。
第一端口探测流表的匹配域包括:报文类型=LLDP。第一端口探测流表的动作域包括:上报控制器。
s406,控制器生成第一端口探测报文,发送第一端口探测报文至交换机1。并且,控制器指示交换机1将第一端口探测报文从交换机1的所有可用转发端口发出,例如
PacketOut第一端口探测报文。
第一端口探测报文的报文类型可以为LLDP。第一端口探测报文的源MAC地址可以全为0。
s408,交换机1通过port 3将第一端口探测报文发送至交换机2的port 4。
s410,交换机2的转发面将第一端口探测报文和第三预置流表进行匹配。根据第三预置流表的动作域,将第一端口探测报文的源MAC地址变更为交换机2的MAC地址以生成第一端口答复报文。
s412,交换机2根据第三预置流表的动作域,将第一端口答复报文从port 4发送至交换机1的port 3。
s414,交换机1的转发面通过port 3接收第一端口答复报文。交换机1的转发面将第一端口答复报文和第一端口探测流表进行匹配,根据第一端口探测流表的匹配域将第一端口答复报文上报控制器。上报的动作中,会将第一端口答复报文的inport端口port3,一并发送至控制器。
s416,控制器记录port 3和交换机2的MAC地址的对应关系,生成第三流表。
控制器通过第一端口答复报文中携带的交换机2的MAC地址和port 3,确定交换机1通过port 3与交换机2连接,生成第三流表。
第三流表的匹配域包括:目的地为交换机2。第三流表的动作域包括:从port 3发出。
具体的,第三流表的匹配域可以包括:报文的目的MAC地址为交换机2的MAC地址。
s418,控制器将第三流表发送至交换机1。
交换机1的转发面接收并存储第三流表。通过第三流表,交换机1后续接收到目的地为交换机2的报文时,可以精确的将该报文从port 3发送至交换机2,减少广播,降低网络负担。
s404至s418的执行,也可以在s420至s448之后或之中执行。
s420,交换机2的控制面生成第二DHCP请求,将第二DHCP请求通过交换机2的管理端口发送至交换机2的转发面。第二DHCP请求的源MAC地址为交换机2的MAC地址。
s422,交换机2的转发面匹配第二DHCP请求和第一预置流表,根据第一预置流表的动作域将第二DHCP请求从交换机2的所有可用转发端口发出。
s424,交换机1从port 3接收第二DHCP请求,将第二DHCP请求发送至DHCP服务器。
具体的,交换机1匹配第二DHCP请求和第二流表,将第二DHCP请求通过port 2发送至DHCP服务器。
由于第二DHCP请求的报文类型为DHCP,因此可以匹配第二流表。
s426,DHCP服务器根据第二DHCP请求,分配IP 2作为交换机2的IP地址。DHCP服务器生成第二DHCP答复,并通过交换机1发送至交换机2。第二DHCP答复的目的MAC地址为交换机2的MAC地址,第二DHCP答复携带IP 2。
s428,交换机2获取第二DHCP答复。交换机2的转发面匹配第二DHCP答复和第二
预置流表,根据第二预置流表的动作域将第二DHCP答复从交换机2的所有可用转发端口发出。由于交换机2的管理端口与转发端口port 5连接,因此交换机2的控制面能够接收到第二DHCP答复,并获取IP 2。
s430,交换机2与控制器建立TCP连接。
TCP连接的建立过程参考图6的s212。
s432,控制器生成第三ARP探测流表和第二端口探测流表,并通过交换机1发送至交换机2。
第三ARP探测流表的匹配域包括:报文类型=ARP,报文的源IP地址是IP 2。第三ARP探测流表的动作域包括:上报控制器。
第二端口探测流表的匹配域包括:报文类型=LLDP。第二端口探测流表的动作域包括:上报控制器。
控制器可以分两次将第三ARP探测流表和第二端口探测流表发送至交换机2。
s434,控制器生成第三ARP请求和第二端口探测报文,并通过交换机1发送至交换机2。并且,控制器指示交换机2将第三ARP请求从交换机2的所有可用转发端口发出,例如PacketOut第三ARP请求。
第二端口探测报文的报文类型可以为LLDP。第二端口探测报文的源MAC地址可以为交换机1的MAC地址。第三ARP请求的目的IP地址是IP 2。
控制器可以分两次将第三ARP请求和第二端口探测报文发送至交换机2。
s436,交换机2的控制面通过管理端口接收从port 5发出的第三ARP请求,生成第三ARP答复。第三ARP答复的源IP地址是IP 2。
s438,交换机2的转发面通过port 5获取第三ARP答复,匹配第三ARP探测流表和第三ARP答复,根据第三ARP探测流表的动作域将第三ARP答复上报控制器。上报至控制器的包括第三ARP答复的inport端口,即与交换机2的管理端口连接的转发端口port5。
s440,控制器记录交换机2的port 5。并根据port 5生成第四流表。第四流表指示将目的地为交换机2的报文从port 5发出。
具体的,第四流表可以由一条或多条流表构成。这多条流表的动作域均为:从port 5发出。每条流表的匹配域可以包括以下任意一种或多种的组合:
报文的目的MAC地址为交换机2的MAC地址;报文的目的IP地址为IP 2;其他能够确定交换机2的字段。
s442,控制器将第四流表通过交换机1发送至交换机2。交换机2的转发面存储第四流表。
第四流表的优先级高于交换机2的第二预置流表,或者控制器指示交换机2在存储第四流表后删除交换机2的第二预置流表。
s444,交换机2的转发面匹配第二端口探测报文和第二端口探测流表,根据第二端口探测流表的动作域将第二端口探测报文上报至控制器。由于第二端口探测报文从port4进入交换机2的转发面,上报至控制器的包括第二端口探测报文的inport端口,即port
4。
s446,控制器记录交换机2与交换机1连接的转发端口port 4,并根据port 4生成第五流表。第五流表指示将目的地DHCP服务器或控制器或交换机1的报文从port 4发出。
由于执行s446时,控制器已经获取交换机1的MAC地址,IP地址信息等交换机1的标识信息,因此可以在第二端口探测报文中携带交换机1的标识信息。控制器可以得知s444中上报第二端口探测报文携带的port 4通向交换机1,控制器因此能够生成第五流表。
s448,控制器将第五流表通过交换机1发送至交换机2。交换机2的转发面存储第五流表。
具体的,第五流表可以由一条或多条流表构成。这多条流表的动作域均为:从port 4发出。每条流表的匹配域可以为采用以下任意一种或多种的组合:
报文类型=DHCP;报文类型=UDP,目的端口=67;目的MAC地址为控制器的MAC地址;目的IP地址为控制器的IP地址;其他能够确定DHCP服务器的字段;其他能够确定控制器的字段;其他能够确定DHCP服务器的字段;目的地为交换机1的IP地址;目的地为交换机1的MAC地址;其他能够确定交换机1的字段。
s436至s442和s444至s448分别用于定位交换机2的控制面连接的转发端口和定位交换机2与交换机1连接的转发端口。s436至s442和s444至s448的执行顺序没有先后之分,两种也可以并行执行。
图6和图8以及后续的图10和图12对应的流程中,采用ARP探测流表和ARP类型的报文来定位交换机的控制面的inport端口(例如,port 1和port 5)以及控制器和DHCP服务器连接交换机的inport端口(例如,port 2)。同时,采用端口探测流表、端口探测报文和端口答复报文来定位交换机之间连接的转发端口(例如,port 3和port 4)。其中,除了使用LLDP类型的端口探测报文和端口答复报文定位交换机之间连接转发端口之外,还可以使用交换机支持的其他网络协议,例如虚拟局域网(英文:Virtual Local Area Network,缩写:VLAN),多协议标签交交换(英文:Multi-Protocol Label Switching;缩写:MPLS)。采用其他网络协议的情况下,例如MPLS,端口探测流表的匹配域中报文类型=MPLS,控制器发送的端口探测报文的报文类型为MPLS,交换机生成的端口答复报文的报文类型为MPLS。
通过图8对应的流程,交换机2对发往交换机2的控制面和发往DHCP服务器以及控制器的报文的处理,都由初始的基于广播流表(第一预置流表和第二预置流表),变为基于单播流表(第三流表和第四流表),大幅降低了后续交换机2发送这类报文的效率。同时,通过该流程,交换机2的IP地址、MAC地址、转发端口的连接关系均被控制器得知,交换机2的控制面与控制器建立连接,接受控制器控制。该流程中,交换机2无须端口学习功能,交换机2的控制面和转发面合并为一张网络,降低了对交换机2的要求,也即降低了网络架构的成本。
网络中其他交换机的受控过程参考图6和图8的过程,网络中从控制器连接的交换机开始逐层受控。与控制器直接连接的交换机通过图6所示的流程受控后,受控交换机
的下一跳交换机通过图8所示的流程受控,然后逐层向下一跳交换机扩散,直至网络中全部交换机均被控制器控制。全部交换机受控后,控制器掌握每台交换机的端口连接情况,因此控制器可以给受控的交换机下发精确控制报文流向的流表,减少报文在网络中的广播,降低网络压力。
图6和图8对应的流程介绍了图1的场景下网络中每个交换机受控的过程。图2a和图2b的场景中,交换机受控的过程与图1的场景类似,以下分别进行介绍。
图2a的场景中,DHCP服务器和控制器分别位于不同服务器,也即通过不同端口与交换机1相连。因此,除了图6和图8的流程之外,还需要定位DHCP服务器与交换机1相连的端口。如图9所示,DHCP服务器与交换机1的port 6相连。图10中各步骤的执行顺序不限定,多个步骤也可以并行执行。
图10中除s606和s608是由交换机1和DHCP服务器间进行通信之外,s602至s636与s202至s236的步骤对应。以下着重介绍图10相比图6不同的步骤和新增的步骤。
s614中控制器还需要生成第四ARP探测流表,并将第四ARP探测流表发送至交换机1。
第四ARP探测流表的匹配域包括:报文类型=ARP,报文的源IP地址=DHCP服务器的IP地址。ARP探测流表的动作域包括:上报至控制器。
s616中,控制器还生成了第四ARP请求,将第四ARP请求发送至交换机1。并且,控制器指示交换机1将第四ARP请求从交换机1的所有可用转发端口发出。第四ARP请求的源IP地址为网关的IP地址,目的IP地址为DHCP服务器的IP地址。
s616中控制器将第四ARP请求发送至交换机1后,s638中交换机1将第四ARP请求发送至DHCP服务器。
s640DHCP服务器将第四ARP答复发送至交换机1。
由于第四ARP请求中的目的IP地址为DHCP服务器的IP地址,DHCP服务器根据第四ARP请求生成第四ARP答复。第四ARP答复的源IP地址为DHCP服务器的IP地址。
s642,交换机1的转发面匹配第四ARP探测流表和第四ARP答复,根据第四ARP探测流表的动作域将第四ARP答复上报控制器,一并上报的还有第四ARP答复进入交换机1的inport端口,即port 6。
s644,控制器记录交换机1的port 6和DHCP服务器连接,生成第六流表。第六流表指示将目的地为DHCP服务器的报文从port 6发出。
第六流表的匹配包括:目的地为DHCP服务器。第六流表的动作域包括:从port 6发出。
具体的,第六流表的匹配域可以为采用以下任意一种或多种的组合:报文类型=DHCP;报文类型=UDP,目的端口=67;其他能够确定DHCP服务器的字段。
s648,控制器将第六流表发送至交换机1。交换机1的转发面接收第六流表后,可以精确处理后续接收的目的地为DHCP服务器的报文,提升了报文的处理效率。
s626至s236、s618至-s224、s638至s648的执行顺序没有先后之分,交换机1也可以并列执行s626、s618、s638。
交换机1受控后,网络中其他交换机的受控过程参考图8。
图2b的场景中,DHCP服务器和控制器位于不同服务器,且连接于不同交换机。因此,除了图6和图8的流程之外,还需要定位DHCP服务器与交换机2相连的端口。如图11所示,DHCP服务器与交换机2的port 7相连。图12中各步骤的执行顺序不限定,多个步骤也可以并行执行。
s802,交换机1的转发面获取交换机1的第一预置流表和交换机1的第二预置流表。
s804,交换机2的转发面获取第四预置流表和第五预置流表。
其中,第四预置流表的匹配域包括:报文的源MAC地址=交换机1的MAC地址;第五预置流表的匹配域包括:报文的目的MAC地址=交换机1的MAC地址。第四预置流表的动作域和第五预置流表的动作域均包括:从交换机2的所有可用转发端口发出。
s806,交换机1的控制面生成第一DHCP请求,将第一DHCP请求通过管理端口发送至转发面。第一DHCP请求的源MAC地址为交换机1的MAC地址。
s808,交换机1的转发面匹配第一DHCP请求和第一预置流表,根据第一预置流表的动作域将第一DHCP请求从交换机1的所有可用转发端口发出。
s810,交换机2通过port 4接收第一DHCP请求,交换机2的转发面匹配第一DHCP请求和第四预置流表,根据第四预置流表的动作域将第一DHCP请求从交换机2的所有可用转发端口发出。包括通过端口7向DHCP服务器发送第一DHCP请求。
s812,DHCP服务器接收port 7发出的第一DHCP请求,根据第一DHCP请求,分配IP 1作为交换机1的IP地址。DHCP服务器生成第一DHCP答复,并发送至交换机2的port7。
第一DHCP答复的目的MAC地址为交换机1的MAC地址,第一DHCP答复携带IP 1。
s814,交换机2通过port 7获取第一DHCP答复。交换机2的转发面匹配第一DHCP答复和第五预置流表,根据第五预置流表的动作域将第一DHCP答复从交换机2的所有可用转发端口发出。包括从交换机2的port 4向交换机1发送,交换机1通过port 3接收从交换机2的port 3发出的该第一DHCP答复,根据交换机1的第二预置流表将第一DHCP答复发送至交换机1的控制面,使得交换机1的控制面获取IP 1。
s816,交换机1与控制器建立TCP连接。具体的,s816参考s212。
s816后,交换机1的port 1和port 2的定位以及单播流表(图6对应的流程中的第一流表和第二流表)的生成参考s214至s236,交换机1的port 3、交换机1的port 4和port 5的定位以及单播流表(图8对应的流程中的第三流表,第四流表和第五流表)的生成参考s402至s448。
s818,控制器生成第五ARP探测流表,并将第五ARP探测流表发送至交换机2。
第五ARP探测流表的匹配域包括:报文类型=ARP,报文的源IP地址=DHCP服务器的IP地址。ARP探测流表的动作域包括:上报至控制器。
s820,控制器还生成了第五ARP请求,将第五ARP请求通过交换机1发送至交换机2并且控制器指示交换机2将第五ARP请求从交换机2的所有可用转发端口发出。第五ARP请求的源IP地址为网关的IP地址,目的IP地址为DHCP服务器的IP地址。
s822,DHCP服务器根据第五ARP请求生成第五ARP答复。第五ARP答复的源IP地址为DHCP服务器的IP地址。DHCP服务器将第五ARP答复发送至交换机2。
s824,交换机2的转发面匹配第五ARP探测流表和第五ARP答复,将第五ARP答复上报控制器,一并上报的还有第五ARP答复进入交换机2的inport端口,即port 7。
s826,控制器记录交换机2的port 7和DHCP服务器连接,生成第七流表。第七流表指示将目的地为DHCP服务器的报文从port 7发出。
第七流表的匹配包括:目的地为DHCP服务器。第七流表的动作域包括:从port 7发出。
具体的,第七流表的匹配域可以为采用以下任意一种或多种的组合:报文类型=DHCP;报文类型=UDP,目的端口=67;其他能够确定DHCP服务器的字段。
s828,控制器将第七流表发送至交换机2。交换机2的转发面接收第七流表后,可以精确处理后续接收的目的地为DHCP服务器的报文,提升了报文的处理效率。
s818至s828的执行,可以和前述交换机1的port 1和port 2的定位以及交换机2的port 3、port 4、port 5的定位并行执行或按任意顺序执行。
通过图6、图8、图10和图12提供的流程,无论控制器和DHCP服务器在网络中通过何种方式部署,网络中的交换机都可以在不需要管理人员介入的情况下自动受控,降低了网络的运维和管理的难度。
图13提供了一种控制器1000。控制器1000包括总线1002、处理器1004、通信接口1006和存储器1008。处理器1004、存储器1008和通信接口1006之间通过总线1002通信。通信接口1006用于与交换机通信。
其中,处理器1004可以为中央处理器(英文:central processing unit,缩写:CPU)。存储器1008可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random access memory,缩写:RAM)。存储器1008还可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器,HDD或SSD。控制器1000通过通信接口1006与被控制器1000管理的交换机通信,例如发送流表至交换机,从交换机接收报文或发送报文至交换机。
存储器1008中存储有可执行代码,处理器1004执行该可执行代码以执行上述流程中控制器侧的动作。具体的,存储器1008中存储有操作***、网关、流表生成模块和报文处理模块。操作***可以为LINUX,UNIX,WINDOWS等,处理器1004执行操作***以对控制器1000进行控制。网关、流表生成模块和报文生成模块运行于操作***之上。流表生成模块用于记录交换机的管理端口和转发端口,并生成相应的流表通过通信接口1006发送至相应的交换机。报文生成模块用于生成各类报文,包括ARP请求,端口探测报文。
图14提供了一种交换机1200。交换机1200包括总线1202、处理器1204、通信接口1206、存储器1208。处理器1204、存储器1208和通信接口1206之间通过总线1202通信。前述网络中各个交换机均可以采用交换1200的架构。处理器1204被配置为执行上述流程中交换机侧的动作。
通信接口1206包括了转发端口。存储器1208内存储了可执行代码。
处理器1204可以通过处理芯片1210和CPU组合实现。处理芯片1210通过集成电路实现,可以为ASIC或PLD或网络处理单元中的一种或多种的组合。上述PLD可以是CPLD,FPGA,GAL中任意一种或多种的组合。存储器608可以包括易失性存储器,例如RAM。存储器1208还可以包括非易失性存储器,例如ROM,快闪存储器,HDD或SSD。
处理器1204的CPU工作时,支持交换机1200的控制面,即交换机的主机。控制面与控制器通信,接收控制器下发的用于生成流表的内容,并生成对应的流表并发送至处理芯片1210。存储器1208中存储有可执行代码,处理器1204执行该可执行代码以执行上述流程中控制器侧的动作。具体的,存储器1208中存储有操作***和报文处理模块。操作***可以为LINUX,UNIX,WINDOWS等,处理器1204执行操作***以对交换机1200进行控制。网关和报文处理模块运行于操作***之上。报文处理模块可以用于生成DHCP请求、生成ARP答复、生成端口答复报文等。处理芯片1210工作时,支持交换机1200的转发面。处理芯片1210内设置有存储器用于存储处理器1204发送的流表,该存储器可以为RAM、ROM、快闪存储器、HDD、SSD、三态内容寻址内存(英文:ternary content addressable memory)中任意一种或多种的组合。
处理器1204也可以仅通过CPU实现。此情况下,处理器1204的CPU工作时,支持交换机1200的控制面和转发面。处理器1204通过通信接口1206接收控制器下发的用于生成流表的内容,并生成对应的流表并发送至存储器1208。存储器1208中还存储有流表匹配模块,处理器1204根据流表匹配模块将报文与流表匹配,并且按照流表的动作域处理报文。
上述各个附图对应的流程的描述各有侧重,某个流程中没有详述的部分,可以参见其他流程的相关描述。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如SSD)等。
Claims (26)
- 一种网络,其特征在于,包括第一交换机第二交换机和控制器,所述第一交换机的管理端口与所述第一交换机的第一转发端口连接,所述第一交换机的第三转发端口与所述第二交换机的第四转发端口连接,在所述控制器和动态主机配置协议DHCP服务器设置在同一物理服务器的情况下,所述第一交换机的第二转发端口与所述DHCP服务器和所述控制器连接;所述第一交换机,用于生成第一DHCP请求;匹配第一预置流表和所述第一DHCP请求;根据所述第一预置流表将所述第一DHCP请求从所述第一交换机的所有可用转发端口发出;所述第二交换机,用于接收所述第一DHCP请求;确定第一DHCP请求无法匹配所述第二交换机的预置流表后,丢弃所述第一DHCP请求;生成第二DHCP请求;通过所述第四转发端口发送所述第二DHCP请求至所述第一交换机;所述第一交换机,用于从所述DHCP服务器接收第一DHCP答复,所述第一DHCP答复由所述DHCP服务器根据所述第一DHCP请求生成;匹配第二预置流表和所述第一DHCP答复;根据所述第二预置流表将所述第一DHCP答复从所述第一交换机的所有可用转发端口发出;通过所述第一交换机的管理端口接收从所述第一转发端口发出的所述第一DHCP答复;从所述第三转发端口接收所述第二DHCP请求;确定所述第二DHCP请求无法匹配所述第一预置流表和所述第二预置流表后,丢弃所述第二DHCP请求。
- 如权利要求1所述的网络,其特征在于,所述第一DHCP请求的源媒体接入控制MAC地址为所述第一交换机的MAC地址;所述第一预置流表指示将源MAC地址为所述第一交换机的MAC地址的报文从所述第一交换机的所有可用转发端口发出。
- 如权利要求1或2所述的网络,其特征在于,所述第一DHCP答复的目的MAC地址为所述第一交换机的MAC地址;所述第二预置流表指示将目的MAC地址为所述第一交换机的MAC地址的报文从所述第一交换机的所有可用转发端口发出。
- 如权利要求1-3任一所述的网络,其特征在于,所述第一交换机,用于根据所述第一DHCP答复中携带的所述第一交换机的IP地址与所述控制器建立传输控制协议TCP连接;所述控制器,用于生成第一流表,发送所述第一流表至所述第一交换机,所述第一流表指示将目的地为所述第一交换机的报文从所述第一转发端口发出,所述第一流表的优先级高于所述第二预置流表或所述第一交换机在收到所述第一流表后删除所述第二预置流表。
- 如权利要求4任一所述的网络,其特征在于,所述控制器,用于生成第一地址解析协议ARP探测流表,所述第一ARP探测流表指示向所述控制器上报源互联网协议IP地址为所述第一交换机的IP地址的ARP类型的报文;将所述第一ARP探测流表发送至所述第一交换机;生成第一ARP请求,所述第一ARP请求的目的IP地址为所述第一交换机的IP地址;发送所述第一ARP请求至所述第一交换机;指示所述第一交换机将所述第一ARP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机,用于接收所述第一ARP探测流表;通过所述第一交换机的管理端 口接收从所述第一转发端口发出的所述第一ARP请求;根据所述第一ARP请求生成第一ARP答复,所述第一ARP答复的源IP地址为所述第一交换机的IP地址;通过所述第一交换机的管理端口将所述第一ARP答复发送至所述第一转发端口;匹配所述第一ARP探测流表和所述第一ARP答复;根据所述第一ARP探测流表上报所述第一ARP答复以及所述第一转发端口的端口号;所述控制器,用于根据所述第一ARP答复以及所述第一转发端口的端口号,生成所述第一流表。
- 如权利要求4或5所述的网络,其特征在于,所述控制器,用于生成第二流表,发送所述第二流表至所述第一交换机,所述第二流表指示将目的地为所述控制器或所述DHCP服务器的报文从所述第二转发端口发出,所述第二流表的优先级高于所述第一预置流表或所述第一交换机在收到所述第二流表后删除所述第一预置流表。
- 如权利要求6所述的网络,其特征在于,所述控制器,用于生成第二ARP探测流表,所述第二ARP探测流表指示向所述控制器上报源IP地址为所述控制器的IP地址的ARP类型的报文;将所述第二ARP探测流表发送至所述第一交换机;生成第二ARP请求,所述第二ARP请求的目的IP地址为所述控制器的IP地址;发送所述第二ARP请求至所述第一交换机;指示所述第一交换机将所述第二ARP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机,用于接收所述第二ARP探测流表;将所述第二ARP请求通过所述第二转发端口发送至所述控制器;所述控制器,用于根据所述第二ARP请求生成第二ARP答复,所述第二ARP答复的源IP地址为所述控制器的IP地址;发送所述第二ARP答复至所述第一交换机;所述第一交换机,用于通过所述第二转发端口接收所述第二ARP答复;匹配所述第二ARP探测流表和所述第二ARP答复;根据所述第二ARP探测流表上报所述第二ARP答复以及所述第二转发端口的端口号;所述控制器,用于根据所述第二ARP答复以及所述第二转发端口的端口号,生成所述第二流表。
- 如权利要求4至7任一所述的网络,其特征在于,所述第二交换机的管理端口与所述第二交换机的第五转发端口连接;所述控制器生成第三流表,发送所述第三流表至所述第一交换机,所述第三流表指示将目的地为所述第二交换机的报文从所述第三转发端口发出;所述控制器生成第四流表,发送所述第四流表至所述第二交换机,所述第四流表指示将目的地为所述第二交换机的报文从所述第五转发端口发出;所述控制器生成第五流表,发送所述第五流表至所述第二交换机,所述第五流表指示将目的地为所述控制器或所述DHCP服务器或所述第一交换机的报文从所述第四转发端口发出。
- 如权利要求8所述的网络,其特征在于,所述控制器,用于生成第一端口探测流表,所述第一端口探测流表指示向所述控制器上报端口答复报文;将所述第一端口探测流表发送至所述第一交换机;生成第一端口探测报文;将所述第一端口探测报文通过所述第一交换机发送至所述第二交换机;所述第二交换机,用于接收所述第一端口探测报文;根据所述第二交换机的预置流表生成第一端口答复报文;将所述第一端口答复报文发送至所述第一交换机;所述第一交换机,用于通过所述第三转发端口接收所述第一端口答复报文;匹配所述第一端口探测流表和所述第一端口答复报文;根据所述第一端口探测流表上报所述第一端口答复报文以及所述第三转发端口的端口号;所述控制器,用于根据所述第一端口答复报文的以及所述第三转发端口的端口号,生成所述第三流表。
- 如权利要求8或9所述的网络,其特征在于,所述第一交换机,用于接收第二流表,所述第二流表指示将目的地为所述控制器或所述DHCP服务器的报文从所述第二转发端口发出;匹配所述第二DHCP请求与所述第二流表;通过所述第二转发端口将所述第二DHCP请求发送至所述DHCP服务器;接收所述DHCP服务器返回的第二DHCP答复,所述第二DHCP答复的目的地为所述第二交换机且所述第二DHCP答复中携带所述第二交换机的IP地址,所述第二DHCP答复由所述DHCP服务器根据所述第二DHCP请求生成;匹配所述第二DHCP答复与所述第三流表;通过所述第三转发端口向所述第二交换机发送所述第二DHCP答复;所述第二交换机,用于接收所述第二DHCP答复,获取所述第二交换机的IP地址;根据所述第二交换机的IP地址与所述控制器建立TCP连接。
- 如权利要求10所述的网络,其特征在于,所述控制器,用于生成第三ARP探测流表,所述第三ARP探测流表指示向所述控制器上报源IP地址为所述第二交换机的IP地址的ARP类型的报文;将所述第三ARP探测流表发送至所述第二交换机;生成第三ARP请求,所述第三ARP请求的目的IP地址为所述第二交换机的IP地址;发送所述第三ARP请求至所述第二交换机;指示所述第二交换机将所述第三ARP请求从所述第二交换机的所有可用转发端口发出;所述第二交换机,用于接收所述第三ARP探测流表;通过所述第二交换机的管理端口接收从所述第五转发端口发出的所述第三ARP请求;根据所述第三ARP请求生成第三ARP答复,所述第三ARP答复的源IP地址为所述第二交换机的IP地址;通过所述第二交换机的管理端口将所述第三ARP答复发送至所述第五转发端口;匹配所述第三ARP探测流表和所述第三ARP答复;根据所述第三ARP探测流表上报所述第三ARP答复和所述第五转发端口的端口号;所述控制器,用于根据所述第三ARP答复和所述第五转发端口的端口号,生成所述第四流表。
- 如权利要求10或11所述的网络,其特征在于,所述控制器,用于生成第二端口探测流表,所述第二端口探测流表指示向所述控制器上报端口探测报文;将所述第二端口探测流表发送至所述第二交换机;生成第二端口探测报文;将所述第二端口探测报文通过第一交换机发送至所述第二交换机;所述第二交换机,用于通过所述第四转发端口接收所述第二端口探测报文;匹配所述第二端口探测流表和所述第二端口探测报文;根据所述第二端口探测流表上报所述第二端口探测报文和所述第四转发端口的端口号;所述控制器,用于根据所述第二端口探测报文的和所述第四转发端口的端口号,生 成所述第五流表。
- 如权利要求4至12任一所述的网络,其特征在于,在所述控制器和所述DHCP服务器设置在不同物理服务器的情况下,所述第一交换机通过所述第二转发端口与所述控制器连接,所述第一交换机通过第六转发端口与所述DHCP服务器连接;所述控制器,用于生成第四ARP探测流表,所述第四ARP探测流表指示向所述控制器上报源IP地址为所述DHCP服务器的IP地址的ARP类型的报文;将所述第四ARP探测流表发送至所述第一交换机;生成第四ARP请求,所述第四ARP请求的目的IP地址为所述DHCP服务器的IP地址;发送所述第四ARP请求至所述第一交换机;指示所述第一交换机将所述第四ARP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机,用于接收所述第四ARP探测流表和所述第四ARP请求;将所述第四ARP请求通过所述第一交换机的所有可用转发端口发出;从所述第六转发端口接收第四ARP答复,所述第四ARP答复的源IP地址为所述DHCP服务器的IP地址,所述第四ARP答复由所述DHCP服务器根据所述第四ARP请求生成;匹配所述第四ARP探测流表和所述第四ARP答复;根据所述第四ARP探测流表上报所述第四ARP答复和所述第六转发端口的端口号;所述控制器,用于根据所述第四ARP探测流表和所述第六转发端口的端口号,生成第六流表,所述第六流表指示将目的地为所述DHCP服务器的报文从所述第六转发端口发出;发送所述第六流表至所述第一交换机。
- 一种网络管理方法,其特征在于,所述方法应用于包括第一交换机和控制器的网络,所述第一交换机的控制面通过所述第一交换机的管理端口与所述第一交换机的第一转发端口连接,所述第一交换机的第二转发端口与所述控制器连接;所述方法包括:所述控制器生成第一ARP探测流表,所述第一ARP探测流表指示向所述控制器上报源IP地址为所述第一交换机的IP地址的ARP类型的报文;所述控制器将所述第一ARP探测流表发送至所述第一交换机;所述控制器生成第一ARP请求,所述第一ARP请求的目的IP地址为所述第一交换机的IP地址;所述控制器发送所述第一ARP请求至所述第一交换机;所述控制器指示所述第一交换机将所述第一ARP请求从所述第一交换机的所有可用转发端口发出;所述控制器获取所述第一交换机的转发面根据所述第一ARP探测流表上报的第一ARP答复和所述第一转发端口的端口号,所述第一ARP答复由所述第一交换机的控制面根据所述第一ARP请求生成,并通过所述第一转发端口发送至所述第一交换机的转发面,所述第一ARP答复的源IP地址为所述第一交换机的IP地址;所述控制器根据所述第一ARP答复和所述第一转发端口的端口号,生成第一流表,所述第一流表指示将目的地为所述第一交换机的报文从所述第一转发端口发出;所述控制器发送所述第一流表至所述第一交换机。
- 如权利要求14的方法,其特征在于,所述方法包括:所述控制器生成第二ARP探测流表,所述第二ARP探测流表指示向所述控制器上报源IP地址为所述控制器的IP地址的ARP类型的报文;所述控制器将所述第二ARP探测流表发送至所述第一交换机;所述控制器生成第二ARP请求,所述第二ARP请求的目的IP地址为所述控制器的IP地址;所述控制器发送所述第二ARP请求至所述第一交换机;所述控制器指示所述第一交换机将所述第二ARP请求从所述第一交换机的所有可用转发端口发出;所述控制器接收所述第一交换机从所述第二转发端口发出的所述第二ARP请求;所述控制器根据所述第二ARP请求生成第二ARP答复,所述第二ARP答复的源IP地址为所述控制器的IP地址;所述控制器通过所述第二转发端口将所述第二ARP答复发送至所述第一交换机的转发面;所述控制器获取所述第一交换机的转发面根据所述第二ARP探测流表上报的所述第二ARP答复和所述第二转发端口的端口号;所述控制器根据所述第二ARP答复和所述第二转发端口的端口号,生成第二流表,所述第二流表指示将目的地为所述控制器的报文从所述第二转发端口发出;所述控制器发送所述第二流表至所述第一交换机。
- 如权利要求14或15所述的方法,其特征在于,所述网络还包括第二交换机,所述第二交换机通过所述第一交换机与所述控制器通信,所述第一交换机的第三转发端口和所述第二交换机的第四转发端口连接;所述方法包括:所述控制器生成第一端口探测流表,所述第一端口探测流表指示向所述控制器上报端口答复报文;所述控制器将所述第一端口探测流表发送至所述第一交换机;所述控制器生成第一端口探测报文;所述控制器将所述第一端口探测报文通过所述第一交换机发送至所述第二交换机;所述控制器获取所述第一交换机的转发面根据所述第一端口探测流表上报的第一端口答复报文和所述第三转发端口的端口号,所述第一端口答复报文由第二交换机的控制面根据所述第一端口探测报文生成,并通过所述第三转发端口发送至所述第一交换机的转发面;所述控制器根据所述第一端口答复报文和所述第三转发端口的端口号,生成第三流表,所述第三流表指示将目的地为所述第二交换机的报文从所述第三转发端口发出;所述控制器发送所述第三流表至所述第一交换机。
- 如权利要求16所述的方法,其特征在于,所述第二交换机与所述控制器建立TCP连接,所述第二交换机的控制面通过所述第二交换机的管理端口与所述第二交换机的第五转发端口连接;所述方法包括:所述控制器生成第三ARP探测流表,所述第三ARP探测流表指示向所述控制器上报源IP地址为所述第二交换机的IP地址的ARP类型的报文;所述控制器将所述第三ARP探测流表发送至所述第二交换机;所述控制器生成第三ARP请求,所述第三ARP请求的目的IP地址为所述第二交换机的IP地址;所述控制器发送所述第三ARP请求至所述第二交换机,指示所述第二交换机将所述第三ARP请求从所述第二交换机的所有可用转发端口发出;所述控制器获取所述第二交换机的转发面根据所述第三ARP探测流表上报的第三ARP答复和所述第五转发端口的端口号,所述第三ARP答复由所述第二交换机的控制面根据所述第三ARP请求生成,并通过所述第五转发端口发送至所述第二交换机的转发面,所述第三ARP答复的源IP地址为所述第二交换机的IP地址;所述控制器根据所述第三ARP答复和所述第五转发端口的端口号,生成第四流表,所述第四流表指示将目的地为所述第二交换机的报文从所述第五转发端口发出;所述控制器发送所述第四流表至所述第二交换机。
- 如权利要求17所述的方法,其特征在于,所述方法包括:所述控制器生成第二端口探测流表,所述第二端口探测流表指示向所述控制器上报端口探测报文;所述控制器将所述第二端口探测流表发送至所述第二交换机;所述控制器生成第二端口探测报文;所述控制器将所述第二端口探测报文通过所述第二交换机的所述第四转发端口发送至所述第二交换机的转发面;所述控制器获取所述第二交换机的转发面根据所述第二端口探测流表上报的所述第二端口探测报文和所述第四转发端口的端口号;所述控制器根据所述第二端口探测报文和所述第四转发端口的端口号,生成第五流表,所述第五流表指示将目的地为所述第一交换机或所述控制器的报文从所述第四转发端口发出;所述控制器发送所述第五流表至所述第二交换机。
- 如权利要求14至18任一所述的方法,其特征在于,所述网络还包括DHCP服务器,所述第一交换机的第六转发端口与所述DHCP服务器连接;所述方法包括:所述控制器生成第四ARP探测流表,所述第四ARP探测流表指示向所述控制器上报源IP地址为所述DHCP服务器的IP地址的ARP类型的报文;所述控制器将所述第四ARP探测流表发送至所述第一交换机;所述控制器生成第四ARP请求,所述第四ARP请求的目的IP地址为所述DHCP服务器的IP地址;所述控制器发送所述第四ARP请求至所述第一交换机;所述控制器指示所述第一交换机将所述第四ARP请求从所述第一交换机的所有可用转发端口发出;所述控制器获取所述第一交换机的转发面根据所述第四ARP探测流表上报的第四ARP答复和所述第六转发端口的端口号,所述第四ARP答复由所述DHCP服务器根据所述第四ARP请求生成并通过所述第一交换机的第六转发端口发送至所述第一交换机的转发面,所述第四ARP答复的源IP地址为所述DHCP服务器的IP地址;所述控制器根据所述第四ARP答复和所述第六转发端口的端口号生成第六流表,所述第六流表指示将目的地为所述DHCP服务器的报文从所述第六转发端口发出;所述控制器发送所述第六流表至所述第一交换机。
- 一种控制器,其特征在于,包括处理器和存储器,所述处理器和所述存储器建立通信;所述处理器,用于执行权利要求14至19任一所述的方法。
- 一种交换机的管理方法,其特征在于,所述交换机为第一交换机,所述第一交换机的控制面通过所述第一交换机的管理端口与所述第一交换机的第一转发端口连接,所述第一交换机的第三转发端口与第二交换机的第四转发端口连接,在控制器和DHCP服务器设置于同一物理服务器的情况下,所述第一交换机的第二转发端口与所述DHCP服务器和所述控制器连接;所述方法包括:所述第一交换机的控制面生成第一DHCP请求,通过所述第一交换机的管理端口将所述第一DHCP请求发送至所述第一交换机的转发面;所述第一交换机的转发面匹配第一预置流表和所述第一DHCP请求;所述第一交换机的转发面根据所述第一预置流表将所述第一DHCP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机的转发面接收所述第一DHCP答复,所述DHCP答复由所述DHCP服务器根据所述第一DHCP请求生成;所述第一交换机的转发面匹配第二预置流表和所述第一DHCP答复;所述第一交换机的转发面根据所述第二预置流表将所述第一DHCP答复从所述第一交换机的所有可用转发端口发出;所述第一交换机的控制面通过所述第一交换机的管理端口接收从所述第一转发端口发出的所述第一DHCP答复;所述第一交换机的转发面从所述第三端口接收所述第二交换机发出的第二DHCP请求;所述第一交换机的转发面确定所述第二DHCP请求无法匹配所述第一预置流表和所述第二预置流表;所述第一交换机的转发面丢弃所述第二DHCP请求。
- 如权利要求21所述的方法,其特征在于,所述方法包括:所述第一交换机的转发面从所述控制器接收第一ARP探测流表,所述第一ARP探测流表指示向所述控制器上报源IP地址为所述第一DHCP答复中携带的所述第一交换机的IP地址的ARP类型的报文;所述第一交换机的转发面从所述控制器接收第一ARP请求,所述第一ARP请求的目的IP地址为所述第一交换机的IP地址;所述第一交换机的转发面根据所述控制器的指示将所述第一ARP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机的控制面通过所述第一交换机的管理端口接收从所述第一转发端口发出的所述第一ARP请求;所述第一交换机的控制面根据所述第一ARP请求生成第一ARP答复,所述第一ARP答复的源IP地址为所述第一交换机的IP地址;所述第一交换机的控制面通过所述第一转发端口将所述第一ARP答复发送至所述第一交换机的转发面;所述第一交换机的转发面匹配所述第一ARP探测流表和所述第一ARP答复;所述第一交换机的转发面根据所述第一ARP探测流表向所述控制器上报所述第一ARP答复和所述第一转发端口的端口号;所述第一交换机的转发面从所述控制器接收第一流表,所述第一流表指示将目的地为所述第一交换机的报文从所述第一转发端口发出,所述第一流表的优先级高于所述第二预置流表或所述第一交换机在收到所述第一流表后删除所述第二预置流表。
- 如权利要求21或22所述的方法,其特征在于,所述方法包括:所述第一交换机的转发面从所述控制器接收第二ARP探测流表,所述第二ARP探测流表指示向所述控制器上报源IP地址为所述控制器的IP地址的ARP类型的报文;所述第一交换机的转发面从所述控制器接收第二ARP请求,所述第二ARP请求的目的IP地址为所述控制器的IP地址;所述第一交换机的转发面根据所述控制器的指示将所述第二ARP请求从所述第一交换机的所有可用转发端口发出;所述第一交换机的转发面通过所述第二转发端口接收第二ARP答复,所述第二ARP答复为所述控制器根据所述第二ARP请求生成的,所述第二ARP答复的源IP地址为所述控制器的IP地址;所述第一交换机的转发面根据所述第二ARP探测流表上报所述第二ARP答复和所述第二转发端口的端口号;所述第一交换机的转发面从所述控制器接收第二流表,所述第二流表指示将目的地为所述控制器或所述DHCP服务器的报文从所述第二转发端口发出,所述第二流表的优先级高于所述第一预置流表或所述第一交换机在收到所述第一流表后删除所述第一预置流表。
- 如权利要求21至23任一所述的方法,其特征在于,所述第一交换机的第三转发端口与第二交换机的第四转发端口连接;所述方法包括:所述第一交换机的转发面从所述控制器接收第一端口探测流表,所述第一端口探测流表指示向所述控制器上报端口答复报文;所述第一交换机的转发面从所述控制器接收第一端口探测报文,将所述第一端口探测报文发送至所述第二交换机;所述第一交换机的转发面通过所述第三转发端口接收所述第二交换机根据所述第一端口探测报文生成的第一端口答复报文;所述第一交换机的转发面根据所述第一端口探测流表向所述控制器上报所述第一端口答复报文和所述第三转发端口的端口号;所述第一交换机的转发面从所述控制器接收第三流表,所述第三流表指示将目的地为所述第二交换机的报文从所述第三转发端口发出。
- 如权利要求21至24任一所述的方法,其特征在于,在所述控制器和所述DHCP服务器设置于不同物理服务器的情况下,所述第一交换机的第二转发端口与所述控制器连接,所述第一交换机的第六转发端口与DHCP服务器连接;所述方法包括:所述第一交换机的转发面从所述控制器接收第四ARP探测流表,所述第四ARP探测流表指示向所述控制器上报源IP地址为所述DHCP服务器的IP地址的ARP类型的报文;所述第一交换机的转发面从所述控制器接收第四ARP请求,所述第四ARP请求的目的IP地址为所述DHCP服务器的IP地址;所述第一交换机的转发面将所述第四ARP请求通过所述第六转发端口发送至所述DHCP服务器;所述第一交换机的转发面通过所述第六转发端口接收第四ARP答复,所述第四ARP答复为所述DHCP服务器根据所述第四ARP请求生成的,所述第四ARP答复的源IP地址为所述DHCP服务器的IP地址;所述第一交换机的转发面根据所述第四ARP探测流表向所述控制器上报所述第四ARP答复和所述第六转发端口的端口号;所述第一交换机的转发面从所述控制器接收第六流表,所述第六流表指示将目的地为所述DHCP服务器的报文从所述第六转发端口发出。
- 一种交换机,其特征在于,包括处理器和存储器,所述处理器和所述存储器建立通信;所述处理器,用于执行权利要求21至25任一所述的方法。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/115419 WO2019113728A1 (zh) | 2017-12-11 | 2017-12-11 | 一种网络及网络管理方法 |
CN201780086953.6A CN110313155B (zh) | 2017-12-11 | 2017-12-11 | 网络、网络管理方法以及该网络的控制器和交换机 |
EP17934772.9A EP3713165B1 (en) | 2017-12-11 | 2017-12-11 | Network and network management method |
US16/897,000 US11223597B2 (en) | 2017-12-11 | 2020-06-09 | Network and network management method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/115419 WO2019113728A1 (zh) | 2017-12-11 | 2017-12-11 | 一种网络及网络管理方法 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/897,000 Continuation US11223597B2 (en) | 2017-12-11 | 2020-06-09 | Network and network management method |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019113728A1 true WO2019113728A1 (zh) | 2019-06-20 |
Family
ID=66818853
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/115419 WO2019113728A1 (zh) | 2017-12-11 | 2017-12-11 | 一种网络及网络管理方法 |
Country Status (4)
Country | Link |
---|---|
US (1) | US11223597B2 (zh) |
EP (1) | EP3713165B1 (zh) |
CN (1) | CN110313155B (zh) |
WO (1) | WO2019113728A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111277492A (zh) * | 2020-01-14 | 2020-06-12 | 南京粒聚智能科技有限公司 | 一种自动探测数控设备类型的边缘计算网关 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107666428B (zh) * | 2016-07-28 | 2020-03-06 | 新华三技术有限公司 | 静默设备探测方法以及装置 |
US11368426B1 (en) * | 2020-12-24 | 2022-06-21 | Nile Global, Inc. | Methods and systems of automatic network service initiation using a network service server |
US11463312B2 (en) * | 2021-01-21 | 2022-10-04 | Cisco Technology, Inc. | Secure onboarding of network devices |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103763194A (zh) * | 2013-12-31 | 2014-04-30 | 杭州华三通信技术有限公司 | 一种报文转发方法及装置 |
CN105430113A (zh) * | 2015-11-03 | 2016-03-23 | 上海斐讯数据通信技术有限公司 | Sdn网络arp报文处理方法、***、控制器及交换机 |
CN106375223A (zh) * | 2016-10-25 | 2017-02-01 | 上海斐讯数据通信技术有限公司 | 一种基于sdn的数据转发***及方法 |
CN106506515A (zh) * | 2016-11-22 | 2017-03-15 | 杭州华三通信技术有限公司 | 一种认证方法和装置 |
CN106685861A (zh) * | 2016-12-05 | 2017-05-17 | 上海斐讯数据通信技术有限公司 | 一种软件定义网络***及其报文转发控制方法 |
CN107395505A (zh) * | 2017-08-07 | 2017-11-24 | 郑州云海信息技术有限公司 | 一种报文传输控制方法及装置 |
Family Cites Families (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7996537B2 (en) * | 2002-11-06 | 2011-08-09 | Telefonaktiebolaget L M Ericsson (Publ) | Method and arrangement for preventing illegitimate use of IP addresses |
US7907615B2 (en) * | 2004-03-12 | 2011-03-15 | At&T Intellectual Property Ii, L.P. | Method and apparatus to manage network addresses for private voice communications |
US8856384B2 (en) * | 2011-10-14 | 2014-10-07 | Big Switch Networks, Inc. | System and methods for managing network protocol address assignment with a controller |
WO2014108178A1 (en) | 2013-01-09 | 2014-07-17 | Telefonaktiebolaget L M Ericsson (Publ) | Connecting a booting switch to a network |
CN103974380B (zh) * | 2013-01-24 | 2018-05-15 | 新华三技术有限公司 | 一种终端接入位置保活的方法及装置 |
CN103973828B (zh) * | 2013-02-01 | 2017-07-14 | 华为技术有限公司 | 一种dhcp客户端获取ip地址的方法及装置 |
CN103152264B (zh) | 2013-02-25 | 2015-11-25 | 北京百度网讯科技有限公司 | Openflow网络和IP网络互连通信方法及Openflow子网边缘交换机 |
CN103269278B (zh) | 2013-04-19 | 2016-06-29 | 江苏省未来网络创新研究院 | 一种基于sdn的终端设备实时接入、离开感知方法 |
PT3661167T (pt) * | 2013-06-26 | 2022-09-26 | Huawei Tech Co Ltd | Método e sistema de atribuição de endereços ip |
US11075948B2 (en) * | 2014-01-10 | 2021-07-27 | Arista Networks, Inc. | Method and system for virtual machine aware policy management |
MX2016009583A (es) * | 2014-01-23 | 2017-04-27 | Huawei Tech Co Ltd | Metodo, dispositivo de conmutacion y dispositivo de control de implementacion de arp. |
CN105391568B (zh) | 2014-09-05 | 2019-07-23 | 华为技术有限公司 | 一种软件定义网络sdn的实现方法、装置和*** |
CN104283790B (zh) | 2014-10-09 | 2017-09-15 | 新华三技术有限公司 | Sdn中弹性分组环rpr的拓扑发现方法和设备 |
CN105577548B (zh) * | 2014-10-10 | 2018-10-09 | 新华三技术有限公司 | 一种软件定义网络中报文处理方法和装置 |
CN104283983B (zh) | 2014-10-27 | 2018-01-09 | 新华三技术有限公司 | 一种软件定义网络中虚拟机ip地址分配方法及装置 |
CN105429875B (zh) | 2015-10-29 | 2018-10-12 | 上海斐讯数据通信技术有限公司 | 基于软件定义网络的链路自动发现方法和*** |
US20170230231A1 (en) * | 2016-02-07 | 2017-08-10 | Moxa Inc. | Reofredundancy system based on virtual router redundancy protocol and method thereof |
US10721140B2 (en) * | 2016-07-20 | 2020-07-21 | Level 3 Communications, Llc | Dynamic service provisioning system and method |
-
2017
- 2017-12-11 EP EP17934772.9A patent/EP3713165B1/en active Active
- 2017-12-11 CN CN201780086953.6A patent/CN110313155B/zh active Active
- 2017-12-11 WO PCT/CN2017/115419 patent/WO2019113728A1/zh unknown
-
2020
- 2020-06-09 US US16/897,000 patent/US11223597B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103763194A (zh) * | 2013-12-31 | 2014-04-30 | 杭州华三通信技术有限公司 | 一种报文转发方法及装置 |
CN105430113A (zh) * | 2015-11-03 | 2016-03-23 | 上海斐讯数据通信技术有限公司 | Sdn网络arp报文处理方法、***、控制器及交换机 |
CN106375223A (zh) * | 2016-10-25 | 2017-02-01 | 上海斐讯数据通信技术有限公司 | 一种基于sdn的数据转发***及方法 |
CN106506515A (zh) * | 2016-11-22 | 2017-03-15 | 杭州华三通信技术有限公司 | 一种认证方法和装置 |
CN106685861A (zh) * | 2016-12-05 | 2017-05-17 | 上海斐讯数据通信技术有限公司 | 一种软件定义网络***及其报文转发控制方法 |
CN107395505A (zh) * | 2017-08-07 | 2017-11-24 | 郑州云海信息技术有限公司 | 一种报文传输控制方法及装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3713165A4 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111277492A (zh) * | 2020-01-14 | 2020-06-12 | 南京粒聚智能科技有限公司 | 一种自动探测数控设备类型的边缘计算网关 |
Also Published As
Publication number | Publication date |
---|---|
EP3713165A4 (en) | 2020-12-30 |
US20200304456A1 (en) | 2020-09-24 |
EP3713165A1 (en) | 2020-09-23 |
CN110313155B (zh) | 2020-10-09 |
CN110313155A (zh) | 2019-10-08 |
US11223597B2 (en) | 2022-01-11 |
EP3713165B1 (en) | 2023-05-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110971433B (zh) | 获取SRv6隧道信息的方法、设备和*** | |
JP6934142B2 (ja) | データ処理 | |
US9531676B2 (en) | Proxy methods for suppressing broadcast traffic in a network | |
EP3070887B1 (en) | Communication method, device and system for virtual extensible local area network | |
US8750288B2 (en) | Physical path determination for virtual network packet flows | |
WO2019113728A1 (zh) | 一种网络及网络管理方法 | |
US20130173788A1 (en) | Network access apparatus | |
US9537766B2 (en) | Packet switching without look-up table for ethernet switches | |
KR20150113597A (ko) | Arp 패킷 처리 방법 및 장치 | |
US11625280B2 (en) | Cloud-native proxy gateway to cloud resources | |
JP7154315B2 (ja) | 仮想プライベートネットワークを管理するための方法およびデバイス | |
US11522754B2 (en) | Systems and methods for Zero-Touch Provisioning of a switch in intermediate distribution frames and main distribution frames | |
US11949602B2 (en) | Stretched EPG and micro-segmentation in multisite fabrics | |
US11929851B2 (en) | Gateway selection method, device, and system | |
EP3262802B1 (en) | Automatic discovery and provisioning of multi-chassis etherchannel peers | |
CN113489646B (zh) | 基于vxlan的分段路由传输方法、服务器、源节点及存储介质 | |
US20240137314A1 (en) | Service chaining in fabric networks | |
Wang et al. | Circuit‐based logical layer 2 bridging in software‐defined data center networking |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17934772 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 2017934772 Country of ref document: EP Effective date: 20200618 |