CN101667975A - Route generation method, device, central processing unit and three-layer switch - Google Patents

Route generation method, device, central processing unit and three-layer switch Download PDF

Info

Publication number
CN101667975A
CN101667975A CN200910205449A CN200910205449A CN101667975A CN 101667975 A CN101667975 A CN 101667975A CN 200910205449 A CN200910205449 A CN 200910205449A CN 200910205449 A CN200910205449 A CN 200910205449A CN 101667975 A CN101667975 A CN 101667975A
Authority
CN
China
Prior art keywords
route
ipv6
ipv4
module
address
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.)
Granted
Application number
CN200910205449A
Other languages
Chinese (zh)
Other versions
CN101667975B (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.)
Beijing Zhigu Tech Co Ltd
Original Assignee
Fujian Star Net Communication 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 Fujian Star Net Communication Co Ltd filed Critical Fujian Star Net Communication Co Ltd
Priority to CN2009102054490A priority Critical patent/CN101667975B/en
Publication of CN101667975A publication Critical patent/CN101667975A/en
Application granted granted Critical
Publication of CN101667975B publication Critical patent/CN101667975B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a route generation method, a device, a central processing unit and a three-layer switch. The method comprises the following steps of obtaining a destination IPv4 address from a destination IPv6 address of a received IPv6 message, selecting an IPv4 route corresponding to the destination IPv4 address from the IPv4 routing table; querying the number of subnetroute and subnet route of the IPv4 route from the IPv4 routing table; and generating the IPv6 integrated route according to the beforehand configured initial route, the subnet route and the destination IPv6 address when judging the subnet route number is less than or equal to the specified threshold. The technical scheme reduces the number of the IPv6 integrated route required to be memorized inthe three-layer switch, thus saving the hardware resource of the three-layer switch.

Description

Route generating method, device, CPU and three-tier switch
Technical field
The present invention relates to three layer-switching technologies, particularly a kind of route generating method, device, CPU and three-tier switch.
Background technology
IPv6 is the Internet engineering duty group (Internet Engineering Task Force, be called for short: the IP next generation protocol of IETF) designing that is used to replace IPv4, but be an evolution process gradually from IPv4 to IPv6, before IPv6 replaced IPv4 fully, there was a coexistence phase in these two kinds of agreements.At the initial stage of coexistence phase, the IPv4 network remains main network, and the IPv6 network is the island network that is present in the IPv4 network.When communicating by letter between the IPv6 network, the IPv6 message need pass through the IPv4 network.In the prior art, adopt IPv6 over IPv4 tunneling technique that the IPv6 message is encapsulated in the IPv4 message usually, to reach the purpose that makes the IPv6 message pass through the IPv4 network.Therefore, in the stage network coexisted, can carry out the communication of IPv6 message by IPv6 ov r IPv4 tunneling technique between the IPv6 network, and need not the IPv4 network is carried out any upgrading and transformation with IPv4.
At present, IPv6 over IPv4 tunnel commonly used can comprise automatic tunnel addressing protocol in manual tunnel, 6to4 tunnel and the station (Intra-Site Automatic Tunnel Addressing Protocol is hereinafter to be referred as ISATAP) tunnel.Manual tunnel is a point-to-point tunneling, can be by the destination address in keeper's human configuration tunnel, and when the IPv6 message was packaged into the IPv4 message, purpose IPv4 address was exactly the destination address in tunnel.6to4 tunnel and Intra-site Automatic Tunnel Addressing Protocol are the point-to-multipoint tunnels, and this point-to-multipoint tunnel is an automatic tunnel, the keeper does not need the destination address of configured tunneling technique, when the IPv6 message was packaged into the IPv4 message, purpose IPv4 address was from address that purpose IPv6 address extraction is come out according to generally accepted rule.
The 6to4 tunnel is configured on the border router of an IPv6 network usually, it will set up the border router that the tunnel arrives another IPv6 network automatically for each IPv6 message, the destination address in the tunnel of setting up is exactly the IPv4 address of the border router of another IPv6 network, and the IPv4 address of this border router is the purpose IPv4 address of IPv4 message.Purpose IPv4 address can extract from the purpose IPv6 address of IPv6 message.Purpose IPv6 address can be as shown in table 1 below:
Table 1
16 bits 32 bits 16 bits 64 bits
??2002 The IPv4 address Subnet number in the website Interface identifier
Preceding 16 bits in the purpose IPv6 address be fix 2002, the IPv4 address that is positioned at 32 bits after 2002 is purpose IPv4 address.When the IPv6 message is packaged into the IPv4 message, can from purpose IPv6 address, extract the purpose IPv4 address of 32 bits.For example, when purpose IPv6 address was 2002:0101:0101:1::1, the purpose IPv4 address that extracts was 1.1.1.1.
Intra-site Automatic Tunnel Addressing Protocol is applicable to that the IPv6 network when a website inside can't use, and need be in the situation of website internal transmission IPv6 message.When adopting Intra-site Automatic Tunnel Addressing Protocol, purpose IPv6 address must meet the ISATAP address format, and purpose IPv6 address is as shown in table 2 below:
Table 2
64 bits 32 bits 32 bits
Any clean culture prefix ??00005EFE The IPv4 address
The IPv4 address of last 32 bits in the purpose IPv6 address is purpose IPv4 address.When the IPv6 message is packaged into the IPv4 message, can from purpose IPv6 address, extract the purpose IPv4 address of last 32 bits.For example, when purpose IPv6 address was 1000::00005EFE:1.1.1.1, the purpose IPv4 address that extracts was 1.1.1.1.
It still is initial matched routings with pre-configured tunnel that the IPv6 that stores in the purpose IPv6 address that performance element on the three-tier switch chips is judged the IPv6 message that receives and the memory cell on the three-tier switch chips integrates matched routings, if purpose IPv6 address and IPv6 integrate matched routings, then performance element can directly be packaged into the IPv4 message with the IPv6 message and forward; If purpose IPv6 address and initial matched routings, then performance element the IPv6 message can be sent to CPU (Central Processing Unit, hereinafter to be referred as: CPU), trigger to generate new IPv6 and integrate route according to the IPv6 message by CPU.CPU generates the process that IPv6 integrates route and is specially: obtain purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives; From the IPv4 routing table, select the IPv4 route corresponding with purpose IPv4 address; Inquire the link layer information of next jumping of this IPv4 route; Generate the prefix that IPv6 integrates route; From internal memory, read corresponding with the initial route in tunnel, be the pre-configured IPv4 packaging information in tunnel; The link layer information of next jumping of integrating prefix, IPv4 packaging information and the IPv4 route of route according to IPv6 generates IPv6 and integrates route.The prefix that this IPv6 integrates route can adopt following method to generate: when the tunnel that adopts was the 6to4 tunnel, initial route is 2002: :/16tunnel X (X is the numbering of tunnel interface), the prefix of this initial route was 2002: :/16.First method can merge the prefix that generates IPv6 integration route with the prefix and the purpose IPv4 address of initial route, and the length of the prefix of IPv6 integration this moment route is 48.Second method can adopt purpose IPv6 address as IPv6 integrate the road by prefix, this moment IPv6 to integrate the length of the prefix of route be 128.For example, purpose IPv6 address is 2002:0101:0101:1::1, then to integrate the prefix of route be 2002:0101:0101: to the IPv6 that generates according to first method :/48, and the prefix that the IPv6 that generates according to second method integrates route is 2002:0101:0101:1::1/128.When adopting Intra-site Automatic Tunnel Addressing Protocol, adopt the prefix of purpose IPv6 address as IPv6 integration route, the length of the prefix of IPv6 integration this moment route is 128.
In realizing process of the present invention, the inventor finds that there are the following problems at least in the prior art: when adopting the 6to4 tunnel also to generate the prefix of IPv6 integration route by above-mentioned first method, because the purpose IPv4 address of 32 bits can become complete one from complete zero in the purpose IPv6 address, therefore in purpose IPv6 address under the changeless prerequisite of other bit outside above-mentioned 32 bits, generating and storing the quantity that IPv6 in the three-tier switch integrates route is 256*256*256*256; When adopting the 6to4 tunnel also to generate the prefix of IPv6 integration route by above-mentioned second method, because back 112 bits can become complete one from complete zero in the purpose IPv6 address, therefore in purpose IPv6 address under the changeless prerequisite of other bit outside above-mentioned 112 bits, generating and storing the quantity that IPv6 in the three-tier switch integrates route is 2112; When adopting Intra-site Automatic Tunnel Addressing Protocol and generate the prefix of IPv6 integration route, because back 32 bits can become complete one from complete zero in the purpose IPv6 address, therefore in purpose IPv6 address under the changeless prerequisite of other bit outside above-mentioned 32 bits, generating and storing the quantity that IPv6 in the three-tier switch integrates route is 256*256*256*256.In sum, in the prior art for different purpose IPv6 addresses, all will generate IPv6 integrates route and stores in the three-tier switch, because it is huge that the IPv6 that generates integrates the quantity of route, and the hardware resource of three-tier switch is limited, therefore in three-tier switch, stored too much IPv6 and integrated route, the hardware resource of three-tier switch can have been exhausted.
Summary of the invention
The embodiment of the invention provides a kind of route generating method, device, CPU and three layers of interpreter, in order to realize saving the hardware resource of three-tier switch.
The embodiment of the invention provides a kind of route generating method, comprising:
From the purpose IPv6 address of the IPv6 message that receives, obtain purpose IPv4 address;
From the IPv4 routing table, select the IPv4 route corresponding with described purpose IPv4 address;
From the IPv4 routing table, inquire the subnet route and the subnet number of routes of described IPv4 route;
When judging described subnet number of routes, generate IPv6 according to pre-configured initial route, described subnet route and described purpose IPv6 address and integrate route smaller or equal to the threshold value that is provided with.
The embodiment of the invention provides a kind of route generating apparatus, comprising:
Acquisition module is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives;
Choose module, be used for selecting the IPv4 route corresponding with described purpose IPv4 address from the IPv4 routing table;
Enquiry module is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of described IPv4 route;
Judge module is used to judge that whether described subnet number of routes is smaller or equal to the threshold value that is provided with;
Generation module is used for generating IPv6 according to pre-configured initial route, described subnet route and described purpose IPv6 address and integrating route when judging described subnet number of routes smaller or equal to the threshold value that is provided with.
The embodiment of the invention also provides a kind of CPU, comprising:
Above-mentioned route generating apparatus.
The embodiment of the invention also provides a kind of three-tier switch, comprising: CPU and memory cell, and described CPU comprises the route generating apparatus;
Described route generating apparatus comprises:
Acquisition module is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives;
Choose module, be used for selecting the IPv4 route corresponding with described purpose IPv4 address from the IPv4 routing table;
Enquiry module is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of described IPv4 route;
Judge module is used to judge that whether described subnet number of routes is smaller or equal to the threshold value that is provided with;
Generation module is used for when judging described subnet number of routes smaller or equal to the threshold value that is provided with, generates IPv6 according to pre-configured initial route and described subnet route and integrates route;
Described memory cell is used to store the IPv6 integration route that described generation module generates.
In the technical scheme of the embodiment of the invention, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can be according to pre-configured initial route, subnet route and purpose IPv6 address generate IPv6 and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, because integrating route, the IPv6 of every generation can mate a plurality of IPv6 messages, therefore present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6, having reduced needs the IPv6 that stores to integrate the quantity of route in the three-tier switch, thereby has saved the hardware resource of three-tier switch.
Description of drawings
The flow chart of a kind of route generating method that Fig. 1 provides for the embodiment of the invention one;
The flow chart of a kind of route generating method that Fig. 2 provides for the embodiment of the invention two;
The structural representation of a kind of route generating apparatus that Fig. 3 provides for the embodiment of the invention three;
The structural representation of a kind of route generating apparatus that Fig. 4 provides for the embodiment of the invention four;
The structural representation of a kind of CPU that Fig. 5 provides for the embodiment of the invention five
The structural representation of a kind of three-tier switch that Fig. 6 provides for the embodiment of the invention six;
The structural representation of a kind of three-tier switch that Fig. 7 provides for the embodiment of the invention seven.
Embodiment
Below by drawings and Examples, the technical scheme of the embodiment of the invention is described in further detail.
The flow chart of a kind of route generating method that Fig. 1 provides for the embodiment of the invention one, as shown in Figure 1, this method comprises:
Step 101, from the purpose IPv6 address of the IPv6 message that receives, obtain purpose IPv4 address;
Step 102, from the IPv4 routing table, select and the corresponding IPv4 route in this purpose IPv4 address;
Step 103, the subnet route that from the IPv4 routing table, inquires this IPv4 route and subnet number of routes;
Step 104, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route;
When adopting 6to4 tunnel transmission IPv6 message, pre-configured initial route is the IPv6 route in 6to4 tunnel; When adopting Intra-site Automatic Tunnel Addressing Protocol transmission IPv6 message, pre-configured initial route is the IPv6 route of Intra-site Automatic Tunnel Addressing Protocol.
When the subnet route that inquires is many, need integrate route by generating many IPv6 according to pre-configured initial route, every strip networking with purpose IPv6 address.
The IPv6 that generates integrates route and is stored in the memory cell of three-tier switch.
In the technical scheme of present embodiment, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can be according to pre-configured initial route, subnet route and purpose IPv6 address generate IPv6 and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, because integrating route, the IPv6 of every generation can mate a plurality of IPv6 messages, therefore present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6, having reduced needs the IPv6 that stores to integrate the quantity of route in the three-tier switch, thereby has saved the hardware resource of three-tier switch.
The flow chart of a kind of route generating method that Fig. 2 provides for the embodiment of the invention two, as shown in Figure 2, this method comprises:
Performance element on step 201, the three-tier switch chips receives the IPv6 message;
Step 202, performance element judge the initial matched routings of storing in the purpose IPv6 address of this IPv6 message and the memory cell on the three-tier switch chips still with the three-tier switch chips on memory cell in the IPv6 that stores integrate matched routings, when the purpose IPv6 address of judging this IPv6 message and initial matched routings, execution in step 203; When the purpose IPv6 address of judging this IPv6 message and IPv6 integration matched routings, execution in step 211;
Wherein, initial route is pre-configured, the process of pre-configured initial route specifically comprises: create the tunnel on three-tier switch, be tunnel configuration IPv4 packaging information, and on tunnel interface, open the IPv6 function, wherein the IPv4 packaging information comprise source address, life span (Time To Live, hereinafter to be referred as: TTL) and COS (Type of Service is hereinafter to be referred as information such as ToS); Be the initial route of tunnel configuration on three-tier switch, and should initial route store in the three-tier switch, for example can directly initial route be write in the internal memory of three-tier switch.Wherein, the tunnel of establishment can be 6to4 tunnel or Intra-site Automatic Tunnel Addressing Protocol, and correspondingly, pre-configured initial route can be the IPv6 route in 6to4 tunnel or the IPv6 route of Intra-site Automatic Tunnel Addressing Protocol.For example, when the tunnel of creating was the 6to4 tunnel, initial route can be 2002: :/16 tunnel X, and wherein the prefix of initial route is 2002: :/16; When the tunnel of creating was Intra-site Automatic Tunnel Addressing Protocol, initial route can be 1000:0:0:0:0:5EFE: :/96 tunnel X, wherein the prefix of initial route is 1000::0000:5EFE: :/96.
When adopting the 6to4 tunnel, the form of the purpose IPv6 address of IPv6 message is as above shown in the table 1; When adopting Intra-site Automatic Tunnel Addressing Protocol, the form of the purpose IPv6 address of IPv6 message is as above shown in the table 2.
Step 203, performance element send to CPU with the IPv6 message;
Step 204, CPU are obtained purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives;
Step 205, CPU select the IPv4 route corresponding with purpose IPv4 address from the IPv4 routing table;
Step 206, CPU inquire the subnet route and the subnet number of routes of this IPv4 route from the IPv4 routing table;
Wherein, the subnet number of routes can be one or more.Because of this IPv4 route also is the subnet route of itself, so when group net number of routes was one, the subnet route was an IPv4 route itself.
For example, when the prefix of IPv4 route was 1.0.0.0/8, the prefix of the subnet route of this IPv4 route that inquires from the IPv4 routing table comprised: 1.0.0.0/8,1.0.0.0/16 and 1.0.0.0/24, the subnet number of routes of this IPv4 route is 3.
Step 207, CPU judge the subnet number of routes whether smaller or equal to the threshold value that is provided with, if execution in step 208 then, if otherwise execution in step 209;
This threshold value can be provided with according to actual needs.And in actual applications can be by the network of making rational planning for reducing the scale of IPv4 routing table, thus the subnet number of routes that from the IPv4 routing table, inquires reduced, so just can improve the probability of subnet number of routes smaller or equal to the threshold value that is provided with.
For example, in the present embodiment, this threshold value can be set to 3.
Step 208, CPU generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, and execution in step 210;
Step 208 can comprise:
Step 2081, inquire the link layer information of next jumping of subnet route;
Step 2082, obtain and the initial corresponding IPv4 packaging information of route;
Particularly, can obtain the IPv4 packaging information corresponding according to the numbering tunnel X of the tunnel interface in the initial route with the numbering tunnel X of tunnel interface.
Step 2083, the prefix of the prefix of initial route and subnet route merged generate the prefix that IPv6 integrates route;
For example, when adopting the 6to4 tunnel, the prefix of initial route is 2002: :/16, the prefix of subnet route comprises 1.0.0.0/8,1.0.0.0/16 and 1.0.0.0/24, then successively respectively with the prefix of initial route and three sub-networkings by prefix merge and generate the prefix 2002:0100: that three IPv6 integrate routes :/24,2002:0101: :/32 and 2002:0101:0100: :/40.Wherein, the length of the prefix of three IPv6 integration routes is respectively 24,32 and 40.
For example, when adopting Intra-site Automatic Tunnel Addressing Protocol, the prefix of initial route is 1000::0000:5EFE: :/96, the prefix of subnet route comprises 1.0.0.0/8,1.0.0.0/16 and 1.0.0.0/24, then successively respectively with the prefix of initial route and three sub-networkings by prefix merge and generate prefix 1000::0000:5EFE:1.0.0.0/104,1000::0000:5EFE:1.1.0.0/112 and the 1000::0000:5EFE:1.1.1.0/120 that three IPv6 integrate routes.Wherein, the length of the prefix of three IPv6 integration routes is respectively 104,112 and 120.
Above-mentioned steps 2081 to the execution of step 2083 is a kind of example only, can change the execution sequence of step 2081 to step 2083 as required in the practical application.
The prefix that step 2084, the link layer information according to next jumping of subnet route, IPv4 packaging information and IPv6 integrate route generates IPv6 and integrates route.
Step 209, CPU generate IPv6 according to pre-configured initial route, IPv4 route and purpose IPv6 address and integrate route, and execution in step 210;
Step 209 can comprise:
Step 2091, inquire the link layer information of next jumping of IPv4 route;
Step 2092, obtain and the initial corresponding IPv4 packaging information of route;
Particularly, can obtain the IPv4 packaging information corresponding according to the numbering tunnel X of the tunnel interface in the initial route with the numbering tunnel X of tunnel interface.
Step 2093, generate the prefix that IPv6 integrates route according to purpose IPv6 address;
When adopting the 6to4 tunnel, can generate the prefix that IPv6 integrates route according to the prefix of initial route and the purpose IPv4 address in the purpose IPv6 address, this moment, IPv6 integrated the length of prefix that the length of the prefix of route is initial route and the length sum of the purpose IPv4 address in the purpose IPv6 address; Perhaps directly generate the prefix that IPv6 integrates route according to purpose IPv6 address, the length of the prefix of IPv6 integration this moment route is the length of purpose IPv6 address.
For example, the prefix of initial route is 2002: :/16, purpose IPv4 address in the purpose IPv6 address is 1.1.1.1, and then prefix and the purpose IPv4 address according to initial route generates the prefix 2002:0101:0101: that IPv6 integrates route :/48, and the length that IPv6 integrates the prefix of route is 48.Perhaps purpose IPv6 address is 2002:0101:0101:1::1, then generates the prefix 2002:0101:0101:1::1/128 that IPv6 integrates route according to purpose IPv6 address, and the length that IPv6 integrates the prefix of route is 128.
When adopting Intra-site Automatic Tunnel Addressing Protocol, can generate the prefix that IPv6 integrates route according to purpose IPv6 address, the length of the prefix of IPv6 integration this moment route is the length of purpose IPv6 address.
For example, purpose IPv6 address is 1000::0000:5EFE:1.1.1.1, then generates the prefix 1000::0000:5EFE:1.1.1.1/128 that IPv6 integrates route according to purpose IPv6 address, and the length that IPv6 integrates the prefix of route is 128.
Above-mentioned steps 2091 to the execution of step 2093 is a kind of example only, can change the execution sequence of step 2091 to step 2093 as required in the practical application.
The prefix that step 2094, the link layer information according to next jumping of IPv4 route, IPv4 packaging information and IPv6 integrate route generates IPv6 and integrates route.
Step 210, CPU integrate route with the IPv6 that generates and send to memory cell, and the IPv6 that is generated by cell stores integrates route, and flow process finishes.
Step 211, performance element are packaged into the IPv4 message with the IPv6 message, and transmit this IPv4 message.
Further, in the present embodiment, can also comprise: CPU is that the IPv6 integration route that generates in step 208 and the step 209 is provided with ageing time, and deletes this IPv6 and integrate route when the time of this IPv6 integration route of cell stores reaches this ageing time.
In the present embodiment, when judging the subnet number of routes, can generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, thereby reduce the quantity that the IPv6 that generates integrates route smaller or equal to the threshold value that is provided with.For example:
When adopting the 6to4 tunnel, suppose to send purpose IPv6 message to three-tier switch continuously, purpose IPv6 adopts the 6to4 address format, the purpose IPv4 address of 32 bits wherein can change to 01FFFFFF (being that purpose IPv4 address changes to 1.255.255.255 from 1.0.0.0) from 01000000, last 80 bits of purpose IPv6 address can change to complete one from complete zero, and promptly purpose IPv6 address is from 2002:0100:: change to 2002:01FF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF.The prefix of the IPv4 route of hypothesis goal IPv4 matching addresses is 1.0.0.0/8, and then the subnet route of this IPv4 route only comprises himself route 1.0.0.0/8, and promptly the subnet number of routes of this IPv4 route is 1.In these cases, according to the technical scheme in the present embodiment, the quantity that generates IPv6 integration route is one.According in the prior art with 2002: :/16 and merge to generate prefix length be the method that 48 IPv6 integrates route in purpose IPv4 address, the quantity that the IPv6 of generation integrates route is the 256*256*256 bar.Generating prefix length according to available technology adopting purpose IPv6 address is the method that 128 IPv6 integrates route, and the quantity that the IPv6 of generation integrates route is (2 104 powers) bar.
When adopting Intra-site Automatic Tunnel Addressing Protocol, suppose to send purpose IPv6 message to three-tier switch continuously, purpose IPv6 adopts the ISATAP address format, and the purpose IPv4 address of 32 bits wherein can change to 01FFFFFF (being that purpose IPv4 address changes to 1.255.255.255 from 1.0.0.0) from 01000000.The prefix of the IPv4 route of hypothesis goal IPv4 matching addresses is 1.0.0.0/8, and then the subnet route of this IPv4 route only comprises himself 1.0.0.0/8, and promptly the subnet number of routes of this IPv4 route is 1.In these cases, according to the technical scheme in the present embodiment, the quantity that generates IPv6 integration route is one.Generating prefix length according to available technology adopting purpose IPv6 address is the method that 128 IPv6 integrates route, and the quantity that the IPv6 of generation integrates route is the 256*256*256 bar.
Therefore, compared with prior art, the quantity of the IPv6 integration route that the technical scheme of employing present embodiment generates is far smaller than the quantity of the IPv6 integration route of the technical scheme generation of adopting prior art.
In the technical scheme of present embodiment, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, can mate a plurality of IPv6 messages because the IPv6 of every generation integrates route, so present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6; When judging the subnet number of routes, generate an IPv6 according to initial route, IPv4 route and purpose IPv6 address and integrate route greater than the threshold value that is provided with; Thereby reduced the quantity that needs the IPv6 that stores to integrate route in the three-tier switch, saved the hardware resource of three-tier switch.For every IPv6 integrates route ageing time is set, when reaching ageing time, deletes this IPv6 and integrate route, thereby reduced the quantity that the IPv6 that stores in the three-tier switch integrates route, further saved the hardware resource of three-tier switch.
The structural representation of a kind of route generating apparatus that Fig. 3 provides for the embodiment of the invention three, as shown in Figure 3, this device comprise acquisition module 111, be connected with acquisition module 111 choose module 112, with the generation module 115 of choosing the enquiry module 113 that module 112 is connected, the judge module 114 that is connected with enquiry module 113, being connected with enquiry module 113, judge module 114 and acquisition module 111.
Acquisition module 111 is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives; Choose the IPv4 route that module 112 is used for selecting from the IPv4 routing table purpose IPv4 address correspondence; Enquiry module 113 is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of IPv4 route; Judge module 114 is used to judge that whether the subnet number of routes is smaller or equal to the threshold value that is provided with; Generation module 115 is used for when judge module 114 is judged the subnet number of routes smaller or equal to the threshold value that is provided with, generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, wherein, purpose IPv6 address can obtain from the IPv6 message that acquisition module 111 receives.
In the present embodiment, the IPv6 that the route generating apparatus generates integrates route and can be stored in the memory cell of three-tier switch.
Route generating apparatus in the present embodiment, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can be according to pre-configured initial route, subnet route and purpose IPv6 address generate IPv6 and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, because integrating route, the IPv6 of every generation can mate a plurality of IPv6 messages, therefore present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6, having reduced needs the IPv6 that stores to integrate the quantity of route in the three-tier switch, thereby has saved the hardware resource of three-tier switch.
The structural representation of a kind of route generating apparatus that Fig. 4 provides for the embodiment of the invention four, as shown in Figure 4, present embodiment also comprises on the basis of the foregoing description three: what be connected with generation module 115 is provided with module 116, with the monitoring module 117 that module 116 is connected is set, with the removing module 118 that module 116 is connected with monitoring module 117 is set.Module 116 is set is used to the IPv6 integration route of generation module generation that ageing time is set, the cell stores IPv6 that monitoring module 117 is used to monitor three-tier switch integrates the time of route, when the time that storing IP v6 integrates route reaches when the ageing time that module 116 is provided with is set and sends the deletion message that these IPv6 integrate route to removing module 118; Removing module 118 is integrated the deletion message of route this IPv6 integration route is deleted from memory cell according to this IPv6.
Route generating apparatus in the present embodiment, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, can mate a plurality of IPv6 messages because the IPv6 of every generation integrates route, so present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6; When judging the subnet number of routes, generate an IPv6 according to initial route, IPv4 route and purpose IPv6 address and integrate route greater than the threshold value that is provided with; Thereby reduced the quantity that needs the IPv6 that stores to integrate route in the three-tier switch, saved the hardware resource of three-tier switch.For every IPv6 integrates route ageing time is set, when reaching ageing time, deletes this IPv6 and integrate route, thereby reduced the quantity that the IPv6 that stores in the three-tier switch integrates route, further saved the hardware resource of three-tier switch.
The structural representation of a kind of CPU that Fig. 5 provides for the embodiment of the invention five, as shown in Figure 5, this CPU comprises route generating apparatus 11.Particularly, this route generating apparatus 11 can adopt the route generating apparatus among embodiment three or the embodiment four, repeats no more herein.
CPU in the present embodiment, when judging the subnet number of routes smaller or equal to the threshold value that is provided with, can generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, can mate a plurality of IPv6 messages because the IPv6 of every generation integrates route, so present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6; When judging the subnet number of routes, generate an IPv6 according to initial route, IPv4 route and purpose IPv6 address and integrate route greater than the threshold value that is provided with; Thereby reduced the quantity that needs the IPv6 that stores to integrate route in the three-tier switch, saved the hardware resource of three-tier switch.For every IPv6 integrates route ageing time is set, when reaching ageing time, deletes this IPv6 and integrate route, thereby reduced the quantity that the IPv6 that stores in the three-tier switch integrates route, further saved the hardware resource of three-tier switch.
The structural representation of a kind of three-tier switch that Fig. 6 provides for the embodiment of the invention six, as shown in Figure 6, this three-tier switch comprises CPU 1 and memory cell 2, CPU 1 comprises route generating apparatus 11, route generating apparatus 11 comprise acquisition module 111, be connected with acquisition module 111 choose module 112, with the generation module 115 of choosing the enquiry module 113 that module 112 is connected, the judge module 114 that is connected with enquiry module 113, being connected with acquisition module 111, enquiry module 113, judge module 114 and memory cell 2.Acquisition module 111 is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives; Choose the IPv4 route that module 112 is used for selecting from the IPv4 routing table purpose IPv4 address correspondence; Enquiry module 113 is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of IPv4 route; Judge module 114 is used to judge that whether the subnet number of routes is smaller or equal to the threshold value that is provided with; Generation module 115 is used for when judge module 114 is judged the subnet number of routes smaller or equal to the threshold value that is provided with, generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, wherein, purpose IPv6 address can obtain from the IPv6 message that acquisition module 111 receives.Generation module 115 is integrated route with the IPv6 that generates and is sent to memory cell 2, and the IPv6 that is generated by memory cell 2 storage generation modules 115 integrates route.
Three-tier switch in the present embodiment, when CPU judges the subnet number of routes smaller or equal to the threshold value that is provided with, can be according to pre-configured initial route, subnet route and purpose IPv6 address generate IPv6 and integrate route, the quantity that the IPv6 that generates integrates route is the subnet number of routes, because integrating route, the IPv6 of every generation can mate a plurality of IPv6 messages, therefore present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6, reduce the IPv6 that memory cell need be stored in the three-tier switch and integrated the quantity of route, thereby saved the hardware resource of three-tier switch.
The structural representation of a kind of three-tier switch that Fig. 7 provides for the embodiment of the invention seven, as shown in Figure 7, on the basis of the foregoing description six, in the present embodiment route generating apparatus 11 also comprise be connected with generation module 115 module 116 is set, with the monitoring module 117 that module 116 is connected with memory cell 2 is set, with the removing module 118 that module 116, monitoring module 117 and memory cell 2 are connected is set.Module 116 is set is used to the IPv6 integration route of generation module generation that ageing time is set, monitoring module 117 is used for the time that monitor bit cell 2 storing IP v6 integrate route, sends the deletion message that these IPv6 integrate route to removing module 118 when the time of storing IP v6 integration route reaches the ageing time that module 116 settings are set; Removing module 118 is integrated the deletion message of route this IPv6 integration route is deleted from memory cell 2 according to this IPv6.
Further, present embodiment also comprises performance element 3.In the purpose IPv6 address that performance element 3 is judged the IPv6 message that receives and the memory cell 2 the initial matched routings of storage still with memory cell 2 in the IPv6 integration matched routings of storage.When purpose IPv6 address that performance element 3 is judged the IPv6 message during, the IPv6 message that receives is sent to the acquisition module 111 in the route generating apparatus 11 of CPU 1 with initial matched routings.When performance element 3 is judged the purpose IPv6 address of IPv6 message and IPv6 and integrated matched routings, the IPv6 message is packaged into the IPv4 message, and transmits this IPv4 message.
Three-tier switch in the present embodiment, when CPU judges the subnet number of routes smaller or equal to the threshold value that is provided with, can generate IPv6 according to pre-configured initial route, subnet route and purpose IPv6 address and integrate route, the quantity of the IPv6 that generates is the subnet number of routes, because each subnet route can be mated a plurality of IPv6 messages, so present embodiment has been avoided integrating route for each different purpose IPv6 address generates an IPv6; When judging the subnet number of routes, generate an IPv6 according to initial route, IPv4 route and purpose IPv6 address and integrate route greater than the threshold value that is provided with; Thereby reduced the quantity of the IPv6 that memory cell need be stored in three-tier switch integration route, saved the hardware resource of three-tier switch.For every IPv6 integrates route ageing time is set, when reaching ageing time, deletes this IPv6 and integrate route, thereby reduced the quantity of the IPv6 integration route of cell stores in the three-tier switch, further saved the hardware resource of three-tier switch.
It should be noted that at last: above embodiment is only in order to technical scheme of the present invention to be described but not limit it, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that: it still can make amendment or be equal to replacement technical scheme of the present invention, and these modifications or be equal to replacement and also can not make amended technical scheme break away from the spirit and scope of technical solution of the present invention.

Claims (10)

1, a kind of route generating method is characterized in that, comprising:
From the purpose IPv6 address of the IPv6 message that receives, obtain purpose I Pv4 address;
From the IPv4 routing table, select the IPv4 route corresponding with described purpose IPv4 address;
From the IPv4 routing table, inquire the subnet route and the subnet number of routes of described IPv4 route;
When judging described subnet number of routes, generate IPv6 according to pre-configured initial route, described subnet route and described purpose IPv6 address and integrate route smaller or equal to the threshold value that is provided with.
2, method according to claim 1 is characterized in that, pre-configured initial route is the IPv6 route in 6to4 tunnel or the IPv6 route of automatic tunnel addressing protocol Intra-site Automatic Tunnel Addressing Protocol.
3, method according to claim 1 is characterized in that, describedly generates IPv6 according to pre-configured initial route, described subnet route and described purpose IPv6 address and integrates route and comprise:
Inquire the link layer information of next jumping of described subnet route;
Obtain the IPv4 packaging information corresponding with described initial route;
The prefix of described initial route and the prefix of described subnet route are merged the prefix that generates IPv6 integration route;
The prefix of integrating route according to the link layer information of next jumping of described subnet route, described IPv4 packaging information and described IPv6 generates described IPv6 and integrates route.
4, method according to claim 1 is characterized in that, also comprises:
For described IPv6 integrates route ageing time is set;
When the time of this IPv6 integration route of storage reaches this ageing time, delete this IPv6 and integrate route.
5, a kind of route generating apparatus is characterized in that, comprising:
Acquisition module is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives;
Choose module, be used for selecting the IPv4 route corresponding with described purpose IPv4 address from the IPv4 routing table;
Enquiry module is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of described IPv4 route;
Judge module is used to judge that whether described subnet number of routes is smaller or equal to the threshold value that is provided with;
Generation module is used for generating IPv6 according to pre-configured initial route, described subnet route and described purpose IPv6 address and integrating route when judging described subnet number of routes smaller or equal to the threshold value that is provided with.
6, device according to claim 5 is characterized in that, also comprises: what be connected with described generation module is provided with module, with described the monitoring module that module is connected is set, and with described the removing module that module is connected with described monitoring module is set;
The described module that is provided with, the IPv6 that is used to described generation module to generate integrates route ageing time is set;
Described monitoring module, the cell stores IPv6 that is used to monitor three-tier switch integrates the time of route, sends the deletion message that this IPv6 integrates route to described removing module when the time that storing IP v6 integrates route reaches the described ageing time that the module setting is set;
Described removing module is used for according to the deletion message of this IPv6 integration route this IPv6 being integrated route and deletes from described memory cell.
7, a kind of CPU is characterized in that, comprising:
Claim 5 or 6 described route generating apparatus.
8, a kind of three-tier switch is characterized in that, comprising: CPU and memory cell, and described CPU comprises the route generating apparatus;
Described route generating apparatus comprises:
Acquisition module is used for obtaining purpose IPv4 address from the purpose IPv6 address of the IPv6 message that receives;
Choose module, be used for selecting the IPv4 route corresponding with described purpose IPv4 address from the IPv4 routing table;
Enquiry module is used for inquiring from the IPv4 routing table subnet route and the subnet number of routes of described IPv4 route;
Judge module is used to judge that whether described subnet number of routes is smaller or equal to the threshold value that is provided with;
Generation module is used for when judging described subnet number of routes smaller or equal to the threshold value that is provided with, generates IPv6 according to pre-configured initial route and described subnet route and integrates route;
Described memory cell is used to store the IPv6 integration route that described generation module generates.
9, three-tier switch according to claim 8, it is characterized in that, described route generating apparatus also comprises: what be connected with described generation module is provided with module, with described the monitoring module that module is connected with described memory cell is set, and the removing module that module, described monitoring module and described memory cell are connected is set with described;
The described module that is provided with, the IPv6 that is used to described generation module to generate integrates route ageing time is set;
Described monitoring module is used to monitor the time that described cell stores IPv6 integrates route, sends the deletion message that this IPv6 integrates route to described removing module when the time that storing IP v6 integrates route reaches the described ageing time that the module setting is set;
Described removing module is used for according to the deletion message of this IPv6 integration route this IPv6 being integrated route and deletes from described memory cell.
10, according to Claim 8 or 9 described three-tier switch, it is characterized in that, also comprise: the performance element that is connected with described acquisition module with described memory cell;
Described performance element is used for when the purpose IPv6 address of judging the IPv6 message that receives and initial matched routings described IPv6 message being sent to described acquisition module; Perhaps when the purpose IPv6 address of judging described IPv6 message and IPv6 integration matched routings, described IPv6 message is packaged into the IPv4 message, and transmits described IPv4 message.
CN2009102054490A 2009-10-23 2009-10-23 Route generation method, device, central processing unit and three-layer switch Active CN101667975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102054490A CN101667975B (en) 2009-10-23 2009-10-23 Route generation method, device, central processing unit and three-layer switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102054490A CN101667975B (en) 2009-10-23 2009-10-23 Route generation method, device, central processing unit and three-layer switch

Publications (2)

Publication Number Publication Date
CN101667975A true CN101667975A (en) 2010-03-10
CN101667975B CN101667975B (en) 2011-12-28

Family

ID=41804420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102054490A Active CN101667975B (en) 2009-10-23 2009-10-23 Route generation method, device, central processing unit and three-layer switch

Country Status (1)

Country Link
CN (1) CN101667975B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546382A (en) * 2010-12-08 2012-07-04 中国电信股份有限公司 Method and system for realizing multicast in Internet protocol version 4 over Internet protocol version 6 (IPv4overIPv6) tunnel
WO2013063797A1 (en) * 2011-11-04 2013-05-10 华为技术有限公司 Internet protocol version 6 multicast address generation method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546382A (en) * 2010-12-08 2012-07-04 中国电信股份有限公司 Method and system for realizing multicast in Internet protocol version 4 over Internet protocol version 6 (IPv4overIPv6) tunnel
CN102546382B (en) * 2010-12-08 2014-08-13 中国电信股份有限公司 Method and system for realizing multicast in Internet protocol version 4 over Internet protocol version 6 (IPv4overIPv6) tunnel
WO2013063797A1 (en) * 2011-11-04 2013-05-10 华为技术有限公司 Internet protocol version 6 multicast address generation method and device
CN103222246A (en) * 2011-11-04 2013-07-24 华为技术有限公司 Internet protocol version 6 multicast address generation method and device
CN103222246B (en) * 2011-11-04 2016-03-30 华为技术有限公司 The method and apparatus that internet protocol version IPv6 multicast address generates

Also Published As

Publication number Publication date
CN101667975B (en) 2011-12-28

Similar Documents

Publication Publication Date Title
WO2022078509A1 (en) Method and apparatus for encapsulating extension header of ipv6 packet
US7600039B2 (en) Label-based multiplexing
CN102724118B (en) Label distribution method and device
EP2903218A1 (en) Method and device for modifying and forwarding message in data communication network
EP4207685A1 (en) Message header processing method and apparatus, storage medium and electronic device
KR20120079124A (en) Method for performing dynamic tunnel message forwarding and switch thereof
CN104022936B (en) A kind of tunnel establishing method and device
CN101848171A (en) Data transmission method based on GRE tunnel, device and system
CN101155115A (en) Method and apparatus for implementing automatic tunnel
CN103023773B (en) Method, device and system for forwarding message in multi-topology network
CN103973574A (en) Data message forwarding method and device in position and identity separation protocol network
CN101360046B (en) Bandwidth resource saving method
CN101286922A (en) Signalling control method, system and apparatus
CN103763750B (en) Method for fast achieving packet forwarding in wireless ad hoc network of TDMA protocol
DE10152011A1 (en) Method and device for mapping network headers onto MPLS headers in bearer architectures
CN102970386A (en) Method and device for realizing traverse of IPv6 message to IPv4 network
CN102291305A (en) Method and device for implementing 6 to 4 relay routing, and message forwarding method
CN112491706A (en) Data message processing method and device, storage medium and electronic device
CN101667975B (en) Route generation method, device, central processing unit and three-layer switch
CN101621472B (en) Message transmission method and router
CN102868642B (en) The method and apparatus of NVGRE message repeating is realized in ASIC
US11784919B2 (en) Method for sending BIERv6 packet and first network device
CN101330447A (en) Method for detecting next-hop MAC address
CN102970218B (en) The method that MF-TDMA ICBM SHF satellite terminal carries out anonymous interconnection based on broadcast-type interface
CN116996439B (en) SDN-based efficient routing addressing method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: BEIJING Z-GOOD TECHNOLOGY SERVICE CO., LTD.

Free format text: FORMER OWNER: FUJIAN XINGWANGRUIJIE NETWORK CO., LTD.

Effective date: 20141201

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 350002 FUZHOU, FUJIAN PROVINCE TO: 100085 HAIDIAN, BEIJING

TR01 Transfer of patent right

Effective date of registration: 20141201

Address after: 100085 Beijing city Haidian District No. 33 Xiaoying Road 1 1F06 room

Patentee after: BEIJING ZHIGU TECHNOLOGY SERVICES CO., LTD.

Address before: Cangshan District of Fuzhou City, Fujian province 350002 Jinshan Road No. 618 Garden Industrial Park Building No. 19

Patentee before: Fujian Xingwangruijie Network Co., Ltd.

EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20100310

Assignee: Fujian Xingwangruijie Network Co., Ltd.

Assignor: BEIJING ZHIGU TECHNOLOGY SERVICES CO., LTD.

Contract record no.: 2015990000030

Denomination of invention: Route generation method, device, central processing unit and three-layer switch

Granted publication date: 20111228

License type: Common License

Record date: 20150116

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model