+

WO2018161967A1 - Method, equipment and system for allocating local media access control address - Google Patents

Method, equipment and system for allocating local media access control address Download PDF

Info

Publication number
WO2018161967A1
WO2018161967A1 PCT/CN2018/078624 CN2018078624W WO2018161967A1 WO 2018161967 A1 WO2018161967 A1 WO 2018161967A1 CN 2018078624 W CN2018078624 W CN 2018078624W WO 2018161967 A1 WO2018161967 A1 WO 2018161967A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
allocated
conflict
address
registration message
Prior art date
Application number
PCT/CN2018/078624
Other languages
French (fr)
Chinese (zh)
Inventor
敖婷
喻敬海
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018161967A1 publication Critical patent/WO2018161967A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Definitions

  • the present disclosure relates to network communication technologies, and in particular, to a method, device, and system for allocating local media access control (MAC) addresses.
  • MAC media access control
  • the expansion of the data center and the introduction of virtualization not only bring about an increase in physical equipment, but also bring about an exponential growth of virtual devices.
  • the growth of these devices has led to a sharp rise in the consumption of MAC addresses.
  • the conventional MAC address is that the above device has been assigned a fixed 48-bit MAC address at the time of manufacture or shipment to facilitate communication between devices.
  • the traditional MAC address will have many problems when it is applied. For example, the MAC address space capacity cannot meet the increasingly consumed MAC address; the MAC address is fixed; the MAC address is not layered and cannot provide other device-related Information, such as location information.
  • IEEE Institute of Electrical and Electronics Engineers
  • a concept of local MAC address that is, the MAC address is no longer globally unique in some network environments. A 48-bit address, but a unique localized address within the network. And a unified allocation of addresses can be used to uniformly allocate a local MAC address to each network element in the network.
  • the local MAC address is usually applied in the form of a request packet, so only the address allocation of the network device to the host and the like is involved, which is suitable for a small network, such as a small internal network scenario.
  • a small network such as a small internal network scenario.
  • how to obtain MAC addresses in multiple network devices requires related protocols.
  • the host can obtain the MAC address by self-declaration, but the entire network architecture is a client and server (C/S, Client/Server) architecture, so the centralized server is adopted. In this way, local MAC address allocation cannot be performed under other network architectures.
  • embodiments of the present disclosure are expected to provide a local address allocation method, device, and system; not only implementing a local address allocation protocol in multiple network devices, but also adapting to different local network architectures.
  • a method for allocating a local media access control address including:
  • the registration message of the local address is sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the device to be allocated determines, by the device to be allocated, the address to be allocated as the address of the device to be allocated, and sending a declaration message of the address; wherein the declaration message includes: The message identifier of the abbreviated message and the block of the address to be allocated that need to be declared.
  • the device to be allocated does not detect any conflict, and includes: after the device to be allocated sends the registration message according to a preset interval according to a preset interval, Determining the conflicting failure message of the registration message or the affirmation message of the address conflict, determining that the device to be allocated does not perceive an address block conflict to be allocated; wherein the conflict failure message includes: a message for uniquely identifying the conflict failure message The message identifier and the conflicting address block; the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • the method further includes: when the device to be allocated senses a conflict, the device to be allocated reselects an address block to be allocated, and resends the registration message.
  • the method further includes: when the device to be allocated receives the declaration message sent by the other device, and the address block that needs to be declared in the declaration message sent by the other device and the registration message
  • the address block to be allocated that needs to be registered is used for collision detection to determine whether a conflict occurs: if a conflict occurs, the address block to be allocated is reselected, and the original address block to be allocated in the registration message that needs to be registered is replaced with a reselection.
  • the block of addresses to be allocated if no conflicts occur, no processing is done.
  • the to-be-allocated address block that needs to be registered in the registration message is obtained by the device to be allocated according to a preset selection policy.
  • a method for allocating a local media access control address including:
  • the allocated device receives the registration message sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
  • the allocated device performs collision detection on the to-be-allocated address block in the registration message and its own local address;
  • the allocated device When a conflict occurs, the allocated device sends a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  • the message identifier in the conflict failure message has a correspondence relationship with the message identifier in the registration message.
  • a method for allocating a local media access control address including:
  • the network device receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
  • the network device when the network device receives the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message.
  • the message identifier and the address block where the conflict occurred;
  • the network device receives the adjacency message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
  • the network device determines, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including: when the network device is configured to be allocated.
  • the network device performs collision detection on the address block to be allocated in the registration message and the address of the allocated device of the network device proxy: when a conflict occurs, the network device sends a corresponding conflict failure
  • the message when no conflict occurs, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  • the network device determines, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including: when the network device is not configured to be allocated.
  • the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  • the network device forwarding the registration message to other network devices other than the device to be allocated in the network, including: after the network device acquires a receiving port for receiving a registration message, establishing a location Corresponding relationship between the message identifier of the registration message and the receiving port; sending the registration message through a port other than the receiving port.
  • the establishing a forwarding mapping relationship according to the adjacency message includes: the network device establishing a forwarding mapping relationship between a receiving port that receives the aforesaid message and an address declared in the abbreviated message.
  • a method for allocating a local media access control address including:
  • the database server receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the database server performs collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a usage state in the entire network;
  • the database server sends a conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  • the method further includes: when the database server receives the affirmation message, save an address that needs to be stated in the declaration message, and set a state of the address to be stated to a usage state.
  • the affirmative message includes a message identifier for uniquely identifying the affirmative message and an address to be claimed.
  • a device to be allocated includes: a first sending module, a sensing module, and a determining module;
  • the first sending module is configured to send a registration message of the local media access control address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the sensing module is configured to detect a conflict; and when no conflict is perceived, the determining module and the first sending module are triggered;
  • the determining module is configured to determine the address block to be allocated as an address of the device to be allocated;
  • the first sending module is further configured to send a declaration message of the address, where the adjacency message includes: a message identifier for uniquely identifying the adjacency message and an address block to be allocated that needs to be declared.
  • the sensing module is configured to not receive a conflict with the registration message after the first sending module sends the registration message according to a preset interval period according to a preset number of times. Determining, by the failure message, the affirmative message of the address conflict, and determining that the address block conflict is not to be allocated; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and an address block in which the conflict occurs; The message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • the to-be-distributed device further includes a selection module; the sensing module is further configured to trigger the selection module and the first sending module when a conflict is perceived; the selecting module, setting To reselect the block to be allocated; the first sending module is further configured to resend the registration message.
  • the to-be-distributed device further includes a first receiving module and a first detecting module; the first receiving module is configured to receive a declaration message sent by another device; and the first detecting module is configured to The address block that needs to be declared in the affirmation message sent by the device performs collision detection with the to-be-allocated address block that needs to be registered in the registration message to determine whether a conflict occurs: if a conflict occurs, the selection module is triggered; if it does not appear If the conflict is not processed, the selection module is further configured to reselect the to-be-allocated address block, and replace the original to-be-allocated address block that needs to be registered in the registration message with the re-selected address block to be allocated.
  • a distributed device including: a second receiving module, a second detecting module, and a second sending module;
  • the second receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
  • the second detecting module is configured to detect a conflict between the to-be-assigned address block and the local address of the registration message, and trigger the second sending module when a conflict occurs;
  • the second sending module is configured to send a conflict failure message to the to-be-distributed device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  • the message identifier in the conflict failure message has a correspondence relationship with the message identifier in the registration message.
  • a network device includes: a third receiving module, a forwarding module, and an establishing module;
  • the third receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
  • the forwarding module is configured to determine, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
  • the third receiving module is configured to trigger the forwarding module when receiving a conflict failure message for the registration message, and trigger the establishing module when receiving the declaration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
  • the forwarding module is further configured to forward the conflict failure message to the to-be-distributed device
  • the establishing module is configured to establish a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
  • the forwarding module is configured to: when the network device is provided with a proxy of the allocated device, the to-be-allocated address block in the registration message and the allocated device of the network device proxy The address is detected by collision: and, when a conflict occurs, a corresponding conflict failure message is sent, and when no conflict occurs, the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the forwarding module is configured to: when the network device does not set an agent of the allocated device, forward the registration message to other network devices other than the device to be allocated in the network.
  • the forwarding module is configured to: after acquiring a receiving port for receiving a registration message, establishing a correspondence between a message identifier of the registration message and the receiving port; and The registration message is sent through a port other than the receiving port.
  • the establishing module is configured to establish a forwarding mapping relationship between a receiving port that receives the affirmative message and an address that needs to be stated in the declaration message.
  • a database server includes: a fourth receiving module, a third detecting module, and a third sending module, where
  • the fourth receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the third detecting module is configured to perform collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a used state in the entire network;
  • the third sending module is configured to send a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  • the database server further includes: a saving module, configured to save an address that needs to be stated in the affirmative message when the fourth receiving module receives the affirmation message, and set the need to affirm The status of the address is set to the usage status; wherein the affirmative message includes a message identifier for uniquely identifying the affirmative message and an address to be claimed.
  • a system for allocating a local media access control address includes at least one device to be allocated, at least one allocated device, and at least one network device;
  • the device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
  • the allocated device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated Address block
  • conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
  • the network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
  • the conflict failure message when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
  • the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
  • a system for allocating a local media access control address comprising at least one device to be allocated, at least one database server, and at least one network device;
  • the device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
  • the database server is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
  • the saved address is an address in a usage state in the entire network
  • conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
  • the network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
  • the conflict failure message when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
  • the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
  • An embodiment of the present disclosure provides a method, a device, and a system for allocating a local address; sending, by a device to be allocated, a block to be allocated to a network device of the entire network, and according to feedback of other network devices of the entire network for the block to be allocated. Declaring the address used by itself, realizing the registration of the local address and the collision detection of the local address, not only implementing the local address allocation protocol in multiple network devices, but also adapting to different local network architectures.
  • FIG. 1 is a schematic flowchart of a method for allocating a local MAC address according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of another method for allocating a local MAC address according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of still another method for allocating a local MAC address according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of another method for allocating a local MAC address according to an embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of a networking according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a multiple MAC allocation protocol data unit according to an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another multi-MAC allocation protocol data unit according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of a link layer discovery protocol data unit according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of a device to be allocated according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram of another device to be allocated according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram of hardware of a device to be allocated according to an embodiment of the present disclosure.
  • FIG. 16 is a schematic structural diagram of a distributed device according to an embodiment of the present disclosure.
  • FIG. 17 is a schematic structural diagram of hardware of an allocated device according to an embodiment of the present disclosure.
  • FIG. 18 is a schematic structural diagram of a network device according to an embodiment of the present disclosure.
  • FIG. 19 is a schematic structural diagram of hardware of a network device according to an embodiment of the present disclosure.
  • FIG. 20 is a schematic structural diagram of a database server according to an embodiment of the present disclosure.
  • FIG. 21 is a schematic structural diagram of another database server according to an embodiment of the present disclosure.
  • FIG. 22 is a schematic structural diagram of hardware of a database server according to an embodiment of the present disclosure.
  • FIG. 23 is a schematic structural diagram of a local MAC address allocation system according to an embodiment of the present disclosure.
  • FIG. 24 is a schematic structural diagram of another local MAC address allocation system according to an embodiment of the present disclosure.
  • FIG. 1 is a flowchart of a method for allocating a local MAC address according to an embodiment of the present disclosure.
  • the process is applicable to a device to be allocated in a network that needs to allocate a local MAC address.
  • the process may include:
  • the device to be allocated sends a registration message of a local MAC address.
  • the device to be allocated may obtain the local MAC address by performing a self-declaration manner to the entire network. Therefore, the registration message may be sent to all device nodes of the entire network, or may be sent to the database through unicast.
  • the server sends.
  • the database server holds the MAC address that has been allocated and is in use, and the database server can be used to centrally manage the MAC address allocation of the entire network.
  • the registration message may include: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated that needs to be registered. It is easy to understand that the MAC address block to be allocated may contain one MAC address or multiple MAC addresses.
  • the MAC address block to be allocated that needs to be registered in the registration message may be obtained after the device to be allocated is selected according to a preset selection policy.
  • the preset selection policy may include: the device to be allocated learns the MAC address block that has not been used from the history record of the entire network data transmission.
  • the device to be allocated does not detect any conflicts, and when implemented, it may preferably include:
  • Determining after the device to be allocated sends the registration message according to a preset interval period according to a preset number of times, without receiving a conflict failure message for the registration message or a declaration message that is verified as an address conflict.
  • the device to be allocated does not detect the MAC address conflict pending application;
  • the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs; thereby enabling the device to be allocated to reselect the to-be-allocated MAC address block to avoid the conflict failure message.
  • the conflicting MAC address block is included, so that the retransmitted registration message has a greater probability of avoiding receiving the collision failure message.
  • the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message, so that the registration message for the conflict failure message can be obtained. In this embodiment, the corresponding relationship is preferably the The message identifier in the conflict failure message is consistent with the message identifier in the registration message.
  • the abbreviated message includes a message identifier for uniquely identifying the affirmative message and a MAC address to be declared. It should be noted that, after receiving the abbreviated message, the network device in the network may establish and maintain a forwarding mapping relationship between the receiving port that receives the adjacency message and the MAC address that needs to be stated in the adjacency message, and the reserved form may be Update the forwarding table of the network device according to the established forwarding mapping relationship, so that the subsequent network device needs to forward the message to the receiving port through the query forwarding table, so that the message needs to be forwarded from the receiving port. Broadcast transmission.
  • the foregoing solution may further include:
  • the device to be allocated reselects a block of MAC addresses to be allocated, and resends the registration message
  • the retransmitted registration message may include a message identifier for uniquely identifying the registration message and a reselected MAC address block to be allocated.
  • the device to be allocated does not detect any conflict, it may be known that when the device to be allocated receives a conflict failure message for the registration message or a declaration message that is verified as an address conflict, The device to be allocated may determine that the conflict is perceived; the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs.
  • the process may further include: when the device to be allocated receives the declaration message sent by the other device, and the MAC address and registration required to be declared in the declaration message sent by the other device.
  • the MAC address block to be allocated that needs to be registered in the message is used for collision detection to determine whether a conflict occurs:
  • the registration message is not processed; preferably, the registration message can also continue to be sent.
  • the method of conflict detection may be to determine whether the intersection between the MAC address to be declared in the affirmative message sent by the other device and the MAC address block to be allocated in the registration message is empty, if the intersection is empty. , indicating a conflict; otherwise, there is no conflict.
  • the embodiment provides a method for allocating a local MAC address to a device to be allocated, and sends a MAC address block to be allocated to the network device of the entire network through the device to be allocated, and according to other network devices of the entire network, the MAC address to be allocated.
  • the feedback of the block is used to declare the MAC address used by itself, realizing the registration of the local MAC address and the collision detection of the local MAC address, not only implementing the local MAC address allocation protocol in multiple network devices, but also adapting to different local network architectures. .
  • a flow of a method for allocating a local MAC address provided by an embodiment of the present disclosure may be applied to an allocated device in a network that has been assigned a local MAC address.
  • the process can include:
  • the allocated device receives a registration message sent by the device to be allocated.
  • the registration message may be sent to the entire network by the device to be allocated that needs to be assigned a local MAC address in the network.
  • the registration message may include: a message identifier for uniquely identifying the registration message, and a MAC to be allocated that needs to be registered by the device to be allocated. Address block.
  • S202 The allocated device performs collision detection on the MAC address block to be allocated in the registration message and its local MAC address.
  • the device in the network has only one corresponding local MAC address in the entire network.
  • the MAC address to be allocated in the registration message is not used by all the allocated devices in the network, it indicates that the device to be allocated is capable of using the MAC address to be allocated in the registration message; when the MAC address to be allocated in the registration message has been used in the network
  • the allocated device it indicates that the MAC address to be allocated in the registration message conflicts with the used MAC address, so the device to be allocated cannot use the MAC address to be allocated in the registration message, and the MAC address to be allocated needs to be reselected. . Therefore, the assigned device has the following two results for collision detection:
  • the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs.
  • the message identifier in the conflict failure message can have a corresponding relationship with the message identifier in the registration message, so that the registration message for the conflict failure message can be obtained.
  • the corresponding relationship is preferably the conflict.
  • the message identifier in the failure message is consistent with the message identifier in the registration message.
  • the technical solution of the present process may further include: an allocated device termination registration message.
  • the device to be allocated will continue to send the declaration message without receiving the conflict failure message for the registration message, so that the device to be allocated will declare the MAC in the message to be declared.
  • the address is the local MAC address of the device to be assigned itself.
  • the embodiment provides a method for allocating a local MAC address to an allocated device, and the allocated device receives the MAC address block to be allocated sent by the device to be allocated, and conflicts with the MAC address block to be allocated according to its own MAC address. Detecting, when a conflict occurs, feeding back a conflict failure message to the device to be allocated, and ending the registration of the device to be allocated when there is no conflict, realizing registration of the local MAC address and collision detection of the local MAC address, not only implemented in multiple network devices
  • the local MAC address allocation protocol can also be adapted to different local network architectures.
  • a flow of a method for allocating a local MAC address is provided.
  • the method may be applicable to a network device that performs forwarding in a network, and the process may include :
  • S301 The network device receives a registration message sent by the device to be allocated.
  • the registration message may include: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered.
  • the network device determines, according to the preset forwarding policy, whether to forward the registration message to other network devices in the network other than the device to be allocated.
  • the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs; generally, the message identifier setting of the conflict failure message may be consistent with the message identifier in the registration message. Therefore, the network device can query the correspondence established in step S301 according to the message identifier in the conflict failure message, so that the forwarding message can send the conflict failure message to the device to be allocated from the receiving port of the registration message.
  • the abbreviated message includes a message identifier for uniquely identifying the affirmative message and a MAC address to be declared. Therefore, the network device can establish a forwarding mapping relationship between the receiving port that receives the abbreviated message and the MAC address to be declared in the adjacency message, and save the mapping relationship in a form of a forwarding entry.
  • the network device usually has a forwarding table. After the new forwarding entry is established, the new forwarding entry can be updated with the existing forwarding table, so that the subsequent network device receives the MAC to be sent to the required forwarding.
  • the forwarding table can be retrieved to query the corresponding sending port, and the packet is directly forwarded from the sending port, which reduces the broadcast sending packet.
  • the network device determines whether to forward the registration message to other network devices other than the device to be allocated in the network, which may include :
  • the network device When the network device is configured with the agent of the allocated device, the network device performs collision detection on the MAC address block to be allocated in the registration message and the local MAC address of the allocated device of the network device proxy;
  • the network device When a conflict occurs, the network device sends a corresponding conflict failure message; and,
  • the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  • the conflict failure message is finally received by the device to be allocated.
  • the network device determines whether to forward the registration message to other network devices other than the device to be allocated in the network, which may include :
  • the network device When the network device does not set a proxy for the device to be allocated, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  • the network device forwarding the registration message to other network devices other than the device to be allocated in the network may include:
  • the network device After the network device obtains the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port;
  • the registration message is sent through a port other than the receiving port.
  • the network device agent when the network device agent has other allocated devices, the behavior of the allocated device is first performed, that is, the collision detection is performed for the MAC address block to be allocated in the registration message, and the process of performing collision detection may be as in the second embodiment.
  • the description of step S202 is not described in this embodiment.
  • the registration message is no longer forwarded.
  • the network device with the proxy capability After receiving the abbreviated message, the network device with the proxy capability still needs to establish a forwarding mapping relationship according to the adjacency message, thereby retaining the MAC address that needs to be declared in the affirmative message.
  • a local media access control MAC address allocation method may include:
  • S401 The database server receives a registration message sent by the device to be allocated.
  • the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the device when the device to be allocated sends the registration message to the database server, the device may send the unicast transmission to enable the database server to receive the registration message.
  • S402 The database server performs collision detection on the to-be-assigned MAC address and the saved MAC address:
  • the saved MAC address is a MAC address in a used state in the entire network
  • the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
  • the method further includes:
  • the database server when the database server receives the affirmation message, save the MAC address that needs to be stated in the declaration message, and set the state of the MAC address that needs to be declared to the usage state; wherein the declaration message includes The message identifier identifying the affirmative message and the MAC address to be declared.
  • the database server After the database server saves and sets the MAC address to be declared in the declaration message to the usage state, the database server updates the saved MAC address, so that the subsequent saved MAC address can be used for conflict. Detection.
  • the present embodiment describes the technical solutions of the above three embodiments by a specific example.
  • This embodiment is implemented by extending the MSRP (Multiple Stream Registration Protocol) protocol based on the MRP (Multiple Registration Protocol) protocol, and may be referred to as a Multi-MAC Assignment Protocol (MMAP).
  • MMAP Multi-MAC Assignment Protocol
  • the three types of messages can be carried by MMAP data units (MMAPDUs, MMAP Data Units).
  • the AttributeType field adds three values corresponding to the three types of messages; the VectorAttribute bytes in the AttributeList field can be defined as two types: The message identifies the messageID attribute and the MAC address attribute; wherein the messageID attribute contains a messageID for distinguishing different message messages.
  • a 48-bit MAC address start value plus a 16-bit random ID may be preferably used for representation; and a MAC address attribute includes a MAC address start value and a MAC address number.
  • the present embodiment is described based on the networking structure shown in FIG. 5.
  • the device to be allocated is T; the allocated device is L; and the network device used for forwarding is B; it should be noted that when the network device is When a proxy is set, B can function as a T or L, and each device is connected through a local area network (LAN), as shown by the circle in FIG.
  • LAN local area network
  • the MAC address registration message is sent; the AttributeList carried in the registration message is as shown in FIG. 6, including the messageID attribute and the MAC address attribute; wherein the MAC address attribute includes the MAC to be allocated that needs to be registered. Address space
  • B After receiving the MAC address registration message, B saves the correspondence between the message ID in the MAC address registration message and the receiving port that receives the MAC address registration message, and forwards the MAC address registration message to other ports, and forwards it through B. Both will receive the MAC address registration message sent by T.
  • the foregoing sending process for the MAC address registration message is as shown in FIG. 7.
  • the direction of the arrow is the direction of transmission of the MAC address registration message
  • the edge of the arrow indicates the MAC address registration message, in the box of B.
  • S indicates that B stores the correspondence between the messageID in the MAC address registration message and the receiving port that receives the MAC address registration message.
  • L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the device: if there is no conflict, the MAC address registration message is terminated; if the conflict occurs, the MAC address conflict is sent.
  • the AttributeList carried in the MAC address conflict message also carries the messageID attribute and the MAC address attribute, but the MAC address attribute at this time represents the conflicting MAC address space.
  • the value of the messageID attribute in the MAC address conflict message is the same as the value of the messageID attribute in the MAC address registration message, so that the registration message for the conflict failure message can be characterized.
  • the B After receiving the MAC address conflict message, the B forwards the MAC address conflict message to T according to the message ID in the MAC address conflict message and the B save correspondence shown in FIG. 7.
  • the above-mentioned delivery process for the MAC address conflict message is as shown in FIG. 9.
  • the arrow direction is the transmission direction of the MAC address conflict message
  • the arrow C indicates the MAC address conflict message, in the box of B.
  • the P indicates that the correspondence saved by B is saved.
  • the device can wait for the preset interval period to perform the sending of the MAC address registration message. After continuously sending the MAC address registration message several times, if no MAC address conflict message is received, the MAC address declaration message is sent to the entire network; After receiving the MAC address conflict message in this period, the new MAC address to be assigned needs to be re-selected and the MAC address registration message is resent. At this time, the message ID also changes with the reselected MAC address.
  • the network device B may establish a forwarding mapping relationship between the abbreviated MAC address and the receiving port according to the MAC address declared in the MAC address declaration message and the receiving port receiving the declaration message, and The forwarding mapping relationship is updated to B's own forwarding table.
  • the save form can be: save the declared MAC address to the destination address, and save the receive port to the output port. Therefore, after receiving the packet to be sent to the abbreviated MAC address, the forwarding table can be searched to find the output port, and the packet is directly forwarded to the T, thereby reducing the sending of the packet by broadcast.
  • the above-mentioned delivery process for the MAC address declaration message is as shown in FIG. 10.
  • the direction of the arrow is the transmission direction of the MAC address declaration message
  • the A of the arrow indicates the MAC address declaration message.
  • the implementation process is performed by the agent with L set in B.
  • the agent with L is set in B
  • the MAC of the proxy L is stored in B. The address, therefore, can be replied to the MAC address conflict message instead of the L being proxied.
  • the implementation process of this embodiment is as follows:
  • the MAC address registration message is sent; the AttributeList carried in the registration message is as shown in FIG. 6, including the messageID attribute and the MAC address attribute; wherein the MAC address attribute includes the MAC to be allocated that needs to be registered. Address space
  • B After receiving the MAC address registration message, B stores the correspondence between the messageID in the MAC address registration message and the receiving port that receives the MAC address registration message. For B without the proxy, the MAC is processed according to the procedure shown in Figure 7. The address registration message is delivered, which is not described in this embodiment.
  • the B set with the proxy detects whether the MAC address saved by itself is in conflict with the MAC address to be allocated that needs to be registered: if there is a conflict, B will send a MAC conflict message to the proxy L. Otherwise, the MAC address registration message is terminated and no forwarding is performed.
  • FIG. 11 the schematic diagram of the B-sending MAC address conflict message set by the proxy is as shown in FIG. 11.
  • the B provided with the proxy is shown by the shaded box, and the direction of the arrow is the B set with the proxy.
  • L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the device: if there is no conflict, the MAC address registration message is terminated; if the conflict occurs, the MAC address conflict is sent.
  • the AttributeList carried in the MAC address conflict message also carries the messageID attribute and the MAC address attribute, but the MAC address attribute at this time represents the conflicting MAC address space.
  • the value of the messageID attribute in the MAC address conflict message is the same as the value of the messageID attribute in the MAC address registration message, so that the registration message for the conflict failure message can be characterized.
  • B After receiving the MAC address conflict message, B forwards the MAC address conflict message to T according to the messageID in the MAC address conflict message and the B save correspondence shown in FIG. 7.
  • the device can wait for the preset interval period to perform the sending of the MAC address registration message. After continuously sending the MAC address registration message several times, if no MAC address conflict message is received, the MAC address declaration message is sent to the entire network; After receiving the MAC address conflict message in this period, the new MAC address to be assigned needs to be re-selected and the MAC address registration message is resent. At this time, the message ID also changes with the reselected MAC address.
  • a B For a B that does not have a proxy, after receiving the MAC address declaration message, it can establish a forwarding mapping relationship between the declared MAC address and the receiving port according to the MAC address declared in the MAC address declaration message and the receiving port receiving the declaration message. And update the forwarding mapping relationship to B's own forwarding table.
  • the save form can be: save the declared MAC address to the destination address, and save the receive port to the output port. Therefore, after receiving the packet to be sent to the abbreviated MAC address, the forwarding table can be searched to find the output port, and the packet is directly forwarded to the T, thereby reducing the sending of the packet by broadcast.
  • MAC address declaration message For a B device configured with a proxy L application, if a MAC address declaration message is received, the MAC address declared in the MAC address declaration message is saved.
  • the L device For the L device, if it has not yet declared its own MAC address, when it receives the MAC address declaration message of other T, it also saves the MAC address in the MAC address declaration message, and needs to register as its own choice. The basis of the MAC address to be assigned to avoid conflicts.
  • the MAC address to be assigned that the device needs to be registered is selected, when the MAC address registration message is sent, if other MAC address declaration messages sent by the T are received, other Ts need to be sent.
  • the MAC address of the life in the MAC address declaration message is compared with the MAC address to be allocated that needs to be registered, and if there is a conflict, the MAC address to be allocated that needs to be registered needs to be re-selected, and the MAC address is restarted. The process of registering a message.
  • the MRP protocol may not be supported.
  • an Edge Control Protocol (ECP) protocol based on the Link Layer Discovery Protocol (LLDP) is used.
  • the implementation process is the same as that in the fourth embodiment and the fifth embodiment.
  • the content difference between the fifth embodiment and the sixth embodiment is that the message content in different messages is a type-length-value (TLV, Type-Length-Value).
  • TLV type-length-value
  • the form is carried in an LLDP data unit (LLDPDU, LLDP Data Unit).
  • the field TLV type indicates the type of the TLV.
  • TLV type Conflict, indicating that it is a MAC address conflict message
  • TLV type Announce, indicating that it is a MAC address declaration message.
  • the field TLV Length is the length of this TLV.
  • the field TLV Value mainly includes two kinds of information: Message ID and MAC start address; for Message ID, it indicates the unique identifier of the message, and for the MAC start address, it indicates the start value of the MAC address block, which is different.
  • the message type has a different meaning.
  • it If it is a registration message, it indicates a MAC address block that needs to be registered; if it is a conflict message, it indicates that the MAC address block has been used by other devices, there is a conflict, and a new MAC address block needs to be reselected; if it is a declaration message , indicating that the MAC address block is officially used by the device, and other devices cannot be used.
  • the number of fields indicates the number of addresses in the address block.
  • the technical solutions of the fifth embodiment and the sixth embodiment can also be implemented based on the Gratuitous ARP (Gratuitous Address Resolution Protocol).
  • the implementation process is the same as that of the fourth embodiment and the fifth embodiment.
  • the difference lies in the need for the existing free ARP.
  • the message is extended. Therefore, the extended free ARP packet can be used to carry the message content in different messages.
  • This embodiment provides a preferred extension to extend the gratuitous ARP packet, but is not limited to the extension.
  • the following attribute values in the gratuitous ARP packet are set, and are set as:
  • Opcode 10, indicating that the type is a MAC address registration message
  • Sender MAC fill in the starting address of the MAC address block
  • Sender IP if there is one, if not, it is 0;
  • Destination MAC fill in the last address of the MAC address block
  • Destination IP Fill in the same address as the Sender IP.
  • the following attribute values in the gratuitous ARP packet are set and set to:
  • Opcode 11, indicating that the type is a MAC address conflict message
  • Sender MAC fill in the starting address of the conflicting MAC address block
  • Sender IP if there is one, if not, it is 0;
  • Destination MAC fill in the last address of the conflicting MAC address block
  • Destination IP Fill in the same address as the Sender IP.
  • the following attribute values in the gratuitous ARP packet are set, and are set as:
  • Opcode 12, indicating that the type is a MAC address declaration message
  • Sender MAC fill in the starting address of the declared MAC address block
  • Sender IP if there is one, if not, it is 0;
  • Destination MAC fill in the last address of the declared MAC address block
  • Destination IP Fill in the same address as the Sender IP.
  • the advantage of implementing the above technical solution based on the free ARP is that it can be combined with the IP address.
  • the correspondence between the MAC address and the IP address can be directly established after the affirmation message.
  • a device to be allocated 130 which includes: a first sending module 1301, a sensing module 1302, and a determining module. 1303; among them,
  • the first sending module 1301 is configured to send a registration message of a local media access control MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message, and a MAC address block to be allocated that needs to be registered. ;
  • the sensing module 1302 is configured to detect any conflicts; and when no conflict is perceived, the determining module 1303 and the first sending module 1301 are triggered;
  • the determining module 1303 is configured to determine the MAC address block to be allocated as the MAC address of the device to be allocated;
  • the first sending module 1301 is further configured to send a declaration message of the MAC address, where the adjacency message includes: a message identifier for uniquely identifying the adjacency message and a to-be-allocated MAC address block that needs to be declared.
  • the sensing module 1302 is configured to: when the first sending module 1301 sends the registration message according to a preset interval, according to a preset interval, does not receive a conflict for the registration message.
  • the message or the affirmation message of the address conflict is determined, and the MAC address conflict is not detected;
  • the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs;
  • the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • the to-be-distributed device 130 further includes a selection module 1304;
  • the sensing module 1302 is further configured to: when the conflict is perceived, trigger the selection module and the first sending module 1301;
  • the selecting module 1304 is configured to reselect a MAC address block to be allocated
  • the first sending module 1301 is further configured to resend the registration message.
  • the to-be-distributed device 130 further includes a first receiving module 1305 and a first detecting module 1306;
  • the first receiving module 1305 is configured to receive a declaration message sent by another device
  • the first detecting module 1306 is configured to detect, by using a MAC address that needs to be clarified in the affirmative message sent by the other device, with a MAC address block to be allocated that needs to be registered in the registration message, to determine whether a conflict occurs: if a conflict occurs. Activating the selection module; if no conflict occurs, the registration message is not processed;
  • the selecting module 1304 is further configured to reselect the MAC address block to be allocated, and replace the original MAC address block to be allocated in the registration message with the re-selected Mac address block to be allocated.
  • each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • the integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product.
  • the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium.
  • a storage medium such as an optical disk, a hard disk, a USB disk, or the like
  • the program instructions When the program instructions are read or executed by an electronic device, the following steps are included:
  • the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the steps stored in the storage medium are: no conflicts are perceived, including:
  • a conflicting message where the conflicting failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs; the message identifier in the conflict failure message and the message identifier in the registration message have Correspondence relationship.
  • the step of storing in the storage medium the method further comprises: when the conflict is perceived, reselecting the block of the MAC address to be allocated, and resending the registration message.
  • the step of storing in the storage medium the method further includes:
  • the MAC address to be declared in the affirmation message sent by the other device is collided with the to-be-allocated MAC address block to be registered in the registration message to determine whether a conflict occurs:
  • the step of storing the MAC address to be allocated in the registration message is obtained by the device to be allocated according to a preset selection policy.
  • a hardware structure of a device to be allocated 130 may be included, which may include: a first communication interface 1501, a first memory 1502, and a first process. And a first bus 1504; wherein
  • the first bus 1504 is configured to connect the first communication interface 1501, the first processor 1503, and the first memory 1502, and mutual communication between the devices;
  • the first communication interface 1501 is configured to perform data transmission with an external network element
  • the first memory 1502 is configured to store instructions and data
  • the first processor 1503 executes the instruction for: sending a registration message of a local MAC address; wherein the registration message includes: a message identifier for uniquely identifying the registration message and a MAC address to be allocated that needs to be registered Piece;
  • the first memory 1502 may be a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory, and
  • RAM random access memory
  • non-volatile memory such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory
  • a processor 1503 provides instructions and data.
  • the first processor 1503 may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), or a programmable logic device. At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is to be understood that, for different devices, the electronic device for implementing the functions of the first processor described above may also be other, and the embodiment of the present disclosure is not specifically limited.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • programmable logic device At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • CPU Central Processing Unit
  • controller microcontroller, and microprocessor
  • the first processor 1503 may be configured to: when the registration message is sent according to a preset interval, according to a preset interval, does not receive a conflict failure message or verification for the registration message. Determining, by the adjacency message of the address conflict, that the MAC address conflict is not to be allocated; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs; the conflict The message identifier in the failure message has a correspondence with the message identifier in the registration message.
  • the first processor 1503 may be further configured to: when the conflict is perceived, reselect the block of the MAC address to be allocated, and resend the registration message.
  • the first processor 1503 may be further configured to: when receiving a declaration message sent by another device, request a MAC address that needs to be declared in the declaration message sent by the other device, and the registration message needs to be performed. Registered MAC address blocks to be allocated for collision detection to determine if a conflict occurs:
  • the to-be-allocated MAC address block that needs to be registered in the registration message is obtained by the device to be allocated according to a preset selection policy.
  • an allocated device 160 includes: a second receiving module 1601, a second detecting module 1602, and a second sending module 1603; wherein
  • the second receiving module 1601 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated.
  • the second detecting module 1602 is configured to perform collision detection between the MAC address block to be allocated in the registration message and the local MAC address of the registration message; when the conflict occurs, the second sending module 1603 is triggered;
  • the second sending module 1603 is configured to send a conflict failure message to the to-be-assigned device, where the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
  • the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • the integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product.
  • the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium.
  • a storage medium such as an optical disk, a hard disk, a USB disk, or the like
  • the program instructions When the program instructions are read or executed by an electronic device, the following steps are included:
  • a registration message including: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
  • a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
  • the step of storing in the storage medium is: the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • a hardware structure of a distributed device 160 may be included, which may include: a second communication interface 1701, a second memory 1702, and a second process. 1703 and a second bus 1704; wherein
  • the second bus 1704 is configured to connect the second communication interface 1701, the second processor 1703, and the second memory 1702 and mutual communication between the devices;
  • the second communication interface 1701 is configured to perform data transmission with an external network element.
  • the second memory 1702 is configured to store instructions and data
  • the second processor 1703 executes the instructions for:
  • a registration message including: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
  • a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
  • the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  • the network device 180 includes: a third receiving module 1801, a forwarding module 1802, and an establishing module 1803. among them,
  • the third receiving module 1801 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated.
  • the forwarding module 1802 is configured to determine, according to a preset forwarding policy, whether to forward the registration message to another network device other than the device to be allocated in the network;
  • the third receiving module 1801 is configured to trigger the forwarding module 1802 when receiving a conflict failure message for the registration message, and trigger the establishing module 1803 when receiving the declaration message; wherein the conflict
  • the failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs;
  • the forwarding module 1802 is further configured to forward the conflict failure message to the to-be-distributed device
  • the establishing module 1803 is configured to establish a forwarding mapping relationship according to the adjacency message, where the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • the forwarding module 1802 is configured to:
  • the MAC address block to be allocated in the registration message is collided with the MAC address of the allocated device proxyed by the network device 180:
  • the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the forwarding module 1802 is configured to:
  • the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the forwarding device 180 is configured to acquire a correspondence between a message identifier of the registration message and the receiving port, after acquiring a receiving port for receiving a registration message;
  • the registration message is sent through a port other than the receiving port.
  • the establishing module 1803 is configured to establish a forwarding mapping relationship between a receiving port that receives the aforesaid message and a MAC address that needs to be stated in the adjacency message.
  • each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • the integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product.
  • the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium.
  • a storage medium such as an optical disk, a hard disk, a USB disk, or the like
  • the program instructions When the program instructions are read or executed by an electronic device, the following steps are included:
  • a registration message including: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
  • conflict failure message Forwarding the conflict failure message to the device to be allocated when receiving a conflict failure message for the registration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and appearing Conflicting MAC address block;
  • the forwarding mapping relationship is established according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • the step of storing in the storage medium is: determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including:
  • the MAC address block to be allocated in the registration message is collided with the MAC address of the allocated device of the network device proxy:
  • the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the step of storing in the storage medium is: determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including:
  • the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the storing step in the storage medium forwarding the registration message to other network devices other than the device to be allocated in the network, including:
  • the registration message is sent through a port other than the receiving port.
  • the step of storing the forwarding in the storage medium the establishing a forwarding mapping relationship according to the adjacency message, including:
  • FIG. 19 shows a hardware structure of a network device 180 according to an embodiment of the present disclosure, which may include: a third communication interface 1901, a third memory 1902, and a third processor. 1903 and a third bus 1904; wherein
  • the third bus 1904 is configured to connect the third communication interface 1901, the third processor 1903, and the third memory 1902 and mutual communication between the devices;
  • the third communication interface 1901 is configured to perform data transmission with an external network element.
  • the third memory 1902 is configured to store instructions and data
  • the third processor 1903 executes the instructions for:
  • a registration message including: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
  • conflict failure message Forwarding the conflict failure message to the device to be allocated when receiving a conflict failure message for the registration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and appearing Conflicting MAC address block;
  • the forwarding mapping relationship is established according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • the third processor 1903 is configured to: when the network device is configured with a proxy of the allocated device, allocate the to-be-assigned MAC address block in the registration message to the network device proxy.
  • the device's MAC address is used for collision detection:
  • the registration message is forwarded to other network devices other than the device to be allocated in the network.
  • the third processor 1903 is configured to: when the network device does not set an agent of the distribution device, forward the registration message to other network devices other than the device to be allocated in the network.
  • the third processor 1903 is configured to:
  • the registration message is sent through a port other than the receiving port.
  • the third processor 1903 is configured to:
  • the database server 200 includes: a fourth receiving module 2001, a third detecting module 2002, and a third sending module 2003, wherein
  • the fourth receiving module 2001 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the third detecting module 2002 is configured to perform collision detection on the to-be-assigned MAC address and the saved MAC address, where the saved MAC address is a MAC address in a used state in the entire network;
  • the third sending module 2003 is configured to send a conflict failure message to the to-be-distributed device, where the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
  • the database server 200 further includes: a saving module 2004, configured to save, when the fourth receiving module 2001 receives the affirmation message, a MAC address that needs to be stated in the declaration message, and Setting the status of the MAC address to be declared to a usage status; wherein the declaration message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software function module.
  • the integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product.
  • the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
  • the computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium.
  • a storage medium such as an optical disk, a hard disk, a USB disk, or the like
  • the program instructions When the program instructions are read or executed by an electronic device, the following steps are included:
  • the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
  • the step of storing in the storage medium the method further includes:
  • the database server when the database server receives the affirmation message, save the MAC address that needs to be stated in the declaration message, and set the state of the MAC address that needs to be declared to the usage state; wherein the declaration message includes A message identifier that uniquely identifies the affirmative message and a MAC address that needs to be declared.
  • the hardware structure of the database server 200 may include: a fourth communication interface 2201, a fourth memory 2202, and a fourth processor. 2203 and a fourth bus 2204; wherein
  • the fourth bus 2204 is configured to connect the fourth communication interface 2201, the fourth processor 2203, and the fourth memory 2202 and mutual communication between the devices;
  • the fourth communication interface 2201 is configured to perform data transmission with an external network element
  • the fourth memory 2202 is configured to store instructions and data
  • the fourth processor 2203 executes the instructions for:
  • the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
  • the fourth memory 2202 may be a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory, and
  • RAM random access memory
  • non-volatile memory such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory
  • the four processor 2203 provides instructions and data.
  • the fourth processor 2203 may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), or a programmable logic device. At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is to be understood that the electronic device for implementing the fourth processor function described above may be other for different devices, and is not specifically limited in the embodiment of the present disclosure.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • programmable logic device At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor microprocessor
  • the fourth processor 2203 is further configured to:
  • the abbreviated message includes the identifier for The message identifier of the affirmation message and the MAC address that needs to be declared.
  • the system 230 includes at least one device to be allocated 130 and at least one allocated device. 160 and at least one network device 180; wherein
  • the device to be allocated 130 is configured to send a registration message of a local MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the method includes: a message identifier for uniquely identifying the abbreviated message; and a MAC address block to be allocated that needs to be declared;
  • the allocated device 180 is configured to receive the registration message sent by the to-be-distributed device 130.
  • the registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered.
  • the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs;
  • the network device 180 is configured to receive a registration message sent by the to-be-distributed device 130, where the registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered.
  • the conflict failure message when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message Identification and a block of MAC addresses that have conflicts;
  • the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • the system 240 includes: at least one to-be-distributed device 130, at least one database server. 200 and at least one network device 180; wherein
  • the device to be allocated 130 is configured to send a registration message of a local MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the method includes: a message identifier for uniquely identifying the abbreviated message; and a MAC address block to be allocated that needs to be declared;
  • the database server 200 is configured to receive a registration message sent by the device to be allocated 130, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
  • the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs;
  • the network device 180 is configured to receive a registration message sent by the to-be-distributed device 130, where the registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered.
  • the conflict failure message when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message Identification and a block of MAC addresses that have conflicts;
  • the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
  • embodiments of the present disclosure can be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the method, device, and system for allocating the local media access control address of the present disclosure send the to-be-allocated address block to the network device of the entire network through the device to be allocated, and declare the self-use according to the feedback of the other network device of the entire network for the address block to be allocated.
  • the address realizes the registration of the local address and the collision detection of the local address, not only realizing the local address allocation protocol in multiple network devices, but also adapting to different local network architectures.

Landscapes

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

Abstract

Disclosed in the embodiment of the present disclosure are a method, equipment and a system for allocating a local media access control address. The method can comprise: a to-be-allocated equipment sends a registration message of a local MAC address; when the to-be-allocated equipment senses no conflict, determining an address block of the to-be-allocated MAC as the MAC address of the to-be-allocated equipment, and sending a declaration message of the MAC address.

Description

一种本地媒体访问控制地址的分配方法、设备和系统Method, device and system for allocating local media access control address
相关申请的交叉引用Cross-reference to related applications
本申请要求于2017年03月10日递交的中国专利申请第201710144446.5号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。The present application claims priority to Chinese Patent Application No. 201710144446.5, filed on Mar.
技术领域Technical field
本公开涉及网络通信技术,尤其涉及一种本地媒体访问控制(MAC,Media Access Control)地址的分配方法、设备和系统。The present disclosure relates to network communication technologies, and in particular, to a method, device, and system for allocating local media access control (MAC) addresses.
背景技术Background technique
数据中心规模的扩大和虚拟化的引入,不仅带来了物理设备的增加,而且还带来了虚拟设备的指数增长。这些设备的增长都导致了MAC地址的消耗急剧上升。而目前传统的MAC地址是上述设备在制造或出厂时已经分配固定的48比特的MAC地址,以便于设备之间通信。The expansion of the data center and the introduction of virtualization not only bring about an increase in physical equipment, but also bring about an exponential growth of virtual devices. The growth of these devices has led to a sharp rise in the consumption of MAC addresses. At present, the conventional MAC address is that the above device has been assigned a fixed 48-bit MAC address at the time of manufacture or shipment to facilitate communication between devices.
而传统的MAC地址在应用时会出现很多问题,比如:MAC地址空间容量已不能满足日益消耗的MAC地址;MAC地址是固定不变的;MAC地址并不分层,无法提供其他与设备相关的信息,例如位置信息等。为了解决传统MAC地址所出现的问题,电气和电子工程师协会(IEEE,Institute of Electrical and Electronics Engineers)提出了一种本地MAC地址的概念,即MAC地址在某些网络环境下不再是全球唯一的48位地址,而是一种在网络内唯一的本地化地址。并且可以采用一种统一分配地址的方式来给网络中的每一个网元统一分配本地MAC地址。The traditional MAC address will have many problems when it is applied. For example, the MAC address space capacity cannot meet the increasingly consumed MAC address; the MAC address is fixed; the MAC address is not layered and cannot provide other device-related Information, such as location information. In order to solve the problems of the traditional MAC address, the Institute of Electrical and Electronics Engineers (IEEE) proposed a concept of local MAC address, that is, the MAC address is no longer globally unique in some network environments. A 48-bit address, but a unique localized address within the network. And a unified allocation of addresses can be used to uniformly allocate a local MAC address to each network element in the network.
当前,对于本地MAC地址的分配,通常采用发送请求数据包的形式来申请本地MAC地址,因此只涉及到网络设备给主机等设备的地址分配,适用于小型网络,如车载内部小网络场景。而对于大型网络,如何在多个网络设备中实现MAC地址的获取,则需要相关的协议来完成。而另外对于本地MAC地址的分配方案,主机可以通过自申明的方式来实现MAC地址的获取,但整个网络架构为客户机和服务器(C/S,Client/Server)架构,因此采取的是集中服务器的方式,无法在其他网络架构下进行本地MAC地址的分配。Currently, for the allocation of the local MAC address, the local MAC address is usually applied in the form of a request packet, so only the address allocation of the network device to the host and the like is involved, which is suitable for a small network, such as a small internal network scenario. For large networks, how to obtain MAC addresses in multiple network devices requires related protocols. In addition, for the local MAC address allocation scheme, the host can obtain the MAC address by self-declaration, but the entire network architecture is a client and server (C/S, Client/Server) architecture, so the centralized server is adopted. In this way, local MAC address allocation cannot be performed under other network architectures.
本部分为与本公开相关的背景技术信息,但是该背景技术信息不一定是现有技术。This section is background information related to the present disclosure, but the background information is not necessarily prior art.
发明内容Summary of the invention
为解决上述技术问题,本公开实施例期望提供一种本地地址的分配方法、设备和系统;不仅在多个网络设备中实现本地地址的分配协议,还能够适应于不同的本地网络架构。In order to solve the above technical problem, embodiments of the present disclosure are expected to provide a local address allocation method, device, and system; not only implementing a local address allocation protocol in multiple network devices, but also adapting to different local network architectures.
根据本公开的一方面,提出一种本地媒体访问控制地址的分配方法,包括:According to an aspect of the present disclosure, a method for allocating a local media access control address is provided, including:
待分配设备发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The registration message of the local address is sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块。And determining, by the device to be allocated, the address to be allocated as the address of the device to be allocated, and sending a declaration message of the address; wherein the declaration message includes: The message identifier of the abbreviated message and the block of the address to be allocated that need to be declared.
根据本公开的实施例,所述待分配设备没有感知到任何冲突,包括:当所述待分配设备根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定所述待分配设备没有感知到有待分配地址块冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。According to the embodiment of the present disclosure, the device to be allocated does not detect any conflict, and includes: after the device to be allocated sends the registration message according to a preset interval according to a preset interval, Determining the conflicting failure message of the registration message or the affirmation message of the address conflict, determining that the device to be allocated does not perceive an address block conflict to be allocated; wherein the conflict failure message includes: a message for uniquely identifying the conflict failure message The message identifier and the conflicting address block; the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
根据本公开的实施例,所述方法还包括:当所述待分配设备感知到冲突时,所述待分配设备重新选择待分配地址块,并重新发送所述注册消息。According to an embodiment of the present disclosure, the method further includes: when the device to be allocated senses a conflict, the device to be allocated reselects an address block to be allocated, and resends the registration message.
根据本公开的实施例,所述方法还包括:当所述待分配设备接收到其他设备发送的申明消息,将其他设备所发送的申明消息中的需要进行申明的地址块与所述注册消息中需要进行注册的待分配地址块进行冲突检测,确定是否出现冲突:如果出现冲突,则重新选择待分配地址块,并将所述注册消息中原有的需要进行注册的待分配地址块替换为重新选择的待分配地址块;如果没有出现冲突,则不作处理。According to an embodiment of the present disclosure, the method further includes: when the device to be allocated receives the declaration message sent by the other device, and the address block that needs to be declared in the declaration message sent by the other device and the registration message The address block to be allocated that needs to be registered is used for collision detection to determine whether a conflict occurs: if a conflict occurs, the address block to be allocated is reselected, and the original address block to be allocated in the registration message that needs to be registered is replaced with a reselection. The block of addresses to be allocated; if no conflicts occur, no processing is done.
根据本公开的实施例,所述注册消息中需要进行注册的待分配地址块由所述待分配设备按照预设的选择策略进行选择后得到。According to an embodiment of the present disclosure, the to-be-allocated address block that needs to be registered in the registration message is obtained by the device to be allocated according to a preset selection policy.
根据本公开的另一方面,提出一种本地媒体访问控制地址的分配方法,包括:According to another aspect of the present disclosure, a method for allocating a local media access control address is provided, including:
已分配设备接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The allocated device receives the registration message sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
所述已分配设备将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;The allocated device performs collision detection on the to-be-allocated address block in the registration message and its own local address;
当出现冲突时,所述已分配设备将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。When a conflict occurs, the allocated device sends a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
根据本公开的实施例,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。According to an embodiment of the present disclosure, the message identifier in the conflict failure message has a correspondence relationship with the message identifier in the registration message.
根据本公开的再一方面,提出一种本地媒体访问控制地址的分配方法,包括:According to still another aspect of the present disclosure, a method for allocating a local media access control address is provided, including:
网络设备接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;Determining, by the network device, whether the registration message is forwarded to other network devices other than the device to be allocated in the network according to a preset forwarding policy;
当所述网络设备接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转 发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And when the network device receives the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message. The message identifier and the address block where the conflict occurred;
当所述网络设备接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And when the network device receives the adjacency message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
根据本公开的实施例,所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:当所述网络设备设置有已分配设备的代理时,所述网络设备将所述注册消息中的待分配地址块与所述网络设备代理的已分配设备的地址进行冲突检测:当出现冲突时,所述网络设备发送对应的冲突失败消息,当没有出现冲突时,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。According to an embodiment of the present disclosure, the network device determines, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including: when the network device is configured to be allocated. When the proxy of the device, the network device performs collision detection on the address block to be allocated in the registration message and the address of the allocated device of the network device proxy: when a conflict occurs, the network device sends a corresponding conflict failure The message, when no conflict occurs, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
根据本公开的实施例,所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:当所述网络设备没有设置已分配设备的代理时,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。According to an embodiment of the present disclosure, the network device determines, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including: when the network device is not configured to be allocated. When the device is a proxy, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
根据本公开的实施例,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:所述网络设备获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;将所述注册消息通过所述接收端口之外的其他端口进行发送。According to an embodiment of the present disclosure, the network device forwarding the registration message to other network devices other than the device to be allocated in the network, including: after the network device acquires a receiving port for receiving a registration message, establishing a location Corresponding relationship between the message identifier of the registration message and the receiving port; sending the registration message through a port other than the receiving port.
根据本公开的实施例,所述根据申明消息建立转发映射关系,包括:所述网络设备建立接收到所述申明消息的接收端口与所述申明消息中所申明的地址之间的转发映射关系。According to an embodiment of the present disclosure, the establishing a forwarding mapping relationship according to the adjacency message includes: the network device establishing a forwarding mapping relationship between a receiving port that receives the aforesaid message and an address declared in the abbreviated message.
根据本公开的又一方面,提出一种本地媒体访问控制地址的分配方法,包括:According to still another aspect of the present disclosure, a method for allocating a local media access control address is provided, including:
数据库服务器接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The database server receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
所述数据库服务器将所述待分配地址块与已保存的地址进行冲突检测:其中,所述已保存的地址为全网中处于使用状态的地址;The database server performs collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a usage state in the entire network;
当出现冲突时,所述数据库服务器将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。When a conflict occurs, the database server sends a conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
根据本公开的实施例,所述方法还包括:当所述数据库服务器收到申明消息时,将所述申明消息中需要申明的地址保存,并将所述需要申明的地址的状态设置为使用状态;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。According to an embodiment of the present disclosure, the method further includes: when the database server receives the affirmation message, save an address that needs to be stated in the declaration message, and set a state of the address to be stated to a usage state. Wherein the affirmative message includes a message identifier for uniquely identifying the affirmative message and an address to be claimed.
根据本公开的又一方面,提出一种待分配设备,所述待分配设备包括:第一发送模块、感知模块和确定模块;其中,According to still another aspect of the present disclosure, a device to be allocated is provided, where the device to be allocated includes: a first sending module, a sensing module, and a determining module;
所述第一发送模块,设置为发送本地媒体访问控制地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The first sending module is configured to send a registration message of the local media access control address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
所述感知模块,设置为感知冲突;并当没有感知到任何冲突时,触发所述确定模块和 第一发送模块;The sensing module is configured to detect a conflict; and when no conflict is perceived, the determining module and the first sending module are triggered;
所述确定模块,设置为将所述待分配地址块确定为所述待分配设备的地址;The determining module is configured to determine the address block to be allocated as an address of the device to be allocated;
所述第一发送模块,还设置为发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块。The first sending module is further configured to send a declaration message of the address, where the adjacency message includes: a message identifier for uniquely identifying the adjacency message and an address block to be allocated that needs to be declared.
根据本公开的实施例,所述感知模块,设置为当所述第一发送模块根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定没有感知到待分配地址块冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。According to an embodiment of the present disclosure, the sensing module is configured to not receive a conflict with the registration message after the first sending module sends the registration message according to a preset interval period according to a preset number of times. Determining, by the failure message, the affirmative message of the address conflict, and determining that the address block conflict is not to be allocated; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and an address block in which the conflict occurs; The message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
根据本公开的实施例,所述待分配设备还包括选择模块;所述感知模块,还设置为当感知到冲突时,触发所述选择模块和所述第一发送模块;所述选择模块,设置为重新选择待分配地址块;所述第一发送模块,还设置为重新发送所述注册消息。According to an embodiment of the present disclosure, the to-be-distributed device further includes a selection module; the sensing module is further configured to trigger the selection module and the first sending module when a conflict is perceived; the selecting module, setting To reselect the block to be allocated; the first sending module is further configured to resend the registration message.
根据本公开的实施例,所述待分配设备还包括第一接收模块和第一检测模块;所述第一接收模块,设置为接收其他设备发送的申明消息;第一检测模块,设置为将其他设备所发送的申明消息中的需要进行申明的地址块与所述注册消息中需要进行注册的待分配地址块进行冲突检测,确定是否出现冲突:如果出现冲突,触发所述选择模块;如果没有出现冲突,则不作处理;所述选择模块,还设置为重新选择待分配地址块,并将所述注册消息中原有的需要进行注册的待分配地址块替换为重新选择的待分配地址块。According to an embodiment of the present disclosure, the to-be-distributed device further includes a first receiving module and a first detecting module; the first receiving module is configured to receive a declaration message sent by another device; and the first detecting module is configured to The address block that needs to be declared in the affirmation message sent by the device performs collision detection with the to-be-allocated address block that needs to be registered in the registration message to determine whether a conflict occurs: if a conflict occurs, the selection module is triggered; if it does not appear If the conflict is not processed, the selection module is further configured to reselect the to-be-allocated address block, and replace the original to-be-allocated address block that needs to be registered in the registration message with the re-selected address block to be allocated.
根据本公开的又一方面,提出一种已分配设备,所述已分配设备包括:第二接收模块、第二检测模块和第二发送模块;其中,According to still another aspect of the present disclosure, a distributed device is provided, the distributed device including: a second receiving module, a second detecting module, and a second sending module;
所述第二接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The second receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
所述第二检测模块,设置为将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;当出现冲突时,触发所述第二发送模块;The second detecting module is configured to detect a conflict between the to-be-assigned address block and the local address of the registration message, and trigger the second sending module when a conflict occurs;
所述第二发送模块,设置为将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。The second sending module is configured to send a conflict failure message to the to-be-distributed device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
根据本公开的实施例,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。According to an embodiment of the present disclosure, the message identifier in the conflict failure message has a correspondence relationship with the message identifier in the registration message.
根据本公开的再一方面,提出一种网络设备,其中,所述网络设备包括:第三接收模块、转发模块和建立模块;其中,According to still another aspect of the present disclosure, a network device is provided, where the network device includes: a third receiving module, a forwarding module, and an establishing module;
所述第三接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The third receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
所述转发模块,设置为根据预设的转发策略决定是否将所述注册消息转发至网络中所 述待分配设备以外的其他网络设备;The forwarding module is configured to determine, according to a preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
所述第三接收模块,设置为当接收到针对所述注册消息的冲突失败消息时,触发所述转发模块;当接收到申明消息时,触发所述建立模块;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;The third receiving module is configured to trigger the forwarding module when receiving a conflict failure message for the registration message, and trigger the establishing module when receiving the declaration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
所述转发模块,还设置为将所述冲突失败消息转发至所述待分配设备;The forwarding module is further configured to forward the conflict failure message to the to-be-distributed device;
所述建立模块,设置为根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。The establishing module is configured to establish a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
根据本公开的实施例,所述转发模块,设置为:当所述网络设备设置有已分配设备的代理时,将所述注册消息中的待分配地址块与所述网络设备代理的已分配设备的地址进行冲突检测:以及,当出现冲突时,发送对应的冲突失败消息,以及,当没有出现冲突时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。According to an embodiment of the present disclosure, the forwarding module is configured to: when the network device is provided with a proxy of the allocated device, the to-be-allocated address block in the registration message and the allocated device of the network device proxy The address is detected by collision: and, when a conflict occurs, a corresponding conflict failure message is sent, and when no conflict occurs, the registration message is forwarded to other network devices other than the device to be allocated in the network.
根据本公开的实施例,所述转发模块,设置为:当所述网络设备没有设置已分配设备的代理时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。According to an embodiment of the present disclosure, the forwarding module is configured to: when the network device does not set an agent of the allocated device, forward the registration message to other network devices other than the device to be allocated in the network.
根据本公开的实施例,所述转发模块,设置为:获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;以及,将所述注册消息通过所述接收端口之外的其他端口进行发送。According to an embodiment of the present disclosure, the forwarding module is configured to: after acquiring a receiving port for receiving a registration message, establishing a correspondence between a message identifier of the registration message and the receiving port; and The registration message is sent through a port other than the receiving port.
根据本公开的实施例,所述建立模块,设置为建立接收到所述申明消息的接收端口与所述申明消息中需要申明的地址之间的转发映射关系。According to an embodiment of the present disclosure, the establishing module is configured to establish a forwarding mapping relationship between a receiving port that receives the affirmative message and an address that needs to be stated in the declaration message.
根据本公开的又一方面,提出一种数据库服务器,所述数据库服务器包括:第四接收模块、第三检测模块和第三发送模块,其中,According to still another aspect of the present disclosure, a database server is provided, where the database server includes: a fourth receiving module, a third detecting module, and a third sending module, where
所述第四接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The fourth receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
所述第三检测模块,设置为将所述待分配地址块与已保存的地址进行冲突检测:其中,所述以保存的地址为全网中处于使用状态的地址;The third detecting module is configured to perform collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a used state in the entire network;
以及,当出现冲突时,触发所述第三发送模块;And, when a conflict occurs, triggering the third sending module;
所述第三发送模块,设置为将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。The third sending module is configured to send a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
根据本公开的实施例,所述数据库服务器还包括:保存模块,设置为当所述第四接收模块收到申明消息时,将所述申明消息中需要申明的地址保存,并将所述需要申明的地址的状态设置为使用状态;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。According to an embodiment of the present disclosure, the database server further includes: a saving module, configured to save an address that needs to be stated in the affirmative message when the fourth receiving module receives the affirmation message, and set the need to affirm The status of the address is set to the usage status; wherein the affirmative message includes a message identifier for uniquely identifying the affirmative message and an address to be claimed.
根据本公开的再一方面,提出一种本地媒体访问控制地址的分配系统,其中,所述系统包括至少一个待分配设备、至少一个已分配设备和至少一个网络设备;其中,According to still another aspect of the present disclosure, a system for allocating a local media access control address is provided, wherein the system includes at least one device to be allocated, at least one allocated device, and at least one network device;
所述待分配设备,设置为发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
以及,当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块;And when the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
所述已分配设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The allocated device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated Address block
以及,将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;And detecting collision of the to-be-allocated address block in the registration message with its own local address;
以及,当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And sending a conflict failure message to the to-be-allocated device when a conflict occurs; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
所述网络设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;And determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And, when receiving the affirmative message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
根据本公开的又一方面,提出一种本地媒体访问控制地址的分配系统,所述系统包括至少一个待分配设备、至少一个数据库服务器和至少一个网络设备;其中,According to still another aspect of the present disclosure, a system for allocating a local media access control address is provided, the system comprising at least one device to be allocated, at least one database server, and at least one network device;
所述待分配设备,设置为发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
以及,当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块;And when the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
所述数据库服务器,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The database server is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
以及,将所述待分配地址与已保存的地址进行冲突检测:其中,所述已保存的地址为全网中处于使用状态的地址;And detecting the conflict between the to-be-assigned address and the saved address: wherein the saved address is an address in a usage state in the entire network;
以及,当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And sending a conflict failure message to the to-be-allocated device when a conflict occurs; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
所述网络设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;And determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And, when receiving the affirmative message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
本公开实施例提供了一种本地地址的分配方法、设备和系统;通过待分配设备向全网的网络设备发送待分配地址块,并根据全网的其他网络设备针对待分配地址块的反馈来申明自身使用的地址,实现了本地地址的注册以及本地地址的冲突检测,不仅在多个网络设备中实现本地地址的分配协议,还能够适应于不同的本地网络架构。An embodiment of the present disclosure provides a method, a device, and a system for allocating a local address; sending, by a device to be allocated, a block to be allocated to a network device of the entire network, and according to feedback of other network devices of the entire network for the block to be allocated. Declaring the address used by itself, realizing the registration of the local address and the collision detection of the local address, not only implementing the local address allocation protocol in multiple network devices, but also adapting to different local network architectures.
附图说明DRAWINGS
图1为本公开实施例提供的一种本地MAC地址的分配方法流程示意图;FIG. 1 is a schematic flowchart of a method for allocating a local MAC address according to an embodiment of the present disclosure;
图2为本公开实施例提供的另一种本地MAC地址的分配方法流程示意图;FIG. 2 is a schematic flowchart of another method for allocating a local MAC address according to an embodiment of the present disclosure;
图3为本公开实施例提供的又一种本地MAC地址的分配方法流程示意图;FIG. 3 is a schematic flowchart of still another method for allocating a local MAC address according to an embodiment of the present disclosure;
图4为本公开实施例提供的再一种本地MAC地址的分配方法流程示意图;FIG. 4 is a schematic flowchart of another method for allocating a local MAC address according to an embodiment of the present disclosure;
图5为本公开实施例提供的一种组网结构示意图;FIG. 5 is a schematic structural diagram of a networking according to an embodiment of the present disclosure;
图6为本公开实施例提供的一种多MAC分配协议数据单元的结构示意图;FIG. 6 is a schematic structural diagram of a multiple MAC allocation protocol data unit according to an embodiment of the present disclosure;
图7为本公开实施例提供的一种消息传递过程示意图;FIG. 7 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure;
图8为本公开实施例提供的另一种多MAC分配协议数据单元的结构示意图;FIG. 8 is a schematic structural diagram of another multi-MAC allocation protocol data unit according to an embodiment of the present disclosure;
图9为本公开实施例提供的一种消息传递过程示意图;FIG. 9 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure;
图10为本公开实施例提供的一种消息传递过程示意图;FIG. 10 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure;
图11为本公开实施例提供的一种消息传递过程示意图;FIG. 11 is a schematic diagram of a message delivery process according to an embodiment of the present disclosure;
图12为本公开实施例提供的一种链路层发现协议数据单元结构示意图;FIG. 12 is a schematic structural diagram of a link layer discovery protocol data unit according to an embodiment of the present disclosure;
图13为本公开实施例提供的一种待分配设备的结构示意图;FIG. 13 is a schematic structural diagram of a device to be allocated according to an embodiment of the present disclosure;
图14为本公开实施例提供的另一种待分配设备的结构示意图;FIG. 14 is a schematic structural diagram of another device to be allocated according to an embodiment of the present disclosure;
图15为本公开实施例提供的一种待分配设备的硬件结构示意图;FIG. 15 is a schematic structural diagram of hardware of a device to be allocated according to an embodiment of the present disclosure;
图16为本公开实施例提供的一种已分配设备的结构示意图;FIG. 16 is a schematic structural diagram of a distributed device according to an embodiment of the present disclosure;
图17为本公开实施例提供的一种已分配设备的硬件结构示意图;FIG. 17 is a schematic structural diagram of hardware of an allocated device according to an embodiment of the present disclosure;
图18为本公开实施例提供的一种网络设备的结构示意图;FIG. 18 is a schematic structural diagram of a network device according to an embodiment of the present disclosure;
图19为本公开实施例提供的一种网络设备的硬件结构示意图;FIG. 19 is a schematic structural diagram of hardware of a network device according to an embodiment of the present disclosure;
图20为本公开实施例提供的一种数据库服务器的结构示意图;FIG. 20 is a schematic structural diagram of a database server according to an embodiment of the present disclosure;
图21为本公开实施例提供的另一种数据库服务器的结构示意图;FIG. 21 is a schematic structural diagram of another database server according to an embodiment of the present disclosure;
图22为本公开实施例提供的一种数据库服务器的硬件结构示意图;FIG. 22 is a schematic structural diagram of hardware of a database server according to an embodiment of the present disclosure;
图23为本公开实施例提供的一种本地MAC地址的分配系统结构示意图;FIG. 23 is a schematic structural diagram of a local MAC address allocation system according to an embodiment of the present disclosure;
图24为本公开实施例提供的另一种本地MAC地址的分配系统结构示意图。FIG. 24 is a schematic structural diagram of another local MAC address allocation system according to an embodiment of the present disclosure.
具体实施方式detailed description
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.
其中,下文以MAC地址为例描述本公开的技术方案,但是本领域技术人员应当理解,本公开的方案可以使用在任何本地地址的分配方法、设备和系统中。The following describes the technical solution of the present disclosure by taking a MAC address as an example, but those skilled in the art should understand that the solution of the present disclosure can be used in any local address allocation method, device, and system.
实施例一Embodiment 1
参见图1,其示出了本公开实施例提供的一种本地MAC地址的分配方法流程,该流程适用于网络中需要分配本地MAC地址的待分配设备,该流程可以包括:FIG. 1 is a flowchart of a method for allocating a local MAC address according to an embodiment of the present disclosure. The process is applicable to a device to be allocated in a network that needs to allocate a local MAC address. The process may include:
S101:待分配设备发送本地MAC地址的注册消息;S101: The device to be allocated sends a registration message of a local MAC address.
本公开实施例中,待分配设备可以通过向全网进行自申明的方式来实现本地MAC地址的获取,因此,注册消息可以向全网的所有设备节点发送,也可以通过单播的方式向数据库服务器发送。该数据库服务器保存有已分配的且正处于使用状态的MAC地址,并且该数据库服务器可以用于集中管理全网的MAC地址分配。该注册消息中可以包括:用于唯一标识该注册消息的消息标识以及需要进行注册的待分配MAC地址块。容易理解地,待分配的MAC地址块可以包含一个MAC地址也可以包含多个MAC地址。In the embodiment of the present disclosure, the device to be allocated may obtain the local MAC address by performing a self-declaration manner to the entire network. Therefore, the registration message may be sent to all device nodes of the entire network, or may be sent to the database through unicast. The server sends. The database server holds the MAC address that has been allocated and is in use, and the database server can be used to centrally manage the MAC address allocation of the entire network. The registration message may include: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated that needs to be registered. It is easy to understand that the MAC address block to be allocated may contain one MAC address or multiple MAC addresses.
可以理解地,注册消息中需要进行注册的待分配MAC地址块可以是待分配设备按照预设的选择策略进行选择后得到的。而预设的选择策略优选可以包括:待分配设备从全网数据传输的历史记录中获知还未被使用的MAC地址块。It can be understood that the MAC address block to be allocated that needs to be registered in the registration message may be obtained after the device to be allocated is selected according to a preset selection policy. Preferably, the preset selection policy may include: the device to be allocated learns the MAC address block that has not been used from the history record of the entire network data transmission.
S102:当待分配设备没有感知到任何冲突时,将所述待分配MAC地址块确定为所述待分配设备的MAC地址,并发送MAC地址的申明消息;S102: When the device to be allocated does not detect any conflict, determine the MAC address block to be allocated as the MAC address of the device to be allocated, and send a declaration message of the MAC address;
需要说明的是,所述待分配设备没有感知到任何冲突,在实现时,优选地可以包括:It should be noted that, the device to be allocated does not detect any conflicts, and when implemented, it may preferably include:
当所述待分配设备根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定所述待分配设备没有感知到有待申请的MAC地址冲突;Determining, after the device to be allocated sends the registration message according to a preset interval period according to a preset number of times, without receiving a conflict failure message for the registration message or a declaration message that is verified as an address conflict. The device to be allocated does not detect the MAC address conflict pending application;
其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;从而能够使得待分配设备再重新选择待分配MAC地址块时,避免冲突失败消息中所包括的出现冲突的MAC地址块,从而使得重新发送的注册消息有更大的概率避免收到冲突失败消息。另外,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系,从而能够获知所述冲突失败消息所针对的注册消息,本实施例中,上述对应关系优选为所述冲突失败消息中的消息标识与所述注册消息中的消息标识一致。The conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs; thereby enabling the device to be allocated to reselect the to-be-allocated MAC address block to avoid the conflict failure message. The conflicting MAC address block is included, so that the retransmitted registration message has a greater probability of avoiding receiving the collision failure message. In addition, the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message, so that the registration message for the conflict failure message can be obtained. In this embodiment, the corresponding relationship is preferably the The message identifier in the conflict failure message is consistent with the message identifier in the registration message.
该申明消息中包括用于唯一标识该申明消息的消息标识以及需要申明的MAC地址。 需要说明的是,当网络中的网络设备接收到申明消息后,可以建立并保留接收到该申明消息的接收端口与该申明消息中需要申明的MAC地址之间的转发映射关系,保留形式可以是根据建立的转发映射关系更新网络设备已有的转发表,从而使得后续网络设备需要转发消息至该需要申明的MAC地址时,通过查询转发表将需要转发的消息从接收端口进行转发,从而不用进行广播发送。The abbreviated message includes a message identifier for uniquely identifying the affirmative message and a MAC address to be declared. It should be noted that, after receiving the abbreviated message, the network device in the network may establish and maintain a forwarding mapping relationship between the receiving port that receives the adjacency message and the MAC address that needs to be stated in the adjacency message, and the reserved form may be Update the forwarding table of the network device according to the established forwarding mapping relationship, so that the subsequent network device needs to forward the message to the receiving port through the query forwarding table, so that the message needs to be forwarded from the receiving port. Broadcast transmission.
示例性地,当所述待分配设备感知到冲突时,上述方案还可以包括:Illustratively, when the device to be allocated senses a conflict, the foregoing solution may further include:
所述待分配设备重新选择待分配MAC地址块,并重新发送注册消息;The device to be allocated reselects a block of MAC addresses to be allocated, and resends the registration message;
需要说明的是,重新发送的注册消息看中可以包括用于唯一标识该注册消息的消息标识以及重新选择的待分配MAC地址块。It should be noted that the retransmitted registration message may include a message identifier for uniquely identifying the registration message and a reselected MAC address block to be allocated.
可以理解地,基于前述针对待分配设备没有感知到任何冲突的说明,可以得知:所述待分配设备收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息时,可以所述待分配设备可以确定感知到冲突;冲突失败消息中可以包括用于唯一标识该冲突失败消息的消息标识以及出现冲突的MAC地址块,It can be understood that, based on the foregoing description that the device to be allocated does not detect any conflict, it may be known that when the device to be allocated receives a conflict failure message for the registration message or a declaration message that is verified as an address conflict, The device to be allocated may determine that the conflict is perceived; the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs.
示例性地,当待分配设备发送注册消息时,那么本流程还可以包括:当待分配设备接收到其他设备发送的申明消息,将其他设备所发送的申明消息中的需要申明的MAC地址与注册消息中需要进行注册的待分配MAC地址块进行冲突检测,确定是否出现冲突:Illustratively, when the device to be allocated sends a registration message, the process may further include: when the device to be allocated receives the declaration message sent by the other device, and the MAC address and registration required to be declared in the declaration message sent by the other device The MAC address block to be allocated that needs to be registered in the message is used for collision detection to determine whether a conflict occurs:
如果出现冲突,则重新选择待分配MAC地址块,并将注册消息中原有的需要进行注册的待分配MAC地址块替换为重新选择的待分配Mac地址块;If a conflict occurs, re-select the MAC address block to be allocated, and replace the original MAC address block to be allocated in the registration message with the re-selected Mac address block to be allocated;
如果没有出现冲突,则对所述注册消息不作处理;优选地,还可以继续发送所述注册消息。If no conflict occurs, the registration message is not processed; preferably, the registration message can also continue to be sent.
可以理解地,冲突检测的方式可以是判定其他设备所发送的申明消息中的需要申明的MAC地址与注册消息中需要进行注册的待分配MAC地址块之间的交集是否为空,如果交集为空,则说明出现冲突;否则,说明没有冲突。It can be understood that the method of conflict detection may be to determine whether the intersection between the MAC address to be declared in the affirmative message sent by the other device and the MAC address block to be allocated in the registration message is empty, if the intersection is empty. , indicating a conflict; otherwise, there is no conflict.
本实施例提供了一种应用于待分配设备的本地MAC地址的分配方法,通过待分配设备向全网的网络设备发送待分配MAC地址块,并根据全网的其他网络设备针对待分配MAC地址块的反馈来申明自身使用的MAC地址,实现了本地MAC地址的注册以及本地MAC地址的冲突检测,不仅在多个网络设备中实现本地MAC地址的分配协议,还能够适应于不同的本地网络架构。The embodiment provides a method for allocating a local MAC address to a device to be allocated, and sends a MAC address block to be allocated to the network device of the entire network through the device to be allocated, and according to other network devices of the entire network, the MAC address to be allocated. The feedback of the block is used to declare the MAC address used by itself, realizing the registration of the local MAC address and the collision detection of the local MAC address, not only implementing the local MAC address allocation protocol in multiple network devices, but also adapting to different local network architectures. .
实施例二Embodiment 2
基于前述实施例相同的技术构思,参见图2,其示出了本公开实施例提供的一种本地MAC地址的分配方法流程,该方法可以适用于网络中已分配有本地MAC地址的已分配设备,该流程可以包括:Based on the same technical concept of the foregoing embodiment, referring to FIG. 2, a flow of a method for allocating a local MAC address provided by an embodiment of the present disclosure may be applied to an allocated device in a network that has been assigned a local MAC address. The process can include:
S201:已分配设备接收待分配设备发送的注册消息;S201: The allocated device receives a registration message sent by the device to be allocated.
该注册消息可以由网络中需要分配本地MAC地址的待分配设备向全网进行发送,该注册消息中可以包括:用于唯一标识该注册消息的消息标识以及待分配设备需要进行注册 的待分配MAC地址块。The registration message may be sent to the entire network by the device to be allocated that needs to be assigned a local MAC address in the network. The registration message may include: a message identifier for uniquely identifying the registration message, and a MAC to be allocated that needs to be registered by the device to be allocated. Address block.
S202:已分配设备将注册消息中的待分配MAC地址块与自身的本地MAC地址进行冲突检测;S202: The allocated device performs collision detection on the MAC address block to be allocated in the registration message and its local MAC address.
需要说明的是,由于本地MAC地址是整个网络中唯一的MAC地址,所以,网络中的设备在全网中仅有一个对应的本地MAC地址。当注册消息中的待分配MAC地址没有被网络中所有已分配设备使用时,则说明待分配设备是能够使用注册消息中的待分配MAC地址;当注册消息中的待分配MAC地址已经被网络中的已分配设备使用时,则说明注册消息中的待分配MAC地址与已经使用的MAC地址发生了冲突,所以待分配设备不能够使用注册消息中的待分配MAC地址,需要重新选择待分配MAC地址。因此,已分配设备进行冲突检测会出现以下两种结果:It should be noted that, since the local MAC address is the only MAC address in the entire network, the device in the network has only one corresponding local MAC address in the entire network. When the MAC address to be allocated in the registration message is not used by all the allocated devices in the network, it indicates that the device to be allocated is capable of using the MAC address to be allocated in the registration message; when the MAC address to be allocated in the registration message has been used in the network When the allocated device is used, it indicates that the MAC address to be allocated in the registration message conflicts with the used MAC address, so the device to be allocated cannot use the MAC address to be allocated in the registration message, and the MAC address to be allocated needs to be reselected. . Therefore, the assigned device has the following two results for collision detection:
S203:当出现冲突时,已分配设备将冲突失败消息发送至待分配设备;S203: When a conflict occurs, the allocated device sends a conflict failure message to the device to be allocated;
需要说明的是,冲突失败消息可以包括用于唯一标识该冲突失败消息的消息标识以及出现冲突的MAC地址块。It should be noted that the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs.
可以理解地,冲突失败消息中的消息标识可以与注册消息中的消息标识具有对应关系,从而能够获知所述冲突失败消息所针对的注册消息,本实施例中,上述对应关系优选为所述冲突失败消息中的消息标识与所述注册消息中的消息标识一致。It can be understood that the message identifier in the conflict failure message can have a corresponding relationship with the message identifier in the registration message, so that the registration message for the conflict failure message can be obtained. In this embodiment, the corresponding relationship is preferably the conflict. The message identifier in the failure message is consistent with the message identifier in the registration message.
示例性地,当没有出现冲突时,本流程的技术方案还可以包括:已分配设备终结注册消息。Exemplarily, when there is no conflict, the technical solution of the present process may further include: an allocated device termination registration message.
可以理解地,已分配设备终结注册消息后,待分配设备在没有收到针对注册消息的冲突失败消息的情况下,会继续发送申明消息,从而使得待分配设备将申明消息中的需要申明的MAC地址作为待分配设备自身的本地MAC地址。It can be understood that, after the device has been assigned the registration message, the device to be allocated will continue to send the declaration message without receiving the conflict failure message for the registration message, so that the device to be allocated will declare the MAC in the message to be declared. The address is the local MAC address of the device to be assigned itself.
本实施例提供了一种应用于已分配设备的本地MAC地址的分配方法,通过已分配设备接收待分配设备发送的待分配MAC地址块,并根据自身的MAC地址与待分配MAC地址块进行冲突检测,当发生冲突时向待分配设备反馈冲突失败消息,当没有发生冲突时终结待分配设备的注册,实现了本地MAC地址的注册以及本地MAC地址的冲突检测,不仅在多个网络设备中实现本地MAC地址的分配协议,还能够适应于不同的本地网络架构。The embodiment provides a method for allocating a local MAC address to an allocated device, and the allocated device receives the MAC address block to be allocated sent by the device to be allocated, and conflicts with the MAC address block to be allocated according to its own MAC address. Detecting, when a conflict occurs, feeding back a conflict failure message to the device to be allocated, and ending the registration of the device to be allocated when there is no conflict, realizing registration of the local MAC address and collision detection of the local MAC address, not only implemented in multiple network devices The local MAC address allocation protocol can also be adapted to different local network architectures.
实施例三Embodiment 3
基于前述实施例相同的技术构思,参见图3,其示出了本公开实施例提供的一种本地MAC地址的分配方法流程,该方法可以适用于网络中进行转发的网络设备,该流程可以包括:Based on the same technical concept of the foregoing embodiment, referring to FIG. 3, a flow of a method for allocating a local MAC address according to an embodiment of the present disclosure is provided. The method may be applicable to a network device that performs forwarding in a network, and the process may include :
S301:网络设备接收待分配设备发送的注册消息;S301: The network device receives a registration message sent by the device to be allocated.
需要说明的是,注册消息中可以包括:用于唯一标识该注册消息的消息标识以及需要进行注册的待分配MAC地址块。It should be noted that the registration message may include: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered.
S302:网络设备根据预设的转发策略决定是否将注册消息转发至网络中待分配设备以 外的其他网络设备;S302: The network device determines, according to the preset forwarding policy, whether to forward the registration message to other network devices in the network other than the device to be allocated.
S303:当网络设备接收到针对注册消息的冲突失败消息时,将冲突失败消息转发至待分配设备。S303: When the network device receives the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated.
需要说明的是,冲突失败消息中可以包括用于唯一标识该冲突失败消息的消息标识以及出现冲突的MAC地址块;通常可以将冲突失败消息的消息标识设置与注册消息中的消息标识一致。从而网络设备可以根据冲突失败消息中的消息标识查询步骤S301中建立的对应关系,从而转发消息能够从注册消息的接收端口将冲突失败消息发送至待分配设备。It should be noted that the conflict failure message may include a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs; generally, the message identifier setting of the conflict failure message may be consistent with the message identifier in the registration message. Therefore, the network device can query the correspondence established in step S301 according to the message identifier in the conflict failure message, so that the forwarding message can send the conflict failure message to the device to be allocated from the receiving port of the registration message.
S303:当网络设备接收到申明消息时,根据申明消息建立转发映射关系。S303: When the network device receives the declaration message, establish a forwarding mapping relationship according to the declaration message.
需要说明的是,申明消息中包括用于唯一标识该申明消息的消息标识以及需要申明的MAC地址。从而网络设备可以建立接收到该申明消息的接收端口与该申明消息中需要申明的MAC地址之间的转发映射关系,并且对该映射关系进行保存,保存形式可以为转发表项的形式。可以理解地,网络设备通常已建立有转发表,当新的转发表项建立之后,可以将新的转发表项更新已有的转发表,从而后续网络设备在接收到要发往需要申明的MAC地址的报文时,可以检索转发表来查询到相应的发送端口,从发送端口直接转发报文,减少了广播发送报文。It should be noted that the abbreviated message includes a message identifier for uniquely identifying the affirmative message and a MAC address to be declared. Therefore, the network device can establish a forwarding mapping relationship between the receiving port that receives the abbreviated message and the MAC address to be declared in the adjacency message, and save the mapping relationship in a form of a forwarding entry. It can be understood that the network device usually has a forwarding table. After the new forwarding entry is established, the new forwarding entry can be updated with the existing forwarding table, so that the subsequent network device receives the MAC to be sent to the required forwarding. When the address of the packet is received, the forwarding table can be retrieved to query the corresponding sending port, and the packet is directly forwarded from the sending port, which reduces the broadcast sending packet.
针对图3所示的技术方案,可选地,对于步骤S302所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,可以包括:For the technical solution shown in FIG. 3, optionally, the network device, according to the preset forwarding policy, determines whether to forward the registration message to other network devices other than the device to be allocated in the network, which may include :
当网络设备设置有已分配设备的代理时,网络设备将注册消息中的待分配MAC地址块与网络设备代理的已分配设备的本地MAC地址进行冲突检测;以及,When the network device is configured with the agent of the allocated device, the network device performs collision detection on the MAC address block to be allocated in the registration message and the local MAC address of the allocated device of the network device proxy;
当出现冲突时,网络设备发送对应的冲突失败消息;以及,When a conflict occurs, the network device sends a corresponding conflict failure message; and,
当没有出现冲突时,网络设备将注册消息转发至网络中待分配设备以外的其他网络设备。When there is no conflict, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
可以理解地,网络设备在发送对应的冲突失败消息后,该冲突失败消息最终会被待分配设备接收。It can be understood that after the network device sends the corresponding conflict failure message, the conflict failure message is finally received by the device to be allocated.
针对图3所示的技术方案,可选地,对于步骤S302所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,可以包括:For the technical solution shown in FIG. 3, optionally, the network device, according to the preset forwarding policy, determines whether to forward the registration message to other network devices other than the device to be allocated in the network, which may include :
当所述网络设备没有设置分配设备的代理时,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When the network device does not set a proxy for the device to be allocated, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
对于上述可选方案来说,网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,可以包括:For the above-mentioned alternative, the network device forwarding the registration message to other network devices other than the device to be allocated in the network may include:
网络设备获取用于接收注册消息的接收端口后,建立注册消息的消息标识与接收端口之间的对应关系;以及,After the network device obtains the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port;
将注册消息通过接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
可以理解地,当网络设备代理有其他已分配设备时,会首先执行已分配设备的行为,即针对注册消息中的待分配MAC地址块进行冲突检测,进行冲突检测的过程可以如实施例二中的步骤S202所述,本实施例对此不做赘述。而且,当网络设备将冲突失败消息发送至待分配设备之后,不再转发注册消息。而具有代理能力的网络设备在接收到申明消息之后,仍旧需要将根据申明消息建立转发映射关系,从而保留申明消息中需要申明的MAC地址。It can be understood that when the network device agent has other allocated devices, the behavior of the allocated device is first performed, that is, the collision detection is performed for the MAC address block to be allocated in the registration message, and the process of performing collision detection may be as in the second embodiment. The description of step S202 is not described in this embodiment. Moreover, after the network device sends a conflict failure message to the device to be allocated, the registration message is no longer forwarded. After receiving the abbreviated message, the network device with the proxy capability still needs to establish a forwarding mapping relationship according to the adjacency message, thereby retaining the MAC address that needs to be declared in the affirmative message.
实施例四Embodiment 4
在实现过程中,待分配设备发送的MAC地址注册消息可以不发送给网络中的已分配设备或者网络设备,当网络中设置有一个用于集中管理MAC地址分配的数据库服务器时,参见图4,一种本地媒体访问控制MAC地址的分配方法可以包括:During the implementation process, the MAC address registration message sent by the device to be allocated may not be sent to the allocated device or the network device in the network. When a database server for centrally managing MAC address allocation is set in the network, refer to FIG. A local media access control MAC address allocation method may include:
S401:数据库服务器接收待分配设备发送的注册消息;S401: The database server receives a registration message sent by the device to be allocated.
其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
对于步骤S401,待分配设备向数据库服务器发送注册消息时,可以采用单播发送的方式进行发送,以使得数据库服务器能够接收到注册消息。For the step S401, when the device to be allocated sends the registration message to the database server, the device may send the unicast transmission to enable the database server to receive the registration message.
S402:数据库服务器将所述待分配MAC地址与已保存的MAC地址进行冲突检测:S402: The database server performs collision detection on the to-be-assigned MAC address and the saved MAC address:
其中,所述已保存的MAC地址为全网中处于使用状态的MAC地址;The saved MAC address is a MAC address in a used state in the entire network;
S403:当出现冲突时,数据库服务器将冲突失败消息发送至所述待分配设备;S403: When a conflict occurs, the database server sends a conflict failure message to the to-be-distributed device;
其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。The conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
需要说明的是,当没有出现冲突时,数据库服务器对于注册消息不作回应,该注册消息在所述数据库服务器处已终结。It should be noted that when there is no conflict, the database server does not respond to the registration message, which is terminated at the database server.
示例性地,所述方法还包括:Illustratively, the method further includes:
当所述数据库服务器收到申明消息时,将所述申明消息中需要申明的MAC地址保存,并将所述需要申明的MAC地址的状态设置为使用状态;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And when the database server receives the affirmation message, save the MAC address that needs to be stated in the declaration message, and set the state of the MAC address that needs to be declared to the usage state; wherein the declaration message includes The message identifier identifying the affirmative message and the MAC address to be declared.
可以理解地,数据库服务器将申明消息中需要申明的MAC地址保存并设置为使用状态后,数据库服务器就对已保存的MAC地址进行了更新,从而后续可以通过更新后的已保存的MAC地址进行冲突检测。Understandably, after the database server saves and sets the MAC address to be declared in the declaration message to the usage state, the database server updates the saved MAC address, so that the subsequent saved MAC address can be used for conflict. Detection.
实施例五Embodiment 5
基于前述实施例相同的技术构思,本实施例通过一个具体示例对上述三个实施例的技术方案进行阐述。本实施例基于MRP(Multiple Registration Protocol,多注册协议)协议,通过对MSRP(Multiple Stream Registration Protocol,多流注册协议)协议进行扩展进行实现,可以称为多MAC分配协议(MMAP,Multiple MAC Assignment Protocol);在MMAP中可以包括有三类消息:MAC地址注册消息、MAC地址冲突消息和MAC地址申明消息。 另外,这三类消息可以通过MMAP数据单元(MMAPDU,MMAP Data Unit)进行承载,在MMAPDU中,AttributeType字段增加三个值对应这三种消息;AttributeList字段中的VectorAttribute字节可以定义为两种:消息标识messageID属性和MAC地址属性;其中,messageID属性包含有messageID,用于区分不同的消息message。本实施例中可以优选采用48位的MAC地址起始值加上16位的随机ID进行表示;而MAC地址属性,包含MAC地址起始值和MAC地址的数量。Based on the same technical concept of the foregoing embodiment, the present embodiment describes the technical solutions of the above three embodiments by a specific example. This embodiment is implemented by extending the MSRP (Multiple Stream Registration Protocol) protocol based on the MRP (Multiple Registration Protocol) protocol, and may be referred to as a Multi-MAC Assignment Protocol (MMAP). There are three types of messages that can be included in MMAP: MAC address registration message, MAC address conflict message, and MAC address declaration message. In addition, the three types of messages can be carried by MMAP data units (MMAPDUs, MMAP Data Units). In the MMAPDUs, the AttributeType field adds three values corresponding to the three types of messages; the VectorAttribute bytes in the AttributeList field can be defined as two types: The message identifies the messageID attribute and the MAC address attribute; wherein the messageID attribute contains a messageID for distinguishing different message messages. In this embodiment, a 48-bit MAC address start value plus a 16-bit random ID may be preferably used for representation; and a MAC address attribute includes a MAC address start value and a MAC address number.
基于图5所示的组网结构,对本实施例进行说明,在图5中,待分配设备为T;已分配设备为L;用于转发的网络设备为B;需要说明的是,当网络设备中设置有代理时,B可以充当T或者L的角色,各设备之间通过局域网(LAN,Local Area Network)连接,如图5中的圆圈所示。The present embodiment is described based on the networking structure shown in FIG. 5. In FIG. 5, the device to be allocated is T; the allocated device is L; and the network device used for forwarding is B; it should be noted that when the network device is When a proxy is set, B can function as a T or L, and each device is connected through a local area network (LAN), as shown by the circle in FIG.
当T需要申请一部分MAC地址时,会发送MAC地址注册消息;注册消息中所携带的AttributeList如图6所示,包括messageID属性和MAC地址属性;其中,MAC地址属性包括需要进行注册的待分配MAC地址空间;When the T needs to apply for a part of the MAC address, the MAC address registration message is sent; the AttributeList carried in the registration message is as shown in FIG. 6, including the messageID attribute and the MAC address attribute; wherein the MAC address attribute includes the MAC to be allocated that needs to be registered. Address space
B接收到MAC地址注册消息后,会保存MAC地址注册消息中的messageID以及接收MAC地址注册消息的接收端口之间的对应关系,并向其他端口转发MAC地址注册消息,通过B的转发,其他L都将接收到T发送的MAC地址注册消息。After receiving the MAC address registration message, B saves the correspondence between the message ID in the MAC address registration message and the receiving port that receives the MAC address registration message, and forwards the MAC address registration message to other ports, and forwards it through B. Both will receive the MAC address registration message sent by T.
可以理解地,上述针对MAC地址注册消息的发送过程如图7所示,图7中,箭头方向为MAC地址注册消息的传递方向,箭头边的R表示MAC地址注册消息,B的方框中的S表示B将MAC地址注册消息中的messageID以及接收MAC地址注册消息的接收端口之间的对应关系进行保存。It can be understood that the foregoing sending process for the MAC address registration message is as shown in FIG. 7. In FIG. 7, the direction of the arrow is the direction of transmission of the MAC address registration message, and the edge of the arrow indicates the MAC address registration message, in the box of B. S indicates that B stores the correspondence between the messageID in the MAC address registration message and the receiving port that receives the MAC address registration message.
L在接收到MAC地址注册消息后,可以检查需要进行注册的待分配的MAC地址是否和本设备的MAC地址冲突:如果不冲突,则终结该MAC地址注册消息;如果冲突,则发送MAC地址冲突消息;MAC地址冲突消息中携带的AttributeList如图8所示,也携带messageID属性和MAC地址属性,但此时的MAC地址属性表示的是有冲突的MAC地址空间。通常来说,MAC地址冲突消息中的messageID属性值与MAC地址注册消息中的messageID属性值相同,从而能够表征冲突失败消息所针对的注册消息。After receiving the MAC address registration message, L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the device: if there is no conflict, the MAC address registration message is terminated; if the conflict occurs, the MAC address conflict is sent. The AttributeList carried in the MAC address conflict message, as shown in Figure 8, also carries the messageID attribute and the MAC address attribute, but the MAC address attribute at this time represents the conflicting MAC address space. Generally, the value of the messageID attribute in the MAC address conflict message is the same as the value of the messageID attribute in the MAC address registration message, so that the registration message for the conflict failure message can be characterized.
B收到MAC地址冲突消息后,根据MAC地址冲突消息中的messageID和图7所示的B保存对应关系将该MAC地址冲突消息转发到T。After receiving the MAC address conflict message, the B forwards the MAC address conflict message to T according to the message ID in the MAC address conflict message and the B save correspondence shown in FIG. 7.
可以理解地,上述针对MAC地址冲突消息的传递过程如图9所示,在图9中,箭头方向为MAC地址冲突消息的传递方向,箭头边的C表示MAC地址冲突消息,B的方框中的P表示B所保存的对应关系进行保存。It can be understood that the above-mentioned delivery process for the MAC address conflict message is as shown in FIG. 9. In FIG. 9, the arrow direction is the transmission direction of the MAC address conflict message, and the arrow C indicates the MAC address conflict message, in the box of B. The P indicates that the correspondence saved by B is saved.
T可以等待预设的间隔周期进行一次MAC地址注册消息的发送,当连续发送若干次MAC地址注册消息后,如果没有收到任何MAC地址冲突消息,则发送MAC地址申明消息到全网;如果在这段时间内收到了MAC地址冲突消息,则需要重新选择新的待分配MAC地址并重新发送MAC地址注册消息,此时message ID也跟随重新选择的MAC地 址发生了变化。The device can wait for the preset interval period to perform the sending of the MAC address registration message. After continuously sending the MAC address registration message several times, if no MAC address conflict message is received, the MAC address declaration message is sent to the entire network; After receiving the MAC address conflict message in this period, the new MAC address to be assigned needs to be re-selected and the MAC address registration message is resent. At this time, the message ID also changes with the reselected MAC address.
网络设备B可以在收到MAC地址申明消息后,根据MAC地址申明消息中申明的MAC地址和接收到该申明消息的接收端口,建立申明的MAC地址和接收端口之间的转发映射关系,并将该转发映射关系更新到B自身的转发表。保存形式可以为:将申明的MAC地址保存到目的地址,并将接收端口保存到输出端口。从而在后续接收到要发往申明的MAC地址的报文后,可以检索该转发表查到输出端口,直接转发报文至T,减少了通过广播方式发送报文。After receiving the MAC address declaration message, the network device B may establish a forwarding mapping relationship between the abbreviated MAC address and the receiving port according to the MAC address declared in the MAC address declaration message and the receiving port receiving the declaration message, and The forwarding mapping relationship is updated to B's own forwarding table. The save form can be: save the declared MAC address to the destination address, and save the receive port to the output port. Therefore, after receiving the packet to be sent to the abbreviated MAC address, the forwarding table can be searched to find the output port, and the packet is directly forwarded to the T, thereby reducing the sending of the packet by broadcast.
可以理解地,上述针对MAC地址申明消息的传递过程如图10所示,在图10中,箭头方向为MAC地址申明消息的传递方向,箭头边的A表示MAC地址申明消息。It can be understood that the above-mentioned delivery process for the MAC address declaration message is as shown in FIG. 10. In FIG. 10, the direction of the arrow is the transmission direction of the MAC address declaration message, and the A of the arrow indicates the MAC address declaration message.
实施例六Embodiment 6
在实施例五的基础上,在本实施例中,以B中设置有L的代理进行实现过程的说明,在B设置有L的代理的情况下,由于B中保存有被代理的L的MAC地址,因此,可以代替被代理的L进行MAC地址冲突消息的答复。本实施例的实现过程如下:On the basis of the fifth embodiment, in the present embodiment, the implementation process is performed by the agent with L set in B. In the case where the agent with L is set in B, the MAC of the proxy L is stored in B. The address, therefore, can be replied to the MAC address conflict message instead of the L being proxied. The implementation process of this embodiment is as follows:
当T需要申请一部分MAC地址时,会发送MAC地址注册消息;注册消息中所携带的AttributeList如图6所示,包括messageID属性和MAC地址属性;其中,MAC地址属性包括需要进行注册的待分配MAC地址空间;When the T needs to apply for a part of the MAC address, the MAC address registration message is sent; the AttributeList carried in the registration message is as shown in FIG. 6, including the messageID attribute and the MAC address attribute; wherein the MAC address attribute includes the MAC to be allocated that needs to be registered. Address space
B接收到MAC地址注册消息后,会保存MAC地址注册消息中的messageID以及接收MAC地址注册消息的接收端口之间的对应关系,对于没有设置代理的B,会按照图7所示的过程对MAC地址注册消息进行传递,本实施例不做赘述。After receiving the MAC address registration message, B stores the correspondence between the messageID in the MAC address registration message and the receiving port that receives the MAC address registration message. For B without the proxy, the MAC is processed according to the procedure shown in Figure 7. The address registration message is delivered, which is not described in this embodiment.
对于设置有代理的B,首先会执行L的行为,即:For B with proxy set, the behavior of L is executed first, namely:
设置有代理的B检测自身保存的MAC地址与需要进行注册的待分配的MAC地址是否冲突:如果有冲突,则B会代理L发送MAC冲突消息。否则,终结该MAC地址注册消息,不做转发。The B set with the proxy detects whether the MAC address saved by itself is in conflict with the MAC address to be allocated that needs to be registered: if there is a conflict, B will send a MAC conflict message to the proxy L. Otherwise, the MAC address registration message is terminated and no forwarding is performed.
可以理解地,设置有代理的B发送MAC地址冲突消息的示意图如图11所示,在图11中,设置有代理的B如斜线阴影方框所示,箭头方向为设置有代理的B所发送的MAC地址冲突消息的传递方向。It can be understood that the schematic diagram of the B-sending MAC address conflict message set by the proxy is as shown in FIG. 11. In FIG. 11, the B provided with the proxy is shown by the shaded box, and the direction of the arrow is the B set with the proxy. The direction in which the sent MAC address conflict message is sent.
对于接收到MAC地址注册消息的L以及没有设置有代理的B来说,本实施例的实现过程与实施例四类似,即:For the L that receives the MAC address registration message and the B that is not provided with the proxy, the implementation process of this embodiment is similar to that of the fourth embodiment, namely:
L在接收到MAC地址注册消息后,可以检查需要进行注册的待分配的MAC地址是否和本设备的MAC地址冲突:如果不冲突,则终结该MAC地址注册消息;如果冲突,则发送MAC地址冲突消息;MAC地址冲突消息中携带的AttributeList如图8所示,也携带messageID属性和MAC地址属性,但此时的MAC地址属性表示的是有冲突的MAC地址空间。通常来说,MAC地址冲突消息中的messageID属性值与MAC地址注册消息中的messageID属性值相同,从而能够表征冲突失败消息所针对的注册消息。After receiving the MAC address registration message, L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the device: if there is no conflict, the MAC address registration message is terminated; if the conflict occurs, the MAC address conflict is sent. The AttributeList carried in the MAC address conflict message, as shown in Figure 8, also carries the messageID attribute and the MAC address attribute, but the MAC address attribute at this time represents the conflicting MAC address space. Generally, the value of the messageID attribute in the MAC address conflict message is the same as the value of the messageID attribute in the MAC address registration message, so that the registration message for the conflict failure message can be characterized.
B收到MAC地址冲突消息后,根据MAC地址冲突消息中的messageID和图7所示 的B保存对应关系将该MAC地址冲突消息转发到T。After receiving the MAC address conflict message, B forwards the MAC address conflict message to T according to the messageID in the MAC address conflict message and the B save correspondence shown in FIG. 7.
T可以等待预设的间隔周期进行一次MAC地址注册消息的发送,当连续发送若干次MAC地址注册消息后,如果没有收到任何MAC地址冲突消息,则发送MAC地址申明消息到全网;如果在这段时间内收到了MAC地址冲突消息,则需要重新选择新的待分配MAC地址并重新发送MAC地址注册消息,此时message ID也跟随重新选择的MAC地址发生了变化。The device can wait for the preset interval period to perform the sending of the MAC address registration message. After continuously sending the MAC address registration message several times, if no MAC address conflict message is received, the MAC address declaration message is sent to the entire network; After receiving the MAC address conflict message in this period, the new MAC address to be assigned needs to be re-selected and the MAC address registration message is resent. At this time, the message ID also changes with the reselected MAC address.
对于没有设置代理的B可以在收到MAC地址申明消息后,根据MAC地址申明消息中申明的MAC地址和接收到该申明消息的接收端口,建立申明的MAC地址和接收端口之间的转发映射关系,并将该转发映射关系更新到B自身的转发表。保存形式可以为:将申明的MAC地址保存到目的地址,并将接收端口保存到输出端口。从而在后续接收到要发往申明的MAC地址的报文后,可以检索该转发表查到输出端口,直接转发报文至T,减少了通过广播方式发送报文。For a B that does not have a proxy, after receiving the MAC address declaration message, it can establish a forwarding mapping relationship between the declared MAC address and the receiving port according to the MAC address declared in the MAC address declaration message and the receiving port receiving the declaration message. And update the forwarding mapping relationship to B's own forwarding table. The save form can be: save the declared MAC address to the destination address, and save the receive port to the output port. Therefore, after receiving the packet to be sent to the abbreviated MAC address, the forwarding table can be searched to find the output port, and the packet is directly forwarded to the T, thereby reducing the sending of the packet by broadcast.
对于设置有代理L应用的B设备,如果收到MAC地址申明消息,则会将MAC地址申明消息中申明的MAC地址保存下来。For a B device configured with a proxy L application, if a MAC address declaration message is received, the MAC address declared in the MAC address declaration message is saved.
对于L设备来说,如果还没有申明到自己的MAC地址,则在接收到其他T的MAC地址申明消息时,也会将该MAC地址申明消息中申明MAC地址保存下来,作为自身选择需要注册的待分配MAC地址的依据,避免冲突重复。For the L device, if it has not yet declared its own MAC address, when it receives the MAC address declaration message of other T, it also saves the MAC address in the MAC address declaration message, and needs to register as its own choice. The basis of the MAC address to be assigned to avoid conflicts.
而对于其他的T来说,当选择好了本设备需要注册的待分配MAC地址后,在发送MAC地址注册消息时,如果收到其他T发来的MAC地址申明消息,则需要将其他T发送的MAC地址申明消息中生命的MAC地址与进行自身所选择的需要注册的待分配MAC地址进行冲突性检测;如果有冲突,则需要重新选择需要注册的待分配MAC地址,并重新开始发送MAC地址注册消息的过程。For other Ts, when the MAC address to be assigned that the device needs to be registered is selected, when the MAC address registration message is sent, if other MAC address declaration messages sent by the T are received, other Ts need to be sent. The MAC address of the life in the MAC address declaration message is compared with the MAC address to be allocated that needs to be registered, and if there is a conflict, the MAC address to be allocated that needs to be registered needs to be re-selected, and the MAC address is restarted. The process of registering a message.
实施例七Example 7
对于某些轻量级的设备而言,可能会不支持MRP协议,本实施例以基于链路层发现协议(LLDP,Link Layer Discovery Protocol)的边缘控制协议(ECP,Edge Control Protocol)协议的方式来实现,实现过程与实施例四和实施例五相同,区别于实施例五和实施例六的内容是:不同消息中的消息内容是以类型-长度-值(TLV,Type-Length-Value)的形式在LLDP数据单元(LLDPDU,LLDP Data Unit)进行承载,如图12所示,字段TLV type表示TLV的类型,针对实施例,定义了三种TLV类型,即TLV type=Register,表示是用于MAC地址注册消息;TLV type=Conflict,表示是MAC地址冲突消息;TLV type=Announce,表示是MAC地址申明消息。字段TLV Length是表示这个TLV的长度。字段TLV Value主要包括了两种信息:Message ID以及MAC起始地址;对于Message ID来说,表示该消息的唯一标识,对于MAC起始地址来说,表示MAC地址块的起始值,在不同的消息类型中具有不同的含义。如果是在注册消息,则表示需要注册的MAC地址块;如果是在冲突消息,则表示该MAC地址块已经被其他设备使用了,存在冲突,需要 重新选择新MAC地址块;如果是在申明消息,则表示该MAC地址块正式被设备使用,其他设备不能使用。字段数量表示地址块的地址数量。For some lightweight devices, the MRP protocol may not be supported. In this embodiment, an Edge Control Protocol (ECP) protocol based on the Link Layer Discovery Protocol (LLDP) is used. The implementation process is the same as that in the fourth embodiment and the fifth embodiment. The content difference between the fifth embodiment and the sixth embodiment is that the message content in different messages is a type-length-value (TLV, Type-Length-Value). The form is carried in an LLDP data unit (LLDPDU, LLDP Data Unit). As shown in FIG. 12, the field TLV type indicates the type of the TLV. For the embodiment, three types of TLVs are defined, that is, TLV type=Register, indicating that it is used. The MAC address registration message; TLV type=Conflict, indicating that it is a MAC address conflict message; TLV type=Announce, indicating that it is a MAC address declaration message. The field TLV Length is the length of this TLV. The field TLV Value mainly includes two kinds of information: Message ID and MAC start address; for Message ID, it indicates the unique identifier of the message, and for the MAC start address, it indicates the start value of the MAC address block, which is different. The message type has a different meaning. If it is a registration message, it indicates a MAC address block that needs to be registered; if it is a conflict message, it indicates that the MAC address block has been used by other devices, there is a conflict, and a new MAC address block needs to be reselected; if it is a declaration message , indicating that the MAC address block is officially used by the device, and other devices cannot be used. The number of fields indicates the number of addresses in the address block.
实施例八Example eight
实施例五与实施例六的技术方案还可以基于免费地址解析协议(Gratuitous ARP,Gratuitous Address Resolution Protocol)进行实现,实现过程与实施例四和实施例五相同,区别在于需要针对现有的免费ARP报文进行扩展。从而能够通过扩展后的免费ARP报文来承载不同消息中的消息内容。本实施例提供一个优选的扩展方案,对免费ARP报文进行扩展,但并非是针对扩展方案的限定。在优选的扩展方案中,对于MAC地址注册消息,将免费ARP报文中的以下属性值进行设置,设置为:The technical solutions of the fifth embodiment and the sixth embodiment can also be implemented based on the Gratuitous ARP (Gratuitous Address Resolution Protocol). The implementation process is the same as that of the fourth embodiment and the fifth embodiment. The difference lies in the need for the existing free ARP. The message is extended. Therefore, the extended free ARP packet can be used to carry the message content in different messages. This embodiment provides a preferred extension to extend the gratuitous ARP packet, but is not limited to the extension. In a preferred extension, for the MAC address registration message, the following attribute values in the gratuitous ARP packet are set, and are set as:
Opcode=10,表示类型为MAC地址注册消息;Opcode=10, indicating that the type is a MAC address registration message;
Sender MAC:填写MAC地址块的起始地址;Sender MAC: fill in the starting address of the MAC address block;
Sender IP:如果有则填,没有则为0;Sender IP: if there is one, if not, it is 0;
Destination MAC:填写MAC地址块的最后地址;Destination MAC: fill in the last address of the MAC address block;
Destination IP:填和Sender IP一样的地址。Destination IP: Fill in the same address as the Sender IP.
在优选的扩展方案中,对于MAC地址冲突消息,将免费ARP报文中的以下属性值进行设置,设置为:In a preferred extension, for the MAC address conflict message, the following attribute values in the gratuitous ARP packet are set and set to:
Opcode=11,表示类型为MAC地址冲突消息;Opcode=11, indicating that the type is a MAC address conflict message;
Sender MAC:填写有冲突MAC地址块的起始地址;Sender MAC: fill in the starting address of the conflicting MAC address block;
Sender IP:如果有则填,没有则为0;Sender IP: if there is one, if not, it is 0;
Destination MAC:填写冲突MAC地址块的最后地址;Destination MAC: fill in the last address of the conflicting MAC address block;
Destination IP:填和Sender IP一样的地址。Destination IP: Fill in the same address as the Sender IP.
在优选的扩展方案中,对于MAC地址申明消息,将免费ARP报文中的以下属性值进行设置,设置为:In a preferred extension, for the MAC address declaration message, the following attribute values in the gratuitous ARP packet are set, and are set as:
Opcode=12,表示类型为MAC地址申明消息;Opcode=12, indicating that the type is a MAC address declaration message;
Sender MAC:填写申明的MAC地址块的起始地址;Sender MAC: fill in the starting address of the declared MAC address block;
Sender IP:如果有则填,没有则为0;Sender IP: if there is one, if not, it is 0;
Destination MAC:填写申明的MAC地址块的最后地址;Destination MAC: fill in the last address of the declared MAC address block;
Destination IP:填和Sender IP一样的地址。Destination IP: Fill in the same address as the Sender IP.
通过基于免费ARP实现上述技术方案的优势在于能够和IP地址结合,对于待分配设备T已经有IP地址的情况,可以在申明消息后直接建立MAC地址和IP地址的对应关系。The advantage of implementing the above technical solution based on the free ARP is that it can be combined with the IP address. For the case where the device T to be allocated already has an IP address, the correspondence between the MAC address and the IP address can be directly established after the affirmation message.
可以理解地,实施例五至实施例八仅公开了实施例一至实施例三的技术方案在不同协议下的实现过程,并非针对本公开实施例的具体限定。It is to be understood that the implementations of the technical solutions of the first embodiment to the third embodiment are not limited to the specific embodiments of the disclosure.
实施例九Example nine
基于前述实施例相同的技术构思,参见图13,其示出了本公开实施例提供的一种待分配设备130,所述待分配设备130包括:第一发送模块1301、感知模块1302和确定模 块1303;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 13, a device to be allocated 130 is provided, which includes: a first sending module 1301, a sensing module 1302, and a determining module. 1303; among them,
所述第一发送模块1301,用于发送本地媒体访问控制MAC地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The first sending module 1301 is configured to send a registration message of a local media access control MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message, and a MAC address block to be allocated that needs to be registered. ;
所述感知模块1302,用于是否感知到任何冲突;并当没有感知到任何冲突时,触发所述确定模块1303和第一发送模块1301;The sensing module 1302 is configured to detect any conflicts; and when no conflict is perceived, the determining module 1303 and the first sending module 1301 are triggered;
所述确定模块1303,用于将所述待分配MAC地址块确定为所述待分配设备的MAC地址;The determining module 1303 is configured to determine the MAC address block to be allocated as the MAC address of the device to be allocated;
所述第一发送模块1301,还用于发送MAC地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配MAC地址块。The first sending module 1301 is further configured to send a declaration message of the MAC address, where the adjacency message includes: a message identifier for uniquely identifying the adjacency message and a to-be-allocated MAC address block that needs to be declared.
示例性地,所述感知模块1302,用于当所述第一发送模块1301根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定没有感知到待分配MAC地址冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Illustratively, the sensing module 1302 is configured to: when the first sending module 1301 sends the registration message according to a preset interval, according to a preset interval, does not receive a conflict for the registration message. The message or the affirmation message of the address conflict is determined, and the MAC address conflict is not detected; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs; The message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
示例性地,参见图14,所述待分配设备130还包括选择模块1304;Illustratively, referring to FIG. 14, the to-be-distributed device 130 further includes a selection module 1304;
所述感知模块1302,还用于当感知到冲突时,触发所述选择模块和所述第一发送模块1301;The sensing module 1302 is further configured to: when the conflict is perceived, trigger the selection module and the first sending module 1301;
所述选择模块1304,用于重新选择待分配MAC地址块;The selecting module 1304 is configured to reselect a MAC address block to be allocated;
所述第一发送模块1301,还用于重新发送所述注册消息。The first sending module 1301 is further configured to resend the registration message.
参见图14,所述待分配设备130还包括第一接收模块1305和第一检测模块1306;Referring to Figure 14, the to-be-distributed device 130 further includes a first receiving module 1305 and a first detecting module 1306;
所述第一接收模块1305,用于接收其他设备发送的申明消息;The first receiving module 1305 is configured to receive a declaration message sent by another device;
第一检测模块1306,用于将其他设备所发送的申明消息中的需要申明的MAC地址与所述注册消息中需要进行注册的待分配MAC地址块进行冲突检测,确定是否出现冲突:如果出现冲突,触发所述选择模块;如果没有出现冲突,则对所述注册消息不作处理;The first detecting module 1306 is configured to detect, by using a MAC address that needs to be clarified in the affirmative message sent by the other device, with a MAC address block to be allocated that needs to be registered in the registration message, to determine whether a conflict occurs: if a conflict occurs. Activating the selection module; if no conflict occurs, the registration message is not processed;
所述选择模块1304,还用于重新选择待分配MAC地址块,并将所述注册消息中原有的需要进行注册的待分配MAC地址块替换为重新选择的待分配Mac地址块。The selecting module 1304 is further configured to reselect the MAC address block to be allocated, and replace the original MAC address block to be allocated in the registration message with the re-selected Mac address block to be allocated.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行 本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
本实施例中的一种本地MAC地址的分配方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种本地MAC地址的分配方法对应的计算机程序指令被一电子设备读取或被执行时,包括如下步骤:The computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium. When the program instructions are read or executed by an electronic device, the following steps are included:
发送本地MAC地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;And sending a registration message of the local MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
当没有感知到任何冲突时,将所述待分配MAC地址块确定为所述待分配设备的MAC地址,并发送MAC地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配MAC地址块。Determining the MAC address block to be allocated as the MAC address of the device to be allocated, and sending a declaration message of the MAC address, wherein the abbreviated message includes: for uniquely identifying the affirmation The message identifier of the message and the block of MAC addresses to be allocated that need to be declared.
可选的,存储介质中存储的与步骤:没有感知到任何冲突,包括:Optionally, the steps stored in the storage medium are: no conflicts are perceived, including:
当根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定没有感知到有待分配MAC地址冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。After the registration message is sent according to the preset interval period according to the preset number of times, if the conflict failure message for the registration message or the declaration message that is verified as the address conflict is not received, it is determined that the MAC address to be allocated is not perceived. a conflicting message, where the conflicting failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs; the message identifier in the conflict failure message and the message identifier in the registration message have Correspondence relationship.
可选的,存储介质中存储的与步骤:所述方法还包括:当感知到冲突时,重新选择待分配MAC地址块,并重新发送所述注册消息。Optionally, the step of storing in the storage medium: the method further comprises: when the conflict is perceived, reselecting the block of the MAC address to be allocated, and resending the registration message.
可选的,存储介质中存储的与步骤:所述方法还包括:Optionally, the step of storing in the storage medium: the method further includes:
当接收到其他设备发送的申明消息,将其他设备所发送的申明消息中的需要申明的MAC地址与所述注册消息中需要进行注册的待分配MAC地址块进行冲突检测,确定是否出现冲突:When receiving the affirmation message sent by the other device, the MAC address to be declared in the affirmation message sent by the other device is collided with the to-be-allocated MAC address block to be registered in the registration message to determine whether a conflict occurs:
如果出现冲突,则重新选择待分配MAC地址块,并将所述注册消息中原有的需要进行注册的待分配MAC地址块替换为重新选择的待分配Mac地址块;If a conflict occurs, re-select the MAC address block to be allocated, and replace the original MAC address block to be allocated in the registration message with the re-selected Mac address block to be allocated;
如果没有出现冲突,则对所述注册消息不作处理。If no conflict occurs, the registration message is not processed.
可选的,存储介质中存储的与步骤:所述注册消息中需要进行注册的待分配MAC地址块由所述待分配设备按照预设的选择策略进行选择后得到。Optionally, the step of storing the MAC address to be allocated in the registration message is obtained by the device to be allocated according to a preset selection policy.
实施例十Example ten
基于前述实施例相同的技术构思,参见图15,其示出了本公开实施例提供的一种待分配设备130的硬件结构,可以包括:第一通信接口1501、第一存储器1502、第一处理器1503和第一总线1504;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 15, a hardware structure of a device to be allocated 130 according to an embodiment of the present disclosure may be included, which may include: a first communication interface 1501, a first memory 1502, and a first process. And a first bus 1504; wherein
所述第一总线1504用于连接所述第一通信接口1501、所述第一处理器1503和所述第一存储器1502以及这些器件之间的相互通信;The first bus 1504 is configured to connect the first communication interface 1501, the first processor 1503, and the first memory 1502, and mutual communication between the devices;
所述第一通信接口1501,用于与外部网元进行数据传输;The first communication interface 1501 is configured to perform data transmission with an external network element;
所述第一存储器1502,用于存储指令和数据;The first memory 1502 is configured to store instructions and data;
所述第一处理器1503执行所述指令用于:发送本地MAC地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The first processor 1503 executes the instruction for: sending a registration message of a local MAC address; wherein the registration message includes: a message identifier for uniquely identifying the registration message and a MAC address to be allocated that needs to be registered Piece;
当没有感知到任何冲突时,将所述待分配MAC地址块确定为所述待分配设备的MAC地址,并发送MAC地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配MAC地址块。Determining the MAC address block to be allocated as the MAC address of the device to be allocated, and sending a declaration message of the MAC address, wherein the abbreviated message includes: for uniquely identifying the affirmation The message identifier of the message and the block of MAC addresses to be allocated that need to be declared.
在实际应用中,上述第一存储器1502可以是易失性存储器(volatile memory),例如随机存取存储器(RAM,Random-Access Memory);或者非易失性存储器(non-volatile memory),例如只读存储器(ROM,Read-Only Memory),快闪存储器(flash memory),硬盘(HDD,Hard Disk Drive)或固态硬盘(SSD,Solid-State Drive);或者上述种类的存储器的组合,并向第一处理器1503提供指令和数据。In a practical application, the first memory 1502 may be a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory, and A processor 1503 provides instructions and data.
上述第一处理器1503可以为特定用途集成电路(ASIC,Application Specific Integrated Circuit)、数字信号处理器(DSP,Digital Signal Processor)、数字信号处理装置(DSPD,Digital Signal Processing Device)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(FPGA,Field Programmable Gate Array)、中央处理器(CPU,Central Processing Unit)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述第一处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。The first processor 1503 may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), or a programmable logic device. At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is to be understood that, for different devices, the electronic device for implementing the functions of the first processor described above may also be other, and the embodiment of the present disclosure is not specifically limited.
示例性地,所述第一处理器1503,可以用于:当根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定没有感知到有待分配MAC地址冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Illustratively, the first processor 1503 may be configured to: when the registration message is sent according to a preset interval, according to a preset interval, does not receive a conflict failure message or verification for the registration message. Determining, by the adjacency message of the address conflict, that the MAC address conflict is not to be allocated; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs; the conflict The message identifier in the failure message has a correspondence with the message identifier in the registration message.
示例性地,所述第一处理器1503,还可以用于:当感知到冲突时,重新选择待分配MAC地址块,并重新发送所述注册消息。Exemplarily, the first processor 1503 may be further configured to: when the conflict is perceived, reselect the block of the MAC address to be allocated, and resend the registration message.
示例性地,所述第一处理器1503,还可以用于:当接收到其他设备发送的申明消息,将其他设备所发送的申明消息中的需要申明的MAC地址与所述注册消息中需要进行注册的待分配MAC地址块进行冲突检测,确定是否出现冲突:Illustratively, the first processor 1503 may be further configured to: when receiving a declaration message sent by another device, request a MAC address that needs to be declared in the declaration message sent by the other device, and the registration message needs to be performed. Registered MAC address blocks to be allocated for collision detection to determine if a conflict occurs:
如果出现冲突,则重新选择待分配MAC地址块,并将所述注册消息中原有的需要进行注册的待分配MAC地址块替换为重新选择的待分配Mac地址块;If a conflict occurs, re-select the MAC address block to be allocated, and replace the original MAC address block to be allocated in the registration message with the re-selected Mac address block to be allocated;
如果没有出现冲突,则对所述注册消息不作处理。If no conflict occurs, the registration message is not processed.
示例性地,所述注册消息中需要进行注册的待分配MAC地址块由所述待分配设备按照预设的选择策略进行选择后得到。For example, the to-be-allocated MAC address block that needs to be registered in the registration message is obtained by the device to be allocated according to a preset selection policy.
实施例十一Embodiment 11
基于前述实施例相同的技术构思,参见图16,其示出了本公开实施例提供的一种已分配设备160,所述已分配设备160包括:第二接收模块1601、第二检测模块1602和第二发送模块1603;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 16 , an allocated device 160 according to an embodiment of the present disclosure is provided. The allocated device 160 includes: a second receiving module 1601, a second detecting module 1602, and a second sending module 1603; wherein
所述第二接收模块1601,用于接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配媒体访问控制MAC地址块;The second receiving module 1601 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated. Media access control MAC address block;
所述第二检测模块1602,用于将所述注册消息中的待分配MAC地址块与自身的本地MAC地址进行冲突检测;当出现冲突时,触发所述第二发送模块1603;The second detecting module 1602 is configured to perform collision detection between the MAC address block to be allocated in the registration message and the local MAC address of the registration message; when the conflict occurs, the second sending module 1603 is triggered;
所述第二发送模块1603,用于将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。The second sending module 1603 is configured to send a conflict failure message to the to-be-assigned device, where the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
示例性地,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Exemplarily, the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
本实施例中的一种本地MAC地址的分配方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种本地MAC地址的分配方法对应的计算机程序指令被一电子设备读取或被执行时,包括如下步骤:The computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium. When the program instructions are read or executed by an electronic device, the following steps are included:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配MAC地址块;And receiving, by the device to be allocated, a registration message, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
将所述注册消息中的待分配MAC地址块与自身的本地MAC地址进行冲突检测;Performing collision detection on the MAC address block to be allocated in the registration message and its local MAC address;
当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。When a conflict occurs, a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
可选的,存储介质中存储的与步骤:所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Optionally, the step of storing in the storage medium is: the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
实施例十二Example twelve
基于前述实施例相同的技术构思,参见图17,其示出了本公开实施例提供的一种已分配设备160的硬件结构,可以包括:第二通信接口1701、第二存储器1702、第二处理器1703和第二总线1704;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 17, a hardware structure of a distributed device 160 according to an embodiment of the present disclosure may be included, which may include: a second communication interface 1701, a second memory 1702, and a second process. 1703 and a second bus 1704; wherein
所述第二总线1704用于连接所述第二通信接口1701、所述第二处理器1703和所述第二存储器1702以及这些器件之间的相互通信;The second bus 1704 is configured to connect the second communication interface 1701, the second processor 1703, and the second memory 1702 and mutual communication between the devices;
所述第二通信接口1701,用于与外部网元进行数据传输;The second communication interface 1701 is configured to perform data transmission with an external network element.
所述第二存储器1702,用于存储指令和数据;The second memory 1702 is configured to store instructions and data;
所述第二处理器1703执行所述指令用于:The second processor 1703 executes the instructions for:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配MAC地址块;And receiving, by the device to be allocated, a registration message, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
将所述注册消息中的待分配MAC地址块与自身的本地MAC地址进行冲突检测;Performing collision detection on the MAC address block to be allocated in the registration message and its local MAC address;
当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。When a conflict occurs, a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
示例性地,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Exemplarily, the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
实施例十三Example thirteen
基于前述实施例相同的技术构思,参见图18,其示出了本公开实施例提供的一种网络设备180,所述网络设备180包括:第三接收模块1801、转发模块1802和建立模块1803;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 18, a network device 180 according to an embodiment of the present disclosure is provided. The network device 180 includes: a third receiving module 1801, a forwarding module 1802, and an establishing module 1803. among them,
所述第三接收模块1801,用于接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配媒体访问控制MAC地址块;The third receiving module 1801 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated. Media access control MAC address block;
所述转发模块1802,用于根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;The forwarding module 1802 is configured to determine, according to a preset forwarding policy, whether to forward the registration message to another network device other than the device to be allocated in the network;
所述第三接收模块1801,用于当接收到针对所述注册消息的冲突失败消息时,触发所述转发模块1802;当接收到申明消息时,触发所述建立模块1803;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;The third receiving module 1801 is configured to trigger the forwarding module 1802 when receiving a conflict failure message for the registration message, and trigger the establishing module 1803 when receiving the declaration message; wherein the conflict The failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which the conflict occurs;
所述转发模块1802,还用于将所述冲突失败消息转发至所述待分配设备;The forwarding module 1802 is further configured to forward the conflict failure message to the to-be-distributed device;
所述建立模块1803,用于根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。The establishing module 1803 is configured to establish a forwarding mapping relationship according to the adjacency message, where the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
示例性地,所述转发模块1802,用于:Illustratively, the forwarding module 1802 is configured to:
当所述网络设备180设置有已分配设备的代理时,将所述注册消息中的待分配MAC地址块与所述网络设备180代理的已分配设备的MAC地址进行冲突检测:When the network device 180 is provided with a proxy of the allocated device, the MAC address block to be allocated in the registration message is collided with the MAC address of the allocated device proxyed by the network device 180:
以及,当出现冲突时,发送对应的冲突失败消息,And, when a conflict occurs, sending a corresponding conflict failure message,
以及,当没有出现冲突时,将所述注册消息转发至网络中所述待分配设备以外的其他 网络设备。And, when there is no conflict, the registration message is forwarded to other network devices other than the device to be allocated in the network.
示例性地,所述转发模块1802,用于:Illustratively, the forwarding module 1802 is configured to:
当所述网络设备180没有设置分配设备的代理时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When the network device 180 does not set a proxy for the device to be allocated, the registration message is forwarded to other network devices other than the device to be allocated in the network.
所述转发装置180,用于获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;以及,The forwarding device 180 is configured to acquire a correspondence between a message identifier of the registration message and the receiving port, after acquiring a receiving port for receiving a registration message;
将所述注册消息通过所述接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
示例性地,所述建立模块1803,用于建立接收到所述申明消息的接收端口与所述申明消息中需要申明的MAC地址之间的转发映射关系。For example, the establishing module 1803 is configured to establish a forwarding mapping relationship between a receiving port that receives the aforesaid message and a MAC address that needs to be stated in the adjacency message.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
本实施例中的一种本地MAC地址的分配方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种本地MAC地址的分配方法对应的计算机程序指令被一电子设备读取或被执行时,包括如下步骤:The computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium. When the program instructions are read or executed by an electronic device, the following steps are included:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配MAC地址块;And receiving, by the device to be allocated, a registration message, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;Determining whether to forward the registration message to other network devices other than the device to be allocated in the network according to a preset forwarding policy;
当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;Forwarding the conflict failure message to the device to be allocated when receiving a conflict failure message for the registration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and appearing Conflicting MAC address block;
当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And when the affirmative message is received, the forwarding mapping relationship is established according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
可选的,存储介质中存储的与步骤:根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:Optionally, the step of storing in the storage medium is: determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including:
当所述网络设备设置有已分配设备的代理时,将所述注册消息中的待分配MAC地址 块与所述网络设备代理的已分配设备的MAC地址进行冲突检测:When the network device is provided with a proxy of the allocated device, the MAC address block to be allocated in the registration message is collided with the MAC address of the allocated device of the network device proxy:
当出现冲突时,发送对应的冲突失败消息,When a conflict occurs, a corresponding conflict failure message is sent,
当没有出现冲突时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When no conflict occurs, the registration message is forwarded to other network devices other than the device to be allocated in the network.
可选的,存储介质中存储的与步骤:根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:Optionally, the step of storing in the storage medium is: determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network, including:
当所述网络设备没有设置分配设备的代理时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When the network device does not set a proxy for the device to be allocated, the registration message is forwarded to other network devices other than the device to be allocated in the network.
可选的,存储介质中存储的与步骤:将所述注册消息转发至网络中待分配设备以外的其他网络设备,包括:Optionally, the storing step in the storage medium: forwarding the registration message to other network devices other than the device to be allocated in the network, including:
获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;After obtaining the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port;
将所述注册消息通过所述接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
可选的,存储介质中存储的与步骤:所述根据申明消息建立转发映射关系,包括:Optionally, the step of storing the forwarding in the storage medium: the establishing a forwarding mapping relationship according to the adjacency message, including:
建立接收到所述申明消息的接收端口与所述申明消息中所申明的MAC地址之间的转发映射关系。And establishing a forwarding mapping relationship between the receiving port that receives the claim message and the MAC address declared in the declaration message.
实施例十四Embodiment 14
基于前述实施例相同的技术构思,参见图19,其示出了本公开实施例提供的一种网络设备180的硬件结构,可以包括:第三通信接口1901、第三存储器1902、第三处理器1903和第三总线1904;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 19, which shows a hardware structure of a network device 180 according to an embodiment of the present disclosure, which may include: a third communication interface 1901, a third memory 1902, and a third processor. 1903 and a third bus 1904; wherein
所述第三总线1904用于连接所述第三通信接口1901、所述第三处理器1903和所述第三存储器1902以及这些器件之间的相互通信;The third bus 1904 is configured to connect the third communication interface 1901, the third processor 1903, and the third memory 1902 and mutual communication between the devices;
所述第三通信接口1901,用于与外部网元进行数据传输;The third communication interface 1901 is configured to perform data transmission with an external network element.
所述第三存储器1902,用于存储指令和数据;The third memory 1902 is configured to store instructions and data;
所述第三处理器1903执行所述指令用于:The third processor 1903 executes the instructions for:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配MAC地址块;以及,And receiving, by the device to be allocated, a registration message, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated MAC address block to be registered by the device to be allocated;
根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;以及,Determining whether to forward the registration message to other network devices other than the device to be allocated in the network according to a preset forwarding policy;
当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;以及,Forwarding the conflict failure message to the device to be allocated when receiving a conflict failure message for the registration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and appearing Conflicting MAC address block; and,
当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And when the affirmative message is received, the forwarding mapping relationship is established according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
示例性地,所述第三处理器1903,用于:当所述网络设备设置有已分配设备的代理 时,将所述注册消息中的待分配MAC地址块与所述网络设备代理的已分配设备的MAC地址进行冲突检测:Illustratively, the third processor 1903 is configured to: when the network device is configured with a proxy of the allocated device, allocate the to-be-assigned MAC address block in the registration message to the network device proxy. The device's MAC address is used for collision detection:
当出现冲突时,发送对应的冲突失败消息,When a conflict occurs, a corresponding conflict failure message is sent,
当没有出现冲突时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When no conflict occurs, the registration message is forwarded to other network devices other than the device to be allocated in the network.
示例性地,所述第三处理器1903,用于:当所述网络设备没有设置分配设备的代理时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。Illustratively, the third processor 1903 is configured to: when the network device does not set an agent of the distribution device, forward the registration message to other network devices other than the device to be allocated in the network.
所述第三处理器1903,用于:The third processor 1903 is configured to:
获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;After obtaining the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port;
将所述注册消息通过所述接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
示例性地,所述第三处理器1903,用于:Illustratively, the third processor 1903 is configured to:
建立接收到所述申明消息的接收端口与所述申明消息中需要申明的MAC地址之间的转发映射关系。And establishing a forwarding mapping relationship between the receiving port that receives the aforesaid message and the MAC address that needs to be stated in the adjacency message.
实施例十五Example fifteen
基于前述实施例相同的技术构思,参见图20,其示出了本公开实施例提供的一种数据库服务器200的结构,所述数据库服务器200包括:第四接收模块2001、第三检测模块2002和第三发送模块2003,其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 20, a structure of a database server 200 according to an embodiment of the present disclosure is provided. The database server 200 includes: a fourth receiving module 2001, a third detecting module 2002, and a third sending module 2003, wherein
所述第四接收模块2001,用于接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The fourth receiving module 2001 is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
所述第三检测模块2002,用于将所述待分配MAC地址与已保存的MAC地址进行冲突检测:其中,所述以保存的MAC地址为全网中处于使用状态的MAC地址;The third detecting module 2002 is configured to perform collision detection on the to-be-assigned MAC address and the saved MAC address, where the saved MAC address is a MAC address in a used state in the entire network;
以及,当出现冲突时,触发所述第三发送模块2003;And, when a conflict occurs, triggering the third sending module 2003;
所述第三发送模块2003,用于将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。The third sending module 2003 is configured to send a conflict failure message to the to-be-distributed device, where the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs.
示例性地,参见图21,所述数据库服务器200还包括:保存模块2004,用于当所述第四接收模块2001收到申明消息时,将所述申明消息中需要申明的MAC地址保存,并将所述需要申明的MAC地址的状态设置为使用状态;其中,所述申明消息包括包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。Illustratively, referring to FIG. 21, the database server 200 further includes: a saving module 2004, configured to save, when the fourth receiving module 2001 receives the affirmation message, a MAC address that needs to be stated in the declaration message, and Setting the status of the MAC address to be declared to a usage status; wherein the declaration message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案 本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit may be stored in a computer readable storage medium if it is implemented in the form of a software function module and is not sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiment is essentially Said that the part contributing to the prior art or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium, comprising a plurality of instructions for making a computer device (may It is a personal computer, a server, or a network device, etc. or a processor that performs all or part of the steps of the method described in this embodiment. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes.
本实施例中的一种本地MAC地址的分配方法对应的计算机程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种本地MAC地址的分配方法对应的计算机程序指令被一电子设备读取或被执行时,包括如下步骤:The computer program instructions corresponding to the local MAC address allocation method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a USB disk, or the like, and a computer corresponding to a local MAC address allocation method in the storage medium. When the program instructions are read or executed by an electronic device, the following steps are included:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;Receiving a registration message sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
将所述待分配MAC地址与已保存的MAC地址进行冲突检测:其中,所述已保存的MAC地址为全网中处于使用状态的MAC地址;Performing collision detection on the to-be-assigned MAC address and the saved MAC address: wherein the saved MAC address is a MAC address in a used state in the entire network;
当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。When a conflict occurs, a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
可选的,存储介质中存储的与步骤:所述方法还包括:Optionally, the step of storing in the storage medium: the method further includes:
当所述数据库服务器收到申明消息时,将所述申明消息中需要申明的MAC地址保存,并将所述需要申明的MAC地址的状态设置为使用状态;其中,所述申明消息包括包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And when the database server receives the affirmation message, save the MAC address that needs to be stated in the declaration message, and set the state of the MAC address that needs to be declared to the usage state; wherein the declaration message includes A message identifier that uniquely identifies the affirmative message and a MAC address that needs to be declared.
实施例十六Example sixteen
基于前述实施例相同的技术构思,参见图22,其示出了本公开实施例提供的一种数据库服务器200的硬件结构,可以包括:第四通信接口2201、第四存储器2202、第四处理器2203和第四总线2204;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 22, the hardware structure of the database server 200 provided by the embodiment of the present disclosure may include: a fourth communication interface 2201, a fourth memory 2202, and a fourth processor. 2203 and a fourth bus 2204; wherein
所述第四总线2204用于连接所述第四通信接口2201、所述第四处理器2203和所述第四存储器2202以及这些器件之间的相互通信;The fourth bus 2204 is configured to connect the fourth communication interface 2201, the fourth processor 2203, and the fourth memory 2202 and mutual communication between the devices;
所述第四通信接口2201,用于与外部网元进行数据传输;The fourth communication interface 2201 is configured to perform data transmission with an external network element;
所述第四存储器2202,用于存储指令和数据;The fourth memory 2202 is configured to store instructions and data;
所述第四处理器2203执行所述指令用于:The fourth processor 2203 executes the instructions for:
接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;Receiving a registration message sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
将所述待分配MAC地址与已保存的MAC地址进行冲突检测:其中,所述已保存的MAC地址为全网中处于使用状态的MAC地址;Performing collision detection on the to-be-assigned MAC address and the saved MAC address: wherein the saved MAC address is a MAC address in a used state in the entire network;
当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块。When a conflict occurs, a conflict failure message is sent to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a collision occurs.
在实际应用中,上述第四存储器2202可以是易失性存储器(volatile memory),例如 随机存取存储器(RAM,Random-Access Memory);或者非易失性存储器(non-volatile memory),例如只读存储器(ROM,Read-Only Memory),快闪存储器(flash memory),硬盘(HDD,Hard Disk Drive)或固态硬盘(SSD,Solid-State Drive);或者上述种类的存储器的组合,并向第四处理器2203提供指令和数据。In a practical application, the fourth memory 2202 may be a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as only Read memory (ROM, Read-Only Memory), flash memory, hard disk (HDD, Hard Disk Drive) or solid state drive (SSD, Solid-State Drive); or a combination of the above types of memory, and The four processor 2203 provides instructions and data.
上述第四处理器2203可以为特定用途集成电路(ASIC,Application Specific Integrated Circuit)、数字信号处理器(DSP,Digital Signal Processor)、数字信号处理装置(DSPD,Digital Signal Processing Device)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(FPGA,Field Programmable Gate Array)、中央处理器(CPU,Central Processing Unit)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述第四处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。The fourth processor 2203 may be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), or a programmable logic device. At least one of (PLD, Programmable Logic Device), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor. It is to be understood that the electronic device for implementing the fourth processor function described above may be other for different devices, and is not specifically limited in the embodiment of the present disclosure.
示例性地,所述第四处理器2203,还用于:Illustratively, the fourth processor 2203 is further configured to:
当收到申明消息时,将所述申明消息中需要申明的MAC地址保存,并将所述需要申明的MAC地址的状态设置为使用状态;其中,所述申明消息包括包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And when the affirmative message is received, save the MAC address that needs to be stated in the affirmative message, and set the state of the MAC address that needs to be declared to the use state; wherein the abbreviated message includes the identifier for The message identifier of the affirmation message and the MAC address that needs to be declared.
实施例十七Example seventeen
基于前述实施例相同的技术构思,参见图23,其示出了本公开实施例提供的一种本地MAC地址的分配系统230,所述系统230包括至少一个待分配设备130、至少一个已分配设备160和至少一个网络设备180;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 23, a distribution system 230 for a local MAC address provided by an embodiment of the present disclosure is provided. The system 230 includes at least one device to be allocated 130 and at least one allocated device. 160 and at least one network device 180; wherein
所述待分配设备130,用于发送本地MAC地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The device to be allocated 130 is configured to send a registration message of a local MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
以及,当所述待分配设备130没有感知到任何冲突时,将所述待分配MAC地址块确定为所述待分配设备130的MAC地址,并发送MAC地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配MAC地址块;And determining, when the device to be allocated 130 does not detect any conflict, determining the MAC address block to be allocated as the MAC address of the device to be allocated 130, and sending a declaration message of the MAC address; wherein the abbreviated message The method includes: a message identifier for uniquely identifying the abbreviated message; and a MAC address block to be allocated that needs to be declared;
所述已分配设备180,用于接收所述待分配设备130发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备130需要进行注册的待分配MAC地址块;The allocated device 180 is configured to receive the registration message sent by the to-be-distributed device 130. The registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered. The block of MAC addresses to be allocated;
以及,将所述注册消息中的待分配MAC地址块与自身的本地MAC地址进行冲突检测;And performing collision detection on the MAC address block to be allocated in the registration message and its local MAC address;
以及,当出现冲突时,将冲突失败消息发送至所述待分配设备130;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;And, when a conflict occurs, sending a conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs;
所述网络设备180,用于接收所述待分配设备130发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备130需要进行注册的待分配MAC地址块;The network device 180 is configured to receive a registration message sent by the to-be-distributed device 130, where the registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered. The MAC address block to be allocated;
以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备130以外的其他网络设备;And determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated 130 in the network;
以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备130;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message Identification and a block of MAC addresses that have conflicts;
以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And, when the affirmative message is received, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
实施例十八Example 18
基于前述实施例相同的技术构思,参见图24,其示出了本公开实施例提供的一种本地MAC地址的分配系统240,所述系统240包括:至少一个待分配设备130、至少一个数据库服务器200和至少一个网络设备180;其中,Based on the same technical concept of the foregoing embodiment, referring to FIG. 24, a local MAC address allocation system 240 according to an embodiment of the present disclosure is provided. The system 240 includes: at least one to-be-distributed device 130, at least one database server. 200 and at least one network device 180; wherein
所述待分配设备130,用于发送本地MAC地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The device to be allocated 130 is configured to send a registration message of a local MAC address, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
以及,当所述待分配设备130没有感知到任何冲突时,将所述待分配MAC地址块确定为所述待分配设备130的MAC地址,并发送MAC地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配MAC地址块;And determining, when the device to be allocated 130 does not detect any conflict, determining the MAC address block to be allocated as the MAC address of the device to be allocated 130, and sending a declaration message of the MAC address; wherein the abbreviated message The method includes: a message identifier for uniquely identifying the abbreviated message; and a MAC address block to be allocated that needs to be declared;
所述数据库服务器200,用于接收待分配设备130发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配MAC地址块;The database server 200 is configured to receive a registration message sent by the device to be allocated 130, where the registration message includes: a message identifier for uniquely identifying the registration message and a to-be-allocated MAC address block that needs to be registered;
以及,将所述待分配MAC地址与已保存的MAC地址进行冲突检测:其中,所述已保存的MAC地址为全网中处于使用状态的MAC地址;And detecting, by the MAC address to be allocated, a saved MAC address, where the saved MAC address is a MAC address in a used state in the entire network;
以及,当出现冲突时,将冲突失败消息发送至所述待分配设备130;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;And, when a conflict occurs, sending a conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and a MAC address block in which a conflict occurs;
所述网络设备180,用于接收所述待分配设备130发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备130需要进行注册的待分配MAC地址块;The network device 180 is configured to receive a registration message sent by the to-be-distributed device 130, where the registration message includes: a message identifier for uniquely identifying the registration message, and the device to be allocated 130 needs to be registered. The MAC address block to be allocated;
以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备130以外的其他网络设备180;And determining, according to a preset forwarding policy, whether to forward the registration message to other network devices 180 other than the device to be allocated 130 in the network;
以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备130;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的MAC地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the to-be-allocated device 130; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message Identification and a block of MAC addresses that have conflicts;
以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的MAC地址。And, when the affirmative message is received, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and a MAC address that needs to be declared.
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产 品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present disclosure can be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
以上所述,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。The above description is only for the preferred embodiments of the present disclosure, and is not intended to limit the scope of the disclosure.
工业实用性Industrial applicability
本公开的本地媒体访问控制地址的分配方法、设备和系统通过待分配设备向全网的网络设备发送待分配地址块,并根据全网的其他网络设备针对待分配地址块的反馈来申明自身使用的地址,实现了本地地址的注册以及本地地址的冲突检测,不仅在多个网络设备中实现本地地址的分配协议,还能够适应于不同的本地网络架构。The method, device, and system for allocating the local media access control address of the present disclosure send the to-be-allocated address block to the network device of the entire network through the device to be allocated, and declare the self-use according to the feedback of the other network device of the entire network for the address block to be allocated. The address realizes the registration of the local address and the collision detection of the local address, not only realizing the local address allocation protocol in multiple network devices, but also adapting to different local network architectures.

Claims (29)

  1. 一种本地媒体访问控制地址的分配方法,所述方法包括:A method for allocating a local media access control address, the method comprising:
    待分配设备发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The registration message of the local address is sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块。And determining, by the device to be allocated, the address to be allocated as the address of the device to be allocated, and sending a declaration message of the address; wherein the declaration message includes: The message identifier of the abbreviated message and the block of the address to be allocated that need to be declared.
  2. 根据权利要求1所述的方法,其中,所述待分配设备没有感知到任何冲突,包括:The method of claim 1, wherein the device to be distributed does not perceive any conflicts, including:
    当所述待分配设备根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定所述待分配设备没有感知到有待分配地址块冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。Determining, after the device to be allocated sends the registration message according to a preset interval period according to a preset number of times, without receiving a conflict failure message for the registration message or a declaration message that is verified as an address conflict. The device to be allocated does not perceive an address block conflict to be allocated; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs; and a message identifier in the conflict failure message The message identifier in the registration message has a corresponding relationship.
  3. 根据权利要求1所述的方法,其中,所述方法还包括:当所述待分配设备感知到冲突时,所述待分配设备重新选择待分配地址块,并重新发送所述注册消息。The method of claim 1, wherein the method further comprises: when the device to be allocated senses a conflict, the device to be allocated reselects an address block to be allocated and resends the registration message.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    当所述待分配设备接收到其他设备发送的申明消息,将其他设备所发送的申明消息中的需要进行申明的地址块与所述注册消息中需要进行注册的待分配地址块进行冲突检测,确定是否出现冲突:When the device to be allocated receives the declaration message sent by the other device, the address block that needs to be declared in the declaration message sent by the other device is collided with the to-be-allocated address block that needs to be registered in the registration message, and is determined. Whether there is a conflict:
    如果出现冲突,则重新选择待分配地址块,并将所述注册消息中原有的需要进行注册的待分配地址块替换为重新选择的待分配地址块;If a conflict occurs, the address block to be allocated is re-selected, and the original address block to be allocated that needs to be registered in the registration message is replaced with the re-selected address block to be allocated;
    如果没有出现冲突,则不作处理。If there is no conflict, it will not be processed.
  5. 根据权利要求1所述的方法,其中,所述注册消息中需要进行注册的待分配地址块由所述待分配设备按照预设的选择策略进行选择后得到。The method according to claim 1, wherein the to-be-allocated address block that needs to be registered in the registration message is obtained by the device to be allocated according to a preset selection policy.
  6. 一种本地媒体访问控制地址的分配方法,所述方法包括:A method for allocating a local media access control address, the method comprising:
    已分配设备接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The allocated device receives the registration message sent by the device to be allocated; wherein the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
    所述已分配设备将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;The allocated device performs collision detection on the to-be-allocated address block in the registration message and its own local address;
    当出现冲突时,所述已分配设备将冲突失败消息发送至所述待分配设备;其中,所述 冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。When a conflict occurs, the allocated device sends a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  7. 根据权利要求6所述的方法,其中,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。The method of claim 6, wherein the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  8. 一种本地媒体访问控制地址的分配方法,所述方法包括:A method for allocating a local media access control address, the method comprising:
    网络设备接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that the device to be allocated needs to register;
    所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;Determining, by the network device, whether the registration message is forwarded to other network devices other than the device to be allocated in the network according to a preset forwarding policy;
    当所述网络设备接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And when the network device receives the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message for uniquely identifying the conflict failure message. The message identifier and the address block where the conflict occurred;
    当所述网络设备接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And when the network device receives the adjacency message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
  9. 根据权利要求8所述的方法,其中,所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:The method of claim 8, wherein the network device determines whether to forward the registration message to other network devices other than the device to be allocated in the network according to a preset forwarding policy, including:
    当所述网络设备设置有已分配设备的代理时,所述网络设备将所述注册消息中的待分配地址块与所述网络设备代理的已分配设备的地址进行冲突检测:When the network device is provided with an agent of the allocated device, the network device performs collision detection on the address block to be allocated in the registration message and the address of the allocated device of the network device proxy:
    当出现冲突时,所述网络设备发送对应的冲突失败消息;When a conflict occurs, the network device sends a corresponding conflict failure message;
    当没有出现冲突时,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When no conflict occurs, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  10. 根据权利要求8所述的方法,其中,所述网络设备根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:The method of claim 8, wherein the network device determines whether to forward the registration message to other network devices other than the device to be allocated in the network according to a preset forwarding policy, including:
    当所述网络设备没有设置已分配设备的代理时,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。When the network device does not set an agent of the allocated device, the network device forwards the registration message to other network devices other than the device to be allocated in the network.
  11. 根据权利要求9或10所述的方法,其中,所述网络设备将所述注册消息转发至网络中所述待分配设备以外的其他网络设备,包括:The method according to claim 9 or 10, wherein the network device forwards the registration message to other network devices other than the device to be allocated in the network, including:
    所述网络设备获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;After the network device acquires the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port;
    将所述注册消息通过所述接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
  12. 根据权利要求8所述的方法,其中,所述根据申明消息建立转发映射关系,包括:The method of claim 8, wherein the establishing a forwarding mapping relationship according to the adjacency message comprises:
    所述网络设备建立接收到所述申明消息的接收端口与所述申明消息中所申明的地址之间的转发映射关系。The network device establishes a forwarding mapping relationship between a receiving port that receives the aforesaid message and an address declared in the affirmative message.
  13. 一种本地媒体访问控制地址的分配方法,所述方法包括:A method for allocating a local media access control address, the method comprising:
    数据库服务器接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The database server receives the registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    所述数据库服务器将所述待分配地址块与已保存的地址进行冲突检测:其中,所述已保存的地址为全网中处于使用状态的地址;The database server performs collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a usage state in the entire network;
    当出现冲突时,所述数据库服务器将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。When a conflict occurs, the database server sends a conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  14. 根据权利要求12所述的方法,其中,所述方法还包括:The method of claim 12, wherein the method further comprises:
    当所述数据库服务器收到申明消息时,将所述申明消息中需要申明的地址保存,并将所述需要申明的地址的状态设置为使用状态;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And when the database server receives the affirmation message, save the address that needs to be stated in the declaration message, and set the state of the address to be stated to the usage state; wherein the declaration message includes a unique identifier The message identifier of the affirmative message and the address to be declared.
  15. 一种待分配设备,所述待分配设备包括:第一发送模块、感知模块和确定模块;其中,A device to be allocated, the device to be allocated includes: a first sending module, a sensing module, and a determining module; wherein
    所述第一发送模块,设置为发送本地媒体访问控制地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The first sending module is configured to send a registration message of the local media access control address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    所述感知模块,设置为感知冲突;并当没有感知到任何冲突时,触发所述确定模块和第一发送模块;The sensing module is configured to detect a conflict; and when no conflict is perceived, the determining module and the first sending module are triggered;
    所述确定模块,设置为将所述待分配地址块确定为所述待分配设备的地址;The determining module is configured to determine the address block to be allocated as an address of the device to be allocated;
    所述第一发送模块,还设置为发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块。The first sending module is further configured to send a declaration message of the address, where the adjacency message includes: a message identifier for uniquely identifying the adjacency message and an address block to be allocated that needs to be declared.
  16. 根据权利要求15所述的待分配设备,其中,所述感知模块,设置为当所述第一发送模块根据预设的间隔周期将所述注册消息按照预设次数进行发送后,没有收到针对所述注册消息的冲突失败消息或验证为地址冲突的申明消息,则确定没有感知到待分配地址块冲突;其中,所述冲突失败消息包括:用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。The device to be allocated according to claim 15, wherein the sensing module is configured to: after the first sending module sends the registration message according to a preset interval, according to a preset number of times, Determining, by the conflicting failure message of the registration message or the affirmation message of the address conflict, determining that the address block conflict to be allocated is not detected; wherein the conflict failure message includes: a message identifier for uniquely identifying the conflict failure message and A conflicting address block occurs; the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  17. 根据权利要求15所述的待分配设备,其中,所述待分配设备还包括选择模块;The device to be dispensed according to claim 15, wherein the device to be distributed further comprises a selection module;
    所述感知模块,还设置为当感知到冲突时,触发所述选择模块和所述第一发送模块;The sensing module is further configured to trigger the selection module and the first sending module when a conflict is perceived;
    所述选择模块,设置为重新选择待分配地址块;The selection module is configured to reselect an address block to be allocated;
    所述第一发送模块,还设置为重新发送所述注册消息。The first sending module is further configured to resend the registration message.
  18. 根据权利要求17所述的待分配设备,其中,所述待分配设备还包括第一接收模块和第一检测模块;The device to be distributed according to claim 17, wherein the device to be distributed further comprises a first receiving module and a first detecting module;
    所述第一接收模块,设置为接收其他设备发送的申明消息;The first receiving module is configured to receive a declaration message sent by another device;
    第一检测模块,设置为将其他设备所发送的申明消息中的需要进行申明的地址块与所述注册消息中需要进行注册的待分配地址块进行冲突检测,确定是否出现冲突:如果出现冲突,触发所述选择模块;如果没有出现冲突,则不作处理;The first detecting module is configured to detect, in the declaration message sent by the other device, the address block that needs to be declared, and the to-be-allocated address block that needs to be registered in the registration message, to determine whether a conflict occurs: if a conflict occurs, Triggering the selection module; if no conflict occurs, no processing is performed;
    所述选择模块,还设置为重新选择待分配地址块,并将所述注册消息中原有的需要进行注册的待分配地址块替换为重新选择的待分配地址块。The selecting module is further configured to reselect the to-be-allocated address block, and replace the original to-be-allocated address block that needs to be registered in the registration message with the re-selected address block to be allocated.
  19. 一种已分配设备,所述已分配设备包括:第二接收模块、第二检测模块和第二发送模块;其中,An allocated device, the allocated device includes: a second receiving module, a second detecting module, and a second sending module; wherein
    所述第二接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The second receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
    所述第二检测模块,设置为将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;当出现冲突时,触发所述第二发送模块;The second detecting module is configured to detect a conflict between the to-be-assigned address block and the local address of the registration message, and trigger the second sending module when a conflict occurs;
    所述第二发送模块,设置为将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。The second sending module is configured to send a conflict failure message to the to-be-distributed device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  20. 根据权利要求19所述的已分配设备,其中,所述冲突失败消息中的消息标识与所述注册消息中的消息标识具有对应关系。The allocated device according to claim 19, wherein the message identifier in the conflict failure message has a corresponding relationship with the message identifier in the registration message.
  21. 一种网络设备,其中,所述网络设备包括:第三接收模块、转发模块和建立模块;其中,A network device, where the network device includes: a third receiving module, a forwarding module, and an establishing module;
    所述第三接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The third receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
    所述转发模块,设置为根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;The forwarding module is configured to: determine, according to a preset forwarding policy, whether to forward the registration message to another network device other than the device to be allocated in the network;
    所述第三接收模块,设置为当接收到针对所述注册消息的冲突失败消息时,触发所述转发模块;当接收到申明消息时,触发所述建立模块;其中,所述冲突失败消息包括用于 唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;The third receiving module is configured to trigger the forwarding module when receiving a conflict failure message for the registration message, and trigger the establishing module when receiving the declaration message; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
    所述转发模块,还设置为将所述冲突失败消息转发至所述待分配设备;The forwarding module is further configured to forward the conflict failure message to the to-be-distributed device;
    所述建立模块,设置为根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。The establishing module is configured to establish a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the adjacency message and an address to be declared.
  22. 根据权利要求21所述的网络设备,其中,所述转发模块,设置为:The network device according to claim 21, wherein the forwarding module is configured to:
    当所述网络设备设置有已分配设备的代理时,将所述注册消息中的待分配地址块与所述网络设备代理的已分配设备的地址进行冲突检测:When the network device is provided with a proxy of the allocated device, the address block to be allocated in the registration message is detected by conflict with the address of the allocated device of the network device proxy:
    以及,当出现冲突时,发送对应的冲突失败消息,And, when a conflict occurs, sending a corresponding conflict failure message,
    以及,当没有出现冲突时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。And, when there is no conflict, the registration message is forwarded to other network devices other than the device to be allocated in the network.
  23. 根据权利要求21所述的网络设备,其中,所述转发模块,设置为:当所述网络设备没有设置已分配设备的代理时,将所述注册消息转发至网络中所述待分配设备以外的其他网络设备。The network device according to claim 21, wherein the forwarding module is configured to: when the network device does not set an agent of the allocated device, forward the registration message to the network other than the device to be allocated Other network devices.
  24. 根据权利要求22或23所述的网络设备,其中,所述转发模块,设置为:The network device according to claim 22 or 23, wherein the forwarding module is configured to:
    获取用于接收注册消息的接收端口后,建立所述注册消息的消息标识与所述接收端口之间的对应关系;以及,After obtaining the receiving port for receiving the registration message, establishing a correspondence between the message identifier of the registration message and the receiving port; and
    将所述注册消息通过所述接收端口之外的其他端口进行发送。The registration message is sent through a port other than the receiving port.
  25. 根据权利要求21所述的网络设备,其中,所述建立模块,设置为建立接收到所述申明消息的接收端口与所述申明消息中需要申明的地址之间的转发映射关系。The network device according to claim 21, wherein the establishing module is configured to establish a forwarding mapping relationship between a receiving port that receives the affirmative message and an address that needs to be stated in the affirmative message.
  26. 一种数据库服务器,所述数据库服务器包括:第四接收模块、第三检测模块和第三发送模块,其中,A database server, the database server includes: a fourth receiving module, a third detecting module, and a third sending module, where
    所述第四接收模块,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The fourth receiving module is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    所述第三检测模块,设置为将所述待分配地址块与已保存的地址进行冲突检测:其中,所述以保存的地址为全网中处于使用状态的地址;The third detecting module is configured to perform collision detection on the to-be-allocated address block and the saved address: wherein the saved address is an address in a used state in the entire network;
    以及,当出现冲突时,触发所述第三发送模块;And, when a conflict occurs, triggering the third sending module;
    所述第三发送模块,设置为将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块。The third sending module is configured to send a conflict failure message to the to-be-allocated device; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs.
  27. 根据权利要求26所述的数据库服务器,其中,所述数据库服务器还包括:保存模块,设置为当所述第四接收模块收到申明消息时,将所述申明消息中需要申明的地址保 存,并将所述需要申明的地址的状态设置为使用状态;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。The database server according to claim 26, wherein the database server further comprises: a saving module, configured to save an address to be declared in the declaration message when the fourth receiving module receives the declaration message, and Setting a status of the address to be declared to a usage status; wherein the affirmation message includes a message identifier for uniquely identifying the affirmative message and an address to be declared.
  28. 一种本地媒体访问控制地址的分配系统,其中,所述系统包括至少一个待分配设备、至少一个已分配设备和至少一个网络设备;其中,A local media access control address allocation system, wherein the system includes at least one device to be allocated, at least one allocated device, and at least one network device;
    所述待分配设备,设置为发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    以及,当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块;And when the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
    所述已分配设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The allocated device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and a to-be-allocated to be allocated by the device to be allocated Address block
    以及,将所述注册消息中的待分配地址块与自身的本地地址进行冲突检测;And detecting collision of the to-be-allocated address block in the registration message with its own local address;
    以及,当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And sending a conflict failure message to the to-be-allocated device when a conflict occurs; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
    所述网络设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
    以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;And determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
    以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
    以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And, when receiving the affirmative message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
  29. 一种本地媒体访问控制地址的分配系统,所述系统包括至少一个待分配设备、至少一个数据库服务器和至少一个网络设备;其中,A local media access control address allocation system, the system comprising at least one device to be allocated, at least one database server, and at least one network device;
    所述待分配设备,设置为发送本地地址的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The device to be allocated is configured to send a registration message of a local address, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    以及,当所述待分配设备没有感知到任何冲突时,将所述待分配地址块确定为所述待 分配设备的地址,并发送地址的申明消息;其中,所述申明消息包括:用于唯一标识所述申明消息的消息标识以及需要进行申明的待分配地址块;And when the device to be allocated does not detect any conflict, determining the to-be-allocated address block as the address of the device to be allocated, and sending a declaration message of the address; wherein the affirmative message includes: Identifying a message identifier of the abbreviated message and an address block to be allocated that needs to be declared;
    所述数据库服务器,设置为接收待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及需要进行注册的待分配地址块;The database server is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message and an address block to be allocated that needs to be registered;
    以及,将所述待分配地址与已保存的地址进行冲突检测:其中,所述已保存的地址为全网中处于使用状态的地址;And detecting the conflict between the to-be-assigned address and the saved address: wherein the saved address is an address in a usage state in the entire network;
    以及,当出现冲突时,将冲突失败消息发送至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And sending a conflict failure message to the to-be-allocated device when a conflict occurs; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message and an address block in which a conflict occurs;
    所述网络设备,设置为接收所述待分配设备发送的注册消息;其中,所述注册消息包括:用于唯一标识所述注册消息的消息标识以及所述待分配设备需要进行注册的待分配地址块;The network device is configured to receive a registration message sent by the device to be allocated, where the registration message includes: a message identifier for uniquely identifying the registration message, and an address to be allocated that needs to be registered by the device to be allocated Piece;
    以及,根据预设的转发策略决定是否将所述注册消息转发至网络中所述待分配设备以外的其他网络设备;And determining, according to the preset forwarding policy, whether to forward the registration message to other network devices other than the device to be allocated in the network;
    以及,当接收到针对所述注册消息的冲突失败消息时,将所述冲突失败消息转发至所述待分配设备;其中,所述冲突失败消息包括用于唯一标识所述冲突失败消息的消息标识以及出现冲突的地址块;And, when receiving the conflict failure message for the registration message, forwarding the conflict failure message to the device to be allocated; wherein the conflict failure message includes a message identifier for uniquely identifying the conflict failure message And a block of addresses that have conflicts;
    以及,当接收到申明消息时,根据申明消息建立转发映射关系;其中,所述申明消息包括用于唯一标识所述申明消息的消息标识以及需要申明的地址。And, when receiving the affirmative message, establishing a forwarding mapping relationship according to the adjacency message; wherein the adjacency message includes a message identifier for uniquely identifying the affirmative message and an address that needs to be declared.
PCT/CN2018/078624 2017-03-10 2018-03-09 Method, equipment and system for allocating local media access control address WO2018161967A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710144446.5A CN108574743A (en) 2017-03-10 2017-03-10 A kind of distribution method, equipment and the system of local media accessing to control address
CN201710144446.5 2017-03-10

Publications (1)

Publication Number Publication Date
WO2018161967A1 true WO2018161967A1 (en) 2018-09-13

Family

ID=63447228

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078624 WO2018161967A1 (en) 2017-03-10 2018-03-09 Method, equipment and system for allocating local media access control address

Country Status (2)

Country Link
CN (1) CN108574743A (en)
WO (1) WO2018161967A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114944967A (en) * 2021-02-09 2022-08-26 奥动新能源汽车科技有限公司 Coding method, system, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529851B1 (en) * 2002-02-08 2009-05-05 Cisco Technology, Inc. Method and apparatus for MAC address assignment
CN102333013A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Method, device and system for detecting medium access control (MAC) address conflicts
CN102340555A (en) * 2011-10-18 2012-02-01 中兴通讯股份有限公司 Medium/media access control address allocation method, device and system
CN102355510A (en) * 2011-10-17 2012-02-15 中兴通讯股份有限公司 Medium/media access control (MAC) address allocation method, device and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333133A (en) * 2011-10-11 2012-01-25 中兴通讯股份有限公司 Medium access control (MAC) address distribution method, device and system
CN102333134B (en) * 2011-10-17 2014-03-19 中兴通讯股份有限公司 Medium/media access control address conflict detection method, device and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529851B1 (en) * 2002-02-08 2009-05-05 Cisco Technology, Inc. Method and apparatus for MAC address assignment
CN102333013A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Method, device and system for detecting medium access control (MAC) address conflicts
CN102355510A (en) * 2011-10-17 2012-02-15 中兴通讯股份有限公司 Medium/media access control (MAC) address allocation method, device and system
CN102340555A (en) * 2011-10-18 2012-02-01 中兴通讯股份有限公司 Medium/media access control address allocation method, device and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114944967A (en) * 2021-02-09 2022-08-26 奥动新能源汽车科技有限公司 Coding method, system, electronic device and storage medium
CN114944967B (en) * 2021-02-09 2024-02-13 奥动新能源汽车科技有限公司 Encoding method, encoding system, electronic device and storage medium

Also Published As

Publication number Publication date
CN108574743A (en) 2018-09-25

Similar Documents

Publication Publication Date Title
CN101663878B (en) Extensions to ipv6 neighbor discovery protocol for automated prefix delegation
US8825768B2 (en) Methods and apparatus for merging peer-to-peer overlay networks
JP6204510B2 (en) Topology discovery in hybrid networks
KR100804831B1 (en) How to create and manage sessions between a wireless USB host and a wireless USB device, wireless USB host and wireless USB device
CN104604193B (en) The automatic management method and device of network infrastructure with virtual unit environmental functional
CN102315968B (en) Network configuration method in virtual machine environment
WO2013151902A1 (en) Devices and methods for communication in ad-hoc networks
CN104753697A (en) Method, equipment and system for controlling provisioning of network equipment
CN104378455A (en) IP address distribution method and device
CN106101171B (en) Server connection method and device
CN105744593B (en) A node network access method and device
JP5508273B2 (en) Network location service
WO2012088934A1 (en) Method and switching device for filtering messages
WO2019011247A1 (en) Mac address information synchronization method, device and storage medium
WO2018161967A1 (en) Method, equipment and system for allocating local media access control address
CN105635138B (en) A kind of method and apparatus for preventing ARP from attacking
CN111245974A (en) Address allocation method, device, equipment and storage medium
CN104243626B (en) Information processing apparatus
CN107592261A (en) Message processing method, device and router
CN114024725B (en) Inter-container communication method, system, electronic device and storage medium
CN108712316B (en) Access configuration method, device and system of virtual machine
CN108712522B (en) IP address allocation method and device
US20150236911A1 (en) Detecting characteristics of a data path loop on a network
CN105245635B (en) FCoE communication means, apparatus and system
JP6308295B2 (en) COMMUNICATION DEVICE, SERVER, COMMUNICATION SYSTEM, AND COMMUNICATION METHOD

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18764541

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18764541

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载