摘要 |
An OFS in-band communication method and an OFS are disclosed. The method includes: receiving an LLDP data packet; creating a controller list entry or updating a controller list entry when it is determined, by using a role sub-field, that a sender type of the received LLDP data packet is OFC; acquiring a first-time TCP handshake packet used for establishing a TCP connection, and checking, according to a destination MAC and a destination IP that are carried in the TCP handshake packet, whether a corresponding controller list entry exists in a controller list; and if yes, updating a flow entry according to the MAC, the IP, and the in_port in the corresponding controller list entry in the controller list, so that an OFS can forward, by using a flow table, a packet to be sent to an OFC to the OFC. |
主权项 |
1. An OpenFlow switch (OFS) in-band communication method, wherein the method is executed by an OFS, the OFS comprises a controller list, the controller list is used to store one or more controller list entries, the controller list entry comprises a MAC and an IP of a local OpenFlow controller (OFC), and a port number that is corresponding to the MAC and the IP of the local OFC and is used when the OFS receives a Link Layer Discovery Protocol (LLDP) data packet sent by the OFC, and the method comprises:
receiving the LLDP data packet, wherein the LLDP data packet comprises a MAC, an IP, and a role sub-field of a sender, wherein the role sub-field is used to identify a sender type; and creating a controller list entry or updating the controller list entry when it is determined, by using the role sub-field, that a sender type of the received LLDP data packet is OFC, wherein the created controller list entry or the updated controller list entry comprises a MAC and an IP of the local OFC that are carried in the LLDP data packet, and a port in_port through which the LLDP data packet is received; and acquiring a first-time TCP handshake packet used for establishing a TCP connection; checking, according to a destination MAC and a destination IP that are carried in the TCP handshake packet, whether a corresponding controller list entry exists in the controller list; and if yes, updating a flow entry according to the MAC, the IP, and the in_port in the corresponding controller list entry in the controller list, so that the OFS can forward, by using a flow table, a packet to be sent to an OFC to the OFC. |