A kind of data fast forwarding method and system
Technical field
It is fast more particularly to a kind of data based on PON home gateway unit the present invention relates to data communication field
Fast retransmission method and system.
Background technology
As the development of the communication technology, Network increasingly diversity are also increasing to the demand of network bandwidth.Light
Fine access technology has the advantages that high bandwidth, long transmission distance, strong antijamming capability become Future Access Network technology because of it
Developing direction.
Passive optical-fiber network PON (Passive Optical Network) technology is a kind of point-to-multipoint intelligent acess
Technology.Whole PON is mainly by the light net of the optical line terminal OLT (Optical Line Terminal) of local side, user side
Network unit ONU (Optical Network Unit) and Optical Distribution Network ODN (Optical Distribution Network)
Form.Wherein, ODN parts are completely by passive optical splitter (Passive Optical Splitter, abbreviation POS) and optical fiber etc.
Passive device is formed.
With it, easily maintenance, high bandwidth, strong, the comprehensive networking low cost and other advantages of autgmentability become optical fiber and arrived PON
Family (Fiber To The Home, abbreviation FTTH), Fiber To The Building (Fiber To The Building, abbreviation FTTB) etc. light
A kind of fibre access currently used optimal system architecture of occasion.
At present, home gateway unit HGU (Home Gateway Unit) realizes data from LAN generally by CPU
LAN (Local Area Network) arrives wide area network WAN (Wide Area Network) forwarding, for example, DSL (Digital
Subscriber Line, digital subscriber line) or ordinary router, due to bandwidth requirement than relatively low, general tens,
So data after being received from physical network card, can transmit data to CPU by network process module, data are entered by CPU
Row processing, re-sends to purpose network interface card, so as to realize forwarding of the data from LAN to WAN after treating according to demand.
In the prior art, HGU data forwarding will pass through CPU always, so as to consume CPU always, so as to influence other things
The operation of part.Also, because current low profile edge CPU processing data ability is not powerful, the processing to data is limited, several
In the case of 10000000, CPU occupancy is just very high, has had a strong impact on the speed of HGU data forwardings, can not also meet PON
Requirement.
The content of the invention
In view of the above the shortcomings that prior art, it is an object of the invention to provide a kind of data fast forwarding method and
System, for solving in PON in the prior art, forwarding speed of the HGU data from LAN to WAN is slow, and CPU usage is high
Problem.
In order to achieve the above objects and other related objects, the present invention provides a kind of data fast forwarding method, applied to PON
The HGU of network, the data fast forwarding method include:Step S10, by the data buffer storage of reception to DMA receiving queues;Wherein
The data of reception include source address information;Step S20, according to the DMA receiving queues, the DMA is matched according to forwarding matching list
Data in receiving queue, obtain destination address information;And encapsulation of data again, it is forwarded to DMA transmit queues;Step S30, is pressed
According to the DMA transmit queues, the data Resealed are forwarded to purpose network interface according to its destination address information.
Alternatively, the forwarding matching list includes source address information, destination address information and its matching relationship.
Alternatively, source address information includes source MAC, source IP address, source port and Ethernet protocol number;Destination address
Information includes target MAC (Media Access Control) address, purpose IP address and destination interface.
Alternatively, data are Resealed in the step S20 to include the source MAC in data, source IP address, source port
It is revised as target MAC (Media Access Control) address, purpose IP address and destination interface.
Alternatively, in the step S20, according to the DMA receiving queues, match the DMA according to forwarding matching list and connect
The data in queue are received, obtaining destination address information includes:Judge whether data can be carried out according to the forwarding matching list
Match somebody with somebody:If can match, directly by the way that source address information is revised as into corresponding destination address information;If can not match,
CPU is then sent the data to, by CPU processing, so as to obtain the destination address information of the data;Also, CPU counts this
According to source address information, destination address information and its matching relationship added to it is described forwarding matching list in.
The invention also discloses a kind of data fast-forwarding system, and applied to the HGU of PON, the data quickly turn
Hair system includes:DMA receiving modules, matching module and DMA sending modules;The DMA receiving modules are used to cache the number received
According to DMA receiving queues, and according to the DMA receiving queues, add data to the matching module;Wherein, the number of reception
According to including source address information;The matching module is used to, according to forwarding matching list, carry out matching treatment to data, obtain destination address
Information;Data are Resealed and sent into the DMA transmit queues of the DMA sending modules;The DMA sending modules according to
The DMA transmit queues send the data Resealed to corresponding purpose network interface.
Alternatively, the forwarding matching list includes source address information, destination address information and its matching relationship.
Alternatively, the data fast-forwarding system also includes CPU processing modules, and the CPU processing modules are used for logical
When the destination address information of data can not be obtained by crossing the matching module, the data are handled, so as to obtain the data
Destination address information, and destination address information is returned into the matching module;By the source address information of the data, destination address
Information and its matching relationship are added to the forwarding matching list.
Alternatively, source address information includes source MAC, source IP address, source port and Ethernet protocol number;Destination address
Information includes target MAC (Media Access Control) address, purpose IP address and destination interface.
Alternatively, the matching module to data Reseal including by the source MAC in data, source IP address,
Source port is revised as target MAC (Media Access Control) address, purpose IP address and destination interface.
As described above, a kind of data fast forwarding method and system of the present invention, will applied to the HGU units of PON network interfaces
Source address information, destination address information and its matching relationship are stored in forwarding matching list, in this way, the number received in LAN mouths
According to caching to DMA receiving queues, and matching module is transferred data to, by forwarding matching list can Rapid matching acquisition purpose
Address information, and send after being Resealed to data to DMA transmit queues, after finally being Resealed by DMA sending modules
Data are sent to corresponding purpose WAN mouths.Whole repeating process, and need not move through CPU and data are handled.Also, this
Information in the forwarding matching list of invention can also be updated by CPU, if data can not be quick in matching list is forwarded
With destination address information is obtained, then the data can be sent to CPU, have CPU to be handled according to rule it, so as to obtain purpose
Address information, and the source address information, destination address information and its matching relationship are updated in forwarding matching list, in case next
Data with identical source MAC, source IP address, source port and Ethernet protocol number can be directly by forwarding matching list
Rapid matching is carried out, and no longer needs CPU processing.Thus it is not difficult to find out, data fast forwarding method of the invention and is
System, greatly reduces CPU usage during data forwarding, improves data forwarding speed.
Brief description of the drawings
Fig. 1 is shown as a kind of schematic flow sheet of data fast forwarding method disclosed in the embodiment of the present invention.
Fig. 2 is shown as a kind of structural representation of data fast-forwarding system disclosed in the embodiment of the present invention.
Component label instructions
S10~S30 steps
200 data fast-forwarding systems
210 DMA receiving modules
220 matching modules
230 DMA sending modules
240 CPU processing modules
Embodiment
Illustrate embodiments of the present invention below by way of specific instantiation, those skilled in the art can be by this specification
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through specific realities different in addition
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.It should be noted that in the case where not conflicting, following examples and implementation
Feature in example can be mutually combined.
Refer to accompanying drawing.It should be noted that the diagram provided in following examples only illustrates this hair in a schematic way
Bright basic conception, then in schema only display with relevant component in the present invention rather than according to component count during actual implement,
Shape and size are drawn, and kenel, quantity and the ratio of each component can be a kind of random change during its actual implementation, and its component
Being laid out kenel may also be increasingly complex.
The data fast forwarding method and system of the HGU units applied to PON of the present invention, for solving larger band
In the case of width, it is larger to CPU occupancy to carry out data forwarding.It uses DMA (Direct Memory Access, storage
Device directly accesses) technology, it is allowed to the direct read/write data between external equipment and memory, neither pass through CPU, it is not required that
CPU intervenes.Whole data forwarding operation is carried out under the control of DMA receiving modules and DMA sending modules.CPU is except same
Done during the first time forwarding of class data (there is identical source address information) outside a little handling, CPU can enter in transmitting procedure
The other work of row.So, in the most of the time, CPU and input and output are all in parallel work-flow.Therefore, whole system is made
Efficiency greatly improve.
Embodiment 1
As shown in figure 1, present embodiment discloses a kind of data fast forwarding method of the HGU units applied to PON,
Specifically include:
Step S10, by the data buffer storage of reception to DMA receiving queues;The data wherein received include source address information:
HGU is after LAN mouths receive data, by data buffer storage into DMA receiving queues, at the same time, triggers in hardware
It is disconnected, and inform matching module.Data are to be cached according to sequencing to DMA receiving queues.
Also, the source address information in the data received includes source MAC, source IP address, source port and Ethernet
Protocol number.
Step S20, according to DMA receiving queues, the data in the DMA receiving queues are matched according to forwarding matching list, are obtained
Take destination address information;And encapsulation of data again, it is forwarded to DMA transmit queues:
Wherein, forwarding matching list includes source address information, destination address information and its matching relationship.Data are according to its source
Location information, by forwarding matching list to match destination address information corresponding to acquisition.Also, destination address information includes:Mesh
MAC Address, purpose IP address and destination interface.
First, after data buffer storage to DMA receiving queues, according to the order of DMA receiving queues, by data according to forwarding
Matched with table, and judge whether to match:
If it can match, then directly obtain destination address information corresponding to the data;
If can not match, CPU is sent the data to, data are handled according to Ethernet protocol, acquisition pair
The destination address information answered, and source address information, destination address information and its matching relationship are added in forwarding matching list;
Then, data are Resealed according to destination address information:Directly by the source MAC in data, source IP
Target MAC (Media Access Control) address, purpose IP address and destination interface are revised as in address, source port;
Finally, by the data forwarding Resealed to DMA transmit queues.
It is not difficult to find out there is the data of identical source MAC, source IP address, source port and Ethernet protocol number, only
First data is needed by CPU processing, and remaining data is only needed according to first be updated in forwarding matching list
The CPU of individual data result, so that it may directly obtain destination address information, it is no longer necessary to handle by CPU.
Step S30, according to DMA transmit queues, the data Resealed are forwarded to purpose according to its destination address information
Network interface.
It should be noted that the step of above method divides, it is intended merely to describe clear, one is can be merged into when realizing
Step is split to some steps, is decomposed into multiple steps, as long as comprising identical logical relation, all in this patent
In protection domain;To either adding inessential modification in algorithm in flow or introducing inessential design, but do not change
Become the core design of its algorithm and flow all in the protection domain of the patent.
Embodiment 2
Present embodiment discloses a kind of data fast-forwarding system 200 of the HGU units applied to PON, such as Fig. 2 institutes
Show, including:DMA receiving modules 210, matching module 220, DMA sending modules 230 and CPU processing modules 240.
Wherein, DMA receiving modules 210 be used for by from the data buffer storage that LAN mouths receive into DMA receiving queues, simultaneously
Set out hardware interrupts, and according to the order of DMA receiving queues, add data to matching module 220.Wherein, received from LAN mouths
To data include but is not limited to source address information, and source address information include source MAC, source IP address, source port and with
Too fidonetFido number.
Matching module 220 is used for according to forwarding matching list, and data are carried out with matching treatment and is Resealed, is sent to DMA
In the DMA transmit queues of invention module 230.Matching module 220 is according to the source address information included in data, according to forwarding matching
Table, it can directly obtain destination address information;Further, data are Resealed according to destination address information.At this
In embodiment, the source address information in data is revised as destination address information;I.e. by source MAC, source IP address, source port
It is revised as target MAC (Media Access Control) address, purpose IP address and destination interface;It will finally send to DMA and invent by the data Resealed
In the DMA transmit queues of module 230.
DMA sending modules 230 according to DMA transmit queues order, according to the destination address information of the data Resealed,
Send the datagrams to corresponding wan mouths (purpose network interface).
CPU processing modules 240 are used to carry out rule process conversion to data, obtain destination address information corresponding to data,
And destination address information is returned into matching module 220;And update forwarding matching list.
When matching module 220 can not obtain destination address information by the source address information and forwarding matching list of data,
Matching module 220 can send the data to CPU processing modules 240, and CPU processing modules 240 are according to Ethernet protocol to data
Handled, destination address information corresponding to acquisition, and corresponding destination address information is returned into matching module 220, so as to
Data are Resealed according to destination address information in matching module 220.
Data are carried out after processing obtains destination address information in CPU processing modules 240, also by the source address of the data
Information, destination address information and its matching relationship are added to forwarding in matching list, to receive with identical source address later
When the data of information, it is no longer necessary to which CPU processing modules carry out substantial amounts of data processing to data, directly utilize forwarding matching
Table obtains its corresponding destination address information by matching module 220.
It should be noted that in order to protrude the innovative part of the present invention, will not be with solving the present invention in the present embodiment
The less close module of the technical problem relation that is proposed introduces, but this is not intended that in the present embodiment and other moulds are not present
Block.
Also, it is seen that the present embodiment is system embodiment corresponding to those in the first embodiment, the present embodiment can be with
One embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment are still effective in the present embodiment, in order to
Reduce and repeat, repeat no more here.Correspondingly, the relevant technical details mentioned in the present embodiment are also applicable in first embodiment
In.
In summary, a kind of data fast forwarding method of the invention and system, will applied to the HGU units of PON network interfaces
Source address information, destination address information and its matching relationship are stored in forwarding matching list, in this way, the number received in LAN mouths
According to caching to DMA receiving queues, and matching module is transferred data to, by forwarding matching list can Rapid matching acquisition purpose
Address information, and send after being Resealed to data to DMA transmit queues, after finally being Resealed by DMA sending modules
Data are sent to corresponding purpose WAN mouths.Whole repeating process, and need not move through CPU and data are handled.Also, this
Information in the forwarding matching list of invention can also be updated by CPU, if data can not be quick in matching list is forwarded
With destination address information is obtained, then the data can be sent to CPU, have CPU to be handled according to rule it, so as to obtain purpose
Address information, and the source address information, destination address information and its matching relationship are updated in forwarding matching list, in case next
Data with identical source MAC, source IP address, source port and Ethernet protocol number can be directly by forwarding matching list
Rapid matching is carried out, and no longer needs CPU processing.Thus it is not difficult to find out, data fast forwarding method of the invention and is
System, greatly reduces CPU usage during data forwarding, improves data forwarding speed.So the present invention effectively overcomes now
There is the various shortcoming in technology and have high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, not for the limitation present invention.It is any ripe
Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as
Into all equivalent modifications or change, should by the present invention claim be covered.