Message receiving and sending method, information obtaining, receiving, and sending method, and related device
In accordance with an embodiment, a network device is configured to obtain keepalive information of a terminal device; receive a migration begin request message sent by a control plane network element; and in response to receiving the migration begin request message, after receiving a first keepalive request packet sent by the terminal device, send a first keepalive response packet for the first keepalive request packet to the terminal device based on the keepalive information.
1 . A network device configured to be applied to a first user plane network element comprised in a broadband network gateway (BNG) system, the network device comprising:
one or more processors; and
one or more memories coupled to the one or more processors with instructions stored thereon, wherein the instructions, when executed by the one or more processors, enable the network device to:
obtain keepalive information of a terminal device, wherein the first user plane network element is configured to forward traffic of the terminal device when a second user plane network element in the BNG system is faulty,
receive a migration begin request message sent by a control plane network element in the BNG system,
in response to both receiving the migration begin request message and receiving a first keepalive request packet sent by the terminal device, send a first keepalive response packet corresponding to the first keepalive request packet to the terminal device based on the keepalive information.
2 . The network device according to claim 1 , wherein the instructions, when executed by the one or more processors, further enable the network device to:
in response to the first user plane network element not storing forwarding control entry information matching the first keepalive request packet, send the first keepalive response packet to the terminal device based on the keepalive information.
3 . The network device according to claim 1 , wherein:
the keepalive information comprises a terminal identifier, a gateway identifier, and an interface identifier;
the terminal identifier is used to identify the terminal device; the gateway identifier is used to identify the BNG system;
and the interface identifier is used to identify an interface that is on the first user plane network element and exchanges traffic with the terminal device.
4 . The network device according to claim 3 , wherein, in response to the first user plane network element and the second user plane network element belonging to a same warm backup group, the keepalive information further comprises an index of the warm backup group.
5 . The network device according to claim 3 , wherein:
the terminal identifier comprises a point-to-point protocol over Ethernet (PPPoE) session identifier of the terminal device and a media access control MAC address of the terminal device; and
the gateway identifier comprises a MAC address of the BNG system.
6 . The network device according to claim 3 , wherein:
the terminal identifier comprises a MAC address of the terminal device; and
the gateway identifier comprises a MAC address and an Internet protocol IP address of the BNG system.
7 . The network device according to claim 4 , wherein:
the keepalive information further comprises a local magic number and a client magic number of the terminal device; and
the first keepalive response packet carries the local magic number.
8 . The network device according to claim 4 , wherein the keepalive information further comprises an IP address of the terminal device.
9 . The network device according to claim 4 , wherein the keepalive information further comprises a customer virtual local area network (VLAN) tag and/or a service VLAN tag.
10 . The network device according to claim 9 , wherein, in response to the keepalive information comprising the customer VLAN tag:
the keepalive information further comprises a customer VLAN priority; and
the first keepalive response packet further carries the customer VLAN priority.
11 . The network device according to claim 9 , wherein, in response to the keepalive information comprising the service VLAN tag:
the keepalive information further comprises a service VLAN priority; and
the first keepalive response packet further carries the service VLAN priority.
12 . The network device according to claim 1 , wherein:
the migration begin request message carries a slot identifier; and
the slot identifier indicates a slot that is on the first user plane network element and exchanges traffic with the terminal device.
13 . A network device, configured to be applied to a control plane network element comprised in a broadband network gateway (BNG) system, the network device comprising:
one or more processors; and
one or more memories coupled to the one or more processors with instructions stored thereon, wherein the instructions, when executed by the one or more processors, enable the network device to:
send keepalive information of a terminal device to a first user plane network element in the BNG system, wherein the first user plane network element is configured to forward traffic of the terminal device when a second user plane network element in the BNG system is faulty; and
send a migration begin request message to the first user plane network element in response to a communication fault occurring between the terminal device and the second user plane network element, wherein the migration begin request message indicates the first user plane network element to send a first keepalive response packet to the terminal device based on the keepalive information, and the first keepalive response packet is a response to and corresponds to a first keepalive request packet sent by the terminal device.
14 . The network device according to claim 13 , wherein:
the keepalive information comprises a terminal identifier, a gateway identifier, and an interface identifier;
the terminal identifier is used to identify the terminal device;
the gateway identifier is used to identify the BNG system; and
the interface identifier is used to identify an interface that is on the first user plane network element and exchanges traffic with the terminal device.
15 . The network device according to claim 13 , wherein the instructions, when executed by the one or more processors, further enable the network device to:
send a migration end request message to the first user plane network element, wherein the migration end request message indicates the first user plane network element to send a second keepalive response packet to the terminal device based on a locally stored forwarding control entry information set, and the second keepalive response packet is a response to a second keepalive request packet sent by the terminal device.
16 . The network device according to claim 15 , wherein the instructions, when executed by the one or more processors, further enable the network device to:
indicate the terminal device to update the locally stored forwarding control entry information set.
17 . The network device according to claim 15 , wherein both the migration begin request message and the migration end request message are packet forwarding control protocol (PFCP)-based node messages.
18 . The network device according to claim 13 , wherein the instructions, when executed by the one or more processors, further enable the network device to:
send the keepalive information to a user plane network element other than the first user plane network element in a warm backup group.
19 . The network device according to claim 13 , wherein the instructions, when executed by the one or more processors, further enable the network device to:
send a keepalive backup request message to the first user plane network element, wherein the keepalive backup request message carries the keepalive information.
20 . A method performed by a broadband network gateway (BNG) system comprising a first user plane network element, a second user plane network element, and a control plane network element, the method comprising:
sending, by the control plane network element, keepalive information of a terminal device to the first user plane network element, wherein the first user plane network element is configured to forward traffic of the terminal device when the second user plane network element is faulty;
sending, by the control plane network element, a migration begin request message to the first user plane network element in response to a communication failure occurring between the terminal device and the second user plane network element; and
in response to both receiving the migration begin request message and receiving a first keepalive request packet sent by the terminal device, sending, by the first user plane network element, a first keepalive response packet corresponding to the first keepalive request packet to the terminal device based on the keepalive information.