Background technology
In exchanger system structure, be generally all by exchange chip and CPU (Central Processing Unit, in
Central processor) constitute, exchange chip is responsible for data message forwarding, and CPU is responsible for and controls, the not treatable report of exchange chip
Text is required for submitting CPU treatment, such as L2 (layer 2, data link layer) management message such as BPDU (bridge protocol data
Unit, BPDU), GVRP (Generic Attribute Registration Protocol, general-purpose attribute
Log-in protocol), ARP (Address Resolution Protocol, address resolution protocol);L3 (layer 3, Internet) management reports
Text such as RIP (Routing Information Protocol, routing information protocol), PIM (Protocol Independent
Multicast, Protocol Independent Multicast), OSPF (Open Shortest Path First, ospf),
VRRP (Virtual Router Redundancy Protocol, Virtual Router Redundacy Protocol), IGMP (Internet Group
Management Protocol, igmpinternet), ICMP (Internet Control Message Protocol, network control
Message protocol processed);Data message such as unknown unicast IP (Internet Protocol, procotol) message, unknown multicast report
Text, RPF (Reverse Path Forward, reverse path forwarding) failure message, various error messages.It is right that exchange chip needs
It is sent to that the data flow of CPU carries out classification by queue mode and priority classification is processed, and speed limit is carried out to the bandwidth of CPU,
To ensure that CPU is all without there is the situation of load too high under any circumstance, so as to provide the user a network rings for stabilization
Border.
The method of exchange chip identification protocol messages transmitted to CPU has a lot, such as BroadShield (shield wide), PDU
(Protocol Data Unit, protocol Data Unit), L2 forward tables, ACL (Access Control List, access control row
Table) on give, wherein sent in ACL modes, be using being at most also most flexible mode.It is commonly used in actual items,
To being seen off on protocol massages to have copy (duplication) behaviors and TRAP (trap) behavior.Copy behaviors are the message up sending of matching
CPU is a and then forwards portion again, and TRAP behaviors are message transmitted to CPU, are not forwarded.In mode being sent on ACL, they
Copy to CPU (copying to CPU) of corresponding A CL and redirect (redirection) behavior respectively.It is right in some exchange chips
The behavior of the copy to CPU at ACL, the message for above sending can only be in a queue, it is impossible to distinguish the queue of transmitted to CPU,
And redirect behaviors can specify matching protocol massages will on the cpu queue that send.So for the agreement of copy to CPU
Message, such as DHCP, ARP, OSPF, RIP etc. cannot distinguish between priority team with the protocol massages of copy behavior transmitted to CPU
Row, it is impossible to the priority scheduling of guarantee agreement message.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
The system architecture and business scenario of embodiment of the present invention description are to more clearly illustrate that the present invention is implemented
The technical scheme of example, does not constitute the restriction for technical scheme provided in an embodiment of the present invention, those of ordinary skill in the art
Understand, with the differentiation and the appearance of new business scene of system architecture, technical scheme provided in an embodiment of the present invention is for similar
Technical problem, it is equally applicable.
The technical term that embodiments of the invention are used includes as follows:
ACL:Accesses control list, uses TCAM (the ternary content addressable of exchange chip
Memory, a kind of three-state content addressing memory) the message identification function that device is realized is searched, it is a general function, no
Generally it is just as per money exchange chip function with manufacturer.
Internal loopback:It is that the protocol massages sent from the port of exchange chip are looped back to inside switching chip port again
A kind of message sends mechanism.
General principle of the invention is:Using redirect behaviors can specify matching message will on the CPU that send
Send destination interface for internal loopback port in the characteristic of queue, first modification copy behaviors, first port is received
Message protocol massages are copied to by internal loopback port by the first acl rule, then again internal loopback port pass through second
Protocol massages are redirected to the specified cpu queue that cpu port is specified by acl rule with redirect behaviors, and in copy
Sent in behavior and do not influence that protocol massages are forwarded to the behavior of other second ports during protocol massages.So as to match somebody with somebody again
The queue of the protocol massages by copy behavior transmitted to CPU is put, it is ensured that the priority scheduling of protocol massages.
The above method is described in detail with reference to specific embodiment.Shown in reference picture 1, embodiments of the invention should
For following switching equipment framework, including:The cpu port 121 of CPU11 and exchange chip 12, wherein exchange chip 12 passes through PCI
Bus 13 is connected to CPU11, and exchange chip 12 also includes first port PORT1 and second port PORT2 and internal loopback end
Mouth loopback1, wherein cpu port 121, first port PORT1, second port PORT2 and internal loopback port
Loopback1 can be nondistinctive port on exchange chip, simply right with the difference of its function in an embodiment of the present invention
Which employs different names.
Based on above-mentioned switching equipment framework, embodiments of the invention provide a kind of message up sending method, the institute of reference picture 2
Show, comprise the following steps:
101st, exchange chip receives protocol massages by first port, in first port according to the first acl rule by agreement
Message copies to destination interface, and destination interface is the internal loopback port of exchange chip.
Wherein, internal loopback port can be the special internal loopback port of exchange chip logic, or physically
The internal loopback port that idle port is set, wherein using idle port as internal loopback port when, also wrap before step 101
Include 100, exchange chip and any idle port of exchange chip is configured to internal loopback port.
Additionally, step 101 is that protocol massages are copied into internal loopback port by copy behaviors, while can also be right
Protocol massages are forwarded, and specially exchange chip is sent to second port protocol massages in first port, by the second end
Mouth sends to other equipment the protocol massages.The protocol massages of so forwarding are unaffected to be normally carried out by second port
Forwarding.
102nd, internally protocol massages are redirected to cpu port to exchange chip by loopback port according to the second acl rule
Specify cpu queue.
In addition optional, such scheme also includes that exchange chip receives the first acl rule and the 2nd ACL rule that CPU is issued
Then, the first acl rule and the second acl rule be issued to CPU the TCAM spaces of exchange chip here, the first acl rule it is excellent
Less than the priority of the second acl rule, i.e. the first acl rule is applied to whole exchange chip to first level, and mismatches any port,
Having any port to receive protocol massages and can match the first acl rule carries out subsequent treatment, and the second acl rule is only applied to
Internal loopback port enters on direction, i.e., only internally loopback port performs above-mentioned steps 102.So by the place of step 102
Exchange chip can specify different cpu queues to the different protocol massages for identifying after reason, without such as in the prior art
For the behavior of the copy to CPU at ACL, because destination interface is cpu port, the message for above sending can only be in a queue
In, it is impossible to distinguish the queue (as shown in the dotted arrow in Fig. 1) of transmitted to CPU.So that it is guaranteed that in the case of cpu port congestion,
Abandon the protocol massages of the cpu queue of low priority, it is ensured that the protocol massages in high priority cpu queue are dispatched.
In such scheme, exchange chip receives protocol massages by first port, in first port according to the first acl rule
Protocol massages are copied into destination interface, destination interface is the internal loopback port of exchange chip;It is first according to ACL rule
Protocol massages are then copied into internal loopback port using copy modes, then exchange chip internally loopback port according to second
Protocol massages are redirected to acl rule the specified cpu queue of cpu port, i.e., by redirect modes by internal loopback end
Mouth receives the specified cpu queue that protocol massages are redirected to cpu port, because redirect behaviors can change agreement report
The queue of literary transmitted to CPU, therefore the team of protocol massages by copy behavior transmitted to CPU has been reconfigured in above process
Row, it is ensured that the priority scheduling of protocol massages.
Embodiments of the invention shown in reference picture 2 provide a kind of exchange chip, including:First port PORT1, internal loopback
Port loopback1 and cpu port PORT3;
First port PORT1 is used to receive protocol massages, and the protocol massages are copied into purpose according to the first acl rule
Port, the destination interface is the internal loopback port of the exchange chip
loopback1;
Internal loopback port loopback1 is used for the protocol massages for replicating the first port according to the second acl rule
It is redirected to the specified cpu queue of the cpu port PORT3.
Optionally, also including dispensing unit CU, for any idle port of exchange chip to be configured into internal loopback end
Mouthful.
Optionally, exchange chip also includes that second port PORT2, first port PORT1 is additionally operable to the protocol massages
Send to second port PORT2;The protocol massages that the second port PORT2 is used to send the first port send
To other equipment.
Additionally, priority of the priority of first acl rule less than second acl rule.The cpu port
PORT3 is additionally operable to receive the first acl rule and the second acl rule that CPU is issued.
In such scheme, exchange chip receives protocol massages by first port, in first port according to the first acl rule
Protocol massages are copied into destination interface, destination interface is the internal loopback port of exchange chip;It is first according to ACL rule
Protocol massages are then copied into internal loopback port using copy modes, then exchange chip internally loopback port according to second
Protocol massages are redirected to acl rule the specified cpu queue of cpu port, i.e., by redirect modes by internal loopback end
Mouth receives the specified cpu queue that protocol massages are redirected to cpu port, because redirect behaviors can change agreement report
The queue of literary transmitted to CPU, therefore the team of protocol massages by copy behavior transmitted to CPU has been reconfigured in above process
Row, it is ensured that the priority scheduling of protocol massages.
Additionally, also provide it is a kind of calculate readable media (or medium), including carry out above-described embodiment when executed
The computer-readable instruction of the operation of method.
In addition, a kind of computer program product is also provided, including above computer readable media (or medium).
It should be understood that in various embodiments of the present invention, the size of the sequence number of above-mentioned each process is not meant to that execution is suitable
The priority of sequence, the execution sequence of each process should be determined with its function and internal logic, without the implementation of the reply embodiment of the present invention
Process constitutes any restriction.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein
Unit and algorithm steps, can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
Performed with hardware or software mode, depending on the application-specific and design constraint of technical scheme.Professional and technical personnel
Described function, but this realization can be realized it is not considered that exceeding using distinct methods to each specific application
The scope of the present invention.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method, can be with
Realize by another way.For example, apparatus embodiments described above are only schematical, for example, the unit
Divide, only a kind of division of logic function there can be other dividing mode when actually realizing, for example multiple units or component
Can combine or be desirably integrated into another system, or some features can be ignored, or do not perform.It is another, it is shown or
The coupling each other for discussing or direct-coupling or communication connection can be the indirect couplings of equipment or unit by some interfaces
Close or communicate to connect, can be electrical, mechanical or other forms.
The unit that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit
The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be according to the actual needs selected to realize the mesh of this embodiment scheme
's.
In addition, during each functional unit in each embodiment of the invention can be integrated in a processing unit, it is also possible to
It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.
If the function is to realize in the form of SFU software functional unit and as independent production marketing or when using, can be with
Storage is in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are used to so that a computer equipment (can be individual
People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the invention.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (English full name:Read-only memory, English letter
Claim:ROM), random access memory (English full name:Random access memory, English abbreviation:RAM), magnetic disc or light
Disk etc. is various can be with the medium of store program codes.
The above, specific embodiment only of the invention, but protection scope of the present invention is not limited thereto, and it is any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all contain
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.