Realize the method and apparatus and the message forwarding method of 6to4 transistrouteTechnical field
The present invention relates to the IP network data communication field, particularly be used for the 6to4 transistroute realization technology of IPv4 network and IPv6 network interworking.
Background technology
At present, existing internet is just experiencing the period to the IPv6 transition by IPv4.But existing majority of network facility comprises the network equipment in backbone network, enterprise network and the campus network of operator, does not support the IPv6 agreement, therefore, at this transition period, needs some technology to realize that IPv6 equipment moves in existing IPv4 network.IPv6 over IPv4 tunnel is one of technology that satisfies this demand.
IPv6 over IPv4 tunnel definition the starting point and the terminal point in tunnel, be used to connect the IPv6 network of both sides, tunnel, and tunnel itself runs on the IPv4 network.When the IPv6 message arrives this tunnel, add the IPv4 head to the IPv6 message, be referred to as the tunnel head in the tunnel starting point; When the IPv6 message that has the tunnel head arrives termination point of a tunnel, remove the tunnel head, like this, original IPv6 message just can be transmitted in the IPv6 of termination point of a tunnel side network.
IPv6 over IPv4 tunnel generally is divided into configured tunneling technique and automatic tunnel, and configured tunneling technique generally needs starting point IPv4 address, manual configuration tunnel and terminal point IPv4 address, and the IPv4 address of automatic tunnel is embedded in the IPv6 address of message.
In the prior art, as shown in Figure 1, the 6to4 tunnel be exactly the point of a kind of IPv6 over IPv4 to the multiple spot automatic tunnel, realize network service by setting up the tunnel on the border router between Source Site and purpose website (for example source computer in the 6to4 network A and the purpose computer in the 6to4 network B).The 6to4 tunnel is by comprising the IPv4 address of 6to4 endpoint of a tunnel in the IPv6 address prefix of Source Site, purpose website, set up mapping relations between the IPv6 address of the IPv4 address of the 6to4 of these both sides, tunnel border router and Source Site, purpose website.Particularly, the 6to4 tunnel adopts special 6to4 address, its form is " 2002:abcd:efgh: subnet number:: interface ID/64 ", wherein " 2002 " are fixing IPv6 address prefix, " abcd:efgh " expression is embedded in the IPv4 address of the endpoint of a tunnel in the IPv6 address, represents (" 1.1.1.1 " can be expressed as " 0101:0101 " as the IPv4 address) with 16 systems." 2002:abcd:efgh " part unique identification afterwards the position of website in the 6to4 network.Therefore, the 6to4 address has 64 network prefixs, and wherein preceding 48 the user can not change by the IPv4 address on router decision, and back 16 are defined by user oneself.
But the 6to4 tunnel can only transmit the packet that mails to termination point of a tunnel, thus can only be communicated with a plurality of 6to4 networks, and in order further to arrive other IPv6 networks (as 2001: :/16 networks), just need the support of 6to4 relay router.The 6to4 relay router connects IPv4 and IPv6 network (comprising non-6to4 network), therefore, in order to arrive other IPv6 networks by the 6to4 relay router, need the configuring static route on the border router of 6to4 network, 2001: :/162002:abcd:efgh: for example:, this static routing is also referred to as the 6to4 transistroute.In this 6to4 transistroute, the destination is this IPv6 network of network prefix 2001: :/16, next hop address is pointed to the 6to4 address 2002:abcd:efgh: of opposite end 6to4 relay router:, like this, all messages of going to this IPv6 network all can be forwarded to the 6to4 relay router, be forwarded in the IPv6 network by this 6to4 relay router more afterwards, thus the intercommunication of realization 6to4 network (address prefix is with 2002 beginnings) and IPv6 network.But because the restriction of exchange chip in the existing boundary router, this exchange chip itself can not the Direct Recognition upper-layer configured the 6to4 transistroute, therefore can't be according to the 6to4 address of the opposite end 6to4 relay router of pointing out in this 6to4 transistroute, to the IPv6 message encapsulation tunnel head that receives and two layers of information header and with its correct forwarding.
Summary of the invention
For solving the problem of 6to4 network utilisation IPv4 network and IPv6 net interconnecting, realize the 6to4 transistroute, the present invention proposes a kind of method and apparatus and message forwarding method of the 6to4 of realization transistroute, can't support the defective of 6to4 transistroute with the exchange chip that overcomes route exchange device in the prior art.
Technical scheme provided by the invention is as follows:
A kind of method that realizes the 6to4 transistroute comprises: establishment is used for the IPv6 message via the 6to4 transistroute of 6to4 relay router to purpose IPv6 forwarded; Create configured tunneling technique, the purpose IPv4 address of this configured tunneling technique is IPv4 address embedded in the 6to4 address of described 6to4 relay router, and this configured tunneling technique stores in the tunnel table of exchange chip; Create the configured tunneling technique route, the destination address of this configured tunneling technique route is consistent with the destination address of described 6to4 transistroute, and the outgoing interface of this configured tunneling technique route points to described configured tunneling technique; And with described configured tunneling technique route sending-down in the transmitting of exchange chip.
The present invention also provides a kind of route exchange device of the 6to4 of realization transistroute, be used to connect IPv6 network and IPv4 network, comprise: be used to create the device of 6to4 transistroute, this 6to4 transistroute is used for the IPv6 message via the 6to4 relay router to purpose IPv6 forwarded; Be used to create the device of configured tunneling technique, the purpose IPv4 address of this configured tunneling technique is IPv4 address embedded in the 6to4 address of described 6to4 relay router, and this configured tunneling technique stores in the tunnel table of exchange chip of this route exchange device; And the device that is used to create the configured tunneling technique route, the destination address of this configured tunneling technique route is consistent with the destination address of described 6to4 transistroute, the outgoing interface of this configured tunneling technique route points to this configured tunneling technique, and this configured tunneling technique route is issued in the transmitting of described exchange chip.
Especially, also comprise two layers of information of next jumping that the IPv6 message that is used to have the tunnel head is transmitted in described the transmitting, described transmitting is the 3rd layer of swap table.
Especially, embedded IPv4 address lookup IPv4 routing table obtains two layers of information of described next jumping in the 6to4 address according to the 6to4 relay router.
Especially, two floor information of described next jumping can comprise: the target MAC (Media Access Control) address of next jumping, outbound port number and/or VLAN tag.
Especially, the purpose prefix of described 6to4 transistroute is described purpose IPv6 network of network prefix, and the next hop address of 6to4 transistroute is the 6to4 address of described 6to4 relay router.
The present invention also provides a kind of and utilizes described route exchange device to realize the method that message is transmitted, comprise: receive the IPv6 message, based on the destination address in this IPv6 message, in the transmitting of described route exchange device, search, obtain with described IPv6 message in the corresponding configured tunneling technique of destination address; Source address and destination address according to described configured tunneling technique encapsulate IPv4 tunnel head to this IPv6 message; Two layers of information according to next jumping that arrives the configured tunneling technique destination address encapsulate forwarding then to the IPv6 message that has IPv4 tunnel head.
Utilize technical scheme of the present invention, allow the IPv6 message to be dealt into the 6to4 relay router, and then arrive other IPv6 networks through the IPv4 network.The present invention is divided into two parts with the realization of 6to4 transistroute: create the configured tunneling technique that arrives the 6to4 relay router, and corresponding configured tunneling technique route.After receiving the IPv6 message, coupling configured tunneling technique route is encapsulated as channel message with the IPv6 message and is forwarded to the 6to4 relay router.This method has effectively solved the defective that hardware can't be supported the 6to4 transistroute automatically, can carry out little change at hardware to the existing route switching equipment or the situation of not changing under, realize the intercommunication of 6to4 network and IPv6 network.
Description of drawings
The present invention is described in detail according to embodiment and accompanying drawing below.
Realize the schematic diagram of the 6to4 network interconnection shown in Fig. 1 in the prior art;
Fig. 2 illustrates the flow chart according to the method for the realization 6to4 transistroute of the embodiment of the invention;
Fig. 3 illustrates the network application environment schematic diagram according to the method and apparatus of the realization 6to4 transistroute of the embodiment of the invention.
Embodiment
In order to make technological means of the present invention, each feature, technique effect be easier to understand,, further set forth the present invention below in conjunction with specific embodiments and the drawings.
As shown in Figure 2, be the flow chart according to the method for the realization 6to4 transistroute of the embodiment of the invention, Fig. 3 illustrates the network application environment schematic diagram according to the method and apparatus of the realization 6to4 transistroute of the embodiment of the invention.
As shown in Figure 2, the method according to the realization 6to4 transistroute of the embodiment of the invention may further comprise the steps:
(1) establishment is used for the IPv6 message via the 6to4 transistroute of 6to4 relay router to purpose IPv6 forwarded.The purpose prefix of this 6to4 transistroute is a purpose IPv6 network of network prefix, and the next hop address of 6to4 transistroute is the 6to4 address of 6to4 relay router.For example, as shown in Figure 3, IPv6 network of network prefix can be 2001: :/16, the 6to4 address of 6to4 relay router can for example be 2002:IPv4_Addr::, then this 6to4 transistroute can for example be 2001: :/162002:IPv4_Addr::, wherein IPv4_Addr is the IPv4 address of the port that is connected with the IPv4 internet of 6to4 relay router.
(2) create configured tunneling technique, the purpose IPv4 address of this configured tunneling technique is IPv4 address (for example above-mentioned IP v4_Addr) embedded in the 6to4 address of described 6to4 relay router, and this configured tunneling technique stores in the tunnel table of exchange chip.The establishment of this configured tunneling technique can be triggered by the establishment of 6to4 transistroute.The IPv4 address, source of configured tunneling technique can be the IPv4 address of the port that is connected with the IPv4 network on the 6to4 border router.
(3) create the configured tunneling technique route, the destination address of this configured tunneling technique route is consistent with the destination address of described 6to4 transistroute, for example also can be 2001: :/16, and the outgoing interface of this configured tunneling technique route points to described configured tunneling technique.
(4) with described configured tunneling technique route sending-down in the transmitting of exchange chip.Here, IPv4 address lookup IPv4 routing table that can be embedded according to 6to4 relay router 6to4 address, for one of configured tunneling technique route sending-down is routed to the transmitting of exchange chip (L3 table for example, i.e. the 3rd layer of table), the outgoing interface of the route that is issued is a configured tunneling technique, and two layers of information of next jumping are consistent with the IPv4 route next jump of coupling with outbound port.
Utilize said method, when the port that is connected with the 6to4 network on the 6to4 border router is received the IPv6 message, the L3 table of inquiry exchange chip, coupling configured tunneling technique route, learn that outgoing interface is a configured tunneling technique, and then inquiry tunnel table, for message adds IPv4 tunnel head, add two layers of head according to two layers of information of next jumping then, and forward from outbound port.
According to another embodiment of the present invention, a kind of route exchange device of the 6to4 of realization transistroute also is provided, be used to connect IPv6 network and IPv4 network, changing route exchange device comprises: be used to create the device of 6to4 transistroute, this 6to4 transistroute is used for the IPv6 message via the 6to4 relay router to purpose IPv6 forwarded; Be used to create the device of configured tunneling technique, the purpose IPv4 address of this configured tunneling technique is IPv4 address embedded in the 6to4 address of described 6to4 relay router, and this configured tunneling technique stores in the tunnel table of exchange chip of this route exchange device; And the device that is used to create the configured tunneling technique route, the destination address of this configured tunneling technique route is consistent with the destination address of described 6to4 transistroute, the outgoing interface of this configured tunneling technique route points to this configured tunneling technique, and this configured tunneling technique route is issued in the transmitting of described exchange chip.
In above 6to4 transistroute implementation method and equipment, also can comprise two layers of information of next jumping that the IPv6 message that is used to have the tunnel head is transmitted in described the transmitting, described transmitting is the 3rd layer of swap table.Two layers of information of described next jumping can 6to4 address according to the 6to4 relay router in embedded IPv4 address lookup IPv4 routing table obtain.Two floor information of described next jumping can comprise target MAC (Media Access Control) address, outbound port number and/or the VLAN tag of next jumping.The purpose prefix of described 6to4 transistroute is described purpose IPv6 network of network prefix, and the next hop address of 6to4 transistroute is the 6to4 address of described 6to4 relay router.
The present invention also provides a kind of and utilizes described route exchange device to realize the method that message is transmitted, comprise: receive the IPv6 message, based on the destination address in this IPv6 message, in the transmitting of described route exchange device, search, obtain with described IPv6 message in the corresponding configured tunneling technique of destination address; Source address and destination address according to described configured tunneling technique encapsulate IPv4 tunnel head to this IPv6 message; Two layers of information according to next jumping that arrives the configured tunneling technique destination address encapsulate forwarding then to the IPv6 message that has IPv4 tunnel head.
Certainly, realize among the present invention that the scheme of 6to4 transistroute also can be used in combination with the 6to4 tunnel, as shown in Figure 3, configurable 6to4 tunnel, 6to4 tunnel route between 6to4 border router and 6to4 relay router.The IPv4 address, source in this 6to4 tunnel is the IPv4 address of the port that is connected with the IPv4 internet on the 6to4 border router, and the purpose IPv4 address in 6to4 tunnel is the IPv4 address of the port that is connected with the IPv4 internet on the 6to4 relay router; The purpose prefix of this 6to4 tunnel route is 2002:IPv4_Addr::/z, and outgoing interface is this 6to4 tunnel, and wherein z represents the length of the purpose prefix of this 6to4 tunnel route.So, for going to the IPv6 message of opposite end 6to4 network via the 6to4 border router, can arrive opposite end 6to4 relay router, and then arrive opposite end 6to4 network via the 6to4 tunnel from the 6to4 network; And, can arrive opposite end 6to4 relay router, and then be forwarded to opposite end IPv6 network via configured tunneling technique for going to the IPv6 message of opposite end IPv6 network via the 6to4 border router from the 6to4 network.
Describe by above embodiment, the present invention is described in detail, but foregoing only is to exemplary description of the present invention, and protection scope of the present invention is defined by the claims, and is not limited to foregoing.Those skilled in the art can carry out many modifications to the present invention in the case without departing from the scope of the present invention, and for example, those skilled in the art can adopt according to the application need of reality, and still, these modifications also fall within the scope of the present invention.