Embodiments of this application relate to the field of communication technologies, and in particular, to a traffic monitoring method, a related device, and a system.
Currently, to facilitate management of a large network, the network is divided into different autonomous systems (ASs). Each AS includes a group of forwarding nodes. These forwarding nodes may be devices such as routers or switches. Forwarding nodes in a same AS are managed by a same controller. To facilitate operation and maintenance management of the forwarding nodes in the AS, a traffic distribution feature in the AS needs to be monitored. Currently, in a conventional technology, statistics information of traffic passing through a network node needs to be collected by using another node other than the network node. Therefore, traffic monitoring is complex to implement.
Embodiments of this application provide a traffic monitoring method, a related device, and a system, so that a network node can collect statistics on traffic passing through the network node. Traffic in a network can be monitored more flexibly.
According to a first aspect, a traffic monitoring method is provided. The method is applied to a control node in a network, and the network further includes a plurality of network nodes. The method includes: obtaining traffic statistics data collected by each of the plurality of network nodes; and determining a traffic distribution feature in the network based on the traffic statistics data collected by each network node. Traffic statistics data collected by a first network node in the plurality of network nodes includes a traffic count result of traffic from the first network node to a destination network node that belongs to a same area as the first network node, the destination network node includes an egress node on a path for forwarding a packet by the first network node in the area, and the traffic count result includes a total count of packets forwarded by the first network node to the destination network node.
In an embodiment of the application, to facilitate the control node to analyze a traffic distribution feature in a communication network, for any network node in the network, each of destination network nodes of the network node respectively corresponds to one traffic count result. For the first network node, because destination network nodes of the first network node include the egress node on the path for forwarding a packet by the first network node in the same area, the control node may learn of, based on traffic count results corresponding to the destination network nodes, traffic transmitted from the first network node to egress nodes. This facilitates the control node to determine the traffic distribution feature in the network. In other words, an embodiment of the application provides a method that network nodes collect local aggregated traffic statuses, and then the control node determines the traffic distribution feature in the communication network based on the local aggregated traffic statuses collected by the network nodes. This avoids a case in which traffic statistics information collected by a node other than a forwarding node is used to implement traffic monitoring.
According to the traffic monitoring method provided in the first aspect, in an embodiment, the traffic distribution feature includes a total count of traffic forwarded to a first link by using the first network node as a source node, the first link is a link from a second network node to a third network node, and the second network node and the third network node are network nodes in the plurality of network nodes. In this scenario, an implementation process of determining a traffic distribution feature in the network based on the traffic statistics data collected by each network node may be: determining, based on the traffic statistics data collected by the first network node, the total count of the traffic transmitted to the first link through the first network node, to obtain a first count result; determining, based on traffic statistics data collected by an upstream node of the first network node, a total count of traffic transmitted to the first link through the upstream node of the first network node, to obtain a second count result, where the upstream node is a node that is in the plurality of network nodes and that is on a path including the first network node that forwards a packet to the first link; and calculating a difference between the first count result and the second count result, and using the difference as the total count of the traffic forwarded to the first link by using the first network node as the source node.
Because the network nodes may collect the local aggregated traffic statuses, the control node may directly determine, based on traffic data collected by the network nodes, traffic from the network nodes to a specified link, and further determine that traffic on the specified link includes traffic sent by which source nodes. This can improve efficiency of determining, by the control node, a traffic distribution feature on the specified link.
According to the traffic monitoring method provided in the first aspect, in an embodiment, the foregoing implementation process of determining, based on the traffic statistics data collected by the first network node, the total count of the traffic transmitted to the first link through the first network node may be: determining that paths from the first network node to the destination network node include a path of the first link, and using the destination network node corresponding to the determined path as a statistics node; obtaining, from the traffic statistics data collected by the first network node, a traffic count result corresponding to the statistics node; and determining, based on the traffic count result corresponding to the statistics node, the total count of the traffic transmitted to the first link through the first network node.
The network nodes may collect traffic to destination network nodes through the network nodes. Therefore, the nodes may determine, based on paths from the nodes to the destination network nodes, traffic to a specified link through the nodes, to implement the traffic monitoring method provided in an embodiment of the application.
According to the traffic monitoring method provided in the first aspect, in an embodiment, before the determining, based on traffic statistics data collected by an upstream node of the first network node, a total count of traffic transmitted to the first link through the upstream node of the first network node, the method may further include: determining paths for forwarding a packet to the first link by network nodes in the plurality of network nodes; and obtaining, from the determined paths, a path that includes the first network node, and using a network node corresponding to the obtained path as the upstream node of the first network node.
In an embodiment, the control node may determine the upstream node of the first network node, to implement the traffic monitoring method provided in an embodiment of the application.
According to the traffic monitoring method provided in the first aspect, in an embodiment, when paths for forwarding a packet to a same destination address by the first network node include a plurality of egress nodes, a total count of packets forwarded by the first network node to the plurality of egress nodes is used as a traffic count result corresponding to one virtual destination network node.
For the packet forwarded by the first network node to the same destination address, although there may be a plurality of egress nodes, if the first network node has only one next hop, for the first network node, only a total count of traffic to the next hop needs to be counted. An egress node from which the traffic is transmitted may be determined based on traffic statistics data collected by a downstream node of the first network node. Therefore, in an embodiment of the application, for the plurality of egress nodes, one virtual destination network node may be configured to replace the plurality of egress nodes, to improve efficiency of collecting traffic data by the first network node.
According to the traffic monitoring method provided in the first aspect, in an embodiment, when there are a plurality of next-hop nodes on paths from the first network node to a same destination network node, a count result corresponding to the same destination network node includes a plurality of count results respectively corresponding to the plurality of next-hop nodes, and each of the plurality of count results includes a total count of packets that forward traffic to the same destination network node through a corresponding next-hop node.
For traffic from the first network node to the same destination network node, if the first network node has a plurality of next hops, it indicates that there are a plurality of paths to the same destination network node. In this case, traffic may be separately counted for the plurality of next hops, to further obtain the traffic on the paths. This facilitates more comprehensive and refined monitoring of traffic in the communication network.
According to the traffic monitoring method provided in the first aspect, in an embodiment, the total count is a total quantity of the packets or a total quantity of bytes of the packets.
Monitoring traffic may be collecting statistics on a quantity of forwarded packets, or collecting statistics on total bytes of forwarded packets. This can improve flexibility of the traffic monitoring method provided in an embodiment of the application.
According to a second aspect, a traffic monitoring method is provided. The method is applied to a first network node in a network. The method includes:
obtaining traffic statistics data, where the traffic statistics data includes a traffic count result of traffic from the first network node to a destination network node that belongs to a same area as the first network node, the destination network node includes an egress node on a path for forwarding a packet by the first network node in the area, and the traffic count result includes a total count of packets forwarded by the first network node to the destination network node; and sending the traffic statistics data to a control node in the network.
In an embodiment of the application, to facilitate the control node to analyze a traffic distribution feature in a communication network, for any network node in the network, each of destination network nodes of the network node respectively corresponds to one traffic count result. Because the destination network nodes of the network node include an egress node on a path for forwarding a packet by the network node in a same area, the control node may learn of, based on the traffic count results corresponding to the destination network nodes, traffic transmitted from the network node to the egress nodes. This facilitates the control node to determine the traffic distribution feature in the network. In other words, an embodiment of the application provides a method that network nodes collect local aggregated traffic statuses, and then the control node determines the traffic distribution feature in the communication network based on the local aggregated traffic statuses collected by the network nodes.
According to the traffic monitoring method provided in the second aspect, in an embodiment, the method includes: obtaining a first destination address of a to-be-forwarded first packet; determining a first destination network node based on the first destination address, where the first destination network node includes an egress node on a path for forwarding the first packet by the first network node in the area; and updating a traffic count result corresponding to the first destination network node.
To implement accurate traffic monitoring, the network node can update a traffic count result each time the network node forwards a packet.
According to the traffic monitoring method provided in the second aspect, in an embodiment, an implementation of the determining a first destination network node based on the first destination address may be: obtaining, from a correspondence between a destination address and a destination network node, a destination network node corresponding to the first destination address, to obtain the first destination network node.
The network node may generate the foregoing correspondence in advance, so that the traffic count result can be quickly updated when forwarding a packet.
According to the traffic monitoring method provided in the second aspect, in an embodiment, when there is one egress node on a path for forwarding the first packet to the first destination address by the first network node, the first destination network node is an egress node on the path for forwarding the first packet to the first destination address by the first network node.
According to the traffic monitoring method provided in the second aspect, in an embodiment, when there are a plurality of egress nodes on a path for forwarding the first packet to the first destination address by the first network node, the first destination network node is a virtual destination network node corresponding to the plurality of egress nodes.
For a packet forwarded by the first network node to a same destination address, although there may be a plurality of egress nodes, if the first network node has only one next hop, for the first network node, only a total count of traffic to the next hop needs to be counted. An egress node from which the traffic is transmitted may be determined based on traffic statistics data collected by a downstream node of the first network node. Therefore, in an embodiment of the application, for the plurality of egress nodes, one virtual destination network node may be configured to replace the plurality of egress nodes, to improve efficiency of collecting traffic data by the first network node.
According to the traffic monitoring method provided in the second aspect, in an embodiment, the traffic count result corresponding to the first destination network node includes traffic count results respectively corresponding to next-hop nodes, and a traffic count result corresponding to any next-hop node includes a total count of packets forwarded to the first destination network node through the corresponding next-hop node. In this scenario, an implementation process of the updating a traffic count result corresponding to the first destination network node may be: obtaining, from a routing and forwarding table, one or more next-hop nodes corresponding to the first destination address, where the routing and forwarding table includes next-hop nodes respectively corresponding to a plurality of destination addresses; selecting, from the one or more next-hop nodes, a next-hop node that forwards the first packet, to obtain a target next-hop node; and updating a traffic count result corresponding to the target next-hop node in the traffic count result corresponding to the first destination network node.
For traffic from the network node to a same destination network node, if the network node has a plurality of next hops, it indicates that there are a plurality of paths to the same destination network node. In this case, traffic may be separately counted for the plurality of next hops, to further obtain the traffic on the paths. This facilitates more comprehensive and refined monitoring of traffic in the communication network.
According to the traffic monitoring method provided in the second aspect, in an embodiment, the first destination network node corresponds to a counter array, and the counter array includes counters respectively corresponding to the next-hop nodes on a path for forwarding a packet to the first destination network node by the first network node, and the counter includes a traffic count result corresponding to a corresponding next-hop node. In this scenario, an implementation process of the updating a traffic count result corresponding to the target next-hop node may be: searching for a counter corresponding to the target next-hop node; and updating a traffic count result in the found counter.
In an embodiment of the application, statistics on the traffic count result may be collected by using a hardware counter. This can improve flexibility of the traffic monitoring method provided in an embodiment of the application.
According to the traffic monitoring method provided in the second aspect, in an embodiment, a start address of the counter array corresponding to the first destination network node is further configured for the first destination address in the routing and forwarding table. In this scenario, an implementation process of the searching for a counter corresponding to the target next-hop node may be: determining, based on the target next-hop node and the start address of the counter array corresponding to the first destination network node configured for the first destination address in the routing and forwarding table, an address of the counter corresponding to the target next-hop node; and searching, based on the address of the counter corresponding to the target next-hop node, for the counter corresponding to the target next-hop node.
When the hardware counter is deployed to collect statistics on the traffic count result, a routing and forwarding table in the conventional technology may be expanded, and a start address of a counter array is added to the routing and forwarding table. Because offset addresses of counters corresponding to next hops relative to the start address of the counter array is known, after a next hop is determined, an address of a to-be-updated counter may be determined based on the next hop. After the address of the counter is obtained, the counter may be found based on the address, to update a count result stored in the counter.
According to the traffic monitoring method provided in the second aspect, in an embodiment, the total count is a total quantity of the packets or a total quantity of bytes of the packets.
Monitoring traffic may be collecting statistics on a quantity of forwarded packets, or collecting statistics on total bytes of forwarded packets. This can improve flexibility of the traffic monitoring method provided in an embodiment of the application.
According to a third aspect, a control node is provided. The control node has functions of implementing behaviors in the traffic monitoring method in the first aspect. The control node includes at least one module, and the at least one module is configured to implement the traffic monitoring method provided in the first aspect.
According to a fourth aspect, a first network node is provided. The first network node has functions of implementing behaviors in the traffic monitoring method in the second aspect. The network node includes at least one module, and the at least one module is configured to implement the traffic monitoring method provided in the second aspect.
According to a fifth aspect, a control node is provided. The control node includes a memory and a processor.
The memory is configured to store a computer program.
The processor is configured to execute the computer program stored in the memory, to perform the method according to an embodiment of the first aspect.
According to a sixth aspect, a first network node is provided. The network node includes a memory and a processor.
The memory is configured to store a computer program.
The processor is configured to execute the computer program stored in the memory, to perform the method according to an embodiment of the second aspect.
According to a seventh aspect, a chip is provided. The chip is disposed in a control node, and the chip includes a processor and an interface circuit.
The interface circuit is configured to receive instructions and transmit the instructions to the processor.
The processor is configured to perform the method according to an embodiment of the first aspect.
According to an eighth aspect, a chip is provided. The chip is disposed in a first network node, and the chip includes a processor and an interface circuit.
The interface circuit is configured to receive instructions and transmit the instructions to the processor.
The processor is configured to perform the method according to an embodiment of the second aspect.
According to a ninth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the computer is enabled to perform the traffic monitoring method according to the first aspect or the second aspect.
According to a tenth aspect, a computer program product including instructions is provided. When the instructions are run on a computer, the computer is enabled to perform the traffic monitoring method according to the first aspect or the second aspect.
According to an eleventh aspect, a traffic monitoring system is provided. The system includes a control node and a plurality of network nodes.
A first network node in the plurality of network nodes is configured to implement the method according to an embodiment of the second aspect, and the first network node is any one of the plurality of network nodes.
The control node is configured to implement the method according to an embodiment of the first aspect.
Technical effects obtained in the third aspect to the eleventh aspect are similar to technical effects obtained by using corresponding technical means in the first aspect and the second aspect. Details are not described herein again.
To make the objectives, technical solutions, and advantages of this application clearer, the following further describes the implementations of the embodiments of this application in detail with reference to the accompanying drawings.
Each of the network nodes 101 in
In an embodiment, the network node 101 may actively report, to the control node 101, the traffic statistics data collected by the network node 101. In an embodiment, the control node 102 may request, from the network node 101, the traffic statistics data collected by the network node 101. An implementation of how the control node obtains the traffic statistics data collected by the network node is not limited in an embodiment of the application. In an embodiment of the application, an obtaining manner may be adaptively selected based on a required scenario.
For example, in a scenario in which the traffic distribution feature in the communication network needs to be periodically determined, the network nodes may be configured to periodically proactively report the traffic statistics data collected by the network nodes. For another example, in a scenario in which network congestion occurs, the control node needs to determine the traffic distribution feature in the communication network to analyze a congestion cause. In this case, the control node may deliver a request message to the network node, so that the network node passively reports the traffic statistics data collected by the network node.
The communication network shown in
In an embodiment of the application, the network nodes in the AS may exchange routing information based on an interior gateway protocol (IGP), so that each network node can learn of a network node topology structure of the communication network, and automatically generate a routing and forwarding table.
A link status routing protocol is a type of interior gateway protocol, including, for example, the open shortest path first (OSPF) protocol, and the intermediate system to intermediate system (ISIS) protocol. In the link status routing protocol, each network node generates link status information (LSA) about a directly connected network of the network node. The link status information includes information such as adjacent network node information of the network node and an address of a device connected to the network node. The link status information is transmitted to another network node through an adjacent network node. In this way, each network node in the communication network keeps a copy of the link status information, but does not change it. Finally, each network node stores link status information of the other network nodes in the entire network. The entire network topology structure of the communication network can be learned by using the link status information of the network nodes in the entire network. In this way, each network node has same information about the topology structure of the communication network. Then, each network node can use a “shortest path first” algorithm to calculate an optimal route to destination addresses, and generate the routing and forwarding table. The routing and forwarding table includes route information to the destination addresses, and the routing and forwarding table may also be referred to as a forwarding entry or the like.
As shown in
For any network node in the communication network, after learning of the LSDB, the network node may generate a local routing and forwarding table based on the LSDB. As shown in
In an embodiment, when a network in the AS is large, to control an LSA flooding scale and an SPF calculation scale, the AS may also be divided into a plurality of areas, and network nodes in each area generate intra-area link status information by using the method in
When the AS is divided into the plurality of areas, the communication network shown in
It can be learned that the communication network shown in an embodiment of the application may be a network corresponding to the AS, or may be a network corresponding to an area obtained by dividing the AS. This is not specifically limited in an embodiment of the application.
In addition, the network node in
The following describes the traffic monitoring method provided in the embodiments of this application. The traffic monitoring method provided in an embodiment of the application mainly includes two parts of content. One part of content describes how a network node collects traffic statistics data, and the other part of content describes how a control node determines a traffic distribution feature in a communication network based on the traffic statistics data collected by the network node. The following embodiments explain and describe the foregoing two parts of content.
Operation 401: A first network node obtains traffic statistics data.
The first network node in operation 401 is any network node in a plurality of network nodes included in the communication network.
In an embodiment of the application, to facilitate a control node to analyze a traffic distribution feature in the communication network, for any network node in the communication network, each of destination network nodes that belongs to a same area as the network node respectively corresponds to one traffic count result. For the first network node, a destination network node of the first network node includes an egress node on a path for forwarding a packet by the first network node in the area. It should be noted that there may be one or more destination network nodes of the first network node. A traffic count result corresponding to any destination network node includes a total count of packets forwarded by the first network node to the corresponding destination network node. In this way, after forwarding the packet, the first network node may update a corresponding traffic count result based on the egress node on the path for forwarding a packet, so that the first network node can locally collect statistics on forwarded traffic.
Because the destination network nodes include the egress node on the path for forwarding a packet by the first network node in the area, the control node may learn of, based on traffic count results corresponding to the destination network nodes, traffic count results of traffic transmitted from the first network node to egress nodes. This facilitates the control node to subsequently determine the traffic distribution feature in the network.
The total count of the packets may be a total quantity of sent packets (for example, a quantity of total packets), or may be a total quantity of bytes of sent packets. This is not limited in an embodiment of the application.
How the first network node updates the corresponding traffic count result is described in detail in the following content. For ease of subsequent description, the following first describes the destination network node.
The communication network shown in
If the communication network shown in
If the communication network shown in
For example, an embodiment of determining the destination network node of the first network node may be as follows: The first network node obtains, based on a link state protocol, link status information of the network nodes in the network, and obtains, from the link status information of the network nodes, addresses of devices connected to the network nodes in the network, to obtain all destination addresses. The device may be a host or a network node. For any destination address, a path for forwarding a packet to the destination address by the first network node is obtained based on the minimum spanning tree shown in
Three scenarios shown in
In a scenario 1 shown in
In a scenario 2 shown in
In a scenario 3 shown in
Further, for the scenario 3 shown in
In other words, when egress nodes on a path for forwarding a packet to a same destination address by the first network node include a plurality of egress nodes, a total count of packets forwarded by the first network node to the plurality of egress nodes is used as a traffic count result corresponding to one virtual destination network node. In this case, for the first network node, one destination address corresponds to one destination network node.
After the destination network node is determined for the first network node, for any determined destination network node, there may be a case in which there is more than one next-hop node on a path from the first network node to the destination network node. In this case, traffic transmitted to the destination network node on a path may be counted, so that a more comprehensive and detailed traffic distribution feature can be subsequently analyzed.
In other words, for the first destination network node in destination network nodes of the first network node, when there are a plurality of next-hop nodes on a path from the first network node to the first destination network node, a count result corresponding to the first destination network node includes a plurality of count results respectively corresponding to the plurality of next-hop nodes, and a count result corresponding to any next-hop node includes a total count of packets forwarded to the first destination network node through the corresponding next-hop node. The next-hop node may be a next network node on a path for forwarding a packet by the first destination network node, or may be an egress port for forwarding a packet to a next network node by the first network node, namely, a next-hop egress port.
For example, for the scenario 1 shown in
In addition, in an embodiment of the application, a software module deployed in the first network node may be used to collect statistics on a forwarded packet, to obtain the traffic count result. Alternatively, a hardware counter deployed in the first network node may be used to collect statistics on a forwarded packet. This is not limited in an embodiment of the application.
When collecting the traffic statistics data by using a counter, each destination network node may correspond to one counter array. For the first destination network node in the destination network nodes, a counter array corresponding to the first destination network node includes counters respectively corresponding to next-hop nodes on the path for forwarding a packet to the first destination network node by the first network node. Each counter includes a traffic count result corresponding to a corresponding next-hop node. In other words, a quantity of counters included in each counter array is the same as a quantity of next-hop nodes through which the first network node arrives at a corresponding destination network node. The first destination network node is any one of the destination network nodes of the first network node. Similarly, the next-hop nodes may be a next network node on a path for forwarding a packet by the first destination network node, or may be an egress port for forwarding a packet to a next network node by the first network node, namely, a next-hop egress port.
For example, for the scenario 1 shown in
For another example, for the scenario 2 shown in
For another example, for the scenario 3 shown in
In addition, for one counter in a same counter array, the counter may be marked by using a combination of an identifier of a destination network node and an identifier of the next-hop node. In other words, after the destination network nodes of the first network node are determined, for any destination network node, counters in a counter array corresponding to the destination network node may be created by using an identifier of the destination network node and the identifier of the next-hop node as an index, so that the counters can be subsequently found based on the index.
In addition, the total count in the traffic count result may be the total quantity of sent packets, or may be the total quantity of bytes of sent packets. Therefore, the counter in an embodiment of the application may be a packet quantity counter. Any counter is configured to count a total quantity of packets forwarded through a corresponding next-hop node. The counter may also be a packet byte (Byte) quantity counter. Any counter is configured to count a total quantity of bytes of packets forwarded through a corresponding next-hop node. For example, for any counter, if a packet whose length is N bytes is forwarded through a next-hop node corresponding to the counter, the counter increases a traffic count result by N.
The foregoing traffic count results may be updated each time after the first network node forwards a packet, so that the traffic count result can represent a total count of traffic recently forwarded by a corresponding node. Therefore, in an embodiment, for a to-be-forwarded first packet, the first network node may obtain a first destination address of the to-be-forwarded first packet; determine the first destination network node based on the first destination address, where the first destination network node includes an egress node on a path for forwarding the first packet by the first network node in the area; and update a traffic count result corresponding to the first destination network node.
Because the destination network nodes are determined based on the destination addresses, after the destination network nodes are determined, the destination network nodes determined based on the destination addresses may be stored in a correspondence between the destination address and the destination network node, to generate the correspondence between the destination address and the destination network node. In this scenario, an embodiment of determining the first destination network node based on the first destination address may be: obtaining, from the correspondence between the destination address and the destination network node, a destination network node corresponding to the first destination address, to obtain the first destination network node.
For example, Table 1 is a correspondence between a destination address and a destination network node according to an embodiment of the application. As shown in Table 1, in the correspondence, a destination address 1 corresponds to a destination network node 1, a destination address 2 corresponds to a destination network node 2, and a destination address N corresponds to a destination network node N. It is assumed that the first destination address is the destination address 2, and based on the correspondence shown in Table 1, it may be determined that the first destination network node is the destination network node 2.
It should be noted that in Table 1, an example in which one destination address corresponds to one destination network node is used for description. In an embodiment, one destination address may also correspond to a plurality of destination network nodes. For example, for the scenario 3 shown in
In addition, it can be learned based on the foregoing process of determining the destination network node that, in an embodiment, if no virtual destination network node is configured, all determined egress nodes are directly used as the destination network nodes. In this case, the first destination network node is an egress node on a path for forwarding the first packet to the first destination address by the first network node.
In an embodiment, if the virtual destination network node is configured, when there is one egress node on the path for forwarding a packet to the first destination address by the first network node, the first destination network node is the egress node on the path for forwarding the first packet to the first destination address by the first network node. When there are a plurality of egress nodes on the path for forwarding the first packet to the first destination address by the first network node, the first destination network node is a virtual destination network node corresponding to the plurality of egress nodes.
Further, if there are a plurality of next-hop nodes on a path from the first network node to the first destination network node, in this scenario, to separately collect statistics on a total count of traffic transmitted from next-hop nodes, the traffic count result corresponding to the first destination network node includes traffic count results corresponding to the next-hop nodes, and each of the traffic count results corresponding to the next-hop nodes respectively includes a total count of packets forwarded to the first destination network node through the corresponding next-hop node.
In this scenario, because a routing and forwarding table includes next-hop nodes respectively corresponding to a plurality of destination addresses, an implementation of updating the count result corresponding to the first destination network node may be: obtaining, from the routing and forwarding table, one or more next-hop nodes corresponding to the first destination address, and selecting, from the one or more next-hop nodes, a next-hop node for forwarding the first packet, to obtain a target next-hop node; and updating a traffic count result corresponding to the target next-hop node in the traffic count result corresponding to the first destination network node.
An implementation process of updating the traffic count result corresponding to the target next-hop node may be: searching for a counter corresponding to the target next-hop node; and updating a traffic count result in the found counter.
In an embodiment, if the counters in the counter array corresponding to the destination network node are pre-created by using the identifier of the destination network node and the identifier of the next-hop node as the index, a to-be-updated counter may be directly found based on an identifier of the first destination network node and an identifier of the target next-hop node as an index.
In an embodiment, to determine addresses of the counters, so as to quickly update the count result, a start address of the counter array corresponding to the first destination network node may be further configured in the routing and forwarding table for the first destination address. In this scenario, an implementation process of searching for the counter corresponding to the target next-hop node may be: determining, based on the target next-hop node and the start address of the counter array corresponding to the first destination network node configured for the first destination address in the routing and forwarding table, an address of the counter corresponding to the target next-hop node; and searching, based on the address of the counter corresponding to the target next-hop node, for the counter corresponding to the target next-hop node.
It should be noted that, when there are the plurality of next-hop nodes, the next-hop node is usually selected in an equal-cost load balancing manner according to a hash algorithm. In other words, the first destination address carried in the first packet is mapped according to the hash algorithm. A probability of mapping the first destination address to the next-hop nodes in the hash algorithm is the same. After the next-hop node is determined by using the hash algorithm, because offset addresses of addresses of the counters corresponding to the next-hop nodes relative to the start address of the counter array is known, the address of the counter corresponding to the target next-hop node may be determined based on the target next-hop node and the start address of the counter array corresponding to the first destination network node further configured for the first destination address in the routing and forwarding table.
A table shown on the left of
It can be learned that, compared with the routing and forwarding table shown in
In addition, the offset addresses of the addresses of the counters corresponding to the next-hop nodes relative to the start address of the counter array is known. Therefore, as shown in
According to the schematic diagram of the routing and forwarding table and the offset address shown in
Table 2 is a schematic diagram of count results of destination network nodes corresponding to the node A. As shown in Table 2, a traffic count result corresponding to the destination network node C is 2 G, and this indicates that a total count of traffic from a host directly connected to the node A (this type of host sends a packet whose source addresses include IP_A_1, IP_A_2, . . . , and IP_A_N, and destination addresses include IP_C_1, IP_C_2, . . . , and IP_C_N) to a host directly connected to node F is 2 G. A traffic count result corresponding to the destination network node F is 3 G, which is used to indicate that a total count of traffic from the host directly connected to the node A (this type of host sends a packet whose source addresses include IP_A_1, IP_A_2, . . . , and IP_A_N, and destination addresses include IP_F_1, IP_F_2, . . . , and IP_F_N) to the host directly connected to node F is 3 G. A count result corresponding to other destination network nodes is 0, and this indicates that the host directly connected to the node A does not send traffic to a host directly connected to the several destination network nodes.
After determining the count results corresponding to the destination network nodes, the node A may determine traffic distribution on paths according to a minimum spanning tree of the node A.
C is 2 G, and a total count of traffic transmitted on the path: the node A→the node B→the node E→the node F is 3 G.
Table 3 and Table 4 respectively show traffic statistics data collected by the node B and the node E. As shown in Table 3, for the node B shown in
With reference to the network architecture shown in
As shown in Table 4, for the node E shown in
With reference to the minimum spanning trees of the node E shown in
In addition, local traffic distribution of the network nodes may be analyzed by the network nodes based on traffic statistics data of the destination network nodes collected by the network nodes. In an embodiment, the control node may also perform this operation. This is not limited in an embodiment of the application.
Operation 402: The first network node sends the collected traffic statistics data to the control node in the network.
Based on the system architecture shown in
In the foregoing operation 401 and operation 402, the first network node is used as an example to explain how the network nodes locally collect the traffic statistics data. For an embodiment in which any other network node collects the traffic statistics data, refer to operation 401 and operation 402.
After the network nodes in the network send the collected traffic statistics data to the control node in the network, the control node may analyze the traffic distribution feature in the communication network based on the following operation 403 and operation 404.
Operation 403: The control node obtains the traffic statistics data collected by the network nodes in the network.
For an embodiment of how the control node obtains the traffic statistics data collected by the network nodes in the plurality of network nodes in the communication network, refer to the explanation in operation 402. Details are not described herein again.
Operation 404: The control node determines the traffic distribution feature in the network based on traffic statistics data collected by each network node.
In an embodiment of the application, if a link is overloaded, a traffic source on the link needs to be analyzed, to control the traffic source, and control traffic on the link. Therefore, in an embodiment, the traffic distribution feature in the communication network may include traffic on any link in the communication network includes traffic sent by which source node, for example, a source of the traffic. Therefore, in an embodiment, for any first link in the communication network, the control node determines the traffic distribution feature in the communication network, for example, determines a total count of traffic forwarded by source nodes to the first link. The following description uses an example in which a total count of traffic forwarded to the first link by using the first network node as a source node is determined. After the total count of traffic forwarded to the first link by the source nodes is obtained, a source of traffic on the link is determined.
The first link is a link from a second network node to a third network node. The second network node and the third network node are two network nodes in the plurality of network nodes. In other words, the first link is any link. In this scenario, an embodiment of operation 404 may be: determining, based on traffic statistics data collected by the first network node, a total count of traffic transmitted to the first link through the first network node, to obtain a first count result; and determining, based on traffic statistics data collected by an upstream node of the first network node, a total count of traffic transmitted to the first link through the upstream node of the first network node, to obtain a second count result. A difference between the first count result and the second count result is determined as the total count of traffic forwarded to the first link by using the first network node as the source node. The upstream node is a network node that is in the plurality of network nodes and that is on a path including the first network node that forwards a packet to the first link.
Because the traffic forwarded by the first network node to the first link may also include the traffic forwarded by the upstream node of the first network node to the first link, when a traffic count result of traffic forwarded to the first link by using the first network node as the source node is determined, only the total count of traffic transmitted to the first link through the first network node and the total count of traffic transmitted to the first link through the upstream node of the first network node need to be determined. The difference between the two total counts is the total count of traffic forwarded to the first link by using the first network node as the source node.
The upstream node of the first network node is a network node on a path including the first network node that forwards a packet to the first link. The upstream node of the first network node may be predetermined by the control node. In an embodiment, an implementation process in which the control node determines the upstream node of the first network node may be: The control node may determine paths for forwarding a packet to the first link by network nodes other than the first network node in the plurality of network nodes; and obtain, from the determined paths, a path including the first network node, and use a network node corresponding to the obtained path as the upstream node of the first network node.
The control node may determine, based on minimum spanning trees of other network nodes other than the first network node, paths for forwarding a packet to the first link by the network nodes other than the first network node.
For example, for the communication network shown in
In addition, an embodiment of determining, based on the traffic statistics data collected by the first network node, the total count of traffic transmitted to the first link through the first network node may be: determining that paths from the first network node to the destination network node include a path of the first link, and using the destination network node corresponding to the determined path as a statistics node; obtaining, from the traffic statistics data collected by the first network node, a count result corresponding to the statistics node; and determining, based on a traffic count result corresponding to the statistics node, the total count of the traffic transmitted to the first link through the first network node.
When there is only one determined statistics node, a traffic count result collected by the first network node corresponding to the statistics node may be directly used as the total count of traffic transmitted to the first link through the first network node. Correspondingly, when there are a plurality of determined destination nodes, a plurality of traffic count results that are collected by the first network node and that are in a one-to-one correspondence with the plurality of statistics nodes may be added to obtain a sum, and the sum is used as the total count of traffic transmitted to the first link through the first network node.
The path including the first link in the paths from the first network node to the destination network nodes may also be determined based on a minimum spanning tree of the first network node. Details are not described herein again.
It can be learned that, in an embodiment of the application, a total count of traffic destined for a specified link by using a given device N as a source may be a sum of traffic count results corresponding to a device set that includes the specified link in a path from the device N to another device (the another device is a destination network node), for example, a total count of traffic from the device N to the link. For example, in the minimum spanning tree of the node A shown in
After the total count of traffic transmitted to the first link through the first network node and the total count of traffic transmitted to the first link through the upstream node of the first network node are determined, the difference between the two total counts may be determined as the total count of traffic transmitted to the first link by using the first network node as the source.
For example, for the communication network shown in
For another example, for the communication network shown in
For another example, for the communication network shown in
The foregoing node without an upstream node may further be referred to as a root upstream node or a root upstream device, and the node with an upstream node may further be referred to as a non-root upstream node or a non-root upstream device. This is not limited in an embodiment of the application.
In addition, when composition of traffic on the first link is determined in operation 404, because only the upstream node of the first link transmits a packet to the first link, in operation 404, only traffic count results of traffic transmitted to the first link by using upstream nodes of the first link as a source may be determined. In this case, in operation 404, the first network node is one node in the upstream nodes of the first link.
The upstream node of the first link is a node that can transmit a packet to the first link. For example, in a minimum spanning tree of a node, if the minimum spanning tree includes the first link, the node is used as the upstream node of the first link.
Therefore, in an embodiment, the control node may predetermine an upstream node of links, to obtain an upstream node set of the links. Then, for any link, in operation 404, a total count of traffic transmitted to the link by using upstream nodes as a source in the corresponding upstream node set is determined.
For example, the link B→E is used as an example. In the figure, the minimum spanning trees of the nodes A, B, and C all include the link. Therefore, an upstream node set of the link B→C is {A, B, C}. In other words, the nodes A, B, and C are upstream nodes of the link B→C. In the foregoing implementations, total counts of traffic transmitted to the link B→C by using the nodes A, B, and C as sources are separately determined, that is, a traffic distribution feature on the link.
In conclusion, based on operation 401, the network nodes in the communication network may collect the traffic statistics data. A node-based aggregation traffic count function is added to a chip of the network node. This function enables each network node to collect statistics on traffic to the destination network nodes through the network node, to collect a local aggregation traffic status. For example, for the communication network shown in
Then, the control node in the communication network may obtain a network-wide traffic status by using the foregoing operation 403 to operation 404. In other words, the control node may combine network-wide aggregation traffic based on the traffic statistics data collected by the network nodes, to generate a network-wide traffic model. The network-wide traffic model is an obtained traffic status distribution feature of the communication network. For example, for the communication network shown in
In an embodiment of the application, after determining the traffic distribution feature in the communication network, the control node may further evaluate utilization of the links based on a network-wide traffic distribution feature, and generate threshold-crossing and overload alarms. For example, for the communication network shown in
In addition, after determining that a link is overloaded, the control node may add, for an overload location, a logical link (shortcut) used for load sharing, to alleviate overload. The logical link may also be referred to as a tunnel. A proper cost value is set for the tunnel based on the traffic distribution feature and delivered to the network node, so that the network node can offload some traffic to the tunnel based on the cost value.
For example, for the communication network shown in
After receiving newly delivered tunnel-related information, the node B recalculates a path based on a current topology. Because the cost value of the tunnel delivered by the control node is less than the sum of the costs of B→E and E→D, the node B executes the shortest path algorithm to generate a shortest path to D, for example, B directly arrives at D through the tunnel. In other words, a new forwarding path of traffic from the node C to D is C→B→A→D.
It can be learned that, as shown in
It should be noted that the foregoing three aspects are merely three applications of the traffic monitoring method provided in the embodiments of this application. The traffic monitoring method provided in the embodiments of this application may alternatively be applied to another scenario. Details are not described herein again.
The following describes structures of nodes in the communication network provided in an embodiment of the application.
The main control board 1110 is configured to complete functions such as system management, device maintenance, and protocol processing. The interface boards 1130 and 1140 are configured to provide various service interfaces (for example, a POS interface, a GE interface, and an ATM interface), and forward a packet. The main control board 1110 mainly includes three types of function units: a system management and control unit, a system clock unit, and a system maintenance unit. The main control board 1110, the interface board 1130, and the interface board 1140 are connected to a system backboard by using a system bus to implement interworking. The interface board 1130 includes one or more processors 1131. The processor 1131 is configured to control and manage the interface board, communicate with a central processing unit on the main control board, and forward a packet. A memory 1132 on the interface board 1130 is configured to store a forwarding entry or a routing and forwarding table. The processor 1131 forwards a packet by searching the forwarding entry or the routing and forwarding table stored in the memory 1132.
The interface board 1130 includes one or more network interfaces 1133, configured to receive a packet sent by a previous-hop node, and send a processed packet to a next-hop node according to instructions of the processor 1131. Implementation processes are not described herein again. In addition, in an embodiment of the application, the one or more network interfaces 1133 are further configured to send the traffic statistics data in operation 401 to a control node, so that the control node can determine a traffic count result distribution feature in the communication network by using operation 403 and operation 404 in
It may be understood that, as shown in
In addition, it should be noted that there may be one or more main control boards. When there are a plurality of main control boards, the main control boards may include an active main control board and a backup main control board. There may be one or more interface boards, and a device having a stronger data processing capability provides more interface boards. If there are a plurality of interface boards, the plurality of interface boards can communicate with each other by using one or more switching boards, and the plurality of interface boards can jointly implement load sharing and redundancy backup. In a centralized forwarding architecture, the device may not need the switching board, and the interface board provides a function of processing service data of an entire system. In a distributed forwarding architecture, the device includes a plurality of interface boards. Data exchange between the plurality of interface boards may be implemented by using a switching board, and the plurality of interface boards can provide a large-capacity data exchange and processing capability. Therefore, a data access and processing capability of a network device in the distributed architecture is better than that of a device in the centralized architecture. An architecture to be used depends on a networking deployment scenario, and is not limited herein.
In an embodiment, the memory 1132 may be a read-only memory (ROM), another type of static storage device that can store static information and instructions, a random access memory (RAM), or another type of dynamic storage device that can store information and instructions, or may be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another compact disc storage, an optical disc storage (including a compact optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, and the like), a magnetic disk or another magnetic storage device, or any other medium that can be used to carry or store expected program code in a form of instructions or a data structure and that can be accessed by a computer. However, the memory is not limited thereto. The memory 1132 may exist independently, and is connected to the processor 1131 by using a communication bus. The memory 1132 may alternatively be integrated with the processor 1131.
The memory 1132 is configured to store program code, and execution is controlled by the processor 1131, to perform the packet forwarding method provided in the foregoing embodiment. The processor 1131 is configured to execute the program code stored in the memory 1132. The program code may include one or more software modules. The one or more software modules may be the software module provided in an embodiment in
In an embodiment, the network interface 1133 may be an apparatus that uses any transceiver, and is configured to communicate with another device or a communication network, for example, the Ethernet, a radio access network (RAN), and a wireless local area network (WLAN).
The network processor 1232 is configured to determine the count result included in operation 401, to obtain traffic statistics data. Functions of the network processor 1232 are not described herein again.
The physical interface card 1233 is further configured to send the traffic statistics data collected in operation 401 to a control node, so that the control node can determine a traffic count result distribution feature in the communication network by using operation 403 to operation 404 in
It may be understood that, as shown in
In addition, it should be noted that there may be one or more main control boards. When there are a plurality of main control boards, the main control boards may include an active main control board and a backup main control board. There may be one or more interface boards, and a device having a stronger data processing capability provides more interface boards. There may also be one or more physical interface cards on the interface board. There may be no switching board or one or more switching boards. When there are a plurality of switching boards, load sharing and redundancy backup may be implemented by the switching boards together. In a centralized forwarding architecture, the device may not need the switching board, and the interface board provides a function of processing service data of an entire system. In a distributed forwarding architecture, the device may have at least one switching board, and data exchange between a plurality of interface boards is implemented through the switching board, to provide a large-capacity data exchange and processing capability. Therefore, a data access and processing capability of a network device in the distributed architecture is better than that of a device in the centralized architecture. An architecture to be used depends on a networking deployment scenario, and is not limited herein.
The PIC physical interface card is configured to implement a physical layer interconnection function. An original traffic count result enters the interface board of the network device, and a processed packet is sent from the PIC card.
The network processor NP 1310 is configured to forward a packet. For example, processing of an upstream packet includes: ingress interface processing of a packet, timestamp obtaining, upstream traffic classification, forwarding table searching, measurement information encapsulation, and packet duplication processing. Processing of a downstream packet includes: forwarding table searching, downstream traffic classification, timestamp obtaining, measurement information encapsulation, egress port processing, and the like.
The traffic count result management TM module 1320 is configured to implement functions such as QoS, line-rate forwarding, large-capacity buffering, and queue management. For example, uplink traffic count result management includes uplink QoS processing (such as congestion management and queue scheduling) and slice processing. Downlink traffic count result management includes packet assembly processing, multicast duplication, and downlink QoS processing (such as congestion management and queue scheduling).
It may be understood that if the network device has a plurality of interface boards 1300, the plurality of interface boards 1300 may communicate with each other by using a switched network 1340.
It should be noted that
an obtaining module 1401, configured to obtain traffic statistics data collected by each of the plurality of network nodes. For an embodiment, refer to operation 403 in the embodiment in
Traffic statistics data collected by a first network node in the plurality of network nodes includes a traffic count result of traffic from the first network node to a destination network node that belongs to a same area as the first network node, the destination network node includes an egress node on a path for forwarding a packet by the first network node in the area, and the traffic count result includes a total count of packets forwarded by the first network node to the destination network node.
The control node further includes a determining module 1402, configured to determine a traffic distribution feature in the network based on the traffic statistics data collected by each network node. For an embodiment, refer to operation 404 in the embodiment in
In an embodiment, the traffic distribution feature includes a total count of traffic forwarded to the first link by using the first network node as a source node, the first link is a link from a second network node to a third network node, and the second network node and the third network node are network nodes in the plurality of network nodes.
The determining module is configured to:
determine, based on the traffic statistics data collected by the first network node, the total count of the traffic transmitted to the first link through the first network node, to obtain a first count result;
determine, based on traffic statistics data collected by an upstream node of the first network node, a total count of traffic transmitted to the first link through the upstream node of the first network node, to obtain a second count result, where the upstream node is a node that is in the plurality of network nodes and that is on a path including the first network node that forwards a packet to the first link; and
calculate a difference between the first count result and the second count result, and use the difference as the total count of the traffic forwarded to the first link by using the first network node as the source node.
In an embodiment, the determining module is configured to:
determine that paths from the first network node to the destination network node include a path of the first link, and use the destination network node corresponding to the determined path as a statistics node;
obtain, from the traffic statistics data collected by the first network node, a traffic count result corresponding to the statistics node; and
determine, based on the traffic count result corresponding to the statistics node, the total count of the traffic transmitted to the first link through the first network node.
In an embodiment, the determining module is further configured to:
determine paths for forwarding a packet to the first link by network nodes in the plurality of network nodes; and
obtain, from the determined paths, a path including the first network node, and use a network node corresponding to the obtained path as the upstream node of the first network node.
In an embodiment, when paths for forwarding a packet to a same destination address by the first network node include a plurality of egress nodes, a total count of packets forwarded by the first network node to the plurality of egress nodes is used as a traffic count result corresponding to one virtual destination network node.
In an embodiment, when there are a plurality of next-hop nodes on paths from the first network node to the same destination network node, a count result corresponding to the same destination network node includes a plurality of count results respectively corresponding to the plurality of next-hop nodes. Each of the plurality of count results includes a total count of packets forwarding traffic to the same destination network node through a corresponding next-hop node.
In an embodiment, the total count is a total quantity of the packets or a total quantity of bytes of the packets.
In an embodiment of the application, to facilitate the control node to analyze a traffic distribution feature in a communication network, for any network node in the network, each of destination network nodes of the network node respectively corresponds to one traffic count result. For the first network node, because destination network nodes of the first network node include the egress node on the path for forwarding a packet by the first network node in the same area, the control node may learn of, based on traffic count results corresponding to the destination network nodes, traffic transmitted from the first network node to egress nodes. This facilitates the control node to determine the traffic distribution feature in the network. In other words, an embodiment of the application provides a method that network nodes collect local aggregated traffic statuses, and then the control node determines the traffic distribution feature in the communication network based on the local aggregated traffic statuses collected by the network nodes. This avoids a case in which traffic statistics information collected by a node other than a forwarding node is used to implement traffic monitoring.
It should be noted that, when the control node provided in the foregoing embodiment performs traffic monitoring, division of the foregoing function modules is only used as an example for description. In an actual application, the foregoing functions may be allocated to different function modules for implementation as required. In other words, an internal structure of a device is divided into different function modules to implement all or some of the foregoing functions. In addition, the control node provided in the foregoing embodiment belongs to a same concept as the traffic monitoring method embodiments. For an implementation process, refer to the method embodiments. Details are not described herein again.
a collection module 1501, configured to obtain traffic statistics data, where the traffic statistics data includes a traffic count result of traffic from a first network node to a destination network node that belongs to a same area as the first network node, the destination network node includes an egress node on a path for forwarding a packet by the first network node in the area, and the traffic count result includes a total count of packets forwarded by the first network node to the destination network node. For an embodiment, refer to operation 401 in the embodiment in
The first network node further includes a sending module 1502, configured to send the traffic statistics data to a control node in the network. For an embodiment, refer to operation 402 in the embodiment in
In an embodiment, the network node further includes:
an obtaining module, configured to obtain a first destination address of a to-be-forwarded first packet;
a determining module, further configured to determine a first destination network node based on the first destination address, where the first destination network node includes an egress node on a path for forwarding the first packet by the first network node in the area; and
an updating module, configured to update a traffic count result corresponding to the first destination network node.
In an embodiment, the determining module is configured to:
obtain, from a correspondence between a destination address and a destination network node, a destination network node corresponding to the first destination address, to obtain the first destination network node.
In an embodiment, when there is one egress node on a path for forwarding the first packet to the first destination address by the first network node, the first destination network node is the egress node on the path for forwarding the first packet to the first destination address by the first network node.
When there are a plurality of egress nodes on the path for forwarding the first packet to the first destination address by the first network node, the first destination network node is a virtual destination network node corresponding to the plurality of egress nodes.
In an embodiment, the traffic count result corresponding to the first destination network node includes traffic count results respectively corresponding to next-hop nodes, and a traffic count result corresponding to any next-hop node includes a total count of packets forwarded to the first destination network node through the corresponding next-hop node.
The updating module is configured to:
obtain, from a routing table, one or more next-hop nodes corresponding to the first destination address, where the routing table includes next-hop nodes respectively corresponding to a plurality of destination addresses;
select, from the one or more next-hop nodes, a next-hop node that forwards the first packet, to obtain a target next-hop node; and
update a traffic count result corresponding to the target next-hop node in the traffic count result corresponding to the first destination network node.
In an embodiment, a counter array is configured for the first destination network node. The counter array includes counters respectively corresponding to next-hop nodes on a path for forwarding a packet to the first destination network node by the first network node, and the counter includes a traffic count result corresponding to a corresponding next-hop node.
The updating module is configured to:
search for a counter corresponding to the target next-hop node; and
update a traffic count result in the found counter.
In an embodiment, for the first destination address, a start address of the counter array corresponding to the first destination network node is further configured in the routing table.
The updating module is configured to:
determine, based on the target next-hop node and the start address of the counter array corresponding to the first destination network node configured for the first destination address in the routing table, an address of the counter corresponding to the target next-hop node; and
search, based on the address of the counter corresponding to the target next-hop node, for the counter corresponding to the target next-hop node.
In an embodiment, the total count is a total quantity of the packets or a total quantity of bytes of the packets.
In an embodiment of the application, to facilitate the control node to analyze a traffic distribution feature in a communication network, for any network node in the network, each of destination network nodes of the network node respectively corresponds to one traffic count result. For the first network node, because destination network nodes of the first network node include the egress node on the path for forwarding a packet by the first network node in the same area, the control node may learn of, based on traffic count results corresponding to the destination network nodes, traffic transmitted from the first network node to egress nodes. This facilitates the control node to determine the traffic distribution feature in the network. In other words, an embodiment of the application provides a method that network nodes collect local aggregated traffic statuses, and then the control node determines the traffic distribution feature in the communication network based on the local aggregated traffic statuses collected by the network nodes. This avoids a case in which traffic statistics information collected by a node other than a forwarding node is used to implement traffic monitoring.
It should be noted that, when the first network node provided in the foregoing embodiment collects the traffic statistics data, division of the foregoing function modules is only used as an example for description. In an actual application, the foregoing functions may be allocated to different function modules for implementation as required. In other words, an internal structure of a device is divided into different function modules to implement all or some of the foregoing functions. In addition, the first network node provided in the foregoing embodiment belongs to a same concept as the traffic monitoring method embodiments. For an implementation process, refer to the method embodiments. Details are not described herein again.
The processor 1601 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution of the solutions of this application. When the network device is used as any network node in a plurality of network nodes in a communication network, the processor 1601 is configured to determine traffic statistics data. When the network device is used as a control node in the communication network, the processor 1601 is configured to analyze a traffic distribution feature of the communication network based on traffic statistics data determined by a forwarding node. Functions are not described herein again.
The communication bus 1602 may include a path, to transmit information between the foregoing components.
The memory 1603 may be a read-only memory (ROM), another type of static storage device that can store static information and instructions, a random access memory (RAM), or another type of dynamic storage device that can store information and instructions, or may be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or another compact disc storage, an optical disc storage (including a compact optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, and the like), a magnetic disk or another magnetic storage device, or any other medium that can be used to carry or store expected program code in a form of instructions or a data structure and that can be accessed by a computer. However, the memory is not limited thereto. The memory 1603 may exist independently, and be connected to the processor 1601 through the communication bus 1602. The memory 1603 may be integrated with the processor 1601.
The memory 1603 is configured to store application program code for executing the solutions in this application, and the processor 1601 controls execution of the application program code. The processor 1601 is configured to execute the program code stored in the memory 1603. The program code may include one or more software modules. The control node or any forwarding node in a plurality of forwarding nodes in the foregoing embodiment may determine, by using the processor 1601 and one or more software modules in the program code in the memory 1603, data used for developing an application. The one or more software modules may be the software module provided in any embodiment in
The communication interface 1604 is any apparatus such as a transceiver, and is configured to communicate with another device or communication network, for example, the Ethernet, a radio access network (RAN), a wireless local area network (WLAN), and the like. When the network device is used as any network node in the plurality of network nodes in the communication network, the communication interface 1604 may be configured to report the traffic statistics data to the control node. For an embodiment, refer to operation 402 in the embodiment in
In an embodiment, the network device may include a plurality of processors, for example, the processor 1601 and a processor 1605 in
The foregoing network device may be a general-purpose network device or a dedicated network device. In an embodiment, the network device may be a desktop, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. A type of the network device is not limited in an embodiment of the application.
It may be understood that, when the network device shown in
All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When the software is used for implementation, all or some of the embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or some of the procedures or functions according to the embodiments of this application are generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a digital versatile disc (DVD)), a semiconductor medium (for example, a solid-state disk (SSD)), or the like.
One of ordinary skilled in the art should be aware that in the foregoing one or more examples, functions described in the embodiments of this application may be implemented by hardware, software, firmware, or any combination thereof. When the functions described in the embodiments of this application are implemented by the software, the foregoing functions may be stored in a computer-readable medium or transmitted as one or more instructions or code in the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates transmission of a computer program from one place to another place. The storage medium may be any available medium accessible to a general-purpose or special-purpose computer.
The objectives, technical solutions, and benefits of the embodiments of this application are further described in detail in the foregoing implementations. It should be understood that the foregoing descriptions are merely embodiments of this application, but are not intended to limit the protection scope of this application. Any modification, equivalent replacement or improvement made based on technical solutions of this application shall fall within the protection scope of this application.
Number | Date | Country | Kind |
---|---|---|---|
202010366422.6 | Apr 2020 | CN | national |
This application is a continuation of International Application No. PCT/CN2021/078609, filed on Mar. 2, 2021, which claims priority to Chinese Patent Application No. 202010366422.6, filed on April 30, 2020. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2021/078609 | Mar 2021 | US |
Child | 17976022 | US |