CN106209556B - Method and device for address learning and message transmission - Google Patents

Method and device for address learning and message transmission Download PDF

Info

Publication number
CN106209556B
CN106209556B CN201610523954.XA CN201610523954A CN106209556B CN 106209556 B CN106209556 B CN 106209556B CN 201610523954 A CN201610523954 A CN 201610523954A CN 106209556 B CN106209556 B CN 106209556B
Authority
CN
China
Prior art keywords
board
mac address
characteristic value
message
edge device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610523954.XA
Other languages
Chinese (zh)
Other versions
CN106209556A (en
Inventor
王茹萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201610523954.XA priority Critical patent/CN106209556B/en
Publication of CN106209556A publication Critical patent/CN106209556A/en
Application granted granted Critical
Publication of CN106209556B publication Critical patent/CN106209556B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4604LAN interconnection over a backbone network, e.g. Internet, Frame Relay
    • H04L12/462LAN interconnection over a bridge based backbone
    • H04L12/4625Single bridge functionality, e.g. connection of two networks over a single bridge
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a method and a device for address learning and message transmission, wherein the method is applied to tunnel edge equipment and comprises the following steps: receiving a first message, and acquiring a first characteristic value of a source MAC address of the first message; judging whether a first single board corresponding to the first characteristic value exists in the corresponding relation between the recorded characteristic value and the single board or not according to the first characteristic value; if yes, the first single board learns the source MAC address of the first message. Therefore, the method and the device can enlarge the hardware capacity of the tunnel edge device and reduce the problem of MAC address table entry overflow.

Description

Method and device for address learning and message transmission
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for address learning and packet transmission.
Background
VXLAN (Virtual eXtensible Virtual local area network) is a two-layer VPN technology based on IP networks, using the "MAC in UDP" encapsulation form. VXLAN can provide two-layer interconnection for dispersed physical sites based on existing service provider or enterprise IP networks and can provide service isolation for different tenants. VXLAN typically uses a 24-bit identifier, up to 24 powers of 2 (16777216) VXLAN can be supported, allowing the number of tenants supported to increase dramatically. When a Tunnel edge device at two ends of a Tunnel in a current VXLAN networking, for example, a VTEP (VXLAN Tunnel End Point ) device receives a message at a VXLAN Tunnel side or a user side on a port, a source MAC address in the message is learned to instruct subsequent message forwarding. Since hardware forwarding is faster than software forwarding, VTEP typically writes learned source MAC addresses to its hardware for storage.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for address learning and packet transmission to solve the problem of overflow of MAC address table entries of tunnel edge devices in the prior art.
Specifically, the invention is realized by the following technical scheme:
a method for address learning is applied to tunnel edge equipment, the tunnel edge equipment comprises two or more than two single boards, and the method comprises the following steps:
receiving a first message, and acquiring a first characteristic value of a source MAC address of the first message;
judging whether a first single board corresponding to the first characteristic value exists in the corresponding relation between the recorded characteristic value and the single board or not according to the first characteristic value;
if yes, the first single board learns the source MAC address of the first message.
Further, if there is no first board corresponding to the first eigenvalue in the correspondence between the recorded eigenvalues and boards, the method further includes:
selecting a second single board to learn a source MAC address of the first message;
and recording the corresponding relation between the first characteristic value and the second single board.
Further, the method further comprises:
judging whether the used space of the first single board reaches a preset threshold value;
if so, selecting a third single board according to a preset rule, enabling the third single board to learn the source MAC address of the first message, and recording the corresponding relation between the first characteristic value and the third single board;
the preset rule comprises that the used space of the single board does not reach a preset threshold value;
the used space is used for indicating the resource space which is used for recording the MAC address by the single board.
A method of message transmission, the method comprising:
receiving a second message, and acquiring a second characteristic value in a destination MAC address of the second message;
searching a fourth single board corresponding to the second characteristic value according to the second characteristic value and the recorded corresponding relation between the characteristic value and the single board;
judging whether the fourth single board has an MAC address matched with the destination MAC address;
and if so, forwarding the second message.
Further, the forwarding the second packet specifically includes:
and forwarding the second message from the outgoing interface according to the outgoing interface corresponding to the MAC address.
An address learning apparatus, the apparatus is applied to a tunnel edge device, the tunnel edge device includes two or more boards, the apparatus includes:
a receiving unit, configured to receive a first packet;
an obtaining unit, configured to obtain a first characteristic value of a source MAC address of the first packet;
a judging unit, for judging whether there is a first veneer corresponding to the first characteristic value in the recorded corresponding relationship between the characteristic value and the veneer according to the first characteristic value;
and a processing unit, configured to, when the determining unit determines that the first board corresponding to the first eigenvalue exists in the correspondence between the recorded eigenvalues and boards, enable the first board to learn the source MAC address of the first packet.
Further, the processing unit is further configured to, when the determining unit determines that the first board corresponding to the first eigenvalue does not exist in the correspondence between the recorded eigenvalues and the boards, select a second board to learn the source MAC address of the first packet;
the device further comprises a recording unit, which is used for recording the corresponding relation between the first characteristic value and the second single board.
Further, the determining unit is further configured to determine whether the used space of the first board reaches a preset threshold;
if so, the processing unit is further configured to select a third board according to a preset rule, so that the third board learns the source MAC address of the first message;
the device further comprises a synchronization unit, configured to record a correspondence between the first characteristic value and the third board, and synchronize the correspondence to other boards in the tunnel edge device;
the preset rule comprises that the used space of the single board does not reach a preset threshold value; the used space is used for indicating the resource space which is used for recording the MAC address by the single board.
An apparatus for message transmission, the apparatus comprising:
a receiving unit, configured to receive the second message,
an obtaining unit, configured to obtain a second feature value in a destination MAC address of the second packet;
a searching unit, configured to search, according to the second characteristic value and the recorded correspondence between the characteristic value and a board, a fourth board corresponding to the second characteristic value;
a determining unit, configured to determine whether an MAC address matching the destination MAC address exists in the fourth board;
a forwarding unit, configured to forward the second packet when an MAC address matching the destination MAC address exists in the fourth board.
Further, the forwarding unit is specifically configured to forward the second packet from the egress interface according to the egress interface corresponding to the MAC address.
Therefore, when the tunnel edge device receives the first message, the first board corresponding to the first eigenvalue is searched in the corresponding relation between the recorded eigenvalue and the board by acquiring the first eigenvalue of the source MAC address of the first message and according to the first eigenvalue, so that the first board learns the source MAC address of the first message. Therefore, the method and the device can enlarge the hardware capacity of the tunnel edge device and reduce the problem of MAC address table entry overflow.
Drawings
FIG. 1 is a process flow diagram of a method of address learning in an exemplary embodiment of the invention;
FIG. 2 is a process flow diagram of a method of message transmission in an exemplary embodiment of the invention;
FIG. 3 is a schematic diagram of a single board processing flow in an exemplary embodiment of the invention;
FIG. 4a is a block diagram of the hardware of a device in which the apparatus for address learning is located in an exemplary embodiment of the invention;
FIG. 4b is a logical block diagram of an address learning apparatus in an exemplary embodiment of the invention;
fig. 5a is a hardware structure diagram of a device where a message transmission apparatus is located in an exemplary embodiment of the present invention;
fig. 5b is a logical block diagram of an apparatus for message transmission in an exemplary embodiment of the invention.
Detailed Description
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used can be interpreted as "at … …" or "when … …" or "in response to a determination"
When a tunnel edge device receives a message from the VXLAN tunnel side or the user side on its port, it needs to learn the source MAC of the message and write it into hardware. Since VXLAN can support 16M users, the number of MAC addresses that the tunnel edge device needs to learn is very large, and the problems of insufficient hardware capacity and overflow of MAC address table entries occur due to small hardware storage amount, which affects normal forwarding services.
In order to solve the above problem, the present application provides an embodiment of a method and an apparatus for address learning and message transmission, which may enable a first board corresponding to a first eigenvalue to learn a source MAC address of a first message by obtaining the first eigenvalue of the source MAC address of the first message and searching a corresponding relationship between the recorded eigenvalue and the board according to the first eigenvalue when a tunnel edge device receives the first message. Therefore, the invention can enlarge the hardware capacity of the tunnel edge device and reduce the overflow problem of the MAC address table entry.
Referring to fig. 1, a processing flow diagram of a method for address learning according to an exemplary embodiment of the present invention is shown, where the method is applied to a tunnel edge device, and the tunnel edge device includes two or more boards (for convenience of description, the two or more boards are referred to as multiple blocks hereinafter; it should be noted that the boards described in this embodiment may be understood as interface boards). When the tunnel edge device is a distributed device, a plurality of interface boards are arranged on the tunnel edge device; alternatively, when the tunnel edge device is a centralized device, the tunnel edge device may be a distributed logical device. The method comprises the following steps:
step 101, receiving a first message, and acquiring a first characteristic value of a source MAC address of the first message;
in this embodiment, when the tunnel edge device receives the first packet, the first characteristic value in the source MAC address of the first packet may be obtained, where the first characteristic value may be a value that specifies content in the source MAC address and is capable of classifying different MAC addresses, or the first characteristic value may also be a value that is obtained after the MAC address is subjected to a specific budget and is capable of classifying different MAC addresses.
Step 102, judging whether a first single board corresponding to the first characteristic value exists in the recorded corresponding relation between the characteristic value and the single board according to the first characteristic value;
it should be noted that, the corresponding relationship between the eigenvalue and the board may be set by an administrator, or may be created and recorded when the tunnel edge device receives the message for the first time, in an optional embodiment of the present invention, when the tunnel edge device receives the first message, if it is determined that the first board corresponding to the first eigenvalue does not exist in the corresponding relationship between the recorded eigenvalue and the board, the first message may be considered as the first received message, at this time, the second board may be selected from the multiple boards to learn the source MAC address of the second message (when the second board is selected, the selected board may be used as the second board according to different board state information, for example, the board with the largest remaining storage amount is selected as the second board according to the remaining storage amounts of the different boards), and then the first eigenvalue in the source MAC address of the first message is obtained, recording the corresponding relationship between the first characteristic value and the second board (optionally, synchronizing the corresponding relationship to other boards in the tunnel edge device, so that each board synchronously stores the corresponding relationship). The method for other boards to learn the MAC address of the message source and record the corresponding relationship is the same as that of the other boards, which is not an example.
Because the single boards in the tunnel edge device respectively learn the source MAC addresses of different eigenvalues, and only one correspondence needs to be recorded when a plurality of source MAC addresses of the same eigenvalue are learned in the same single board, the correspondence between the eigenvalue stored in each single board and the single board is relatively simple, and updating and synchronization are not needed each time, thereby reducing the number of times of communication between the single boards.
Step 103, if yes, enabling the first board to learn the source MAC address of the first packet.
When it is determined that the first board corresponds to the first eigenvalue, the first board may learn the source MAC address of the first packet. Therefore, the invention can make different single boards respectively learn the source MAC addresses with different characteristic values, thereby facilitating the storage management of the MAC addresses and improving the searching efficiency of the MAC addresses.
In an optional embodiment of the present invention, after the tunnel edge device searches for the first board corresponding to the first eigenvalue in the correspondence between the recorded eigenvalues and boards, it may further determine whether a used space of the first board reaches a preset threshold, where the used space is used to indicate a resource space in which the board has been used to record the MAC address (i.e., a storage amount used by the board to store the MAC address); if so, indicating that the resources of the first single board for storing the MAC address are insufficient, selecting a third single board from the plurality of single boards according to a preset rule, wherein the preset rule includes that the used space of the single board does not reach a preset threshold, and the preset threshold can be regarded as a proportion value of the storage amount used by the MAC address in a memory of the single board. When it is determined that the used space of the third board does not reach the preset threshold, the third board may learn the source MAC address of the first packet, record the corresponding relationship between the first characteristic value and the third board, and synchronize the corresponding relationship to other boards in the tunnel edge device. Therefore, the invention can realize the distributed storage of the MAC address, so that each single board can process the used condition, and the condition that some single board is idle and the resource of some single board is full is prevented.
In addition, if the MAC address corresponding to the first eigenvalue has been learned in the first board and the correspondence between the first eigenvalue and the first board is recorded, then when the third board learns other MAC addresses corresponding to the first eigenvalue, the correspondence between the first eigenvalue and the third board may be recorded, and the correspondence is synchronized to other boards in the tunnel edge device, at this time, the correspondence between the first eigenvalue and the first board and the correspondence between the first eigenvalue and the third board are recorded in the boards of the tunnel edge device. Therefore, the invention realizes the dynamic allocation of the single boards, can ensure that other single boards continuously learn the MAC address when a certain single board is full of memory, thereby expanding the MAC address learning capability of the tunnel edge equipment, and further realizes the balanced utilization of a plurality of single boards through the embodiment from another point of view.
In order to reduce the occupation of the hardware capacity by the MAC address all the time, an aging mechanism is usually set for the MAC address, and when the MAC address in the board corresponding to the characteristic value is deleted or aged, the characteristic value and the board are deleted from the corresponding relationship, so that the occupation of the hardware capacity can be further reduced.
Referring to fig. 2, the present invention further provides a message transmission method applied to a tunnel edge device according to an address learning method provided by the present invention, which is a processing flow chart of a message transmission method in an exemplary embodiment of the present invention, and the method includes:
step 201, receiving a second message, and acquiring a second characteristic value in a destination MAC address of the second message;
in this embodiment, when any board in the tunnel edge device receives the second message, the second board may further obtain a second characteristic value in the destination MAC address of the second message.
Step 202, searching a fourth board corresponding to the second characteristic value according to the second characteristic value and the recorded corresponding relationship between the characteristic value and the board;
in the foregoing embodiment, it has been described that the corresponding relationship between the characteristic value and the board may be recorded in each board, so that when the board acquires the second characteristic value, a fourth board corresponding to the second characteristic value may be searched in the corresponding relationship between the recorded characteristic value and the board.
Step 203, determining whether an MAC address matching the destination MAC address exists in the fourth board;
and then, the board further determines whether an MAC address matching the destination MAC address exists in the fourth board according to the destination MAC address of the second packet.
And step 204, if the second message exists, forwarding the second message.
If it is determined that the MAC address matching the destination MAC address is stored in the fourth board, the fourth board may forward the second packet.
It should be noted that, in the process of learning the source MAC address of the message, the board in the present invention may learn the outgoing interface corresponding to the MAC address, or otherwise record the corresponding relationship between the source MAC address and the outgoing interface, so that when the fourth board receives the second message, the fourth board may screen out the destination board according to the corresponding relationship between the characteristic value and the board, further may search for the corresponding source MAC address in the screened destination board according to the destination MAC address of the second message, and then forward the second message from the outgoing interface according to the corresponding relationship between the source MAC address and the outgoing interface.
Compared with the message forwarding method which only searches according to the MAC address in the prior art, the message forwarding method can firstly screen the corresponding relation between the characteristic value and the single board, so that specific single boards can be further locked, the MAC address can be possibly stored, and therefore the parallel searching of a plurality of single boards can be carried out, and the searching efficiency can be improved. In addition, because the table entry of the corresponding relation between the characteristic value and the single board is relatively small, the search rate of the MAC address is also improved.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the solution provided in the present application is further described in detail with reference to fig. 3.
As shown in fig. 3, for example, a distributed device is taken as a tunnel edge device, and it is assumed that there are 3 interface boards (i.e., boards described in the above embodiments) on the distributed device, namely, the interface board 1, the interface board 2, and the interface board 3, and the board numbers thereof are Slot1, Slot2, and Slot3, respectively. The tunnel edge device can add a command enabling MAC agent function on a VXLAN user side port, and after the port enabling MAC agent function, other interface boards can also have the function of MAC table entry learning.
It should be noted that, in this embodiment, in the tunnel edge device, optionally, in the interface board 1, the interface board 2, and the interface board 3 of the tunnel edge device, a corresponding relationship between the feature value and the interface board is recorded, where the corresponding relationship may be obtained by configuration or automatic acquisition (the method for acquiring the corresponding relationship has been described in the foregoing embodiment, and is not described again here).
In addition, when the interface board receives the data message, the MAC table entry of the data message can be learned. In the process of learning the MAC table entry, since the MAC address has a length of 48 bits (6 bytes), which is usually represented by 12 16-ary numbers, and every 2-ary numbers are separated by a colon, for example, 08:00:20:0A:8C:6D is a MAC address, where the first 6-bit 16-ary number 08:00:20 represents a network manufacturer number, in the following embodiments, a number for representing the network manufacturer may be selected as a feature value to implement the classification of the MAC address.
In this embodiment, suppose that the interface board 1 receives a first data packet (it should be noted that, the interface board 1, the interface board 2, and the interface board 3 may all receive the data packet), obtains a first characteristic value (i.e. a number used for representing a network manufacturer in the MAC address) 78-AC-C1 of a source MAC address of the first data packet, and determines whether an interface board corresponding to 78-AC-C1 exists in the correspondence relationship according to a correspondence relationship between the characteristic value recorded in the interface board 1 and the interface board (as shown in table 1, where table 1 includes key elements such as a network manufacturer number, an interface board, and a board state, but not limited to these, and further, the interface board in table 1 may be replaced by a board number as long as it can be satisfied that the corresponding interface board is found by the board number), which is as follows:
network manufacturer number Interface board Single board state
78-AC-C1 Interface board 1 Free up
78-AC-C3 Interface board 2 Free up
TABLE 1
As can be seen from table 1, the interface board 1 corresponding to 78-AC-C1 exists in the correspondence relationship, and if the state of the interface board 1 is an idle state, the interface board 1 can record the source MAC address carried in the first data packet.
The board state includes idle state and non-idle state, and the state determination may be performed by customizing a preset threshold, for example, when the memory usage ratio reaches 80%, the board is not idle, and when the memory usage ratio is less than 80%, the board is idle.
In another implementation, assuming that the first data packet received by the interface board 1 has a network manufacturer number of 78-AC-C2, it can be determined according to table 1 that there is no correspondence between 78-AC-C2 and the interface board in table 1, it can be known that the first data packet is the first received data packet, and there is no correspondence between 78-AC-C2 and the interface board in the correspondence, so that the interface board 2 can learn the MAC address table entry of the first data packet (when the interface board is selected to learn the MAC address table entry of the first data packet, the corresponding interface board can be selected according to the state information of different interface boards, for example, the corresponding interface board is selected according to the remaining storage amounts of different interface boards to ensure that the selected interface board is in an idle state), and generate the correspondence between 78-AC-C2 and the interface board 2, and synchronizes the correspondence of 78-AC-C2 with interface board 2 to interface boards 1, 3. At this time, the correspondence table recorded in the interface board is updated (it should be noted that this embodiment can also be taken as an example of obtaining the correspondence between the feature values and the interface board), as shown in table 2:
network manufacturer number Interface board Single board state
78-AC-C1 Interface board 1 Free up
78-AC-C3 Interface board 2 Free up
78-AC-C2 Interface board 2 Free up
TABLE 2
If any interface board receives a data packet with a source MAC address having a characteristic value of 78-AC-C2 at the next time, interface board 2 may be instructed to learn the source MAC address carried in the data packet.
In another implementation, when the interface board 1 receives the first data packet, it obtains that the eigenvalue of the source MAC address carried in the first data packet is 78-AC-C1, and according to the correspondence between the eigenvalue and the interface board, it can be known that the interface board corresponding to 78-AC-C1 is the interface board 1, and before instructing the interface board 1 to learn the source MAC address, it can determine whether the interface board 1 is in an idle state.
An embodiment of determining whether the interface board 1 is in the idle state includes determining whether a used space of the interface board 1 reaches a preset threshold, specifically, determining whether a storage space of the interface board 1 for recording the MAC address reaches a preset proportional value, for example, when it is determined that a usage rate of the storage space of the interface board 1 for recording the MAC address reaches 80%, the interface board 1 may be considered to be in the non-idle state, at this time, another interface board may be selected to record the source MAC address, and a corresponding relationship between 78-AC-C1 and the interface board for recording the source MAC address is recorded.
When selecting other interface boards to record the source MAC address, the method specifically includes:
judging whether the used space of interface board 2 and interface board 3 reaches the preset threshold, if neither, selecting an interface board with the least used space, for example, the used space of interface board 2 is 50%, the used space of interface board 3 is 70%, selecting interface board 2 for recording the source MAC address, and recording the corresponding relationship between 78-AC-C1 and interface board 2, as shown in table 3:
network manufacturer number Interface board Single board state
78-AC-C1 Interface board 1 Is not idle
78-AC-C1 Interface board 2 Free up
78-AC-C3 Interface board 2 Free up
78-AC-C2 Interface board 2 Free up
TABLE 3
Subsequently, if other data packets with the source MAC address characteristic value of 78-AC-C1 are received, if the source MAC address needs to be recorded, the interface board 2 is instructed to record the source MAC address.
Since the network manufacturer number is 78-AC-C1 corresponding to two board numbers, in order to save storage space, the same network manufacturer numbers may be merged, and after the network manufacturer number, the board number corresponding to the new MAC address and the board state are added to the table entry, so as to obtain an updated correspondence table, as shown in table 4.
Figure BDA0001035431620000121
TABLE 4
When an interface board 1 receives a message to be forwarded, assuming that the MAC of the message is MAC1, first obtain a feature value of MAC1 in the message (in this embodiment, the feature value is a network manufacturer number), and search in a currently stored correspondence table, so as to obtain on which interface boards the MAC entries corresponding to the network manufacturer number are all distributed. Then, the MAC table entries corresponding to MAC1 are searched in these interface boards at the same time, and when the MAC table entries corresponding to MAC1 are found on any one of the interface boards, forwarding is performed according to the MAC table entries. For example, the MAC table entry is shown in table 5.
MAC address Outlet interface
MAC1 Tunnel1
TABLE 5
It can be determined that the outgoing interface corresponding to the MAC1 is Tunnel1 according to table 5, then continue to search for the interface board corresponding to the actual outgoing interface corresponding to the MAC1, and send the message out from the actual outgoing interface. The accurate distributed searching mode can also greatly improve the MAC searching efficiency. It should be noted that the MAC table entry egress interface type in table 4 is only an exemplary egress interface type, and the egress interface type is determined according to an egress interface type in an actual network, and is not limited herein.
Therefore, the invention can increase the original capacity rule of one single board into the sum of the specifications of three single boards. Therefore, the problem of insufficient MAC capacity of tunnel edge equipment in the VXLAN network can be solved to a great extent, the point-to-multipoint broadcast message of the MAC can not be learned is avoided, and the bandwidth occupation situation is reduced. Secondly, the searching speed of the MAC table entry is increased and the forwarding efficiency is improved through the learning of a plurality of single boards and the distributed searching.
Based on the same conception, the invention also provides an address learning device and a message transmission device, which can be realized by software or hardware or a combination of the software and the hardware. Taking software implementation as an example, the address learning and message transmission device of the invention is a logical device, and is formed by reading and running corresponding computer program instructions in a memory through a CPU of the device where the address learning and message transmission device is located.
Referring to fig. 4a and fig. 4b, an apparatus 400 for address learning in an exemplary embodiment of the present invention is applied to a tunnel edge device, where the tunnel edge device includes two or more boards, and a basic operating environment of the apparatus includes a CPU, a memory, and other hardware, and from a logic level, the apparatus 400 includes:
a receiving board 401, configured to receive a first message;
an obtaining unit 402, configured to obtain a first characteristic value of a source MAC address of the first packet;
a determining unit 403, configured to determine, according to the first feature value, whether a first board corresponding to the first feature value exists in the correspondence between the recorded feature value and the board;
a processing unit 404, configured to, when the determining unit 403 determines that a first board corresponding to the first eigenvalue exists in the correspondence between the recorded eigenvalues and boards, enable the first board to learn the source MAC address of the first packet.
Optionally, the processing unit 404 is further configured to select a second board to learn a source MAC address of the first packet when the determining unit 403 determines that the first board corresponding to the first eigenvalue does not exist in the correspondence between the recorded eigenvalues and the boards;
the apparatus further includes a recording unit 405, configured to record a corresponding relationship between the first characteristic value and the second board, and synchronize the corresponding relationship to other boards in the tunnel edge device.
Optionally, after searching for the first board corresponding to the first eigenvalue in the correspondence between the recorded eigenvalues and boards according to the first eigenvalue:
the determining unit 403 is further configured to determine whether the used space of the first board reaches a preset threshold; if so, the processing unit 404 is further configured to select a third board according to a preset rule, so that the third board learns the source MAC address of the first packet;
the apparatus further includes a synchronizing unit 406, configured to record a corresponding relationship between the first characteristic value and the third board, and synchronize the corresponding relationship to other boards in the tunnel edge device; the preset rule comprises that the used space of the single board does not reach a preset threshold value; the used space is used for indicating the resource space which is used for recording the MAC address by the single board.
Referring to fig. 5a and fig. 5b, a message transmission apparatus 500 according to an exemplary embodiment of the present invention is shown, where the basic operating environment of the apparatus includes a CPU, a memory, and other hardware, and from a logic perspective, the apparatus 500 includes:
a receiving unit 501, configured to receive a second message;
an obtaining unit 502, configured to obtain a second feature value in a destination MAC address of the second packet;
a searching unit 503, configured to search, according to the second characteristic value and the recorded correspondence between the characteristic value and a board, a fourth board corresponding to the second characteristic value;
a determining unit 504, configured to determine whether an MAC address matching the destination MAC address exists in the fourth board;
a forwarding unit 505, configured to enable the fourth board to forward the second packet when the MAC address matching the destination MAC address exists in the fourth board.
Optionally, the forwarding unit 505 is specifically configured to forward the second packet from the outgoing interface according to the outgoing interface corresponding to the MAC address.
In summary, according to the present application, when the tunnel edge device receives the first message, the first board corresponding to the first eigenvalue is searched in the correspondence between the recorded eigenvalues and boards by obtaining the first eigenvalue of the source MAC address of the first message and according to the first eigenvalue, so that the first board learns the source MAC address of the first message. Therefore, the invention can enlarge the hardware capacity of the tunnel edge device and reduce the overflow problem of the MAC address table entry.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (8)

1. An address learning method is applied to a tunnel edge device, where the tunnel edge device includes two or more boards, and the tunnel edge device enables a MAC proxy function on a VXLAN user-side port, so that the board has a function of MAC entry learning, and the method includes:
receiving a first message, and acquiring a first characteristic value of a source MAC address of the first message;
judging whether a first single board corresponding to the first characteristic value exists in the corresponding relation between the recorded characteristic value and the single board or not according to the first characteristic value;
if yes, the first single board learns the source MAC address of the first message.
2. The method according to claim 1, wherein if there is no first board corresponding to the first eigenvalue in the correspondence between the recorded eigenvalues and boards, the method further comprises:
selecting a second single board to learn a source MAC address of the first message;
and recording the corresponding relation between the first characteristic value and the second single board.
3. The method of claim 1, further comprising:
judging whether the used space of the first single board reaches a preset threshold value;
if so, selecting a third single board according to a preset rule, enabling the third single board to learn the source MAC address of the first message, and recording the corresponding relation between the first characteristic value and the third single board;
the preset rule comprises that the used space of the single board does not reach a preset threshold value;
the used space is used for indicating the resource space which is used for recording the MAC address by the single board.
4. A method for packet transmission, where the method is applied to a tunnel edge device, where the tunnel edge device includes two or more boards, and the tunnel edge device enables an MAC proxy function on a VXLAN user-side port, so that the board has a function of MAC entry learning, and the method includes:
receiving a second message, and acquiring a second characteristic value in a destination MAC address of the second message;
searching a fourth single board corresponding to the second characteristic value according to the second characteristic value and the recorded corresponding relation between the characteristic value and the single board;
judging whether the fourth single board has an MAC address matched with the destination MAC address;
and if so, forwarding the second message from the output interface according to the output interface corresponding to the MAC address.
5. An address learning apparatus, wherein the apparatus is applied to a tunnel edge device, the tunnel edge device includes two or more boards, and the tunnel edge device enables a MAC proxy function on a VXLAN user-side port, so that the board has a function of MAC entry learning, and the apparatus includes:
a receiving unit, configured to receive a first packet;
an obtaining unit, configured to obtain a first characteristic value of a source MAC address of the first packet;
a judging unit, for judging whether there is a first veneer corresponding to the first characteristic value in the recorded corresponding relationship between the characteristic value and the veneer according to the first characteristic value;
and a processing unit, configured to, when the determining unit determines that the first board corresponding to the first eigenvalue exists in the correspondence between the recorded eigenvalues and boards, enable the first board to learn the source MAC address of the first packet.
6. The apparatus of claim 5,
the processing unit is further configured to, when the determining unit determines that the first board corresponding to the first eigenvalue does not exist in the correspondence between the recorded eigenvalues and the boards, select a second board to learn the source MAC address of the first packet;
the device further comprises a recording unit, which is used for recording the corresponding relation between the first characteristic value and the second single board.
7. The apparatus of claim 5,
the judging unit is further configured to judge whether the used space of the first board reaches a preset threshold;
if so, the processing unit is further configured to select a third board according to a preset rule, so that the third board learns the source MAC address of the first message;
the device further comprises a synchronization unit, configured to record a correspondence between the first characteristic value and the third board, and synchronize the correspondence to other boards in the tunnel edge device;
the preset rule comprises that the used space of the single board does not reach a preset threshold value; the used space is used for indicating the resource space which is used for recording the MAC address by the single board.
8. A message transmission apparatus, where the apparatus is applied to a tunnel edge device, where the tunnel edge device includes two or more boards, and the tunnel edge device enables an MAC proxy function on a VXLAN user-side port, so that the board has a function of MAC entry learning, and the apparatus includes:
a receiving unit, configured to receive the second message,
an obtaining unit, configured to obtain a second feature value in a destination MAC address of the second packet;
a searching unit, configured to search, according to the second characteristic value and the recorded correspondence between the characteristic value and a board, a fourth board corresponding to the second characteristic value;
a determining unit, configured to determine whether an MAC address matching the destination MAC address exists in the fourth board;
and a forwarding unit, configured to, when an MAC address matching the destination MAC address exists in the fourth board, forward the second packet from the outgoing interface according to the outgoing interface corresponding to the MAC address.
CN201610523954.XA 2016-06-29 2016-06-29 Method and device for address learning and message transmission Active CN106209556B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610523954.XA CN106209556B (en) 2016-06-29 2016-06-29 Method and device for address learning and message transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610523954.XA CN106209556B (en) 2016-06-29 2016-06-29 Method and device for address learning and message transmission

Publications (2)

Publication Number Publication Date
CN106209556A CN106209556A (en) 2016-12-07
CN106209556B true CN106209556B (en) 2020-01-03

Family

ID=57466266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610523954.XA Active CN106209556B (en) 2016-06-29 2016-06-29 Method and device for address learning and message transmission

Country Status (1)

Country Link
CN (1) CN106209556B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106911547B (en) * 2017-02-10 2020-09-25 新华三技术有限公司 Message forwarding method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110721A (en) * 2006-07-18 2008-01-23 中兴通讯股份有限公司 Method for accessing into control address table spacing using Ethernet switch medium
CN101179514A (en) * 2007-12-18 2008-05-14 杭州华三通信技术有限公司 Method and device of maintaining MAC item of distributed network processing system
CN102571610A (en) * 2012-03-02 2012-07-11 杭州华三通信技术有限公司 Packet forwarding method and edge equipment
CN102577280A (en) * 2011-11-28 2012-07-11 华为技术有限公司 Method, apparatus and system for sending message
CN102739526A (en) * 2012-06-13 2012-10-17 烽火通信科技股份有限公司 Realization method of efficient distributed routing list realizing method
CN103414640A (en) * 2013-07-19 2013-11-27 福建三元达通讯股份有限公司 Method for expanding capacity of wireless controller device MAC address forwarding table
CN105119831A (en) * 2015-09-15 2015-12-02 烽火通信科技股份有限公司 MAC (Media Access Control) address learning method and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110721A (en) * 2006-07-18 2008-01-23 中兴通讯股份有限公司 Method for accessing into control address table spacing using Ethernet switch medium
CN101179514A (en) * 2007-12-18 2008-05-14 杭州华三通信技术有限公司 Method and device of maintaining MAC item of distributed network processing system
CN102577280A (en) * 2011-11-28 2012-07-11 华为技术有限公司 Method, apparatus and system for sending message
CN102571610A (en) * 2012-03-02 2012-07-11 杭州华三通信技术有限公司 Packet forwarding method and edge equipment
CN102739526A (en) * 2012-06-13 2012-10-17 烽火通信科技股份有限公司 Realization method of efficient distributed routing list realizing method
CN103414640A (en) * 2013-07-19 2013-11-27 福建三元达通讯股份有限公司 Method for expanding capacity of wireless controller device MAC address forwarding table
CN105119831A (en) * 2015-09-15 2015-12-02 烽火通信科技股份有限公司 MAC (Media Access Control) address learning method and system

Also Published As

Publication number Publication date
CN106209556A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN107079060B (en) System and method for carrier-level NAT optimization
CN107390832B (en) Server system and cooling method
WO2021008533A1 (en) Method for determining path, and related device
US9465641B2 (en) Selecting cloud computing resource based on fault tolerance and network efficiency
EP3057270A1 (en) Technologies for modular forwarding table scalability
US10348603B1 (en) Adaptive forwarding tables
US8942217B2 (en) System and method for hierarchical link aggregation
CN109981493B (en) Method and device for configuring virtual machine network
CN108768866B (en) Cross-card forwarding method and device for multicast message, network equipment and readable storage medium
CN108173691B (en) Cross-device aggregation method and device
US20090135816A1 (en) Method and apparatus for assigning ip addresses
US11863439B2 (en) Method, apparatus and storage medium for application identification
CN107493222B (en) VXLAN message forwarding method and device
US9197598B2 (en) MAC address distribution
CN107547346B (en) Message transmission method and device
US11329886B2 (en) Automatic classification of network devices in a network
US8914503B2 (en) Detected IP link and connectivity inference
US10868777B1 (en) Power management of routing tables using vertical scaling
US20070091899A1 (en) Data structure for storing and accessing multiple independent sets of forwarding information
CN106209556B (en) Method and device for address learning and message transmission
CN108650180B (en) Stacking system and table entry issuing method and device thereof
CN116016448A (en) Service network access method, device, equipment and storage medium
US9008108B2 (en) Criteria for identifying network frames
US10608937B1 (en) Determining destination resolution stages for forwarding decisions
CN114338386A (en) Network configuration method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

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

Applicant after: Xinhua three Technology Co., Ltd.

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

Applicant before: Huasan Communication Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant