[go: up one dir, main page]

CN108574743A - A kind of distribution method, equipment and the system of local media accessing to control address - Google Patents

A kind of distribution method, equipment and the system of local media accessing to control address Download PDF

Info

Publication number
CN108574743A
CN108574743A CN201710144446.5A CN201710144446A CN108574743A CN 108574743 A CN108574743 A CN 108574743A CN 201710144446 A CN201710144446 A CN 201710144446A CN 108574743 A CN108574743 A CN 108574743A
Authority
CN
China
Prior art keywords
message
mac address
allocated
conflict
equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710144446.5A
Other languages
Chinese (zh)
Inventor
敖婷
喻敬海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201710144446.5A priority Critical patent/CN108574743A/en
Priority to PCT/CN2018/078624 priority patent/WO2018161967A1/en
Publication of CN108574743A publication Critical patent/CN108574743A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The embodiment of the invention discloses a kind of distribution method, equipment and the systems of local media accessing to control address;This method may include:Equipment to be allocated sends the registration message of local mac address;When the equipment to be allocated is not detected by any conflict, the MAC Address block to be allocated is determined as the MAC Address of the equipment to be allocated, and send the statement message of MAC Address.

Description

Method, equipment and system for distributing local media access control address
Technical Field
The present invention relates to network communication technologies, and in particular, to a method, a device, and a system for allocating a local Media Access Control (MAC) address.
Background
The expansion of the scale of the data center and the introduction of virtualization bring about not only the increase of physical devices but also the exponential growth of virtual devices. The proliferation of these devices has resulted in a dramatic rise in the consumption of MAC addresses. Whereas the conventional MAC address is a MAC address of 48 bits that the above-mentioned devices have been assigned to at the time of manufacture or shipment to facilitate communication between the devices.
The conventional MAC address has many problems in specific applications, such as: the capacity of the MAC address space cannot meet the increasingly consumed MAC addresses; the MAC address is fixed; the MAC addresses are not hierarchical and cannot provide other device-related information, such as location information. To solve the problems of the conventional MAC address, the Institute of Electrical and Electronics Engineers (IEEE) has proposed a concept of a local MAC address, i.e., a MAC address is no longer a globally unique 48-bit address in some network environments, but is a localized address unique within a network. And a unified address allocation mode can be adopted to uniformly allocate the local MAC address to each network element in the network.
Currently, for the allocation of the local MAC address, the local MAC address is usually applied in a form of sending a request data packet, so that the address allocation of the network device to the host and other devices is only involved, and the method is suitable for a small network, such as a vehicle-mounted internal small network scenario. For a large network, how to obtain the MAC address in multiple network devices needs a relevant protocol to complete. In addition, for the local MAC address allocation scheme, the host may implement MAC address acquisition in a self-declared manner, but the entire network architecture is a Client and Server (C/S) architecture, so that a centralized Server manner is adopted, and local MAC address allocation cannot be performed under other network architectures.
Disclosure of Invention
In order to solve the foregoing technical problem, embodiments of the present invention desirably provide a method, device, and system for allocating a local MAC address; the protocol for distributing local MAC addresses is not only realized in a plurality of network devices, but also can be adapted to different local network architectures.
The technical scheme of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for allocating a local media access control MAC address, where the method includes:
the equipment to be allocated sends a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
In the above scheme, the device to be allocated does not sense any conflict, and specifically includes:
when the device to be allocated transmits the registration message according to a preset interval period for a preset number of times, and does not receive a conflict failure message aiming at the registration message or a declaration message verified as an address conflict, determining that the device to be allocated does not sense the MAC address conflict to be allocated; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
In the above aspect, the method further includes: and when the equipment to be distributed perceives the conflict, the equipment to be distributed reselects the MAC address block to be distributed and retransmits the registration message.
In the above aspect, the method further includes:
when the device to be allocated receives declaration information sent by other devices, the device to be allocated performs conflict detection on the MAC address to be declared in the declaration information sent by other devices and the MAC address block to be allocated, which needs to be registered in the registration information, and determines whether a conflict occurs:
if conflict occurs, reselecting the MAC address block to be allocated, and replacing the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected MAC address block to be allocated;
if no conflict occurs, no processing is done.
In the above scheme, the MAC address block to be allocated, which needs to be registered in the registration message, is obtained by selecting, by the device to be allocated, according to a preset selection policy.
In a second aspect, an embodiment of the present invention provides a method for allocating a local media access control MAC address, where the method includes:
the distributed equipment receives a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
the allocated equipment carries out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the allocated equipment;
when a conflict occurs, the distributed equipment sends a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
In a third aspect, an embodiment of the present invention provides a method for allocating a local media access control MAC address, where the method includes:
the network equipment receives a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
the network equipment determines whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when the network equipment receives a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when the network equipment receives the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In the foregoing solution, the network device determining whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy includes:
when the network device is provided with an agent of the allocated device, the network device performs conflict detection on the MAC address block to be allocated in the registration message and the MAC address of the allocated device of the network device agent:
when a conflict occurs, the network device sends a corresponding conflict failure message,
and when no conflict occurs, the network equipment forwards the registration message to other network equipment except the equipment to be distributed in the network.
In the foregoing solution, the network device determining whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy includes:
and when the network equipment does not set the proxy of the distribution equipment, the network equipment forwards the registration message to other network equipment except the equipment to be distributed in the network.
In the foregoing solution, the establishing a forwarding mapping relationship according to the declaration message includes:
the network device establishes a forwarding mapping relationship between a receiving port receiving the declaration message and the MAC address declared in the declaration message.
In a fourth aspect, an embodiment of the present invention provides a method for allocating a local media access control MAC address, where the method includes:
a database server receives a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the database server carries out conflict detection on the MAC address to be distributed and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, the database server sends a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
In the above aspect, the method further includes:
when the database server receives a declaration message, storing the MAC address to be declared in the declaration message, and setting the state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In a fifth aspect, an embodiment of the present invention provides an apparatus to be allocated, where the apparatus to be allocated includes: the device comprises a first sending module, a sensing module and a determining module; wherein,
the first sending module is used for sending a registration message of a local Media Access Control (MAC) address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the sensing module is used for sensing whether any conflict is sensed; when no conflict is sensed, triggering the determining module and the first sending module;
the determining module 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 is further configured to send a declaration message of the MAC address; wherein the declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
In the foregoing solution, the sensing module is configured to determine that no MAC address collision to be allocated is sensed when the first sending module sends the registration message according to a preset number of times according to a preset interval period and does not receive a collision failure message for the registration message or a declaration message that is verified as an address collision; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
In the above scheme, the device to be allocated further includes a selection module;
the sensing module is further used for triggering the selection module and the first sending module when a conflict is sensed;
the selection module is used for reselecting the MAC address block to be allocated;
the first sending module is further configured to resend the registration message.
In the above scheme, the device to be allocated further includes a first receiving module and a first detecting module;
the first receiving module is used for receiving declaration messages sent by other devices;
a first detection module, configured to perform collision detection on a MAC address that needs to be declared in a declaration message sent by another device and a MAC address block to be allocated that needs to be registered in the registration message, and determine whether a collision occurs: if a conflict occurs, triggering the selection module; if no conflict occurs, no processing is carried out;
the selection module is further configured to reselect the MAC address block to be allocated, and replace the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected MAC address block to be allocated.
In a sixth aspect, an embodiment of the present invention provides an allocated apparatus, where the allocated apparatus includes: the first receiving module, the first detecting module and the first sending module; wherein,
the second receiving module is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the second detection module is used for carrying out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the second detection module; when a conflict occurs, triggering the second sending module;
the second sending module is used for sending the conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
In a seventh aspect, an embodiment of the present invention provides a network device, where the network device includes: a third receiving module, a forwarding module and an establishing module; wherein,
the third receiving module is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the forwarding module is configured to determine whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy;
the third receiving module is configured to trigger the forwarding module when receiving a collision failure message for the registration message; triggering the establishing module when receiving a declaration message; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the forwarding module is further configured to forward the conflict failure message to the device to be allocated;
the establishing module is used for establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In the foregoing scheme, the forwarding module is specifically configured to:
when the network equipment is provided with an agent of the allocated equipment, the MAC address block to be allocated in the registration message and the MAC address of the allocated equipment of the network equipment agent are subjected to conflict detection:
and, when a collision occurs, transmitting a corresponding collision failure message,
and when no conflict occurs, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
In the foregoing scheme, the forwarding module is specifically configured to: and when the network equipment does not set the agent of the distribution equipment, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
In the foregoing solution, the forwarding module is configured to:
after a receiving port for receiving a registration message is obtained, establishing a corresponding relation between a message identifier of the registration message and the receiving port; and the number of the first and second groups,
and sending the registration message through other ports except the receiving port.
In the foregoing solution, the establishing module is configured to establish a forwarding mapping relationship between a receiving port that receives the declaration message and a MAC address that needs to be declared in the declaration message.
In an eighth aspect, an embodiment of the present invention provides a database server, where the database server includes: a fourth receiving module, a third detecting module and a third sending module, wherein,
the fourth receiving module is configured to receive a registration message sent by a device to be allocated; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the third detection module is configured to perform collision detection on the MAC address to be allocated and the stored MAC address: wherein, the stored MAC address is the MAC address in the use state in the whole network;
and, when a collision occurs, triggering the third sending module;
the third sending module is configured to send a collision failure message to the device to be allocated; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
In the above solution, the database server further includes: a storing module, configured to store, when the fourth receiving module receives a declaration message, a MAC address to be declared in the declaration message, and set a state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In a ninth aspect, an embodiment of the present invention provides a system for allocating local media access control MAC addresses, where the system includes at least one device to be allocated, at least one allocated device, and at least one network device; wherein,
the equipment to be allocated is used for sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the allocated device is used for receiving the registration message sent by the device to be allocated; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
and carrying out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the MAC address block;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device is used for receiving the registration message sent by the device to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In a tenth aspect, an embodiment of the present invention provides a system for allocating local media access control MAC addresses, where the system includes at least one device to be allocated, at least one database server, and at least one network device; wherein,
the equipment to be allocated is used for sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the database server is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
and performing conflict detection on the MAC address to be allocated and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device is used for receiving the registration message sent by the device to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
The embodiment of the invention provides a method, equipment and a system for distributing local MAC addresses; the device to be allocated sends the MAC address block to be allocated to the network devices of the whole network, and declares the MAC address used by the device to be allocated according to the feedback of other network devices of the whole network aiming at the MAC address block to be allocated, thereby realizing the registration of the local MAC address and the conflict detection of the local MAC address, realizing the allocation protocol of the local MAC address in a plurality of network devices, and being suitable for different local network architectures.
Drawings
Fig. 1 is a schematic flow chart of a method for allocating a local MAC address according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of another local MAC address allocation method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another local MAC address allocation method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for allocating a local MAC address according to another embodiment of the present invention;
fig. 5 is a schematic diagram of a networking architecture according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a multiple MAC allocation protocol data unit according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a message delivery process according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of another multiple MAC allocation protocol data unit according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a message delivery process according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a message passing process according to an embodiment of the present invention;
fig. 11 is a schematic diagram of a message delivery process according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a link layer discovery protocol data unit according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a device to be distributed according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of another apparatus to be distributed according to an embodiment of the present invention;
fig. 15 is a schematic diagram of a specific hardware structure of a device to be allocated according to an embodiment of the present invention;
FIG. 16 is a schematic structural diagram of a distributed apparatus according to an embodiment of the present invention;
fig. 17 is a schematic diagram of a specific hardware structure of a distributed device according to an embodiment of the present invention;
fig. 18 is a schematic structural diagram of a network device according to an embodiment of the present invention;
fig. 19 is a schematic hardware structure diagram of a network device according to an embodiment of the present invention;
fig. 20 is a schematic structural diagram of a database server according to an embodiment of the present invention;
fig. 21 is a schematic structural diagram of another database server according to an embodiment of the present invention;
fig. 22 is a schematic hardware structure diagram of a database server according to an embodiment of the present invention;
fig. 23 is a schematic structural diagram of a system for allocating local MAC addresses according to an embodiment of the present invention;
fig. 24 is a schematic structural diagram of another local MAC address allocation system according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Example one
Referring to fig. 1, it shows a flow of a method for allocating a local MAC address according to an embodiment of the present invention, where the flow is suitable for a device to be allocated in a network, where the local MAC address needs to be allocated, and the flow may include:
s101: the equipment to be allocated sends a registration message of a local MAC address;
specifically, in the embodiment of the present invention, the device to be allocated may implement obtaining the local MAC address in a self-declaration manner to the entire network, and therefore, the registration message may be sent to all device nodes in the entire network, or may be sent to the database server in a unicast manner. The database server holds the assigned and in-use MAC addresses, and can be used to centrally manage the overall network of MAC address assignments. The registration message may include: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated to be registered. It is easily understood that the MAC address block to be allocated may contain one MAC address or a plurality of MAC addresses.
It can be understood that the MAC address block to be allocated, which needs to be registered in the registration message, may be obtained after the device to be allocated selects according to a preset selection policy. And the preset selection policy may preferably include: the device to be allocated learns the MAC address block that has not been used from the history of the data transmission over the entire network.
S102: when the device to be allocated does not sense any conflict, 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;
it should be noted that, the device to be allocated does not sense any conflict, and in particular implementation, it may preferably include:
when the device to be allocated transmits the registration message according to a preset interval period for a preset number of times, and does not receive a conflict failure message aiming at the registration message or a declaration message verified as an address conflict, determining that the device to be allocated does not sense the MAC address conflict to be applied;
wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; therefore, when the device to be allocated reselects the MAC address block to be allocated, the MAC address block with conflict included in the conflict failure message is avoided, and the retransmitted registration message has higher probability to avoid receiving the conflict failure message. In addition, the message identifier in the collision failure message and the message identifier in the registration message have a corresponding relationship, so that the registration message to which the collision failure message is directed can be known.
Specifically, the declaration message includes a message identifier for uniquely identifying the declaration message and a MAC address to be declared. It should be noted that, after receiving the declaration message, the network device in the network may establish and retain a forwarding mapping relationship between the receiving port that receives the declaration message and the MAC address that needs to be declared in the declaration message, and a specific retention form may be to update an existing forwarding table of the network device according to the established forwarding mapping relationship, so that when a subsequent network device needs to forward a message to the MAC address that needs to be declared, the message that needs to be forwarded is forwarded from the receiving port by querying the forwarding table, and thus broadcast transmission is not required.
For example, when the device to be allocated senses a conflict, the above scheme may further include:
the equipment to be allocated reselects the MAC address block to be allocated and retransmits the registration message;
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.
It will be appreciated that, based on the preceding description that no conflict is perceived by the device to be allocated, it can be seen that: when the device to be allocated receives a conflict failure message for the registration message or a declaration message that the registration message is verified to be an address conflict, the device to be allocated may determine that a conflict is perceived; the collision failure message may include a message identification for uniquely identifying the collision failure message and a MAC address block where the collision occurred,
illustratively, when the device to be allocated sends the registration message, then the process may further include: when the device to be allocated receives declaration information sent by other devices, the MAC address needing declaration in the declaration information sent by other devices and the MAC address block to be allocated which needs to be registered in the registration information are subjected to conflict detection, and whether conflict occurs is determined:
if the conflict occurs, reselecting the MAC address block to be allocated, and replacing the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected Mac address block to be allocated;
if no conflict occurs, the registration message is not processed; preferably, the registration message may also be continuously transmitted.
It can be understood that, the specific collision detection method may be to determine whether an intersection between the MAC address to be declared in the declaration message sent by the other device and the MAC address block to be allocated that needs to be registered in the registration message is empty, and if the intersection is empty, it indicates that a collision occurs; otherwise, no conflict is indicated.
The embodiment provides a local MAC address allocation method applied to equipment to be allocated, which is characterized in that the equipment to be allocated sends an MAC address block to be allocated to network equipment of the whole network, and the MAC address used by the equipment to be allocated is declared according to feedback of other network equipment of the whole network aiming at the MAC address block to be allocated, so that registration of the local MAC address and conflict detection of the local MAC address are realized, a local MAC address allocation protocol is realized in a plurality of network equipment, and the method can be suitable for different local network architectures.
Example two
Based on the same technical concept as the foregoing embodiment, referring to fig. 2, a flow of a method for allocating a local MAC address according to an embodiment of the present invention is shown, where the method may be applied to an allocated device to which a local MAC address is allocated in a network, and the flow may include:
s201: the distributed equipment receives a registration message sent by the equipment to be distributed;
specifically, the registration message may be sent to the whole network by a device to be allocated, which needs to allocate a local MAC address in the network, and the registration message may include: and the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated.
S202: the distributed equipment carries out conflict detection on the MAC address block to be distributed in the registration message and the local MAC address of the distributed equipment;
it should be noted that, since the native MAC address is a unique MAC address in the entire network, the devices in the network have only one corresponding native MAC address in the entire network. When the MAC address to be allocated in the registration message is not used by all allocated devices in the network, the device to be allocated can use the MAC address to be allocated in the registration message; when the MAC address to be allocated in the registration message is already used by the allocated device in the network, it indicates that the MAC address to be allocated in the registration message conflicts with the used MAC address, so that 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, collision detection by the allocated device has two results:
s203: when a conflict occurs, the distributed equipment sends a conflict failure message to the equipment to be distributed;
it should be noted that the collision failure message may include a message identifier for uniquely identifying the collision failure message and a MAC address block where the collision occurs.
It can be understood that the message identifier in the collision failure message may have a corresponding relationship with the message identifier in the registration message, so that the registration message to which the collision failure message is directed can be known.
Illustratively, when no conflict occurs, the technical solution of the present process may further include: the assigned device terminates the registration message.
It can be understood that after the allocated device terminates the registration message, the device to be allocated continues to send the declaration message when the collision failure message for the registration message is not received, so that the device to be allocated takes the MAC address to be declared in the declaration message as the local MAC address of the device to be allocated.
The embodiment provides a local MAC address allocation method applied to allocated equipment, which includes the steps that the allocated equipment receives an MAC address block to be allocated sent by the allocated equipment, collision detection is carried out according to the MAC address of the allocated equipment and the MAC address block to be allocated, a collision failure message is fed back to the allocated equipment when collision occurs, registration of the allocated equipment is terminated when no collision occurs, registration of local MAC addresses and collision detection of local MAC addresses are achieved, a local MAC address allocation protocol is achieved in a plurality of network equipment, and the local MAC address allocation method can be suitable for different local network architectures.
EXAMPLE III
Based on the same technical concept as the foregoing embodiment, referring to fig. 3, it shows a flow of a method for allocating a local MAC address according to an embodiment of the present invention, where the method may be applied to a network device for forwarding in a network, and the flow may include:
s301: the network equipment receives a registration message sent by the equipment to be distributed;
it should be noted that the registration message may include: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated to be registered.
S302: the network equipment determines whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
s303: when the network equipment receives the conflict failure message aiming at the registration message, the conflict failure message is forwarded to the equipment to be distributed.
It should be noted that the collision failure message may include a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; the message identity of the collision failure message may typically be set to coincide with the message identity in the registration message. Therefore, the network device can query the corresponding relationship established in step S301 according to the message identifier in the collision failure message, so that the forwarding message can send the collision failure message to the device to be allocated from the receiving port of the registration message.
S303: when the network equipment receives the declaration message, the forwarding mapping relation is established according to the declaration message.
It should be noted that the declaration message includes a message identifier for uniquely identifying the declaration message and a MAC address to be declared. Therefore, the network device can establish a forwarding mapping relationship between the receiving port receiving the declaration message and the MAC address to be declared in the declaration message, and store the mapping relationship, and the specific storage form may be a form of a forwarding table entry. It can be understood that the network device has usually established a forwarding table, and after a new forwarding table entry is established, the new forwarding table entry may be updated to an existing forwarding table, so that when a subsequent network device receives a message to be sent to an MAC address that needs to be declared, the forwarding table may be retrieved to query a corresponding sending port, the message is directly forwarded from the sending port, and broadcast sending of the message is reduced.
For the technical solution shown in fig. 3, optionally, for the network device that determines whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy in step S302, the method may include:
when the network equipment is provided with an agent of the allocated equipment, the network equipment carries out conflict detection on an MAC address block to be allocated in the registration message and a local MAC address of the allocated equipment of the network equipment agent; and the number of the first and second groups,
when a conflict occurs, the network equipment sends a corresponding conflict failure message; and the number of the first and second groups,
when no conflict occurs, the network device forwards the registration message to other network devices except the device to be distributed in the network.
It is understood that after the network device sends the corresponding collision failure message, the collision failure message is finally received by the device to be allocated.
For the technical solution shown in fig. 3, optionally, for the network device that determines whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy in step S302, the method may include:
and when the network equipment does not set the proxy of the distribution equipment, the network equipment forwards the registration message to other network equipment except the equipment to be distributed in the network.
Specifically, for the above alternative, the network device forwarding the registration message to other network devices in the network except the device to be allocated may include:
after the network equipment acquires a receiving port for receiving the registration message, establishing a corresponding relation between a message identifier of the registration message and the receiving port; and the number of the first and second groups,
and sending the registration message through other ports except the receiving port.
It can be understood that, when the network device agent has other allocated devices, the behavior of the allocated devices is executed first, that is, collision detection is performed on the MAC address block to be allocated in the registration message, and a process of specifically performing collision detection may be as described in step S202 in embodiment two, which is not described in detail in this embodiment. And after the network equipment sends the conflict failure message to the equipment to be distributed, the registration message is not forwarded any more. After receiving the declaration message, the network device with proxy capability still needs to establish a forwarding mapping relationship according to the declaration message, so as to retain the MAC address to be declared in the declaration message.
Example four
In a specific implementation process, a MAC address registration message sent by a device to be allocated may not be sent to an allocated device or a network device in a network, and when a database server for centrally managing MAC address allocation is provided in the network, referring to fig. 4, a method for allocating a local media access control MAC address may include:
s401: a database server receives a registration message sent by equipment to be distributed;
wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
specifically, for step S401, when the device to be allocated sends the registration message to the database server, the registration message may be sent in a unicast manner, so that the database server can receive the registration message.
S402: the database server carries out conflict detection on the MAC address to be distributed and the stored MAC address:
wherein, the saved MAC address is the MAC address in the use state in the whole network;
s403: when a conflict occurs, the database server sends a conflict failure message to the equipment to be distributed;
wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
It should be noted that when no conflict occurs, the database server does not respond to the registration message, which is terminated at the database server.
Illustratively, the method further comprises:
when the database server receives a declaration message, storing the MAC address to be declared in the declaration message, and setting the state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
It can be understood that, after the database server stores and sets the MAC address to be declared in the declaration message to the use state, the database server updates the stored MAC address, so that collision detection can be performed subsequently through the updated stored MAC address.
EXAMPLE five
Based on the same technical concept of the foregoing embodiments, the present embodiment explains the technical solutions of the foregoing three embodiments by a specific example. The embodiment is implemented by extending the MRSP Protocol based on the MRP Protocol, and may be referred to as a Multiple MAC Assignment Protocol (MMAP); three types of messages may be included in the MMAP: MAC address registration messages, MAC address collision messages, and MAC address declaration messages. In addition, the three types of messages can be carried by an MMAP Data Unit (MMAPDU), and in the MMAPDU, three values are added to an AttributeType field to correspond to the three types of messages; the vectorattetbute byte in the AttributeList field can be defined as two kinds: the message identifies a messageID attribute and an MAC address attribute; the message ID attribute contains a message ID for distinguishing different messages. In this embodiment, 48-bit MAC address start value plus 16-bit random ID may be preferably used for representation; and the MAC address attribute comprises a MAC address starting value and the number of the MAC addresses.
The present embodiment is explained based on the networking structure shown in fig. 5, where in fig. 5, the device to be allocated is T; the allocated device is L; the network equipment for forwarding is B; it should be noted that when the Network device is provided with an agent, B may play a role of T or L, and the devices are connected through a Local Area Network (LAN), as shown by a circle in fig. 5.
When T needs to apply for a part of MAC address, a MAC address registration message is sent; the AttributeList carried in the registration message is shown in fig. 6, and includes a messageID attribute and a MAC address attribute; the MAC address attribute comprises an MAC address space to be allocated, which needs to be registered;
and B, after receiving the MAC address registration message, storing the corresponding relation between the messageID in the MAC address registration message and a receiving port for receiving the MAC address registration message, forwarding the MAC address registration message to other ports, and receiving the MAC address registration message sent by T by other L through the forwarding of B.
It can be understood that the above sending process for the MAC address registration message is shown in fig. 7, the direction of the arrow is the transmission direction of the MAC address registration message, R near the arrow represents the MAC address registration message, and S in the block of B represents 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.
After receiving the MAC address registration message, the L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the present device: if not, terminating the MAC address registration message; if so, sending an MAC address conflict message; the AttributeList carried in the MAC address collision message also carries a messageID attribute and a MAC address attribute as shown in fig. 8, but the MAC address attribute at this time indicates a MAC address space with collision. Generally, the messageID attribute value in the MAC address collision message is the same as the messageID attribute value in the MAC address registration message, so that the registration message for which the collision failure message is intended can be characterized.
After receiving the MAC address collision message, B forwards the MAC address collision message to T according to the messageID in the MAC address collision message and the correspondence relationship stored in B shown in fig. 7.
It can be understood that the above-mentioned transmission process for the MAC address collision message is shown in fig. 9, the direction of an arrow is the transmission direction of the MAC address collision message, C near the arrow indicates the MAC address collision message, and P in the block of B indicates that the correspondence relationship stored in B is stored.
T can wait for the sending of MAC address registration message once in the preset interval period, after the MAC address registration message is sent for a plurality of times continuously, if no MAC address conflict message is received, the MAC address declaration message is sent to the whole network; if the MAC address conflict message is received in the period of time, a new MAC address to be allocated needs to be reselected and the MAC address registration message needs to be retransmitted, and at the moment, the message ID also changes along with the reselected MAC address.
After receiving the MAC address declaration message, the network device B may 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 that received the declaration message, and update the forwarding mapping relationship to a forwarding table of the network device B itself. The specific preservation form can be as follows: the declared MAC address is saved to the destination address and the receive port is saved to the output port. Therefore, after a message of the MAC address to be declared is received subsequently, the forwarding table can be searched to find the output port, the message is directly forwarded to the T, and the message is reduced from being sent in a broadcasting mode.
It is to be understood that the above-mentioned transmission process for the MAC address declaration message is shown in fig. 10, the direction of the arrow is the transmission direction of the MAC address declaration message, and a near the arrow represents the MAC address declaration message.
EXAMPLE six
In addition to the fifth embodiment, in this embodiment, the explanation of the specific implementation procedure is performed by the agent whose B has L, and in the case of the agent whose B has L, since the MAC address of the proxied L is stored in B, the MAC address collision message can be replied instead of the proxied L. The specific implementation process of this embodiment is as follows:
when T needs to apply for a part of MAC address, a MAC address registration message is sent; the AttributeList carried in the registration message is shown in fig. 6, and includes a messageID attribute and a MAC address attribute; the MAC address attribute comprises an MAC address space to be allocated, which needs to be registered;
after receiving the MAC address registration message, B may store a correspondence between the messageID in the MAC address registration message and the receiving port that receives the MAC address registration message, and for B that does not have an agent, may transmit the MAC address registration message according to the process shown in fig. 7, which is not described in detail in this embodiment.
For B provided with an agent, the behavior of L is performed first, namely:
b, detecting whether the MAC address stored by the B and the MAC address to be distributed which needs to be registered conflict or not by the B provided with the agent: if there is a collision, B will proxy L to send a MAC collision message. Otherwise, terminating the MAC address registration message and not forwarding.
It is to be understood that a schematic diagram of the B provided with the agent sending the MAC address collision message is shown in fig. 11, the B provided with the agent is shown as a hatched block with oblique lines, and the arrow direction is the transfer direction of the MAC address collision message sent by the B provided with the agent.
For the L that receives the MAC address registration message and the B that is not provided with the proxy, the specific implementation process of this embodiment is similar to that of the fourth embodiment, that is:
after receiving the MAC address registration message, the L may check whether the MAC address to be allocated that needs to be registered conflicts with the MAC address of the present device: if not, terminating the MAC address registration message; if so, sending an MAC address conflict message; the AttributeList carried in the MAC address collision message also carries a messageID attribute and a MAC address attribute as shown in fig. 8, but the MAC address attribute at this time indicates a MAC address space with collision. Generally, the messageID attribute value in the MAC address collision message is the same as the messageID attribute value in the MAC address registration message, so that the registration message for which the collision failure message is intended can be characterized.
After receiving the MAC address collision message, B forwards the MAC address collision message to T according to the messageID in the MAC address collision message and the correspondence relationship stored in B shown in fig. 7.
T can wait for the sending of MAC address registration message once in the preset interval period, after the MAC address registration message is sent for a plurality of times continuously, if no MAC address conflict message is received, the MAC address declaration message is sent to the whole network; if the MAC address conflict message is received in the period of time, a new MAC address to be allocated needs to be reselected and the MAC address registration message needs to be retransmitted, and at the moment, the message ID also changes along with the reselected MAC address.
For B without agent, after receiving MAC address declaration message, according to MAC address declared in MAC address declaration message and receiving port receiving the declaration message, establishing forwarding mapping relation between declared MAC address and receiving port, and updating the forwarding mapping relation to self forwarding table of B. The specific preservation form can be as follows: the declared MAC address is saved to the destination address and the receive port is saved to the output port. Therefore, after a message of the MAC address to be declared is received subsequently, the forwarding table can be searched to find the output port, the message is directly forwarded to the T, and the message is reduced from being sent in a broadcasting mode.
For the B device provided with the agent L application, if the MAC address declaration message is received, the MAC address declared in the MAC address declaration message is stored.
For the L device, if the MAC address of the L device has not been declared, when the MAC address declaration message of another T is received, the declared MAC address in the MAC address declaration message is also stored, and is used as a basis for selecting the MAC address to be allocated that needs to be registered, so that collision repetition is avoided.
For other T, after the MAC address to be allocated which needs to be registered by the device is selected, when the MAC address registration message is sent, if the MAC address declaration message sent by other T is received, the conflict detection is carried out on the life MAC address in the MAC address declaration message sent by other T and the MAC address to be allocated which needs to be registered and is selected by the device; if there is a conflict, the MAC address to be allocated that needs to be registered needs to be reselected, and the process of sending the MAC address registration message begins again.
EXAMPLE seven
For some lightweight devices, the MRP Protocol may not be supported, and this embodiment is implemented in an Edge Control Protocol (ECP) Protocol based on a Link Layer Discovery Protocol (LLDP), and the specific implementation process is the same as that in the fourth embodiment and the fifth embodiment, and the content is different from that in the fifth embodiment and the sixth embodiment: the message content in the different messages is carried in the form of Type-Length-Value (TLV) in LLDP Data Unit (LLDPDU, LLDP Data Unit), as shown in fig. 12, the field TLVtype indicates the Type of TLV, for the embodiment, three TLV types are defined, namely TLV Type — Register, indicating that it is for MAC address registration message; TLV type ═ Conflict, which indicates that it is a MAC address collision message; TLV type ═ Announce, indicates that it is a MAC address declaration message. The field TLV Length is a Length indicating this TLV. The field TLVValue mainly includes two kinds of information: message ID and MAC start address; for the Message ID, the unique identity of the Message is indicated, and for the MAC start address, the start value of the MAC address block has different meanings in different Message types. If the message is in the registration message, the MAC address block which needs to be registered is indicated; if the MAC address block is in the conflict message, the MAC address block is used by other equipment, and a conflict exists, so that a new MAC address block needs to be reselected; if the message is a declaration message, the MAC address block is formally used by the device, and other devices cannot use the MAC address block. The number of fields indicates the number of addresses of the address block.
Example eight
The technical solutions of the fifth embodiment and the sixth embodiment may also be implemented based on a Gratuitous Address Resolution Protocol (Gratuitous ARP), and the specific implementation process is the same as that of the fourth embodiment and the fifth embodiment, except that the existing free ARP packet needs to be expanded. Therefore, the expanded free ARP message can bear the message content in different messages. The embodiment provides a preferred extension scheme, which is to extend the gratuitous ARP packet, but is not limited to the extension scheme. In a preferred extension scheme, for the MAC address registration message, the following attribute values in the gratuitous ARP message are set, specifically:
opcode 10, which indicates a type of MAC address registration message;
sender MAC: filling in the initial address of the MAC address block;
sender IP: if yes, filling, and if not, 0 is obtained;
destination MAC: filling the final address of the MAC address block;
destination IP: fills in the same address as Sender IP.
In a preferred extension scheme, for a MAC address collision message, the following attribute values in the gratuitous ARP message are set, specifically:
opcode is 11, and the type is MAC address conflict message;
sender MAC: filling the initial address of the conflict MAC address block;
sender IP: if yes, filling, and if not, 0 is obtained;
destination MAC: filling the final address of the conflict MAC address block;
destination IP: fills in the same address as Sender IP.
In a preferred extension scheme, for the MAC address declaration message, the following attribute values in the gratuitous ARP message are set, specifically:
opcode 12, indicating a type of MAC address declaration message;
sender MAC: filling in the initial address of the stated MAC address block;
sender IP: if yes, filling, and if not, 0 is obtained;
destination MAC: filling in the last address of the claimed MAC address block;
destination IP: fills in the same address as Sender IP.
The technical scheme has the advantages that the technical scheme can be combined with the IP address based on the free ARP, and the corresponding relation between the MAC address and the IP address can be directly established after a declaration message for the condition that the equipment T to be allocated already has the IP address.
It can be understood that the fifth to eighth embodiments only disclose implementation processes of the technical solutions of the first to third embodiments under different protocols, and are not specific limitations on the embodiments of the present invention.
Example nine
Based on the same technical concept as the foregoing embodiment, referring to fig. 13, there is shown an apparatus to be distributed 130 according to an embodiment of the present invention, where the apparatus to be distributed 130 includes: a first sending module 1301, a sensing module 1302 and a determining module 1303; wherein,
the first sending module 1301 is configured to send a registration message of a local media access control MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the sensing module 1302, configured to determine whether any conflict is sensed; and when no conflict is perceived, triggering the determining module 1303 and the first sending module 1301;
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 a MAC address; wherein the declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
Illustratively, the sensing module 1302 is configured to determine that a collision of the MAC address to be allocated is not sensed when the first sending module 1301 does not receive a collision failure message for the registration message or a declaration message that is verified as an address collision after sending the registration message according to a preset number of times in a preset interval period; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
Illustratively, referring to fig. 14, the apparatus to be distributed 130 further includes a selection module 1304;
the sensing module 1302 is further configured to trigger the selecting module and the first sending module 1301 when a conflict is sensed;
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.
Further, referring to fig. 14, the device to be distributed 130 further includes a first receiving module 1305 and a first detecting module 1306;
the first receiving module 1305 is configured to receive declaration messages sent by other devices;
a first detecting module 1306, configured to perform collision detection on a MAC address that needs to be declared in a declaration message sent by another device and a MAC address block to be allocated that needs to be registered in the registration message, to determine whether a collision occurs: if a conflict occurs, triggering 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, which needs to be registered, in the registration message with the reselected 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 alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Specifically, the computer program instructions corresponding to a local MAC address allocation method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to a local MAC address allocation method in the storage medium are read or executed by an electronic device, the method includes the following steps:
sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when no conflict is sensed, determining the MAC address block to be allocated as the MAC address of the equipment to be allocated, and sending declaration information of the MAC address; wherein the declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
Optionally, the step of storing in the storage medium: no conflict is perceived, including in particular:
when the registration message is sent according to a preset time according to a preset interval period, if a conflict failure message aiming at the registration message or a declaration message verified as an address conflict is not received, determining that the MAC address conflict to be distributed is not sensed; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
Optionally, the step of storing in the storage medium: the method further comprises the following steps: and when the conflict is sensed, reselecting the MAC address block to be distributed, and retransmitting the registration message.
Optionally, the step of storing in the storage medium: the method further comprises the following steps:
when receiving declaration information sent by other equipment, carrying out conflict detection on the MAC address needing declaration in the declaration information sent by the other equipment and the MAC address block to be allocated which needs to be registered in the registration information, and determining whether a conflict occurs:
if the conflict occurs, reselecting the MAC address block to be allocated, and replacing the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected Mac address block to be allocated;
if no conflict occurs, the registration message is not processed.
Optionally, the step of storing in the storage medium: and the MAC address block to be allocated, which needs to be registered in the registration message, is obtained by selecting the equipment to be allocated according to a preset selection strategy.
Example ten
Based on the same technical concept as the foregoing embodiment, referring to fig. 15, a specific hardware structure of a device to be distributed 130 according to an embodiment of the present invention is shown, which may include: a first communication interface 1501, a first memory 1502, a first processor 1503, and a first bus 1504; wherein,
the first bus 1504 is used to connect the first communication interface 1501, the first processor 1503 and the first memory 1502 and to communicate between these devices;
the first communication interface 1501 is configured to perform data transmission with an external network element;
the first memory 1502 for storing instructions and data;
the first processor 1503 executing the instructions to: sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when no conflict is sensed, determining the MAC address block to be allocated as the MAC address of the equipment to be allocated, and sending declaration information of the MAC address; wherein the declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
In practical applications, the first Memory 1502 may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory) such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (HDD), or a Solid-State Drive (SSD); or a combination of the above types of memory and provides instructions and data to the first processor 1503.
The first Processor 1503 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is to be understood that the electronic device for implementing the first processor function may be other electronic devices, and the embodiment of the present invention is not limited in particular.
Illustratively, the first processor 1503 may be specifically configured to: when the registration message is sent according to a preset time according to a preset interval period, if a conflict failure message aiming at the registration message or a declaration message verified as an address conflict is not received, determining that the MAC address conflict to be distributed is not sensed; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
Illustratively, the first processor 1503 may further be configured to: and when the conflict is sensed, reselecting the MAC address block to be distributed, and retransmitting the registration message.
Illustratively, the first processor 1503 may further be configured to: when receiving declaration information sent by other equipment, carrying out conflict detection on the MAC address needing declaration in the declaration information sent by the other equipment and the MAC address block to be allocated which needs to be registered in the registration information, and determining whether a conflict occurs:
if the conflict occurs, reselecting the MAC address block to be allocated, and replacing the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected Mac address block to be allocated;
if no conflict occurs, the registration message is not processed.
Illustratively, the MAC address block to be allocated, which needs to be registered in the registration message, is obtained by selecting, by the device to be allocated, according to a preset selection policy.
EXAMPLE eleven
Based on the same technical concept as the previous embodiment, referring to fig. 16, it shows a distributed apparatus 160 provided by an embodiment of the present invention, where the distributed apparatus 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 a device to be allocated; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the second detecting module 1602, configured to perform collision detection on the MAC address block to be allocated in the registration message and the local MAC address of the second detecting module; when a conflict occurs, triggering the second sending module 1603;
the second sending module 1603 is configured to send a collision failure message to the to-be-allocated device; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
Illustratively, the message identifier in the conflict failure message and the message identifier in the registration message have a corresponding relationship.
In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Specifically, the computer program instructions corresponding to a local MAC address allocation method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to a local MAC address allocation method in the storage medium are read or executed by an electronic device, the method includes the following steps:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
carrying out conflict detection on the MAC address block to be distributed in the registration message and the local MAC address of the MAC address block;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
Optionally, the step of storing in the storage medium: and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
Example twelve
Based on the same technical concept of the foregoing embodiment, referring to fig. 17, which shows a specific hardware structure of a distributed device 160 provided by an embodiment of the present invention, the specific hardware structure may include: a second communication interface 1701, a second memory 1702, a second processor 1703 and a second bus 1704; wherein,
the second bus 1704 is used for connecting the second communication interface 1701, the second processor 1703 and the second memory 1702, and for intercommunication among these devices;
the second communication interface 1701 is configured to perform data transmission with an external network element;
the second memory 1702 for storing instructions and data;
the second processor 1703 executes the instructions to:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
carrying out conflict detection on the MAC address block to be distributed in the registration message and the local MAC address of the MAC address block;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
Illustratively, the message identifier in the conflict failure message and the message identifier in the registration message have a corresponding relationship.
EXAMPLE thirteen
Based on the same technical concept as the foregoing embodiment, referring to fig. 18, a network device 180 according to an embodiment of the present invention is shown, where the network device 180 includes: a third receiving module 1801, a forwarding module 1802, and an establishing module 1803; wherein,
the third receiving module 1801 is configured to receive a registration message sent by a device to be allocated; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the forwarding module 1802 is configured to determine whether to forward the registration message to other network devices in the network other than the device to be allocated according to a preset forwarding policy;
the third receiving module 1801 is configured to trigger the forwarding module 1802 when a collision failure message for the registration message is received; triggering the establishing module 1803 when receiving the declaration message; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the forwarding module 1802 is further configured to forward the collision failure message to the device to be allocated;
the establishing module 1803 is configured to establish a forwarding mapping relationship according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
Illustratively, the forwarding module 1802 is specifically configured to:
when the network device 180 is provided with an agent of the allocated device, performing conflict detection on the MAC address block to be allocated in the registration message and the MAC address of the allocated device proxied by the network device 180:
and, when a collision occurs, transmitting a corresponding collision failure message,
and when no conflict occurs, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
Illustratively, the forwarding module 1802 is specifically configured to:
when the network device 180 does not set the agent of the distribution device, the registration message is forwarded to other network devices in the network except the device to be distributed.
Specifically, the forwarding device 180 is specifically configured to establish a correspondence between a message identifier of a registration message and a receiving port after acquiring the receiving port for receiving the registration message; and the number of the first and second groups,
and sending the registration message through other ports except the receiving port.
Illustratively, the establishing module 1803 is configured to establish a forwarding mapping relationship between a receiving port that receives the declaration message and a MAC address that needs to be declared in the declaration message.
In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Specifically, the computer program instructions corresponding to a local MAC address allocation method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to a local MAC address allocation method in the storage medium are read or executed by an electronic device, the method includes the following steps:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
Optionally, the step of storing in the storage medium: determining whether to forward the registration message to other network devices except the device to be distributed in the network according to a preset forwarding policy, including:
when the network equipment is provided with an agent of the allocated equipment, the MAC address block to be allocated in the registration message and the MAC address of the allocated equipment of the network equipment agent are subjected to conflict detection:
when a collision occurs, a corresponding collision failure message is transmitted,
and when no conflict occurs, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
Optionally, the step of storing in the storage medium: determining whether to forward the registration message to other network devices except the device to be distributed in the network according to a preset forwarding policy, including:
and when the network equipment does not set the agent of the distribution equipment, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
Optionally, the step of storing in the storage medium: forwarding the registration message to other network devices except the device to be distributed in the network, including:
after a receiving port for receiving a registration message is obtained, establishing a corresponding relation between a message identifier of the registration message and the receiving port;
and sending the registration message through other ports except the receiving port.
Optionally, the step of storing in the storage medium: the establishing of the forwarding mapping relation according to the declaration message comprises the following steps:
establishing a forwarding mapping relationship between a receiving port receiving the declaration message and the MAC address declared in the declaration message.
Example fourteen
Based on the same technical concept of the foregoing embodiment, referring to fig. 19, which shows a specific hardware structure of a network device 180 provided in an embodiment of the present invention, the network device may include: a third communication interface 1901, a third memory 1902, a third processor 1903, and a third bus 1904; wherein,
the third bus 1904 is used for connecting the third communication interface 1901, the third processor 1903 and the third memory 1902, and for communicating with each other;
the third communication interface 1901 is configured to perform data transmission with an external network element;
the third memory 1902, for storing instructions and data;
the third processor 1903 executing the instructions to:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated; and the number of the first and second groups,
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy; and the number of the first and second groups,
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs; and the number of the first and second groups,
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
Illustratively, the third processor 1903 is specifically configured to: when the network equipment is provided with an agent of the allocated equipment, the MAC address block to be allocated in the registration message and the MAC address of the allocated equipment of the network equipment agent are subjected to conflict detection:
when a collision occurs, a corresponding collision failure message is transmitted,
and when no conflict occurs, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
Illustratively, the third processor 1903 is specifically configured to: and when the network equipment does not set the agent of the distribution equipment, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
Further specifically, the third processor 1903 is specifically configured to:
after a receiving port for receiving a registration message is obtained, establishing a corresponding relation between a message identifier of the registration message and the receiving port;
and sending the registration message through other ports except the receiving port.
Illustratively, the third processor 1903 is specifically configured to:
and establishing a forwarding mapping relation between a receiving port receiving the declaration message and the MAC address needing declaration in the declaration message.
Example fifteen
Based on the same technical concept as the foregoing embodiment, referring to fig. 20, it shows a structure of a database server 200 provided by an embodiment of the present invention, where 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 a device to be allocated; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the third detecting module 2002 is configured to perform collision detection on the MAC address to be allocated and the stored MAC address: wherein, the stored MAC address is the MAC address in the use state in the whole network;
and, when a conflict occurs, triggering the third sending module 2003;
the third sending module 2003, configured to send a collision failure message to the to-be-allocated device; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
Illustratively, referring to fig. 21, the database server 200 further includes: a saving module 2004, configured to, when the fourth receiving module 2001 receives a declaration message, save a MAC address that needs to be declared in the declaration message, and set a state of the MAC address that needs to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
In addition, each functional module in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the present embodiment essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Specifically, the computer program instructions corresponding to a local MAC address allocation method in the present embodiment may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to a local MAC address allocation method in the storage medium are read or executed by an electronic device, the method includes the following steps:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
and performing conflict detection on the MAC address to be allocated and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
Optionally, the step of storing in the storage medium: the method further comprises the following steps:
when the database server receives a declaration message, storing the MAC address to be declared in the declaration message, and setting the state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
Example sixteen
Based on the same technical concept of the foregoing embodiment, referring to fig. 22, it shows a hardware structure of a database server 200 provided by an embodiment of the present invention, which may include: a fourth communication interface 2201, a fourth memory 2202, a fourth processor 2203 and a fourth bus 2204; wherein,
the fourth bus 2204 is used for connecting the fourth communication interface 2201, the fourth processor 2203 and the fourth memory 2202 and for mutual communication among the devices;
the fourth communication interface 2201 is configured to perform data transmission with an external network element;
the fourth memory 2202 for storing instructions and data;
the fourth processor 2203 executes the instructions to:
receiving a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
and performing conflict detection on the MAC address to be allocated and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
In practical applications, the fourth Memory 2202 may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory) such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (HDD), or a Solid-State Drive (SSD); or a combination of the above types of memories and provides instructions and data to the fourth processor 2203.
The fourth Processor 2203 may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is to be understood that the electronic device for implementing the fourth processor function may be other devices, and the embodiment of the present invention is not limited in particular.
Illustratively, the fourth processor 2203 is further configured to:
when receiving declaration information, storing the MAC address needing declaration in the declaration information, and setting the state of the MAC address needing declaration to be a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
Example seventeen
Based on the same technical concept as the foregoing embodiment, referring to fig. 23, a local MAC address allocation system 230 provided in an embodiment of the present invention is shown, where the system 230 includes at least one device to be allocated 130, 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; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated 130 does not perceive 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the allocated device 180 is configured to receive a registration message sent by the device to be allocated 130; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which needs to be registered by the device to be allocated 130;
and carrying out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the MAC address block;
and when a conflict occurs, sending a conflict failure message to the device to be allocated 130; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device 180 is configured to receive a registration message sent by the device to be allocated 130; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which needs to be registered by the device to be allocated 130;
and determining whether to forward the registration message to other network devices except the device to be distributed 130 in the network according to a preset forwarding policy;
and when receiving a collision failure message for the registration message, forwarding the collision failure message to the device to be allocated 130; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
EXAMPLE eighteen
Based on the same technical concept as the foregoing embodiment, referring to fig. 24, it shows a local MAC address allocation system 240 provided in an embodiment of the present invention, where the system 240 includes: at least one device to be distributed 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; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated 130 does not perceive 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the database server 200 is configured to receive a registration message sent by the device to be allocated 130; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
and performing conflict detection on the MAC address to be allocated and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
and when a conflict occurs, sending a conflict failure message to the device to be allocated 130; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device 180 is configured to receive a registration message sent by the device to be allocated 130; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which needs to be registered by the device to be allocated 130;
and determining whether to forward the registration message to other network devices 180 except the device to be distributed 130 in the network according to a preset forwarding policy;
and when receiving a collision failure message for the registration message, forwarding the collision failure message to the device to be allocated 130; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention 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, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (29)

1. A method for assigning local media access control MAC addresses, the method comprising:
the equipment to be allocated sends a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
2. The method according to claim 1, wherein the device to be allocated does not perceive any conflict, specifically comprising:
when the device to be allocated transmits the registration message according to a preset interval period for a preset number of times, and does not receive a conflict failure message aiming at the registration message or a declaration message verified as an address conflict, determining that the device to be allocated does not sense the MAC address conflict to be allocated; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
3. The method of claim 1, further comprising: and when the equipment to be distributed perceives the conflict, the equipment to be distributed reselects the MAC address block to be distributed and retransmits the registration message.
4. The method of claim 1, further comprising:
when the device to be allocated receives declaration information sent by other devices, the device to be allocated performs conflict detection on the MAC address to be declared in the declaration information sent by other devices and the MAC address block to be allocated, which needs to be registered in the registration information, and determines whether a conflict occurs:
if conflict occurs, reselecting the MAC address block to be allocated, and replacing the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected MAC address block to be allocated;
if no conflict occurs, no processing is done.
5. The method according to claim 1, wherein the MAC address block to be allocated, which needs to be registered in the registration message, is obtained by selecting, by the device to be allocated, according to a preset selection policy.
6. A method for assigning local media access control MAC addresses, the method comprising:
the distributed equipment receives a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
the allocated equipment carries out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the allocated equipment;
when a conflict occurs, the distributed equipment sends a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
7. The method of claim 6, wherein the message identifier in the collision failure message and the message identifier in the registration message have a corresponding relationship.
8. A method for assigning local media access control MAC addresses, the method comprising:
the network equipment receives a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
the network equipment determines whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when the network equipment receives a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when the network equipment receives the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
9. The method according to claim 8, wherein the network device determines whether to forward the registration message to other network devices in the network other than the device to be distributed according to a preset forwarding policy, including:
when the network device is provided with an agent of the allocated device, the network device performs conflict detection on the MAC address block to be allocated in the registration message and the MAC address of the allocated device of the network device agent:
when a conflict occurs, the network device sends a corresponding conflict failure message,
and when no conflict occurs, the network equipment forwards the registration message to other network equipment except the equipment to be distributed in the network.
10. The method according to claim 8, wherein the network device determines whether to forward the registration message to other network devices in the network other than the device to be distributed according to a preset forwarding policy, including:
and when the network equipment does not set the proxy of the distribution equipment, the network equipment forwards the registration message to other network equipment except the equipment to be distributed in the network.
11. The method according to claim 9 or 10, wherein the network device forwards the registration message to other network devices in the network than the device to be distributed, including:
after the network equipment acquires a receiving port for receiving the registration message, establishing a corresponding relation between a message identifier of the registration message and the receiving port;
and sending the registration message through other ports except the receiving port.
12. The method of claim 8, wherein establishing a forwarding mapping from a declaration message comprises:
the network device establishes a forwarding mapping relationship between a receiving port receiving the declaration message and the MAC address declared in the declaration message.
13. A method for assigning local media access control MAC addresses, the method comprising:
a database server receives a registration message sent by equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the database server carries out conflict detection on the MAC address to be distributed and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, the database server sends a conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
14. The method of claim 12, further comprising:
when the database server receives a declaration message, storing the MAC address to be declared in the declaration message, and setting the state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
15. An apparatus to be dispensed, characterized in that it comprises: the device comprises a first sending module, a sensing module and a determining module; wherein,
the first sending module is used for sending a registration message of a local Media Access Control (MAC) address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the sensing module is used for sensing whether any conflict is sensed; when no conflict is sensed, triggering the determining module and the first sending module;
the determining module 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 is further configured to send a declaration message of the MAC address; wherein the declaration message includes: a message identifier for uniquely identifying the declaration message and a to-be-allocated MAC address block to be declared.
16. The apparatus to be allocated according to claim 15, wherein the sensing module is configured to determine that no MAC address collision is sensed when the first sending module sends the registration message according to a preset number of times according to a preset interval period and does not receive a collision failure message for the registration message or a declaration message that is verified as an address collision; wherein the collision failure message comprises: a message identifier for uniquely identifying the collision failure message and a MAC address block where a collision occurs; and the message identification in the conflict failure message and the message identification in the registration message have a corresponding relation.
17. An apparatus to be distributed according to claim 15, characterized in that it further comprises a selection module;
the sensing module is further used for triggering the selection module and the first sending module when a conflict is sensed;
the selection module is used for reselecting the MAC address block to be allocated;
the first sending module is further configured to resend the registration message.
18. An apparatus to be distributed according to claim 17, further comprising a first receiving module and a first detecting module;
the first receiving module is used for receiving declaration messages sent by other devices;
a first detection module, configured to perform collision detection on a MAC address that needs to be declared in a declaration message sent by another device and a MAC address block to be allocated that needs to be registered in the registration message, and determine whether a collision occurs: if a conflict occurs, triggering the selection module; if no conflict occurs, no processing is carried out;
the selection module is further configured to reselect the MAC address block to be allocated, and replace the original MAC address block to be allocated, which needs to be registered, in the registration message with the reselected MAC address block to be allocated.
19. An allocated apparatus, characterized in that the allocated apparatus comprises: the first receiving module, the first detecting module and the first sending module; wherein,
the second receiving module is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the second detection module is used for carrying out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the second detection module; when a conflict occurs, triggering the second sending module;
the second sending module is used for sending the conflict failure message to the equipment to be distributed; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
20. The allocated apparatus of claim 19, wherein the message identifier in the collision failure message and the message identifier in the registration message have a correspondence.
21. A network device, characterized in that the network device comprises: a third receiving module, a forwarding module and an establishing module; wherein,
the third receiving module is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: a message identifier for uniquely identifying the registration message and a MAC address block to be allocated, which is required to be registered by the device to be allocated;
the forwarding module is configured to determine whether to forward the registration message to other network devices in the network except the device to be allocated according to a preset forwarding policy;
the third receiving module is configured to trigger the forwarding module when receiving a collision failure message for the registration message; triggering the establishing module when receiving a declaration message; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the forwarding module is further configured to forward the conflict failure message to the device to be allocated;
the establishing module is used for establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
22. The network device of claim 21, wherein the forwarding module is specifically configured to:
when the network equipment is provided with an agent of the allocated equipment, the MAC address block to be allocated in the registration message and the MAC address of the allocated equipment of the network equipment agent are subjected to conflict detection:
and, when a collision occurs, transmitting a corresponding collision failure message,
and when no conflict occurs, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
23. The network device of claim 21, wherein the forwarding module is specifically configured to: and when the network equipment does not set the agent of the distribution equipment, forwarding the registration message to other network equipment except the equipment to be distributed in the network.
24. The network device of claim 22 or 23, wherein the forwarding module is configured to:
after a receiving port for receiving a registration message is obtained, establishing a corresponding relation between a message identifier of the registration message and the receiving port; and the number of the first and second groups,
and sending the registration message through other ports except the receiving port.
25. The network device of claim 21, wherein the establishing module is configured to establish a forwarding mapping relationship between a receiving port receiving the declaration message and a MAC address that needs to be declared in the declaration message.
26. A database server, comprising: a fourth receiving module, a third detecting module and a third sending module, wherein,
the fourth receiving module is configured to receive a registration message sent by a device to be allocated; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
the third detection module is configured to perform collision detection on the MAC address to be allocated and the stored MAC address: wherein, the stored MAC address is the MAC address in the use state in the whole network;
and, when a collision occurs, triggering the third sending module;
the third sending module is configured to send a collision failure message to the device to be allocated; wherein the collision failure message comprises a message identifier for uniquely identifying the collision failure message and a MAC address block where collision occurs.
27. The database server of claim 26, wherein the database server further comprises: a storing module, configured to store, when the fourth receiving module receives a declaration message, a MAC address to be declared in the declaration message, and set a state of the MAC address to be declared as a use state; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
28. A local media access control, MAC, address assignment system, the system comprising at least one device to be assigned, at least one assigned device, and at least one network device; wherein,
the equipment to be allocated is used for sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the allocated device is used for receiving the registration message sent by the device to be allocated; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
and carrying out conflict detection on the MAC address block to be allocated in the registration message and the local MAC address of the MAC address block;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device is used for receiving the registration message sent by the device to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
29. A local Media Access Control (MAC) address distribution system is characterized by comprising at least one device to be distributed, at least one database server and at least one network device; wherein,
the equipment to be allocated is used for sending a registration message of a local MAC address; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
when the device to be allocated does not sense any conflict, 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 declaration message includes: the message identification is used for uniquely identifying the declaration message and the MAC address block to be allocated which needs declaration;
the database server is used for receiving a registration message sent by the equipment to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered;
and performing conflict detection on the MAC address to be allocated and the stored MAC address: wherein, the saved MAC address is the MAC address in the use state in the whole network;
when a conflict occurs, sending a conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
the network device is used for receiving the registration message sent by the device to be distributed; wherein the registration message comprises: the message identifier is used for uniquely identifying the registration message and the MAC address block to be allocated, which needs to be registered by the equipment to be allocated;
determining whether to forward the registration message to other network equipment except the equipment to be distributed in the network according to a preset forwarding strategy;
when receiving a conflict failure message aiming at the registration message, forwarding the conflict failure message to the equipment to be distributed; wherein the conflict failure message comprises a message identifier for uniquely identifying the conflict failure message and a MAC address block where a conflict occurs;
when receiving the declaration message, establishing a forwarding mapping relation according to the declaration message; wherein the declaration message comprises a message identification for uniquely identifying the declaration message and a MAC address to be declared.
CN201710144446.5A 2017-03-10 2017-03-10 A kind of distribution method, equipment and the system of local media accessing to control address Pending CN108574743A (en)

Priority Applications (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
PCT/CN2018/078624 WO2018161967A1 (en) 2017-03-10 2018-03-09 Method, equipment and system for allocating local media access control address

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN108574743A true CN108574743A (en) 2018-09-25

Family

ID=63447228

Family Applications (1)

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

Country Status (2)

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

Families Citing this family (1)

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

Citations (5)

* 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
CN102333134A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Medium/media access control address conflict detection method, device and system
CN102333013A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Method, device and system for detecting medium access control (MAC) address conflicts
CN102333133A (en) * 2011-10-11 2012-01-25 中兴通讯股份有限公司 Medium access control (MAC) address distribution 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102340555B (en) * 2011-10-18 2014-04-09 中兴通讯股份有限公司 Medium/media access control address allocation method, device and system

Patent Citations (5)

* 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
CN102333133A (en) * 2011-10-11 2012-01-25 中兴通讯股份有限公司 Medium access control (MAC) address distribution method, device and system
CN102333134A (en) * 2011-10-17 2012-01-25 中兴通讯股份有限公司 Medium/media access control address conflict detection method, device and system
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

Also Published As

Publication number Publication date
WO2018161967A1 (en) 2018-09-13

Similar Documents

Publication Publication Date Title
CN101663878B (en) Extensions to ipv6 neighbor discovery protocol for automated prefix delegation
US7826462B2 (en) Address assignment apparatus, address assignment method, and computer product
CN108777722B (en) Multi-system networking communication method, device, mobile terminal and storage medium
US8264985B2 (en) Locally unique node port identifiers
US8478891B1 (en) Employing socket ranges to ascertain layer 2 addresses
CN104604193B (en) Method and device for automatic management of network infrastructure with virtual device environment function
US20150113168A1 (en) Network Bridging
CN104753697A (en) Method, equipment and system for controlling provisioning of network equipment
US10382391B2 (en) Systems and methods for managing network address information
US11606332B1 (en) Duplicate address detection for ranges of global IP addresses
EP2458825A1 (en) Method of creating a functional arrangement of a wireless mesh network of communication devices with packet message transmission and routing packet message transmission in such a network
CN107087041B (en) Method and device for statically binding IP address to DHCP client
CN105722040B (en) Method, device and system for transmitting business messages
CN104812021A (en) Method and device for accessing AC (access controller) by AP (access point)
CN111245974B (en) Address allocation method, device, equipment and storage medium
CN100479613C (en) Method for mark setting of the remote device and allocation of the communication address
CN108574743A (en) A kind of distribution method, equipment and the system of local media accessing to control address
CN108989173B (en) Message transmission method and device
US20250300962A1 (en) Address configuration method and electronic device
US9571448B2 (en) Address assignment protocol
CN108712522B (en) IP address allocation method and device
WO2015008541A1 (en) Communication device, communication method, and program
CN103581171B (en) A kind of file transmitting method and device
CN112911026A (en) Address application method, device and equipment
CN107547395B (en) Message transmission method and device and machine-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180925

RJ01 Rejection of invention patent application after publication