CN108574637A - A kind of method, apparatus and interchanger of address learning - Google Patents
A kind of method, apparatus and interchanger of address learning Download PDFInfo
- Publication number
- CN108574637A CN108574637A CN201710132350.7A CN201710132350A CN108574637A CN 108574637 A CN108574637 A CN 108574637A CN 201710132350 A CN201710132350 A CN 201710132350A CN 108574637 A CN108574637 A CN 108574637A
- Authority
- CN
- China
- Prior art keywords
- source address
- message
- state
- address
- state table
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/36—Backward learning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/54—Organization of routing tables
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/66—Layer 2 routing, e.g. in Ethernet based MAN's
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention provides a kind of method, apparatus of address learning and interchangers, wherein this method includes:The matched first action instruction information of the first message for obtaining and receiving from the first flow table;Indicate that information copies the first source address corresponding with the first message in first state variable to according to the first action;The state table of address learning is used for according to first state variable update, wherein the second source address corresponding with the first message and the first source address mapping relations between the two to be stored in state table;Preset table is updated according to updated state table, wherein preset table is used for the result of storage address self study.Through the invention, solve the problems, such as OpenFlow networks in the related technology due to do not support two layer address acquisition and use and can not support the outer layer addresses self-learning function to be packaged needed for cascade net, and then achieved the effect that effective progress address learning.
Description
Technical field
The present invention relates to the communications fields, in particular to the method, apparatus and interchanger of a kind of address learning.
Background technology
For OpenFlow (open flows) network using the framework of control plane and Forwarding plane phase separation, Fig. 1 is according to correlation
The OpenFlow networking component configuration diagrams of technology.As shown in Figure 1, OpenFlow network-based control planes are controlled by OpenFlow
Device processed realizes that the Forwarding plane of OpenFlow networks realized by OpenFlow interchangers, OpenFlow controllers with
OpenFlow agreements are run between OpenFlow interchangers;OpenFlow controllers are handed over using OpenFlow agreements to OpenFlow
It changes planes and issues the flow table (Flow Table) comprising multiple entries (Entry) and a plurality of types of groups of tables (Group Table), flow
Table parameter includes matching field (Match Fields) and the instruction (Instructions) etc. comprising action (Actions), group
Table parameter includes set type (Group Type) and behavior aggregate (Action Buckets) etc., to reach control data forwarding
Purpose realizes the separation of data forwarding and route test.
According to the regulation of OpenFlow protocol specifications, if OpenFlow interchangers receive the report for not matching flow table
Text can then be encapsulated in the message in Packet_in message and be sent to the processing of OpenFlow controllers.By the rule being previously set
After then having handled, OpenFlow controllers can issue the flow table for matching the message to OpenFlow interchangers, subsequent same in this way
Class message can be matched to the flow table newly issued and independently complete message according to flow table and group table by OpenFlow interchangers
Forwarding.
The Message processing flow that existing OpenFlow protocol specifications define is a kind of stateless flow, all states letter
Breath is stored in OpenFlow controllers, and do so a disadvantage is exactly that the reaction speed of OpenFlow interchangers is inadequate
Soon, while also it is brought to the control channel between OpenFlow controllers and OpenFlow controllers and OpenFlow interchangers
Larger pressure.So industry propose one kind be referred to as open state (OpenState) technical solution it is existing to improve
OpenFlow protocol specifications so that OpenFlow interchangers itself can store some status informations and independent of controller
In the case of independently update correlated condition.Fig. 2 is the schematic diagram of OpenState technical solutions in the related technology, as shown in Fig. 2,
OpenState technical solutions introduce new state table (State Table), and state table is issued to by OpenFlow controllers
OpenFlow interchangers, state table include two parameters:Match key assignments (Match Key) and state value (State), wherein
What is indicated with key assignments is key assignments extractor (Key Extractor) according to from key made of some field combinations extracted in message
Value, state value are then attached on the successful message of matching status table, flow table (Flow Table) are entered together with message, flow table exists
It is new matching word that state value (State) is increased on the basis of the flow table matching field that existing OpenFlow protocol specifications define
Section, in addition flow table increases the action (Action) of setting state (Set-State) for the message of successful match, which can
New state value (Next_State), new state value and another key assignments extractor (Key Extractor) is arranged from report
The key assignments extracted in text for updating state table, thereby realizes OpenFlow interchangers institute storage state information together
It automatically updates.
There are two types of the function of address learning in existing network, one is Media access contorl (Media Access
Control, referred to as MAC) address learning function, in the network that is forwarded based on MAC Address, the network equipment to pass through study
The source MAC of received packet and the correspondence of inbound port generate new mac address forwarding table or the existing MAC of update
Addresses forwarding table;Another kind is outer layer addresses self-learning function to be packaged, is used in cascade net (Overlay Network), side
The edge network equipment by learn received packet outer layer source address and internal layer source address mapping relations, with generating new outer layer
Location encapsulating sheet or the existing outer layer addresses encapsulating sheet of update.Cascade net is a kind of widely used network type, and Fig. 3 is according to phase
The schematic network structure of the cascade net of pass technology, as shown in figure 3, in cascade net not comprising two kinds of fringe node and intermediate node
The network equipment of same type, for user equipment by connecting fringe node to access cascade net, the characteristics of cascade net is fringe node
All messages for entering cascade net by user-side port can be directed to and add outer envelope, include to be used for middle node in outer envelope
The outer layer source address and outer layer destination address of point forwarding, wherein outer layer source address are directed toward this destination edge section of addition outer envelope
Point, the distally directed fringe node of outer layer destination address, and add the source address of the message before outer envelope and destination address is adding
It is still carried in messages as internal layer source address and internal layer destination address after adding outer envelope.Remote edge node synchronization passes through network side
Port receives be added to the message of outer envelope after, the mapping between the outer layer source address and internal layer source address of message can be closed
System carries out self study, and mapping relations between this address are preserved, as the fringe node to subsequent from this edge section
Point adds the foundation of outer envelope, this outer layer addresses self-learning function to be packaged namely above-mentioned into the message of cascade net.
The OpenState technical solutions that industry proposes are by the extension to OpenFlow protocol specifications, although can support
MAC Address self-learning function, but can not still support the outer layer addresses self-learning function to be packaged needed for cascade net, at present also still
Effective solution scheme is not proposed.
Invention content
A kind of method, apparatus and interchanger of address learning are provided in the embodiment of the present invention, at least to solve correlation
In technology OpenFlow networks due to do not support two layer address acquisition and use and can not support to be packaged needed for cascade net
The problem of outer layer addresses self-learning function.
According to one embodiment of present invention, a kind of method of address learning is provided, including:It is obtained from the first flow table
The matched first action instruction information of the first message for taking and receiving;It will be with described the according to the first action instruction information
Corresponding first source address of one message copies in first state variable;It is used for address certainly according to the first state variable update
The state table of study, wherein the second source address corresponding with first message and described first are stored in the state table
Source address mapping relations between the two;Preset table is updated according to the updated state table, wherein the preset table is used for
Store the result of described address self study.
Optionally, the state table according to the first state variable update for address learning includes:From described first
Second source address of first message is extracted in message;According to second source address and the first state variable
Update the state table.
Optionally, include according to state table described in second source address and the first state variable update:Described
Second source address is searched in state table;In the case where not finding second source address, created in the state table
Build state entry corresponding with second source address, wherein the state entry created is for recording second source
Address and with the mapping relations between first source address that is carried in the first state variable.
Optionally, after second source address is searched in the state table, further include:Finding second source
In the case of address, the third source address with second source address matches stored in the state table is judged, and it is described
Whether first source address carried in first state variable is identical;In the state table with second source address matches
The third source address, with carried in the first state variable the first source address difference when, by the state table
In the third source address replace with first source address.
Optionally, include according to the updated state table update preset table:It generates and updates in the preset table
The corresponding matching field of second source address in the state table afterwards;By described in the updated state table
One source address is embedded into the preset table in the second action instruction information corresponding with the matching field, wherein described the
Two action instruction information are used to indicate executes predetermined operation according to first source address.
Optionally, after according to the updated state table update preset table, further include:The second message is received,
In, the destination address of second message and second source address corresponding with first message are identical;According to it is described
The corresponding matching field of destination address obtains the second action instruction information from the preset table;It is acted according to described second
The instruction for indicating information executes the predetermined operation according to first source address to second message.
Optionally, executing the predetermined operation to second message according to first source address includes:According to described
First source address encapsulates second message;Alternatively, exporting second message according to first source address.
Optionally, the matched first action instruction information of the first message for obtaining and receive from the first flow table it
Before, further include:Receive the flow table that open flows controller issues, the state table and the preset table;After according to update
The state table update preset table after, further include:The updated preset table is reported to the open flows controller.
Optionally, the preset table is one of the following:Second flow table, group table.
According to another embodiment of the invention, a kind of device of address learning is provided, including:First obtains mould
Block, the matched first action instruction information of the first message for obtaining and receiving from the first flow table;Module is copied, is used for
The first source address corresponding with first message is copied in first state variable according to the first action instruction information;
First update module, the state table for being used for address learning according to the first state variable update, wherein the state
The second source address corresponding with first message and first source address mapping relations between the two are stored in table;The
Two update modules, for updating preset table according to the updated state table, wherein the preset table is for storing describedly
The result of location self study.
Optionally, first update module is additionally operable to extract the institute of first message from first message
State the second source address;According to state table described in second source address and the first state variable update.
Optionally, first update module includes:Searching unit, for searching second source in the state table
Address;Creating unit is created and described the in the state table in the case where not finding second source address
The corresponding state entry of two source addresses, wherein the state entry created for record second source address and with institute
State the mapping relations between first source address carried in first state variable.
Optionally, first update module further includes:Judging unit, for searching described second in the state table
After source address, in the case where finding second source address, judge to store in the state table with described second
Whether first source address carried in the third source address of source address matches, with the first state variable is identical;It replaces
Unit, for, with the third source address of second source address matches, becoming with the first state in the state table
When the first source address difference carried in amount, the third source address in the state table is replaced with into first source
Address.
Optionally, second update module is additionally operable to generate and the updated state table in the preset table
In the corresponding matching field of second source address;It is embedded by first source address in the updated state table
Into the second action instruction information corresponding with the matching field in the preset table, wherein the second action instruction letter
Breath is used to indicate executes predetermined operation according to first source address.
Optionally, described device further includes:First receiving module, for being updated in advance according to the updated state table
If after table, receiving the second message, wherein the destination address of second message and corresponding with first message described the
Two source addresses are identical;Second acquisition module, for basis matching field corresponding with the destination address from the preset table
Obtain the second action instruction information;Execution module, for the instruction according to the second action instruction information, according to described
First source address executes the predetermined operation to second message.
Optionally, the execution module is additionally operable to encapsulate second message according to first source address;Alternatively, pressing
Second message is exported according to first source address.
Optionally, described device further includes:Second receiving module, in for obtaining and receiving from the first flow table
Before the matched first action instruction information of one message, receive the flow table that issues of open flows controller, the state table and
The preset table;Reporting module, for after according to the updated state table update preset table, flow control to be opened to described
Device processed reports the updated preset table.
According to still another embodiment of the invention, a kind of interchanger is provided, including:Processor and memory, wherein institute
Processor is stated, the matched first action instruction information of the first message for obtaining and receiving from the first flow table;According to institute
The first action instruction information is stated to copy the first source address corresponding with first message in first state variable to;According to institute
State state table of the first state variable update for address learning, wherein be stored in the state table and first report
Literary corresponding second source address and first source address mapping relations between the two;More according to the updated state table
New preset table, wherein the preset table is used to store the result of described address self study;The memory, it is described for storing
First flow table, the state table and the preset table.
Optionally, the processor is additionally operable to extract described the second of first message from first message
Source address;According to state table described in second source address and the first state variable update.
Optionally, the processor is additionally operable to search second source address in the state table;Institute is not being found
In the case of stating the second source address, state entry corresponding with second source address is created in the state table, wherein institute
Create the state entry be used for record second source address and with carried in the first state variable described first
The mapping relations between source address.
Optionally, the processor is additionally operable to after searching second source address in the state table, is finding
In the case of second source address, judge to store in the state table with the third source of second source address matches
Whether first source address carried in location, with the first state variable is identical;With described second in the state table
The third source address of source address matches, with carried in the first state variable the first source address difference when, will
The third source address in the state table replaces with first source address.
Optionally, the processor is additionally operable to generate in the preset table and the institute in the updated state table
State the corresponding matching field of the second source address;By first source address in the updated state table, it is embedded into described
In preset table in the second action instruction information corresponding with the matching field, wherein the second action instruction information is used for
Instruction executes predetermined operation according to first source address.
Optionally, the interchanger further includes:First transmitting device, wherein the transmitting device, for according to update
Afterwards the state table update preset table after, receive the second message, wherein the destination address of second message and with it is described
Corresponding second source address of first message is identical;The processor is additionally operable to according to corresponding with the destination address
The second action instruction information is obtained from the preset table with field;The instruction of information is indicated according to second action,
The predetermined operation is executed to second message according to first source address.
Optionally, the processor is additionally operable to encapsulate second message according to first source address;Alternatively, according to
First source address exports second message.
Optionally, the interchanger further includes:Second transmitting device, wherein second transmitting device, for from the
Before the matched first action instruction information of the first message for obtaining and receiving in one flow table, receives open flows controller and issue
The flow table, the state table and the preset table;After according to the updated state table update preset table, to institute
It states open flows controller and reports the updated preset table.
According to still another embodiment of the invention, a kind of storage medium is additionally provided.The storage medium is set as storage and uses
In the program code for executing following steps:The matched first action instruction of the first message for obtaining and receiving from the first flow table
Information;The first source address corresponding with first message is copied to first state according to the first action instruction information to become
In amount;According to the first state variable update be used for address learning state table, wherein be stored in the state table with
Corresponding second source address of first message and first source address mapping relations between the two;According to updated institute
State state table update preset table, wherein the preset table is used to store the result of described address self study.
Optionally, storage medium is also configured to store the program code for executing following steps:According to first shape
State variable is updated includes for the state table of address learning:It is extracted from first message described in first message
Second source address;According to state table described in second source address and the first state variable update.
Optionally, storage medium is also configured to store the program code for executing following steps:According to second source
State table includes described in address and the first state variable update:Second source address is searched in the state table;
In the case of not finding second source address, status bar corresponding with second source address is created in the state table
Mesh, wherein the state entry created is for recording second source address and being carried with the first state variable
First source address between the mapping relations.
Optionally, storage medium is also configured to store the program code for executing following steps:In the state table
After searching second source address, further include:In the case where finding second source address, judge in the state table
The third source address with second source address matches of middle storage, with first source carried in the first state variable
Whether address is identical;In the state table with the third source address of second source address matches, with first shape
When the first source address difference carried in state variable, the third source address in the state table is replaced with described
One source address.
Optionally, storage medium is also configured to store the program code for executing following steps:According to updated institute
Stating state table update preset table includes:It is generated in the preset table with second source in the updated state table
The corresponding matching field in location;By first source address in the updated state table, be embedded into the preset table with
The matching field corresponding second acts in instruction information, wherein the second action instruction information is used to indicate according to institute
It states the first source address and executes predetermined operation.
Optionally, storage medium is also configured to store the program code for executing following steps:According to updated
After the state table update preset table, further include:Receive the second message, wherein the destination address of second message and with
Corresponding second source address of first message is identical;According to matching field corresponding with the destination address from described pre-
If obtaining the second action instruction information in table;According to the instruction of the second action instruction information, according to first source
Address executes the predetermined operation to second message.
Optionally, storage medium is also configured to store the program code for executing following steps:According to first source
Address executes the predetermined operation to second message:Second message is encapsulated according to first source address;Or
Person exports second message according to first source address.
Optionally, storage medium is also configured to store the program code for executing following steps:From the first flow table
Before the matched first action instruction information of the first message for obtaining and receiving, further include:Open flows controller is received to issue
The flow table, the state table and the preset table;After according to the updated state table update preset table, also wrap
It includes:The updated preset table is reported to the open flows controller.
Through the invention, the first source address information is obtained by the first flow table, passes through the state table for address learning
The mapping relations between the first source address and the second source address are got, then are gone by state table to update storage address learning result
Preset table pass through and carry out two source addresses of internal layer and outer layer for the state table of address learning due to the use of three tables
Study, can support the acquisition and use of two layer address, therefore, can solve in the related technology OpenFlow networks due to not
Support two layer address acquisition and use and the problem of can not support the outer layer addresses self-learning function to be packaged needed for cascade net,
Achieve the effect that effectively to carry out address learning.
Description of the drawings
Attached drawing described herein is used to provide further understanding of the present invention, and is constituted part of this application, this hair
Bright illustrative embodiments and their description are not constituted improper limitations of the present invention for explaining the present invention.In the accompanying drawings:
Fig. 1 is the OpenFlow networking component configuration diagrams according to the relevant technologies;
Fig. 2 is the schematic diagram of OpenState technical solutions in the related technology;
Fig. 3 is the schematic network structure according to the cascade net of the relevant technologies;
Fig. 4 is the hardware block diagram of the interchanger of the method for the address learning of the embodiment of the present invention;
Fig. 5 is the flow chart of the method for address learning according to the ... of the embodiment of the present invention;
Fig. 6 is the flow diagram of the method for address learning according to the preferred embodiment of the invention;
Fig. 7 is the schematic diagram according to the preferred embodiment of the invention for realizing MAC Address self-learning function;
Fig. 8 is the schematic diagram according to the preferred embodiment of the invention for realizing outer layer addresses self-learning function to be packaged;
Fig. 9 is the structure diagram one of the device of address learning according to the ... of the embodiment of the present invention;
Figure 10 be address learning according to the ... of the embodiment of the present invention device in the first update module 96 structure diagram one;
Figure 11 be address learning according to the ... of the embodiment of the present invention device in the first update module 96 structure diagram two;
Figure 12 is the structure diagram two of the device of address learning according to the ... of the embodiment of the present invention;
Figure 13 is the structure diagram three of the device of address learning according to the ... of the embodiment of the present invention;
Figure 14 is the structure diagram one of interchanger according to the ... of the embodiment of the present invention;
Figure 15 is the structure diagram two of interchanger according to the ... of the embodiment of the present invention;
Figure 16 is the structure diagram three of interchanger according to the ... of the embodiment of the present invention.
Specific implementation mode
Come that the present invention will be described in detail below with reference to attached drawing and in conjunction with the embodiments.It should be noted that not conflicting
In the case of, the features in the embodiments and the embodiments of the present application can be combined with each other.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.
Embodiment 1
The embodiment of the method that the embodiment of the present application 1 is provided can be in interchanger, interchanger, terminal or similar
Arithmetic unit in execute.For running on switches, Fig. 4 is the friendship of the method for the address learning of the embodiment of the present invention
The hardware block diagram changed planes.As shown in figure 4, interchanger 40 may include one or more (only showing one in figure) processors
42 (processor 42 can include but is not limited to the processing unit of Micro-processor MCV or programmable logic device FPGA etc.) are used for
Store the memory 44 of data and the transmitting device 46 for communication function.It will appreciated by the skilled person that figure
Structure shown in 4 is only to illustrate, and does not cause to limit to the structure of above-mentioned electronic device.For example, interchanger 40 may also include
More either less components or with the configuration different from shown in Fig. 4 than shown in Fig. 4.
Memory 44 can be used for storing the software program and module of application software, certainly such as the address in the embodiment of the present invention
Corresponding program instruction/the module of method of study, processor 42 by operation be stored in software program in memory 44 and
Module realizes above-mentioned method to perform various functions application and data processing.Memory 44 may include that high speed is random
Memory may also include nonvolatile memory, such as one or more magnetic storage device, flash memory or other are non-volatile
Property solid-state memory.In some instances, memory 44 can further comprise the memory remotely located relative to processor 42,
These remote memories can pass through network connection to interchanger 40.The example of above-mentioned network includes but not limited to internet, enterprise
Industry intranet, LAN, mobile radio communication and combinations thereof.
Transmitting device 46 is used to receive via a network or transmission data.Above-mentioned network specific example may include handing over
The wireless network that 40 communication providers of changing planes provide.In an example, transmitting device 46 includes a network adapter
(Network Interface Controller, NIC), can be connected with other network equipments by base station so as to interconnection
Net is communicated.In an example, transmitting device 46 can be radio frequency (Radio Frequency, RF) module, be used to lead to
Wireless mode is crossed to be communicated with internet.
A kind of method for the address learning running on above-mentioned interchanger is provided in the present embodiment, and Fig. 5 is according to this
The flow chart of the method for the address learning of inventive embodiments, as shown in figure 5, the flow includes the following steps:
Step S502, the matched first action instruction information of the first message for obtaining and receiving from the first flow table;
Step S504 indicates that information copies the first source address corresponding with the first message to first shape according to the first action
In state variable;
Step S506 is used for the state table of address learning according to first state variable update, wherein stored in state table
There are the second source address corresponding with the first message and the first source address mapping relations between the two;
Step S508 updates preset table, wherein preset table is for storage address self study according to updated state table
As a result.
Through the above steps, the first source address information is obtained by the first flow table, passes through the state for address learning
Table gets the mapping relations between the first source address and the second source address, then is gone by state table to update storage address learning knot
The preset table of fruit, solve OpenFlow networks in the related technology due to do not support two layer address acquisition and use and can not prop up
The problem of holding the outer layer addresses self-learning function to be packaged needed for cascade net, enabling address learning is effectively performed.
Optionally, the executive agent of above-mentioned steps can be interchanger, terminal etc., but not limited to this.
Optionally, the first source address can be the inbound port of the first message or the outer layer source address of message;Second source
Address can be address media access control (Media Access Control, referred to as MAC) of the first message, can also be
The internal layer source address of first message.
Optionally, in step S506, various ways update state table may be used, for example, can be from the first message
The second source address for extracting the first message, according to the second source address and first state variable update state table.Carrying out second
When the acquisition of source address, key assignments extractor can be used to extract the second source address of the message from the first message.
Optionally, when according to the second source address and first state variable update state table, can in the following way into
The update of row state table:Search the second source address in state table, the result of lookup can there are two types of, it is as follows:
In the case where not finding the second source address, status bar corresponding with the second source address is created in state table
Mesh, wherein first source address of the state entry created for recording the second source address and with being carried in first state variable
Between mapping relations;
In the case where finding the second source address, the third with the second source address matches stored in state table is judged
Whether the first source address carried in source address, with first state variable is identical;In state table with the second source address matches
When the first source address difference carried in third source address, with first state variable, the third source address in state table is replaced
For the first source address;In state table with the third source address of the second source address matches, with carried in first state variable
When one source address difference, state table can not be handled.
Optionally, in step S508, various ways update preset table may be used, for example, can be given birth in preset table
At matching field corresponding with the second source address in updated state table;By the first source in updated state table
Location is embedded into preset table in the second action instruction information corresponding with matching field, wherein the second action instruction information is used for
Instruction executes predetermined operation according to the first source address.
Optionally, after updating preset table according to updated state table, the second message can also be received, wherein the
The destination address of two messages and the second source address corresponding with the first message are identical;According to matching field corresponding with destination address
The second action instruction information is obtained from preset table;The instruction that information is indicated according to the second action, according to the first source address pair the
Two messages execute predetermined operation.It is since the destination address of the second message is identical as the second source address, then corresponding with destination address
Matching field and matching field corresponding with the second source address are identical, according to matching field corresponding with destination address from pre-
If the action instruction information obtained in table, as aforementioned second action instruction information.
Optionally, executing predetermined operation according to first the second message of source address pair can be there are many mode, for example, can be by
The second message is encapsulated according to the first source address, for example, the second message addition outer envelope can be given and use the first source address conduct
The destination address of message;The second message can also be exported according to the first source address, for example, exported from the first source address, that is,
Second message is exported from the first source address.
Optionally, what aforementioned first flow table, state table and preset table can be received by OpenFlow controllers, for example,
Before step S502, the first flow table that open flows controller (OpenFlow controllers) issues can be received, state table and default
Table;And after step s 508, updated preset table can also be reported to open flows controller.The opportunity of above-mentioned reception operation
Can be set as needed, for example, the first flow table, state table and preset table issue can be based on this equipment (for example,
OpenFlow interchangers) send request message carry out, or according to preset sending cycle carry out, or
It is that OpenFlow controllers are actively issued according to the current state of interchanger (network condition, treatment effeciency etc.).Preset table
It reports and is carried out immediately after can updating, can also be periodically to carry out, can also be and meet preset condition (timeline
The resource occupation condition etc. of part, network condition, equipment) carry out afterwards.
Optionally, preset table can be the second flow table, can also be a group table.The type of specific preset table according to
Based on above-described embodiment and preferred embodiment, to illustrate the whole flow process interaction of scheme, in this preferred embodiment
In, provide a kind of method of address learning.
The method of the address learning provided in the preferred embodiment, is accomplished by the following way address learning:
Controller issues flow table, address learning state table and the storage address self study knot for obtaining message status information to the network equipment
The flow table of fruit;The flow table that the message that the network equipment receives can enter acquisition message status information first is handled, the flow table meeting
The status information of message is copied to new state, then using new state and message source address, adaptive learning table in location carries out over the ground
Update;Using each entry of address learning state table matching key assignments and state value to the flow table of storage address self study result into
Row update.
The method of the address learning of the preferred embodiment of the present invention is illustrated with reference to Fig. 6.As shown in fig. 6, should
The method of address learning specifically includes following steps:
Step A, controller issue the flow table for obtaining message status information, address learning state table to the network equipment and deposit
Store up the flow table of address learning result.
The flow table (effect is with aforementioned first-class table) of message status information is obtained for the relevant status information (example of message
Such as, the inbound port of message, the outer layer source address of message are acted on aforementioned first source address) copying new state to, (effect is the same as aforementioned
Status information variable), the matching field of the flow table is " message for needing address learning ", and corresponding action is " copy message
Status information is to new state (Next_State) " (effect is with aforementioned first action instruction information);Address learning state table (is made
With with being previously used for the state table of address learning) for recorded message source address information (effect is with aforementioned second source address) and
The message status information acquired in the flow table of message status information is obtained, the matching key assignments of the state table is message source address, shape
State value is message status information;Address learning state table is using matching key assignments and state value to storage address self study result
Flow table is updated, and the matching field of the flow table (effect is with aforementioned preset table) of storage address self study result is " comprising matching
The matching field of key assignments ", corresponding action are that " using state value as the action of parameter " (effect is the same as aforementioned second action instruction letter
Breath).
Step B, the flow table that the message that the network equipment receives can enter acquisition message status information first are handled, the stream
The status information of message can be copied to new state by table, then use new state and message source address location adaptive learning table over the ground
It is updated.
After message (effect is with aforementioned first message) enters the flow table for obtaining message status information, " needed using matching field
Want the message of address learning " it is matched, for example, if being shown all into networking as matching field using asterisk wildcard
The message of network equipment will carry out address learning.For the message of successful match, executing action, " copy message status information arrives
The status information of message is copied to new state by new state ", and key assignments extractor can extract message source address from message, so
Address adaptive learning table is updated with message source address and new state afterwards, so, address learning state table is just
Have recorded the message source address information and message status information acquired in address learning.
Step C, using the matching key assignments and state value of each entry of address learning state table to storage address self study knot
The flow table of fruit is updated.
The matching key assignments of each entry of address learning state table has recorded with state value acquired in address learning respectively
Message source address information and message status information, using matching key assignments and state value to the flow table of storage address self study result into
Row update, that is, go to update storage in the flow table of address learning result with the matching key assignments of address adaptive learning table
With key assignments, remove to update storage the state value in the flow table of address learning result with the state value of address adaptive learning table.Such as
The matching key assignments of some entry of fruit address learning state table be storage address self study result flow table in be not present, then exist
Increase new flow table entry in the flow table of storage address self study result;If the matching of some entry of address learning state table
Key assignments is will not then to increase new flow table entry present in the flow table of storage address self study result, but update storage ground
Existing flow table entry in the flow table of location self study result.
After the flow table of storage address self study result obtains update, the network equipment needs after controller report updates
Flow table.
The method of the address learning of this preferred embodiment is illustrated with reference to two examples.
Example 1
Fig. 7 is the schematic diagram according to the preferred embodiment of the invention for realizing MAC Address self-learning function.As shown in fig. 7,
In this example, the step of OpenFlow controllers are executed with OpenFlow interchangers, is as follows:
Step 1, OpenFlow controllers issue the flow table for obtaining message ingress port information, address to OpenFlow interchangers
The flow table of adaptive learning table and storage address self study result.
The matching field for obtaining the flow table of message ingress port information is " asterisk wildcard ", and corresponding action is " copy<Message
Inbound port>To new state ";The matching key assignments of address learning state table is " source MAC of message ", and state value is " message
Inbound port ";The matching field of the flow table of storage address self study result be "<The target MAC (Media Access Control) address of message>", it is corresponding dynamic
As " from<The exit port of message>Output ".
Step 2, the message that OpenFlow interchangers receive can enter the flow table progress for obtaining message ingress port information first
The ingress port information of message can be copied to new state by processing, the flow table, then use the source MAC pair of new state and message
Address learning state table is updated.
After message enters the flow table for obtaining message ingress port information, matched using matching field " asterisk wildcard ", namely
All messages into OpenFlow interchangers all can successful match action " copy is executed for the message of successful match<Report
The inbound port of text>To new state " ingress port information of message copied to new state, the inbound port of message is exactly that the flow table is obtained
The message related status information taken, and key assignments extractor can extract the source MAC of outgoing packet from message, then use message
Source MAC and inbound port are updated address adaptive learning table, in this way, address learning state table just has recorded address
The source MAC of message acquired in self study and the inbound port of message.
Step 3, using the matching key assignments of each entry of address learning state table and state value to storage address self study knot
The flow table of fruit is updated.
The matching key assignments of each entry of address learning state table has recorded with state value acquired in address learning respectively
The source MAC of message and the inbound port of message, using matching key assignments with state value to the flow table of storage address self study result
It is updated, that is, goes to update storage address learning result with the source MAC of the message of address adaptive learning table
Matching field in flow table<The target MAC (Media Access Control) address of message>(effect is with aforementioned matching field), with address adaptive learning table
The inbound port of message removes to update storage the action parameter in the flow table of address learning result<The exit port of message>, reach from<
The exit port of message>The purpose that message is forwarded.If the source MAC of the message of some entry of address learning state table
Location be the flow table of storage address self study result matching field in be not present, then in the flow table of storage address self study result
It is middle to increase new flow table entry, and come using the inbound port of the source MAC of the message in address learning state table and message
Update above-mentioned newly-increased flow table entry;If the source MAC of the message of some entry of address learning state table is storage
Present in the matching field of the flow table of location self study result, then it will not increase new flow table entry, but directly use address
Existing flow table entry in flow table of the inbound port of message in adaptive learning table to update storage address learning result.
After the flow table of storage address self study result obtains update, OpenFlow interchangers need to control to OpenFlow
Device processed reports updated flow table.
Example 2
Fig. 8 is the schematic diagram according to the preferred embodiment of the invention for realizing outer layer addresses self-learning function to be packaged.Such as Fig. 8
Shown, in this example, OpenFlow controllers will execute as follows with the OpenFlow interchangers as cascade net fringe node
Step:
Step 1, OpenFlow controllers to OpenFlow interchangers issue obtain packet outer layer source address information flow table,
The flow table of address learning state table and storage address self study result.
The matching field for obtaining the flow table of packet outer layer source address information is " inbound port of message is network-side port ", phase
The action answered is " copy<The outer layer source address of message>To new state ";The matching key assignments of address learning state table is " message
Internal layer source address ", state value be " the outer layer source address of message ";The matching field of the flow table of storage address self study result is
" inbound port of message be user-side port+<The destination address of message>", that is, it is user to meet the inbound port of message simultaneously
The destination address of side ports and message is some value, and corresponding action is " to add outer envelope to message and use<Message
Outer layer destination address>Outer layer destination address as message ".
Step 2, the message that OpenFlow interchangers receive can enter the flow table for obtaining packet outer layer source address information first
It is handled, which can copy new state to the outer layer source address information of message, then use the interior of new state and message
Layer source address is updated address adaptive learning table.
After message enters the flow table for obtaining message ingress port information, using matching field, " inbound port of message is network side
The message meeting successful match that port " is matched namely OpenFlow interchangers are received from network-side port, for successful match
Message, execute action " copy<The outer layer source address of message>To new state " the outer layer source address information of message is copied to newly
State, the outer layer source address of message is exactly the message related status information acquired in the flow table, and key assignments extractor can be from message
The internal layer source address of middle extraction outgoing packet, then with the internal layer source address of message and outer layer source address to address adaptive learning table
It is updated, in this way, address learning state table just has recorded the internal layer source address and report of the message acquired in address learning
The outer layer source address of text.
Step 3, using the matching key assignments of each entry of address learning state table and state value to storage address self study knot
The flow table of fruit is updated.
The matching key assignments of each entry of address learning state table has recorded with state value acquired in address learning respectively
The internal layer source address of message and the outer layer source address of message, using matching key assignments with state value to storage address self study result
Flow table is updated, that is, goes to update storage address learning knot with the internal layer source address of the message of address adaptive learning table
In the flow table of fruit<The destination address of message>, go to update storage ground with the outer layer source address of the message of address adaptive learning table
Action parameter in the flow table of location self study result<The outer layer destination address of message>.If address learning state table some
The internal layer source address of purpose message be the flow table of storage address self study result matching field in be not present, then in storage
Increase new flow table entry in the flow table of location self study result, and using the internal layer source of the message in address learning state table
The outer layer source address of location and message updates above-mentioned newly-increased flow table entry;If the report of some entry of address learning state table
The internal layer source address of text is will not then to increase new flow table present in the matching field of the flow table of storage address self study result
Entry, but directly address learning result is updated storage using the outer layer source address of the message in address learning state table
Flow table in existing flow table entry.
After the flow table of storage address self study result obtains update, OpenFlow interchangers need to control to OpenFlow
Device processed reports updated flow table.
In addition, other than using flow table to carry out storage address self study result, storage address can also be carried out using group table certainly
Learning outcome.An advantage using group table is the destination address that can store a message simultaneously and message after multiple encapsulation
Therefore the mapping relations of outer layer destination address can support the multiple of message source address acquired in address learning and acquisition
The correspondence of message status, this is possible to needs in the outer layer addresses self-learning function to be packaged of cascade net.
The above-mentioned technical proposal of preferred embodiment through the invention gets message respectively by using flow table and state table
Two source addresses so that OpenFlow networks can support simultaneously based on MAC forwarding network needed for MAC Address self-learning function
With the outer layer addresses self-learning function to be packaged needed for cascade net.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical scheme of the present invention is substantially in other words to existing
The part that technology contributes can be expressed in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
Additionally provide a kind of device of address learning in the present embodiment, the device is for realizing above-described embodiment and excellent
Embodiment is selected, repeating no more for explanation had been carried out.As used below, predetermined function may be implemented in term " module "
Software and/or hardware combination.Although device described in following embodiment is preferably realized with software, hardware,
Or the realization of the combination of software and hardware is also that may and be contemplated.
Fig. 9 is the structure diagram one of the device of address learning according to the ... of the embodiment of the present invention, as shown in figure 9, the device
Including:
First acquisition module 92, matched first action of the first message for obtaining and receiving from the first flow table refer to
Show information;
Module 94 is copied, above-mentioned first acquisition module 92 is connected to, for indicating that information will be with first according to the first action
Corresponding first source address of message copies in first state variable;
First update module 96 is connected to above-mentioned copy module 94, for being used for address according to first state variable update
The state table of self study, wherein both the second source address corresponding with the first message and first source address are stored in state table
Between mapping relations;
Second update module 98 is connected to above-mentioned first update module 96, pre- for being updated according to updated state table
If table, wherein preset table is used for the result of storage address self study.
Optionally, the first update module 96, with can be also used for the second source that the first message is extracted from the first message
Location;According to the second source address and first state variable update state table.
Figure 10 be address learning according to the ... of the embodiment of the present invention device in the first update module 96 structure diagram one,
As shown in Figure 10, which includes:
Searching unit 102, for searching the second source address in state table;
Creating unit 104 is connected to above-mentioned searching unit 102, in the case where not finding the second source address,
State entry corresponding with the second source address is created in state table, wherein the state entry created is for recording the second source
Location and with the mapping relations between the first source address for being carried in first state variable.
Figure 11 be address learning according to the ... of the embodiment of the present invention device in the first update module 96 structure diagram two,
As shown in figure 11, which further includes:
Judging unit 112 is connected to above-mentioned searching unit 102, after searching the second source address in state table,
In the case of finding the second source address, judge it is being stored in state table with the second source address matches third source addresses, with
Whether the first source address carried in first state variable is identical;
Replacement unit 114 is connected to above-mentioned judging unit 112, in state table with the second source address matches the
When the first source address difference carried in three source addresses, with first state variable, the third source address in state table is replaced with
First source address.
Optionally, the second update module 98 can be also used for generating in preset table and the in updated state table
The corresponding matching field of two source addresses;By the first source address in updated state table, it is embedded into preset table and matches word
Section corresponding second acts in instruction information, wherein the second action instruction information is used to indicate to be executed in advance according to the first source address
Fixed operation.
Figure 12 is the structure diagram two of the device of address learning according to the ... of the embodiment of the present invention, as shown in figure 12, the dress
It sets in addition to including all modules shown in Fig. 9, further includes:
First receiving module 122, for after updating preset table according to updated state table, receiving the second message,
Wherein, the destination address of the second message and the second source address corresponding with the first message are identical;
Second acquisition module 124 is connected to above-mentioned first receiving module 122, for according to corresponding with destination address
The second action instruction information is obtained from preset table with field;
Execution module 126 is connected to above-mentioned second acquisition module 124, the instruction for indicating information according to the second action,
Predetermined operation is executed according to first the second message of source address pair.
Optionally, execution module 126 can be also used for encapsulating the second message according to the first source address;Alternatively, according to first
Source address exports the second message.
Figure 13 is the structure diagram three of the device of address learning according to the ... of the embodiment of the present invention, as shown in figure 13, the dress
It sets in addition to including all modules shown in Fig. 9, further includes:
Second receiving module 132, for dynamic in the first message matched first for obtaining and receiving from the first flow table
Before making instruction information, the flow table that open flows controller issues, state table and preset table are received;
Reporting module 134 is connected to above-mentioned second receiving module 132, for being updated in advance according to updated state table
If after table, updated preset table is reported to open flows controller.
Optionally, above-mentioned preset table can be one of the following:Second flow table, group table.
It should be noted that above-mentioned modules can be realized by software or hardware, for the latter, Ke Yitong
Following manner realization is crossed, but not limited to this:Above-mentioned module is respectively positioned in same processor;Alternatively, above-mentioned modules are with arbitrary
The form of combination is located in different processors.
Embodiment 3
A kind of interchanger is additionally provided in the present embodiment, and the interchanger is for realizing above-described embodiment and preferred implementation side
Formula had carried out repeating no more for explanation.
Figure 14 is the structure diagram one of interchanger according to the ... of the embodiment of the present invention, and as shown in figure 14, which includes:Processing
Device 142 and memory 144, wherein
Processor 142, the matched first action instruction letter of the first message for obtaining and receiving from the first flow table
Breath;Indicate that information copies the first source address corresponding with the first message in first state variable to according to the first action;According to
First state variable update is used for the state table of address learning, wherein corresponding with the first message the is stored in state table
Two source addresses and the first source address mapping relations between the two;Preset table is updated according to updated state table, wherein default
Table is used for the result of storage address self study;
Memory 144 is connected with above-mentioned processor 142, for storing the first flow table, state table and preset table.
Processor 142 is additionally operable to extract the second source address of the first message from the first message;According to the second source address
And first state variable update state table.
Optionally, processor 142 are additionally operable to search the second source address in state table;The second source address is not being found
In the case of, state entry corresponding with the second source address is created in state table, wherein the state entry created is for remembering
Record the second source address and with the mapping relations between the first source address for being carried in first state variable.
Optionally, processor 142 are additionally operable to after searching the second source address in state table, with finding the second source
In the case of location, judge it is being stored in state table with the second source address matches third source addresses, and in first state variable
Whether the first source address carried is identical;With the third source address of the second source address matches in state table, become with first state
When the first source address difference carried in amount, the third source address in state table is replaced with into the first source address.
Optionally, processor 142 are additionally operable to generate in preset table and the second source address pair in updated state table
The matching field answered;By the first source address in updated state table, it is embedded into preset table corresponding with matching field
In two action instruction information, wherein the second action instruction information is used to indicate executes predetermined operation according to the first source address.
Figure 15 is the structure diagram two of interchanger according to the ... of the embodiment of the present invention, and as shown in figure 15, it includes figure which, which removes,
Outside all modules shown in 14, further include:First transmitting device 152, wherein
First transmitting device 152, for after updating preset table according to updated state table, receiving the second message,
Wherein, the destination address of the second message and the second source address corresponding with the first message are identical;
Processor 142 is connected to above-mentioned first transmitting device 152, is additionally operable to according to matching word corresponding with destination address
Section obtains the second action instruction information from preset table;The instruction that information is indicated according to the second action, according to the first source address pair
Second message executes predetermined operation.
Optionally, processor 142 are additionally operable to encapsulate the second message according to the first source address;Alternatively, according to the first source address
Export the second message.
Figure 16 is the structure diagram three of interchanger according to the ... of the embodiment of the present invention, and as shown in figure 16, it includes figure which, which removes,
Outside all modules shown in 14, further include:Second transmitting device 162, wherein
Second transmitting device 162, for dynamic in the first message matched first for obtaining and receiving from the first flow table
Before making instruction information, the flow table that open flows controller issues, state table and preset table are received;According to updated state table
After updating preset table, updated preset table is reported to open flows controller.
Optionally, above-mentioned preset table can be one of the following:Second flow table, group table.
Embodiment 4
A kind of storage medium is additionally provided in the embodiment of the present invention.Optionally, in the present embodiment, above-mentioned storage medium
It can be set to store the program code for executing following steps:
S1, the matched first action instruction information of the first message for obtaining and receiving from the first flow table;
S2 indicates that information copies the first source address corresponding with the first message to first state variable according to the first action
In;
S3 is used for the state table of address learning according to first state variable update, wherein is stored in state table and the
Corresponding second source address of one message and the first source address mapping relations between the two;
S4 updates preset table, wherein preset table is used for the result of storage address self study according to updated state table.
Optionally, storage medium is also configured to store the program code for executing following steps:
Include for the state table of address learning according to first state variable update:
S1 extracts the second source address of the first message from the first message;
S2, according to the second source address and first state variable update state table.
Optionally, storage medium is also configured to store the program code for executing following steps:
Include according to the second source address and first state variable update state table:
S1 searches the second source address in state table;
S2 creates state corresponding with the second source address in the case where not finding the second source address in state table
Entry, wherein the state entry created is used to record the second source address and with the first source for being carried in first state variable
Mapping relations between location.
Optionally, storage medium is also configured to store the program code for executing following steps:
After searching the second source address in state table, further include:
S1, in the case where finding the second source address, judge to store in state table with the second source address matches
Whether the first source address carried in third address, with first state variable is identical;
S2, in state table with the third address of the second source address matches, with the first source carried in first state variable
When the difference of address, the third address in state table is replaced with into the first source address.
Optionally, storage medium is also configured to store the program code for executing following steps:
Updating preset table according to updated state table includes:
S1 generates matching field corresponding with the second source address in updated state table in preset table;
The first source address in updated state table is embedded into preset table corresponding with matching field second by S2
In action instruction information, wherein the second action instruction information is used to indicate executes predetermined operation according to the first source address.
Optionally, storage medium is also configured to store the program code for executing following steps:
After updating preset table according to updated state table, further include:
S1 receives the second message, wherein the destination address of the second message and the second source address phase corresponding with the first message
Together;
S2 obtains the second action instruction information according to matching field corresponding with destination address from preset table;
S3, the instruction of information is indicated according to the second action, and predetermined operation is executed according to first the second message of source address pair.
Optionally, storage medium is also configured to store the program code for executing following steps:
Executing predetermined operation according to first the second message of source address pair includes:
S1 encapsulates the second message according to the first source address;Or
S2 exports the second message according to the first source address.
Optionally, storage medium is also configured to store the program code for executing following steps:
S1 is gone back before the matched first action instruction information of the first message for obtaining and receiving in the first flow table
Including:Receive the flow table that open flows controller issues, state table and preset table;
S2, according to updated state table update preset table after, further include:After update being reported to open flows controller
Preset table.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only memory (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or
The various media that can store program code such as CD.
Optionally, in the present embodiment, processor executes above-mentioned implementation according to stored program code in storage medium
Method and step in example.
Obviously, those skilled in the art should be understood that each module of the above invention or each step can be with general
Computing device realize that they can be concentrated on a single computing device, or be distributed in multiple computing devices and formed
Network on, optionally, they can be realized with the program code that computing device can perform, it is thus possible to which they are stored
It is performed by computing device in the storage device, and in some cases, it can be with different from shown in sequence execution herein
The step of going out or describing, either they are fabricated to each integrated circuit modules or by them multiple modules or
Step is fabricated to single integrated circuit module to realize.In this way, the present invention is not limited to any specific hardware and softwares to combine.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.
Claims (25)
1. a kind of method of address learning, which is characterized in that including:
The matched first action instruction information of the first message for obtaining and receiving from the first flow table;
The first source address corresponding with first message is copied to first state according to the first action instruction information to become
In amount;
According to the first state variable update be used for address learning state table, wherein be stored in the state table with
Corresponding second source address of first message and first source address mapping relations between the two;
Preset table is updated according to the updated state table, wherein the preset table is for storing described address self study
As a result.
2. according to the method described in claim 1, it is characterized in that, being learnt by oneself for address according to the first state variable update
The state table of habit includes:
Second source address of first message is extracted from first message;
According to state table described in second source address and the first state variable update.
3. according to the method described in claim 2, it is characterized in that, according to second source address and the first state variable
Updating the state table includes:
Second source address is searched in the state table;
In the case where not finding second source address, created in the state table corresponding with second source address
State entry, wherein the state entry created for record second source address and with the first state variable
The mapping relations between first source address of middle carrying.
4. according to the method described in claim 3, it is characterized in that, searched in the state table second source address it
Afterwards, further include:
In the case where finding second source address, judge being stored in the state table with second source address
Whether first source address carried in the third address matched, with the first state variable is identical;
With the third address of second source address matches in the state table, carried with the first state variable
The first source address difference when, the third address in the state table is replaced with into first source address.
5. according to the method described in claim 1, it is characterized in that, updating preset table packet according to the updated state table
It includes:
Matching field corresponding with second source address in the updated state table is generated in the preset table;
By first source address in the updated state table, it is embedded into the preset table and the matching field pair
In the second action instruction information answered, wherein the second action instruction information is used to indicate to be held according to first source address
Row predetermined operation.
6. according to the method described in claim 5, it is characterized in that, according to updated state table update preset table it
Afterwards, further include:
Receive the second message, wherein the destination address of second message and second source corresponding with first message
Address is identical;
The second action instruction information is obtained from the preset table according to matching field corresponding with the destination address;
According to the instruction of the second action instruction information, second message is executed according to first source address described pre-
Fixed operation.
7. according to the method described in claim 6, it is characterized in that, being executed to second message according to first source address
The predetermined operation includes:
Second message is encapsulated according to first source address;Or
Second message is exported according to first source address.
8. according to the method described in claim 1, it is characterized in that,
Before the matched first action instruction information of the first message for obtaining and receiving in the first flow table, further include:It connects
Receive the flow table that open flows controller issues, the state table and the preset table;
After according to the updated state table update preset table, further include:Update is reported to the open flows controller
The preset table afterwards.
9. method according to any one of claim 1 to 8, which is characterized in that the preset table is one of the following:Second
Flow table, group table.
10. a kind of device of address learning, which is characterized in that including:
First acquisition module, the matched first action instruction letter of the first message for obtaining and receiving from the first flow table
Breath;
Module is copied, for copying the first source address corresponding with first message according to the first action instruction information
Into first state variable;
First update module, the state table for being used for address learning according to the first state variable update, wherein described
It is stored with the second source address corresponding with first message in state table and first source address mapping between the two is closed
System;
Second update module, for updating preset table according to the updated state table, wherein the preset table is for storing
The result of described address self study.
11. device according to claim 10, which is characterized in that first update module is additionally operable to from described first
Second source address of first message is extracted in message;According to second source address and the first state variable
Update the state table.
12. according to the devices described in claim 11, which is characterized in that first update module includes:
Searching unit, for searching second source address in the state table;
Creating unit is created and described the in the state table in the case where not finding second source address
The corresponding state entry of two source addresses, wherein the state entry created for record second source address and with institute
State the mapping relations between first source address carried in first state variable.
13. device according to claim 12, which is characterized in that first update module further includes:
Judging unit is finding second source address after searching second source address in the state table
In the case of, the third source address with second source address matches stored in the state table is judged, with described first
Whether first source address carried in state variable is identical;
Replacement unit, in the state table with the third source address of second source address matches, with described the
When the first source address difference carried in one state variable, the third source address in the state table is replaced with into institute
State the first source address.
14. device according to claim 10, which is characterized in that second update module is additionally operable to described default
Matching field corresponding with second source address in the updated state table is generated in table;By the updated shape
First source address in state table is embedded into the second action instruction information corresponding with the matching field in the preset table
In, wherein the second action instruction information is used to indicate executes predetermined operation according to first source address.
15. device according to claim 14, which is characterized in that further include:
First receiving module, for after according to the updated state table update preset table, receiving the second message,
In, the destination address of second message and second source address corresponding with first message are identical;
Second acquisition module, for obtaining described the from the preset table according to matching field corresponding with the destination address
Two action instruction information;
Execution module, for the instruction according to the second action instruction information, according to first source address to described second
Message executes the predetermined operation.
16. according to claim 15 described device, which is characterized in that the execution module is additionally operable to according to first source
Location encapsulates second message;Alternatively, exporting second message according to first source address.
17. the device according to any one of claim 10 to 16, which is characterized in that further include:
Second receiving module, in the matched first action instruction letter of the first message for obtaining and receiving from the first flow table
Before breath, the flow table that open flows controller issues, the state table and the preset table are received;
Reporting module is used for after according to the updated state table update preset table, in the open flows controller
Report the updated preset table.
18. a kind of interchanger, which is characterized in that including:Processor and memory, wherein
The processor, the matched first action instruction information of the first message for obtaining and receiving from the first flow table;
The first source address corresponding with first message is copied in first state variable according to the first action instruction information;
According to the first state variable update be used for address learning state table, wherein be stored in the state table with it is described
Corresponding second source address of first message and first source address mapping relations between the two;According to the updated shape
State table updates preset table, wherein the preset table is used to store the result of described address self study;
The memory, for storing first flow table, the state table and the preset table.
19. interchanger according to claim 18, which is characterized in that the processor is additionally operable to from first message
In extract second source address of first message;According to second source address and the first state variable update
The state table.
20. interchanger according to claim 19, which is characterized in that the processor is additionally operable in the state table
Search second source address;In the case where not finding second source address, in the state table create with it is described
The corresponding state entry of second source address, wherein the state entry created for record second source address and with
The mapping relations between first source address carried in the first state variable.
21. interchanger according to claim 20, which is characterized in that the processor is additionally operable in the state table
After searching second source address, in the case where finding second source address, judge to store in the state table
The third source address with second source address matches, be with first source address carried in the first state variable
It is no identical;In the state table with the third source address of second source address matches, with the first state variable
When the first source address difference of middle carrying, with replacing with first source by the third source address in the state table
Location.
22. interchanger according to claim 18, which is characterized in that the processor is additionally operable in the preset table
Generate matching field corresponding with second source address in the updated state table;By the updated state table
In first source address, be embedded into the preset table it is corresponding with the matching field second action instruction information in,
Wherein, the second action instruction information is used to indicate executes predetermined operation according to first source address.
23. interchanger according to claim 22, which is characterized in that further include:First transmitting device, wherein
The transmitting device, for after according to the updated state table update preset table, receiving the second message,
In, the destination address of second message and second source address corresponding with first message are identical;
The processor is additionally operable to obtain described the from the preset table according to matching field corresponding with the destination address
Two action instruction information;According to the instruction of the second action instruction information, according to first source address to second report
Text executes the predetermined operation.
24. according to interchanger described in claim 23, which is characterized in that the processor is additionally operable to according to first source
Location encapsulates second message;Alternatively, exporting second message according to first source address.
25. the interchanger according to any one of claim 18 to 24, which is characterized in that further include:Second transmitting device,
Wherein,
Second transmitting device, for referring in matched first action of the first message for obtaining and receiving from the first flow table
Before showing information, the flow table that open flows controller issues, the state table and the preset table are received;After according to update
The state table update preset table after, report the updated preset table to the open flows controller.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710132350.7A CN108574637B (en) | 2017-03-07 | 2017-03-07 | Address self-learning method and device and switch |
PCT/CN2018/077526 WO2018161827A1 (en) | 2017-03-07 | 2018-02-28 | Address self-learning method and device, and switch |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710132350.7A CN108574637B (en) | 2017-03-07 | 2017-03-07 | Address self-learning method and device and switch |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108574637A true CN108574637A (en) | 2018-09-25 |
CN108574637B CN108574637B (en) | 2022-09-27 |
Family
ID=63448984
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710132350.7A Active CN108574637B (en) | 2017-03-07 | 2017-03-07 | Address self-learning method and device and switch |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108574637B (en) |
WO (1) | WO2018161827A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111343108A (en) * | 2020-02-24 | 2020-06-26 | 盛科网络(苏州)有限公司 | Mac table entry learning forwarding method and device |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109450798B (en) * | 2018-12-13 | 2022-07-12 | 郑州云海信息技术有限公司 | Method for managing routing table information and computer-readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120044837A1 (en) * | 2009-02-24 | 2012-02-23 | Universidad Carlos Iii De Madrid | Data frame routing method and network bridge |
CN102801612A (en) * | 2012-07-06 | 2012-11-28 | 武汉虹信通信技术有限责任公司 | Improved method and system for updating routing information of main engine on exchanging chip |
CN103841019A (en) * | 2012-11-27 | 2014-06-04 | 中兴通讯股份有限公司 | Method and device for being connected into shortest path bridging network in multi-homing mode |
EP2940952A1 (en) * | 2014-04-30 | 2015-11-04 | Brocade Communications Systems, Inc. | Method and system for facilitating switch virtualization in a network of interconnected switches |
CN106209634A (en) * | 2015-04-30 | 2016-12-07 | 中兴通讯股份有限公司 | The learning method of address mapping relation and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101123570B (en) * | 2006-08-09 | 2011-05-18 | 华为技术有限公司 | Data forward method and system between multiple operator Ethernet |
CN104468855B (en) * | 2013-09-25 | 2018-04-03 | 阿里巴巴集团控股有限公司 | The treating method and apparatus of ARP message |
US9577927B2 (en) * | 2014-06-30 | 2017-02-21 | Nicira, Inc. | Encoding control plane information in transport protocol source port field and applications thereof in network virtualization |
-
2017
- 2017-03-07 CN CN201710132350.7A patent/CN108574637B/en active Active
-
2018
- 2018-02-28 WO PCT/CN2018/077526 patent/WO2018161827A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120044837A1 (en) * | 2009-02-24 | 2012-02-23 | Universidad Carlos Iii De Madrid | Data frame routing method and network bridge |
CN102801612A (en) * | 2012-07-06 | 2012-11-28 | 武汉虹信通信技术有限责任公司 | Improved method and system for updating routing information of main engine on exchanging chip |
CN103841019A (en) * | 2012-11-27 | 2014-06-04 | 中兴通讯股份有限公司 | Method and device for being connected into shortest path bridging network in multi-homing mode |
EP2940952A1 (en) * | 2014-04-30 | 2015-11-04 | Brocade Communications Systems, Inc. | Method and system for facilitating switch virtualization in a network of interconnected switches |
CN106209634A (en) * | 2015-04-30 | 2016-12-07 | 中兴通讯股份有限公司 | The learning method of address mapping relation and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111343108A (en) * | 2020-02-24 | 2020-06-26 | 盛科网络(苏州)有限公司 | Mac table entry learning forwarding method and device |
CN111343108B (en) * | 2020-02-24 | 2021-10-22 | 苏州盛科通信股份有限公司 | Mac table entry learning forwarding method and device |
Also Published As
Publication number | Publication date |
---|---|
WO2018161827A1 (en) | 2018-09-13 |
CN108574637B (en) | 2022-09-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11374848B2 (en) | Explicit routing with network function encoding | |
US9832130B2 (en) | Data packet routing method and device | |
CN107819663B (en) | Method and device for realizing virtual network function service chain | |
CN104869065B (en) | Data message processing method and device | |
EP3070895B1 (en) | Encapsulation method and system for flow identifier | |
CN107911258A (en) | A kind of realization method and system in the secure resources pond based on SDN network | |
CN105933225B (en) | Strategy routing method and system based on SDN | |
US10050863B2 (en) | Network communication system, software-defined network controller and routing method thereof | |
CN105337881A (en) | Data message processing method, service node and stream guiding point | |
CN106878194A (en) | A kind of message processing method and device | |
CN102780779A (en) | Gateway equipment and method and device for optimization of campus network export P2P (peer-to-peer) traffic | |
CN114640557A (en) | Gateway and cloud network system | |
CN107919973B (en) | Method and apparatus for configuring network device parameters | |
CN110650092B (en) | Data processing method and device | |
US10615999B2 (en) | Virtual local area network configuration system and method, and computer program product thereof | |
CN107360089A (en) | A kind of method for routing foundation, business datum conversion method and device | |
CN108574637A (en) | A kind of method, apparatus and interchanger of address learning | |
CN113543152B (en) | 5G communication system, data communication method, and nonvolatile storage medium | |
CN105519058B (en) | Controller, service node and data packet forwarding method | |
CN110022263A (en) | A kind of method and relevant apparatus of data transmission | |
CN107800630A (en) | Message processing method and device | |
WO2015154393A1 (en) | Method and apparatus for processing service node ability, service classifier and service controller | |
CN107124360B (en) | Label packaging method and device | |
CN115514702A (en) | Method and device for quickly switching link, electronic equipment and storage medium | |
EP4075739B1 (en) | Service chain forwarding control methods and devices |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |