CN107342939B - Method and device for transmitting data - Google Patents

Method and device for transmitting data Download PDF

Info

Publication number
CN107342939B
CN107342939B CN201610284852.7A CN201610284852A CN107342939B CN 107342939 B CN107342939 B CN 107342939B CN 201610284852 A CN201610284852 A CN 201610284852A CN 107342939 B CN107342939 B CN 107342939B
Authority
CN
China
Prior art keywords
node
network node
packet
network
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610284852.7A
Other languages
Chinese (zh)
Other versions
CN107342939A (en
Inventor
李峰
朱夏
李晋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610284852.7A priority Critical patent/CN107342939B/en
Publication of CN107342939A publication Critical patent/CN107342939A/en
Application granted granted Critical
Publication of CN107342939B publication Critical patent/CN107342939B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/20Hop count for routing purposes, e.g. TTL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

The embodiment of the invention discloses a method and a device for transmitting data, wherein the method comprises the following steps: a first network node receives a message, wherein a message header of the message carries indication information, the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to N network nodes on a forwarding path of the message, and N is an integer greater than or equal to 2; the first network node determining a node number of the first network node; the first network node determines a first target link number corresponding to the node number of the first network node according to the message header of the message; the first network node forwards the packet on the link corresponding to the first target link number, which can improve the application range of data transmission in the network.

Description

Method and device for transmitting data
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for transmitting data in the field of communications.
Background
The Multi-Protocol Label Switching (MPLS) technology is a next generation Internet broadband network technology, where the MPLS technology separates routing and forwarding of data, creates an explicit Path by using a constrained route, and further creates a Label Switched Path (LSP), and a Segmented Routing (SR) is an MPLS technology, where the SR mainly includes a node Label and a link Label, the node Label is information of a shortest Path calculated by each node to a target node, and issues current node and next hop information to a forwarding table, each node stores all node labels in its respective forwarding table, and can finally reach the target node according to the shortest Path information and the node Label, and the node Label adopts a shortest Path first algorithm, but it often causes overload of some links in the network because of inability to balance network load, while other link resources are not fully utilized, thereby causing congestion in the network that could otherwise meet the traffic demand. In order to avoid network congestion, a link label is introduced, the link label is a label allocated by each node for all local links, a forwarding table of each node only stores the link label of the node, and each node broadcasts the link label according to an Interior Gateway Protocol (IGP), so that the source node can obtain the link label of each node, the source node determines a forwarding path for the traffic information packet according to each node after obtaining the link label of each node, and adds link label in message head to indicate network node to forward message, after node receives message, and finding an exit according to the link label of the top layer, and stripping the link label of the top layer, namely a local label, until the destination network node, all the link labels in the message header are stripped. An Internet Protocol Version 6 (IPv 6) network also transmits data in a manner similar to a link label. However, when data is transmitted through an Internet Protocol Version 4 (IPv 4) network, the header of the data only includes a source address and a destination address, and the data cannot be transmitted by stripping the address of each layer, and the data transmission in the IPv4 network has certain limitations.
Disclosure of Invention
The method and the device for transmitting data provided by the embodiment of the invention can improve the application range of data transmission.
In a first aspect, a method for processing data is provided, the method comprising: a first network node receives a message, wherein a message header of the message carries indication information, the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to N network nodes on a forwarding path of the message, and N is an integer greater than or equal to 2; the first network node determining a node number of the first network node; the first network node determines a first target link number corresponding to the node number of the first network node according to the message header of the message; and the first network node forwards the message on the link corresponding to the first target link number.
Thus, the N node numbers may correspond to N network nodes on a forwarding path of the packet one to one, the N node numbers correspond to N target link numbers one to one, and after the first network node receives the packet, the first network node determines the node number of itself according to the packet header and determines the first target link number corresponding to the node number of itself, so that the target link number of the forwarding packet can be determined according to the node number of the network node, and an application range of data transmission can be improved, for example, data transmission in an IPv4 network can be performed.
Specifically, when each network node in the N network nodes receives a packet, the packet header includes indication information, which may be used to indicate a correspondence between a node number of the network node and a target link number, and may also indicate a position where each target link number occupies a byte of the packet header, each network node may determine a target link number corresponding to its own number according to the indication information in the packet header, and search for a target link number of each network node according to a position where the node number of each network node indicated by the indication information occupies the byte of the packet header, and transmit data on a link corresponding to the searched target link number, where the indication information in the packet header exists in the whole packet forwarding process, so as to avoid transmitting data by stripping each layer address, even if only the source address and the destination address of the message are available, the message can be transmitted through the indication information, so that the limitation of the message in network transmission is avoided, the application range of data transmission is improved, and the method and the device can be applied to data transmission of an IPv4 network.
Optionally, the indication information may indicate that the target link numbers of each network node occupy the same number of bytes of the packet header, and the target link numbers of the N network nodes are sequentially arranged in the packet header; optionally, each network node may sequentially search, according to its own node number, a target link number corresponding to its own node number.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy different numbers of bytes of the packet header, and optionally, each network node searches for the target link number corresponding to the node number according to the node number and the indication information of the network node.
Optionally, the packet header of the packet carries N node numbers in addition to the indication information, so that after each network node receives the packet, the node number of the network node itself is determined, and after the node number of the network node itself is found by searching the node number of the packet itself, a target link number corresponding to the node number of the network node itself is found, and the packet is forwarded on a link corresponding to the target link number.
The node number is used to identify a network node, for example, the node number may be used to identify the network node as the hop on a forwarding path, and the node number may also be a result of a summation of a lifetime of a packet in the network node and the maximum number of forwarding nodes, and the like. The node number may be determined according to other manners, and is not limited herein. The node numbers of the same network node may be different in transmitting different messages. The network node may determine a target link number for forwarding the packet according to the node number of the network node itself, and further forward the packet on a link corresponding to the determined target link number.
Optionally, the first network node may determine its own node number according to the packet, for example, the first network node may determine its own node number according to the lifetime of the packet header of the packet; for another example, the first network node may determine its own node number according to the current transmission hop count of the packet in the packet header.
In a first possible implementation manner of the first aspect, before the first network node receives the packet, the method further includes: the first network node sends at least one link number of the first network node to the first device, wherein the at least one link number includes the first target link number, and the byte size occupied by the first target link number in the header is determined according to the largest link number in the at least one link number.
Optionally, the byte size occupied by the first target link number in the header may be the byte size occupied by the largest link number in the at least one link number.
Therefore, the byte size of the first target link number in the message header is determined according to the actual required size, each link label in the prior art occupies a fixed 32bit, all link labels on the path are packaged in the message header, and the link labels occupy a large amount of message space, so that the transmission efficiency is low.
With reference to the foregoing possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the header of the packet further carries: time To Live (TTL) of the message; before the first network node determines the node number of the first network node, the method further comprises: the first network node receives the maximum forwarding node number L sent by the first equipment, wherein the L is an integer greater than or equal to N; the first network node determining a node number of the first network node, comprising: and the first network node determines the node number of the first network node according to the L and the TTL carried in the message header.
Specifically, each network node can receive the maximum forwarding node number L sent by the first device, and when receiving the packet, the packet header includes the time to live TTL of the packet, and each network node determines its own node number according to L and TTL, for example, it can obtain its own number by subtracting L from TTL, or obtain its own number by adding a certain specific value to L, but if how the first device generates the node number of each network node, how each network node obtains its own node number, that is, the way in which the first device generates the node number is the same as the way in which each network node generates its own node number, so that it is further ensured that the packet can be forwarded through a correct forwarding path.
With reference to the foregoing possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the determining, by the first network node, the node number of the first network node according to the L and the TTL carried in the packet header includes: and the first network node determines the result of the TTL for the L as the node number of the first network node.
Specifically, the result of the addition of the TTL to the L in the message of each network node is determined as the node number of each network node, and since the TTL phase difference between every two adjacent network nodes is 1, that is, if the TTL of the first network node is T0, the value of the lifetime of the message is reduced by 1 for every network node, in this way, the node numbers of any two network nodes are different, that is, each node number corresponds to one target link number, and it is impossible that two identical node numbers correspond to two target link numbers, it can be ensured that the message is transmitted on the link corresponding to the correct target link number, and the reliability of data transmission is further improved.
With reference to the foregoing possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the header of the packet further carries: the current transmission hop count of the message; the first network node determining a node number of the first network node, comprising: and the first network node determines the value of the current transmission hop number in the message header as the node number of the first network node.
Specifically, each time a message passes through one network node, the current transmission hop count in the message header is increased by 1, when the first network node receives the message, the current transmission hop count in the message header is determined as the node number of the first network node, if the first network node is the first network node in the N network nodes, that is, the first network node is the source network node, the first network node finds the target link number corresponding to the node number 1 if the value of the current transmission hop count in the message header of the message received by the first network node is 1, and forwards the message on the link of the target link number corresponding to the node number 1 of the high message.
With reference to the foregoing possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, before the first network node forwards the packet on the link corresponding to the first target link number, the method further includes: and the first network node updates the value of the current transmission hop number in the message header to the node number of the first network node plus 1.
After each network node receives the message and determines the node number of the network node according to the message header of the message, the value of the current transmission hop count in the message header is updated to the node number of the network node plus 1, so that the next network node determines the node number of the network node according to the updated current transmission hop count after receiving the message.
With reference to the foregoing possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect, before the first network node receives the packet, the method further includes: the first network node sends current traffic information to the first device, so that the first device determines the forwarding path according to the current traffic information.
In a second aspect, a method for transmitting data is provided, the method comprising: the method comprises the steps that first equipment determines a forwarding path of a message, wherein the forwarding path comprises N network nodes, and N is an integer greater than or equal to 2; the first device determines indication information of the forwarding path, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to the N network nodes, and a packet header of the packet carries the indication information of the forwarding path.
Optionally, after determining a forwarding path of the packet, the first device determines indication information of the forwarding path, where the indication information is used to indicate a target link number corresponding to each network node number, and the indication information is carried in a packet header of the packet and is forwarded at each network node, optionally, the target link number corresponding to each network node number may occupy byte positions of a predefined packet header in sequence, and when receiving the packet, the network node determines its own node number, and searches for a target link number corresponding to the byte position of the predefined packet header occupied by its own node number in sequence, and forwards the packet on a link corresponding to the found target link number.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy the same byte size of the packet header, and the target link number of each network node occupies a predefined byte position of the packet header.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy different byte sizes of the packet header, and optionally, each network node searches for the target link number corresponding to the node number according to the node number and the indication information of the network node.
Optionally, the packet header of the packet carries N node numbers in addition to the indication information, so that after each network node receives the packet, the node number of the network node itself is determined, and after the node number of the network node itself is found by searching the node number of the packet itself, a target link number corresponding to the node number of the network node itself is found, and the packet is forwarded on a link corresponding to the target link number.
In a first possible implementation manner of the second aspect, before the determining, by the first device, the indication information of the forwarding path, the method further includes: the first device obtains at least one link number of an ith network node in the N network nodes; the first device determines indication information of the forwarding path, including: and the first equipment determines a target link number of the ith network node in at least one link number of the ith network node according to the forwarding path, wherein i is an integer which is greater than 0 and less than or equal to N.
Specifically, each network node sends at least one link number of the network node to the first device, and after the first device determines the forwarding path, the target link number for forwarding the packet is determined according to the at least one link number sent by each network node to the first device, so that the target link numbers of all network nodes on the whole forwarding path can be determined.
With reference to the foregoing possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, after the first device obtains at least one link number of an ith network node of the N network nodes, the method further includes: and the first equipment determines the byte size occupied by the target link number of the ith network node in the message according to the maximum link number in at least one link number of the i network nodes.
Optionally, the first device may determine, as the byte occupied by the target link number of each network node in the packet, the byte occupied by the largest link number of the at least one link number sent by each network node.
With reference to the foregoing possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, before the determining, by the first device, the indication information of the forwarding path, the method further includes: the first device determines the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein the L is an integer greater than or equal to N; the first device determines indication information of the forwarding path, including: the first device determines a node number of each network node according to the L and the lifetime of the message corresponding to each network node in the N network nodes, and the first device determines a target link number corresponding to the node number of each network node.
Optionally, after receiving the packet, a first network node in the N network nodes sends a first TTL in the packet to the first device, and after receiving the first TTL, the first device may determine that the first TTL belongs to a TTL corresponding to the first network node, the first device may subtract 1 from the first TTL to obtain a second TTL, determine the second TTL as a TTL corresponding to the second network node, and so on, and the first device may determine a TTL corresponding to each network node in the N network nodes, and then determine a node number of each network node according to the TTL corresponding to each network node and the maximum number L of forwarding nodes.
With reference to the foregoing possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the determining, by the first device, the node number of each network node according to the L and the lifetime of the packet corresponding to each network node in the N network nodes includes: and the first equipment determines the result of the remainder of the survival time of the message corresponding to each network node in the N network nodes on the L as the node number of each network node.
Alternatively, if the value of the lifetime of the packet at the source network node is T0, the value of the lifetime of the packet is reduced by 1 for every network node, so that the difference between the values of the lifetimes of two adjacent network nodes is 1.
With reference to the foregoing possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the determining, by the first device, the indication information of the forwarding path includes: the first device determines a forwarding hop count corresponding to each network node in the N network nodes in the forwarding path as a node number of each network node; the first device determines a target link number corresponding to the node number of each network node.
With reference to the foregoing possible implementation manner of the second aspect, in a sixth possible implementation manner of the second aspect, after the first device determines a forwarding path of the packet, the method further includes: the first device determines an initial value of a forwarding hop count of the packet, where a packet header of the packet carries the initial value of the forwarding hop count, for example, the initial value of the forwarding hop count is 1, and when a first network node of the N network nodes receives the packet, the initial value 1 of the forwarding hop count in the packet header is used as a node number of the first network node. For example, the first device may determine the initial value of the forwarding hop count of the first network node as 1, determine the forwarding hop count of the second network node as 2, and so on, and after determining the forwarding hop count of each network node, determine the forwarding hop count of each network node as the node number of each network node itself.
With reference to the foregoing possible implementation manner of the second aspect, in a seventh possible implementation manner of the second aspect, before the first device determines the forwarding path of the packet, the method further includes: the first device obtains a source address and a destination address of the message and current flow information of each network node in a plurality of network nodes in a current network topological structure; the determining, by the first device, a forwarding path of the packet includes: the first device determines the forwarding path according to the source address and the destination address and current traffic information of each of the plurality of network nodes.
Optionally, the first device may further obtain a real-time cache size sent by each network node of the N network nodes and a link bandwidth of at least one link of each network node, and the first device may determine the forwarding path according to the current traffic information of each network node, the real-time cache size of each network node, and the link bandwidth of at least one link of each network node. That is, the first device may determine a forwarding path for the packet according to the physical bandwidth, the real-time traffic, and the size of the cache of each network node.
Optionally, when the first device is a controller, each of the N network nodes sends its current traffic information to the controller, after receiving the packet, the first network node of the N network nodes sends a source address and a destination address of the packet to the controller, and the controller determines a forwarding path for the packet according to the received source address and destination address and the current traffic information of each network node.
Optionally, when the first device is a first network node of the N network nodes, that is, the first network node is a source network node, each network node of the N network nodes sends its current traffic information to the first network node, the first network node obtains a source address and a destination address of a packet when receiving the packet, and the controller determines a forwarding path for the packet according to the source address and the destination address and the current traffic information of each network node.
With reference to the foregoing possible implementation manner of the second aspect, in an eighth possible implementation manner of the second aspect, after the first device determines, according to the current network topology structure, the maximum number L of forwarding nodes through which the packet can pass, the method further includes: the first device transmits the L to each of the N network nodes.
After the first device determines the node number of each network node by using the L, each network node also needs to determine its own node number by using the same L, so that it can be ensured that the node number of each network node determined by the first device is consistent with its own node number determined by each network node, and further the accuracy of data transmission is ensured.
With reference to the foregoing possible implementation manner of the second aspect, in a ninth possible implementation manner of the second aspect, after the first device determines the indication information of the forwarding path, the method further includes: and the source network node forwards the message according to the indication information.
Specifically, if the first device is a source network node, that is, the source network node is a first network node of the N network nodes, the source network node receives a packet, and determines indication information of a forwarding path according to the packet, where the indication information is used to indicate a target link number corresponding to a node number of each network node, and encapsulates the indication information into a packet header of the packet, and forwards the packet to a next network node in the forwarding path.
With reference to the foregoing possible implementation manners of the second aspect, in a tenth possible implementation manner of the second aspect, the first device is a controller; after the first device determines the indication information of the forwarding path, the method further includes: the controller sends the path indication information to a source network node of the packet, where the N network nodes include the source network node.
Specifically, if the first device is a controller, the indication information may be determined by centralized control of the controller. The controller may receive current traffic information sent by the plurality of network nodes, and may also receive a source address and a destination address of a packet sent by the first network node, and determine a forwarding path for the packet according to the current traffic information sent by the plurality of network nodes and the source address and the destination address of the packet, where the forwarding path includes N network nodes of the plurality of network nodes. The controller may also receive at least one own link number sent by the N network nodes, determine, according to the at least one own link number sent by the forwarding path at the N network nodes, a target link number of the N network nodes for forwarding a packet, determine, for each of the N network nodes, a node number, further determine indication information indicating the target link number corresponding to each of the N node numbers, send, to a first network node, that is, a source network node, the first network node forwards the packet according to the indication information, and encapsulate the indication information in a packet header for forwarding.
In a third aspect, an apparatus for transmitting data is provided, configured to perform the method in the first aspect or any possible implementation manner of the first aspect. In particular, the apparatus comprises means for performing the method of the first aspect described above or any possible implementation manner of the first aspect.
In a fourth aspect, there is provided an apparatus for transmitting data for performing the method of the second aspect or any possible implementation manner of the second aspect. In particular, the apparatus comprises means for performing the method of the second aspect described above or any possible implementation of the second aspect.
In a fifth aspect, a system for transmitting data is provided, which includes the apparatus according to the third aspect and the apparatus according to the fourth aspect.
In a sixth aspect, there is provided an apparatus for transmitting data, the apparatus comprising: receiver, transmitter, memory, processor and bus system. Wherein the receiver, the transmitter, the memory and the processor are connected by the bus system, the memory is configured to store instructions, and the processor is configured to execute the instructions stored by the memory to control the receiver to receive signals and control the transmitter to transmit signals, and when the processor executes the instructions stored by the memory, the execution causes the processor to execute the method of the first aspect or any possible implementation manner of the first aspect.
In a seventh aspect, an apparatus for transmitting data is provided, the apparatus comprising: receiver, transmitter, memory, processor and bus system. Wherein the receiver, the transmitter, the memory and the processor are connected by the bus system, the memory is used for storing instructions, the processor is used for executing the instructions stored by the memory to control the receiver to receive signals and control the transmitter to transmit signals, and when the processor executes the instructions stored by the memory, the execution causes the processor to execute the method of the second aspect or any possible implementation manner of the second aspect.
In an eighth aspect, there is provided a computer readable medium for storing a computer program comprising instructions for carrying out the method of the first aspect or any possible implementation manner of the first aspect.
In a ninth aspect, there is provided a computer readable medium for storing a computer program comprising instructions for performing the method of the second aspect or any possible implementation of the second aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments of the present invention will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application scenario according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a method of transmitting data according to an embodiment of the invention;
FIG. 3 is a diagram illustrating another method for transmitting data according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an apparatus for transmitting data according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another apparatus for transmitting data according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an apparatus for transmitting data according to an embodiment of the present invention;
fig. 7 is a schematic diagram of another apparatus for transmitting data according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below clearly with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, shall fall within the scope of protection of the present invention.
It should be understood that the technical solutions of the embodiments of the present invention can be applied to various communication systems, for example: a Global System for Mobile communications (GSM) System, a Code Division Multiple Access (CDMA) System, a Wideband Code Division Multiple Access (WCDMA) System, a General Packet Radio Service (GPRS), a Long Term Evolution (LTE) System, a Frequency Division Duplex (FDD) System, a Time Division Duplex (TDD), a Universal Mobile Telecommunications System (UMTS), a world wide telecommunications Access (WLAN) System, a Wireless Local Area Network (WLAN) System, or a WLAN System (WLAN) for short, in the future.
Fig. 1 shows an application scenario diagram of an embodiment of the present invention, where a packet needs to be transmitted from S to N, and the packet needs to be forwarded by a network node in fig. 1, as shown in fig. 1, the network topology includes 9 network nodes, which are R1, R2, R3, R4, R5, R6, R7, R8, and R9, each network node has its own egress port, that is, each network node includes at least one link capable of transmitting data, and each network node numbers its own link, for example, R4 determines a link number of R4-R5 as 0, a link number of R4-R6 as 1, and a link number of R4-R2 as 2. Each network node sends its own determined link number to R1 or the controller. Each network node sends the current traffic information on each link of the network node to R1 or a controller, when a message needs to be transmitted, the R1 or the controller determines a forwarding path for the message according to the source address and the destination address of the message and the current traffic information of each network node, for example, the forwarding path determined by the R1 or the controller is R1-R2-R4-R6-R9. Optionally, any network node in the current network structure may determine a forwarding path for transmitting the packet, and when the first network node determines the forwarding path for transmitting the packet, for example, R1 in fig. 1 receives the packet, R1 sends the source address and the destination address of the packet to the network node or the controller that determines the forwarding path, fig. 1 is only a schematic diagram of an embodiment of the present invention, and of course, an application scenario of the embodiment of the present invention may not include the controller in fig. 1.
The form of the Controller in the embodiment of the present invention is not specifically limited, and for example, the Controller may be a Base Station (Base Station) in a wireless Network or a Radio Network Controller (RNC). The form of the network node is not particularly limited in the embodiments of the present invention, and the network node may be a router or a switch, for example.
A method of transmitting data according to an embodiment of the present invention will be described with reference to fig. 2 and 3.
Fig. 2 shows a method 100 for transmitting data according to an embodiment of the present invention, where the method 100 includes:
s110, the first equipment determines a forwarding path of the message, wherein the forwarding path comprises N network nodes, and N is an integer greater than or equal to 2;
s120, the first device determines indication information of the forwarding path, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to the N network nodes, and a packet header of the packet carries the indication information of the forwarding path.
Specifically, after determining a forwarding path of a packet, the first device determines indication information of the forwarding path, where the indication information is used to indicate that N node numbers may correspond to N network nodes on the forwarding path of the packet one to one, and the N node numbers correspond to N target link numbers one to one.
Optionally, after determining a forwarding path of the packet, the first device determines indication information of the forwarding path, where the indication information is used to indicate a target link number corresponding to each network node number, and the indication information is carried in a packet header of the packet and is forwarded at each network node, optionally, the target link number corresponding to each network node number may occupy byte positions of a predefined packet header in sequence, and when receiving the packet, the network node determines its own node number, and searches for a target link number corresponding to the byte position of the predefined packet header occupied by its own node number in sequence, and forwards the packet on a link corresponding to the found target link number. It should be understood that the target link number corresponding to the node number of each network node may also occupy the bytes of the packet header out of order, and the first device and the network node may determine the position where the target link number occupies the bytes of the packet header in a manner specified by the protocol.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy the same byte size of the packet header, and the byte position of the packet header predefined by the target link number of each network node, for example, two bytes of the packet header occupied by the target link number corresponding to each network node, if the first network node determines that the node number of the first network node is the node number corresponding to the first two bytes, the target link number of the first two byte positions is searched, and the first network node forwards the packet according to the target link number of the first two byte positions.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy different byte sizes of the packet header, and optionally, each network node searches for the target link number corresponding to the node number according to the node number and the indication information, for example, the indication information indicates that the target link number corresponding to the first network node occupies the first two bytes of the packet header, and the target link number corresponding to the second network node occupies the third to fifth bytes of the packet header, so that the first network node determines, according to the indication information, that the target link numbers corresponding to the first two bytes of the packet header are the target link numbers of the first network node, and the second network node determines, according to the indication information, that the target link numbers corresponding to the third to fifth bytes of the packet header are the target link numbers of the second network node.
Optionally, the packet header of the packet carries N node numbers in addition to the indication information, so that after each network node receives the packet, the node number of the network node itself is determined, and after the node number of the network node itself is found by finding the node number of the network node itself in the packet header, a target link number corresponding to the node number of the network node itself is found, and the packet is forwarded on a link corresponding to the target link number.
It should be understood that N node numbers may correspond to N network nodes on a forwarding path of a packet one to one, and that N node numbers correspond to N destination link numbers one to one.
As an alternative embodiment, before S120, the method 100 further includes: the first device obtains at least one link number of an ith network node in the N network nodes; s120, comprising: and the first equipment determines a target link number of the ith network node in at least one link number of the ith network node according to the forwarding path, wherein i is an integer which is greater than 0 and less than or equal to N.
Specifically, each network node sends at least one link number of the network node to the first device, and after the first device determines the forwarding path, the target link number for forwarding the packet is determined according to the at least one link number sent by each network node to the first device, so that the target link numbers of all network nodes on the whole forwarding path can be determined.
As an optional embodiment, after the first device obtains at least one link number of the ith network node of the N network nodes, the method 100 further includes: and the first equipment determines the byte size occupied by the target link number of the ith network node in the message according to the maximum link number in at least one link number of the i network nodes.
Optionally, the first device may determine, as the byte occupied by the target link number of each network node in the packet, the byte occupied by the largest link number of the at least one link number sent by each network node.
As an alternative embodiment, before S120, the method 100 further includes: the first device determines the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein the L is an integer greater than or equal to N; the first device determines indication information of the forwarding path, including: and the first equipment determines the node number of each network node according to the L and the TTL of the message corresponding to each network node in the N network nodes, and determines the target link number corresponding to the node number of each network node.
Optionally, after receiving the packet, a first network node of the N network nodes sends a first TTL in the packet to the first device, and after receiving the first TTL, the first device may determine that the first TTL belongs to a TTL corresponding to the first network node, the first device may subtract 1 from the first TTL to obtain a second TTL, and determine the second TTL as a TTL corresponding to the second network node, and so on, and the first device may determine a TTL corresponding to each network node of the N network nodes, and then may determine a node number of each network node according to the TTL corresponding to each network node and the maximum number L of forwarding nodes.
As an optional embodiment, the determining, by the first device, the node number of each network node according to the L and the lifetime of the packet corresponding to each network node in the N network nodes includes: the first device determines a result of the remainder of the message from the time-to-live of the packet corresponding to each of the N network nodes to the L as a node number of each network node, and determines a target link number corresponding to the node number of each network node.
Alternatively, if the value of the lifetime of the packet at the source network node is T0, the value of the lifetime of the packet is reduced by 1 for every network node, so that the difference between the values of the lifetimes of two adjacent network nodes is 1.
As an example, as shown in fig. 1, if the first device determines that the path for forwarding the packet is R1-R2-R4-R6-R9, the link numbers of R1-R2 are 0, the link numbers of R2-R4 are 0, the link numbers of R4-R6 are 1, and the link numbers of R6-R9 are 0. When R1 receives a packet, if TTL in the packet is 98, and the first device determines that the maximum number L of forwarding nodes that can be passed by the packet in the current network topology is 9, the first device uses a value 8 of 98mod9 as a node number of R1, uses a value 7 of 97mod9 as a node number of R2, uses a value 6 of 96mod9 as a node number of R4, and uses a value 5 of 95mod9 as a node number of R6, where mod is a remainder operation, the first device determines that a correspondence relationship between a node number on the path and a target link number is as shown in table 1, and optionally, a packet header may include only a target link number in table 1, that is, the target link number determined by the first device and the node number have a correspondence relationship; optionally, the header may also include both the node number in table 1 and the target link number in table 1.
TABLE 1
Node numbering 8 7 6 5
Target link numbering 0 0 1 0
As an optional embodiment, the determining, by the first device, the indication information of the forwarding path includes: and the first equipment determines the corresponding forwarding hop count of each network node in the N network nodes in the forwarding path as the node number of each network node.
For example, the first device may determine the forwarding hop count of the first network node as 1, determine the forwarding hop count of the second network node as 2, and so on, and after determining the forwarding hop count of each network node, determine the forwarding hop count of each network node as the node number of each network node itself.
As an example, as shown in fig. 1, if the first device determines that the path for forwarding the packet is R1-R2-R4-R6-R9, the link numbers of R1-R2 are 0, the link numbers of R2-R4 are 0, the link numbers of R4-R6 are 1, and the link numbers of R6-R9 are 0. The first device may determine that the node number of R1 is 1, the node number of R2 is 2, the node number of R4 is 3, and the node number of R6 is 4, and then the first device determines that the correspondence between the node number on the path and the target link number is as shown in table 2, optionally, the packet header may only include the target link number in table 2, that is, the target link number determined by the first device has a correspondence with the node number; optionally, the header may also include both the node number in table 2 and the target link number in table 2.
TABLE 2
Node numbering 1 2 3 4
Target link numbering 0 0 1 0
As an optional embodiment, after the first device determines a forwarding path of the packet, the method 100 further includes: the first device determines an initial value of a forwarding hop count of the packet, where a packet header of the packet carries the initial value of the forwarding hop count, for example, the initial value of the forwarding hop count is 1, and when a first network node of the N network nodes receives the packet, the initial value 1 of the forwarding hop count in the packet header is used as a node number of the first network node.
As an alternative embodiment, before S110, the method 100 further includes: the first device obtains a source address and a destination address of the message and current flow information of each network node in a plurality of network nodes in a current network topological structure; s110, comprising: the first device determines the forwarding path according to the source address and the destination address and current traffic information of each of the plurality of network nodes.
Optionally, the first device may further obtain a real-time cache size sent by each network node of the N network nodes and a link bandwidth of at least one link of each network node, and the first device may determine the forwarding path according to the current traffic information of each network node, the real-time cache size of each network node, and the link bandwidth of at least one link of each network node. That is, the first device may determine a forwarding path for the packet according to the physical bandwidth, the real-time traffic, and the size of the cache of each network node.
Optionally, when the first device is a controller, each of the N network nodes sends its current traffic information to the controller, after receiving the packet, the first network node of the N network nodes sends a source address and a destination address of the packet to the controller, and the controller determines a forwarding path for the packet according to the received source address and destination address and the current traffic information of each network node.
Optionally, when the first device is a first network node of the N network nodes, that is, the first network node is a source network node, each network node of the N network nodes sends its current traffic information to the first network node, the first network node obtains a source address and a destination address of a packet when receiving the packet, and the controller determines a forwarding path for the packet according to the source address and the destination address and the current traffic information of each network node.
As an optional embodiment, after the first device determines, according to the current network topology, the maximum number L of forwarding nodes that the packet can pass through, the method 100 further includes: the first device transmits the L to each of the N network nodes.
After the first device determines the node number of each network node by using the L, each network node also needs to determine its own node number by using the same L, so that it can be ensured that the node number of each network node determined by the first device is consistent with its own node number determined by each network node, and further the accuracy of data transmission is ensured.
As an optional embodiment, the first device is a source network node of the packet, the N network nodes include the source network node, and after the first device determines the indication information of the forwarding path, the method 100 further includes: and the source network node forwards the message according to the indication information.
Specifically, if the first device is a source network node, that is, the source network node is a first network node of the N network nodes, the source network node receives a packet, and determines indication information of a forwarding path according to the packet, where the indication information is used to indicate a node number of each network node and a target link number corresponding to each node number, and encapsulates the indication information into a packet header of the packet to forward the packet to a next network node in the forwarding path.
As an alternative embodiment, the first device is a controller; after the first device determines the indication information of the forwarding path, the method 100 further includes: the controller sends the path indication information to a source network node of the packet, where the N network nodes include the source network node.
Specifically, if the first device is a controller, the indication information may be determined by centralized control of the controller. The controller may receive current traffic information sent by the plurality of network nodes, and may also receive a source address and a destination address of a packet sent by the first network node, and determine a forwarding path for the packet according to the current traffic information sent by the plurality of network nodes and the source address and the destination address of the packet, where the forwarding path includes N network nodes of the plurality of network nodes. The controller may also receive at least one own link number sent by the N network nodes, determine, according to the at least one own link number sent by the forwarding path at the N network nodes, a link number of the N network nodes, which is used for forwarding a packet, and determine, for each network node in the N network nodes, a node number, further determine indication information, where the indication information indicates a target link number corresponding to each node number in the N node numbers, and send the indication information to a first network node, that is, a source network node, where the first network node forwards the packet according to the indication information, and encapsulates the indication information in a packet header for forwarding.
Fig. 3 shows a method 200 for transmitting data according to an embodiment of the present invention, where the method 200 includes:
s210, a first network node receives a message, wherein a message header of the message carries indication information, the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to N network nodes on a forwarding path of the message, and N is an integer greater than or equal to 2;
s220, the first network node determines a node number of the first network node;
s230, the first network node determines a first target link number corresponding to the node number of the first network node according to the message header of the message;
s240, the first network node forwards the packet on the link corresponding to the first target link number.
Specifically, the N node numbers may include a node number of a first network node, where the first target link number is a target link number corresponding to the first network node number, the N node numbers may correspond to N network nodes on a forwarding path of the packet one to one, and the N node numbers correspond to the N target link numbers one to one, and after the first network node receives the packet, the first network node determines a node number of itself according to a packet header and determines the first target link number corresponding to the node number of itself, so that the target link number for forwarding the packet can be determined according to the node number of the network node, which may improve an application range of data transmission, for example, may be transmitted in an IPv4 network.
More specifically, when each network node in the N network nodes receives a packet, the packet header includes indication information, which may be used to indicate a correspondence relationship between a node number of the network node and a target link number, and may also indicate a position where each target link number occupies a byte of the packet header, each network node may determine, according to the indication information in the packet header, a target link number corresponding to its own number, and search, according to the position where the node number of each network node indicated by the indication information occupies the byte of the packet header, the target link number of each network node, and transmit data on a link corresponding to the searched target link number, where the indication information in the packet header exists during the entire packet forwarding process, so as to avoid transmitting data by stripping each layer address, even if only the source address and the destination address of the message are available, the message can be transmitted through the indication information, so that the limitation of the message in network transmission is avoided, the application range of data transmission is improved, and the method and the device can be applied to the transmission of an IPv4 network.
Optionally, the first network node may receive a packet sent by a previous network node adjacent to the first network node on the forwarding path.
Optionally, the indication information may indicate that the target link number of each network node occupies equal bytes of the header; optionally, each network node may sequentially search, according to its own node number, a target link number corresponding to its own node number.
Optionally, the indication information may indicate that the target link number corresponding to each network node may occupy different byte sizes of the packet header, and optionally, each network node searches for the target link number corresponding to the node number according to the node number and the indication information of the network node.
Optionally, the packet header of the packet carries N node numbers in addition to the indication information, so that after each network node receives the packet, the node number of the network node itself is determined, and after the node number of the network node itself is found by searching the node number of the packet itself, a target link number corresponding to the node number of the network node itself is found, and the packet is forwarded on a link corresponding to the target link number.
The node number is used to identify a network node, for example, the node number may be used to identify the network node as the hop on a forwarding path, and the node number may also be a result of a summation of a lifetime of a packet in the network node and the maximum number of forwarding nodes, and the like. The node number may be determined according to other manners, and is not limited herein. The node numbers of the same network node may be different when transmitting different messages, for example, the node number of the first network node when transmitting the first message is 2, and the node number of the first network node when transmitting the second message may not be 2, for example, may be 4, etc., that is, the node number of each network node is not fixed. The network node may determine a target link number for forwarding the packet according to the node number of the network node itself, and further forward the packet on a link corresponding to the determined target link number.
Optionally, the first network node may determine its own node number according to the packet, for example, the first network node may determine its own node number according to TTL of a packet header of the packet; for another example, the first network node may determine its own node number according to the current transmission hop count of the packet in the packet header.
As an alternative embodiment, before S210, the method 200 further includes: the first network node sends at least one link number of the first network node to the first device, wherein the at least one link number includes the first target link number, and the byte size occupied by the first target link number in the header is determined according to the largest link number in the at least one link number.
Optionally, the byte size occupied by the first target link number in the header may be the byte size occupied by the largest link number in the at least one link number.
Therefore, the byte size of the first target link number in the message header is determined according to the actual required size, each link label in the prior art occupies a fixed 32bit, all link labels on the path are packaged in the message header, and the link labels occupy a large amount of message space, so that the transmission efficiency is low.
As an optional embodiment, the header of the packet further carries: TTL of the message; prior to S220, the method 200 further includes: the first network node receives the maximum forwarding node number L sent by the first equipment, wherein the L is an integer greater than or equal to N; s120, comprising: and the first network node determines the node number of the first network node according to the L and the TTL carried in the message header.
Specifically, each network node can receive the maximum number L of forwarding nodes sent by the first device, and when receiving a packet, a packet header includes a time to live TTL of the packet, and each network node determines its own node number according to L and TTL. However, if how the first device generates the node number of each network node, how each network node obtains its own node number, that is, the way in which the first device generates the node number is the same as the way in which each network node generates its own node number, so as to further ensure that the packet can be forwarded through a correct forwarding path.
As an optional embodiment, the determining, by the first network node, the node number of the first network node according to the L and the TTL carried in the packet header includes: and the first network node determines the result of the TTL for complementing the L as the node number of the first network node.
Specifically, the result of the addition of the TTL to the L in the message of each network node is determined as the node number of each network node, and since the TTL phase difference between every two adjacent network nodes is 1, that is, if the TTL of the first network node is T0, the value of the lifetime of the message is reduced by 1 for every network node, in this way, the node numbers of any two network nodes are different, that is, each node number corresponds to one target link number, and it is impossible that two identical node numbers correspond to two target link numbers, it can be ensured that the message is transmitted on the link corresponding to the correct target link number, and the reliability of data transmission is further improved.
As an optional embodiment, the header of the packet further carries: the current transmission hop count of the message; s220, including: and the first network node determines the value of the current transmission hop number in the message header as the node number of the first network node.
Specifically, each time a message passes through one network node, the current transmission hop count in the message header is increased by 1, when the first network node receives the message, the current transmission hop count in the message header is determined as the node number of the first network node, if the first network node is the first network node in the N network nodes, that is, the first network node is the source network node, the first network node finds the target link number corresponding to the node number 1 if the value of the current transmission hop count in the message header of the message received by the first network node is 1, and forwards the message on the link of the target link number corresponding to the node number 1 of the high message.
As an alternative embodiment, before S240, the method 200 further includes: and the first network node updates the value of the current transmission hop number in the message header to the node number of the first network node plus 1.
Specifically, after each network node receives a message and determines its own node number according to the message header of the message, the value of the current transmission hop count in the message header is updated to the node number of itself plus 1, so that after the next network node receives the message, its own node number is determined according to the updated current transmission hop count.
It should be understood that the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present invention.
The method for transmitting data according to the embodiment of the present invention is described in detail above with reference to fig. 2 and 3, and the apparatus for transmitting data according to the embodiment of the present invention is described in detail below with reference to fig. 4 to 7.
Fig. 4 shows an apparatus 300 for transmitting data according to an embodiment of the present invention, where the apparatus 300 includes:
a receiving module 310, configured to receive a packet, where a packet header of the packet carries indication information, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to N network nodes on a forwarding path of the packet, and N is an integer greater than or equal to 2;
a determining module 320 for determining a node number of the apparatus;
the determining module 310 is further configured to determine, according to the packet header of the packet, a first target link number corresponding to the node number of the device;
the sending module 330 is configured to forward the packet on the link corresponding to the first target link number.
As an alternative embodiment, the sending module 330 is further configured to: before receiving a message, sending at least one link number of the device to a first device, wherein the at least one link number includes the first target link number, and the byte size occupied by the first target link number in the message header is determined according to the largest link number in the at least one link number.
As an optional embodiment, the header of the packet further carries: the time to live of the message TTL; the receiving module 310 is further configured to: before determining the node number of the device, receiving the maximum number L of forwarding nodes sent by first equipment, wherein the L is an integer greater than or equal to N; the determining module 320 is specifically configured to: and determining the node number of the device according to the L and the TTL carried in the message header.
As an optional embodiment, the determining module 320 is further specifically configured to: and determining the remainder result of the TTL on the L as the node number of the device.
As an optional embodiment, the header of the packet further carries: the current transmission hop count of the message; the determining module 320 is further specifically configured to: and determining the value of the current transmission hop number in the message header as the node number of the device.
As an alternative embodiment, the apparatus 300 further comprises: an update module: and updating the value of the current transmission hop count in the message header to the node number of the device plus 1 before forwarding the message on the link corresponding to the first target link number.
It should be appreciated that the apparatus 300 herein is embodied in the form of functional modules. The term module herein may refer to an Application Specific Integrated Circuit (ASIC), an electronic Circuit, a processor (e.g., a shared, dedicated, or group processor) and memory that execute one or more software or firmware programs, a combinational logic Circuit, and/or other suitable components that support the described functionality. In an optional example, it may be understood by those skilled in the art that the apparatus 300 may be specifically a first network node in the foregoing embodiment, and the apparatus 300 may be configured to perform each procedure and/or step corresponding to the first network node in the foregoing method embodiment, and details are not described herein again to avoid repetition.
Fig. 5 shows an apparatus 400 for transmitting data according to an embodiment of the present invention, where the apparatus 400 includes:
a determining module 410, configured to determine a forwarding path of the packet, where the forwarding path includes N network nodes, and N is an integer greater than or equal to 2;
the determination module 410 is further configured to: and determining indication information of the forwarding path, wherein the indication information includes a target link number corresponding to each node number in N node numbers, the N node numbers correspond to the N network nodes, and a message header of the message carries the indication information of the forwarding path.
As an alternative embodiment, the apparatus 400 further comprises: a first obtaining module, configured to obtain at least one link number of an ith network node in the N network nodes before determining the indication information of the forwarding path; the determining module 410 is specifically configured to: and according to the forwarding path, determining a target link number of the ith network node in at least one link number of the ith network node, wherein i is an integer which is greater than 0 and less than or equal to N.
As an alternative embodiment, the determining module 410 is further configured to: after obtaining at least one link number of the ith network node in the N network nodes, determining the byte size occupied by the target link number of the ith network node in the packet according to the largest link number in the at least one link number of the i network node.
As an alternative embodiment, the determining module 410 is further configured to: before the indication information of the forwarding path is determined, determining the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein the L is an integer greater than or equal to N; the determining module 410 is further specifically configured to: and determining the node number of each network node according to the L and the survival time of the message corresponding to each network node in the N network nodes, and determining the target link number corresponding to the node number of each network node by the first equipment.
As an optional embodiment, the determining module 410 is further specifically configured to: and determining the result of the remainder of the survival time of the message corresponding to each network node in the N network nodes on the L as the node number of each network node, and determining the target link number corresponding to the node number of each network node.
As an optional embodiment, the determining module 410 is further specifically configured to: and determining the forwarding hop number corresponding to each network node in the N network nodes in the forwarding path as the node number of each network node, and determining the target link number corresponding to the node number of each network node.
As an alternative embodiment, the determining module 410 is further configured to: after the forwarding path of the message is determined, determining an initial value of the forwarding hop count of the message, wherein a message header of the message carries the initial value of the forwarding hop count.
As an alternative embodiment, the apparatus 400 further comprises: a second obtaining module, configured to obtain a source address and a destination address of the packet and current traffic information of each network node in a plurality of network nodes in a current network topology before the forwarding path of the packet is determined; the determination module 410 is further configured to: and determining the forwarding path according to the source address and the destination address and the current flow information of each network node in the plurality of network nodes.
As an alternative embodiment, the apparatus 400 further comprises: a first sending module, configured to send the maximum number L of forwarding nodes that the packet can pass through to each network node in the N network nodes after determining the maximum number L of forwarding nodes that the packet can pass through according to the current network topology structure.
As an optional embodiment, the apparatus 400 is a source network node of the packet, and the apparatus 400 further includes: and the second sending module is used for forwarding the message according to the forwarding path after the device determines the indication information of the forwarding path.
As an alternative embodiment, the apparatus 400 is a controller; the apparatus 400 further comprises: a third sending module, configured to send the indication information to a source network node of the packet after the apparatus determines the indication information of the forwarding path, where the N network nodes include the source network node.
It should be appreciated that the apparatus 400 herein is embodied in the form of functional modules. The term module herein may refer to an Application Specific Integrated Circuit (ASIC), an electronic Circuit, a processor (e.g., a shared, dedicated, or group processor) and memory that execute one or more software or firmware programs, a combinational logic Circuit, and/or other suitable components that support the described functionality. In an optional example, it may be understood by those skilled in the art that the apparatus 400 may be specifically a first device in the foregoing embodiment, and the apparatus 400 may be configured to perform each procedure and/or step corresponding to the first device in the foregoing method embodiment, and in order to avoid repetition, details are not described here again.
Fig. 6 illustrates an apparatus 500 for transmitting data according to an embodiment of the present invention, where the apparatus 500 includes a receiver 510, a processor 520, a transmitter 530, a memory 540, and a bus system 550. Wherein, the receiver 510, the processor 520, the transmitter 530 and the memory 540 are connected by a bus system 550, the memory 540 is used for storing instructions, the processor 520 is used for executing the instructions stored by the memory 540 to control the receiver 510 to receive signals and control the transmitter 530 to transmit instructions.
The receiver 510 is configured to receive a packet, where a packet header of the packet carries indication information, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to N network nodes on a forwarding path of the packet, and N is an integer greater than or equal to 2; the processor 520 is configured to determine a node number of the apparatus; the processor 520 is further configured to determine, according to a header of the packet, a first target link number corresponding to the node number of the device; the sender 530 is configured to forward the packet on the link corresponding to the first target link number.
As an alternative embodiment, the transmitter 530 is further configured to: before receiving the packet, at least one link number of the apparatus 500 is sent to the first device, where the at least one link number includes the first target link number, and the byte size occupied by the first target link number in the packet header is determined according to the largest link number in the at least one link number.
As an optional embodiment, the header of the packet further carries: the time to live of the message TTL; the receiver 510 is further configured to: before determining the node number of the device, receiving the maximum number L of forwarding nodes sent by first equipment, wherein the L is an integer greater than or equal to N; the processor 520 is specifically configured to: and determining the node number of the device according to the L and the TTL carried in the message header.
As an alternative embodiment, the processor 520 is specifically further configured to: and determining the residue of the TTL on the L as the node number of the first network node.
As an optional embodiment, the header of the packet further carries: the current transmission hop count of the message; the processor 520 is further specifically configured to: and determining the value of the current transmission hop number in the message header as the node number of the device.
As an alternative embodiment, the processor 520 is further configured to: and updating the value of the current transmission hop count in the message header to the node number of the first network node plus 1 before forwarding the message on the link corresponding to the first target link number.
It is to be understood that the apparatus 500 may be embodied as the first network node in the above embodiments, and may be configured to perform each step and/or flow corresponding to the first network node in the above method embodiments. Alternatively, the memory 540 may include both read-only memory and random access memory, and provide instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor 520 may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may perform the steps corresponding to the first network node in the above method embodiments.
Fig. 7 illustrates an apparatus 600 for transmitting data according to an embodiment of the present invention, where the apparatus 600 includes a receiver 610, a processor 620, a transmitter 630, a memory 640, and a bus system 650. Wherein, the receiver 610, the processor 620, the transmitter 630 and the memory 640 are connected by a bus system 650, the memory 640 is used for storing instructions, and the processor 620 is used for executing the instructions stored in the memory 640 to control the receiver 610 to receive signals and control the transmitter 630 to transmit instructions.
The processor 620 is configured to determine a forwarding path of the packet, where the forwarding path includes N network nodes, and N is an integer greater than or equal to 2; the processor 620 is further configured to: and determining indication information of the forwarding path, wherein the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to the N network nodes, and a message header of the message carries the indication information of the forwarding path.
As an alternative embodiment, receiver 610 is configured to: before determining the indication information of the forwarding path, acquiring at least one link number of an ith network node in the N network nodes; the processor 620 is specifically configured to: and according to the forwarding path, determining a target link number of the ith network node in at least one link number of the ith network node, wherein i is an integer which is greater than 0 and less than or equal to N.
As an alternative embodiment, the processor 620 is further configured to: after obtaining at least one link number of the ith network node in the N network nodes, determining the byte size occupied by the target link number of the ith network node in the packet according to the largest link number in the at least one link number of the i network node.
As an alternative embodiment, the processor 620 is further configured to: before the indication information of the forwarding path is determined, determining the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein the L is an integer greater than or equal to N; the processor 620 is further specifically configured to: and determining the node number of each network node according to the L and the survival time of the message corresponding to each network node in the N network nodes, and determining the target link number corresponding to the node number of each network node.
As an alternative embodiment, the processor 620 is specifically further configured to: and determining the result of the remainder of the survival time of the message corresponding to each network node in the N network nodes on the L as the node number of each network node, and determining the target link number corresponding to the node number of each network node.
As an alternative embodiment, the processor 620 is specifically further configured to: and determining the forwarding hop number corresponding to each network node in the N network nodes in the forwarding path as the node number of each network node.
As an alternative embodiment, receiver 610 is configured to: before the forwarding path of the message is determined, obtaining a source address and a destination address of the message and current flow information of each network node in a plurality of network nodes in a current network topology structure; the processor 620 is further configured to: and determining the forwarding path according to the source address and the destination address and the current flow information of each network node in the plurality of network nodes.
As an alternative embodiment, the transmitter 630 is configured to: after the maximum number L of forwarding nodes through which the packet can pass is determined according to the current network topology structure, the L is sent to each network node in the N network nodes.
As an alternative embodiment, the apparatus 600 is a source network node of the packet, and the sender 630 is further configured to: after determining the indication information of the forwarding path, the apparatus 600 forwards the packet according to the indication information.
As an alternative embodiment, the apparatus 600 is a controller; the transmitter 630 is further configured to: after determining the indication information of the forwarding path, the apparatus 600 sends the indication information of the forwarding path to a source network node of the packet, where the N network nodes include the source network node.
It is to be understood that the apparatus 600 may be embodied as the first device in the above embodiments, and may be configured to perform each step and/or flow corresponding to the first device in the above method embodiments. The memory 640 may alternatively comprise read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information. The processor 620 may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor may perform the steps corresponding to the first device in the above method embodiment.
Those of ordinary skill in the art will appreciate that the various method steps and elements described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both, and that the steps and elements of the various embodiments have been described above generally in terms of their functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the unit is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (30)

1. A method of transmitting data, the method comprising:
a first network node receives a message, wherein a message header of the message carries indication information, the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to N network nodes on a forwarding path of the message, and N is an integer greater than or equal to 2;
the first network node determining a node number of the first network node;
the first network node determines a first target link number corresponding to the node number of the first network node according to the message header of the message;
and the first network node forwards the message on the link corresponding to the first target link number.
2. The method of claim 1, wherein prior to the first network node receiving the packet, the method further comprises:
the first network node sends at least one link number of the first network node to a first device, wherein the at least one link number comprises the first target link number, and the byte size of the first target link number in the header is determined according to the largest link number in the at least one link number.
3. The method according to claim 1 or 2, wherein the header of the packet further carries: TTL (time to live) of the message;
before the first network node determines the node number of the first network node, the method further comprises:
the first network node receives the maximum forwarding node number L sent by the first equipment, wherein L is an integer greater than or equal to N;
the first network node determining a node number of the first network node, including:
and the first network node determines the node number of the first network node according to the L and the TTL carried in the message header.
4. The method according to claim 1 or 2, wherein the header of the packet further carries: the current transmission hop count of the message;
the first network node determining a node number of the first network node, including:
and the first network node determines the value of the current transmission hop number in the message header as the node number of the first network node.
5. The method according to claim 4, wherein before the first network node forwards the packet on the link corresponding to the first target link number, the method further comprises:
and the first network node updates the value of the current transmission hop count in the message header to the node number of the first network node plus 1.
6. A method of transmitting data, the method comprising:
the method comprises the steps that first equipment determines a forwarding path of a message, wherein the forwarding path comprises N network nodes, and N is an integer greater than or equal to 2;
the first device determines indication information of the forwarding path, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to the N network nodes, and a packet header of the packet carries the indication information.
7. The method of claim 6, wherein before the first device determines the indication of the forwarding path, the method further comprises:
the first equipment acquires at least one link number of the ith network node in the N network nodes;
the determining, by the first device, the indication information of the forwarding path includes:
and the first equipment determines a target link number of the ith network node in at least one link number of the ith network node according to the forwarding path, wherein i is an integer which is greater than 0 and less than or equal to N.
8. The method of claim 7, wherein after the first device obtains at least one link number of an ith network node of the N network nodes, the method further comprises:
and the first equipment determines the byte size occupied by the target link number of the ith network node in the message according to the maximum link number in at least one link number of the i network nodes.
9. The method according to any of claims 6 to 8, wherein before the first device determines the indication information of the forwarding path, the method further comprises:
the first equipment determines the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein L is an integer greater than or equal to N;
the determining, by the first device, the indication information of the forwarding path includes:
the first equipment determines the node number of each network node according to the L and the survival time of the message corresponding to each network node in the N network nodes;
the first device determines a target link number corresponding to the node number of each network node.
10. The method according to any one of claims 6 to 8, wherein the determining, by the first device, the indication information of the forwarding path includes:
the first device determines a forwarding hop count corresponding to each network node in the N network nodes in the forwarding path as a node number of each network node;
the first device determines a target link number corresponding to the node number of each network node.
11. The method according to any one of claims 6 to 8, wherein after the first device determines a forwarding path of the packet, the method further comprises:
and the first equipment determines an initial value of the forwarding hop count of the message, wherein a message header of the message carries the initial value of the forwarding hop count.
12. The method according to any one of claims 6 to 8, wherein before the first device determines the forwarding path of the packet, the method further comprises:
the first equipment acquires a source address and a destination address of the message and current flow information of each network node in a plurality of network nodes in a current network topological structure;
the determining, by the first device, a forwarding path of the packet includes:
and the first equipment determines the forwarding path according to the source address and the destination address and the current flow information of each network node in the plurality of network nodes.
13. The method according to claim 9, wherein after the first device determines the maximum number L of forwarding nodes that the packet can pass through according to the current network topology, the method further comprises:
the first device sends the L to each of the N network nodes.
14. The method according to any of claims 6 to 8, wherein the first device is a source network node of the packet,
after the first device determines the indication information of the forwarding path, the method further includes:
and the source network node forwards the message according to the indication information.
15. The method of any one of claims 6 to 8, wherein the first device is a controller;
after the first device determines the indication information of the forwarding path, the method further includes:
the controller sends the indication information to a source network node of the packet, where the N network nodes include the source network node.
16. An apparatus for transmitting data, the apparatus comprising:
a receiving module, configured to receive a packet, where a packet header of the packet carries indication information, where the indication information is used to indicate a target link number corresponding to each node number in N node numbers, where the N node numbers correspond to N network nodes on a forwarding path of the packet, and N is an integer greater than or equal to 2;
a determining module for determining a node number of the apparatus;
the determining module is further configured to determine, according to a packet header of the packet, a first target link number corresponding to a node number of the device;
and the sending module is used for forwarding the message on the link corresponding to the first target link number.
17. The apparatus of claim 16, wherein the sending module is further configured to:
before receiving a message, sending at least one link number of the device to a first device, where the at least one link number includes the first target link number, and a byte size occupied by the first target link number in the message header is determined according to a largest link number in the at least one link number.
18. The apparatus according to claim 16 or 17, wherein the header of the packet further carries: TTL (time to live) of the message;
the receiving module is further configured to: before determining the node number of the device, receiving the maximum forwarding node number L sent by first equipment, wherein the L is an integer greater than or equal to N;
the determining module is specifically configured to: and determining the node number of the device according to the L and the TTL carried in the message header.
19. The apparatus according to claim 16 or 17, wherein the header of the packet further carries: the current transmission hop count of the message;
the determining module is specifically further configured to: and determining the value of the current transmission hop count in the message header as the node number of the device.
20. The apparatus of claim 19, further comprising:
an update module: and the node number updating unit is configured to update the value of the current transmission hop count in the packet header to the node number of the device plus 1 before forwarding the packet on the link corresponding to the first target link number.
21. An apparatus for transmitting data, the apparatus comprising:
a determining module, configured to determine a forwarding path of a packet, where the forwarding path includes N network nodes, and N is an integer greater than or equal to 2;
the determination module is further to: and determining indication information of the forwarding path, wherein the indication information is used for indicating a target link number corresponding to each node number in N node numbers, the N node numbers correspond to the N network nodes, and a message header of the message carries the indication information.
22. The apparatus of claim 21, further comprising:
a first obtaining module, configured to obtain at least one link number of an ith network node in the N network nodes before determining the indication information of the forwarding path;
the determining module is specifically configured to: and according to the forwarding path, determining a target link number of the ith network node in at least one link number of the ith network node, wherein i is an integer which is greater than 0 and less than or equal to N.
23. The apparatus of claim 22, wherein the determining module is further configured to:
after at least one link number of the ith network node in the N network nodes is obtained, determining the byte size occupied by the target link number of the ith network node in the message according to the largest link number in the at least one link number of the i network nodes.
24. The apparatus of any of claims 21-23, wherein the determining module is further configured to:
before the indication information of the forwarding path is determined, determining the maximum number L of forwarding nodes through which the message can pass according to the current network topology structure, wherein L is an integer greater than or equal to N;
the determining module is specifically further configured to:
determining the node number of each network node according to the L and the survival time of the message corresponding to each network node in the N network nodes; and determining a target link number corresponding to the node number of each network node.
25. The apparatus according to any one of claims 21 to 23, wherein the determining module is further configured to:
determining a forwarding hop count corresponding to each network node in the N network nodes in the forwarding path as a node number of each network node;
and determining a target link number corresponding to the node number of each network node.
26. The apparatus of any of claims 21-23, wherein the determining module is further configured to:
after the forwarding path of the message is determined, determining an initial value of the forwarding hop count of the message, wherein a message header of the message carries the initial value of the forwarding hop count.
27. The apparatus of any one of claims 21 to 23, further comprising:
a second obtaining module, configured to obtain a source address and a destination address of the packet and current traffic information of each network node in a plurality of network nodes in a current network topology before determining a forwarding path of the packet;
the determination module is further to: and determining the forwarding path according to the source address and the destination address and the current flow information of each network node in the plurality of network nodes.
28. The apparatus of claim 24, further comprising:
a first sending module, configured to send L to each network node in the N network nodes after determining, according to the current network topology structure, the maximum number L of forwarding nodes through which the packet can pass.
29. The apparatus according to any of claims 21 to 23, wherein the apparatus is a source network node of the packet,
the device further comprises:
and the second sending module is used for forwarding the message according to the forwarding path after the device determines the indication information of the forwarding path.
30. The apparatus of any one of claims 21 to 23, wherein the apparatus is a controller;
the device further comprises:
a third sending module, configured to send the indication information to a source network node of the packet after the apparatus determines the indication information of the forwarding path, where the N network nodes include the source network node.
CN201610284852.7A 2016-04-29 2016-04-29 Method and device for transmitting data Active CN107342939B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610284852.7A CN107342939B (en) 2016-04-29 2016-04-29 Method and device for transmitting data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610284852.7A CN107342939B (en) 2016-04-29 2016-04-29 Method and device for transmitting data

Publications (2)

Publication Number Publication Date
CN107342939A CN107342939A (en) 2017-11-10
CN107342939B true CN107342939B (en) 2020-02-14

Family

ID=60222766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610284852.7A Active CN107342939B (en) 2016-04-29 2016-04-29 Method and device for transmitting data

Country Status (1)

Country Link
CN (1) CN107342939B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714742A (en) * 2018-05-11 2023-02-24 华为技术有限公司 Message sending method, network node and system
CN110505600B (en) 2018-05-18 2022-05-10 华为技术有限公司 Routing method and device
US11245617B1 (en) 2018-12-28 2022-02-08 Juniper Networks, Inc. Compressed routing header
US11412071B2 (en) 2019-05-13 2022-08-09 Juniper Networks, Inc. Compressed routing header information for networks
CN112398732B (en) * 2019-08-12 2023-09-12 迈普通信技术股份有限公司 Message processing method, device and system
CN113364679B (en) * 2020-03-06 2023-04-18 华为技术有限公司 Segmented routing based forwarding control method, message forwarding method and device
CN113395206B (en) * 2020-03-13 2023-06-02 华为技术有限公司 Route determining method, device and network equipment
CN111966595B (en) * 2020-08-13 2024-04-05 安徽芯纪元科技有限公司 Method for positioning core in software debugging system and method for transmitting debugging message
CN112272143B (en) * 2020-12-12 2021-03-30 广东睿江云计算股份有限公司 Route learning and forwarding method
CN115118544B (en) * 2021-03-08 2024-04-12 北京华为数字技术有限公司 Communication method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217498A (en) * 2008-01-18 2008-07-09 北京科技大学 A self-organizing network routing method based on data message point-to-point decision making
CN101931587A (en) * 2009-06-19 2010-12-29 华为技术有限公司 Method and system of virtue cluster route
CN102014043A (en) * 2009-09-08 2011-04-13 中兴通讯股份有限公司 Address mapping system, data transmission method and address mapping maintenance method
CN103475581A (en) * 2012-06-06 2013-12-25 华为技术有限公司 Network tab distribution method, equipment and system
CN104580025A (en) * 2013-10-18 2015-04-29 华为技术有限公司 Method for establishing in-band connection in open flow network and switch

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217498A (en) * 2008-01-18 2008-07-09 北京科技大学 A self-organizing network routing method based on data message point-to-point decision making
CN101931587A (en) * 2009-06-19 2010-12-29 华为技术有限公司 Method and system of virtue cluster route
CN102014043A (en) * 2009-09-08 2011-04-13 中兴通讯股份有限公司 Address mapping system, data transmission method and address mapping maintenance method
CN103475581A (en) * 2012-06-06 2013-12-25 华为技术有限公司 Network tab distribution method, equipment and system
CN104580025A (en) * 2013-10-18 2015-04-29 华为技术有限公司 Method for establishing in-band connection in open flow network and switch

Also Published As

Publication number Publication date
CN107342939A (en) 2017-11-10

Similar Documents

Publication Publication Date Title
CN107342939B (en) Method and device for transmitting data
KR102620026B1 (en) Message processing method, relevant equipment and computer storage medium
US10250501B2 (en) Service packet forwarding method and apparatus
CN110034971B (en) Method and device for detecting service chain
CN110661711B (en) Method for generating label forwarding table, message sending method, device and equipment
US20190097758A1 (en) Data transmission method, device, and system
US11902153B1 (en) Compressed routing header
CN107968750B (en) Message transmission method, device and node
CN111385209B (en) Message processing method, message forwarding method, device and equipment
CN107124363B (en) Message broadcasting method and device
CN109714274B (en) Method for acquiring corresponding relation and routing equipment
CN108616367B (en) Fault positioning method and network equipment
EP3886384B1 (en) Methods for updating route in network, network devices, and system
CN111988266B (en) Method for processing message
EP4068704A1 (en) Packet sending method, routing table entry generation method, device, and storage medium
US10644900B2 (en) Forwarding multicast data packets using bit index explicit replication (BIER) for BIER-incapable network devices
CN112468396B (en) Method, device and system for programming host network performance requirements
CN106900174B (en) Data transmission method, device and system for wireless local area network mesh network
CN112491718A (en) Message header processing method and device, storage medium and electronic device
WO2019241992A1 (en) Routing method, node and computer storage medium
US20240073128A1 (en) Message encapsulation and de-encapsulation method and device, storage medium, and electronic device
CN105100300B (en) Method and device for converting network address into NAT
CN108965122B (en) Routing method, device and computer readable storage medium
CN107241236B (en) Forwarding information base table item detection method, detection equipment and network equipment
CN104412548A (en) Method and device for keeping user device IP address fixed

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant