CN101692647A - Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router - Google Patents
Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router Download PDFInfo
- Publication number
- CN101692647A CN101692647A CN200910093532A CN200910093532A CN101692647A CN 101692647 A CN101692647 A CN 101692647A CN 200910093532 A CN200910093532 A CN 200910093532A CN 200910093532 A CN200910093532 A CN 200910093532A CN 101692647 A CN101692647 A CN 101692647A
- Authority
- CN
- China
- Prior art keywords
- output
- input
- data
- packet
- circuit
- 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
Links
- 230000015654 memory Effects 0.000 claims abstract description 318
- 238000012423 maintenance Methods 0.000 claims abstract description 25
- 230000003068 static effect Effects 0.000 claims abstract description 5
- 238000005538 encapsulation Methods 0.000 claims description 26
- 238000001914 filtration Methods 0.000 claims description 15
- 239000000284 extract Substances 0.000 claims description 13
- 238000012790 confirmation Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 4
- 230000002093 peripheral effect Effects 0.000 claims description 2
- 230000009191 jumping Effects 0.000 claims 5
- 238000012795 verification Methods 0.000 claims 3
- 239000003550 marker Substances 0.000 claims 2
- 102000006479 Heterogeneous-Nuclear Ribonucleoproteins Human genes 0.000 claims 1
- 108010019372 Heterogeneous-Nuclear Ribonucleoproteins Proteins 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 22
- 238000000034 method Methods 0.000 abstract description 19
- 230000008569 process Effects 0.000 abstract description 13
- 230000005641 tunneling Effects 0.000 abstract description 6
- 230000009466 transformation Effects 0.000 abstract 1
- 238000000605 extraction Methods 0.000 description 14
- 230000009471 action Effects 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 8
- 238000011144 upstream manufacturing Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000002457 bidirectional effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000004744 fabric Substances 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000007704 transition Effects 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 210000004899 c-terminal region Anatomy 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000011960 computer-aided design Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
路由器中采用IPv6头封装IPv4包的隧道转发系统属于下一代互联网IPv6高性能核心路由器技术领域。The tunnel forwarding system adopting IPv6 header to encapsulate IPv4 packet in router belongs to the technical field of IPv6 high-performance core router of next generation Internet.
背景技术Background technique
IPv6协议解决了IPv4协议地址枯竭、安全性不足以及移动性差等问题。从IPv4过渡到IPv6是一个渐进而漫长的过程,两者将共存相当长时间。随着IPv6的大规模发展,出现纯IPv6主干网络,IPv6上引入大量业务。因为IPv6与IPv4协议的不兼容性,已有的网络用户迁移到纯IPv6网络后,将无法与资源丰富的IPv4网络互联。这使得原IPv4网络的用户和资源迁移到IPv6网络的过程十分缓慢,导致已建成的纯IPv6网络使用率不高。为了推动IPv4-IPv6网络的过渡,急需一种可以实现IPv4和IPv6网络互访,IPv4数据包经IPv6网络传输的隧道技术或者协议转换技术。The IPv6 protocol solves the problems of IPv4 protocol address exhaustion, insufficient security and poor mobility. The transition from IPv4 to IPv6 is a gradual and lengthy process, and the two will coexist for quite a long time. With the large-scale development of IPv6, a pure IPv6 backbone network appears, and a large number of services are introduced on IPv6. Due to the incompatibility between IPv6 and IPv4 protocols, existing network users will not be able to interconnect with the resource-rich IPv4 network after migrating to a pure IPv6 network. This makes the process of migrating the users and resources of the original IPv4 network to the IPv6 network very slow, resulting in a low utilization rate of the established pure IPv6 network. In order to promote the transition of the IPv4-IPv6 network, there is an urgent need for a tunneling technology or protocol conversion technology that can realize mutual access between IPv4 and IPv6 networks, and transmit IPv4 data packets through the IPv6 network.
目前采用IPv4协议封装IPv6报文的隧道技术应用较广,也较成熟,而IPv6协议封装IPv4报文的隧道技术则不够成熟,目前采用IPv6头封装IPv4报文的隧道技术还没有统一的国际标准,市场上一些采用IPv6头封装IPv4报文的隧道技术大部分是用软件实现的,封装的体系结构各不相同,速度低,不能满足高速网络的实际应用需要。At present, the tunneling technology using IPv4 protocol to encapsulate IPv6 packets is widely used and relatively mature, while the tunneling technology using IPv6 protocol to encapsulate IPv4 packets is not mature enough. At present, there is no unified international standard for tunneling technology using IPv6 header to encapsulate IPv4 packets , Most of the tunneling technologies on the market that use IPv6 headers to encapsulate IPv4 packets are implemented by software. The architectures of the encapsulation are different, and the speed is low, which cannot meet the actual application needs of high-speed networks.
本发明实现路由器中采用IPv6头封装IPv4包的隧道转发,解决IPv4网络通过纯IPv6主干网络实现互联的问题,方法简单、高效,达到3.2Gbit/s的封装和转发速度。The invention realizes the tunnel forwarding of the IPv4 packet encapsulated by the IPv6 header in the router, solves the problem that the IPv4 network realizes interconnection through the pure IPv6 backbone network, the method is simple and efficient, and the encapsulation and forwarding speed reaches 3.2Gbit/s.
FPGA(Field Programmable Gate Array)是上世纪80年代末开始使用的大规模可编程数字集成电路器件。它充分利用计算机辅助设计技术进行器件的开发与应用。用户借助于计算机不仅能自行设计专用集成电路芯片,还可在计算机上进行功能仿真和实时仿真,及时发现问题,调整电路,改进设计方案。这样,设计者不必动手搭接电路、调试验证,只须在计算机上操作很短的时间,即可设计出与实际系统相差无几的理想电路。而且,FPGA器件采用标准化结构,体积小、集成度高、功耗低、速度快,可无限次反复编程,因此,成为科研产品开发及其小型化的首选器件,其应用极为广泛。FPGA (Field Programmable Gate Array) is a large-scale programmable digital integrated circuit device that began to be used in the late 1980s. It makes full use of computer-aided design technology for device development and application. With the help of computers, users can not only design ASIC chips by themselves, but also perform function simulation and real-time simulation on the computer to find problems in time, adjust circuits, and improve design solutions. In this way, the designer does not need to manually connect the circuit, debug and verify, and only needs to operate on the computer for a short time to design an ideal circuit that is almost the same as the actual system. Moreover, the FPGA device adopts a standardized structure, small size, high integration, low power consumption, fast speed, and can be programmed repeatedly indefinitely. Therefore, it has become the first choice for scientific research product development and miniaturization, and its application is extremely wide.
CAM(Content Addressable Memory)是一种特殊的存储器,它将输入数据与CAM中存储的所有数据项同时进行并行比较,迅速判断输入数据是否与CAM中存储的数据项匹配,并给出数据项对应地址和匹配信息。CAM是目前使用最多的实现快速路由查找的器件,CAM能够在有限的几个硬件时钟周期内完成关键字的精确匹配查找,如果采用流水线操作,每个时钟周期输入一个查找的关键字,则CAM能在每个硬件时钟周期流水输出一个查找结果。CAM (Content Addressable Memory) is a special kind of memory, it compares the input data with all the data items stored in CAM at the same time, quickly judges whether the input data matches the data items stored in CAM, and gives the data item correspondence Address and matching information. CAM is currently the most used device to achieve fast routing lookup. CAM can complete the exact matching search of keywords within a limited number of hardware clock cycles. A lookup result can be pipelined every hardware clock cycle.
TCAM(Ternary Content Addressable Memory)也是一种CAM,但它的每个存储位有三种状态:0、1或X(不关心),每一个表项都包含数值比特串和掩码比特串,因此可以用来确定最长前缀匹配。TCAM (Ternary Content Addressable Memory) is also a kind of CAM, but each of its storage bits has three states: 0, 1 or X (don't care), and each entry contains a value bit string and a mask bit string, so it can Used to determine the longest prefix match.
发明内容Contents of the invention
本发明目的在于提供一种路由器中采用IPv6头封装IPv4包的隧道转发系统,具体实现采用FPGA和CAM技术。采用本发明的路由器可以连接IPv6主干网和IPv4孤岛,实现IPv4孤岛之间通过IPv6主干网的透明传输。The purpose of the present invention is to provide a tunnel forwarding system that adopts IPv6 header to encapsulate IPv4 packets in a router, and the specific realization adopts FPGA and CAM technology. The router of the invention can connect the IPv6 backbone network and the IPv4 isolated island, and realize the transparent transmission between the IPv4 isolated islands through the IPv6 backbone network.
本发明的特征:Features of the present invention:
含有:一个集成于FPGA芯片上的隧道处理电路、SRAM单端口存储器、SRAM双端口存储器、CAM内容可寻址存储器以及CPU控制单元,其中:Contains: a tunnel processing circuit integrated on the FPGA chip, SRAM single-port memory, SRAM dual-port memory, CAM content addressable memory and CPU control unit, of which:
所述的隧道处理电路,含有:IP包输入接口电路、包过滤电路、包输入队列存储器FIFO、IPv6协议封装电路、IPv6包队列存储器FIFO、包相关信息提取电路、检索指令队列存储器FIFO、CAM控制电路、检索结果队列存储器FIFO、IPv6数据包相关信息队列存储器FIFO、IPv6数据包存储器RAM、包发送电路、CAM维护指令队列存储器FIFO、第0个上交包队列存储器FIFO、第1个上交包队列存储器FIFO、上交包发送电路、以及CPU接口电路,其中:The tunnel processing circuit includes: IP packet input interface circuit, packet filtering circuit, packet input queue memory FIFO, IPv6 protocol encapsulation circuit, IPv6 packet queue memory FIFO, packet related information extraction circuit, retrieval instruction queue memory FIFO, CAM control Circuit, retrieval result queue memory FIFO, IPv6 data packet related information queue memory FIFO, IPv6 data packet memory RAM, packet sending circuit, CAM maintenance instruction queue memory FIFO, 0th handover packet queue memory FIFO, 1st handover packet Queue memory FIFO, handover packet sending circuit, and CPU interface circuit, wherein:
IP包输入接口电路,输入端接收上级物理和数据链路层处理电路输出的数据就绪信号和数据总线信号,输出读信号给上级物理和数据链路层处理电路,所述IP包输入接口电路数据输出端和包过滤电路的输入端相连,对输入输出的IPv4和IPv6包头信号和包尾信号分别进行计数,将包头包尾计数输出信号发送给CPU接口电路,并接收CPU接口电路输入的复位信号和计数器清零信号;The IP packet input interface circuit, the input end receives the data ready signal and the data bus signal output by the upper physical and data link layer processing circuit, and outputs the read signal to the upper physical and data link layer processing circuit, and the IP packet input interface circuit data The output terminal is connected to the input terminal of the packet filtering circuit, counts the input and output IPv4 and IPv6 packet header signals and packet tail signals respectively, sends the packet header and packet tail count output signal to the CPU interface circuit, and receives the reset signal input by the CPU interface circuit and counter clear signal;
包过滤电路,输入端和IP包输入接口电路相连,还分别和第0个上交包队列存储器FIFO、包输入队列存储器FIFO输出快满信号相连,输出端分别和第0个上交包队列存储器FIFO的输入端、包输入队列存储器FIFO的输入端相连,对输入输出的包头信号和包尾信号进行计数,并发送给CPU接口电路,同时接收CPU接口电路输入的复位信号和计数器清零信号;Packet filtering circuit, the input end is connected to the IP packet input interface circuit, and is also connected to the 0th handover packet queue memory FIFO and the packet input queue memory FIFO output almost full signal, and the output end is respectively connected to the 0th handover packet queue memory The input end of the FIFO and the input end of the packet input queue memory FIFO are connected, and the input and output packet header signals and packet tail signals are counted, and sent to the CPU interface circuit, and simultaneously receive the reset signal and the counter clearing signal input by the CPU interface circuit;
包输入队列存储器FIFO,是一个先进先出队列存储器,数据宽度为36位,输入端与上述包过滤电路的IP包输出端相连,读信号来自IPv6协议封装电路,复位信号来自CPU接口电路;The packet input queue memory FIFO is a first-in-first-out queue memory with a data width of 36 bits. The input end is connected to the IP packet output end of the above-mentioned packet filter circuit, the read signal comes from the IPv6 protocol encapsulation circuit, and the reset signal comes from the CPU interface circuit;
IPv6协议封装电路,输入端和所述包输入队列存储器FIFO相连,输出端和IPv6包队列存储器FIFO相连,此外输入端还接收IPv6包队列存储器FIFO输出的快满信号,IPv6协议封装电路对输入输出的包头信号和包尾信号进行计数,并发送给CPU接口电路,同时接收CPU接口电路输入的复位信号和计数器清零信号;The IPv6 protocol encapsulation circuit, the input end is connected with the packet input queue memory FIFO, the output end is connected with the IPv6 packet queue memory FIFO, in addition the input end also receives the nearly full signal output by the IPv6 packet queue memory FIFO, and the IPv6 protocol encapsulation circuit is to the input and output The packet header signal and packet tail signal are counted and sent to the CPU interface circuit, and at the same time receive the reset signal and counter clear signal input by the CPU interface circuit;
IPv6包队列存储器FIFO,是一个先进先出队列存储器,数据宽度为40位,数据输入端与上述IPv6协议封装电路相连,读输入信号和包相关信息提取电路的读输出相连,输出端和包相关信息提取电路相连,复位信号来自CPU接口电路;The IPv6 packet queue memory FIFO is a first-in-first-out queue memory with a data width of 40 bits. The data input end is connected to the above-mentioned IPv6 protocol encapsulation circuit, the read input signal is connected to the read output of the packet-related information extraction circuit, and the output end is related to the packet. The information extraction circuit is connected, and the reset signal comes from the CPU interface circuit;
包相关信息提取电路,输入端和IPv6包队列存储器的输出端相连,输出端分别和检索指令队列存储FIFO、IPv6数据包存储器RAM、IPv6数据包相关信息队列存储器FIFO相连,对输入输出的包头信号和包尾信号进行计数,并发送给CPU接口电路,同时接收CPU接口电路输入的复位信号和计数器清零信号;Packet-related information extraction circuit, the input end is connected to the output end of the IPv6 packet queue memory, and the output end is respectively connected to the retrieval command queue storage FIFO, the IPv6 data packet memory RAM, and the IPv6 data packet related information queue memory FIFO, and the input and output packet header signals Count with the end-of-packet signal, send it to the CPU interface circuit, and receive the reset signal and counter clear signal input by the CPU interface circuit at the same time;
检索指令队列存储器FIFO,是一个先进先出队列存储器,数据宽度为100位,数据输入端与上述包相关信息提取电路相连,读输入信号和CAM控制电路的读输出相连,数据输出端和CAM控制电路相连;The retrieval instruction queue memory FIFO is a first-in-first-out queue memory with a data width of 100 bits. The data input terminal is connected to the above-mentioned package-related information extraction circuit, the read input signal is connected to the read output of the CAM control circuit, and the data output terminal is connected to the CAM control circuit. circuit connected;
CAM控制电路,输入端分别和检索指令队列存储器FIFO输出端、CAM维护指令队列存储器FIFO输出端相连,CAM控制电路输出的CAM存储器读写控制命令总线信号以及双向数据请求总线REQDATA信号和CAM存储器相连,CAM控制电路和SRAM单端口存储器的数据总线相连,CAM控制电路输入端还和CAM存储器输出的读确认信号、查找匹配信号、查找输出有效信号相连,CAM控制电路输出的检索信息输出端和检索结果队列存储器FIFO相连,此外CAM控制电路的读信号分别和检索指令队列存储器FIFO的读输入端、CAM维护指令队列存储器FIFO读输入端相连,CAM控制电路输出端和CPU接口电路相连,将路由表保存的表项发送给CPU接口电路,CAM控制电路对IPv6路由查询次数和查询命中的信息进行计数,将这些信息作为查询状态信息发送给CPU接口电路,并接收CPU接口电路输入的复位信号和计数器清零信号;CAM control circuit, the input terminal is connected to the FIFO output terminal of the retrieval command queue memory and the FIFO output terminal of the CAM maintenance command queue memory respectively, and the CAM memory read and write control command bus signal output by the CAM control circuit and the bidirectional data request bus REQDATA signal are connected to the CAM memory , the CAM control circuit is connected to the data bus of the SRAM single-port memory, the input terminal of the CAM control circuit is also connected to the read confirmation signal output by the CAM memory, the search matching signal, and the search output effective signal, and the retrieval information output terminal output by the CAM control circuit is connected to the retrieval information output terminal. The result queue memory FIFO is connected. In addition, the read signal of the CAM control circuit is connected with the read input end of the retrieval instruction queue memory FIFO and the read input end of the CAM maintenance instruction queue memory FIFO. The output end of the CAM control circuit is connected with the CPU interface circuit, and the routing table The saved table items are sent to the CPU interface circuit, and the CAM control circuit counts the number of IPv6 routing queries and the information of query hits, sends these information as query status information to the CPU interface circuit, and receives the reset signal and counter input from the CPU interface circuit clear signal;
检索结果队列存储器FIFO,是一个先进先出队列存储器,数据宽度为148位,数据输入端与CAM控制电路的输出相连,读输入信号和包发送电路的读输出相连,数据输出端和包发送电路的输入端相连;The retrieval result queue memory FIFO is a first-in-first-out queue memory with a data width of 148 bits. The data input terminal is connected to the output of the CAM control circuit, the read input signal is connected to the read output of the packet transmission circuit, and the data output terminal is connected to the packet transmission circuit. The input terminal is connected;
IPv6数据包相关信息队列存储器FIFO,是一个先进先出队列存储器,数据宽度为60位,数据输入端与上述包相关信息提取电路相连,读输入信号和包发送电路的读输出相连,数据输出端和包发送电路相连;The IPv6 data packet-related information queue memory FIFO is a first-in-first-out queue memory with a data width of 60 bits. The data input terminal is connected to the above-mentioned packet-related information extraction circuit, and the read input signal is connected to the read output of the packet transmission circuit. The data output terminal Connected to the packet sending circuit;
CAM维护指令队列存储器FIFO,是一个先进先出队列存储器,数据宽度为90位,数据输入端和CPU接口电路相连,读输入信号和CAM控制电路输出的读信号相连,数据输出端和CAM控制电路的数据输入端相连;CAM maintenance instruction queue memory FIFO is a first-in-first-out queue memory with a data width of 90 bits. The data input terminal is connected to the CPU interface circuit, the read input signal is connected to the read signal output by the CAM control circuit, and the data output terminal is connected to the CAM control circuit. The data input terminal is connected;
包发送电路,分别向检索结果队列存储器FIFO、IPv6数据包相关信息队列存储器FIFO发出读信号,并和检索结果队列存储器FIFO、IPv6数据包相关信息队列存储器FIFO的输出端相连,包发送电路输出的读信号、读地址和IPv6数据包存储器RAM相连,IPv6数据包存储器RAM的数据输出端和包发送电路相连,包发送电路的输出还和第1个上交包队列存储器FIFO以及FPGA片外的上行FIFO相连,包发送电路对输入输出的IPv4、IPv6包头信号和包尾信号分别进行计数,并发送给CPU接口电路,同时接收CPU接口电路输入的复位信号和计数器清零信号;The packet sending circuit sends a read signal to the retrieval result queue memory FIFO and the IPv6 packet-related information queue memory FIFO respectively, and is connected to the output end of the retrieval result queue memory FIFO and the IPv6 data packet-related information queue memory FIFO, and the packet sending circuit outputs The read signal and read address are connected to the IPv6 data packet memory RAM, the data output end of the IPv6 data packet memory RAM is connected to the packet sending circuit, and the output of the packet sending circuit is also connected to the first handover packet queue memory FIFO and the uplink outside the FPGA chip The FIFOs are connected, and the packet sending circuit counts the input and output IPv4, IPv6 packet header signals and packet tail signals respectively, and sends them to the CPU interface circuit, and simultaneously receives the reset signal and the counter clearing signal input by the CPU interface circuit;
IPv6数据包存储器RAM是一个双端口的FPGA片内读写存储器,有一个数据写入端口和一个数据输出端口,数据写入端口和包相关信息提取电路的IPv6数据输出端相连,读端口的所有信号和包发送电路相连,IPv6数据包存储器RAM数据宽度为36位,读写端口分别有14根地址线;The IPv6 data packet memory RAM is a dual-port FPGA on-chip read-write memory, with a data write port and a data output port, the data write port is connected with the IPv6 data output port of the packet-related information extraction circuit, and all read ports The signal is connected to the packet sending circuit, the data width of the IPv6 packet memory RAM is 36 bits, and the read and write ports have 14 address lines respectively;
第0个上交包队列存储器FIFO,是一个先进先出队列存储器,数据宽度为36位,数据输入端与上述包过滤电路相连,读输入信号和上交包发送电路的读输出相连,数据输出端和上交包发送电路相连;The 0th handover packet queue memory FIFO is a first-in first-out queue memory with a data width of 36 bits. The data input terminal is connected to the above-mentioned packet filter circuit, and the read input signal is connected to the read output of the handover packet sending circuit, and the data output The terminal is connected to the handover packet sending circuit;
第1个上交包队列存储器FIFO,是一个先进先出队列存储器,数据宽度为36位,数据输入端与包发送电路相连,读输入信号和上交包发送电路的读输出相连,数据输出端和上交包发送电路相连;The first handover packet queue memory FIFO is a first-in-first-out queue memory with a data width of 36 bits. The data input terminal is connected to the packet sending circuit, the read input signal is connected to the read output of the handover packet sending circuit, and the data output terminal It is connected with the handover packet sending circuit;
上交包发送电路,输入端和第0个上交包队列存储器FIFO、第1个上交包队列存储器FIFO相连,数据输出端和SRAM双端口存储器的数据输入端相连,上交包发送电路发送的CPU中断信号、SRAM双端口存储器数据起始地址和终止地址、SRAM双端口存储器中待传送数据的长度信号输出端和CPU接口电路相连,CPU接口电路将CPU响应信号输出给上交包发送电路的输入端,上交包发送电路对输入输出的IPv4、IPv6包头信号和包尾信号分别进行计数,并发送给CPU接口电路,同时接收CPU接口电路输入的复位信号和计数器清零信号;The handover packet sending circuit, the input end is connected to the 0th handover packet queue memory FIFO and the first handover packet queue memory FIFO, the data output end is connected to the data input end of the SRAM dual-port memory, and the handover packet sending circuit sends The CPU interrupt signal, the start address and end address of the SRAM dual-port memory data, the length signal output of the data to be transmitted in the SRAM dual-port memory are connected to the CPU interface circuit, and the CPU interface circuit outputs the CPU response signal to the handover packet sending circuit The input terminal of the handover packet transmission circuit counts the input and output IPv4, IPv6 packet header signals and packet tail signals respectively, and sends them to the CPU interface circuit, and simultaneously receives the reset signal and the counter clear signal input by the CPU interface circuit;
CPU接口电路,和由FPGA实现的隧道处理电路内部各个电路相连,接收各个电路输入的IPv4、IPv6输入输出包头信号和包尾信号计数,以及CAM控制电路的查询状态计数,CPU接口电路与FPGA片外CPU控制单元的CPU地址总线、数据总线、读写控制信号相连,输出的中断信号和CPU控制单元的中断输入相连,CPU接口电路还和SRAM双端口存储器数据输出端口的地址总线、数据总线、读写控制信号相连,CPU接口电路接收CPU控制单元输入的复位信号,并将复位信号传送给FPGA内的其它各个电路,将清零信号传送给IP包输入接口电路、包过滤电路、IPv6协议封装电路、包相关信息提取电路、CAM控制电路、上交包发送电路、包发送电路,CPU接口电路还和CAM维护指令队列存储器FIFO的数据输入端相连,接收CAM控制电路输出的路由表表项数据,接收上交包发送电路输出的SRAM双端口存储器数据起始地址和终止地址、SRAM双端口存储器中待传送数据的长度以及中断请求信息,也向上交包发送电路发送CPU中断响应指示信号;The CPU interface circuit is connected to each circuit inside the tunnel processing circuit realized by FPGA, and receives the IPv4 and IPv6 input and output packet header signals and packet tail signal counts input by each circuit, as well as the query status count of the CAM control circuit. The CPU interface circuit and the FPGA chip The CPU address bus, data bus, and read-write control signal of the external CPU control unit are connected, the interrupt signal output is connected with the interrupt input of the CPU control unit, and the CPU interface circuit is also connected with the address bus, data bus, and The read and write control signals are connected, the CPU interface circuit receives the reset signal input by the CPU control unit, and transmits the reset signal to other circuits in the FPGA, and transmits the reset signal to the IP packet input interface circuit, packet filter circuit, and IPv6 protocol encapsulation circuit, packet-related information extraction circuit, CAM control circuit, handover packet sending circuit, packet sending circuit, and the CPU interface circuit is also connected to the data input end of the CAM maintenance instruction queue memory FIFO, and receives the routing table entry data output by the CAM control circuit , receiving the SRAM dual-port memory data start address and termination address output by the packet sending circuit, the length of the data to be transmitted in the SRAM dual-port memory, and the interrupt request information, and also sending the CPU interrupt response indication signal to the packet sending circuit;
所述包过滤电路是一个电路组件,其中:输入IP包数据寄存器,输入端和IP包输入接口电路的输出端相连;输入IP包数据寄存器的输出端分别和IPv4数据包寄存器、IPv6数据包寄存器相连;IPv4数据包寄存器的输出端分别和IPv4数据包延迟寄存器组、IPv4包头校验和寄存器、生存时间寄存器、包类型寄存器、状态控制机的输入端相连,同时也接收状态控制机的输出;IPv4数据包延迟寄存器组的输出端和数据选择器A的输入端相连;IPv4数据包头校验和生成器的输入端分别和IPv4头校验和寄存器输出、生存时间更新寄存器输出相连;生存时间寄存器的输出端和减一减法器A的输入端以及状态控制机的输入端相连,减一减法器A的输出端和生存时间更新寄存器的输入端相连,生存时间更新寄存器的输出端分别和IPv4数据包头校验和生成器、状态控制机相连;数据选择器A的输入端又分别和IPv4数据包延迟寄存器组的输出端、IPv4数据包头校验和生成器的输出端以及状态控制机的输出端相连,数据选择器A的输出端和更新后的IPv4数据包寄存器输入端相连;The packet filtering circuit is a circuit assembly, wherein: the input IP packet data register is connected to the output end of the input interface circuit of the IP packet; the output end of the input IP packet data register is respectively connected to the IPv4 packet register and the IPv6 packet register connected; the output end of the IPv4 data packet register is connected with the input end of the IPv4 data packet delay register group, the IPv4 packet header checksum register, the time-to-live register, the packet type register, and the state control machine respectively, and also receives the output of the state control machine; The output end of the IPv4 packet delay register group is connected to the input end of the data selector A; the input end of the IPv4 packet header checksum generator is connected to the output of the IPv4 header checksum register and the output of the time-to-live update register respectively; the time-to-live register The output terminal of the subtractor A is connected to the input terminal of the state control machine, the output terminal of the subtractor A is connected to the input terminal of the time-to-live update register, and the output terminals of the time-to-live update register are respectively connected to the IPv4 data The packet header checksum generator is connected to the state control machine; the input end of the data selector A is respectively connected to the output end of the IPv4 packet delay register group, the output end of the IPv4 packet header checksum generator, and the output end of the state control machine Connected, the output end of data selector A is connected with the updated IPv4 packet register input end;
IPv6数据包寄存器的输出端分别和IPv6数据包延迟寄存器组、跳数寄存器、下一个头寄存器、IPv6目的地址寄存器、状态控制机的输入端相连,同时也接收状态控制机的输出;跳数寄存器的输出端和减一减法器B的输入端相连以及状态控制机相连,跳数更新寄存器的输出端还和状态控制机相连;减一减法器B的输出端和跳数更新寄存器的输入端相连;数据选择器B的输入端分别和IPv6数据包延迟寄存器组、跳数更新寄存器、状态控制机的输出端相连,数据选择器B的输出端和更新后的IPv6数据包寄存器输入端相连;下一个头寄存器的输入端和IPv6数据包寄存器的输出端相连,输出端和状态控制机相连;IPv6目的地址寄存器的输出端和比较器的输入端相连,比较器的另一个输入端和本路由器IPv6地址寄存器输出端相连;比较器的输出端和状态控制机的输入端相连;本路由器IPv6地址寄存器输入端和CPU接口电路的输出相连;The output end of IPv6 data packet register is connected with the input end of IPv6 data packet delay register group, hop count register, next head register, IPv6 purpose address register, state control machine respectively, also receives the output of state control machine simultaneously; Hop count register The output end of the subtractor B is connected with the input end of the subtractor B and the state control machine, and the output end of the hop update register is also connected with the state control machine; the output end of the subtractor B is connected with the input end of the hop update register ; The input end of data selector B is connected with the output end of IPv6 data packet delay register group, hop update register, state control machine respectively, and the output end of data selector B is connected with the updated IPv6 data packet register input end; The input end of a header register is connected with the output end of the IPv6 packet register, and the output end is connected with the state control machine; the output end of the IPv6 destination address register is connected with the input end of the comparator, and the other input end of the comparator is connected with the IPv6 The output end of the address register is connected; the output end of the comparator is connected with the input end of the state control machine; the input end of the router IPv6 address register is connected with the output of the CPU interface circuit;
数据选择器C的输入端分别和更新后的IPv4数据包寄存器、更新后的IPv6数据包寄存器的输出端相连、状态控制机以及包输入队列存储器FIFO的快满信号相连,数据选择器C的输出端分别和第0个上交包队列存储器FIFO、包输入队列存储器FIFO相连,同时数据选择器C的包头信号和包尾信号输出端也和计数器的输入端相连;计数器接收CPU接口电路输出的计数器清零信号,并将包头包尾信号计数信号传送给CPU接口电路的输入端;The input end of data selector C links to each other with the output end of the IPv4 data packet register after updating, the IPv6 data packet register after updating, the state control machine and the nearly full signal of packet input queue memory FIFO are connected, the output of data selector C Terminals are respectively connected to the 0th handover packet queue memory FIFO and packet input queue memory FIFO, and the output terminals of the packet header signal and packet tail signal of the data selector C are also connected to the input terminal of the counter; the counter receives the counter output by the CPU interface circuit Clear the signal, and transmit the count signal of the header and tail signal to the input end of the CPU interface circuit;
所述IPv6协议封装电路是一个电路组件,其中:包输入队列存储器FIFO接口电路,数据输入端和包输入队列存储器FIFO的数据输出端相连,输出的读信号和包输入队列存储器FIFO的读输入信号相连,控制输入输出端和状态控制机电路相连;IPv4包头数据寄存器,输入端和包输入队列存储器FIFO接口电路输出端以及状态控制机电路输出端相连,一个输出端和IPv4包头转IPv6隧道包头电路相连,另一个输出端和多路数据选择器电路输入端相连;IPv4负载数据寄存器,输入端和包输入队列存储器FIFO接口电路输出端相连,输出端和多路数据选择器电路输入端相连;IPv6数据寄存器,输入端和包输入队列存储器FIFO接口电路的输出端相连,输出端和多路数据选择器电路输入端相连;IPv6隧道包头数据寄存器,输入端和IPv4包头转IPv6隧道包头电路以及状态控制机电路相连,输出端和多路数据选择器电路相连;多路数据选择器电路的输出端和IPv6包队列存储器FIFO的输入端相连;包输入队列存储器FIFO接口电路将接收的数据包头信号和尾信号发送给计数器电路,多路数据选择器电路也把输出的数据包头、包尾信号传送给计数器电路,计数器电路输出的输入输出包头包尾信号计数和CPU接口电路的状态计数器值输入端相连,同时接收CPU接口电路输入的计数器清零信号;The IPv6 protocol encapsulation circuit is a circuit assembly, wherein: the packet input queue memory FIFO interface circuit, the data input end is connected with the data output end of the packet input queue memory FIFO, the output read signal and the read input signal of the packet input queue memory FIFO Connected, the control input and output ends are connected to the state control machine circuit; the IPv4 packet header data register, the input end is connected to the output end of the FIFO interface circuit of the packet input queue memory and the output end of the state control machine circuit, and one output end is connected to the IPv4 packet header to IPv6 tunnel packet header circuit Connected, the other output end is connected with the input end of the multiplex data selector circuit; the IPv4 load data register, the input end is connected with the output end of the packet input queue memory FIFO interface circuit, and the output end is connected with the input end of the multiplex data selector circuit; IPv6 The data register, the input end is connected with the output end of the FIFO interface circuit of the packet input queue memory, and the output end is connected with the input end of the multi-channel data selector circuit; the IPv6 tunnel header data register, the input end is connected with the IPv4 header transfer IPv6 tunnel header circuit and state control The machine circuit is connected, and the output end is connected with the multiplex data selector circuit; the output end of the multiplex data selector circuit is connected with the input end of the IPv6 packet queue memory FIFO; the packet input queue memory FIFO interface circuit will receive the data packet head signal and tail The signal is sent to the counter circuit, and the multi-channel data selector circuit also transmits the output data packet header and packet tail signal to the counter circuit, and the input and output packet header and tail signal counts output by the counter circuit are connected to the state counter value input terminal of the CPU interface circuit. Simultaneously receive the counter clearing signal input by the CPU interface circuit;
所述包相关信息提取电路是一个电路组件,由一系列的电路组成:IPv6包队列存储器接口电路,所述数据输入端和IPv6包队列存储器FIFO相连,输出的读信号和IPv6包队列存储器FIFO的读输入信号相连,控制输入输出端和状态控制机电路相连,输出端和包上交标识寄存器、包优先级寄存器、包源端口编号寄存器、包起始地址寄存器、包终止地址寄存器、包序列号寄存器、包目的地址寄存器、隧道标识寄存器以及包写入RAM电路相连;IPv6包信息发送电路的输入端和所述包上交标识寄存器、包优先级寄存器、包起始地址寄存器、包源端口编号寄存器、包终止地址寄存器、包序列号寄存器相连,控制信息来自于状态控制机,输出端接IPv6数据包相关信息队列存储器FIFO;检索指令发送电路的输入端和包序列号寄存器、包目的地址寄存器、隧道标识寄存器相连,输出端和检索指令队列存储器FIFO相连,控制输入端和状态控制机相连;包写入RAM电路的输出端和IPv6数据包存储器RAM相连,它的控制输入端和状态控制机相连;计数器的输入端分别和IPv6包队列存储器FIFO接口电路的输入包头信号以及输入包尾信号相连,还和包写入RAM电路输出的包头信号和包尾信号相连,同时也和CPU接口电路输入的计数器清零信号相连,输出的包头尾信号计数和CPU接口电路相连;Described packet-related information extraction circuit is a circuit component, is made up of a series of circuits: IPv6 packet queue memory interface circuit, described data input end is connected with IPv6 packet queue memory FIFO, the read signal of output and IPv6 packet queue memory FIFO The read input signal is connected, the control input and output terminals are connected to the state control machine circuit, and the output terminal is connected to the packet handover identification register, packet priority register, packet source port number register, packet start address register, packet end address register, and packet serial number The register, the packet destination address register, the tunnel identification register and the packet writing RAM circuit are connected; the input end of the IPv6 packet information sending circuit is handed over to the identification register, the packet priority register, the packet starting address register, and the packet source port number The register, the packet termination address register, and the packet serial number register are connected, the control information comes from the state control machine, and the output terminal is connected to the IPv6 data packet related information queue memory FIFO; the input terminal of the retrieval instruction sending circuit is connected with the packet serial number register, and the packet destination address register , the tunnel identification register are connected, the output end is connected with the retrieval instruction queue memory FIFO, the control input end is connected with the state control machine; the output end of the packet writing RAM circuit is connected with the IPv6 data packet memory RAM, and its control input end is connected with the state control machine Connected; the input end of the counter is respectively connected with the input packet header signal and the input packet tail signal of the IPv6 packet queue memory FIFO interface circuit, and also connected with the packet header signal and packet tail signal output by the packet writing RAM circuit, and also connected with the CPU interface circuit input The counter clearing signal is connected, and the output packet header and tail signal count is connected to the CPU interface circuit;
所述CAM控制电路是一个电路组件,由一系列的电路组成:检索指令队列存储器FIFO接口电路的数据输入端和检索指令队列存储器FIFO输出端相连,输出的读信号和检索指令队列存储器FIFO的读信号相连,并且输出端也和状态控制机互连,接收状态控制机输出的控制信号;CAM写入数据寄存器的输入端和检索指令队列存储器FIFO接口电路、以及CAM维护指令队列存储器FIFO接口电路的输出端相连,输出端和CAM数据总线读写控制电路相连;CAM操作指令发送电路的输入端和检索指令队列存储器FIFO接口电路的输出端、CAM维护指令队列存储器FIFO接口电路的输出端相连,输出端直接和CAM存储器的命令总线INST、LTIN、SEGSEL、GMASK、CRB和请求选通信号REQSTB相连;SRAM写入数据寄存器的输入端和CAM维护指令队列存储器FIFO接口电路输出端,以及检索指令队列存储器FIFO接口电路的输出端相连,输出端和SRAM数据总线读写控制电路输入端相连;SRAM数据总线读写控制电路的输出端和SRAM读出数据寄存器、检索结果寄存器以及SRAM单端口存储器相连,控制信号输入端和状态机输出相连;CPU读出数据寄存器的输入端和CAM读出数据寄存器的输出端、SRAM读出数据寄存器的输出端相连,输出端和CPU接口电路相连;检索结果寄存器的输入端和数据包序列号寄存器的输出端相连,输出端和检索结果队列存储器FIFO相连;数据包序列号寄存器的输入端和检索指令队列存储器FIFO接口电路的输出端以及状态控制机的输出端相连;计数器的输入端和检索结果寄存器的输出端相连,还和CPU接口电路输入的计算器清零信号相连,它输出的查询状态计数输出和CPU接口电路相连;Described CAM control circuit is a circuit component, is made up of a series of circuits: the data input end of retrieval instruction queue memory FIFO interface circuit is connected with retrieval instruction queue memory FIFO output end, the read signal of output and the read of retrieval instruction queue memory FIFO The signal is connected, and the output end is also interconnected with the state control machine to receive the control signal output by the state control machine; the input end of the CAM write data register and the retrieval instruction queue memory FIFO interface circuit, and the CAM maintenance instruction queue memory FIFO interface circuit The output end is connected, and the output end is connected with the CAM data bus read-write control circuit; the input end of the CAM operation instruction sending circuit is connected with the output end of the retrieval instruction queue memory FIFO interface circuit, and the output end of the CAM maintenance instruction queue memory FIFO interface circuit, and the output The terminal is directly connected to the command bus INST, LTIN, SEGSEL, GMASK, CRB of the CAM memory and the request strobe signal REQSTB; the input terminal of the SRAM write data register and the output terminal of the FIFO interface circuit of the CAM maintenance instruction queue memory, and the retrieval instruction queue memory The output end of the FIFO interface circuit is connected, and the output end is connected with the input end of the SRAM data bus read-write control circuit; the output end of the SRAM data bus read-write control circuit is connected with the SRAM read data register, the retrieval result register and the SRAM single-port memory, and the control The signal input terminal is connected to the output of the state machine; the input terminal of the CPU read data register is connected to the output terminal of the CAM read data register and the output terminal of the SRAM read data register, and the output terminal is connected to the CPU interface circuit; the input of the retrieval result register The end is connected with the output end of the data packet serial number register, and the output end is connected with the retrieval result queue memory FIFO; the input end of the data packet serial number register is connected with the output end of the retrieval instruction queue memory FIFO interface circuit and the output end of the state control machine; The input terminal of the counter is connected with the output terminal of the retrieval result register, and is also connected with the calculator clearing signal input by the CPU interface circuit, and the query state count output of it is connected with the CPU interface circuit;
所述包发送电路是一个电路组件,由一系列的电路组成:IPv6数据包相关信息队列存储器FIFO接口电路,数据输入端和IPv6数据包相关信息队列存储器FIFO的输出端相连,控制输入和输出端与状态机控制电路相连,输出的读信号和IPv6数据包相关信息队列存储器FIFO读输入端相连,输出端分别和包存储起始地址寄存器、包存储终止地址寄存器、包长度寄存器、包优先级寄存器、源端口编号寄存器、包序列号寄存器A的输入端相连;检索结果队列存储器FIFO接口电路,数据输入端和检索结果队列存储器FIFO的输出相连,控制输入和输出端与状态机控制电路相连,输出端分别和包序列号寄存器B、目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv6地址寄存器、下一跳IPv4地址寄存器、隧道IPv6目的地址寄存器的输入端相连;位宽为36位的附加数据寄存器组的输入端分别和包优先级寄存器、包长度寄存器、源端口编号寄存器、源线卡编号寄存器、目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv6地址寄存器、下一跳IPv4地址寄存器、隧道IPv6目的地址寄存器的数据输出端相连;源线卡编号寄存器的输入来自CPU接口电路;增10加法器,输入端和包存储起始地址的输出相连,输出端与地址寄存器A相连;地址寄存器B的输入端和包存储起始地址的输出相连;增1加法器的输出端分别和IPv6数据包存储器读地址寄存器的输出端、地址寄存器C的输入端相连;多路数据选择器A,输入端分别和地址寄存器A、地址寄存器B、地址寄存器C相连,控制输入端和状态机控制电路的输出相连,输出端和IPv6数据包存储器读地址寄存器的输入端相连;数据比较器A,输入端和包存储终止地址寄存器的输出端以及IPv6数据包存储器读地址寄存器的输出端相连,输出端和状态机控制电路的输入端相连;位宽为36位的IP数据寄存器,输入端和IPv6数据包存储器RAM的数据输出端相连,输出端和多路数据选择器B的输入端相连;多路数据选择器B,数据输入端分别和位宽为36位的附加数据寄存器组的输出端、位宽为36位的IP数据寄存器的输出端相连,输出端和上交数据包寄存器、带附加数据的IPv4或IPv6数据包寄存器的输入端相连;上交数据包寄存器的输出端和第1个上交包队列存储器FIFO的输入端相连;带附加数据的IPv4或IPv6包寄存器的输出端发往与FPGA相连的上行FIFO;带附加数据的IPv4或IPv6包寄存器的还将发送的数据包头信号和包尾信号分别传送给计数器,计数器还和CPU接口电路输入的计数器清零信号相连,计数器输出的包头包尾信号计数信号发送给CPU接口电路;Described packet sending circuit is a circuit component, is made up of a series of circuits: IPv6 data packet related information queue memory FIFO interface circuit, data input end is connected with the output end of IPv6 data packet related information queue memory FIFO, control input and output end It is connected with the state machine control circuit, the output read signal is connected with the FIFO read input terminal of the IPv6 data packet related information queue memory, and the output terminal is respectively connected with the packet storage start address register, packet storage end address register, packet length register, and packet priority register , the source port number register, and the input of the packet serial number register A are connected; the retrieval result queue storage FIFO interface circuit, the data input terminal is connected with the output of the retrieval result queue storage FIFO, the control input and output terminals are connected with the state machine control circuit, and the output The terminals are respectively connected to the input ends of the packet serial number register B, the destination port number register, the destination line card number register, the next-hop IPv6 address register, the next-hop IPv4 address register, and the tunnel IPv6 destination address register; the bit width is 36 bits The input terminals of the additional data register group are respectively connected with the packet priority register, the packet length register, the source port number register, the source line card number register, the destination port number register, the destination line card number register, the next hop IPv6 address register, the next hop The data output end of the IPv4 address register and the tunnel IPv6 destination address register are connected; the input of the source line card number register comes from the CPU interface circuit; the adder is increased by 10, the input end is connected with the output of the packet storage start address, and the output end is connected with the address register A connected; the input of the address register B is connected to the output of the packet storage start address; the output of the adder is connected to the output of the IPv6 packet memory read address register and the input of the address register C respectively; multiplex data selection Device A, the input end is connected with the address register A, address register B, address register C respectively, the control input end is connected with the output of the state machine control circuit, the output end is connected with the input end of the IPv6 data packet memory read address register; the data comparator A, the input end is connected to the output end of the packet storage termination address register and the output end of the IPv6 packet memory read address register, and the output end is connected to the input end of the state machine control circuit; the bit width is 36 bits of IP data register, the input end It is connected with the data output terminal of the IPv6 data packet memory RAM, and the output terminal is connected with the input terminal of the multiplexer B; the data input terminal of the multiplexer B is respectively connected with the output of the additional data register group whose bit width is 36 bits end, the output end of the IP data register with a bit width of 36 bits is connected, and the output end is connected with the input end of the handover data packet register and the IPv4 or IPv6 data packet register with additional data; the output end of the handover data packet register is connected with the first The input end of 1 handover packet queue memory FIFO is connected; the output end of the IPv4 or IPv6 packet register with additional data is sent to the upstream FIFO connected with FPGA; the IPv4 or IPv6 packet with additional data is sent to The register also transmits the sent data packet header signal and packet tail signal to the counter respectively, and the counter is also connected with the counter clearing signal input by the CPU interface circuit, and the packet header and packet tail signal count signal output by the counter is sent to the CPU interface circuit;
所述CAM存储器,是系统的FPGA片外存储器,读写控制命令总线信号以及数据请求总线REQDATA信号来自CAM控制电路,输出的地址总线信号和读写信号分别与SRAM单端口存储器的地址总线和读写信号相连,输出的读确认信号、查找匹配信号、查找输出有效信号和CAM控制电路输入端相连;The CAM memory is the FPGA off-chip memory of the system. The read-write control command bus signal and the data request bus REQDATA signal are from the CAM control circuit. The write signal is connected, and the output read confirmation signal, search match signal, and search output valid signal are connected to the input end of the CAM control circuit;
所述SRAM单端口存储器,是系统的FPGA片外静态SRAM存储器,读写输入信号和地址信号来自CAM存储器的输出,数据输入输出端和CAM控制电路相连;Described SRAM single-port memory is the FPGA off-chip static SRAM memory of system, and read-write input signal and address signal are from the output of CAM memory, and data input and output end are connected with CAM control circuit;
所述SRAM双端口存储器,是系统的FPGA片外静态双端口SRAM存储器,分为数据写入端口和数据输出端口,数据写入端口的双向数据总线和上交包发送电路相连,数据写入端口的读写信号线、地址总线和上交包发送电路的输出端相连,数据输出端口的双向数据总线和CPU接口电路相连,数据输出端口的读写信号线、地址总线和CPU接口电路的输出端相连。The SRAM dual-port memory is a static dual-port SRAM memory outside the FPGA chip of the system, which is divided into a data write port and a data output port. The read and write signal lines and address bus of the data output port are connected to the output end of the handover packet sending circuit, the bidirectional data bus of the data output port is connected to the CPU interface circuit, the read and write signal line of the data output port, the address bus and the output end of the CPU interface circuit connected.
通过上述方法构建的路由器中采用IPv6头封装IPv4包的隧道转发系统,由一片FPGA芯片EP1S25F780、两片IDT75k62100(TCAM)、两片IDT71T75602(SRAM)、一片CY7C1300A(SRAM双端口存储器)芯片构成,FPGA和外围芯片采用同一个时钟进行工作。The tunnel forwarding system that adopts IPv6 header to encapsulate IPv4 packets in the router built by the above method is composed of one FPGA chip EP1S25F780, two IDT75k62100 (TCAM), two IDT71T75602 (SRAM), and one CY7C1300A (SRAM dual-port memory) chip. Work with the same clock as peripheral chips.
FPGA只有一个主时钟CLK,该时钟频率为100MHZ时,上述所有模块的复位信号来自于CPU接口电路,CPU接口电路的复位信号来自于CPU控制单元,上述所有模块的时钟都为CLK,但在上面为避免重复,没有提,路由器中采用IPv6头封装IPv4包的隧道转发系统达到的性能指标为:FPGA has only one main clock CLK. When the clock frequency is 100MHZ, the reset signals of all the above modules come from the CPU interface circuit, and the reset signals of the CPU interface circuit come from the CPU control unit. The clocks of all the above modules are CLK, but in the above In order to avoid repetition, it is not mentioned that the performance indicators achieved by the tunnel forwarding system that uses IPv6 headers to encapsulate IPv4 packets in routers are:
IDT75k62100和FPGA共用一个主时钟100MHZ CLK,两片IDT71T75602的工作频率为50MHZ,该50MHZ和主100MHZ的时钟源相同,是100MHZ CLK主时钟经二分频得到的;IDT75k62100 and FPGA share a main clock 100MHZ CLK, and the operating frequency of the two IDT71T75602 is 50MHZ. The 50MHZ and the main 100MHZ clock source are the same, and are obtained by dividing the 100MHZ CLK main clock by two;
通过利用CAM系统构造的查找表,支持表项条数的动态分配,支持IPv6包的IPv6路由查找,系统能保证以3.2Gbit/s线速收发数据包。By using the lookup table constructed by the CAM system, it supports the dynamic allocation of the number of entries and IPv6 routing lookup of IPv6 packets, and the system can guarantee to send and receive data packets at a line speed of 3.2Gbit/s.
通过上述方法,使用一片EP1S25780和级联两片IDT75k62100构建的路由查找器最大支持64K*288bits的IPv6路由表项。Through the above method, the route finder built by using one EP1S25780 and cascading two IDT75k62100s can support IPv6 routing entries of 64K*288bits at most.
该隧道传输处理系统可以处理IPv6隧道数据包、IPv4数据包和IPv6非隧道数据包,最大处理32k字节数据包。系统能保证3.2Gbit/s线速收发数据包,如果超过3.2Gbit/s会丢包,但没有丢的包能正确传送,如果包速率又回到3.2Gbit/s,仍然不会丢包。The tunnel transmission processing system can process IPv6 tunnel data packets, IPv4 data packets and IPv6 non-tunnel data packets, and can process data packets of up to 32k bytes. The system can guarantee 3.2Gbit/s wire speed to send and receive data packets. If it exceeds 3.2Gbit/s, packets will be lost, but the packets that are not lost can be transmitted correctly. If the packet rate returns to 3.2Gbit/s, there will still be no packet loss.
支持上交包整包缓存。Support handing over the entire packet cache.
通过CPU对FPGA内的各电路模块及CAM系统进行控制和维护。Control and maintain each circuit module and CAM system in FPGA through CPU.
附图说明Description of drawings
图1路由器中采用IPv6头封装IPv4包的隧道转发系统在核心路由器线卡中的位置以及和周围器件的关系Figure 1 The position of the tunnel forwarding system in the router that uses the IPv6 header to encapsulate the IPv4 packet in the line card of the core router and the relationship with the surrounding devices
图2路由器中采用IPv6头封装IPv4包的隧道转发系统的芯片之间连接关系Figure 2 The connection relationship between chips in the tunnel forwarding system that uses IPv6 headers to encapsulate IPv4 packets in routers
图3路由器中采用IPv6头封装IPv4包的隧道转发系统FPGA内部的各个子电路之间的关系Figure 3 The relationship between the various sub-circuits inside the FPGA of the tunnel forwarding system that uses the IPv6 header to encapsulate the IPv4 packet in the router
图4包过滤电路Figure 4 packet filtering circuit
图5IPv 6协议封装电路Figure 5 IPv6 protocol encapsulation circuit
图6包相关信息提取电路Figure 6 Package related information extraction circuit
图7CAM控制电路Figure 7CAM control circuit
图8包发送电路Figure 8 packet sending circuit
图9CAM存储器存储的表项数据结构Table entry data structure stored in Figure 9CAM memory
说明:目的IPv6地址128位(127~0),隧道标识占1位,保留位置0。Note: The destination IPv6 address is 128 bits (127~0), the tunnel ID occupies 1 bit, and the reserved bit is 0.
图10SRAM单端口存储器存储的表项数据结构Figure 10 SRAM single-port memory storage entry data structure
说明:标识(bit71~69):000——IPv4转发;001——上交;010——丢弃,011——普通IPv6转发;100——IPv6隧道转发;Description: Identification (bit71~69): 000——IPv4 forwarding; 001—handover; 010—discard, 011—general IPv6 forwarding; 100——IPv6 tunnel forwarding;
目的线卡编号:bit71~68;目的端口编号:bit67~64。Destination line card number: bit71~68; destination port number: bit67~64.
IPv6隧道目的地址共128位,由SRAM单端口存储器第三个和第四个表项的bit63~0构成。The IPv6 tunnel destination address has a total of 128 bits, which is composed of bit63~0 of the third and fourth entries of the SRAM single-port memory.
保留位置0。
图11IP包输入接口电路接收的经过上级电路处理的PPP包数据结构Figure 11 The data structure of the PPP packet received by the IP packet input interface circuit and processed by the upper circuit
图12包输入队列存储器FIFO中的数据结构Figure 12 The data structure in the packet input queue memory FIFO
说明:(1)bit35~34为包的头尾指示:10——数据包开始,00——数据包中间数据,01——数据包结束,11——数据包错误。bit33~32为MOD域,最后一个32位有效字节指示,只有在包尾时才有意义:00——最后四个字节都有效,01——最后四个字节中三个字节有效(bit31~8),10——最后四个字节中两个字节有效(bit31~16),11——最后四个字节中一个字节有效(bit31~24);无效位用0填充。bit31~31,数据包的具体内容。Explanation: (1) bit35~34 indicate the head and tail of the packet: 10—the beginning of the data packet, 00—the middle data of the data packet, 01—the end of the data packet, 11—the error of the data packet. bit33~32 is the MOD field, the last 32-bit valid byte indicates that it is meaningful only at the end of the packet: 00—the last four bytes are all valid, 01—three of the last four bytes are valid (bit31~8), 10—two bytes in the last four bytes are valid (bit31~16), 11—one byte in the last four bytes is valid (bit31~24); invalid bits are filled with 0 . bit31~31, the specific content of the data packet.
图13IPv6数据包相关信息队列存储器FIFO中的数据结构Figure 13 The data structure in the FIFO of the IPv6 data packet-related information queue memory
图14检索指令队列存储器FIFO中的数据结构Figure 14 Retrieve the data structure in the instruction queue memory FIFO
图15CAM维护指令队列存储器FIFO数据结构Figure 15 CAM maintenance instruction queue memory FIFO data structure
图16检索结果队列存储器FIFO中的数据结构Figure 16 The data structure in the retrieval result queue memory FIFO
图17发送给上行FIFO的数据结构Figure 17 The data structure sent to the upstream FIFO
说明:(1)bit35~34为包的头尾指示:10——数据包开始,00——数据包中间数据,01——数据包结束,11——数据包错误。bit33~32为MOD域,最后一个32位有效字节指示,只有在包尾时才有意义:00——最后四个字节都有效,01——最后四个字节中三个字节有效(bit31~8),10——最后四个字节中两个字节有效(bit31~16),11——最后四个字节中一个字节有效(bit31~24);无效位用0填充。bit31~31,数据包的具体内容。Explanation: (1) bit35~34 indicate the head and tail of the packet: 10—the beginning of the data packet, 00—the middle data of the data packet, 01—the end of the data packet, 11—the error of the data packet. bit33~32 is the MOD field, the last 32-bit valid byte indicates that it is meaningful only at the end of the packet: 00—the last four bytes are all valid, 01—three of the last four bytes are valid (bit31~8), 10—two bytes in the last four bytes are valid (bit31~16), 11—one byte in the last four bytes is valid (bit31~24); invalid bits are filled with 0 . bit31~31, the specific content of the data packet.
(2)源位置编号:bit15~8,共8位,其中bit11~8标识源端口编号,bit15~12标识源线卡编号。(2) Source location number: bits 15-8, 8 bits in total, where bits 11-8 identify the source port number, and bits 15-12 identify the source line card number.
(3)目的端口编号:bit19~8,共12位,但目前只用了bit11~8,其它位置0,用来指明数据包到达目标线卡后的输出端口。(3) Destination port number: bit19~8, 12 bits in total, but currently only bit11~8 are used, and other bits are 0, which are used to indicate the output port after the data packet arrives at the target line card.
图18上交数据结构Figure 18 hand in data structure
说明:bit35~34为包的头尾指示:10——数据包开始,00——数据包中间数据,01——数据包结束,11——数据包错误。bit33~32为MOD域,最后一个32位有效字节指示,只有在包尾时才有意义:00——最后四个字节都有效,01——最后四个字节中三个字节有效(bit31~8),10——最后四个字节中两个字节有效(bit31~16),11——最后四个字节中一个字节有效(bit31~24);无效位用0填充。bit31~31,数据包的具体内容。Note: bit35~34 are the head and tail instructions of the packet: 10—the start of the data packet, 00—the middle data of the data packet, 01—the end of the data packet, 11—the error of the data packet. bit33~32 is the MOD field, the last 32-bit valid byte indicates that it is meaningful only at the end of the packet: 00—the last four bytes are all valid, 01—three of the last four bytes are valid (bit31~8), 10—two bytes in the last four bytes are valid (bit31~16), 11—one byte in the last four bytes is valid (bit31~24); invalid bits are filled with 0 . bit31~31, the specific content of the data packet.
图19采用IPv6头封装IPv4报文的隧道数据包的数据结构Figure 19 uses the IPv6 header to encapsulate the data structure of the tunnel data packet of the IPv4 message
具体实施方式Detailed ways
路由器中采用IPv6头封装IPv4包的隧道转发系统用在线路接口卡上,解决IPv4网络通过纯IPv6主干网络实现互联的问题,具体实现采用FPGA技术。它由隧道处理电路和外部SRAM双端口存储器芯片、SRAM单端口存储器芯片、CAM存储器芯片、CPU控制单元实现,隧道处理电路由一片FPGA实现。该系统在高性能核心路由器中的位置见附图1,构成该系统的芯片之间连接关系如图2所示。The tunnel forwarding system that uses IPv6 header to encapsulate IPv4 packets in routers is used on line interface cards to solve the problem of interconnection of IPv4 networks through pure IPv6 backbone networks, and the specific implementation uses FPGA technology. It is realized by a tunnel processing circuit, an external SRAM dual-port memory chip, an SRAM single-port memory chip, a CAM memory chip, and a CPU control unit, and the tunnel processing circuit is realized by an FPGA. The position of the system in the high-performance core router is shown in Figure 1, and the connection relationship between the chips constituting the system is shown in Figure 2.
由图可知,路由器中采用IPv6头封装IPv4包的隧道转发系统从物理和数据链路层处理电路接收按照PPP协议封装的数据包,该数据包只含有协议域、信息域和填充域,隧道传输处理系统根据协议域标识提取其中的纯IPv6数据报文和IPv4数据报文。对IPv4数据报文进行封装,加上IPv6数据包头,成为IPv6隧道数据包;对IPv6数据报文的目的地址和跳数进行检查,将目的地址为本路由器的IPv6数据包直接上交给CPU控制单元进行处理。对于目的地址不为本路由器的IPv6数据包,从中提取路由查找信息,并将查找信息提交给CAM查找系统(CAM+SRAM)进行查找,由FPGA构成的隧道处理电路,根据查找返回的结果,决定对IPv6数据包是进行普通IPv6转发、采用IPv6头封装IPv4包的隧道转发、IPv4转发、丢弃还是上交给CPU进行处理。转发的包通过上行FIFO存储器发送给后续的交换结构协处理器和交换结构进行处理。It can be seen from the figure that the tunnel forwarding system in the router adopts the IPv6 header to encapsulate the IPv4 packet, and receives the data packet encapsulated according to the PPP protocol from the physical and data link layer processing circuits. The processing system extracts pure IPv6 data packets and IPv4 data packets therein according to the protocol domain identification. Encapsulate the IPv4 data packet and add the IPv6 data packet header to become an IPv6 tunnel data packet; check the destination address and hop count of the IPv6 data packet, and directly hand over the IPv6 data packet whose destination address is the router to the CPU control unit is processed. For the IPv6 data packet whose destination address is not the router, extract the route lookup information from it, and submit the lookup information to the CAM lookup system (CAM+SRAM) for lookup, the tunnel processing circuit composed of FPGA, according to the result returned by the lookup, decides Whether to perform normal IPv6 forwarding, IPv6 header-encapsulated tunnel forwarding of IPv4 packets, IPv4 forwarding, discarding, or handing over to the CPU for processing of IPv6 data packets. The forwarded packet is sent to the subsequent switch fabric coprocessor and switch fabric for processing through the uplink FIFO memory.
隧道传输处理系统上电后,CPU控制单元通过CPU接口电路对整个系统进行初始化,将CAM配置成288位查找模式,并配置SRAM表项。初始化完成后,系统才可以正常工作。After the tunnel transmission processing system is powered on, the CPU control unit initializes the entire system through the CPU interface circuit, configures the CAM as a 288-bit search mode, and configures SRAM entries. After the initialization is completed, the system can work normally.
系统使用的CAM单个表项的存储位宽为72位,所以支持的表项长度是72bit的整数倍,由于IPv6包的目的地址是128位,因此至少需要2个CAM表项来存储IPv6包的目的地址。IPv4包进入路由器之后,离开路由器时,如果采用IPv6头封装IPv4包的隧道转发,系统除了要提供隧道末端出口的IPv6地址外,还需要提供隧道包离开当前路由器后途经的下一跳路由器IPv6地址,这样提供查找结果的SRAM至少需要256位。系统使用的SRAM单端口存储器支持的表项长度是72bit的整数倍,这样以来,实际上SRAM提供的存储容量为288位,对应SRAM有4个存储单元。288位SRAM必须要有288位CAM配对,才能在时序上匹配,所以系统采用4个CAM表项共288位来表示一个路由表项。第一个表项的bit71~69位取100,说明是IPv6表项,bit68如果取1,说明查的是用IPv6封装的隧道包的路由,bit68如果取0,说明查的是普通IPv6包的路由,bit67~64位保留不用,bit63~0对应IPv6目的地址的高64位。第二个表项的bit71~64位保留不用,bit63~0对应IPv6目的地址的低64位。还有2个表项保留不用,置0,如图9所示。The storage bit width of a single CAM entry used by the system is 72 bits, so the supported entry length is an integer multiple of 72 bits. Since the destination address of an IPv6 packet is 128 bits, at least two CAM entries are required to store the IPv6 packet. Destination address. After the IPv4 packet enters the router and leaves the router, if the IPv6 header is used to encapsulate the tunnel forwarding of the IPv4 packet, the system needs to provide not only the IPv6 address of the tunnel end exit, but also the IPv6 address of the next-hop router that the tunnel packet passes through after leaving the current router. , such that the SRAM providing the lookup results requires at least 256 bits. The length of entries supported by the SRAM single-port memory used by the system is an integer multiple of 72 bits. In this way, the actual storage capacity provided by the SRAM is 288 bits, corresponding to 4 storage units of the SRAM. 288-bit SRAM must be paired with 288-bit CAM to match in timing, so the system uses 4 CAM entries with a total of 288 bits to represent a routing entry. The
系统使用的SRAM单端口存储器支持的每个路由表项结构如图10所示:第一个表项的bit71~69构成路由查找结果的标识位,用于表示查找结果的类型:IPv4转发、普通IPv6转发、IPv6隧道转发、丢弃、数据上交给CPU控制单元;目的线卡编号由第二个表项的bit71~68构成,共4位,用于表示数据包通过交换结构将要到达的目的线卡;目的端口编号由bit67~64构成,共4位,用于表示转发的数据包经过交换结构到达目的线卡后,通过线卡的哪一个端口发送出去;第一个表项和第二个表项的bit63~0里存储的是下一跳目的地址,如果是普通IPv6转发,则下一跳的IP地址是128位,如果是IPv4转发,则下一跳的IP地址是32位,此时只有第二个表项的bit31~0位有效;标识位等于000时,数据包以IPv4转发,等于001时,数据包被丢弃,等于010时,数据包被上交给CPU控制单元,等于011时,数据包以普通IPv6转发,等于100时,数据包以IPv6隧道转发;SRAM第三和第四个表项的bit63~0里存储的是IPv4数据包以IPv6隧道方式转发时,IPv6隧道末端出口路由器的128位IPv6目的地址。The structure of each routing entry supported by the SRAM single-port memory used by the system is shown in Figure 10:
整个系统的工作流程如下:The workflow of the whole system is as follows:
1)IP包输入接口电路从物理和数据链路层处理电路读取经过处理的PPP协议数据包和数据源端口编号,经过处理的PPP协议数据包只含有协议域、信息域和填充域,PPP数据包的其它部分已经在上级电路被剔除了。根据PPP包的16位协议编号,提取其中的纯IPv6或IPv4数据包,将去掉PPP 16位协议域和填充域的纯IPv6报文或IPv4报文发送到包过滤电路。1) The IP packet input interface circuit reads the processed PPP protocol data packet and data source port number from the physical and data link layer processing circuit. The processed PPP protocol data packet only contains the protocol field, the information field and the padding field. PPP The other parts of the data packet have already been discarded by the higher-level circuit. According to the 16-bit protocol number of the PPP packet, the pure IPv6 or IPv4 data packet is extracted, and the pure IPv6 message or IPv4 message with the PPP 16-bit protocol field and the filling field removed is sent to the packet filtering circuit.
2)包过滤电路接收IPv4和IPv6数据包,如果接收的是单播IPv4数据包,则对IPv4包的生存时间TTL域进行检查,如果其TTL为0,则将该IPv4数据包丢弃;如果TTL大于1,则对IPv4数据包的TTL域进行减1操作,如果减1后,TTL等于0,则将该IPv4数据包发送给第0个上交包队列存储器FIFO;如果接收的IPv4数据包是多播数据,也发送给第0个上交包队列存储器FIFO;如果接收的单播IPv4包的TTL不为0,TTL进行减1操作后得到的TTL也不为0,则让该IPv4包完成TTL减1操作,重新生成新的首部校验和后让该包通过,发送给下一级包输入队列存储器FIFO。2) Packet filter circuit receives IPv4 and IPv6 data packet, if what receive is unicast IPv4 data packet, then the time-to-live TTL field of IPv4 packet is checked, if its TTL is 0, then this IPv4 data packet is discarded; If TTL If it is greater than 1, subtract 1 from the TTL domain of the IPv4 data packet. If the TTL is equal to 0 after subtracting 1, the IPv4 data packet will be sent to the 0th handover packet queue memory FIFO; if the received IPv4 data packet is Multicast data is also sent to the 0th handover packet queue memory FIFO; if the TTL of the received unicast IPv4 packet is not 0, and the TTL obtained after the TTL is subtracted by 1 is also not 0, let the IPv4 packet complete TTL minus 1 operation, regenerate a new header checksum, let the packet pass, and send it to the next-level packet input queue memory FIFO.
包过滤电路接收的IPv6数据包分三种:单播、多播、任播。在后续的处理中,本系统对任播的处理和单播一样,所有对单播的处理方式也同时应用于任播,但不再说明。There are three types of IPv6 data packets received by the packet filtering circuit: unicast, multicast, and anycast. In the subsequent processing, the processing of anycast in this system is the same as that of unicast, and all the processing methods for unicast are also applied to anycast, but will not be described again.
包过滤电路接收到IPv6包后,首先查看包的跳数限制,如果它的跳数限制为0,就将该IPv6包丢弃;如果它的跳数限制大于或等于1,则将跳数限制进行减1操作,如果减1后,跳数为0,则将该IPv6数据包发送给第0个上交包队列存储器FIFO;如果跳数减1后,跳数仍然不为0,包过滤电路就对该IPv6包目的地址进行检查;如果是多播包就发送给第0个上交包队列存储器FIFO。After the packet filter circuit receives the IPv6 packet, it first checks the hop limit of the packet, and if its hop limit is 0, the IPv6 packet is discarded; if its hop limit is greater than or equal to 1, then the hop limit is removed. Subtract 1 operation, if after subtracting 1, the hop count is 0, then send the IPv6 data packet to the 0th handover packet queue memory FIFO; if the hop count is still not 0 after the hop count is decremented by 1, the packet filtering circuit will The destination address of the IPv6 packet is checked; if it is a multicast packet, it is sent to the 0th handover packet queue memory FIFO.
如果接收的IPv6数据包的目的地址是本路由器,分两种情况,第一种是情况:该数据包不是IPv6隧道包,则发送给第0个上交包队列存储器FIFO;第二种是情况:该数据包是隧道包,那么小于61字节的包都丢弃,不小于61字节的就发送给下一级包输入队列存储器FIFO。If the destination address of the received IPv6 data packet is the router, there are two cases, the first is the case: the data packet is not an IPv6 tunnel packet, then it will be sent to the 0th handover packet queue memory FIFO; the second is the case : The data packet is a tunnel packet, then the packets smaller than 61 bytes are all discarded, and those not smaller than 61 bytes are sent to the next-level packet input queue memory FIFO.
如果接收的IPv6数据包的目的地址不是本路由器,也分两种情况:第一种情况是该数据包是IPv6隧道包,那么小于61字节的包都丢弃,不小于61字节的就发送给下一级包输入队列存储器FIFO;第二种情况是该数据包不是IPv6隧道数据包,则对数据包的大小不进行检查直接发送给下一级包输入队列存储器FIFO。If the destination address of the received IPv6 data packet is not the router, there are two cases: the first case is that the data packet is an IPv6 tunnel packet, then the packet smaller than 61 bytes will be discarded, and the packet not smaller than 61 bytes will be sent Input the queue storage FIFO to the next-level packet; the second case is that the data packet is not an IPv6 tunnel data packet, then the size of the data packet is not checked and directly sent to the next-level packet input queue storage FIFO.
3)IPv6协议封装电路通过包输入队列存储器FIFO接口电路读取数据包,根据IP数据的版本号,包输入队列存储器FIFO接口电路知道读入的数据是IPv4数据包还是IPv6数据包。3) The IPv6 protocol encapsulation circuit reads the data packet through the packet input queue memory FIFO interface circuit, and according to the version number of the IP data, the packet input queue memory FIFO interface circuit knows whether the data read in is an IPv4 data packet or an IPv6 data packet.
如果是IPv4数据,在状态控制机电路的控制下,包输入队列存储器FIFO接口电路读取IPv4包头数据,并将其保存在IPv4包头数据寄存器中,IPv4包头数据寄存器中的数据又输出给IPv4包头转IPv6隧道包头电路。IPv4包头转IPv6隧道包头电路对应每一个IPv4包头,生成一个IPv6封装包头:IPv6包头的源地址就是本路由器的IPv6地址,包头目的地址最高96位bit127~32置0,最低32位就是当前处理的IPv4数据包的目的地址,包头下一个首部域设置为十进制的101,跳数限制设为十进制的64,包的流量类别设置为0,流标号置0。生成的IPv6包头发送到IPv6隧道包头数据寄存器中。多路数据选择器将保存在IPv6隧道包头数据寄存器中的IPv6包头和保存在IPv4包头数据寄存器中的数据依次选通发送到下一级的IPv6包队列存储器FIFO中,与此同时包输入队列存储器FIFO接口电路继续读取IPv4数据包的负载部分,并将它们保存在IPv4负载数据寄存器中,在发送完IPv4包头数据寄存器中的数据后,多路数据选择器立即选通IPv4负载数据寄存器的输出,这样IPv6隧道包就像流水一样不断线地发送到下一级的IPv6包队列存储器FIFO中。If it is IPv4 data, under the control of the state control machine circuit, the packet input queue memory FIFO interface circuit reads the IPv4 packet header data, and saves it in the IPv4 packet header data register, and the data in the IPv4 packet header data register is output to the IPv4 packet header Transfer to IPv6 tunnel header circuit. The IPv4 header-to-IPv6 tunnel header circuit corresponds to each IPv4 header and generates an IPv6 encapsulation header: the source address of the IPv6 header is the IPv6 address of the router, the highest 96 bits of the header destination address are set to 0, and the lowest 32 bits are currently processed The destination address of the IPv4 data packet, the next header field of the packet header is set to 101 in decimal, the hop limit is set to 64 in decimal, the traffic type of the packet is set to 0, and the flow label is set to 0. The generated IPv6 header is sent to the IPv6 tunnel header data register. The data in the IPv6 packet header stored in the IPv6 tunnel packet header data register and the data stored in the IPv4 packet header data register are sequentially selected and sent to the next-level IPv6 packet queue memory FIFO by the multiplexer, and at the same time, the packet is input into the queue memory The FIFO interface circuit continues to read the load part of the IPv4 data packet and save them in the IPv4 load data register. After sending the data in the IPv4 header data register, the multiplexer immediately selects the output of the IPv4 load data register , so that the IPv6 tunnel packet is continuously sent to the next-level IPv6 packet queue memory FIFO like a pipeline.
如果是IPv6隧道包,包输入队列存储器FIFO接口电路读取IPv6头,并将IPv6头丢弃,紧接着读取IPv6隧道包的IPv4包头数据,并将其保存在IPv4包头数据寄存器中,IPv4包头数据寄存器中的数据又输出给IPv4包头转IPv6隧道包头电路。在状态控制机电路的控制下,IPv4包头转IPv6隧道包头电路对应每一个IPv4包头,又生成一个IPv6封装包头:IPv6包头的源地址就是本路由器的IPv6地址,包头目的地址最高96位bit127~32置0,最低32位就是当前处理的IPv4数据包的目的地址,包头下一个首部域设置为十进制的101,跳数限制设为十进制的2,包的流量类别设置为0,流标号置0。生成的IPv6包头发送到IPv6隧道包头数据寄存器中。多路数据选择器将保存在IPv6隧道包头数据寄存器中的IPv6包头和保存在IPv4包头数据寄存器中的数据依次选通发送到下一级的IPv6包队列存储器FIFO中,与此同时包输入队列存储器FIFO接口电路继续读取IPv6隧道包的IPv4数据负载部分,并将它们保存在IPv4负载数据寄存器中,在发送完IPv4包头数据寄存器中的数据后,多路数据选择器立即选通IPv4负载数据寄存器的输出,这样已经更新的IPv6隧道包就像流水一样不断线地发送到下一级的IPv6包队列存储器FIFO中。If it is an IPv6 tunnel packet, the packet input queue memory FIFO interface circuit reads the IPv6 header, and discards the IPv6 header, and then reads the IPv4 packet header data of the IPv6 tunnel packet, and stores it in the IPv4 packet header data register, and the IPv4 packet header data The data in the register is output to the IPv4 header-to-IPv6 tunnel header circuit. Under the control of the state control machine circuit, the IPv4 header-to-IPv6 tunnel header circuit corresponds to each IPv4 header, and generates an IPv6 encapsulation header: the source address of the IPv6 header is the IPv6 address of the router, and the destination address of the header is up to 96 bits bit127~32 Set to 0, the lowest 32 bits are the destination address of the currently processed IPv4 data packet, the next header field of the packet header is set to 101 in decimal, the hop limit is set to 2 in decimal, the traffic type of the packet is set to 0, and the flow label is set to 0. The generated IPv6 header is sent to the IPv6 tunnel header data register. The data in the IPv6 packet header stored in the IPv6 tunnel packet header data register and the data stored in the IPv4 packet header data register are sequentially selected and sent to the next-level IPv6 packet queue memory FIFO by the multiplexer, and at the same time, the packet is input into the queue memory The FIFO interface circuit continues to read the IPv4 data load part of the IPv6 tunnel packet and saves them in the IPv4 load data register. After sending the data in the IPv4 header data register, the multiplexer selects the IPv4 load data register immediately The output of the IPv6 tunnel packet that has been updated like this is continuously sent to the IPv6 packet queue memory FIFO of the next level like a pipeline.
包输入队列存储器FIFO接口电路读取的IPv6数据包如果不是隧道包,则不对IPv6数据包进行任何处理,只将它暂存在IPv6数据寄存器中,通过多路数据选择器,直接将它传送到下一级的IPv6包队列存储器FIFO。If the IPv6 data packet read by the packet input queue memory FIFO interface circuit is not a tunnel packet, no processing is performed on the IPv6 data packet, it is only temporarily stored in the IPv6 data register, and it is directly transmitted to the next channel through the multiplex data selector. One-level IPv6 packet queue memory FIFO.
4)包相关信息提取电路通过IPv6包队列存储器FIFO接口电路从IPv6包队列存储器FIFO中读取IPv6数据包,每一个节拍读40位,其中8位是边带信息,32位是IP数据包。IPv6包队列存储器FIFO接口电路中有一个节拍计算器、一个包计算器,节拍计算器记录接收的数据包节拍数,每个节拍含32位IP数据,包计算器记录接收的数据包个数。系统初始化时,节拍计算器和包计算器被清0。IPv6包队列存储器FIFO接口电路接收一个数据包时,该数据包第一节拍数据对应的节拍计算器值,就是该IPv6数据包在IPv6存储器RAM中保存的起始地址,数据包最后一节拍数据对应的计算器值,就是该数据包在IPv6存储器RAM中保存的终止地址。每接收一节拍数据后,计算器值加1。数据包的起始地址和终止地址被输出,分别保存在包起始地址寄存器、包终止地址寄存器中。相应地,接收一个数据包时,该数据包第一节拍数据对应的包计算器值,就是该数据包对应的序列号,该序列号被输出给包序列号寄存器保存。每接收完一个数据包,包计算器值加1,包计算器加1是在接收数据包的最后一个节拍之后发生的。4) The packet-related information extraction circuit reads the IPv6 data packet from the IPv6 packet queue memory FIFO through the IPv6 packet queue memory FIFO interface circuit, and each beat reads 40 bits, wherein 8 bits are side information, and 32 bits are IP packets. The IPv6 packet queue memory FIFO interface circuit has a beat calculator and a packet calculator. The beat calculator records the number of beats of the received data packets. Each beat contains 32 bits of IP data. The packet calculator records the number of received packets. When the system is initialized, the beat counter and packet counter are cleared to 0. When the IPv6 packet queue memory FIFO interface circuit receives a data packet, the beat calculator value corresponding to the first beat data of the data packet is exactly the starting address of the IPv6 data packet stored in the IPv6 memory RAM, and the last beat data of the data packet corresponds to The calculator value of is the termination address of the data packet stored in the IPv6 memory RAM. After each beat data is received, the counter value is increased by 1. The start address and end address of the data packet are output and stored in the packet start address register and the packet end address register respectively. Correspondingly, when a data packet is received, the packet calculator value corresponding to the first beat data of the data packet is the serial number corresponding to the data packet, and the serial number is output to the packet serial number register for storage. Each time a data packet is received, the value of the packet counter is increased by 1, and the increment of the packet counter by 1 occurs after the last beat of the received data packet.
在状态控制机电路的作用下,IPv6包队列存储器FIFO接口电路通过包写入RAM电路,将接收的IPv6包发送到与包相关信息提取电路相连的IPv6数据包存储器RAM,IPv6数据包存储器RAM是一个读写与时钟同步的双端口RAM存储器,一个端口专门用来写数据,一个端口专门用来读数据。Under the action of the state control machine circuit, the IPv6 packet queue memory FIFO interface circuit writes the IPv6 packet into the RAM circuit through the packet, and sends the received IPv6 packet to the IPv6 packet memory RAM connected with the packet-related information extraction circuit, and the IPv6 packet memory RAM is A dual-port RAM memory that reads and writes synchronously with the clock, one port is dedicated to writing data, and one port is dedicated to reading data.
在状态控制机电路的作用下,IPv6包队列存储器FIFO接口电路提取数据包的源端口编号,并将源端口编号发送到源端口编号寄存器。对于接收的IPv6数据包,如果它的下一个首部域是0,则置上交标识,并将该上交标识输出给包上交标识寄存器,在该寄存器中进行保存。Under the action of the state control machine circuit, the IPv6 packet queue memory FIFO interface circuit extracts the source port number of the data packet, and sends the source port number to the source port number register. For the received IPv6 data packet, if its next header field is 0, set the handover flag, and output the handover flag to the packet handover flag register, and save it in the register.
在状态控制机电路的作用下,IPv6包队列存储器FIFO接口电路提取包的流量类别保存在包优先级寄存器中。如果IPv6包是隧道包,就将隧道标识寄存器置1,否则置0。Under the action of the state control machine circuit, the IPv6 packet queue memory FIFO interface circuit extracts the traffic category of the packet and saves it in the packet priority register. If the IPv6 packet is a tunnel packet, set the tunnel identification register to 1, otherwise set to 0.
包上交标识寄存器、包优先级寄存器、包源端口号寄存器、包终止地址寄存器、包起始地址寄存器、包序列号寄存器的值输出给IPv6包信息发送电路,IPv6信息发送电路在状态控制机电路控制下,将数据发送给与包相关信息提取电路相连的IPv6数据包相关信息队列存储器FIFO。The value of the packet handover identification register, packet priority register, packet source port number register, packet termination address register, packet start address register, and packet serial number register is output to the IPv6 packet information sending circuit, and the IPv6 information sending circuit is in the state control machine Under the control of the circuit, the data is sent to the IPv6 data packet-related information queue memory FIFO connected with the packet-related information extraction circuit.
CAM工作受它的命令总线和请求数据总线控制,检索指令发送电路生成CAM命令总线控制数据:请求选通信号REQSTB、操作指令类型信号INST、查找类型信号LTIN、段选信号SEGSEL、掩码寄存器选择信号GMASK,CAM命令总线控制数据由检索指令发送电路发送到检索指令队列存储器FIFO。The work of CAM is controlled by its command bus and request data bus. The retrieval instruction sending circuit generates CAM command bus control data: request strobe signal REQSTB, operation instruction type signal INST, search type signal LTIN, segment selection signal SEGSEL, mask register selection The signal GMASK, CAM command bus control data is sent to the retrieval instruction queue memory FIFO by the retrieval instruction sending circuit.
包序列号寄存器、隧道标识寄存器和包目的地址寄存器经检索指令发送电路发送给与包相关信息提取电路相连的检索指令队列存储器FIFO,其中隧道标识寄存器和包目的地址寄存器保存的数据对应CAM数据总线输入的72位宽度REQDATA数据,用来进行CAM查找。The packet serial number register, tunnel identification register and packet destination address register are sent to the retrieval instruction queue memory FIFO connected with the packet-related information extraction circuit through the retrieval instruction sending circuit, wherein the data stored in the tunnel identification register and the packet destination address register correspond to the CAM data bus The input 72-bit wide REQDATA data is used for CAM lookup.
5)CAM控制电路内部的检索指令队列存储器FIFO接口电路从检索指令队列存储器FIFO中读取检索指令,并将REQDATA数据写入CAM写入数据寄存器。CAM存储器的操作受命令总线的控制,因此读取的总线控制命令REQSTB、INST、LTIN、SEGSEL、GMASK写入CAM操作指令发送电路。检索指令队列存储器FIFO接口电路还将检索指令对应的数据包序列号保存到数据包序列号存储器中。5) The retrieval instruction queue memory FIFO interface circuit inside the CAM control circuit reads the retrieval instruction from the retrieval instruction queue memory FIFO, and writes the REQDATA data into the CAM write data register. The operation of the CAM memory is controlled by the command bus, so the read bus control commands REQSTB, INST, LTIN, SEGSEL, GMASK are written into the CAM operation instruction sending circuit. The FIFO interface circuit of the retrieval instruction queue memory also saves the data packet serial number corresponding to the retrieval instruction into the data packet serial number memory.
CAM表项和SRAM表项初始化完成后,在CAM运行的过程中,操作系统要不断地对CAM表项和SRAM表项进行删除、添加等操作,这些操作是CPU通过CPU接口电路向CAM维护指令队列存储器FIFO发送CAM维护指令来完成的。CAM控制电路通过CAM维护指令队列存储器FIFO接口电路读取CAM维护指令队列存储器FIFO的CAM维护指令,并将REQDATA数据写入CAM写入数据寄存器,读取的总线控制命令REQSTB、INST、LTIN、SEGSEL、GMASK写入CAM操作指令发送电路。CAM维护指令队列存储器FIFO接口电路还将需要写的SRAM表项保存在SRAM写入数据寄存器中。After the initialization of CAM entries and SRAM entries is completed, during the operation of CAM, the operating system must continuously delete and add operations to CAM entries and SRAM entries. These operations are maintenance instructions from the CPU to the CAM through the CPU interface circuit. The queue memory FIFO sends CAM maintenance instructions to complete. The CAM control circuit reads the CAM maintenance instruction of the CAM maintenance instruction queue memory FIFO through the CAM maintenance instruction queue memory FIFO interface circuit, and writes the REQDATA data into the CAM write data register, and reads the bus control commands REQSTB, INST, LTIN, SEGSEL , GMASK is written into the CAM operation instruction sending circuit. The CAM maintenance instruction queue memory FIFO interface circuit also saves the SRAM entries that need to be written in the SRAM write data register.
在状态控制机电路的作用下,CAM数据总线读写控制电路和SRAM读写数据总线控制电路把对应的表项写入CAM和SRAM存储器中,或将查找的结果输出给CAM读出数据寄存器、SRAM读出数据寄存器。如果是对CAM进行维护操作,CPU读出数据寄存器将读取的CAM和SRAM数据发送给CPU接口电路,通过CPU接口电路上交CPU。如果对CAM进行操作的指令来自检索指令队列存储器FIFO接口电路,则将SRAM检索的结果以及数据包序列号寄存器保存的序列号输出到检索结果寄存器,通过检索结果寄存器发送到与CAM控制电路相连的检索结果队列存储器FIFO。Under the action of the state control machine circuit, the CAM data bus read-write control circuit and the SRAM read-write data bus control circuit write the corresponding entries into the CAM and SRAM memory, or output the result of the search to the CAM read-out data register, SRAM read data register. If the maintenance operation is performed on the CAM, the CPU reads the data register and sends the read CAM and SRAM data to the CPU interface circuit, and hands it over to the CPU through the CPU interface circuit. If the command to operate the CAM comes from the retrieval instruction queue memory FIFO interface circuit, the result of the SRAM retrieval and the sequence number stored in the data packet sequence number register are output to the retrieval result register, and sent to the CAM control circuit through the retrieval result register. Retrieve result queue memory FIFO.
6)包发送电路通过IPv6数据包相关信息队列存储器FIFO接口电路,读取包在IPv6数据包存储器RAM中存储的起始地址、终止地址、上交标识以及数据包序列号,并将终止地址保存在终止地址寄存器中。检索结果队列存储器FIFO接口电路,读取检索结果队列存储器FIFO,根据标识位和IPv6数据包相关信息队列存储器FIFO接口电路得到的上交标识位,状态机控制电路知道包发送电路对数据包进行处理方式要么是按照IPv4转发,要么是将数据包上交,要么是将数据包丢弃,要么是按照普通IPv6转发该数据包,要么是按照IPv6隧道方式转发该数据包。此外如果经由IPv6数据包相关信息队列存储器FIFO接口电路和检索结果队列存储器FIFO接口电路得到的数据包序列号分别保存到4位的包序列号寄存器A和包序列号寄存器B,包序列号寄存器A和包序列号寄存器B中的数据输入到数据比较器B,如果比较的结果是两个数据不相等,说明系统出现错误,数据比较器B向CPU接口电路发送指示信号,通过CPU接口电路对整个系统进行复位。复位之后按照上面的方法对系统进行初始化。6) The packet sending circuit reads the start address, the termination address, the hand-over identification and the packet sequence number stored in the IPv6 packet memory RAM by the IPv6 data packet related information queue memory FIFO interface circuit, and saves the termination address in the end address register. The retrieval result queue storage FIFO interface circuit reads the retrieval result queue storage FIFO, according to the identification bit and the handover identification bit obtained by the IPv6 data packet-related information queue storage FIFO interface circuit, the state machine control circuit knows that the packet sending circuit processes the data packet The method is either forwarding according to IPv4, or handing over the data packet, or discarding the data packet, or forwarding the data packet according to ordinary IPv6, or forwarding the data packet according to the IPv6 tunnel mode. In addition, if the data packet serial number obtained via the IPv6 data packet-related information queue memory FIFO interface circuit and the retrieval result queue memory FIFO interface circuit are respectively saved to 4-bit packet serial number register A and packet serial number register B, the packet serial number register A And the data in the packet serial number register B is input to the data comparator B, if the result of the comparison is that the two data are not equal, it means that there is an error in the system, and the data comparator B sends an indication signal to the CPU interface circuit, through the CPU interface circuit. The system resets. After reset, initialize the system according to the above method.
IPv6数据包相关信息队列存储器FIFO接口电路从IPv6数据包相关信息队列存储器FIFO读取数据包长度、包优先级、源端口编号,并将其分别保存在数据包长度寄存器、包优先级寄存器、源端口编号寄存器中。检索结果队列存储器FIFO接口电路读取目的端口编号、目的线卡编号、下一跳IPv6或IPv4地址、隧道IPv6目的地址,分别将它们保存在目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv6寄存器或IPv4地址寄存器、隧道IPv6目的地址寄存器中。IPv6 data packet related information queue memory FIFO interface circuit reads data packet length, packet priority, source port numbering from IPv6 data packet related information queue memory FIFO, and it is respectively stored in data packet length register, packet priority register, source in the port number register. The retrieval result queue memory FIFO interface circuit reads the destination port number, the destination line card number, the next hop IPv6 or IPv4 address, and the tunnel IPv6 destination address, and stores them in the destination port number register, the destination line card number register, and the next hop address respectively. IPv6 register or IPv4 address register, tunnel IPv6 destination address register.
如果数据按照IPv4转发,则将包长度寄存器、包优先级寄存器、源线卡编号寄存器、源端口编号寄存器、目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv4寄存器输出的值,保存在3个位宽为36位的附加数据寄存器组中。在状态控制机的作用下,多路选择器B分3拍将3个位宽为36位的附加数据寄存器组中的数据发送出去,这些数据作为IPv4数据包的附加数据头,添加在IPv4数据包的前面,发送给上行FIFO。If the data is forwarded according to IPv4, the values output by the packet length register, packet priority register, source line card number register, source port number register, destination port number register, destination line card number register, and next-hop IPv4 register are stored in 3 additional data registers with a bit width of 36 bits. Under the action of the state control machine, the multiplexer B divides into 3 beats to send the data in the 3 additional data register groups with a bit width of 36 bits. These data are added to the IPv4 data packet as the additional data header of the IPv4 data packet. The front of the packet is sent to the upstream FIFO.
紧接IPv4附加数据头的就是IPv4数据包,在状态控制机电路的作用下,增10加法器从输入端接收包存储起始地址,对该地址值实现加10操作,并将结果输出给地址寄存器A进行保存,多路数据选择器A选择地址寄存器A中的数据输出给IPv6数据包存储器RAM读地址寄存器,读地址寄存器将读地址发送给IPv6数据包存储器RAM读端口的读地址总线。IPv6数据包存储器RAM将读得的数据发送给位宽为36位的IP数据寄存器,多路选择器B选通位宽为36位的IP数据寄存器,这样IPv4数据包第一拍数据就紧随IPv4的附加数据头发送给上行FIFO。Next to the IPv4 additional data header is the IPv4 data packet. Under the action of the state control machine circuit, the 10 adder receives the packet from the input end to store the starting address, adds 10 to the address value, and outputs the result to the address The register A saves, and the multiplexer A selects the data in the address register A to output to the IPv6 packet memory RAM read address register, and the read address register sends the read address to the read address bus of the IPv6 packet memory RAM read port. The IPv6 data packet memory RAM sends the read data to the IP data register with a bit width of 36 bits, and the multiplexer B selects the IP data register with a bit width of 36 bits, so that the first beat data of the IPv4 data packet is followed by Additional data headers for IPv4 are sent to the upstream FIFO.
在状态控制机电路的作用下,增1加法器读取IPv6数据包存储器RAM读地址寄存器的值,对该地址进行加1运算后提交给地址寄存器C。多路数据选择器A选通地址寄存器C中的数据,将该数据交给IPv6数据包存储器RAM读地址寄存器。此后系统运行的过程和发送IPv4数据包第一拍数据时一样。Under the action of the state control machine circuit, the increment adder reads the value of the IPv6 data packet memory RAM read address register, adds 1 to the address and submits it to the address register C. The multiplexer A selects the data in the address register C, and hands the data to the IPv6 data packet memory RAM to read the address register. Afterwards, the process of the system running is the same as when sending the first beat of the IPv4 data packet.
每个时钟周期,数据比较器A将输入的IPv6数据包存储器RAM读地址寄存器值和输入的包存储终止地址寄存器的值进行比较,如果两者相等,说明该数据包的数据已经全部输出。如果包存储器电路中还有别的数据,在状态控制机的作用下,包发送电路对后续的数据包也进行同样的处理。Each clock cycle, the data comparator A compares the value of the input IPv6 data packet memory RAM read address register with the value of the input packet storage end address register, and if the two are equal, it means that the data of the data packet has all been output. If there are other data in the packet memory circuit, under the action of the state control machine, the packet sending circuit also performs the same processing on subsequent data packets.
如果数据按照普通IPv6转发,包发送电路的工作过程和转发IPv4数据包的工作过程总体相似,只有小部分不一样。不一样的部分是:If the data is forwarded according to ordinary IPv6, the working process of the packet sending circuit is generally similar to the working process of forwarding IPv4 data packets, only a small part is different. The different parts are:
(1)如果数据按照普通IPv6转发,则将包长度寄存器、包优先级寄存器、源线卡编号寄存器、源端口编号寄存器、目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv6寄存器输出的值,保存在6个位宽为36位的附加数据寄存器组中。在状态控制机的作用下,多路选择器B分6拍将6个位宽为36位附加数据寄存器组中的东西发送出去,这些数据作为IPv6数据包的附加数据头,添加在IPv6数据包的前面,交给下一级上行FIFO。(1) If the data is forwarded according to ordinary IPv6, then output the packet length register, packet priority register, source line card number register, source port number register, destination port number register, destination line card number register, and next-hop IPv6 register value, stored in six additional data register banks with a width of 36 bits. Under the action of the state control machine, the multiplexer B divides into 6 beats to send the contents of the 36-bit additional data register group with a bit width of 6. These data are added to the IPv6 data packet as the additional data header of the IPv6 data packet. to the front of the next level uplink FIFO.
(2)IPv6数据包的第一拍数据的地址是通过包存储起始地址发送给地址寄存器B,再通过多路数据选择器A发送给IPv6数据包存储器RAM读地址寄存器,不能通过增10加法器进行加10操作。(2) The address of the first shot data of the IPv6 data packet is sent to the address register B through the packet storage start address, and then sent to the IPv6 data packet memory RAM to read the address register through the multiplexer A, which cannot be increased by 10. The device adds 10 to the operation.
如果数据按照IPv6隧道转发,包发送电路的工作过程和转发IPv6数据包的工作过程总体相似,只有小部分不一样。不一样的部分是:如果数据按照IPv6转发,则将包长度寄存器、包优先级寄存器、源线卡编号寄存器、源端口编号寄存器、目的端口编号寄存器、目的线卡编号寄存器、下一跳IPv6寄存器、隧道IPv6目的地址寄存器输出的值,保存在10个位宽为36位的附加数据寄存器组中;在状态控制机的作用下,在发送隧道IPv6数据包时,隧道包128位的IPv6目的地址,来自于IPv6协议封装电路,在这里要用位宽为36位附加数据寄存器组中保存的通过CAM查表得到的隧道IPv6目的地址取代。If the data is forwarded according to the IPv6 tunnel, the working process of the packet sending circuit is generally similar to the working process of forwarding the IPv6 data packet, only a small part is different. The different part is: if the data is forwarded according to IPv6, the packet length register, packet priority register, source line card number register, source port number register, destination port number register, destination line card number register, next hop IPv6 register 1. The value output by the tunnel IPv6 destination address register is stored in 10 additional data register groups whose bit width is 36 bits; , comes from the IPv6 protocol encapsulation circuit, and shall be replaced here by the tunnel IPv6 destination address obtained through the CAM look-up table stored in the additional data register set with a bit width of 36 bits.
如果数据不进行IPv4、普通IPv6转发、IPv6隧道转发,还是进行上交,包发送电路的工作过程和转发IPv6数据包的工作过程总体相似,只有小部分不一样。不一样的地方是:If the data is not forwarded by IPv4, ordinary IPv6, or IPv6 tunnel, but is still handed over, the working process of the packet sending circuit is generally similar to the working process of forwarding IPv6 data packets, only a small part is different. The difference is:
(1)IPv6数据包的上交时,IPv6数据包的附加数据只有一拍,附加数据只含有源线卡编号和源端口编号。不足36位的其它数据用0来填充。(1) When the IPv6 data packet is handed over, the additional data of the IPv6 data packet is only one beat, and the additional data only includes the source line card number and the source port number. Other data less than 36 bits are filled with 0.
(2)通过多路数据选择器B选择的数据发送给上交数据包寄存器,通过上交数据包寄存器发送给第1个上交包队列存储器FIFO。(2) The data selected by the multiplexer B is sent to the handover data packet register, and then sent to the first handover packet queue memory FIFO through the handover data packet register.
如果数据不进行IPv4、普通IPv6转发、IPv6隧道转发,也不需要上交,还是丢弃,在状态控制机电路的作用下,包发送电路不再对IPv6数据包存储器RAM进行任何操作。多路数据选择器A和多路数据选择器B也不进行任何操作。If the data does not carry out IPv4, ordinary IPv6 forwarding, IPv6 tunnel forwarding, it does not need to be handed over, or discarded, under the action of the state control machine circuit, the packet sending circuit no longer performs any operation on the IPv6 data packet memory RAM. Demultiplexer A and demultiplexer B also do nothing.
跟在被丢弃数据包后面如果还有别的数据包,则状态控制机电路指示IPv6数据包相关信息队列存储器FIFO接口电路和检索结果队列存储器FIFO接口电路提取下一个数据包的转发信息,根据转发信息的标识按照上面所说的方式进行数据包的转发、上交、丢弃处理。If there are other data packets following the discarded data packet, the state control machine circuit instructs the IPv6 data packet related information queue memory FIFO interface circuit and the retrieval result queue memory FIFO interface circuit to extract the forwarding information of the next data packet, according to forwarding The identification of information carries out forwarding, handing over, and discarding processing of data packets according to the above-mentioned manner.
7)只要第0个上交包队列存储器FIFO或第1个上交包队列存储器FIFO不空,上交包发送电路就能轮流从不空的第0个上交包队列存储器FIFO和第1个上交包队列存储器FIFO中读取数据包发送给SRAM双端口存储器,当SRAM双端口存储器中存储的上交数据包字节数达到一定门槛值,或接收一个数据包后一段时间内没有收到新数据包时,上交包发送电路就向CPU接口电路发送中断信号,并将上交数据包在双端口存储器RAM中存储的起始地址、终止地址以及待传送数据的长度传送给CPU接口电路,CPU接口电路将中断信号传送给CPU,如果CPU不忙,就对中断请求进行相应,启动上交包数据传送,CPU接口电路将上交数据包从SRAM双端口存储器中读出来,再发送给CPU进行处理。7) As long as the 0th handover packet queue memory FIFO or the first handover packet queue memory FIFO is not empty, the handover packet sending circuit can take turns from the non-empty 0th handover packet queue memory FIFO and the first handover packet queue memory FIFO The data packet read from the FIFO of the handover packet queue memory is sent to the SRAM dual-port memory. When the number of bytes of the handover data packet stored in the SRAM dual-port memory reaches a certain threshold, or a data packet is not received within a period of time after receiving a data packet When a new data packet is received, the handover packet sending circuit sends an interrupt signal to the CPU interface circuit, and transmits the start address, the end address and the length of the data to be transmitted of the handover data packet stored in the dual-port memory RAM to the CPU interface circuit , the CPU interface circuit transmits the interrupt signal to the CPU. If the CPU is not busy, it responds to the interrupt request and starts the handover packet data transmission. The CPU interface circuit reads the handover data packet from the SRAM dual-port memory and sends it to The CPU does the processing.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100935323A CN101692647B (en) | 2009-10-12 | 2009-10-12 | Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009100935323A CN101692647B (en) | 2009-10-12 | 2009-10-12 | Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101692647A true CN101692647A (en) | 2010-04-07 |
CN101692647B CN101692647B (en) | 2012-03-14 |
Family
ID=42081305
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009100935323A Expired - Fee Related CN101692647B (en) | 2009-10-12 | 2009-10-12 | Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101692647B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103329507A (en) * | 2011-04-01 | 2013-09-25 | 西门子企业通讯有限责任两合公司 | Method for addressing messages in a computer network |
CN103885850A (en) * | 2013-03-01 | 2014-06-25 | 上海富欣智能交通控制有限公司 | Online inspection system and online inspection method for memorizer |
CN104794090A (en) * | 2014-01-22 | 2015-07-22 | 北京浩正泰吉科技有限公司 | Remote terminal module |
CN104917634A (en) * | 2015-04-27 | 2015-09-16 | 苏州大学 | Router card clock frequency determination method and device |
CN107615264A (en) * | 2015-03-16 | 2018-01-19 | 迈克尔·E·玛匝瑞克 | System and method for seamless conversion from IPv4 address to IPv6 address |
CN107967149A (en) * | 2011-12-23 | 2018-04-27 | 英特尔公司 | Mask register is write from source writing in destination, the systems, devices and methods of output masking are set in mask register |
CN108932110A (en) * | 2017-05-26 | 2018-12-04 | 希捷科技有限公司 | Method and apparatus for managing data in memory |
CN111124968A (en) * | 2019-12-05 | 2020-05-08 | 山东浪潮人工智能研究院有限公司 | Interconnection exchange method based on FPGA and RISC-V |
CN112260896A (en) * | 2020-10-16 | 2021-01-22 | 山东云海国创云计算装备产业创新中心有限公司 | Network transmission testing method, device, equipment and readable storage medium |
CN113377438A (en) * | 2021-08-13 | 2021-09-10 | 沐曦集成电路(上海)有限公司 | Processor and data reading and writing method thereof |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100388673C (en) * | 2003-07-18 | 2008-05-14 | 华为技术有限公司 | Method for implementing intra-site automatic tunnel |
CN100563241C (en) * | 2003-10-01 | 2009-11-25 | 华为技术有限公司 | The method that a kind of network transition inserts |
CN1564542A (en) * | 2004-04-20 | 2005-01-12 | 清华大学 | Tunnel set-up method for carrying out internet of IPV4 network on IPV6 network |
US7437470B2 (en) * | 2004-11-18 | 2008-10-14 | International Business Machines Corporation | Tunneling IPv6 packets |
-
2009
- 2009-10-12 CN CN2009100935323A patent/CN101692647B/en not_active Expired - Fee Related
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9401892B2 (en) | 2011-04-01 | 2016-07-26 | Unify Gmbh & Co. Kg | Method for addressing messages in a computer network |
US10158604B2 (en) | 2011-04-01 | 2018-12-18 | Unify Gmbh & Co. Kg | Method for addressing messages in a computer network |
CN103329507A (en) * | 2011-04-01 | 2013-09-25 | 西门子企业通讯有限责任两合公司 | Method for addressing messages in a computer network |
CN107967149A (en) * | 2011-12-23 | 2018-04-27 | 英特尔公司 | Mask register is write from source writing in destination, the systems, devices and methods of output masking are set in mask register |
CN107967149B (en) * | 2011-12-23 | 2021-12-10 | 英特尔公司 | System, apparatus and method for setting an output mask in a destination writemask register from a source writemask register |
CN103885850A (en) * | 2013-03-01 | 2014-06-25 | 上海富欣智能交通控制有限公司 | Online inspection system and online inspection method for memorizer |
CN104794090A (en) * | 2014-01-22 | 2015-07-22 | 北京浩正泰吉科技有限公司 | Remote terminal module |
CN107615264A (en) * | 2015-03-16 | 2018-01-19 | 迈克尔·E·玛匝瑞克 | System and method for seamless conversion from IPv4 address to IPv6 address |
CN107615264B (en) * | 2015-03-16 | 2020-12-29 | 迈克尔·E·玛匝瑞克 | System and method for seamless conversion from IPv4 address to IPv6 address |
CN104917634B (en) * | 2015-04-27 | 2018-03-02 | 苏州大学 | A kind of router card clock frequency determines method and device |
US10152110B2 (en) | 2015-04-27 | 2018-12-11 | Soochow University | Clock frequency determining method and device for router card |
CN104917634A (en) * | 2015-04-27 | 2015-09-16 | 苏州大学 | Router card clock frequency determination method and device |
WO2016173221A1 (en) * | 2015-04-27 | 2016-11-03 | 苏州大学张家港工业技术研究院 | Clock frequency determining method and device for router card |
CN108932110A (en) * | 2017-05-26 | 2018-12-04 | 希捷科技有限公司 | Method and apparatus for managing data in memory |
CN108932110B (en) * | 2017-05-26 | 2021-08-13 | 希捷科技有限公司 | Method and apparatus for managing data in memory |
CN111124968A (en) * | 2019-12-05 | 2020-05-08 | 山东浪潮人工智能研究院有限公司 | Interconnection exchange method based on FPGA and RISC-V |
CN112260896A (en) * | 2020-10-16 | 2021-01-22 | 山东云海国创云计算装备产业创新中心有限公司 | Network transmission testing method, device, equipment and readable storage medium |
CN113377438A (en) * | 2021-08-13 | 2021-09-10 | 沐曦集成电路(上海)有限公司 | Processor and data reading and writing method thereof |
CN113377438B (en) * | 2021-08-13 | 2021-11-30 | 沐曦集成电路(上海)有限公司 | Processor and data reading and writing method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN101692647B (en) | 2012-03-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101692647B (en) | Tunnel forwarding system in which IPv4 packets are encapsulated by IPv6 head in router | |
US6794896B1 (en) | Method and apparatus for multithreading | |
US7069372B1 (en) | Processor having systolic array pipeline for processing data packets | |
US7418536B2 (en) | Processor having systolic array pipeline for processing data packets | |
US7916632B1 (en) | Systems and methods for handling packet fragmentation | |
US6654823B2 (en) | Packet-data processing apparatus | |
US7773599B1 (en) | Packet fragment handling | |
WO2019164827A1 (en) | Programmable computer io device interface | |
US20040151170A1 (en) | Management of received data within host device using linked lists | |
US7782857B2 (en) | Logical separation and accessing of descriptor memories | |
US8085780B1 (en) | Optimized buffer loading for packet header processing | |
US8270399B2 (en) | Crossbar apparatus for a forwarding table memory in a router | |
US6891397B1 (en) | Gigabit router on a single programmable logic device | |
CN101291546A (en) | Core Router Switch Fabric Coprocessor | |
US20040049613A1 (en) | Balanced linked lists for high performance data buffers in a network device | |
JP2003508957A (en) | Network processor processing complex and method | |
CN111490969A (en) | Flexible header alteration in a network device | |
CN1327674C (en) | Double stack compatible router searching device supporting access control listing function on core routers | |
JPH09224041A (en) | Device and method for data packing by addition | |
US7551645B2 (en) | Apparatus and method to receive and align incoming data including SPI data in a buffer to expand data width by utilizing a single read port and single write port memory device | |
WO2002015484A1 (en) | System and method for transferring a packet from a port controller to a switch fabric | |
US7379451B1 (en) | Address lookup table | |
US7239630B1 (en) | Dedicated processing resources for packet header generation | |
US7319702B2 (en) | Apparatus and method to receive and decode incoming data and to handle repeated simultaneous small fragments | |
US7158520B1 (en) | Mailbox registers for synchronizing header processing execution |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120314 |