Method for processing packet in access network and network device

10523562 ยท 2019-12-31

Assignee

Inventors

Cpc classification

International classification

Abstract

This application provides a method for processing a packet in an access network. The method includes: receiving, by an access device, a layer 2 protocol packet sent by a central device, where a destination address of the layer 2 protocol packet is a MAC address of the access device; obtaining, flow table information according to the layer 2 protocol packet, and generating a flow table entry, where the flow table entry includes a match field and an instruction; receiving a service packet; and determining a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processing the service packet according to the instruction in the generated flow table entry. According to the technical solution, the access device can obtain the flow table information from the central device without the need of configuring a public IP address.

Claims

1. A method for processing a packet in an access network, comprising: receiving, by an access device, a layer 2 protocol packet sent by a central device, wherein a destination address of the layer 2 protocol packet is a Media Access Control (MAC) address of the access device, the access device is configured to connect to user equipment, and the central device is configured to connect the access device to an Internet Protocol (IP) network; obtaining, by the access device, flow table information according to the layer 2 protocol packet, wherein the flow table information comprises a match field and an instruction, and generating, by the access device, a flow table entry according to the flow table information, wherein the flow table entry comprises the match field and the instruction; receiving, by the access device, a service packet sent by the user equipment; and determining, by the access device, a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processing the service packet according to the instruction in the generated flow table entry; wherein when a gigabit passive optical network (GPON) or a next-generation GPON is between the access device and the central device, the central device is an optical line terminal (OLT), the access device is an optical network unit (ONU), and the layer 2 protocol packet is an optical network terminal (ONT) management and control interface (OMCI) protocol packet; wherein the OMCI protocol packet carries a uniform resource identifier (URI) of a configuration file, and the OMCI protocol packet comprises a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and the obtaining, by the access device, flow table information according to the layer 2 protocol packet comprises: when the access device determines that the OMCI protocol packet carries the second message identifier, accessing, by the access device, the configuration file according to the URI, to obtain the flow table information from the configuration file.

2. The method according to claim 1, wherein the OMCI protocol packet carries an OpenFlow message, wherein the OpenFlow message carries the flow table information, and the OMCI protocol packet comprises a first message identifier, wherein the first message identifier is used to identify that the OMCI protocol packet carries the OpenFlow message; and the obtaining, by the access device, flow table information according to the layer 2 protocol packet comprises: when the access device determines that the OMCI protocol packet carries the first message identifier, obtaining, by the access device, the flow table information according to the OpenFlow message carried in the OMCI protocol packet.

3. The method according to claim 1, wherein the configuration file further comprises line management information, where the line management information comprises: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the method further comprises: accessing, by the access device, the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file.

4. The method according to claim 1, wherein when an Ethernet passive optical network EPON or a next-generation EPON is between the access device and the central device, the central device is an OLT, the access device is an ONU, and the layer 2 protocol packet is an Ethernet packet.

5. The method according to claim 1, wherein when either of an Ethernet network and an IP network is between the access device and the central device, the central device is either of an edge device of the IP network and an OLT, the access device is a digital subscriber line access multiplexer DSLAM, and the layer 2 protocol packet is an Ethernet packet.

6. The method according to claim 4, wherein a payload part of the Ethernet packet carries an OpenFlow message, and the Ethernet packet comprises a third message identifier, wherein the third message identifier is used to identify that the Ethernet packet carries the OpenFlow message; and the obtaining, by the access device, flow table information according to the Ethernet packet comprises: when the access device determines that the Ethernet packet carries the third message identifier, obtaining, by the access device, the flow table information according to the OpenFlow message carried in the payload part of the Ethernet packet.

7. The method according to claim 4, wherein the Ethernet packet carries a URI of a configuration file, and the Ethernet packet comprises a fourth message identifier, wherein the fourth message identifier is used to identify that the Ethernet packet carries the URI, and the obtaining, by the access device, flow table information according to the layer 2 protocol packet comprises: when the access device determines that the Ethernet packet carries the fourth message identifier, accessing, by the access device, the configuration file according to the URI, carried in the Ethernet packet, of the configuration file, to obtain the flow table information from the configuration file.

8. The method according to claim 7, wherein the configuration file further comprises line management information, wherein the line management information comprises: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the method further comprises: accessing, by the access device, the configuration file according to the URI carried in the Ethernet packet, to obtain the line management information from the configuration file.

9. An access device in an access network, wherein the access device comprises: a memory to store instructions; and a processor to execute the instructions to cause the access device to: receive a layer 2 protocol packet sent by a central device, wherein a destination address of the layer 2 protocol packet is a Media Access Control (MAC) address of the access device, the access device is configured to connect to user equipment, and the central device is configured to connect the access device to an Internet Protocol (IP) network; wherein when a gigabit passive optical network (GPON) or a next-generation GPON is between the access device and the central device, the central device is an optical line terminal (OLT), the access device is an optical network unit (ONU), and the layer 2 protocol packet is an optical network terminal (ONT) management and control interface (OMCI) protocol packet; wherein the OMCI protocol packet carries a uniform resource identifier (URI) of a configuration file, and the OMCI protocol packet comprises a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and when the access device determines that the OMCI protocol packet carries the second message identifier, access the configuration file according to the URI, to obtain flow table information from the configuration file; obtain the flow table information according to the layer 2 protocol packet received by the receiving unit, wherein the flow table information comprises a match field and an instruction, and generate a flow table entry according to the flow table information, wherein the flow table entry comprises the match field and the instruction; receive a service packet sent by the user equipment; and determine a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, process the service packet according to the instruction in the generated flow table entry.

10. The access device according to claim 9, wherein the OMCI protocol packet carries an OpenFlow message, wherein the OpenFlow message carries the flow table information, and the OMCI protocol packet comprises a first message identifier, wherein the first message identifier is used to identify that the OMCI protocol packet carries the OpenFlow message; and the access device is configured to: when it is determined that the OMCI protocol packet carries the first message identifier, obtain the flow table information according to the OpenFlow message carried in the OMCI protocol packet.

11. The access device according to claim 9, wherein the configuration file further comprises line management information, wherein the line management information comprises: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the access device is further configured to access the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file.

12. The access device according to claim 9, wherein when an Ethernet passive optical network (EPON) or a next-generation EPON is between the access device and the central device, the central device is an OLT, the access device is an ONU, and the layer 2 protocol packet received by the access device is an Ethernet packet.

13. The access device according to claim 9, wherein when either of an Ethernet network and an IP network is between the access device and the central device, the central device is either of an edge device of the IP network and an OLT, the access device is a digital subscriber line access multiplexer (DSLAM), and the layer 2 protocol packet received by the access device is an Ethernet packet.

14. A central device in an access network, wherein the central device comprises: a memory to store instructions; and a processor to execute the instructions to cause the central device to: generate a layer 2 protocol packet, wherein a destination address of the layer 2 protocol packet is a Media Access Control (MAC) address of an access device, the layer 2 protocol packet carries flow table information, the central device is configured to connect the access device to an Internet Protocol IP network, and the access device is configured to connect to user equipment; wherein when a gigabit passive optical network (GPON) or a next-generation GPON is between the access device and the central device, the central device is an optical line terminal (OLT), the access device is an optical network unit (ONU), and the layer 2 protocol packet is an optical network terminal (ONT) management and control interface (OMCI) protocol packet; wherein the OMCI protocol packet carries a uniform resource identifier (URI) of a configuration file, and the OMCI protocol packet comprises a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and when the access device determines that the OMCI protocol packet carries the second message identifier, access the configuration file according to the URI, to obtain the flow table information from the configuration file; and send the layer 2 protocol packet generated by the central device to the access device.

15. The central device according to claim 14, wherein when an Ethernet passive optical network (EPON) or a next-generation EPON is between the access device and the central device, the central device is an OLT, the access device is an ONU, and the layer 2 protocol packet is an Ethernet packet, wherein a payload part of the Ethernet packet carries an OpenFlow message, and the OpenFlow message carries the flow table information.

Description

BRIEF DESCRIPTION OF DRAWINGS

(1) To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show some embodiments of the present invention, and persons of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.

(2) FIG. 1 is a schematic diagram of a network architecture of an optical access network in the prior art;

(3) FIG. 2 is a schematic flowchart of a method for processing a packet in an access network according to an embodiment of the present invention;

(4) FIG. 3 is a schematic diagram of an interaction process between an ONU and an OLT according to an embodiment of the present invention;

(5) FIG. 3a is a schematic diagram of a format of an OMCI protocol packet according to an embodiment of the present invention;

(6) FIG. 4 is a schematic diagram of an interaction process between an ONU and an OLT according to an embodiment of the present invention;

(7) FIG. 5 is a schematic diagram of an interaction process between an ONU and an OLT according to an embodiment of the present invention;

(8) FIG. 6 is a schematic diagram of an interaction process between an ONU and an OLT according to an embodiment of the present invention;

(9) FIG. 7a is a schematic diagram of a format of an Ethernet packet according to an embodiment of the present invention;

(10) FIG. 7b is a schematic diagram of a format of an Ethernet packet according to an embodiment of the present invention;

(11) FIG. 8 is a schematic diagram of an interaction process between a DSLAM and an OLT according to an embodiment of the present invention;

(12) FIG. 9 is a schematic diagram of an interaction process between a DSLAM and an OLT according to an embodiment of the present invention;

(13) FIG. 10 is a schematic structural diagram of an access device according to an embodiment of the present invention;

(14) FIG. 11 is a schematic structural diagram of an access device according to an embodiment of the present invention;

(15) FIG. 12 is a schematic structural diagram of a central device according to an embodiment of the present invention; and

(16) FIG. 13 is a schematic structural diagram of a central device according to an embodiment of the present invention.

DESCRIPTION OF EMBODIMENTS

(17) To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following clearly describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are a part rather than all of the embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

(18) Referring to FIG. 2, an embodiment of the present invention provides a method for processing a packet in an access network. The method includes:

(19) 201: An access device receives a layer 2 protocol packet sent by a central device, where a destination address of the layer 2 protocol packet is a MAC address of the access device, the access device is configured to connect to user equipment, and the central device is configured to connect the access device to an IP network.

(20) 202: The access device obtains flow table information according to the layer 2 protocol packet, where the flow table information includes a match field and an instruction, and the access device generates a flow table entry according to the flow table information, where the flow table entry includes the match field and the instruction.

(21) 203: The access device receives a service packet sent by the user equipment.

(22) 204: The access device determines a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processes the service packet according to the instruction in the generated flow table entry.

(23) Optionally, the flow table information may be layer 2 forwarding table information or layer 3 forwarding table information, or may be flow table information defined in the OpenFlow protocol; correspondingly, the flow table entry that is generated by the access device according to the flow table information may be a layer 2 forwarding entry, a layer 3 forwarding entry, or a flow table entry defined in the OpenFlow. The flow table entry is used by the user equipment to access the IP network by using the access device.

(24) Optionally, when a GPON or a next-generation GPON is between the access device and the central device, the central device is an OLT, the access device is an ONU, and the layer 2 protocol packet is an OMCI protocol packet.

(25) Optionally, the OMCI protocol packet carries an OpenFlow message, where the OpenFlow message carries the flow table information, and the OMCI protocol packet includes a first message identifier, where the first message identifier is used to identify that the OMCI protocol packet carries the OpenFlow message; and the obtaining, by the access device, flow table information according to the layer 2 protocol packet includes:

(26) when the access device determines that the OMCI protocol packet carries the first message identifier, obtaining, by the access device, the flow table information according to the OpenFlow message carried in the OMCI protocol packet, where the OpenFlow message may be an OpenFlow message of a controller-to-switch type, and for the OpenFlow message of a controller-to-switch type, reference may be made to the OpenFlow Switch Specification Version 1.0.0 released by the Open Networking Foundation (Open Networking Foundation, ONF).

(27) Referring to FIG. 3, FIG. 3 is a schematic diagram of an interaction process between the ONU and the OLT when the ONU obtains the flow table information by using the OMCI protocol packet. The interaction process includes the following steps:

(28) 301: The OLT generates a first OpenFlow management entity (Management Entity, ME). The first OpenFlow ME is configured to manage a flow table, and the OLT generates the OMCI protocol packet by using the first OpenFlow ME. A format of the first OpenFlow ME is as follows:

(29) attribute field (Attributes):

(30) an ME identifier (ID), used to identify the first OpenFlow ME;

(31) an OpenFlow version (Version), used to identify an OpenFlow version number of the OpenFlow message; and

(32) an OpenFlow Message, used to carry the OpenFlow message; and

(33) action field (Actions):

(34) create (Create), used to create the first OpenFlow ME or create an attribute of the first OpenFlow ME;

(35) delete (Delete), used to delete the first OpenFlow ME or an attribute of the first OpenFlow ME;

(36) get (Get), used to get all attributes of the first OpenFlow ME or an attribute of the first OpenFlow ME; and

(37) set (Set), used to set all attributes of the first OpenFlow ME or an attribute of the first OpenFlow ME.

(38) The OMCI protocol packet includes the OpenFlow version number of the OpenFlow message and the OpenFlow message, the first message identifier of the OMCI protocol packet is generated according to the ME ID of the first OpenFlow ME, and a specific generation manner is not limited in this embodiment of the present invention. A packet format of the OMCI protocol packet is shown in FIG. 3a, and the OMCI protocol packet includes:

(39) a GPON encapsulation method (GPON Encapsulation Method, GEM) message header field, a transaction correlation identifier (Transaction correlation identifier) field, a message type (Message type) field, a device identifier (Device identifier) field, a message identifier (Message identifier) field, a message content (Message contents) field, and an OMCI trailer (OMCI trailer) field. For specific meanings of the fields, refer to G.984.4(06/2004) of the International Telecommunication Union Telecommunication Standardization Sector (International Telecommunication Union Telecommunication Standardization Sector, ITU-T). In this embodiment of the present invention, the Message identifier of the OMCI protocol packet carries the first message identifier, and the Message contents in the OMCI protocol packet carries the OpenFlow message.

(40) 302: The OLT sends the OMCI protocol packet to the ONU.

(41) 303: The ONU obtains the OpenFlow message from the OMCI protocol packet, to further obtain the flow table information.

(42) 304: The ONU generates the flow table entry according to the flow table information.

(43) After generating the flow table entry, the ONU may forward, according to the flow table entry, the service packet received from the user equipment. According to the foregoing process, the ONU can still obtain the flow table information from the central device without the need of independently configuring a public IP address for the ONU, so as to implement that the user equipment is connected to an IP network by using the ONU, and a forwarding entry no longer needs to be independently configured, which helps simplify management and maintenance of the ONU.

(44) Optionally, after step 304, the interaction process may further include:

(45) feeding back, by the ONU, a flow table entry generation result to the OLT by using the OMCI protocol, so that the OLT determines whether to repeatedly send the OMCI protocol packet including the flow table information to the ONU.

(46) Optionally, the OMCI protocol packet carries a URI of a configuration file, and the OMCI protocol packet includes a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI, and the obtaining, by the access device, flow table information according to the layer 2 protocol packet includes:

(47) when the access device determines that the OMCI protocol packet carries the second message identifier, accessing, by the access device, the configuration file according to the URI, to obtain the flow table information from the configuration file.

(48) Referring to FIG. 4, FIG. 4 is a schematic diagram of an interaction process between the ONU and the OLT when the ONU obtains the flow table information from the configuration file, when the OMCI protocol packet carries the URI of the configuration file. The interaction process includes the following steps:

(49) 401: The OLT stores the flow table information in the configuration file. The configuration file may be stored in a specific network device, and in this embodiment of the present invention, an example in which the configuration file is stored in the OLT is used. The configuration file may further be stored in a network management device or a server.

(50) 402: The OLT generates a second OpenFlow ME, where the OpenFlow ME is configured to manage the configuration file, and the OLT generates the OMCI protocol packet by using the second OpenFlow ME. The OLT sends, by using the OMCI protocol, the URI corresponding to the configuration file to the ONU. A format of the second OpenFlow ME is as follows:

(51) attribute field (Attributes):

(52) an ME identifier (ID), used to identify the second OpenFlow ME; and

(53) a URI field, used to identify the URI corresponding to the configuration file; and

(54) action field (Actions):

(55) create (Create), used to create the second OpenFlow ME or create an attribute of the second OpenFlow ME;

(56) delete (Delete), used to delete the second OpenFlow ME or an attribute of the second OpenFlow ME;

(57) get (Get), used to get all attributes of the second OpenFlow ME or an attribute of the second OpenFlow ME; and

(58) set (Set), used to set all attributes of the second OpenFlow ME or an attribute of the second OpenFlow ME.

(59) The OMCI protocol packet includes the URI field of the second OpenFlow ME, the second message identifier of the OMCI protocol packet is generated according to the ME ID of the second OpenFlow ME, and a specific generation manner is not limited in this embodiment of the present invention.

(60) In this embodiment of the present invention, when the OMCI protocol packet carries the URI of the configuration file, the Message identifier in the OMCI protocol packet carries the second message identifier, and the Message contents in the OMCI protocol packet carries the URI.

(61) 403: The ONU acquires, by using the OMCI protocol, the URI corresponding to the configuration file.

(62) 404: The ONU accesses the configuration file by using the URI. When the configuration file is stored in the OLT, the ONU accesses the configuration file in the OLT by using the URI; when the configuration file is stored in another network device, the ONU accesses the another network device by using the URI to acquire the configuration file.

(63) 405: The OLT delivers the configuration file to the ONU.

(64) 406: The ONU obtains the flow table information according to the configuration file, and generates a flow table entry.

(65) According to the foregoing technical solution, an access device receives a layer 2 protocol packet sent by a central device, obtains flow table information by using the layer 2 protocol packet, and generates a flow table entry. An ONU can obtain the flow table information from the central device without the need of independently configuring a public IP address for the ONU and without the need of operating Transmission Control Protocol/Internet Protocol (Transmission Control Protocol/Internet Protocol, TCP/IP), so as to help implement that user equipment accesses an IP network by using the access device, avoiding a waste of a public IP address; moreover, an OLT controls delivery of all flow table information together, and the ONU does not need to independently configure a flow table entry, which helps simplify management and maintenance of the ONU.

(66) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the method further includes:

(67) accessing, by the access device, the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file, where the access device acquires the line management information from the configuration file, which avoids a technical problem in the prior art that multiple MEs need to be generated when the central device needs to deliver the line management information including multiple pieces of parameter information and that causes management and maintenance difficulties.

(68) Referring to FIG. 5, FIG. 5 is a schematic diagram of an interaction process between the ONU and the OLT when the ONU obtains the line management information by using the layer 2 protocol packet. The interaction process includes the following steps:

(69) 501: The OLT stores the line management information in the configuration file. The configuration file may be stored in a specific network device, and in this embodiment of the present invention, an example in which the configuration file is stored in the OLT is used. The configuration file may further be stored in a network management device or a server.

(70) 502: The OLT sends, by using the layer 2 protocol, the URI corresponding to the configuration file to the ONU.

(71) 503: The ONU acquires, by using the layer 2 protocol, the URI corresponding to the configuration file.

(72) 504: The ONU accesses the configuration file by using the URI. When the configuration file is stored in the OLT, the ONU accesses the configuration file in the OLT by using the URI; when the configuration file is stored in another network device, the ONU accesses the another network device by using the URI to acquire the configuration file.

(73) 505: The OLT delivers the configuration file to the ONU.

(74) 506: The ONU configures a corresponding line parameter according to the configuration file. The line management information is stored in the configuration file, and the ONU configures the access device according to the line management information, to configure and manage the access line.

(75) Optionally, when an EPON or a next-generation EPON is between the access device and the central device, the central device is an OLT, the access device is an ONU, and the layer 2 protocol packet is an Ethernet Ethernet packet.

(76) Optionally, a payload part of the Ethernet packet carries an OpenFlow message, and the Ethernet packet includes a third message identifier, where the third message identifier is used to identify that the Ethernet packet carries the OpenFlow message, and the obtaining, by the access device, flow table information according to the Ethernet packet includes:

(77) when the access device determines that the Ethernet packet carries the third message identifier, obtaining, by the access device, the flow table information according to the OpenFlow message carried in the payload part of the Ethernet packet, where the OpenFlow message is transmitted directly as a payload of the Ethernet packet, and IP packet encapsulation is no longer performed on the Ethernet packet.

(78) Referring to FIG. 6, FIG. 6 is a schematic diagram of an interaction process between the ONU and the OLT when the ONU obtains the flow table information by using the layer 2 protocol packet. The interaction process includes the following steps:

(79) 601: The OLT generates the Ethernet packet, where the payload part of the Ethernet packet carries the OpenFlow message.

(80) 602: The OLT sends the Ethernet packet to the ONU.

(81) 603: The ONU obtains the OpenFlow message from the Ethernet packet, to further obtain the flow table information.

(82) 604: The ONU generates the flow table entry according to the flow table information.

(83) Optionally, after step 604, the interaction process may further include:

(84) feeding back, by the ONU, a flow table entry generation result to the OLT by using the Ethernet packet, so that the OLT determines whether to repeatedly send the Ethernet packet including the flow table information to the ONU.

(85) Referring to FIG. 7a, FIG. 7a shows a format of the Ethernet packet, where the Ethernet packet includes:

(86) a destination Media Access Control (Media Access Control, MAC) address (Destination MAC Address) field, used to carry a MAC address of the access device;

(87) a source MAC address (Source MAC Address) field, used to carry a MAC address of the central device;

(88) an Ethernet Type (Ethernet Type) field, used to identify that the Ethernet packet is a slow protocol packet, where

(89) the Ethernet Type field may be set to 88-09;

(90) a code (Code) field, used to identify that the Ethernet packet carries the OpenFlow message, where the Code field may be set to 0xFE;

(91) an OpenFlow version (OpenFlow Version) field, used to identify a version type of the OpenFlow message;

(92) an OpenFlow message (OpenFlow message) field, used to carry the OpenFlow message; and

(93) a frame check sequence (Frame Check Sequence, FCS) field, used to perform frame check on the Ethernet packet.

(94) The Code field is used to carry the third message identifier, where the third message identifier may be set to 0xFE.

(95) Optionally, FIG. 7a shows the Ethernet packet, where the packet may further include:

(96) a subtype (Subtype) field, used to identify that the Ethernet packet is an Operation, Administration and Maintenance (OAM) packet.

(97) Optionally, in the Ethernet packet shown in FIG. 7a, a Subtype field may further be used to identify that the Ethernet packet carries the OpenFlow message, the Subtype field may be set to 0xFE, and in this case, a value of the Code field may not be limited. The Subtype field may carry the third message identifier, and the third message identifier may be set to 0xFE.

(98) Optionally, in the Ethernet packet shown in FIG. 7a, the Ethernet Type field may further be used to identify that the Ethernet packet carries the OpenFlow message, and a value of the Ethernet Type field may be 0x88b5, 0x88b6, or 0x88b7. The Ethernet Type field may carry the third message identifier, and the third message identifier may be set to 0x88b5, 0x88b6, or 0x88b7.

(99) Optionally, the Ethernet packet carries a URI of a configuration file, and the Ethernet packet includes a fourth message identifier, where the fourth message identifier is used to identify that the Ethernet packet carries the URI, and the obtaining, by the access device, flow table information according to the layer 2 protocol packet includes:

(100) when the access device determines that the Ethernet packet carries the fourth message identifier, accessing, by the access device, the configuration file according to the URI, carried in the Ethernet packet, of the configuration file, to obtain the flow table information from the configuration file.

(101) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the method further includes:

(102) accessing, by the access device, the configuration file according to the URI carried in the Ethernet packet, to obtain the line management information from the configuration file.

(103) Optionally, when an Ethernet network or an IP network is between the access device and the central device, the central device is an edge device of the IP network or an OLT, the access device is a digital subscriber line access multiplexer DSLAM, and the layer 2 protocol packet is an Ethernet packet. The format of the Ethernet packet is already described in FIG. 7a, and is not described herein again.

(104) When the Ethernet packet carries the URI of the configuration file, for the format of the Ethernet packet, refer to FIG. 7b, where:

(105) a destination Media Access Control (Media Access Control, MAC) address (Destination MAC Address) field, used to carry a MAC address of the access device;

(106) a source MAC address (Source MAC Address) field, used to carry a MAC address of the central device;

(107) an Ethernet Type (Ethernet Type) field, used to identify that the Ethernet packet is a slow protocol packet, where

(108) the Ethernet Type field may be set to 88-09;

(109) a code (Code) field, used to identify that the Ethernet packet carries the URI corresponding to the configuration file, where the Code field may be set to 0xFE;

(110) a URI field, used to carry the URI of the configuration file; and

(111) a frame check sequence (Frame Check Sequence, FCS) field, used to perform frame check on the Ethernet packet.

(112) The Code field is used to carry the fourth message identifier, where the fourth message identifier may be set to 0xFE.

(113) Optionally, in the Ethernet packet shown in FIG. 7b, the Subtype field may further be used to identify that the Ethernet packet carries the URI corresponding to the configuration file, where the Subtype field may be set to 0xFE. The Subtype field may carry the fourth message identifier, and the fourth message identifier may be set to 0xFE.

(114) Optionally, in the Ethernet packet shown in FIG. 7b, the Ethernet Type field may further be used to identify that the Ethernet packet carries the URI corresponding to the configuration file, and a value of the Ethernet Type field may be 0x88b5, 0x88b6, or 0x88b7. The Ethernet Type field may carry the fourth message identifier, and the fourth message identifier may be set to 0x88b5, 0x88b6, or 0x88b7.

(115) Referring to FIG. 8, FIG. 8 is a schematic diagram of an interaction process between the DSLAM and the OLT when the ONU obtains the flow table information by using the layer 2 protocol packet. The interaction process includes the following steps:

(116) 801: The OLT generates the Ethernet packet, where the Ethernet packet directly carries the OpenFlow message.

(117) 802: The OLT sends the Ethernet packet to the DSLAM.

(118) 803: The DSLAM obtains the OpenFlow message from the Ethernet packet, to further obtain the flow table information.

(119) 804: The DSLAM generates a flow table entry according to the flow table information.

(120) Optionally, after step 804, the interaction process may further include:

(121) feeding back, by the DSLAM, a flow table entry generation result to the OLT by using the Ethernet packet, so that the OLT determines whether to repeatedly send the Ethernet packet including the flow table information to the DSLAM.

(122) In the embodiment shown in FIG. 8, that the access device is a DSLAM and the central device is an OLT is only used as an example for description. Alternatively, the access device may be a Cable Modem Termination System (CMTS) or a switch device, and the central device may be an edge device of an IP network, for example, a common router or a Broadband Remote Access Server (BRAS).

(123) Optionally, the Ethernet packet carries the URI of the configuration file, and the obtaining, by the DSLAM, the flow table information according to the Ethernet packet includes:

(124) accessing, by the access device, the configuration file according to the URI, carried in the Ethernet packet, of the configuration file, to obtain the flow table information from the configuration file.

(125) Referring to FIG. 9, FIG. 9 is a schematic diagram of an interaction process between the DSLAM and the OLT when the DSLAM obtains the line management information by using the Ethernet packet. The interaction process includes the following steps:

(126) 901: The OLT stores the line information in the configuration file. In this embodiment of the present invention, an example in which the configuration file is stored in the OLT is used. The configuration file may further be stored in a network management device or a server.

(127) 902: The OLT sends, by using the Ethernet packet, the URI corresponding to the configuration file to the DSLAM.

(128) 903: The DSLAM acquires, by using the Ethernet packet, the URI corresponding to the configuration file.

(129) 904: The DSLAM accesses the configuration file by using the URI. When the configuration file is stored in the OLT, the DSLAM accesses the configuration file in the OLT by using the URI; when the configuration file is stored in another network device, the DSLAM accesses the another network device by using the URI to acquire the configuration file.

(130) 905: The OLT delivers the configuration file to the DSLAM.

(131) 906: The DSLAM configures a corresponding line parameter according to the configuration file. The line management information is stored in the configuration file, and the DSLAM configures the access device according to the line management information, to configure and manage the access line.

(132) A format of the Ethernet packet is the same as the format of the Ethernet packet shown in FIG. 7a or FIG. 7b, and is not described herein again.

(133) According to the foregoing technical solution, an access device generates a flow table entry by receiving a layer 2 protocol packet sent by a central device. The access device can obtain flow table information from the central device without the need of configuring a public IP address for the access device and without the need of operating TCP/IP, so as to help implement that user equipment accesses an IP network by using the access device, avoiding a waste of a public IP address; moreover, the central device controls delivery of all flow table information together, and it is unnecessary to independently configure a flow table entry for the access device, which helps simplify management and maintenance of the access device.

(134) Referring to FIG. 10, an embodiment of the present invention further provides an access device 1000 in an access network. The access device 1000 may be the access device in the method shown in FIG. 2. The access device 1000 includes:

(135) a receiving unit 1001, configured to receive a layer 2 protocol packet sent by a central device, where a destination address of the layer 2 protocol packet is a Media Access Control MAC address of the access device 1000, the access device 1000 is configured to connect to user equipment, and the central device is configured to connect the access device 1000 to an IP network;

(136) a generation unit 1002, configured to obtain flow table information according to the layer 2 protocol packet received by the receiving unit 1001, where the flow table information includes a match field and an instruction, and generate a flow table entry according to the flow table information, where the flow table entry includes the match field and the instruction, where

(137) the receiving unit 1001 is further configured to receive a service packet sent by the user equipment; and

(138) a processing unit 1003, configured to determine a matching flow table entry according to the service packet received by the receiving unit 1001, and when the matching flow table entry is the generated flow table entry, process the service packet according to the instruction in the generated flow table entry.

(139) Optionally, when a GPON or a next-generation GPON is between the access device 1000 and the central device, the central device is an OLT, the access device 1000 is an ONU, and the layer 2 protocol packet received by the receiving unit 1001 is an OMCI protocol packet.

(140) Optionally, the OMCI protocol packet received by the receiving unit 1001 carries an OpenFlow message, where the OpenFlow message carries the flow table information, and the OMCI protocol packet includes a first message identifier, where the first message identifier is used to identify that the OMCI protocol packet carries the OpenFlow message; and the generation unit is specifically configured to: when it is determined that the OMCI protocol packet carries the first message identifier, obtain the flow table information according to the OpenFlow message carried in the OMCI protocol packet.

(141) Optionally, the OMCI protocol packet received by the receiving unit 1001 carries a URI of a configuration file, and the OMCI protocol packet includes a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and the generation unit is specifically configured to: when it is determined that the OMCI protocol packet carries the second message identifier, access, by the access device 1000, the configuration file according to the URI, to obtain the flow table information from the configuration file.

(142) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device 1000 and a physical layer parameter of the access line, and the line management information is used by the access device 1000 to configure and manage the access line; and the access device 1000 further includes:

(143) an acquiring unit, configured to access the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file.

(144) For the OMCI protocol packet, reference may be made to FIG. 3a. The OMCI protocol packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(145) Optionally, when an Ethernet passive optical network EPON or a next-generation EPON is between the access device 1000 and the central device, the central device is an OLT, the access device 1000 is an ONU, and the layer 2 protocol packet received by the receiving unit is an Ethernet packet.

(146) Optionally, when either of an Ethernet network and an IP network is between the access device 1000 and the central device, the central device is either of an edge device of the IP network and an OLT, the access device 1000 is a DSLAM, and the layer 2 protocol packet received by the receiving unit is an Ethernet packet.

(147) Optionally, a payload part of the Ethernet packet carries an OpenFlow message, and the Ethernet packet includes a third message identifier, where the third message identifier is used to identify that the Ethernet packet carries the OpenFlow message; and the generation unit 1002 is specifically configured to obtain flow table information according to the OpenFlow message carried in the payload part of the Ethernet packet.

(148) Optionally, the Ethernet packet carries a uniform resource identifier URI of a configuration file, and the Ethernet packet includes a fourth message identifier, where the fourth message identifier is used to identify that the Ethernet packet carries the URI; and the generation unit 1002 is specifically configured to: when it is determined that the Ethernet packet carries the fourth message identifier, access the configuration file according to the URI, carried in the Ethernet packet, of the configuration file, to obtain the flow table information from the configuration file.

(149) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device 1000 and a physical layer parameter of the access line, and the line management information is used by the access device 1000 to configure and manage the access line; and the access device 1000 further includes:

(150) an acquiring unit, configured to access the configuration file according to the URI carried in the Ethernet packet, to obtain the line management information from the configuration file.

(151) For the Ethernet packet, reference may be made to FIG. 7a and FIG. 7b. The Ethernet packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(152) Optionally, the access device 1000 may further be a cable modem termination system (Cable Modem Termination System, CMTS), a cable modem (Cable Modem, CM) device, a converged cable access platform (Converged Cable Access Platform, CCAP) device, or a switch device.

(153) According to the foregoing technical solution, the access device 1000 receives a layer 2 protocol packet sent by a central device, obtains flow table information by using the layer 2 protocol packet, and generates a flow table entry. The access device 1000 can obtain the flow table information from the central device without the need of independently configuring a public IP address for the access device 1000 and without the need of operating TCP/IP, so as to help implement that user equipment accesses an IP network by using the access device 1000, avoiding a waste of a public IP address; moreover, the central device controls delivery of all flow table information together, and it is unnecessary to independently configure a flow table entry for the access device 1000, which helps simplify management and maintenance of the ONU.

(154) Referring to FIG. 11, an embodiment of the present invention further provides an access device 1100. The access device 1100 may be the access device in the method shown in FIG. 2. The access device 1100 includes: a memory 1101, a receiver 1102, and a processor 1103 separately connected to the memory 1101 and the receiver 1102. The memory 1101 is configured to store a group of program instructions, and the processor 1103 is configured to invoke the program instructions stored in the memory 1101, to perform the following operations:

(155) triggering the receiver 1102 to receive a layer 2 protocol packet sent by a central device, where a destination address of the layer 2 protocol packet is a MAC address of the access device 1100, the access device 1100 is configured to connect to user equipment, and the central device is configured to connect the access device 1100 to an IP network;

(156) obtaining flow table information according to the layer 2 protocol packet received by the receiver 1102, where the flow table information includes a match field and an instruction, and generating a flow table entry according to the flow table information, where the flow table entry includes the match field and the instruction;

(157) triggering the receiver 1102 to receive a service packet sent by the user equipment; and

(158) determining a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processing the service packet according to the instruction in the generated flow table entry.

(159) Optionally, when a GPON or a next-generation GPON is between the access device 1100 and the central device, the central device is an OLT, the access device 1100 is an ONU, and the layer 2 protocol packet received by the receiver 1102 is an OMCI protocol packet.

(160) Optionally, the OMCI protocol packet received by the receiver 1102 carries an OpenFlow message, where the OpenFlow message carries the flow table information, and the OMCI protocol packet includes a first message identifier, where the first message identifier is used to identify that the OMCI protocol packet carries the OpenFlow message; and the processor 1103 is specifically configured to: when it is determined that the OMCI protocol packet carries the first message identifier, obtain the flow table information according to the OpenFlow message carried in the OMCI protocol packet.

(161) Optionally, the OMCI protocol packet received by the receiver 1102 carries a URI of a configuration file, and the OMCI protocol packet includes a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and the processor 1103 is specifically configured to: when it is determined that the OMCI protocol packet carries the second message identifier, access the configuration file according to the URI, to obtain the flow table information from the configuration file.

(162) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line; and the processor 1103 is further configured to access the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file.

(163) For the OMCI protocol packet, reference may be made to FIG. 3a. The OMCI protocol packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(164) Optionally, when an EPON or a next-generation EPON is between the access device 1100 and the central device, the central device is an OLT, the access device 1100 is an ONU, and the layer 2 protocol packet received by the receiver 1102 is an Ethernet packet.

(165) Optionally, when either of an Ethernet network and an IP network is between the access device 1100 and the central device, the central device 1100 is either of an edge device of the IP network and an OLT, the access device 1100 is a DSLAM, and the layer 2 protocol packet received by the receiver 1102 is an Ethernet packet.

(166) Optionally, a payload part of the Ethernet packet carries an OpenFlow message, and the Ethernet packet includes a third message identifier, where the third message identifier is used to identify that the Ethernet packet carries the OpenFlow message; and the processor 1103 is specifically configured to obtain flow table information according to the OpenFlow message carried in the payload part of the Ethernet packet.

(167) Optionally, the Ethernet packet carries a URI of a configuration file, and the Ethernet packet includes a fourth message identifier, where the fourth message identifier is used to identify that the Ethernet packet carries the URI; and the processor 1103 is specifically configured to: when it is determined that the Ethernet packet carries the fourth message identifier, access, by the access device 1100, the configuration file according to the URI, carried in the Ethernet packet, of the configuration file, to obtain the flow table information from the configuration file.

(168) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device 1100 and a physical layer parameter of the access line, and the line management information is used by the access device 1100 to configure and manage the access line; and the processor 1103 of the access device is further configured to access the configuration file according to the URI carried in the Ethernet packet, to obtain the line management information from the configuration file.

(169) For the Ethernet packet, reference may be made to FIG. 7a and FIG. 7b. The Ethernet packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(170) Optionally, the processor 1103 may be a CPU, the memory 1101 may be an internal memory of an RAM type, and the receiver 1102 may include a common physical interface, where the physical interface may be an Ethernet interface or an ATM interface. The processor 1103, the receiver 1102, and the memory 1101 may be integrated into one or more independent circuits or one or more pieces of independent hardware, for example, an ASIC.

(171) Optionally, the access device 1100 may further be a cable modem termination system (Cable Modem Termination System, CMTS), a cable modem (Cable Modem, CM) device, a converged cable access platform (Converged Cable Access Platform, CCAP) device, or a switch device.

(172) According to the foregoing technical solution, the access device 1100 generates a flow table entry by receiving a layer 2 protocol packet sent by a central device. The access device 1100 can obtain flow table information from the central device without the need of configuring a public IP address for the access device 1100 and without the need of operating TCP/IP, so as to help implement that user equipment accesses an IP network by using the access device 1100, avoiding a waste of a public IP address; moreover, the central device controls delivery of all flow table information together, and it is unnecessary to independently configure a flow table entry for the access device 1000, which helps implement management and maintenance of the access device 1100.

(173) Referring to FIG. 12, an embodiment of the present invention further provides a central device 1200 in an access network. The central device 1200 may be the central device in the method shown in FIG. 2. The central device 1200 includes:

(174) a generation unit 1201, configured to generate a layer 2 protocol packet, where a destination address of the layer 2 protocol packet is a MAC address of an access device, the layer 2 protocol packet carries flow table information, the central device 1200 is configured to connect the access device to an IP network, and the access device is configured to connect to user equipment; and

(175) a sending unit 1202, configured to send the layer 2 protocol packet generated by the generation unit to the access device.

(176) Optionally, when a GPON or a next-generation GPON is between the access device and the central device 1200, the central device 1200 is an OLT, the access device is an ONU, and the layer 2 protocol packet is an OMCI protocol packet, where the OMCI protocol packet carries an OpenFlow message, and the OpenFlow message carries the flow table information.

(177) For the OMCI protocol packet, reference may be made to FIG. 3a. The OMCI protocol packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(178) Optionally, when an EPON or a next-generation EPON is between the access device and the central device 1200, the central device 1200 is an OLT, the access device is an ONU, and the layer 2 protocol packet is an Ethernet packet, where a payload part of the Ethernet packet carries an OpenFlow message.

(179) Optionally, the OMCI protocol packet carries a URI of a configuration file, and the configuration file includes the flow table information.

(180) For the Ethernet packet, reference may be made to FIG. 7a and FIG. 7b. The Ethernet packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(181) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line. The access device may access the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file. The access device acquires the line management information from the configuration file, which avoids a technical problem in the prior art that multiple MEs need to be generated when the central device needs to deliver the line management information including multiple pieces of parameter information, and that causes management and maintenance difficulties.

(182) According to the foregoing technical solution, the central device 1200 generates a layer 2 protocol packet, where the layer 2 protocol packet carries flow table information, and sends the layer 2 protocol packet to an access device. The access device can obtain the flow table information from the central device 1200 without the need of independently configuring a public IP address for the access device, so as to implement that user equipment accesses an IP network by using the access device, avoiding a waste of a public IP address; moreover, the central device 1200 controls delivery of all flow table information together, and it is unnecessary to independently configure a flow table entry for the access device, which helps simplify management and maintenance of the access device.

(183) Referring to FIG. 13, an embodiment of the present invention further provides a central device 1300. The central device 1300 may be the central device in the method shown in FIG. 2. The central device 1300 includes: a memory 1301, a transmitter 1302, and a processor 1303 separately connected to the memory 1301 and the transmitter 1302. The memory 1301 is configured to store a group of program instructions, and the processor 1303 is configured to invoke the program instructions stored in the memory 1301, to perform the following operations:

(184) generating a layer 2 protocol packet, where a destination address of the layer 2 protocol packet is a MAC address of an access device, the layer 2 protocol packet carries flow table information, the central device 1300 is configured to connect the access device to an IP network, and the access device is configured to connect to user equipment; and

(185) triggering the transmitter 1302 to send the layer 2 protocol packet generated by the processor 1303 to the access device.

(186) Optionally, when a GPON or a next-generation GPON is between the access device and the central device 1300, the central device 1300 is an OLT, the access device is an ONU, and the layer 2 protocol packet is an OMCI protocol packet, where the OMCI protocol packet carries an OpenFlow message, and the OpenFlow message carries the flow table information.

(187) For the OMCI protocol packet, reference may be made to FIG. 3a. The OMCI protocol packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(188) Optionally, when an EPON or a next-generation EPON is between the access device and the central device 1300, the central device 1300 is an OLT, the access device is an ONU, and the layer 2 protocol packet is an Ethernet packet, where a payload part of the Ethernet packet carries an OpenFlow message.

(189) Optionally, the OMCI protocol packet carries a URI of a configuration file, and the configuration file includes the flow table information.

(190) For the Ethernet packet, reference may be made to FIG. 7a and FIG. 7b. The Ethernet packet is already described in detail in the foregoing method embodiment, and is not described herein again.

(191) Optionally, the configuration file further includes line management information, where the line management information includes: a type of an access line on a user side of the access device and a physical layer parameter of the access line, and the line management information is used by the access device to configure and manage the access line. The access device may access the configuration file according to the URI of the configuration file, to obtain the line management information from the configuration file. The access device acquires the line management information from the configuration file, which avoids a technical problem in the prior art that multiple MEs need to be generated when the central device needs to deliver the line management information including multiple pieces of parameter information, and that causes management and maintenance difficulties.

(192) According to the foregoing technical solution, the central device 1300 generates a layer 2 protocol packet, where the layer 2 protocol packet carries flow table information, and sends the layer 2 protocol packet to an access device. The access device can obtain the flow table information from the central device 1300 without the need of independently configuring a public IP address for the access device and without the need of operating TCP/IP, so as to help implement that user equipment accesses an IP network by using the access device, avoiding a waste of a public IP address; moreover, the central device 1300 controls delivery of all flow table information together, and it is unnecessary to independently configure a flow table entry for the access device, which helps simplify management and maintenance of the access device.

(193) Optionally, the processor 1303 may be a CPU, the memory 1301 may be an internal memory of an RAM type, and the transmitter 1302 may include a common physical interface, where the physical interface may be an Ethernet interface or an ATM interface. The processor 1303, the transmitter 1302, and the memory 1301 may be integrated into one or more independent circuits or one or more pieces of independent hardware, for example, an ASIC.

(194) Persons of ordinary skill in the art may understand that all or a part of the steps of the method in the embodiments of the present invention may be implemented by a program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program runs, the steps of the method in the embodiments of the present invention are performed. The storage medium may be at least one of the following media: media that are capable of storing program code, such as a Read-Only Memory (Read-Only Memory, ROM for short), a RAM, a magnetic disk, or an optical disc.

(195) Finally, it should be noted that the foregoing embodiments are merely intended for exemplarily describing the technical solutions of the present invention other than limiting the present invention. Although the present invention and benefits of the present invention are described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some technical features thereof, without departing from the scope of the claims of the present invention.