The retransmission method of high speed data link control data
Technical field
The present invention relates to data communication technology, specially refer to a kind of method of carrying out network equipment forwarding high speed data link control (HDLC, High Level Data Link Control) data of data forwarding based on hardware routing table.
Background technology
Data communication system can be made up of three parts, i.e. transmitter, channel and receiver.In two-way communication, each side of communication has transmitter and receiver.Current use is more is the data communication system that adopts the conventional data circuit of seven parts to describe, as shown in Figure 1, wherein, data terminal equipment (DTE, Data Terminal Equipment) is meant the equipment that all link to each other with the network port, comprises simple terminal, intelligent terminal, synchronous terminal, asynchronous terminal or the like.Data circuit terminating equipment (DCE, Data Circuit-Terminating Equipment) is meant modulator-demodulator, multiplexer or digital device or the like equipment.
Important task of data communication system is to be responsible for data are accurately transmitted between two DTE with certain coded format, and the data that assurance receiving terminal DTE receives are identical with the data that transmitting terminal DTE sends.This error control function is normally realized by the data link layer protocol of International Organization for Standardization definition.
The HDLC agreement is a kind of bit-oriented data link control procedure by the ISO promulgation, be data terminal equipment (DTE, Data Terminal Equipment) with data circuit terminating equipment (DCE, Data Circuit-Terminating Equipment) between the data link layer protocol of interface.At present, the HDLC agreement extensively is used in the flexible exchanging network, in actual application, the employed data link layer of soft switch router that only needs to dispose in the flexible exchanging network is encapsulated as the HDLC encapsulation, described soft switch router just can directly generate software routing table by static routing configuration or dynamic routing protocol, handle thereby finish the HDLC forwarding of data, therefore, the configuration when using the soft switch router to transmit the HDLC data is very simple.But the shortcoming of using above-mentioned method of carrying out data forwarding according to software routing table to transmit the HDLC data is to expend time in longlyer, makes the data transmission performance of data communication system be subjected to influencing significantly.
For this reason, data forwarding method based on hardware routing table has been proposed.Owing to write down the mapping relations between destination network segment, next-hop network equipment and this end interface in the hardware routing table, the network equipment can be according to the destination network segment at the destination address place of received data, directly find the interface of transmitting current data, thereby can improve the forwarding speed of router greatly.At present, the high speed switching equipment of using always based on Ethernet exchange kernel just can be supported the data forwarding based on hardware routing table.Yet, because the HDLC agreement does not have the IP control protocol (IPCP) that can carry out two ends Internet protocol (IP) address negotiation functionality, thereby, when use is transmitted the HDLC data based on the network equipment of hardware routing table, the interface mappings of next-hop network equipment and local terminal can't be got up, thereby cause the described network equipment can't set up described hardware routing table based on hardware routing table, thereby can not carry out the HDLC forwarding of data handles, influence the HDLC agreement at the network equipment based on hardware routing table, for example based on the high speed switching equipment of Ethernet exchange kernel, in normal use.
Summary of the invention
In order to solve the problems of the technologies described above, the invention provides a kind of HDLC forwarding of data method, can effectively solve the problem that the network equipment that carries out data forwarding based on hardware routing table can not be transmitted the HDLC data.
HDLC forwarding of data method of the present invention comprises:
A, when the data link layer encapsulated type when front port is HDLC, will work as the next-hop network apparatus bound of front port and this interface;
B, according to the address of described next-hop network equipment, generate map addresses list item when front port;
C, cooperate static routing configuration or dynamic routing protocol algorithm to generate the hardware routing table of present networks equipment according to the map addresses list item of each interface;
D, after receiving HDLC packet to be transmitted, according to the destination address that carries in the described HDLC packet, search the corresponding interface of transmitting this packet from described hardware routing table, this HDLC packet is forwarded.
The network equipment of the present invention is the high speed switching equipment based on Ethernet exchange kernel.
The described next-hop network apparatus bound that will work as front port and this interface of steps A is: set up when the data-link layer address of front port and the corresponding relation between this interface next-hop network device network layer address.
Network layer address of the present invention is the IP address of next-hop network equipment.
The described map addresses list item of step B comprises: when the network layer address of the data-link layer address of front port and corresponding with it next-hop network equipment.
Step B carries out when current interface protocol state is startup.
Steps A is described will work as front port and next-hop network apparatus bound before, further comprise:
A1, judge when front port whether bind with certain network equipment, if, execution in step A2 then; Otherwise process ends continues execution in step A;
A2, judge with when the network appliance address of front port binding whether identical with the described next-hop network of steps A device address, if, process ends then, continuation execution in step C; Otherwise, execution in step A3;
A3, remove original binding, process ends continues execution in step A then.
Step D further comprises: when the data link layer of front port is removed the encapsulation of HDLC, if bound the next-hop network device address when front port, then remove original binding.
The original binding of removing of the present invention comprises: remove when the data-link layer address of front port and the corresponding relation between the described network appliance address; If when front port calculated address mapping item, then remove the map addresses list item that has generated when front port.
Step D further comprises: becoming when stopping by startup when the protocol status of front port, and according to when the binding relationship of front port, that removing has generated, when the map addresses list item of front port with this interface next-hop network equipment.
According to a further aspect in the invention, the present invention also provides a kind of high speed data link control HDLC forwarding of data method, comprising:
A, when the data link layer encapsulated type when front port is HDLC, judge when front port and whether bind with certain network equipment, if, execution in step b then; Otherwise, execution in step c;
B, judge whether identical with the network appliance address of binding when front port with the next-hop network device address of this interface, if, execution in step d; Otherwise, remove original binding, then execution in step c;
C, at current interface protocol state when starting, will work as the next-hop network apparatus bound of front port and this interface, and according to the address of described next-hop network equipment, the map addresses list item of front port is worked as in generation;
D, cooperate static routing configuration or dynamic routing protocol algorithm to generate the hardware routing table of present networks equipment according to the map addresses list item of each interface;
E, after receiving HDLC packet to be transmitted, according to the destination address that carries in the described HDLC packet, search the corresponding interface of transmitting this packet from described hardware routing table, this HDLC packet is forwarded.
This shows, HDLC forwarding of data method of the present invention, by working as the front port next-hop network apparatus bound corresponding, can generate map addresses list item, thereby can further generate the hardware routing table of the network equipment when front port with this interface.The network equipment based on hardware routing table can be finished the HDLC forwarding of data according to the hardware routing table that generates, solve the problem that to transmit the HDLC data based on the network equipment of hardware routing table effectively, guarantee that the HDLC agreement is based on the normal use in the network equipment of hardware routing table.
In addition, because the method for the invention realizes being interrupted, therefore be easy on the realization mechanism of original HDLC agreement, expand and realize.
Description of drawings
Fig. 1 is general data communication system structural representation;
Fig. 2 is the method flow diagram that carries out the network equipment forwarding HDLC data of data forwarding based on hardware routing table of the present invention;
Fig. 3 be before steps A shown in Figure 2, check when front port whether with the method flow diagram of other network equipments bindings;
Fig. 4 is the original binding method flow chart of removing of the present invention.
Embodiment
For the purpose, technical scheme and the advantage that make invention is clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in further detail.
In order to solve the problem that can't transmit the HDLC data based on the network equipment of hardware routing table, the invention provides a kind of HDLC forwarding of data method, as shown in Figure 2, this method mainly may further comprise the steps:
A, disposing after the data link layer encapsulated type of front port is HDLC, will work as the front port next-hop network apparatus bound corresponding with this interface.
Wherein, the described network equipment high speed switching equipment or the like that can be based on Ethernet exchange kernel carries out the network equipment of data forwarding based on hardware routing table.
This step is described will work as front port and the next-hop network apparatus bound is specially: set up when the data-link layer address of front port and the corresponding relation between the next-hop network device network layer address.Described network layer address can be IP address or other network layer address of next-hop network equipment.At present, can use opposite end map addresses order to set up when the data-link layer address of front port and the corresponding relation between the next-hop network device network layer address.For example, for high speed switching equipment based on Ethernet exchange kernel, if described network layer address is the IP address of the network equipment, the map addresses order of then described opposite end is: map ip X.X.X.X, wherein, on behalf of next, X.X.X.X jump the IP address that exchanges the high speed switching equipment of kernel based on Ethernet.In addition, in this process, do not need to be provided with address mask, the length that mask will be set automatically based on the high speed switching equipment of Ethernet exchange kernel is 32.
Need to prove that in order to guarantee the correctness of data forwarding, each interface of the described network equipment only allows to bind with a next-hop network equipment.
In addition, in order to realize data forwarding, in this steps A, except will also carrying out the local terminal address configuration with when the address binding of front port and next-hop network equipment.Described local terminal address configuration is meant the network layer address of configuration present networks equipment self.Described local terminal address configuration can steps A is described will work as front port and next-hop network apparatus bound before or carry out afterwards, and can not exceed protection scope of the present invention.
B, according to and when the address of the next-hop network equipment of front port binding, generate map addresses list item when front port.
Described map addresses list item comprises: when the network layer address of the data-link layer address of front port and corresponding with it next-hop network equipment.The map addresses list item of the total interface of each network equipment is formed the address mapping table of present networks equipment.
Need to prove, whenever step B can carry out after steps A, but it is just effective when only being " starting (UP) " at current interface protocol state, therefore, in order to save system resource, when can being chosen in current interface protocol state for " UP " according to the protocol status when front port, carries out step B.
C, according to the map addresses list item of each interface, cooperate static routing configuration or dynamic routing protocol algorithm to generate the hardware routing table of present networks equipment.
Described hardware routing table has write down the network layer address of the destination network segment at certain packet rs destination terminal place, the next-hop network equipment corresponding with this destination network segment and the data-link layer address of corresponding interface.
D, after receiving HDLC packet to be transmitted, according to the destination address that carries in this HDLC packet, and the hardware routing table of present networks equipment, search the corresponding interface of transmitting this packet, and this HDLC packet forwarded by interface.
In this step, the process of forwarding HDLC packet specifically comprises:
D1, according to the destination address that carries in this HDLC packet, obtain the destination network segment at this HDLC packet rs destination terminal place;
D2, search the hardware routing table of present networks equipment, obtain the next-hop network device address corresponding and the data-link layer address of corresponding interface with this destination network segment according to described destination network segment;
D3, according to the data-link layer address of corresponding interface, the HDLC packet that is received is forwarded to described next-hop network equipment by this interface.
This shows,, can solve the network equipment that carries out data forwarding based on hardware routing table and can not carry out the problem that the HDLC data forwarding is handled by HDLC data forwarding method of the present invention.
In order to simplify above-mentioned flow process, in the steps A, before will working as front port and next-hop network apparatus bound, can also further carry out check when front port whether with the process of other network equipments bindings.As shown in Figure 3, this process mainly comprises:
A1, judge when front port whether bind with certain network equipment, if, execution in step A2 then; Otherwise process ends continues execution in step A, is about to when front port and described next-hop network apparatus bound;
A2, judge whether identical with the network appliance address of binding when front port with the described next-hop network of steps A device address, if, process ends then, continue execution in step C, promptly, cooperate static routing configuration or dynamic routing protocol algorithm to generate the hardware routing table of present networks equipment according to the map addresses list item of each interface; Otherwise, execution in step A3;
A3, remove original binding, process ends continues execution in step A then, is about to when front port and the described next-hop network apparatus bound of steps A.
The original binding of the described removing of this step mainly comprises as shown in Figure 4:
A31, releasing are when the data-link layer address of front port and the corresponding relation between the described network appliance address;
Especially, for high speed switching equipment based on Ethernet exchange kernel, if described network layer address is the IP address of the network equipment, then can uses and remove opposite end map addresses UNDO MAP IP order and remove corresponding relation when the IP address of the data-link layer address of front port and next-hop network equipment;
If A32 when front port calculated address mapping item, then removes the map addresses list item that has generated when front port.
By above-mentioned steps, can under the situation that has the identical address mapping item, save the step of calculated address mapping item, the wasting of resources of avoiding repetition calculated address mapping item to cause effectively.
Because the described generation of step B is carried out when the map addresses list item of front port can become " UP " at the protocol status when front port, therefore, carry out in the process of HDLC data forwarding at step D, if when the protocol status of front port changes, for example, when being become " stopping (DOWN) " state by " UP ", the method for the invention also needs according to the mapping relations when front port and next-hop network device address, removes the map addresses list item when front port that has generated.
In addition, carry out in the process of HDLC data forwarding at step D, the method of the invention further comprises: if remove the encapsulation of HDLC when the data link layer of front port, when adopting other data link layer protocols, if bound the next-hop network device address when front port, then removed existing binding.Wherein, the method for unbind is identical with the method that steps A 3 is adopted, and promptly comprises following two steps:
A31, releasing are when the data-link layer address of front port and the corresponding relation of its next-hop network device address;
If A32 then removes the map addresses list item that has generated when front port when there is the map addresses list item in front port.