Patent Description:
The present invention relates to communications technologies, and in particular, to a packet processing method, a network node, and a controller.

The Dynamic Host Configuration Protocol (full name in English: Dynamic Host Configuration Protocol, DHCP for short in English) is a dynamic address assignment protocol based on the Transmission Control Protocol/Internet Protocol (full name in English: Transmission Control Protocol/Internet Protocol, TCP/IP for short in English). In an actual application, a DHCP server assigns an Internet Protocol (full name in English: Internet Protocol, IP for short in English) address to a user terminal that serves as a DHCP client, so as to avoid an IP address conflict between different user terminals.

If the user terminal and the DHCP server are located in different physical network segments, a DHCP relay (name in English: relay) device needs to transfer a DHCP packet between the user terminal and the DHCP server. For example, after receiving a Dynamic Host Configuration Protocol discover (name in English: DHCP Discover) packet sent by the user terminal, the DHCP relay device may generate a first DHCP packet and send the first DHCP packet to the DHCP server. The DHCP Discover packet may be used to search for the DHCP server. The first DHCP packet includes a gateway interface IP address and a Media Access Control (full name in English: Media Access Control, MAC for short in English) address of the user terminal. The gateway interface IP address is an IP address of a physical interface through which the DHCP relay device communicates with the user terminal. The DHCP relay device may further send, to the user terminal, a Dynamic Host Configuration Protocol offer (name in English: DHCP Offer) packet from the DHCP server. The DHCP Offer packet includes an IP address provided by the DHCP server to the user terminal. After receiving a Dynamic Host Configuration Protocol request (name in English: DHCP Request) packet sent by the user terminal, the DHCP relay device may generate a second DHCP packet and send the second DHCP packet to the DHCP server. The DHCP relay device may further send, to the user terminal, a Dynamic Host Configuration Protocol acknowledgement (name in English: DHCP ACK) packet from the DHCP server. The DHCP ACK packet includes configuration information of the user terminal. After receiving the DHCP ACK packet, the user terminal may obtain the IP address assigned by the DHCP server to the user terminal.

A network node between the user terminal and the DHCP server needs to support a DHCP relay function, and can generate a DHCP packet. For example, the DHCP relay device may insert information such as the gateway interface IP address into a relay agent information option (name in English: Relay Agent Information Option) field, such as an option <NUM> field, of the received DHCP Discover packet or DHCP Request packet. The network node between the user terminal and the DHCP server further needs to support formats, customized by different operators, of option fields, and the network node between the user terminal and the DHCP server is relatively complex. <CIT> describes a service configuration method which includes steps as follows: configuring a VLAN ID of a port on an intermediate device according to preset configuration information, where the port is connected to a client; after a DHCP request message which is from the client through the intermediate device is received, obtaining a MAC address in the DHCP request message, and obtaining an IP address corresponding to the MAC address from the configuration information; and sending a response message carrying the IP address and the VLAN ID to the client through the intermediate device, so that the client sets a local virtual local area network identifier to the VLAN ID and sets a local IP address to the IP address after receiving the response message.

In view of this, embodiments of the present invention provide a packet processing method, which helps resolve a problem that a network node between a user terminal and a DHCP server is relatively complex. Embodiments not falling within the scope of the claims are exemplary.

The embodiments of the present invention further provide a network node and a controller.

Technical solutions provided in the embodiments of the present invention are as follows:
According to a first aspect, a packet processing method is provided, including:.

In a first possible implementation manner of the first aspect, the method further includes:.

With reference to the first aspect or the first possible implementation manner of the first aspect, a second possible implementation manner of the first aspect is further provided, where the method further includes:.

With reference to the first aspect, the first possible implementation manner of the first aspect, or the second possible implementation manner of the first aspect, a third possible implementation manner of the first aspect is further provided, where after the sending, by the network node, the second packet to a controller, the method further includes:.

With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, a fourth possible implementation manner of the first aspect is further provided, where the first packet is a DHCP Discover packet, and the third packet is a DHCP Offer packet; or.

With reference to the first aspect or any possible implementation manner of the first aspect, a fifth possible implementation manner of the first aspect is further provided, where a payload (name in English: payload) of the second packet includes an OpenFlow protocol (full name in English: open flow protocol, OFP for short in English) packet, and a payload of the OFP packet carries the first packet.

With reference to the fifth possible implementation manner of the first aspect, a sixth possible implementation manner of the first aspect is further provided, where the second packet is an Institute of Electrical and Electronics Engineers IEEE <NUM> protocol packet, a subtype subtype field of the IEEE <NUM> protocol packet is used to identify that the IEEE <NUM> protocol packet includes the OFP packet, and a payload of the IEEE <NUM> protocol packet carries the OFP packet, the information about the port, and the MAC address of the user terminal.

With reference to the fifth possible implementation manner of the first aspect, a seventh possible implementation manner of the first aspect is further provided, where the second packet is an Ethernet operation, administration and maintenance ETH OAM packet, a code code field of the ETH OAM packet is used to identify that the ETH OAM packet includes the OFP packet, and a data data field of the ETH OAM packet carries the OFP packet, the information about the port, and the MAC address of the user terminal.

With reference to the fifth possible implementation manner of the first aspect, an eighth possible implementation manner of the first aspect is further provided, where the second packet is an optical network terminal management and control interface OMCI protocol packet, a message identifier field included in the OMCI protocol packet is used to identify that the OMCI protocol packet includes the OFF packet, and a message contents field included in the OMCI protocol packet carries the OFF packet, the information about the port, and the MAC address of the user terminal.

With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, the third packet included in the fourth packet is a DHCP ACK packet or an RA message, the third packet further includes a configuration parameter, and the configuration parameter includes an identifier of a configuration file and an identifier of a server that provides the configuration file; and
the method further includes:.

According to a second aspect, a packet processing method is provided, including:.

In a first possible implementation manner of the second aspect, the method further includes:.

With reference to the first possible implementation manner of the second aspect, a second possible implementation manner of the second aspect is further provided, where the second packet is a DHCP Discover packet, and the third packet is a DHCP Offer packet; or.

With reference to the first possible implementation manner of the second aspect, a third possible implementation manner of the second aspect is further provided, where the method further includes:.

According to a third aspect, a network node is provided, including:.

In a first possible implementation manner of the third aspect, the network node further includes:.

With reference to the third aspect or the first possible implementation manner of the third aspect, a second possible implementation manner of the third aspect is further provided, where the network node further includes:.

With reference to the first possible implementation manner of the third aspect or the second possible implementation manner of the third aspect, a third possible implementation manner of the third aspect is further provided, where the first packet is a DHCP Discover packet, and the third packet is a DHCP Offer packet; or.

With reference to the first possible implementation manner of the third aspect or the second possible implementation manner of the third aspect, a fourth possible implementation manner of the third aspect is further provided, where the third packet included in the fourth packet is a DHCP ACK packet or an RA message, the third packet further includes a configuration parameter, and the configuration parameter includes an identifier of a configuration file and an identifier of a server that provides the configuration file; and
the network node further includes:.

According to a fourth aspect, a controller is provided, including:.

In a first possible implementation manner of the fourth aspect, the controller further includes:.

With reference to the first possible implementation manner of the fourth aspect, a second possible implementation manner of the fourth aspect is further provided, where the second packet is a DHCP Discover packet, and the third packet is a DHCP Offer packet; or.

With reference to the first possible implementation manner of the fourth aspect, a third possible implementation manner of the fourth aspect is further provided, where.

According to the foregoing solutions, the network node provided in the embodiments of the present invention receives a first packet from a user terminal, and obtains a second packet, where the first packet is used to request an IP address from a DHCP server, and the second packet is a packet except a DHCP packet. The network node sends the second packet to a controller. The controller receives the packet from the network node, and obtains, from the packet from the network node, a packet used to request an IP address from the DHCP server. The controller obtains the DHCP packet according to the packet used to request an IP address from the DHCP server, a port through which the network node receives the first packet, and a MAC address of the user terminal. The controller may send the DHCP packet to the DHCP server. In this way, a network node of an access network may not need to generate a DHCP packet, and instead, a controller generates a DHCP packet, and the network node of the access network may not need to support a DHCP relay function either, and merely forwards a packet from the controller or a packet from another network node, which helps decrease complexity of the network node.

To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly describes the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and ordinary persons skilled in the art may still derive other drawings from these accompanying drawings.

<FIG> is a schematic diagram of a network scenario. The network scenario shown in <FIG> is an access scenario based on the China Data-over-Cable Service Interface Specification (full name in English: China Data-over-Cable Service Interface Specification, C-DOCSIS for short in English). In the network scenario shown in <FIG>, a cable modem (full name in English: Cable Modem, CM for short in English) <NUM> and a DHCP server <NUM> are located in different network segments. The CM <NUM> may communicate with a cable media converter (full name in English: Cable Media Converter, CMC for short in English) <NUM>, the CMC <NUM> may communicate with an optical line termination (full name in English: Optical Line Termination, OLT for short in English) <NUM>, and the OLT <NUM> communicates with the DHCP server <NUM> by using a broadband network gateway (full name in English: Broadband Network Gateway, BNG for short in English) <NUM>. The BNG <NUM> is configured to forward a packet between the OLT <NUM> and the DHCP server <NUM>.

In the network shown in <FIG>, a method for the DHCP server to dynamically configure an IP address for the CM <NUM> may include as follows:
The CM <NUM> sends a DHCP Discover packet to the CMC <NUM>, where the DHCP Discover packet may include a MAC address of the CM <NUM>. The CMC <NUM> generates a first DHCP packet according to a first port and the MAC address of the CM <NUM>, for example, the CMC <NUM> adds the first port and the MAC address of the CM <NUM> to an option <NUM> field of the first DHCP packet. The first port is a port through which the CMC <NUM> receives the DHCP Discover packet. The CM <NUM> sends the first DHCP packet to the OLT <NUM>.

The OLT <NUM> may insert a second port into the option <NUM> field of the first DHCP packet, so as to obtain a second DHCP packet. The second port is a port through which the OLT <NUM> receives the first DHCP packet. The OLT <NUM> sends the second DHCP packet to the DHCP server <NUM>.

The DHCP server <NUM> obtains an available IP address according to the MAC address of the CM <NUM> that is included in the received second DHCP packet. The DHCP server <NUM> obtains a DHCP Offer packet. The DHCP Offer packet includes the second port, the first port, and the IP address that is provided to the CM <NUM>. The DHCP server <NUM> sends the DHCP Offer packet to the OLT <NUM>, and the OLT <NUM> sends the DHCP Offer packet to the CMC <NUM>. The CMC <NUM> sends the DHCP Offer packet to the CM <NUM> through the first port.

The CM <NUM> selects, from the received DHCP Offer packet, the IP address provided by the DHCP server <NUM> to the CM <NUM>. The CM <NUM> obtains a DHCP Request packet. The DHCP Request packet includes an address of the DHCP server <NUM> and the IP address that is provided by the DHCP server <NUM> to the CM <NUM>. The CM <NUM> sends the DHCP Request packet to the CMC <NUM>. The CMC <NUM> obtains a third DHCP packet. The third DHCP packet includes the first port, an ID of the DHCP server <NUM>, and the IP address that is assigned by the DHCP server <NUM> to the CM <NUM>. The CMC <NUM> may send, by using a same method as that for sending the first DHCP packet, the third DHCP packet to the DHCP server <NUM> by using the OLT <NUM>. The DHCP server <NUM> confirms that the IP address provided to the CM <NUM> is not being used, and sends a DHCP ACK packet to the CM <NUM> by using the OLT <NUM> and the CMC <NUM>. After receiving the DHCP ACK packet, the CM <NUM> obtains the IP address assigned by the DHCP server <NUM> to the CM <NUM>.

In the network scenario shown in <FIG>, a network node, such as the CMC <NUM>, the OLT <NUM>, or another network node, of an access network needs to support a DHCP relay function such as processing of an option <NUM> field of a DHCP packet, for example: generating a DHCP packet. The network node further needs to support formats, customized by different operators, of Option fields, and the network node is relatively complex.

In view of the foregoing problem, a method for helping resolve that a network node between a user terminal and a DHCP server is relatively complex is provided. In this solution, a network node receives a first packet sent by a user terminal. A second network device may separately communicate with the user terminal and the network node. The first packet is used to request an IP address from a DHCP server. The first packet may be a DHCP Discover packet, a DHCP Request packet, or a router solicitation (full name in English: Router Solicitation, RS for short in English) message. The network node obtains a second packet. The second packet includes the first packet, information about a port, and a MAC address of the user terminal, where the port is a port through which the network node receives the first packet. The network node sends the second packet to a controller. After receiving the packet sent by the network node, the controller may obtain a DHCP packet according to the packet that is included in the packet sent by the network node and that is used to request the IP address from the DHCP server. The controller sends the DHCP packet to the DHCP server or the network node. The foregoing solution may be implemented by using the following several embodiments.

<FIG> is a schematic diagram of a network scenario according to an embodiment of the present invention. In the network scenario shown in <FIG>, a CM <NUM> and a DHCP server <NUM> are located in different network segments. In the network scenario shown in <FIG>, a CMC <NUM> and a convergence forwarding device <NUM> are network nodes of an access network. The CM <NUM> may communicate with the CMC <NUM>, the CMC <NUM> may separately communicate with the convergence forwarding device <NUM> and a controller <NUM>, the convergence forwarding device <NUM> may separately communicate with the controller <NUM> and the DHCP server <NUM>, and the controller <NUM> may separately communicate with the CMC <NUM>, the convergence forwarding device <NUM>, and the controller <NUM>.

The CM <NUM> shown in <FIG> may serve as a form of a user terminal, but the user terminal mentioned in the embodiments of the present invention is not limited to only this form. The user terminal mentioned in the embodiments of the present invention may also be a user terminal in a form such as customer premises equipment (full name in English: customer premises equipment, CPE for short in English), a set top box (full name in English: set top box, STB for short in English), an embedded multimedia terminal adapter (full name in English: embedded multimedia terminal adapter, eMTA for short in English), or a computer, and examples are not listed herein one by one. The controller <NUM> in <FIG> may be deployed on one device with the convergence forwarding device <NUM>, or may be deployed on a device that can communicate with the CMC <NUM>, the convergence forwarding device <NUM>, or the DHCP server <NUM>. The controller <NUM> may be an access controller (full name in English: Access Controller, AC for short in English), or may be another type of controller, and examples are not listed herein one by one. The convergence forwarding device <NUM> may be a forwarding device such as an OLT, a router, or a switch, and examples are not listed herein one by one.

The network node mentioned in the embodiments of the present invention may be a remote access node (full name in English: Remote Access Node, Remote AN for short in English). The remote access node may be any device such as CPE, a drop point unit (full name in English: Drop Point Unit, DPU for short in English), an optical network terminal (full name in English: Optical Network Terminal, ONT for short in English), a cable modem (full name in English: Cable Modem, CM for short in English), a CMC, a miniature switch, a miniature digital subscriber line access multiplexer (full name in English: DSL Access Multiplexer, DSLAM for short in English), a miniature cable modem terminal system (full name in English: Cable Modem Terminal System, CMTS for short in English), or a miniature converged cable access platform (full name in English: Converged Cable Access Platform, CCAP for short in English).

<FIG> is a schematic diagram of a network node according to an embodiment of the present invention. The network node shown in <FIG> may be the CMC <NUM> or the convergence forwarding device <NUM> in the network scenario shown in <FIG>. The network node shown in <FIG> may include a processor <NUM>, a memory <NUM>, and a communications interface <NUM>. The processor <NUM>, the memory <NUM>, and the communications interface <NUM> are connected by using a communications bus <NUM>. The processor <NUM> may be a CPU or an NP, and the processor <NUM> includes at least one physical processor; and the communications interface <NUM> includes at least one physical interface.

The memory <NUM> is configured to store a program. Optionally, the memory <NUM> may be further configured to store a correspondence between an ID of a service flow and a MAC address of a CM <NUM>, where the service flow is used to carry a packet transmitted between the CMC <NUM> and the CM <NUM>.

The processor <NUM> performs the following operations according to an executable instruction included in the program read from the memory <NUM>.

The processor <NUM> receives, by using the communications interface <NUM>, a first packet sent by a user terminal, where the first packet is used to request an IP address from a DHCP server <NUM>. For example, if the network node is the CMC <NUM>, the user terminal may be the CM <NUM>, and the first packet may be a DHCP Discover packet, a DHCP Request packet, or an RS message.

The processor <NUM> obtains the MAC address of the CM <NUM>. Specifically, the processor <NUM> obtains the MAC address of the CM <NUM> according to an ID of a service flow that carries the first packet and according to the correspondence that is stored in the memory <NUM>. For example, the service flow that carries the first packet may carry the ID of the service flow, and the processor <NUM> may learn the ID of the service flow that carries the first packet.

The processor <NUM> obtains a second packet, where the second packet includes the first packet, information about a first port, and the MAC address of the CM <NUM>. The first port is a port through which the network node receives the first packet, for example, if the network node is the CMC <NUM>, the first port may be a port through which the CMC <NUM> receives a DHCP Discover packet, a DHCP Request packet, or an RS message. If the network node is the convergence forwarding device <NUM>, the first port may be a port through which the convergence forwarding device receives a DHCP packet.

The processor <NUM> sends the second packet to a controller <NUM> by using the communications interface <NUM>.

Optionally, the processor <NUM> may further receive, by using the communications interface <NUM>, a third packet sent by the DHCP server <NUM>. The third packet includes an IP address of the user terminal, for example, the third packet may be a DHCP Offer packet, a DHCP ACK packet, or an RA message. The processor <NUM> may send the third packet to the CM <NUM> by using the communications interface <NUM>.

Optionally, the processor <NUM> may further receive, by using the communications interface <NUM>, a fourth packet sent by the controller <NUM>, where the fourth packet includes the third packet, the information about the first port, and the MAC address of the CM <NUM>. The processor <NUM> obtains the third packet, the information about the first port, and the MAC address of the CM <NUM> from the fourth packet. The processor <NUM> may send the third packet to the CM <NUM> by using the communications interface <NUM> and according to the information about the first port and the MAC address of the CM <NUM>.

Optionally, the third packet may further include a configuration parameter. The configuration parameter may include an identifier (full name in English: Identifier, ID for short in English) of a server configured to provide a configuration file, and an ID of the configuration file. The ID of the server configured to provide the configuration file may be information that uniquely identifies the server, for example, an address or a name of the server, and the ID of the configuration file may be information that uniquely identifies the file, for example, a name of the configuration file. The server configured to provide the configuration file may be a Trivial File Transfer Protocol (full name in English: Trivial File Transfer Protocol, TFTP for short in English) server (not shown in <FIG>). The processor <NUM> may further obtain a correspondence between the configuration parameter and the MAC address of the CM <NUM>. The processor <NUM> may write the correspondence between the MAC address of the CM <NUM> and the configuration parameter into the memory <NUM>.

<FIG> is a schematic diagram of a network node according to an embodiment of the present invention. The network node shown in <FIG> includes a first receiving unit <NUM>, a first packet obtaining unit <NUM>, and a first sending unit <NUM>. Optionally, the network node shown in <FIG> further includes a second receiving unit <NUM> and a second sending unit <NUM>. Optionally, the network node shown in <FIG> further includes a third receiving unit <NUM>, a second packet obtaining unit <NUM>, and a third sending unit <NUM>. The network node shown in <FIG> further includes a storage unit <NUM>, a fourth receiving unit <NUM>, and a fourth sending unit <NUM>.

The network node shown in <FIG> and the network node shown in <FIG> may be a same apparatus, for example, both are the CMC <NUM> or the convergence forwarding device <NUM> in the network scenario shown in <FIG>. It may be considered that <FIG> shows, from a physical perspective, content included in a network node, and <FIG> shows, from a logical perspective, content included in a network node. Optionally, the first receiving unit <NUM>, the first sending unit <NUM>, the second receiving unit <NUM>, the second sending unit <NUM>, the third receiving unit <NUM>, the third sending unit <NUM>, the fourth receiving unit <NUM>, and the fourth sending unit <NUM> shown in <FIG> may be implemented by the communications interface <NUM> shown in <FIG>; the first packet obtaining unit <NUM> and the second packet obtaining unit <NUM> shown in <FIG> may be implemented by the processor <NUM> shown in <FIG> according to an executable instruction stored in the memory <NUM>; and the storage unit <NUM> shown in <FIG> may be implemented by the memory <NUM> shown in <FIG>.

<FIG> is a schematic diagram of a controller according to an embodiment of the present invention. The controller shown in <FIG> may be the controller <NUM> in the network scenario shown in <FIG>. The controller shown in <FIG> may be deployed on a same device with a convergence forwarding device <NUM>, or may be deployed on a device such as an AC that can communicate with a CMC <NUM>, a convergence forwarding device <NUM>, or a DHCP server <NUM>. A first packet received by the controller shown in <FIG> from a network node is the second packet sent by the network node shown in <FIG> or <FIG>. A second packet included in the first packet received by the controller shown in <FIG> is the first packet included in the second packet sent by the network node shown in <FIG> or <FIG>.

The controller shown in <FIG> may include a processor <NUM>, a memory <NUM>, and a communications interface <NUM>. The processor <NUM>, the memory <NUM>, and the communications interface <NUM> may communicate with each other by using a communications bus <NUM>. The processor <NUM> may be a CPU or an NP, and the processor <NUM> includes at least one physical processor; and the communications interface <NUM> includes at least one physical interface.

The memory <NUM> is configured to store a program. Optionally, the memory <NUM> may further store a correspondence between a MAC address of a CM <NUM> and a configuration file of the CM <NUM>. The configuration file of the CM <NUM> that is included in the correspondence may be an identifier used to indicate the configuration file, and the identifier used to indicate the configuration file is included in a configuration parameter.

The processor <NUM> may perform the following operations according to an executable instruction included in the program read from the memory <NUM>.

The processor <NUM> receives, by using the communications interface <NUM>, a first packet sent by a network node, where the network node may be the CMC <NUM> or the convergence forwarding device <NUM> in the network scenario shown in <FIG>. The first packet is a packet except a DHCP packet, and the first packet includes a second packet, information about a port, and a MAC address of a user terminal, where the port is a port through which the network node receives the second packet. The second packet is a packet used to request an IP address from the DHCP server <NUM>. For example, if the network node is the CMC <NUM>, the second packet may be a DHCP Discover packet, a DHCP Request packet, or an RS message. If the network node is the convergence forwarding device <NUM>, a DHCP packet that is sent by the CMC <NUM> and that is received by the convergence forwarding device <NUM> is generated by the controller <NUM>.

The processor <NUM> obtains the second packet, information about a first port, and the MAC address of the CM <NUM> from the first packet. The processor <NUM> obtains the DHCP packet according to the second packet, where the DHCP packet includes the information about the first port and the MAC address of the CM <NUM>. For example, the processor <NUM> may insert the information about the first port and the MAC address of the CM <NUM> into an option <NUM> field included in the received second packet, so as to obtain the DHCP packet.

The processor <NUM> sends the DHCP packet to the DHCP server <NUM> or the network node by using the communications interface <NUM>. For example, the processor <NUM> sends the DHCP packet to the DHCP server <NUM> by using the communications interface <NUM>; or the processor <NUM> sends the DHCP packet to the network node by using the communications interface <NUM>, and the network node sends the DHCP packet to the DHCP server <NUM>.

Optionally, the processor <NUM> may further receive, by using the communications interface <NUM>, a third packet sent by the DHCP server <NUM>. The third packet includes an IP address assigned by the DHCP server <NUM> to the user terminal. If the second packet included in the first packet received by the controller <NUM> is a DHCP Discover packet, the third packet is a DHCP Offer packet; if the second packet included in the first packet received by the controller <NUM> is a DHCP Request packet, the third packet is a DHCP ACK packet; or if the second packet included in the first packet received by the controller <NUM> is an RS message, the third packet is an RA message.

After receiving the third packet, the processor <NUM> obtains a fourth packet. For example, the third packet may further include the MAC address of the CM <NUM>, and the processor <NUM> may obtain, from the memory <NUM>, the information about the first port corresponding to the MAC address of the CM <NUM>. The processor <NUM> may generate the fourth packet according to the third packet, the information about the first port, and the MAC address of the CM <NUM>.

The processor <NUM> may send the fourth packet to the network node by using the communications interface <NUM>. For example, if the network node is the CMC <NUM>, the processor <NUM> may send the fourth packet to the CMC <NUM> by using the communications interface <NUM>. If the network node is the convergence forwarding device, the processor <NUM> may send the fourth packet to the convergence forwarding device <NUM> by using the communications interface <NUM>, and the convergence forwarding device <NUM> sends the fourth packet to the CMC <NUM>.

<FIG> is a schematic diagram of a controller according to an embodiment of the present invention. The controller shown in <FIG> includes a first receiving unit <NUM>, a first obtaining unit <NUM>, and a first sending unit <NUM>. Optionally, the controller shown in <FIG> further includes a second receiving unit <NUM>, a second obtaining unit <NUM>, and a second sending unit <NUM>. Optionally, the controller shown in <FIG> further includes a storage unit (not shown in <FIG>).

The controller shown in <FIG> and the controller shown in <FIG> may be a same apparatus, for example, both are the controller <NUM> in the network scenario shown in <FIG>. It may be considered that <FIG> shows, from a physical perspective, content included in a controller, and <FIG> shows, from a logical perspective, content included in a controller. Optionally, the first receiving unit <NUM>, the first sending unit <NUM>, the second receiving unit <NUM>, and the second sending unit <NUM> shown in <FIG> may be implemented by the communications interface <NUM> shown in <FIG>; the first obtaining unit <NUM> and the second obtaining unit <NUM> shown in <FIG> may be implemented by the processor <NUM> shown in <FIG> according to an executable instruction stored in the memory <NUM>; and the storage unit included in the controller shown in <FIG> may be implemented by the memory <NUM> shown in <FIG>.

<FIG> is a schematic diagram of a DHCP server according to an embodiment of the present invention. The DHCP server shown in <FIG> may be the DHCP server <NUM> in the network scenario shown in <FIG>. The DHCP server shown in <FIG> may include a processor <NUM>, a memory <NUM>, and a communications interface <NUM>. The processor <NUM>, the memory <NUM>, and the communications interface <NUM> may communicate with each other by using a communications bus <NUM>. The processor <NUM> may be a CPU, and the processor <NUM> may include at least one physical processor; and the communications interface <NUM> may include at least one physical interface.

The memory <NUM> is configured to store a program and an IP address of a user terminal, for example, the IP address of the user terminal may be an IP address of a CM <NUM>.

The processor <NUM> receives, by using the communications interface <NUM>, a DHCP packet sent by the controller <NUM>, where the DHCP packet includes information about a first port and a MAC address of the CM <NUM>. The DHCP packet may be a packet obtained by the controller <NUM> according to a DHCP Discover packet; or the DHCP packet may be a packet obtained by the controller <NUM> according to a DHCP Request packet; or the DHCP packet may be a packet obtained by the controller <NUM> according to an RS message.

The processor <NUM> may select, from the memory <NUM> according to the MAC address of the CM <NUM>, an IP address that is not being used.

Optionally, the processor <NUM> may further obtain a third packet according to the received DHCP packet and the selected IP address, where the third packet includes the information about the first port, the MAC address of the CM <NUM>, and an IP address that is assigned to the user terminal. If the DHCP packet is a packet obtained by the controller <NUM> according to a DHCP Discover packet, the third packet is a DHCP Offer packet; if the DHCP packet may be a packet obtained by the controller <NUM> according to a DHCP Request packet, the third packet is a DHCP Request packet; or if the DHCP packet may be a packet obtained by the controller <NUM> according to an RS message, the third packet is an RA message.

The processor <NUM> may send the third packet to a network node by using the communications interface <NUM>, where the network node may be the convergence forwarding device <NUM> or the CMC <NUM> shown in <FIG>.

<FIG> is a schematic diagram of a DHCP server according to an embodiment of the present invention. The DHCP server shown in <FIG> includes a receiving unit <NUM> and a first obtaining unit <NUM>. Optionally, the DHCP server shown in <FIG> further includes at least one of a second obtaining unit <NUM>, a sending unit <NUM>, or a third obtaining unit <NUM>. The DHCP server shown in <FIG> further includes a storage unit (not shown in <FIG>).

The DHCP server shown in <FIG> and the DHCP server shown in <FIG> may be a same apparatus, for example, both are the DHCP server <NUM> in the network scenario shown in <FIG>. It may be considered that <FIG> shows, from a physical perspective, content included in a DHCP server, and <FIG> shows, from a logical perspective, content included in a DHCP server. Optionally, the receiving unit <NUM> and the sending unit <NUM> shown in <FIG> may be implemented by the communications interface <NUM> shown in <FIG>; and the first obtaining unit <NUM>, the second obtaining unit <NUM>, and the third obtaining unit <NUM> shown in <FIG> may be implemented by the processor <NUM> shown in <FIG> according to an executable instruction stored in the memory <NUM>.

<FIG> is a schematic diagram of a packet processing method according to Embodiment <NUM> of the present invention. In the method provided in Embodiment <NUM> of the present invention, a controller <NUM> has a DHCP Relay function, and a CMC <NUM> and a convergence forwarding device <NUM> may have no DHCP Relay function. The packet processing method provided in Embodiment <NUM> of the present invention is described in detail in the following with reference to <FIG>.

A user terminal sends a DHCP Discover packet to the CMC <NUM>.

For example, the DHCP Discover packet is used to discover a DHCP server <NUM> and is a packet for requesting an IP address from the DHCP server <NUM>.

That the user terminal is a CM <NUM> is used as an example, and the CM <NUM> may send a DHCP Discover packet to the CMC <NUM> by using a service flow. The service flow may carry an ID of the service flow, and a correspondence exists between the ID of the service flow and a MAC address of the CM <NUM>.

That the user terminal is CPE is used as an example, and the CPE sends a DHCP Discover packet in a broadcast manner. The CM <NUM> may forward the DHCP Discover packet to the CMC <NUM> by using a service flow. The service flow may carry an ID of the service flow, and a correspondence exists between the ID of the service flow and a MAC address of the CM <NUM>. A same operation procedure as that of the CPE may be used by another user terminal such as an STB or an eMTA, and details are not described herein.

The CMC <NUM> sends a packet <NUM> to the controller <NUM>.

For example, the packet <NUM> includes the DHCP Discover packet, information about a first port, and the MAC address of the CM <NUM>. The packet <NUM> is a packet except a DHCP packet; and the first port is a port through which the CMC <NUM> receives the DHCP Discover packet, and the first port may be a physical port or a logical port.

When an Ethernet passive optical network (full name in English: Ethernet passive optical network, EPON for short in English) or a next-generation EPON exists between the remote access node and the convergence forwarding device, a layer-<NUM> protocol packet is an Ethernet packet such as an Institute of Electrical and Electronics Engineers (full name in English: Institute of Electrical and Electronics Engineers, IEEE for short in English) <NUM> packet or an Ethernet operation, administration and maintenance (full name in English: Ethernet operation, administration and maintenance, ETH OAM for short in English) packet.

The packet <NUM> may be an IEEE <NUM> protocol packet shown in <FIG>. A subtype field included in the IEEE <NUM> protocol packet may be used to identify that the IEEE <NUM> protocol packet includes an OFP packet. A payload included in the IEEE <NUM> protocol packet may carry the OFP packet, and a payload included in the OFF packet may carry the DHCP Discover packet, the information about the first port, and the MAC address of the CM <NUM>. Alternatively, a payload included in the IEEE <NUM> protocol packet may carry the OFP packet, the information about the first port, and the MAC address of the CM <NUM>, and a payload of the OFF packet may carry the DHCP Discover packet. For example, the subtype field included in the IEEE <NUM> protocol packet may be set to a first numerical value, where the first numerical value may identify that the payload of the IEEE <NUM> protocol packet carries the OFP packet. An option field may be further added after the OFP packet included in the payload of the IEEE <NUM> protocol packet, where the option field may be used to identify that the information about the first port and the MAC address of the CM <NUM> are carried after the option field. Alternatively, the subtype field included in the IEEE <NUM> protocol packet may be set to 0xFE. In the IEEE <NUM> protocol packet whose subtype field is set to 0xFE, an organization unique identifier (full name in English: Organization Unique Identifier, OUI for short in English) field is used to identify that the payload includes organization-specific extensions (full name in English: organization-specific extensions) content and the message content carries the OFP packet.

The packet <NUM> may be an ETH OAM packet shown in <FIG>. A Code field included in the ETH OAM packet may be used to identify that the ETH OAM packet includes an OFP packet. A Data field included in the ETH OAM packet may carry the OFF packet, and a payload included in the OFP packet may carry the DHCP Discover packet, the information about the first port, and the MAC address of the CM <NUM>. Alternatively, a Data field included in the ETH OAM packet may carry the OFP packet, the information about the first port, and the MAC address of the CM <NUM>, and a payload of the OFP packet may carry the DHCP Discover packet. For example, the Code field included in the ETH OAM packet may be set to 0xFE. An OUI field may identify that an organization-specific extensions field in the Data field of the ETH OAM packet carries the OFP packet.

When a gigabit-capable passive optical network (full name in English: gigabit-capable passive optical network, GPON for short in English) or a next-generation GPON exists between the remote access node and the convergence forwarding device, a layer-<NUM> protocol packet is an optical network unit management and control interface (full name in English: ONU Management and Control Interface, OMCI for short in English) protocol packet.

The packet <NUM> may be an OMCI protocol packet shown in <FIG>. The OMCI protocol packet includes a GPON encapsulation method (full name in English: G-PON Encapsulation Method, GEM for short in English) header field, a transaction correlation identifier (name in English: Transaction correlation identifier) field, a message type (name in English: Message type) field, a device identifier (name in English: Device identifier) field, a message identifier (name in English: Message identifier) field, a message contents (name in English: Message contents) field, and an OMCI trailer (name in English: OMCI trailer) field. For meanings of the fields included in the OMCI protocol packet, reference may be made to related descriptions in G. <NUM> (<NUM>/<NUM>) of International Telecommunication Union Telecommunication Standardization Sector (full name in English: International Telecommunication Union Telecommunication Standardization Sector, ITU-T for short in English).

In this embodiment of the present invention, an OpenFlow management entity (full name in English: Management Entity, ME for short in English) is defined in the OMCI protocol, and a format of the OpenFlow ME may include: an attribute field (name in English: Attributes) and an action field (name in English: Actions). The attribute field may include: an ME identifier (full name in English: Identifier, ID for short in English), an OpenFlow version (name in English: Version), an OpenFlow Message, a Circuit ID, and a Remote ID. The ME identifier is used to identify the OpenFlow ME. The OpenFlow version may be used to identify an OpenFlow version number. The OpenFlow Message is used to carry the OFP packet. The Circuit ID is used to identify first access information of a user, for example, the information about the first port. The Remote ID is used to identify second access information of the user, for example, the MAC address of the CM <NUM>. Actions may include actions such as Create (name in English: Create), Delete (name in English: Delete), Get (name in English: Get), and Set (name in English: Set). Create may be used to create the OpenFlow ME or create an attribute of the OpenFlow ME, Delete may be used to delete the OpenFlow ME or an attribute of the OpenFlow ME, Get may be used to get all attributes of the OpenFlow ME or an attribute of the OpenFlow ME, and Set may be used to set all the attributes of the OpenFlow ME or an attribute of the OpenFlow ME.

The Message identifier of the OMCI protocol packet mentioned in this embodiment of the present invention may be used to identify a corresponding OpenFlow ME. Content included in the Message contents of the OMCI protocol packet may be generated according to the OpenFlow ME. The Message contents of the OMCI protocol packet may carry the OFP packet.

For example, a first receiving unit <NUM> of the CMC <NUM> receives the DHCP Discover packet sent by the CM <NUM>. A first packet obtaining unit <NUM> obtains the information about the first port and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may generate the packet <NUM> according to the DHCP Discover packet, the information about the first port, and the MAC address of the CM <NUM>. A storage unit <NUM> may store the correspondence between the ID of the service flow and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may obtain the MAC address of the CM <NUM> according to the ID of the service flow that carries the DHCP Discover packet and according to the correspondence that is stored in the storage unit <NUM>.

For example, a first sending unit <NUM> of the CMC <NUM> may send the packet <NUM> to the controller <NUM>; or a first sending unit <NUM> may send the packet <NUM> to the convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the controller <NUM>. The first sending unit <NUM> may send the packet <NUM> to the controller <NUM> in a tunnel manner. Optionally, in a process in which the convergence forwarding device <NUM> sends the packet <NUM> to the controller <NUM>, information about a port through which the convergence forwarding device <NUM> receives the packet <NUM> may be carried in the packet <NUM>.

The controller <NUM> sends a first DHCP packet to the DHCP server <NUM>.

For example, a first receiving unit <NUM> of the controller <NUM> receives the packet <NUM> sent by the CMC <NUM>. A first obtaining unit <NUM> obtains the DHCP Discover packet, the information about the first port, and the MAC address of the CM <NUM> from the packet <NUM>. The first obtaining unit <NUM> obtains the first DHCP packet according to the DHCP Discover packet, the information about the first port, and the MAC address of the CM <NUM>, where the first DHCP packet includes the information about the first port and the MAC address of the CM <NUM>. For example, the first obtaining unit <NUM> may insert the information about the first port and the MAC address of the CM <NUM> into an option <NUM> field of the DHCP Discover packet, so as to generate the first DHCP packet. A first sending unit <NUM> may send the first DHCP packet to the DHCP server <NUM>.

For example, the first sending unit <NUM> may send the first DHCP packet to the DHCP server <NUM> by using the convergence forwarding device <NUM>; or the first sending unit <NUM> may directly send the first DHCP packet to the DHCP server <NUM>.

Steps <NUM> to <NUM> are optional steps. The DHCP server <NUM> may send a DHCP Offer packet to the user terminal by using the convergence forwarding device <NUM> and the CMC <NUM>; or the DHCP server <NUM> may send a DHCP Offer packet to the user terminal by using a method of steps <NUM> to <NUM> shown in <FIG>.

The DHCP server <NUM> sends the DHCP Offer packet to the controller <NUM>.

For example, a receiving unit <NUM> of the DHCP server <NUM> receives the first DHCP packet from the controller <NUM>. A first obtaining unit <NUM> may obtain the MAC address of the CM <NUM> from the first DHCP packet. The first obtaining unit <NUM> may select an IP address for the user terminal according to the MAC address of the CM <NUM>.

For example, a second obtaining unit <NUM> of the DHCP server <NUM> may obtain the DHCP Offer packet according to the IP address that is obtained by the first obtaining unit <NUM> and that is selected for the user terminal. The DHCP Offer packet includes the IP address provided by the DHCP server <NUM> to the user terminal, the information about the first port, and the MAC address of the CM <NUM>. Optionally, the DHCP Offer packet further includes an IP address of the DHCP server <NUM>.

For example, a sending unit <NUM> sends the DHCP Offer packet to the controller <NUM>; or a sending unit <NUM> sends the DHCP Offer packet to the controller <NUM> by using the convergence forwarding device <NUM>.

The controller <NUM> sends a packet <NUM> to the CMC <NUM>.

For example, the packet <NUM> includes the DHCP Offer packet, the information about the first port, and the MAC address of the CM <NUM>. The packet <NUM> may also be in a format of the packet shown in <FIG>. The packet <NUM> may be in a format that is the same as that of the packet <NUM>, or may be in a format that is different from that of the packet <NUM>. A difference between the packet <NUM> and the packet <NUM> lies in that a payload of an OFP packet included in the packet <NUM> carries the DHCP Offer packet.

For example, a second receiving unit <NUM> of the controller <NUM> receives the DHCP Offer packet from the DHCP server <NUM> or the convergence forwarding device <NUM>. A second obtaining unit <NUM> may obtain the packet <NUM> according to the DHCP Offer packet, the obtained information about the first port, and the obtained MAC address of the CM <NUM>. A second sending unit <NUM> may send the packet <NUM> to the convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the CMC <NUM>; or a second sending unit <NUM> may directly send the packet <NUM> to the CMC <NUM>. The second obtaining unit <NUM> may obtain the information about the first port and the MAC address of the CM <NUM> from the DHCP Offer packet.

The CMC <NUM> sends the DHCP Offer packet to the user terminal.

For example, a third receiving unit <NUM> of the CMC <NUM> receives the packet <NUM>. A second packet obtaining unit <NUM> may obtain the DHCP Offer packet, the information about the first port, and the MAC address of the CM <NUM> from the packet <NUM>. A third sending unit <NUM> may send the DHCP Offer packet to the user terminal according to the information about the first port and the MAC address of the CM <NUM>.

If the user terminal is the CM <NUM>, the IP address that is included in the DHCP Offer packet and that is provided by the DHCP server <NUM> to the user terminal is an IP address of the CM <NUM>; or if the user terminal is CPE connected to the CM <NUM>, the IP address that is included in the DHCP Offer packet and that is provided by the DHCP server <NUM> to the user terminal is an IP address of the CPE.

The user terminal sends a DHCP Request packet to the CMC <NUM>.

That the user terminal is the CM <NUM> is used as an example, and the CM <NUM> may send the DHCP Request packet to the CMC <NUM> through a physical port or a logical port. A correspondence exists between a service flow that carries the DHCP Request packet and the MAC address of the CM <NUM>. The DHCP Request packet sent by the CM <NUM> may include an IP address provided by the DHCP server <NUM> to the CM <NUM>. Optionally, the DHCP Request packet sent by the CM <NUM> may further include an address of the DHCP server <NUM>.

That the user terminal is CPE is used as an example, and the CPE sends the DHCP Request packet to the CMC <NUM> through a physical port or a logical port of the CM <NUM>. The DHCP Request packet includes an IP address provided by the DHCP server <NUM> to the CPE. Optionally, the DHCP Request packet may further include an address of the DHCP server <NUM>. The CM <NUM> may forward the DHCP Request packet to the CMC <NUM> by using a service flow.

For example, the packet <NUM> includes the DHCP Request packet, information about a second port, and the MAC address of the CM <NUM>. The DHCP Request packet may include the IP address provided by the DHCP server <NUM> to the user terminal. The second port is a port through which the CMC <NUM> receives the DHCP Request packet, and the second port may be a physical port or a logical port. The second port may be the same as the first port or may be different from the first port. The packet <NUM> may be in a format of the packet shown in <FIG>. The packet <NUM> may be in a packet format that is the same as that of the packet <NUM>, or may be in a packet format that is different from that of the packet <NUM>. A difference between the packet <NUM> and the packet <NUM> lies in that an OFP packet included in the packet <NUM> carries the DHCP Request packet.

For example, the first receiving unit <NUM> of the CMC <NUM> may receive the DHCP Request packet sent by the CM <NUM>. The first packet obtaining unit <NUM> may obtain the information about the second port and the MAC address of the CM <NUM>. A method for the first packet obtaining unit <NUM> to obtain the MAC address of the CM <NUM> may be the same as that in step <NUM>. The first packet obtaining unit <NUM> may generate the packet <NUM> according to the DHCP Request packet, the information about the second port, and the MAC address of the CM <NUM>.

For example, the first sending unit <NUM> of the CMC <NUM> may send the packet <NUM> to the convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the controller <NUM>; or the first sending unit <NUM> of the CMC <NUM> may directly send the packet <NUM> to the controller <NUM>. In a process in which the convergence forwarding device <NUM> sends the packet <NUM> to the controller <NUM>, information about a port through which the convergence forwarding device <NUM> receives the packet <NUM> may be carried in the packet <NUM>.

The controller <NUM> sends a second DHCP packet to the DHCP server <NUM>.

For example, the first receiving unit <NUM> of the controller <NUM> receives the packet <NUM> sent by the CMC <NUM>. The first obtaining unit <NUM> obtains the DHCP Request packet, the information about the second port, and the MAC address of the CM <NUM> from the packet <NUM>. The first obtaining unit <NUM> obtains the second DHCP packet, where the second DHCP packet includes the IP address provided by the DHCP server <NUM> to the user terminal, the information about the second port, and the MAC address of the CM <NUM>. For example, the first obtaining unit <NUM> may add the information about the second port and the MAC address of the CM <NUM> to an option <NUM> field of the DHCP Request packet, so as to generate the second DHCP packet. Optionally, the second DHCP packet may further include the address of the DHCP server <NUM>. The first sending unit <NUM> may send the second DHCP packet to the DHCP server <NUM> by using the method in step <NUM>.

Steps <NUM> to <NUM> are optional steps. The DHCP server <NUM> sends a DHCP ACK packet to the user terminal by using the convergence forwarding device <NUM> and the CMC <NUM>; or the DHCP server <NUM> may send the DHCP ACK packet to the user terminal by using a method of steps <NUM> to <NUM> shown in <FIG>.

The DHCP server <NUM> sends the DHCP ACK packet to the controller <NUM>.

For example, the receiving unit <NUM> of the DHCP server <NUM> receives the second DHCP packet from the controller <NUM>. The first obtaining unit <NUM> may obtain, from the second DHCP packet, the MAC address of the CM <NUM> and the IP address that is provided by the DHCP server <NUM> to the user terminal.

For example, the second obtaining unit <NUM> of the DHCP server <NUM> may obtain the DHCP ACK packet when the first obtaining unit <NUM> determines that the IP address provided to the user terminal is not being used. The DHCP ACK packet includes the IP address assigned to the user terminal. The DHCP ACK packet further includes the information about the first port and the MAC address of the CM <NUM>. The sending unit <NUM> sends the DHCP ACK packet to the controller <NUM>; or the sending unit <NUM> sends the DHCP ACK packet to the controller <NUM> by using the convergence forwarding device <NUM>.

Optionally, the DHCP ACK packet further includes a configuration parameter, where the configuration parameter includes an ID of a configuration file and an ID of a server that provides the configuration file.

For example, the packet <NUM> includes the DHCP ACK packet, the information about the second port, and the MAC address of the CM <NUM>. The packet <NUM> may be in a format of the packet shown in <FIG>. The packet <NUM> may be in a packet format that is the same as that of the packet <NUM>, or may be in a packet format that is different from that of the packet <NUM>. A difference between the packet <NUM> and the packet <NUM> lies in that an OFP packet included in the packet <NUM> carries the DHCP ACK packet.

For example, the second receiving unit <NUM> of the controller <NUM> receives the DHCP ACK packet from the DHCP server <NUM> or the convergence forwarding device <NUM>. The second obtaining unit <NUM> may obtain the packet <NUM> according to the DHCP ACK packet, the obtained information about the second port, and the obtained MAC address of the CM <NUM>. The second sending unit <NUM> may send the packet <NUM> to the convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the CMC <NUM>; or the second sending unit <NUM> may directly send the packet <NUM> to the CMC <NUM>.

The CMC <NUM> sends the DHCP ACK packet to the user terminal.

For example, the third receiving unit <NUM> of the CMC <NUM> receives the packet <NUM>. The second packet obtaining unit <NUM> may obtain the DHCP ACK packet, the information about the second port, and the MAC address of the CM <NUM> from the packet <NUM>. The third sending unit <NUM> may send the DHCP ACK packet to the user terminal according to the second port and the MAC address of the CM <NUM>. If the user terminal is CPE connected to the CM <NUM>, the CM <NUM> further sends the DHCP ACK packet to the CPE.

In the method provided in Embodiment <NUM> of the present invention, the CMC <NUM> sends, to the controller <NUM>, a packet that includes the DHCP Discover packet or the DHCP Request packet, and the controller <NUM> performs DHCP relay processing, so as to generate the first DHCP packet or the second DHCP packet, that is, the controller <NUM> has a DHCP relay function, and the CMC <NUM> may have no DHCP relay function. In this way, a network node such as the CMC <NUM> does not need to support a DHCP protocol, thereby decreasing complexity of the network node.

That the user terminal is the CM <NUM> is used as an example, and after step <NUM>, the method provided in Embodiment <NUM> of the present invention may further include: sending, by the controller <NUM>, a correspondence between a configuration parameter and the MAC address of the CM <NUM> to the CMC <NUM> by using the packet <NUM>, where the configuration parameter includes an ID of a configuration file and an ID of a server that provides the configuration file.

Optionally, after step <NUM>, the method provided in Embodiment <NUM> of the present invention may further include:.

For example, the CMC <NUM> may obtain the MAC address of the CM <NUM> by using the method in step <NUM> in Embodiment <NUM>. The storage unit <NUM> of the CMC <NUM> may store the correspondence delivered by the controller <NUM>, where the correspondence includes the configuration parameter and the MAC address of the CM <NUM>. A fourth receiving unit <NUM> receives the configuration file request packet sent by the CM <NUM>, where the configuration file request packet is used to request the configuration file from the server that provides the configuration file. The first packet obtaining unit <NUM> may determine, according to the stored correspondence, that the configuration parameter included in the configuration file request packet is correct. After the first packet obtaining unit <NUM> determines that the configuration parameter is correct, a fourth sending unit <NUM> sends the configuration file request packet to the server that provides the configuration file.

Optionally, the method provided in Embodiment <NUM> of the present invention may further include:
determining, by the CMC <NUM>, that the configuration parameter included in the configuration file request packet and the obtained MAC address of the CM <NUM> are different from those in the correspondence delivered by the controller <NUM>, and notifying the user terminal that the configuration file is requested unsuccessfully.

Optionally, the method provided in Embodiment <NUM> of the present invention may further include:
forwarding, by the CMC <NUM> to the user terminal, the configuration file sent by the server that provides the configuration file, so that the user terminal completes, by using the configuration file, configuration before assessing a network.

For example, the fourth receiving unit <NUM> included in the CMC <NUM> may receive a configuration file response packet from the controller <NUM> or the convergence gateway device <NUM>. The configuration file response packet includes the IP address of the CM <NUM> and the configuration file. The fourth sending unit <NUM> may send the configuration file to the CM <NUM> according to the IP address of the CM <NUM>.

That the user terminal is CPE is used as an example, and the correspondence delivered by the controller <NUM> to the CMC <NUM> is a correspondence between an IP address of the CPE and the MAC address of the CM <NUM>. The CMC <NUM> may perform source address verification (full name in English: Source Address Verification, SAV for short in English) on a service packet from the CPE according to the received correspondence between the IP address of the CPE and the MAC address of the CM <NUM>. A user terminal such as an STB or an eMTA may use a same operation procedure as that of the CPE, and details are not described herein.

For example, the first receiving unit <NUM> of the CMC <NUM> receives the configuration file request packet sent by the CM <NUM>. The CMC <NUM> may obtain the MAC address of the CM <NUM> by using the method in step <NUM> in Embodiment <NUM>. The first packet obtaining unit <NUM> may obtain the packet <NUM> according to the configuration file request packet, the configuration parameter, and the MAC address of the CM <NUM>. The first sending unit <NUM> sends the packet <NUM> to the controller <NUM>. The controller <NUM> may store the correspondence between the configuration parameter and the MAC address of the CM <NUM>. The controller <NUM> obtains the configuration file request packet from the packet <NUM>. The controller <NUM> determines that the configuration parameter included in the configuration file request packet and the obtained MAC address of the CM <NUM> are the same as those in the correspondence, and requests the configuration file from the server that provides the configuration file. For example, a name of a configuration file included in the correspondence is the same as a name of the configuration file included in the configuration file request packet, and the MAC address of the CM <NUM> included in the correspondence is the same as the obtained MAC address of the CM <NUM>, and in this case, it is determined that the configuration parameter included in the configuration file request packet and the obtained MAC address of the CM <NUM> are the same as those in the correspondence. The packet <NUM> may be in a format shown in <FIG>. An OFF packet included in the packet <NUM> carries the configuration file request packet.

Optionally, the method provided in Embodiment <NUM> of the present invention may further include:
determining, by the controller <NUM>, that the configuration parameter included in the configuration file request packet and the obtained MAC address of the CM <NUM> are different from those in the correspondence, and notifying, by using the CMC <NUM>, the user terminal that the configuration file is requested unsuccessfully.

Optionally, the method provided in Embodiment <NUM> of the present invention may further include:
forwarding, by the controller <NUM> to the user terminal by using the CMC <NUM>, the configuration file sent by the server that provides the configuration file, so that the user terminal obtains the configuration file, where the controller <NUM> may add the configuration file to an OFP packet included in a packet <NUM> and send the packet <NUM> to the CMC <NUM>, the CMC <NUM> forwards the configuration file to the user terminal, and the packet <NUM> may be in a format of the packet shown in <FIG>.

That the user terminal is CPE as an example, and the correspondence stored in the controller <NUM> is a correspondence between an IP address of the CPE and the MAC address of the CM <NUM>. The controller <NUM> may perform source address verification (full name in English: Source Address Verification, SAV for short in English) on a service packet from the CPE according to the correspondence between the IP address of the CPE and the MAC address of the CM <NUM>. A user terminal such as an STB or an eMTA may use a same operation procedure as the CPE, and details are not described herein.

<FIG> is a schematic diagram of a packet processing method according to Embodiment <NUM> of the present invention. The packet processing method provided in Embodiment <NUM> of the present invention is described in detail in the following with reference to <FIG>.

A user terminal sends an RS message to a CMC <NUM>.

For example, the RS message is used to request a prefix of an IP address from a DHCP server <NUM> and is a packet for requesting a prefix of an IP address from the DHCP server <NUM>.

That the user terminal is a CM <NUM> is used as an example, and the CM <NUM> may send the RS message to the CMC <NUM> through a physical port or a logical port. The RS message is sent by using a service flow between the CM <NUM> and the CMC <NUM>, and the service flow may be identified by using an ID of the service flow.

That the user terminal is CPE is used as an example, and the CPE sends the RS message in a broadcast manner. The CM <NUM> may send the RS message to the CMC <NUM> by using a service flow, where the service flow may carry an ID of the service flow, and a correspondence exists between the ID of the service flow and a MAC address of the CM <NUM>. A same operation procedure as that of the CPE may be used by another user terminal such as an STB or an eMTA, and details are not described herein.

The CMC <NUM> sends a packet <NUM> to a controller <NUM>.

For example, the packet <NUM> includes the RS message, information about a first port, and the MAC address of the CM <NUM>. The first port is a port through which the CMC <NUM> receives the RS message, and the first port may be a physical port or a logical port. The packet <NUM> may be of a structure of the packet shown in <FIG>. A payload included in the packet <NUM> may carry an OFF packet, and the OPF packet may carry the RS message.

For example, a first receiving unit <NUM> of the CMC <NUM> receives the RS message sent by the CM <NUM>. A first packet obtaining unit <NUM> obtains the information about the first port and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may generate the packet <NUM> according to the RS message, the information about the first port, and the MAC address of the CM <NUM>. A storage unit <NUM> may store the correspondence between the ID of the service flow and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may obtain the MAC address of the CM <NUM> according to the ID of the service flow that carries the RS message and according to the correspondence that is stored in the storage unit <NUM>.

For example, a first sending unit <NUM> of the CMC <NUM> may send the packet <NUM> to the controller <NUM>; or a first sending unit <NUM> may send the packet <NUM> to a convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the controller <NUM>.

The controller <NUM> sends a third DHCP packet to the DHCP server <NUM>.

For example, a first receiving unit <NUM> of the controller <NUM> receives the packet <NUM> sent by the CMC <NUM>. A first obtaining unit <NUM> obtains the RS message, the information about the first port, and the MAC address of the CM <NUM> from the packet <NUM>. The first obtaining unit <NUM> obtains the third DHCP packet, where the third DHCP packet includes the information about the first port, the MAC address of the CM <NUM>, and the RS message. For example, the first obtaining unit <NUM> may generate the third DHCP packet by using the information about the first port, the MAC address of the CM <NUM>, and the RS message as Option content of a relay forwarding message. A first sending unit <NUM> may send the third DHCP packet to the DHCP server <NUM>.

For example, the first sending unit <NUM> may send the third DHCP packet to the DHCP server <NUM> by using the convergence forwarding device <NUM>; or the first sending unit <NUM> may directly send the third DHCP packet to the DHCP server <NUM>.

The DHCP server <NUM> sends a relay response message to the controller <NUM>.

For example, a receiving unit <NUM> of the DHCP server <NUM> receives the third DHCP packet from the controller <NUM>. A first obtaining unit <NUM> may obtain the MAC address of the CM <NUM> from the third DHCP packet. The first obtaining unit <NUM> may obtain, according to the MAC address of the CM <NUM>, a prefix of an IP address assigned to the user terminal.

For example, a second obtaining unit <NUM> of the DHCP server <NUM> may obtain the relay response message according to the prefix of the IP address that is obtained by the first obtaining unit <NUM> and that is assigned to the user terminal, where the relay response message includes the prefix of the IP address assigned to the user terminal, and the relay response message further includes the information about the first port and the MAC address of the CM <NUM>. A sending unit <NUM> sends the relay response message to the controller <NUM>; or a sending unit <NUM> sends the relay response message to the controller <NUM> by using the convergence forwarding device <NUM>.

For example, the packet <NUM> includes an RA message, the information about the first port, and the MAC address of the CM <NUM>. The RA message may include the prefix of the IP address assigned by the DHCP server <NUM> to the user terminal. The packet <NUM> may also be in a format of the packet shown in <FIG>. The packet <NUM> may be in a format that is the same as that of the packet <NUM>, or may be in a format that is different from that of the packet <NUM>. A difference between the packet <NUM> and the packet <NUM> lies in that a payload of an OFP packet included in the packet <NUM> carries the RA message.

For example, a second receiving unit <NUM> of the controller <NUM> receives the relay response message from the DHCP server <NUM> or the convergence forwarding device <NUM>. A second obtaining unit <NUM> may obtain the packet <NUM> according to the RA message, the obtained information about the first port, and the obtained MAC address of the CM <NUM>. A second sending unit <NUM> may send the packet <NUM> to the convergence forwarding device <NUM>, and the convergence forwarding device <NUM> sends the packet <NUM> to the CMC <NUM>; or a second sending unit <NUM> may directly send the packet <NUM> to the CMC <NUM>.

The CMC <NUM> sends the RA message to the user terminal.

For example, a third receiving unit <NUM> of the CMC <NUM> receives the packet <NUM>. A second packet obtaining unit <NUM> may obtain the RA message, the information about the first port, and the MAC address of the CM <NUM> from the packet <NUM>. A third sending unit <NUM> may send the RA message to the user terminal through the first port.

If the user terminal is the CM <NUM>, the prefix of the IP address that is included in the RA message and that is assigned to the user terminal is a prefix of an IP address of the CM <NUM>; or if the user terminal is CPE connected to the CM <NUM>, the prefix of the IP address that is assigned by the DHCP server <NUM> to the user terminal is a prefix of an IP address of the CPE.

In the method provided in Embodiment <NUM> of the present invention, the CMC <NUM> sends a packet that includes the RS message to the controller <NUM>, and the controller <NUM> generates the third DHCP packet. The controller has a DHCP relay function, and a network node such as the CMC <NUM> may have no DHCP relay function. In this way, the network node does not need to support a DHCP protocol, thereby decreasing complexity of the network node.

That the user terminal is the CM <NUM> is used as an example, and after step <NUM>, the method provided in Embodiment <NUM> of the present invention further includes:
sending, by the controller <NUM>, a correspondence between a configuration parameter and the MAC address of the CM <NUM> to the CMC <NUM> by using the packet <NUM>, where the configuration parameter includes an ID of a configuration file and an address of a server that provides the configuration file, and the server that provides the configuration file may be a TFTP server or a ToD server.

That the user terminal is CPE is used as an example, and the correspondence delivered by the controller <NUM> to the CMC <NUM> is a correspondence between a prefix of an IP address of the CPE and the MAC address of the CM <NUM>. The CMC <NUM> may perform source address verification (full name in English: Source Address Verification, SAV for short in English) on a service packet from the CPE according to the received correspondence between the prefix of the IP address of the CPE and the MAC address of the CM <NUM>. A user terminal such as an STB or an eMTA may use a same operation procedure as the CPE, and details are not described herein.

The controller <NUM> determines that the configuration parameter included in the configuration file request packet and the obtained MAC address of the CM <NUM> are the same as those in the correspondence, and sends the configuration file request packet to the server that provides the configuration file.

Optionally, the method provided in Embodiment <NUM> of the present invention may further include:
forwarding, by the controller <NUM> to the user terminal by using the CMC <NUM>, the configuration file sent by the server that provides the configuration file, so that the user terminal obtains the configuration file, where a method for the controller <NUM> to send the configuration file to the CMC <NUM> is the same as the method provided in Embodiment <NUM> of the present invention.

That the user terminal is CPE as an example, and the correspondence stored in the controller <NUM> is a correspondence between a prefix of an IP address of the CPE and the MAC address of the CM <NUM>. The controller <NUM> may perform source address verification (full name in English: Source Address Verification, SAV for short in English) on a service packet from the CPE according to the correspondence between the prefix of the IP address of the CPE and the MAC address of the CM <NUM>. A user terminal such as an STB or an eMTA may use a same operation procedure as the CPE, and details are not described herein.

A user terminal sends a packet <NUM> to a CMC <NUM>.

For example, the packet <NUM> may be the DHCP Discover packet in Embodiment <NUM>, the DHCP Request packet in Embodiment <NUM>, or the RS message in Embodiment <NUM>, and content included in the packet <NUM> is not described in detail herein.

That the user terminal is a CM <NUM> is used as an example, and the CM <NUM> may send the packet <NUM> to the CMC <NUM> through a physical port or a logical port. The packet <NUM> may be carried in a service flow between the CM <NUM> and the CMC <NUM>. The service flow that carries the packet <NUM> may carry an ID of the service flow.

For example, the packet <NUM> includes the packet <NUM>, information about a first port, and a MAC address of the CM <NUM>. The packet <NUM> is a packet except a DHCP packet. The first port is a port through which the CMC <NUM> receives the packet <NUM>, and the first port may be a physical port or a logical port. The packet <NUM> may be of a structure of the packet shown in <FIG>. The packet <NUM> may be carried in a payload of an OFP packet, and the OFP packet may be carried in a payload of the packet <NUM>.

For example, a first receiving unit <NUM> of the CMC <NUM> receives the packet <NUM> sent by the CM <NUM>. A first packet obtaining unit <NUM> obtains the information about the first port and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may generate the packet <NUM> according to the packet <NUM>, the information about the first port, and the MAC address of the CM <NUM>. A storage unit <NUM> may store a correspondence between the ID of the service flow and the MAC address of the CM <NUM>. The first packet obtaining unit <NUM> may obtain the MAC address of the CM <NUM> according to the ID that is of the service flow and that is carried in the packet <NUM> and according to the correspondence that is stored in the storage unit <NUM>.

The controller <NUM> sends a fourth DHCP packet to the CMC <NUM>.

For example, a first receiving unit <NUM> of the controller <NUM> receives the packet <NUM> sent by the CMC <NUM>. A first obtaining unit <NUM> obtains the packet <NUM>, the information about the first port, and the MAC address of the CM <NUM> from the packet <NUM>. The first obtaining unit <NUM> obtains the fourth DHCP packet, where the fourth DHCP packet includes the information about the first port and the MAC address of the CM <NUM>. For example, the first obtaining unit <NUM> may add the information about the first port and the MAC address of the CM <NUM> to an option <NUM> field of the packet <NUM>, so as to obtain the fourth DHCP packet. A first sending unit <NUM> may send the fourth DHCP packet to the CMC <NUM>.

The CMC <NUM> sends the fourth DHCP packet to the convergence forwarding device <NUM>.

For example, a second receiving unit <NUM> of the CMC <NUM> receives the fourth DHCP packet sent by the controller <NUM>. A second sending unit <NUM> sends the fourth DHCP packet to the convergence forwarding device <NUM>.

The convergence forwarding device <NUM> sends a packet <NUM> to the controller <NUM>.

For example, a structure of the convergence forwarding device <NUM> may be the same as a structure of the CMC <NUM>. After receiving the fourth DHCP packet, the convergence forwarding device <NUM> may obtain the packet <NUM> by using a method for the CMC <NUM> to process the packet <NUM>, and details are not described herein. The packet <NUM> may include the fourth DHCP packet, the first port, a third port, and the MAC address of the CM <NUM>, where the third port may be a port through which the convergence forwarding device <NUM> receives the DHCP packet, and the third port may be a physical port or a logical port. The packet <NUM> may be in a format of the packet shown in <FIG>, that is, the fourth DHCP packet may be carried in a payload of an OFP packet, and the OFF packet may be carried in a payload of the packet <NUM>.

The controller <NUM> sends a fifth DHCP packet to a DHCP server <NUM>.

For example, the controller <NUM> may send the fifth DHCP packet to the DHCP server <NUM> by using the method in Embodiment <NUM> or Embodiment <NUM>, and details are not described herein.

Steps <NUM> to <NUM> are optional. The DHCP server <NUM> may send a packet <NUM> to the user terminal by using the convergence forwarding device <NUM> and the CMC <NUM>; or the DCHP server <NUM> may send a packet <NUM> to the user terminal by using a method of steps <NUM> to <NUM> shown in <FIG>.

The DHCP server <NUM> sends the packet <NUM> to the controller <NUM>.

For example, if the packet <NUM> is a DHCP Discover packet, the packet <NUM> is a DHCP Offer packet. The DHCP Offer packet is the same as the DHCP Offer packet in Embodiment <NUM>, and details are not described herein. If the packet <NUM> is a DHCP Request packet, the packet <NUM> is a DHCP ACK packet. The DHCP ACK packet is the same as the DHCP ACK packet in Embodiment <NUM>, and details are not described herein. If the packet <NUM> is an RS message, the packet <NUM> is an RA message. The RA message is the same as the RA message in Embodiment <NUM>, and details are not described herein.

For example, the DHCP server <NUM> may send the packet <NUM> to the controller <NUM> by using the method in Embodiment <NUM> or Embodiment <NUM>, and details are not described herein.

For example, the packet <NUM> includes the packet <NUM>, the information about the first port, and the MAC address of the CM <NUM>. The packet <NUM> is a packet except a DHCP packet. The packet <NUM> may be of a structure of the packet shown in <FIG>. The packet <NUM> may be carried in a payload of an OFP packet, and the OFP packet may be carried in a payload of the packet <NUM>.

For example, the controller <NUM> may send the packet <NUM> to the CMC <NUM> by using the method in Embodiment <NUM> or Embodiment <NUM>.

Optionally, the controller <NUM> may further send the packet <NUM> to the convergence forwarding device <NUM>. The convergence forwarding device <NUM> may send the packet <NUM> to the CMC <NUM> according to the third port.

The CMC <NUM> sends the packet <NUM> to the user terminal.

For example, the CMC <NUM> may obtain the packet <NUM> by using the method in Embodiment <NUM> or Embodiment <NUM>. The CMC <NUM> may send the packet <NUM> to the user terminal by using the method in Embodiment <NUM> or Embodiment <NUM>.

In the method provided in Embodiment <NUM> of the present invention, the CMC <NUM> or the convergence forwarding device <NUM> may have no DHCP relay function, that is, the CMC <NUM> or the convergence forwarding device <NUM> does not need to generate a DHCP packet. The controller <NUM> has a DHCP relay function, that is, the controller <NUM> generates a DHCP packet according to a received packet that includes the packet <NUM> or the packet <NUM>. The method provided in Embodiment <NUM> helps decrease complexity of a network node.

In the foregoing embodiments of the present invention, the CMC <NUM>, the convergence forwarding device <NUM>, and the DHCP server <NUM> separately communicate with the controller <NUM> through an extended port. The CMC <NUM>, the convergence forwarding device <NUM>, the controller <NUM>, and the DHCP server <NUM> may forward a packet according to a configured forwarding rule or forwarding entry. Alternatively, each of the CMC <NUM>, the convergence forwarding device <NUM>, the controller <NUM>, and the DHCP server <NUM> can learn a network node connected to each port, and each of the foregoing nodes may forward a packet according to the network node connected to each port and according to a forwarding rule. For example, the CMC <NUM> may send the packet <NUM> or the packet <NUM> to the controller <NUM> according to a first forwarding rule. The CMC <NUM> may send an RA message to the user terminal according to a second forwarding rule. The CMC <NUM> may send a DHCP packet to the convergence forwarding device <NUM> according to a third forwarding rule. Each forwarding process of each node is not described herein by using examples one by one.

In the foregoing embodiments of the present invention, packets such as the packet <NUM> to the packet <NUM> and the packet <NUM> to the packet <NUM> are all packets except a DHCP packet.

Claim 1:
A packet processing method, wherein the method comprises:
receiving, by a network node of an access network, a first packet sent by a user terminal, wherein the first packet is used to request an Internet Protocol, IP, address from a Dynamic Host Configuration Protocol, DHCP, server;
obtaining, by the network node, a second packet, wherein the second packet comprises the first packet, information about a port, and a Media Access Control, MAC, address of the user terminal; and
sending, by the network node in the second packet, the first packet, the information about the port, and the MAC address of the user terminal to a controller, wherein the port is a port through which the network node receives the first packet and wherein the information about the port, and the MAC address of the user terminal are comprised outside of the first packet,
wherein the first packet is a Dynamic Host Configuration Protocol discover, DHCP Discover, packet; or
the first packet is a Dynamic Host Configuration Protocol request, DHCP Request, packet; or
the first packet is a router solicitation, RS, message.