CN101860483B - BFD realization method and device based on chip lookup table - Google Patents
BFD realization method and device based on chip lookup table Download PDFInfo
- Publication number
- CN101860483B CN101860483B CN201010189246.XA CN201010189246A CN101860483B CN 101860483 B CN101860483 B CN 101860483B CN 201010189246 A CN201010189246 A CN 201010189246A CN 101860483 B CN101860483 B CN 101860483B
- Authority
- CN
- China
- Prior art keywords
- packet
- bfd
- enable
- chip
- preset
- 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.)
- Active
Links
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to a BFD realization method and device based on a chip lookup table. The method comprises the following steps: the data pack sent by a central processing unit (CPU) is received; when the data pack is a bidirectional forwarding detection (BFD) data pack, the BFD data pack sending port in a prestored table is obtained according to the pack header of the BFD data pack and the preset capacitate of the chip; and the sending port is used to send the BFD data pack. Correspondingly, the invention provides a BFD realization device based on the chip lookup table. The BFD realization method and device based on the chip lookup table use the chip to receive the BFD data pack and perform table lookup to realize the forwarding of the BFD data pack, thus accelerating the forwarding speed of the BFD data pack and reducing the load of CPU software lookup table in the prior art.
Description
Technical field
The present invention relates to network communication field, particularly a kind of BFD implementation method based on chip lookup table and device.
Background technology
It is the fast detecting agreement of Internet protocol (Internet Protocol, IP) layer that two-way converting detects (Bidirectional Forwarding Detection, BFD) agreement, can the link failure of each layer of Sampling network.And, because BFD carries out simple, the unicity of fault detect, make BFD can be absorbed in the fast detecting of fault, help network with good service quality (Quality of Service, QoS) transmission of voice, video and other demand (telecommunication) service is realized, thus help service provider to provide required high reliability, the high applicability simulated sound signal networking telephone (Voice over Internet Protocol, VoIP) and other real time business for client.Therefore, the detection time delay of BFD just becomes the important indicator parameter weighing the network equipment.
Existing BFD packet is all first rely on CPU software lookup forwarding data table and obtain transmit port, then is sent by this transmit port by this BFD packet, and its three layers tables of data forwarded search flow process as shown in Figure 1.First, search routing table, draw Internet protocol (InternetProtocol, the IP) address of the down hop of packet; Secondly, the IP address search address resolution protocol (AddressResolution Protocol, ARP) according to down hop is shown, and show that the media interviews of down hop control (Media AccessControl, MAC) address; Again, search MAC table according to the MAC Address of down hop, draw the transmit port of BFD packet, thus this BFD packet is sent by this transmit port.
Above by the method for CPU software lookup forwarding data table, make the time interval sending packet longer, affect the speed that BFD packet forwards.
Summary of the invention
Main purpose of the present invention is to provide a kind of BFD implementation method based on chip lookup table and device, is intended to the forwarding speed accelerating BFD packet.
The invention provides a kind of BFD implementation method based on chip lookup table, comprise the following steps:
Receive the packet that central processing unit CPU sends;
When packet is two-way converting detection BFD packet, according to the packet header of BFD packet and the preset enable of chip, obtain the preset BFD Packet Generation port prestored in table;
BFD packet is sent by transmit port.
Preferably, comprise before the step of packet that above-mentioned reception CPU sends:
Obtain control command, and arrange the preset enable of chip according to control command, chip preset enable comprises two layers, and forwarding is enable, three layers of forwarding are enable.
Preferably, when preset enable be two layers forward enable time, search the MAC table prestored in table according to object MAC address in the packet header of packet, obtain the transmit port of BFD packet.
Preferably, when preset enable be three layers forward enable time, search routing table according to object internet protocol address in the packet header of packet, obtain the IP address of down hop;
According to the IP address search ARP table of down hop, obtain the MAC Address of down hop;
Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet.
Preferably, also comprise after the step of packet that above-mentioned reception CPU sends:
When packet is not BFD packet, packet discard.
Present invention also offers a kind of BFD implement device based on chip lookup table, comprising:
Receiver module, for receiving the packet that central processing unit CPU sends;
Processing module, during for being two-way converting detection BFD packet when packet, according to the packet header of BFD packet and the preset enable of chip, obtains the preset BFD Packet Generation port prestored in table;
Sending module, for sending BFD packet by transmit port.
Preferably, said apparatus also comprises:
Arranging module, for obtaining control command, and arranging the preset enable of chip according to control command, chip preset enable comprises two layers, and forwarding is enable, three layers of forwarding are enable.
Preferably, above-mentioned processing module specifically for: when preset enable be two layers forward enable time, search the MAC table prestored in table according to object MAC address in the packet header of packet, obtain the transmit port of BFD packet.
Preferably, above-mentioned processing module also specifically for: when preset enable be three layers forward enable time, search routing table according to object internet protocol address in the packet header of packet, obtain the IP address of down hop;
According to the IP address search ARP table of down hop, obtain the MAC Address of down hop;
Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet.
Preferably, above-mentioned processing module also specifically for when packet is not BFD packet, packet discard.
The present invention is based on BFD implementation method and the device of chip lookup table, receive BFD packet by chip, and look-up table is carried out to it, realize the forwarding of BFD packet, not only accelerate the forwarding speed of BFD packet, and alleviate the burden of CPU software checking book in prior art.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet being realized BFD in prior art by CPU software checking book;
Fig. 2 is the schematic flow sheet of an embodiment of the BFD implementation method that the present invention is based on chip lookup table;
Fig. 3 is the schematic flow sheet of an embodiment of the BFD implement device that the present invention is based on chip lookup table.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 2 is the schematic flow sheet of a kind of BFD implementation method one embodiment based on chip lookup table of the present invention.
A kind of BFD implementation method based on chip lookup table of the present embodiment, comprises the following steps:
The packet that step S11, reception CPU send;
Exchange chip receives the packet assembled that CPU (Central Processing Unit, CPU) sends.When this packet is BFD packet, its assembling flow path is:
The UDP part of steps A, assembling datagram;
By requesting for comments, (Request for Comments, RFC) document carries out User Datagram Protocol (User Datagram Protocol, UDP) encapsulation to BFD detection messages.This RFC document is the standard document of transmission control protocol/Internet protocol (Transmission Control Protocol/Internet Protocol, TCP/IP).
The IP section of step B, assembling datagram;
The packet encapsulated through UDP is carried out Internet protocol (Internet Protocol, IP) encapsulation, adding purpose IP address, source IP address.
Two layers of packet header of step C, assembling datagram.
Two layers of packet header comprise BFD identifier, media interviews control (Media Access Control, MAC) address and VLAN (Virtual Local Area Network, VLAN) part.At this, the state that VLAN ID is acquiescence can be set, i.e. VLAN 1.MAC Address comprises target MAC (Media Access Control) address, source MAC.
Step S12, judge whether this packet is BFD packet;
When there is BFD identifier in two layers of packet header, then judge that this packet is BFD packet, go to step S13; Otherwise judge that this packet is not BFD packet, go to step S15.
Step S13, according to the packet header of BFD packet and the preset enable of chip, obtain the preset BFD Packet Generation port prestored in table;
Step S14, send this BFD packet by transmit port;
Step S15, abandon this packet.
Also comprise before above-mentioned steps S11:
Step S10, acquisition control command, and the preset enable of chip is set according to this control command;
This chip preset enable comprises two layers and forwards enable or three layers of forwarding are enable.According to register handbook, by obtaining control command, and the corresponding register value of chip is set according to this control command, namely the preset enable of chip be set.Concrete preset enable setting will be arranged accordingly according to concrete chip, and such as, the register value of certain chip will be set to:
IPMC_DO_VLAN=0;
V6IPMC_ENABLE=1;
V6L3_ENABLE=0;
V4L3_ENABLE=1;
By the setting of above-mentioned register, this chip known preset enable is that three layers of forwarding of IPV4 are enable.Therefore, when receiving BFD packet, this chip, according to the object IP address in BFD packet header, searches routing table, ARP table, MAC table, successively to obtain the transmit port of BFD data retransmission.And send BFD packet by this transmit port.
Above-mentioned steps S13 is specially:
A, when preset enable be two layers forward enable time, search the MAC table prestored in table according to target MAC (Media Access Control) address in the packet header of packet, obtain the transmit port of BFD packet;
B, when preset enable be three layers forward enable time, according to object IP address search routing table in the packet header of packet, obtain the IP address of down hop; According to the IP address search ARP table of down hop, obtain the MAC Address of down hop; Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet.
The present embodiment is based on the BFD implementation method of chip lookup table, receive BFD packet by chip, and look-up table is carried out to it, realize the forwarding of BFD packet, not only alleviate the burden by CPU software checking book in prior art, and accelerate the forwarding speed of BFD packet.
Fig. 3 is the structural representation of BFD implement device one embodiment that the present invention is based on chip lookup table.
The present embodiment comprises based on the BFD implement device of chip lookup table:
Receiver module 10, for receiving the packet that central processing unit CPU sends;
Judge module 20, for judging whether this packet is BFD packet;
Processing module 30, for when this packet is BFD packet, according to the packet header of BFD packet and the preset enable of chip, obtains the preset BFD Packet Generation port prestored in table;
Sending module 40, for sending BFD packet by transmit port.
The above-mentioned BFD implement device based on chip lookup table also comprises:
Arranging module 50, for obtaining control command, and arranging the preset enable of chip according to control command, chip preset enable comprises two layers and forwards enable or three layers of forwarding are enable.
According to register handbook, by obtaining control command, and the corresponding register value of chip is set according to this control command, namely the preset enable of chip be set.Such as, the register value of certain chip will be set to:
IPMC_DO_VLAN=0;
V6IPMC_ENABLE=1;
V6L3_ENABLE=0;
V4L3_ENABLE=1;
By the setting of above-mentioned register, this chip known preset enable is that three layers of forwarding of IPV4 are enable.Therefore, when receiving BFD packet, this chip, according to the object IP address in BFD packet header, searches routing table, ARP table, MAC table, successively to obtain the transmit port of BFD data retransmission.And send BFD packet by this transmit port.
Above-mentioned processing module 30 specifically for: when preset enable be two layers forward enable time, search the MAC table prestored in table according to object MAC address in the packet header of packet, obtain the transmit port of BFD packet;
When preset enable be three layers forward enable time, search routing table according to object internet protocol address in the packet header of packet, obtain the IP address of down hop; According to the IP address search ARP table of down hop, obtain the MAC Address of down hop; Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet.
Above-mentioned processing module 30 also specifically for when this packet is not BFD packet, abandons this packet.
The present embodiment is based on the BFD implement device of chip lookup table, receive BFD packet by chip, and look-up table is carried out to it, realize the forwarding of BFD packet, not only alleviate the burden by CPU software checking book in prior art, and accelerate the forwarding speed of BFD packet.
The foregoing is only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize specification of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.
Claims (4)
1., based on a BFD implementation method for chip lookup table, it is characterized in that, comprise the following steps:
Obtain control command, and arrange the preset enable of chip according to described control command, described chip preset enable comprises two layers and forwards enable or three layers of forwarding are enable;
Receive the packet that central processing unit CPU sends; Described packet is the packet assembled by CPU;
When described packet is two-way converting detection BFD packet, according to the packet header of BFD packet and the preset enable of chip, obtain the preset BFD Packet Generation port prestored in table; When preset enable be two layers forward enable time, search the MAC table prestored in table according to object MAC address in the packet header of packet, obtain the transmit port of BFD packet; When preset enable be three layers forward enable time, search routing table according to object internet protocol address in the packet header of packet, obtain the IP address of down hop; According to the IP address search ARP table of down hop, obtain the MAC Address of down hop; Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet;
Described BFD packet is sent by described transmit port.
2. as claimed in claim 1 based on the BFD implementation method of chip lookup table, it is characterized in that, also comprise after the step of the packet that described reception CPU sends:
When described packet is not BFD packet, abandon described packet.
3., based on a BFD implement device for chip lookup table, it is characterized in that, comprising:
Arranging module, for obtaining control command, and arranging the preset enable of chip according to described control command, described chip preset enable comprises two layers and forwards enable or three layers of forwarding are enable;
Receiver module, for receiving the packet that central processing unit CPU sends; Described packet is the packet assembled by CPU;
Processing module, during for being two-way converting detection BFD packet when described packet, according to the packet header of BFD packet and the preset enable of chip, obtains the preset BFD Packet Generation port prestored in table; When preset enable be two layers forward enable time, search the MAC table prestored in table according to object MAC address in the packet header of packet, obtain the transmit port of BFD packet; When preset enable be three layers forward enable time, search routing table according to object internet protocol address in the packet header of packet, obtain the IP address of down hop; According to the IP address search ARP table of down hop, obtain the MAC Address of down hop; Search MAC table according to the MAC Address of this down hop, obtain the transmit port of BFD packet;
Sending module, for sending described BFD packet by described transmit port.
4., as claimed in claim 3 based on the BFD implement device of chip lookup table, it is characterized in that, described processing module also specifically for when described packet is not BFD packet, abandons described packet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010189246.XA CN101860483B (en) | 2010-06-01 | 2010-06-01 | BFD realization method and device based on chip lookup table |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010189246.XA CN101860483B (en) | 2010-06-01 | 2010-06-01 | BFD realization method and device based on chip lookup table |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101860483A CN101860483A (en) | 2010-10-13 |
CN101860483B true CN101860483B (en) | 2015-01-28 |
Family
ID=42946148
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010189246.XA Active CN101860483B (en) | 2010-06-01 | 2010-06-01 | BFD realization method and device based on chip lookup table |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101860483B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105099957B (en) * | 2015-08-20 | 2018-05-18 | 电子科技大学 | A kind of data packet forwarding method based on software checking book |
CN105228028B (en) * | 2015-09-18 | 2018-05-11 | 南京大学镇江高新技术研究院 | A kind of video stream media data distribution based on udp broadcast and pre-cache method |
CN105635167A (en) * | 2016-01-25 | 2016-06-01 | 盛科网络(苏州)有限公司 | Method and device for realizing message edition function by using hardware |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101159665A (en) * | 2007-08-28 | 2008-04-09 | 杭州华三通信技术有限公司 | Method and device to implement forwarding of unknown multicast packet to router port |
CN101695047A (en) * | 2009-10-26 | 2010-04-14 | 中兴通讯股份有限公司 | Method and switch for realizing forwarding of dynamic tunnel message |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20050066903A (en) * | 2003-12-27 | 2005-06-30 | 한국전자통신연구원 | Packet forwarding apparatus and method for address lookup algorithm with three routing step tables in high speed router system |
-
2010
- 2010-06-01 CN CN201010189246.XA patent/CN101860483B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101159665A (en) * | 2007-08-28 | 2008-04-09 | 杭州华三通信技术有限公司 | Method and device to implement forwarding of unknown multicast packet to router port |
CN101695047A (en) * | 2009-10-26 | 2010-04-14 | 中兴通讯股份有限公司 | Method and switch for realizing forwarding of dynamic tunnel message |
Also Published As
Publication number | Publication date |
---|---|
CN101860483A (en) | 2010-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11522734B2 (en) | Method for controlling a remote service access path and relevant device | |
US7995478B2 (en) | Network communication with path MTU size discovery | |
Kumar et al. | Survey on transport layer protocols: TCP & UDP | |
WO2011110118A2 (en) | Fault detection method and system | |
US10812292B2 (en) | Packet processing method and device | |
JP2011205642A5 (en) | ||
RU2012136595A (en) | LOCAL IP ACCESS DIAGRAM | |
CN104717259B (en) | The multi-path data Transmission system and method for distributed transfer server network assistance | |
US9203728B2 (en) | Metadata capture for testing TCP connections | |
WO2016034029A1 (en) | Method and device for processing service traffic | |
CN102932461A (en) | Network acceleration transmission method and device | |
US20070171836A1 (en) | Estimating system, terminal, estimating method, and program | |
WO2014026571A1 (en) | Method and device for sending generic routing encapsulation tunnel message | |
WO2009124477A1 (en) | Method, system and device for packet transmission | |
TWI580226B (en) | Method for determining maximum segment size | |
CN101277225A (en) | Method for analyzing network quality as well as network quality analysis terminal-initiating equipment | |
CN101860483B (en) | BFD realization method and device based on chip lookup table | |
WO2009026824A1 (en) | A method, device and system for transferring multiplex messages | |
RiLi | Research and application of TCP/IP protocol in embedded system | |
CN102469016B (en) | Device and method for determining path maximum transmission unit (PMTU) reversely | |
WO2013026299A1 (en) | Address resolution method and device, and information transmission method | |
JP2006253867A (en) | Frame transmission system and method | |
CN102377834B (en) | Network address translation equipment and communication method | |
CN101064671A (en) | Method for processing P2P technique based network video signal | |
KR100932570B1 (en) | Method for maintaining large session information between application server and client in NAT equipment without burdening server and server side network |
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 |