CN101197787B - Packet information learning method and apparatus - Google Patents

Packet information learning method and apparatus Download PDF

Info

Publication number
CN101197787B
CN101197787B CN2008100559937A CN200810055993A CN101197787B CN 101197787 B CN101197787 B CN 101197787B CN 2008100559937 A CN2008100559937 A CN 2008100559937A CN 200810055993 A CN200810055993 A CN 200810055993A CN 101197787 B CN101197787 B CN 101197787B
Authority
CN
China
Prior art keywords
information
appointed information
unit
cpu
message
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.)
Expired - Fee Related
Application number
CN2008100559937A
Other languages
Chinese (zh)
Other versions
CN101197787A (en
Inventor
王彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2008100559937A priority Critical patent/CN101197787B/en
Publication of CN101197787A publication Critical patent/CN101197787A/en
Application granted granted Critical
Publication of CN101197787B publication Critical patent/CN101197787B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a message information learning method which comprises the following steps: a quick forwarding table is searched according to designated information in a current received message; if the designated information is not discovered in the quick forwarding table, search is made whether the designated information has been stored in a buffer table; if the designated information has been stored in the buffer table, learning of current received message information is ended; if the designated information has not been stored in the buffer table, the designated information is stored in the buffer table and reported to a CPU; when an instruction for being in need of learning the designated information, which is returned by the CPU, is received, a corresponding relation between the designated information and a port which receives the current message is stored in the quick forwarding table; when an instruction for having no need of learning the designated information, the learning of the current received message information is ended. The invention also discloses a message learning device. The technical proposal of the invention can improve learning efficiency of the message information and reduce CPU treatment load.

Description

A kind of packet information learning method and device
Technical field
The present invention relates to data communication technology field, refer to a kind of packet information learning method and device especially.
Background technology
At present, in data communication field, the network equipment is when two layers of forwardings or three layer data, by searching the outbound port that the mode of transmitting fast obtains received data.Simultaneously, described transmitting fast of being searched is that the network equipment obtains by the message that self received is carried out dynamic learning.
Fig. 1 carries out the composition structural representation of the network equipment of data forwarding according to medium access control (MAC, Media Access Control) address in the prior art.As shown in Figure 1, this two-layer network device mainly comprises: logic module, CPU and MAC Address tabulation.Wherein, logic module is field programmable gate array (FPGA, Field Programmable Gate Array); The MAC Address tabulation is transmit fast a kind of, and each list item wherein all is the mapping relations between MAC Address and the port.
Fig. 2 is the network equipment shown in Fig. 1 is transmitted processing to the message that is received a flow chart.As shown in Figure 2, may further comprise the steps:
Step 201, logic module in the network equipment detects whether receive message, is execution in step 202 then, otherwise proceeds to detect.
Step 202, logic module is searched the MAC Address tabulation according to the MAC Address of received packet, if hit then execution in step 203, otherwise execution in step 204.
Step 203, logic module sends the message that is received, and returns step 201 according to the MAC Address list item that hits from corresponding ports.
Step 204, logic module is reported to CPU with described MAC Address.
In this step, logic module reports CPU to be specially MAC Address: logic module writes MAC Address in first-in first-out (FIFO) formation, and CPU obtains the MAC Address that logic module reports by the information that reads in the fifo queue.
Step 205, CPU judges whether and need learn the MAC Address that is received, and is execution in step 207 then, otherwise execution in step 206.
Step 206, CPU returns the instruction that need not to learn to logic module, and logic module receives instruction back execution in step 201.
Step 207, CPU returns the instruction that needs study to logic module, and logic module receives the instruction back described MAC Address is learnt, and returns step 201 after finishing study.
In this step, logic module is learnt to be specially to described MAC Address: logic module is saved in the MAC Address tabulation with the source MAC of described message and the corresponding relation that receives between the port of this message.After this, just can send from corresponding ports receiving target MAC (Media Access Control) address when being the message of above-mentioned source MAC.
In MAC address learning process shown in Figure 2, logic module is unknown MAC Address in the MAC Address that receives message, and when promptly not having corresponding M AC address in the MAC Address tabulation, just the MAC Address with this message reports CPU by writing fifo queue.But when CPU did not also respond this MAC Address that reports, if the next message of same session just arrives, then logic module also can report CPU by writing fifo queue with the MAC Address of back arrival message, by that analogy.And the MAC Address that belongs to the message of same session is identical in fact, so said process can cause CPU many times to receive and handle identical MAC Address, is effective but in fact have only primary reception and processing.As seen, existing MAC address learning scheme has reduced the communication efficiency between logic module and the CPU, and then has reduced the learning efficiency of MAC Address, and has increased the weight of the processing load of CPU.
In fact for other message information learning process, study as five-tuple, same exist since the speed that message arrives the network equipment to handle the message information learning efficiency that the speed of a message causes greater than the CPU of this network equipment not high, CPU handles the problem that load weighs.
Summary of the invention
In view of this, the invention provides a kind of message information learning device, this device can improve the message information learning efficiency, and alleviates the processing load of CPU.
The present invention also provides a kind of packet information learning method, and this device can improve the message information learning efficiency, and alleviates the processing load of CPU.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
The invention discloses a kind of message information learning device, this device comprises: transmit memory cell, buffer unit, unit and CPU fast, wherein,
Transmit memory cell fast, be used for storage and transmit fast;
Buffer unit is used to preserve the appointed information that unit writes, and feeds back the memory address of described appointed information to unit;
Unit, be used for searching the appointed information of current reception message from transmitting memory cell fast, if do not find then inquire about whether preserved described appointed information in the described buffer unit, be the study that then finishes current reception message information, otherwise described appointed information is write buffer unit, and described appointed information reported CPU, the memory address of described appointed information in buffer unit reported CPU; When CPU returns the judged result that need learn, described appointed information and the corresponding relation that receives between the port of described current message are saved in the described memory cell of transmitting fast; When CPU returns the judged result that need not learn, finish the study of current message information;
CPU is used for judging whether to learn according to the appointed information that unit reports, and returns judged result to unit, and the memory address of described appointed information in buffer unit is handed down to unit;
Described unit is further used for after receiving the judged result that CPU returns, according to the address information of wherein carrying, and the described appointed information of deletion from buffer unit.
The invention also discloses a kind of packet information learning method, this method comprises:
Unit is searched fast according to the appointed information in the current reception message and is transmitted;
If do not find described appointed information transmitting fast from described, then whether preserved described appointed information in the query caching table, be the study that then finishes current reception message information, otherwise described appointed information is saved in described cache table, and report CPU, and the memory address of described appointed information is reported CPU;
When unit receives needs that CPU returns when learning the memory address of the instruction of described appointed information and described appointed information, with described appointed information with receive corresponding relation between the port of described current message and be saved in and describedly transmit fast, and, delete the described appointed information of preserving on this address according to the memory address of described appointed information; When not needing of receiving that CPU returns learnt the memory address of the instruction of described appointed information and described appointed information, finish the study of current message information, and, delete the described appointed information of preserving on this address according to the memory address of described appointed information.
As seen from the above technical solution, this searching fast according to the appointed information in the current reception message of the present invention transmitted; If do not find described appointed information transmitting fast from described, then whether preserved described appointed information in the query caching table, be the study that then finishes current reception message information, otherwise described appointed information is saved in described cache table, and report CPU; When receiving needs that CPU returns when learning the instruction of described appointed information, with described appointed information with receive corresponding relation between the port of described current message and be saved in and describedly transmit fast; When receive that CPU returns do not need to learn the instruction of described appointed information the time, finish technical scheme to the study of current message information, improved the message information learning efficiency, and alleviated the processing load of CPU.
Description of drawings
Fig. 1 is the composition structural representation that carries out the network equipment of data forwarding in the prior art according to MAC Address;
Fig. 2 is the network equipment shown in Fig. 1 is transmitted processing to the message that is received a flow chart;
Fig. 3 is the structured flowchart of a kind of message information learning device of the embodiment of the invention;
Fig. 4 is the structured flowchart of a kind of MAC address learning device of the embodiment of the invention;
Fig. 5 is the flow chart that device shown in Figure 4 is learnt MAC Address.
Embodiment
Fig. 3 is the structured flowchart of a kind of message information learning device of the embodiment of the invention.As shown in Figure 3, this message information learning device comprises: transmit memory cell 301, buffer unit 302, unit 303 and CPU 304 fast, wherein:
Transmit memory cell 301 fast, be used for storage and transmit fast;
Buffer unit 302 is used to preserve the appointed information that unit 303 writes;
Unit 303, be used for searching the appointed information of current reception message from transmitting memory cell 301 fast, if do not find then whether preserved described appointed information in the query caching unit 302, be the study that then finishes current reception message information, otherwise described appointed information is write buffer unit 302, and described appointed information is reported CPU 304; When CPU 304 returns the judged result that need learn, with described appointed information with receive corresponding relation between the port of described current message and be saved in and transmit memory cell 301 fast; When CPU304 returns the judged result that need not learn, finish study to current reception message information;
CPU304 is used for judging whether to learn according to the message information that unit 303 reports, and returns judged result to unit.
In the embodiment shown in fig. 3, appointed information in the current message is reported CPU304 to be saved in the buffer unit 302 before, therefore, before the appointed information of the current message that the CPU304 response is reported, if belong to the next message of same session arrives with current message, then can know whether CPU is handling the described next appointed information that arrives message by query caching unit 302, if then no longer learn the described next appointed information that arrives message, promptly no longer report this appointed information to CPU, thereby improved the learning efficiency of message information, alleviated the processing load of CPU.
For making purpose of the present invention, technical scheme and advantage clearer, the learning process with MAC Address is an example below, and the present invention is described in more detail.
Fig. 4 is the structured flowchart of a kind of MAC address learning device of the embodiment of the invention.As shown in Figure 4, this MAC address learning device comprises: transmit memory cell 401, buffer unit 402, unit 403, CPU404 and first-in first-out memory cell 405 fast.
In Fig. 4:
Transmit memory cell 401 fast, be used for store M AC address table.Here mac address table is the mac address table of corresponding relation between preservation MAC Address of the prior art and the port.
Buffer unit 402 is a content adressable memory (CAM, Content AddressableMemory), is used to preserve the MAC Address that unit 403 writes, and returns the memory address of the MAC Address that writes to unit.
First-in first-out memory cell 405 is used for preserving MAC Address and the memory address of this MAC Address in buffer unit 402 that unit 403 writes, and reads for CPU404, and its data that write are earlier read by CPU404 earlier.
Unit 403, be used for when receiving current incoming message, to searching the MAC Address of current message from transmitting memory cell 401 fast, if the MAC Address that does not find then whether preserved current message in the query caching unit 402, be the study that then finishes current message MAC Address, otherwise the MAC Address of current message is write buffer unit 402, and MAC Address and this MAC Address memory address in buffer unit 402 of current message reported CPU404; When CPU404 returns the judged result that need learn, with described appointed information with receive corresponding relation between the port of described current message and be saved in and transmit memory cell 401 fast, and according to MAC Address memory address in buffer unit 402 of the current message that comprises in the judged result, the MAC Address of the current message of deletion from buffer unit 402; When CPU404 returns the judged result that need not learn, MAC Address memory address in buffer unit 402 according to the current message that comprises in this judged result, the MAC Address of the current message of deletion finishes the learning process to current message MAC Address from buffer unit 402.
CPU404, be used for reading MAC Address and this MAC Address memory address buffer unit 402 that unit 403 reports from first-in first-out memory cell 405, and judge whether this MAC Address needs to learn, and return the judged result that comprises this MAC Address memory address in buffer unit 402 to unit 403.
For the process of the study MAC Address that makes device shown in Figure 4 is clearer, the process of its study MAC Address is described in the mode of flow chart below.
Fig. 5 is the flow chart that device shown in Figure 4 is learnt MAC Address.As shown in Figure 5, may further comprise the steps:
Step 501, unit 403 detects whether receive message, is execution in step 502 then, otherwise proceeds to detect.
Step 502, unit 403 are searched according to the MAC Address of received packet and are transmitted memory cell 402 fast, if hit then execution in step 503, otherwise execution in step 504.
Step 503, unit 403 sends the message that is received, and returns step 501 according to the MAC Address list item that hits from corresponding ports.
Whether step 504 has preserved the MAC Address of received packet in the unit 403 query caching unit 402, be execution in step 505 then, otherwise execution in step 506.
Step 505, unit 403 finishes the study of the MAC Address of received packet, returns step 501.
Step 506, unit 403 is saved in buffer unit 402 with the MAC Address of received packet, and the memory address of this MAC Address in buffer unit 402 that described MAC Address and buffer unit 402 return reported CPU404.
In this step, unit 403 writes first-in first-out memory cell 405 with the information that needs report CPU404, and CPU404 reads the information that unit 403 reports from first-in first-out memory cell 405.
Step 507, CPU404 judges whether and need learn the MAC Address that is received, and is execution in step 509 then, otherwise execution in step 508.
Step 508, CPU404 returns the judged result of the MAC Address that need not to learn received packet to unit 403, and wherein comprises the memory address of described MAC Address in buffer unit 402.Unit 403 is deleted the MAC Address of received packet according to the address information in the judged result from buffer unit 402, and execution in step 501.
Step 509, CPU404 returns the judged result of the MAC Address that needs the study received packet to unit 403, and wherein comprises the memory address of described MAC Address in buffer unit 402.After unit 403 receives judged result, with the MAC Address of received packet with receive corresponding relation between the port of this message and be saved in and transmit memory cell 401 fast, and according to the address information in the judged result, the MAC Address of deletion received packet from buffer unit 402, and execution in step 501.
Learning process with MAC Address in above-mentioned Fig. 4 and embodiment shown in Figure 5 is illustrated technical scheme of the present invention.For other message information learning process, identical as the learning process of five-tuple with the learning process of Fig. 4 and Fig. 5, only MAC Address need be replaced with five-tuple and get final product, no longer repeat here.
In sum, the present invention searches fast according to the appointed information in the current received packet and transmits; If do not find described appointed information transmitting fast from described, then whether preserved described appointed information in the query caching table, be the study that then finishes current reception message information, otherwise described appointed information is saved in described buffer unit, and report CPU; When receiving needs that CPU returns when learning the instruction of described appointed information, with described appointed information with receive corresponding relation between the port of described current message and be saved in and describedly transmit fast; When receive that CPU returns do not need to learn the instruction of described appointed information the time, finish the study of current message information.In the technique scheme, because the appointed information in the current message is reported CPU to be saved in the cache table earlier before, therefore, before the appointed information of the current message that the CPU response is reported, if belong to the next message of same session arrives with current message, then can know whether CPU is handling the described next appointed information that arrives message by the query caching table, if then no longer learn the described next appointed information that arrives message, promptly no longer report this appointed information to CPU, thereby improved the learning efficiency of message information, alleviated the processing load of CPU.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention, all any modifications of being made within the spirit and principles in the present invention, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a message information learning device is characterized in that, this device comprises: transmit memory cell, buffer unit, unit and CPU fast, wherein,
Transmit memory cell fast, be used for storage and transmit fast;
Buffer unit is used to preserve the appointed information that unit writes, and feeds back the memory address of described appointed information to unit;
Unit, be used for searching the appointed information of current reception message from transmitting memory cell fast, if do not find then inquire about whether preserved described appointed information in the described buffer unit, be the study that then finishes current reception message information, otherwise described appointed information is write buffer unit, and described appointed information reported CPU, the memory address of described appointed information in buffer unit reported CPU; When CPU returns the judged result that need learn, described appointed information and the corresponding relation that receives between the port of described current message are saved in the described memory cell of transmitting fast; When CPU returns the judged result that need not learn, finish the study of current message information;
CPU is used for judging whether to learn according to the described appointed information that unit reports, and returns judged result to unit, and the memory address of described appointed information in buffer unit is handed down to unit;
Described unit is further used for after receiving the judged result that CPU returns, according to the address information of wherein carrying, and the described appointed information of deletion from buffer unit.
2. device as claimed in claim 1 is characterized in that described device further comprises the first-in first-out memory cell,
Described unit, the appointed information and this appointed information that are used for needs are reported CPU deposit described first-in first-out memory cell in the memory address of buffer unit;
Described CPU is used for reading appointed information that unit reports and this appointed information memory address at buffer unit from described first-in first-out memory cell.
3. device as claimed in claim 1 or 2 is characterized in that, this device is arranged in two layers or the three-layer network appliance.
4. device as claimed in claim 1 or 2 is characterized in that,
Describedly transmit transmitting fast that memory cell stores fast and be mac address table;
Described unit is from transmitting the described MAC Address that designates the information as that memory cell and buffer unit are searched fast.
5. a packet information learning method is characterized in that, this method comprises:
Unit is searched fast according to the appointed information in the current reception message and is transmitted;
If do not find described appointed information transmitting fast from described, then whether preserved described appointed information in the query caching table, be the study that then finishes current reception message information, otherwise described appointed information is saved in described cache table, and report CPU, and the memory address of described appointed information is reported CPU;
When unit receives needs that CPU returns when learning the memory address of the instruction of described appointed information and described appointed information, with described appointed information with receive corresponding relation between the port of described current message and be saved in and describedly transmit fast, and, delete the described appointed information of preserving on this address according to the memory address of described appointed information; When not needing of receiving that CPU returns learnt the memory address of the instruction of described appointed information and described appointed information, finish the study of current message information, and, delete the described appointed information of preserving on this address according to the memory address of described appointed information.
6. method as claimed in claim 5 is characterized in that, described unit comprises to the CPU reporting information:
Unit deposits the information that needs report CPU in the First Input First Output in;
CPU reads reporting information from First Input First Output.
7. as claim 5 or 6 described methods, it is characterized in that described transmitting fast is mac address table, the described MAC Address that designates the information as.
8. as claim 5 or 6 described methods, it is characterized in that described appointed information comprises: Media Access Control Address, and/or five-tuple information.
CN2008100559937A 2008-01-03 2008-01-03 Packet information learning method and apparatus Expired - Fee Related CN101197787B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008100559937A CN101197787B (en) 2008-01-03 2008-01-03 Packet information learning method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008100559937A CN101197787B (en) 2008-01-03 2008-01-03 Packet information learning method and apparatus

Publications (2)

Publication Number Publication Date
CN101197787A CN101197787A (en) 2008-06-11
CN101197787B true CN101197787B (en) 2010-08-25

Family

ID=39547941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008100559937A Expired - Fee Related CN101197787B (en) 2008-01-03 2008-01-03 Packet information learning method and apparatus

Country Status (1)

Country Link
CN (1) CN101197787B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857414A (en) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 Forwarding table writing method and device and message forwarding method and device

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101938415B (en) * 2010-08-30 2012-07-18 北京傲天动联技术有限公司 Rapid forwarding method for network forwarding device
CN103036794A (en) * 2011-10-10 2013-04-10 华为技术有限公司 Learning method, device and system of message
CN107579916B (en) 2016-07-04 2021-03-23 新华三技术有限公司 Forwarding table entry access method and device
CN112087388B (en) * 2020-08-17 2022-03-08 深圳市风云实业有限公司 Method for forwarding L2 data message
CN115567435A (en) * 2021-07-02 2023-01-03 中国船舶重工集团公司第七二四研究所 FPGA-based routing information parallel and rapid searching and managing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829188A (en) * 2005-03-01 2006-09-06 杭州华为三康技术有限公司 Method for carrying out policy management on medium access control address learning
CN1878139A (en) * 2006-05-31 2006-12-13 杭州华为三康技术有限公司 Three-layer forwarding method, device and ARP information table updating method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1829188A (en) * 2005-03-01 2006-09-06 杭州华为三康技术有限公司 Method for carrying out policy management on medium access control address learning
CN1878139A (en) * 2006-05-31 2006-12-13 杭州华为三康技术有限公司 Three-layer forwarding method, device and ARP information table updating method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2004-193821A 2004.07.08

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857414A (en) * 2012-08-20 2013-01-02 中兴通讯股份有限公司 Forwarding table writing method and device and message forwarding method and device
CN102857414B (en) * 2012-08-20 2018-05-04 中兴通讯股份有限公司 A kind of forwarding table write-in, message forwarding method and device

Also Published As

Publication number Publication date
CN101197787A (en) 2008-06-11

Similar Documents

Publication Publication Date Title
CN101197787B (en) Packet information learning method and apparatus
CN104283806B (en) Business chain processing method and equipment
CN111382327B (en) Character string matching device and method
CN104615684B (en) A kind of mass data communication concurrent processing method and system
CN105812264B (en) The MAC address learning of multidiameter delay and the device and method of address search
CN103731355A (en) Method and system for avoiding Hash collision during MAC address learning
CN105704036B (en) Message forwarding method, device and system
CN101841438B (en) Method or system for accessing and storing stream records of massive concurrent TCP streams
CN102882810A (en) Rapid message transmitting method and device
US9083725B2 (en) System and method providing hierarchical cache for big data applications
CN101616099B (en) Method and device for refreshing hardware forwarding table and routing equipment
CN108306835A (en) A kind of the input-buffer structure and data forwarding method of Ethernet switch
CN109600313A (en) Message forwarding method and device
CN102325077B (en) Communication method among branches and egress routers of branches
CN105589664A (en) Virtual storage high-speed transmission method
CN107613529A (en) Message treatment method and base station
WO2018214652A1 (en) Method and apparatus for message transmission
CN101478482B (en) Non-rule matching method, apparatus and system in packet classification
CN103973571A (en) Network processor and routing searching method
CN102571936A (en) Method, device and system for searching data
CN105335307B (en) A kind of loading method and device of acl rule
CN103581024A (en) Learning method and device combining MAC address hardware and software
CN104394099B (en) A kind of message transmitting method and device
CN101237405B (en) Data buffer method and device
CN105743678A (en) Method and apparatus for managing table space of ternary content addressable memory (TCAM)

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

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: 20100825

Termination date: 20200103