CN102355510B - Medium/media access control (MAC) address allocation method, device and system - Google Patents
Medium/media access control (MAC) address allocation method, device and system Download PDFInfo
- Publication number
- CN102355510B CN102355510B CN201110316181.5A CN201110316181A CN102355510B CN 102355510 B CN102355510 B CN 102355510B CN 201110316181 A CN201110316181 A CN 201110316181A CN 102355510 B CN102355510 B CN 102355510B
- Authority
- CN
- China
- Prior art keywords
- mac address
- router
- request message
- sending
- network 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.)
- Active
Links
Landscapes
- Small-Scale Networks (AREA)
Abstract
The invention provides a medium/media access control (MAC) address allocation method, which comprises the following steps that: before accessing a network, network equipment sends an MAC address request message to a multicast address of a router, wherein the MAC address request message carries a current MAC address of the network equipment; the router receiving the MAC address request message judges whether an allocable MAC address exists locally; if the allocable MAC address does not exist, the router sends a request message for acquiring an MAC address to a server; the server allocates the MAC address according to the received request message and sends the MAC address to the router; the router sends the received MAC address to the network equipment; and the network equipment receives the MAC address. The invention also discloses an MAC address allocation device and an MAC address allocation system. By the invention, the MAC address can be allocated automatically according to a request of the network equipment in an access network; and therefore, a conflict of the MAC address can be avoided.
Description
Technical Field
The present invention relates to an ethernet access technology, and in particular, to a method, an apparatus, and a system for allocating Medium/Media Access Control (MAC) addresses.
Background
At present, the Internet is an Internet Protocol Version 6 (IPv 6) network, and with the development of network technologies such as smart cities, electronic earth, Internet of things, etc., the demand of people for accessing the IPv6 network at any time and any place is continuously expanding, and various wired and wireless network devices are continuously accessed into the IPv6 network. Moreover, with the development of virtualization technology, virtual network devices are also continuously added to the IPv6 network. However, the MAC address of the existing network device is a 48-bit address generated by random solidification at the time of shipment, and thus is not changeable. As such, as the number of network devices accessing the two-layer switching network increases, the probability that different network devices have the same MAC address increases, which may result in MAC address collision.
Because the packet forwarding of the layer two switch is realized based on the MAC address, when the MAC address conflicts exist in the layer two switch network, the MAC forwarding table may oscillate, which may cause the layer two switch to mistakenly send the service response interaction message, the service access message, and other messages, which may further cause the network device with the MAC address conflicts to fail to normally access the network, and may not provide the network service for the user.
In addition, since the message of network interaction can be guided to other devices with conflicting MACs by the layer two switch, not only the risk of leakage of network secret information is caused, but also the risk of network attack is caused to be guided to an unexpected network device or virtual device, thereby bringing about the risk of network attack.
Disclosure of Invention
In view of this, the main objective of the present invention is to provide a method, an apparatus, and a system for allocating MAC addresses, which can avoid occurrence of MAC address collision, thereby ensuring normal access of network devices to a network, providing normal network services for users, and reducing risk of network attacks.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention discloses a Media Access Control (MAC) address allocation method, which comprises the following steps:
before accessing a network, a network device sends an MAC address request message to a multicast address of a router, wherein the MAC address request message carries a current MAC address of the network device;
the router receiving the MAC address request message judges whether a distributable MAC address exists locally, and when the distributable MAC address does not exist, the router sends a request message for acquiring the MAC address to a server;
the server distributes an MAC address according to the received request message and sends the MAC address to the router;
the router sends the received MAC address to a network device, and the network device receives the assigned MAC address.
Preferably, the sending, by the router, the request message for acquiring the MAC address to the server is:
the router sends a request message SOLICIT for acquiring the MAC address to the server through an IPv6 transmission control message protocol DHCPv 6;
the server allocates a MAC address according to the received request message, and sends the MAC address to the router:
the server distributes the MAC address according to the received SOLICIT, places the MAC address in a notification response ADVERTISE and sends the MAC address to the router through a DHCPv6 protocol;
the router sends the received MAC address to the network equipment, and the network equipment receives the allocated MAC address as follows:
the router extracts the MAC address from the ADVERTISE received through the DHCPv6 protocol and sends the MAC address to the network equipment.
Preferably, the sending to the network device is:
and placing the MAC address in an MAC address allocation response message, and sending the MAC address allocation response message to a multicast address generated according to the MAC address in the MAC address request message.
Preferably, after determining whether there is an allocatable MAC address locally, the method further includes:
and if the assignable MAC address exists, assigning the MAC address and sending the MAC address to the network equipment.
Preferably, the router multicast address is all router multicast address FF02:: 2.
Preferably, after the network device receives the MAC address, the method further includes:
before accessing a network, network equipment sends an MAC address conflict detection request message to a multicast address, wherein the MAC address conflict detection request message carries an allocated MAC address;
the target network equipment receiving the MAC address conflict detection request message extracts and detects the MAC address from the MAC address conflict detection request message, and sends an MAC address conflict detection response message to the multicast address when judging that the extracted MAC address is the same as the MAC address of the target network equipment;
and after receiving the MAC address conflict detection response message, the network equipment sends an MAC address request message to the multicast address of the router.
Preferably, after the network device receives the MAC address collision detection response packet, the method further includes:
the network equipment sends an MAC address conflict notification message to the router, wherein the notification message carries the distributed MAC address;
the router sets the MAC address in the received MAC address conflict notification message as temporarily unavailable, and sends an MAC address conflict response message;
and after receiving the MAC address conflict response message, the network equipment sends an MAC address request message to the multicast address of the router.
Preferably, the MAC address collision detection request message and the MAC address collision detection response message are respectively placed in an extended ICMPv6 message or an extended ICMPv6 option.
The invention discloses a network device, which comprises: the MAC address request message sending unit and the MAC address receiving unit; wherein,
the MAC address request message sending unit is configured to send an MAC address request message to a multicast address of a router before accessing a network, where the MAC address request message carries a current MAC address of the network device;
the MAC address receiving unit is used for receiving the MAC address sent by the router.
Preferably, the network device further includes: the device comprises an MAC address conflict detection request message sending unit, a multicast address conflict detection unit and a control unit, wherein the MAC address conflict detection request message sending unit is used for sending an MAC address conflict detection request message to a multicast address before accessing a network, and the MAC address conflict detection request message carries an allocated MAC address;
the MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision detection response message, where the request message carries a current MAC address of the network device.
Preferably, the network device further includes: the MAC address conflict notification message sending unit is used for sending an MAC address conflict notification message to the router after receiving the response message, wherein the MAC address conflict notification message carries the allocated MAC address;
the MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision response message, where the MAC address request message carries a current MAC address of the network device.
The invention discloses a router, which comprises: the device comprises a resource judging unit, a request message sending unit and an MAC address sending unit; wherein,
the resource judging unit is used for judging whether the router has an assignable MAC address after receiving the MAC address request message;
the request message sending unit is used for sending a request message for acquiring the MAC address to the server when the router to which the router belongs does not have the assignable MAC address;
the MAC address sending unit is configured to send the received MAC address to the network device.
Preferably, the request message sending unit is specifically configured to send a request message SOLICIT for acquiring a MAC address to the server through a DHCPv6 protocol;
the MAC address sending unit is specifically configured to extract a MAC address from the ADVERTISE received through the DHCPv6 protocol, and send the MAC address to the network device.
Preferably, the router further includes: and the MAC address setting unit is used for setting the MAC address in the received MAC address conflict notification message as temporarily unavailable and sending an MAC address conflict response message.
The invention discloses a server, which comprises: an MAC address allocation unit and an MAC address transmission unit; wherein,
the MAC address allocation unit is used for allocating MAC addresses according to the received request messages;
and the MAC address sending unit is used for sending the allocated MAC address to the router.
Preferably, the MAC address allocating unit is specifically configured to allocate a MAC address according to the received SOLICIT;
the MAC address sending unit is specifically configured to place the allocated MAC address in a notification response ADVERTISE and send the notification response ADVERTISE to the router through a DHCPv6 protocol.
The invention discloses a network device, which comprises: the MAC address extracting unit, the detecting unit and the MAC address conflict detection response message sending unit; wherein,
the MAC address extracting unit is used for extracting an MAC address from the received MAC address conflict detection request message;
the detection unit is used for detecting the extracted MAC address and judging whether the extracted MAC address is the same as the MAC address of the detection unit;
and the MAC address conflict detection response message sending unit is used for sending an MAC address conflict detection response message to the multicast address when the extracted MAC address is the same as the MAC address of the multicast address.
The invention discloses a MAC address distribution system, which comprises: network devices, routers, and servers; wherein,
the network equipment is used for sending an MAC address request message to a router multicast address before accessing a network, wherein the MAC address request message carries the current MAC address of the network equipment; receiving the MAC address sent by the router;
the router is used for judging whether a distributable MAC address exists locally according to the MAC address request message sent by the network equipment, and sending a request message for acquiring the MAC address to the server when the distributable MAC address does not exist; sending the MAC address sent by the server to the network equipment;
and the server is used for allocating the MAC address according to the request message sent by the router and sending the MAC address to the router.
In view of the above, according to the MAC address allocation method, apparatus, and system provided by the present invention, before accessing a network, a network device sends an MAC address request packet to a router multicast address, where the MAC address request packet carries a current MAC address of the network device; the router receiving the MAC address request message judges whether a distributable MAC address exists locally, and when the distributable MAC address does not exist, the router sends a request message for acquiring the MAC address to a server; the server distributes an MAC address according to the received request message and sends the MAC address to the router; the router sends the received MAC address to the network device, which receives and uses the assigned MAC address. By adopting the technical scheme, the MAC address can be automatically allocated according to the request of the network equipment accessed into the network, so that the condition of MAC address conflict is avoided, the normal access of the network equipment to the network is further ensured, the normal network service is provided for users, and the risk of network attack is reduced.
Drawings
FIG. 1 is a schematic diagram of a router according to the present invention;
FIG. 2 is a schematic diagram of a network device according to the present invention;
FIG. 3 is a schematic diagram of a MAC address assignment system according to the present invention;
fig. 4 is a schematic flow chart illustrating an implementation of the MAC address allocation method according to the first embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating an implementation of a MAC address allocation method according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of an application scenario for accessing an IPv6 network.
Detailed Description
The invention discloses a network device as network access initiating side, which comprises: the MAC address request message sending unit and the MAC address receiving unit; wherein,
the MAC address request message sending unit is configured to send an MAC address request message to a multicast address of a router before accessing a network, where the MAC address request message carries a current MAC address of the network device;
the MAC address receiving unit is used for receiving the MAC address sent by the router.
Optionally, the network device further includes: the device comprises an MAC address conflict detection request message sending unit, a multicast address conflict detection unit and a control unit, wherein the MAC address conflict detection request message sending unit is used for sending an MAC address conflict detection request message to a multicast address before accessing a network, and the MAC address conflict detection request message carries an allocated MAC address;
the MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision detection response message, where the request message carries a current MAC address of the network device.
Optionally, the network device further includes: and the MAC address conflict notification message sending unit is used for sending an MAC address conflict notification message to the router after receiving the response message, wherein the MAC address conflict notification message carries the allocated MAC address.
The MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision response message, where the MAC address request message carries a current MAC address of the network device.
The present invention discloses a router, as shown in fig. 1, the router includes: the device comprises a resource judging unit, a request message sending unit and an MAC address sending unit; wherein,
the resource judging unit is used for judging whether the router has an assignable MAC address after receiving the MAC address request message;
the request message sending unit is used for sending a request message for acquiring the MAC address to the server when the router to which the router belongs does not have the assignable MAC address;
the MAC address sending unit is configured to send the received MAC address to the network device.
Preferably, the request Message sending unit is specifically configured to send a request Message SOLICIT for acquiring a MAC address to a server through an IPv6 transmission Control Message Protocol (Internet Control Message Protocol for IPv6, ICMPv 6);
the MAC address sending unit is specifically configured to extract a MAC address from the ADVERTISE received through the DHCPv6 protocol, and send the MAC address to the network device.
Optionally, the router further includes:
and the MAC address setting is used for setting the MAC address in the received MAC address conflict notification message as temporarily unavailable and sending an MAC address conflict response message.
The invention discloses a server, which comprises: an MAC address allocation unit and an MAC address transmission unit; wherein,
the MAC address allocation unit is used for allocating MAC addresses according to the received request messages;
and the MAC address sending unit is used for sending the allocated MAC address to the router.
Preferably, the MAC address allocating unit is specifically configured to allocate a MAC address according to the received SOLICIT;
the MAC address sending unit is specifically configured to place the allocated MAC address in a notification response ADVERTISE and send the notification response ADVERTISE to the router through a DHCPv6 protocol.
The present invention also discloses a network device as a network access response side, as shown in fig. 2, the network device includes:
the MAC address extracting unit is used for extracting the MAC address from the received MAC address conflict detection request message;
the detection unit is used for detecting the extracted MAC address and judging whether the extracted MAC address is the same as the MAC address of the detection unit;
and the MAC address conflict detection response message sending unit is used for sending an MAC address conflict detection response message to the multicast address when the extracted MAC address is the same as the MAC address of the multicast address.
The present invention discloses a MAC address allocation system, as shown in fig. 3, the system includes: network devices, routers, and servers; wherein,
the network equipment is used for sending an MAC address request message to a router multicast address before accessing a network, wherein the MAC address request message carries the current MAC address of the network equipment; receiving the MAC address sent by the router;
the router is used for judging whether a distributable MAC address exists locally according to the MAC address request message sent by the network equipment, and sending a request message for acquiring the MAC address to the server when the distributable MAC address does not exist; sending the MAC address sent by the server to the network equipment;
and the server is used for allocating the MAC address according to the request message sent by the router and sending the MAC address to the router.
Based on the above device and system, the following describes a first embodiment of the MAC address assignment method of the present invention, as shown in fig. 4, the method includes:
step 401, before accessing a network, a network device sends an MAC address request message to a multicast address of a router, wherein the MAC address request message carries a current MAC address of the network device;
here, the router multicast address is all router multicast address FF02:: 2.
Step 402, the router receiving the MAC address request message judges whether a distributable MAC address exists locally, and when the distributable MAC address does not exist, the router sends a request message for acquiring the MAC address to a server;
specifically, the router sends a request message SOLICIT for acquiring the MAC address to the server through the DHCPv6 protocol.
Step 403, the server allocates a MAC address according to the received request message, and sends the MAC address to the router;
specifically, the server allocates a MAC address according to the received SOLICIT, and places the MAC address in a notification response ADVERTISE, and sends the notification response ADVERTISE to the router through a DHCPv6 protocol.
Step 404, the router sends the received MAC address to a network device, and the network device receives the assigned MAC address.
Specifically, the router extracts the MAC address from the ADVERTISE received through the DHCPv6 protocol, places the MAC address in a MAC address allocation response message, and sends the MAC address allocation response message to the multicast address generated according to the MAC address in the MAC address request message.
Further, the network device uses the assigned MAC address to complete subsequent operations.
Optionally, after determining whether there is an allocatable MAC address locally, the method further includes:
and if the assignable MAC address exists, assigning the MAC address and sending the MAC address to the network equipment.
Therefore, by adopting the technical scheme, the MAC address can be automatically allocated according to the request of the network equipment accessing the IPv6 network, so that the condition of MAC address conflict is avoided.
Optionally, after the router extracts the MAC address from the ADVERTISE received through the DHCPv6 protocol, the method further includes:
the router selects an ADVERTISE with an MAC address and meeting the set requirement; sending a REQUEST to a server sending the ADVERTISE;
the server places the received MAC address in a REPLY response REPLY according to the received REQUEST and sends the MAC address to the router through a DHCPv6 protocol;
the router receives the REPLY and extracts the MAC address therefrom.
Therefore, the router extracts the MAC address from the ADVERTISE and the REPLY once in sequence, so that the router can compare and check the extracted MAC address according to actual needs to ensure the accuracy of the acquired MAC address.
Optionally, before the router sends the MAC address to the network device, the router further determines a validity period of the MAC address, and sends the MAC address and the validity period of the MAC address to the network device.
Therefore, the MAC address used by the network equipment has the validity period, and if the use time of the MAC address exceeds the validity period, the MAC address is invalid, so that the cyclic utilization efficiency of the MAC address can be improved.
If the MAC address needs to be continuously used after the validity period of the MAC address is reached, the network equipment sends a validity period continuation request RENEW/REBIND to the router through a DHCPv6 protocol before the validity period expires, wherein the request carries the MAC address. And the router sends the validity period of the MAC address to the network equipment through the DHCPv6 protocol according to the received RENEW/REBIND.
By adopting the technical scheme, the failure of the MAC address can be avoided when the network equipment is accessed into the IPv6 network, so that the network equipment can be normally connected with the network.
Further, when the network device goes offline, the network device sends a request RELEASE for releasing the MAC address to the router through the DHCPv6 protocol, where the request carries the MAC address; the router marks the MAC address as available according to the received RELEASE and informs the network equipment that the MAC address is invalid.
Therefore, by adopting the technical scheme, the MAC address can be prevented from being occupied when the network equipment disconnects the IPv6 network, and the cyclic utilization efficiency of the MAC address can be further improved.
Based on the above device and system, the following describes a second embodiment of the MAC address assignment method of the present invention, and compared with the first embodiment, this embodiment includes a step of detecting MAC address collision, as shown in fig. 5, and the method includes:
step 501, before accessing a network, a network device sends an MAC address request message to a multicast address of a router, wherein the MAC address request message carries a current MAC address of the network device;
step 502, the router receiving the MAC address request message judges whether a distributable MAC address exists locally, and if the distributable MAC address does not exist, step 503 is executed; if there are assignable MAC addresses, step 514 is entered.
Step 503, the router sends a request message for acquiring the MAC address to the server;
step 504, the server allocates the MAC address according to the received request message, and sends the MAC address to the router.
And 505, the router sends the received MAC address to a network device, and the network device receives the MAC address.
Step 506, before accessing the network, the network device sends a MAC address collision detection request message to the multicast address, wherein the MAC address collision detection request message carries the allocated MAC address;
here, the MAC address collision detection request message is placed in an extended ICMPv6 message or an extended ICMPv6 option; the last 24 bits of the multicast address are the last 24 bits of the current MAC address of the network device. Therefore, the online network equipment with the last 24 bits of the MAC address of the online network equipment and the last 24 bits of the current MAC address of the network equipment receive the MAC address conflict detection request message, and the missed detection is avoided.
Step 507, the target network device receiving the MAC address collision detection request message extracts the MAC address from the request message.
Step 508, the target network device detects the extracted MAC address, determines whether the extracted MAC address is the same as its own MAC address, and if so, proceeds to step 509; if not, step 515 is entered.
Step 509, the target network device sends a MAC address collision detection response message to the multicast address.
Here, the MAC address collision detection response message is placed in an extended ICMPv6 message or an extended ICMPv6 option; the last 24 bits of the multicast address are the last 24 bits of the MAC address in the MAC address collision detection request message. Therefore, the online network equipment with the same last 24 bits of the MAC address in the MAC address conflict detection request message and the last 24 bits of the MAC address in the MAC address conflict detection request message can receive the MAC address conflict detection response message, and the network equipment which sends the MAC address conflict detection request message can not receive the MAC address conflict detection response message due to the existence of the MAC address conflict.
Step 510, the network device judges whether a response message is received within a preset time, and if the response message is received, the step 511 is entered; if no response message is received, step 516 is entered.
Step 511, the network device sends an MAC address conflict notification message to the router according to the received MAC address conflict detection response message, where the notification message carries the assigned MAC address;
step 512, the router sets the MAC address in the received MAC address collision notification message as temporarily unavailable, and sends out a MAC address collision response message.
As can be seen from the above, setting the MAC address in the MAC address collision notification message as temporarily unavailable can prevent the router from reassigning the MAC to other network devices in subsequent operations.
Step 513, the network device receives the MAC address collision response packet, and returns to step 501.
Step 514, allocating a MAC address and sending the MAC address to network equipment; the network device receives the assigned MAC address and returns to step 506.
Step 515, the target network device does not respond and returns to step 510.
Step 516, the network device accesses the network by using the current MAC address, and ends the process.
Therefore, by adopting the technical scheme, the MAC address allocation and the conflict detection can be repeatedly carried out until the MAC address of the network equipment is not in conflict with the MAC addresses of other online network equipment, and the condition of MAC address conflict is effectively avoided.
Optionally, the functions in steps 510 to 513 may also be implemented by the following steps, where the network device sends an MAC address request message to a router multicast address according to the received MAC address collision detection response message before accessing the network, where the MAC address request message carries the current MAC address of the network device and the assigned MAC address; and the router receiving the MAC address request message sets the MAC address allocated in the MAC address request message as temporarily unavailable.
The present invention can be applied to the scenario of accessing the IPv6 network, as shown in fig. 6, the subnet 1 is directly connected to the aggregation router through the two-layer switch 1; the subnet 2 is connected with the two-layer switch 2, the two-layer switch 2 is connected with the router, and the router is connected with the aggregation router. The network device 1 is a network device ready for accessing a network, the preset MAC address is 00-1C-AC-73-63-a0, and the rest of the network devices are online network devices. In this example, the server is located in the aggregation router.
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 (14)
1. A method for media access control, MAC, address assignment, the method comprising:
before accessing a network, a network device sends an MAC address request message to a multicast address of a router, wherein the MAC address request message carries a current MAC address of the network device;
the router receiving the MAC address request message judges whether a distributable MAC address exists locally, if so, the router distributes the MAC address and sends the MAC address to network equipment;
when the distributable MAC address does not exist, the router sends a request message for acquiring the MAC address to the server;
the server distributes an MAC address according to the received request message and sends the MAC address to the router;
the router sends a request message with the MAC address to the server, extracts the MAC address in a reply response message of the server for comparison and verification, and sends the received MAC address to network equipment after the verification is passed, and the network equipment receives the distributed MAC address;
before the router sends the MAC address to the network equipment, the validity period of the MAC address is also determined, and the validity period of the MAC address is sent to the network equipment.
2. The method of claim 1, wherein the router sends the request message for obtaining the MAC address to the server as:
the router sends a request message SOLICIT for acquiring the MAC address to the server through an IPv6 transmission control message protocol DHCPv 6;
the server allocates a MAC address according to the received request message, and sends the MAC address to the router:
the server distributes the MAC address according to the received SOLICIT, places the MAC address in a notification response ADVERTISE and sends the MAC address to the router through a DHCPv6 protocol;
the router sends the received MAC address to the network equipment, and the network equipment receives the allocated MAC address as follows:
the router extracts the MAC address from the ADVERTISE received through the DHCPv6 protocol and sends the MAC address to the network equipment.
3. The method of claim 2, wherein the sending to the network device is:
and placing the MAC address in an MAC address allocation response message, and sending the MAC address allocation response message to a multicast address generated according to the MAC address in the MAC address request message.
4. The method of claim 1, wherein the router multicast address is all router multicast addresses FF02:: 2.
5. The method of claim 1, wherein after the network device receives the MAC address, the method further comprises:
before accessing a network, network equipment sends an MAC address conflict detection request message to a multicast address, wherein the MAC address conflict detection request message carries an allocated MAC address;
the target network equipment receiving the MAC address conflict detection request message extracts and detects the MAC address from the MAC address conflict detection request message, and sends an MAC address conflict detection response message to the multicast address when judging that the extracted MAC address is the same as the MAC address of the target network equipment;
and after receiving the MAC address conflict detection response message, the network equipment sends an MAC address request message to the multicast address of the router.
6. The method of claim 5, wherein after the network device receives the MAC address collision detection response message, the method further comprises:
the network equipment sends an MAC address conflict notification message to the router, wherein the notification message carries the distributed MAC address;
the router sets the MAC address in the received MAC address conflict notification message as temporarily unavailable, and sends an MAC address conflict response message;
and after receiving the MAC address conflict response message, the network equipment sends an MAC address request message to the multicast address of the router.
7. The method of claim 5, wherein the MAC address collision detection request message and the MAC address collision detection response message are placed in an extended ICMPv6 message or an extended ICMPv6 option, respectively.
8. A network device, characterized in that the network device comprises: the MAC address request message sending unit and the MAC address receiving unit; wherein,
the MAC address request message sending unit is configured to send an MAC address request message to a multicast address of a router before accessing a network, where the MAC address request message carries a current MAC address of the network device;
the MAC address receiving unit is used for receiving the MAC address sent by the router and the validity period of the MAC address; wherein,
the MAC address sent by the router is the allocated MAC address when the router determines that the allocable MAC address exists locally; when the situation that the allocable MAC address does not exist locally is determined, sending a request message for obtaining the MAC address to a server, receiving the MAC address allocated by the server, then sending the request message with the MAC address allocated by the server to the server, extracting the MAC address in the reply response message of the server, and carrying out comparison and verification on the MAC address;
a validity period continuation request sending unit, configured to send a validity period continuation request RENEW/RENEW to the router through a DHCPv6 protocol before the validity period expires when the MAC address needs to be continuously used after reaching the validity period of the MAC address, where the request carries the MAC address.
9. The network device of claim 8, further comprising: the device comprises an MAC address conflict detection request message sending unit, a multicast address conflict detection unit and a control unit, wherein the MAC address conflict detection request message sending unit is used for sending an MAC address conflict detection request message to a multicast address before accessing a network, and the MAC address conflict detection request message carries an allocated MAC address;
the MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision detection response message, where the request message carries a current MAC address of the network device.
10. The network device of claim 9, further comprising: the MAC address conflict notification message sending unit is used for sending an MAC address conflict notification message to the router after receiving the response message, wherein the MAC address conflict notification message carries the allocated MAC address;
the MAC address request message sending unit is further configured to send an MAC address request message to a router multicast address after receiving an MAC address collision response message, where the MAC address request message carries a current MAC address of the network device.
11. A router, characterized in that the router comprises: the device comprises a resource judging unit, a request message sending unit and an MAC address sending unit; wherein,
the resource judging unit is used for judging whether the router has an assignable MAC address after receiving the MAC address request message;
the request message sending unit is used for sending a request message for acquiring the MAC address to a server when the router does not have the assignable MAC address, and sending the request message with the MAC address to the server when the allocated MAC address of the server is received;
the MAC address sending unit is used for allocating an MAC address and sending the MAC address to the network equipment when the router has the allocatable MAC address, and comparing and checking the MAC address in the reply response message of the server extracted twice when the router does not have the allocatable MAC address, and sending the received MAC address to the network equipment after the checking is passed;
and the validity period sending unit is used for determining the validity period of the MAC address before sending the MAC address to the network equipment and sending the validity period of the MAC address to the network equipment.
12. The router according to claim 11,
the request message sending unit is specifically configured to send a request message SOLICIT for acquiring the MAC address to the server through a DHCPv6 protocol;
the MAC address sending unit is specifically configured to extract a MAC address from the ADVERTISE received through the DHCPv6 protocol, and send the MAC address to the network device.
13. The router of claim 11, further comprising:
and the MAC address setting unit is used for setting the MAC address in the received MAC address conflict notification message as temporarily unavailable and sending an MAC address conflict response message.
14. A MAC address assignment system, the system comprising: network devices, routers, and servers; wherein,
the network equipment is used for sending an MAC address request message to a router multicast address before accessing a network, wherein the MAC address request message carries the current MAC address of the network equipment; receiving the MAC address sent by the router; when the MAC address needs to be continuously used after the validity period of the MAC address is reached, sending a validity period continuation request RENEW/REBIND to a router through a DHCPv6 protocol before the validity period is expired, wherein the request carries the MAC address;
the router is used for judging whether a distributable MAC address exists locally according to the MAC address request message sent by the network equipment, and if the distributable MAC address exists, the router distributes the MAC address and sends the MAC address to the network equipment;
sending a request message for acquiring the MAC address to a server when the distributable MAC address does not exist; when the MAC address distributed by the server is received, sending a request message with the MAC address to the server, extracting the MAC address in a reply response message of the server, carrying out comparison and verification, and sending the MAC address sent by the server to network equipment after the verification is passed; before the MAC address is sent to the network equipment, the validity period of the MAC address is also determined, and the validity period of the MAC address is sent to the network equipment;
and the server is used for allocating the MAC address according to the request message sent by the router and sending the MAC address to the router.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110316181.5A CN102355510B (en) | 2011-10-17 | 2011-10-17 | Medium/media access control (MAC) address allocation method, device and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110316181.5A CN102355510B (en) | 2011-10-17 | 2011-10-17 | Medium/media access control (MAC) address allocation method, device and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102355510A CN102355510A (en) | 2012-02-15 |
CN102355510B true CN102355510B (en) | 2014-08-20 |
Family
ID=45579003
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110316181.5A Active CN102355510B (en) | 2011-10-17 | 2011-10-17 | Medium/media access control (MAC) address allocation method, device and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102355510B (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103327130B (en) * | 2012-03-22 | 2017-07-07 | 中兴通讯股份有限公司 | Method, terminal and system that MAC Address is multiplexed |
CN103701943B (en) * | 2012-09-27 | 2018-07-27 | 南京中兴新软件有限责任公司 | The control method and device of MAC Address |
CN103841028B (en) * | 2014-03-24 | 2017-02-08 | 杭州华三通信技术有限公司 | Method and device for forwarding messages |
CN104079686B (en) * | 2014-07-17 | 2017-11-21 | 福州瑞芯微电子股份有限公司 | The method to set up and distribution method of terminal device MAC Address |
CN108023972A (en) * | 2016-11-04 | 2018-05-11 | 中兴通讯股份有限公司 | Distribute the method, apparatus and system of MAC Address |
CN108574743A (en) * | 2017-03-10 | 2018-09-25 | 中兴通讯股份有限公司 | A kind of distribution method, equipment and the system of local media accessing to control address |
CN112543386B (en) * | 2019-09-20 | 2022-04-15 | 中国移动通信有限公司研究院 | Address acquisition method and related equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101291350A (en) * | 2008-06-02 | 2008-10-22 | 中兴通讯股份有限公司 | Processing method and device for address collision of media access control |
CN101707637A (en) * | 2009-11-27 | 2010-05-12 | 中兴通讯股份有限公司 | Method and system for allocating IP address |
-
2011
- 2011-10-17 CN CN201110316181.5A patent/CN102355510B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101291350A (en) * | 2008-06-02 | 2008-10-22 | 中兴通讯股份有限公司 | Processing method and device for address collision of media access control |
CN101707637A (en) * | 2009-11-27 | 2010-05-12 | 中兴通讯股份有限公司 | Method and system for allocating IP address |
Also Published As
Publication number | Publication date |
---|---|
CN102355510A (en) | 2012-02-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102355510B (en) | Medium/media access control (MAC) address allocation method, device and system | |
CN100527752C (en) | DHCP address allocation method | |
US9729501B2 (en) | System and data card for stateless automatic configuration of IPv6 address and method for implementing the same | |
US7962584B2 (en) | Usage of host generating interface identifiers in DHCPv6 | |
CN102685270B (en) | Method and equipment for distributing dynamic addresses | |
CN102118453B (en) | Method, service device, client and communication system for automatic configuration of IP address | |
CN104378455B (en) | IP address distribution method and device | |
CN101795300B (en) | IP (Internet Protocol) address recovery method and system, as well as DHCP (Dynamic Host Configuration Protocol) repeater and DHCP server | |
CN102439949A (en) | Method for solving internet protocol address assignment conflict and related device and system | |
CN104104744A (en) | IP address assignment method and device | |
CN101883158A (en) | Method and client for acquiring VLAN (Virtual Local Area Network) IDs (Identifiers) and network protocol addresses | |
EP2442521A1 (en) | Method for obtaining ip address of dynamic host configuration protocol version 6 server, dynamic host configuration protocol version 6 server and dynamic host configuration protocol version 6 communication system | |
CN102340555B (en) | Medium/media access control address allocation method, device and system | |
CN1845554B (en) | Control method for dynamically distributing IP address in 3G network | |
CN107615723B (en) | Internet protocol address allocation method and relay equipment | |
CN105704256A (en) | Method, device and system for IP address management | |
CN101179515B (en) | Method and device for inhibiting black hole routing | |
US20120008627A1 (en) | Method and apparatus for assigning device identifier with collision avoidance | |
CN102333013B (en) | Method, device and system for detecting medium access control (MAC) address conflicts | |
CN102333133A (en) | Medium access control (MAC) address distribution method, device and system | |
KR100689734B1 (en) | Address allocation method and device thereof in wireless network environment | |
CN103051739A (en) | Network terminal and IP (Internet Protocol) address configuration method thereof | |
CN102244689B (en) | Method and equipment for obtaining remote IP address | |
CN108667957B (en) | IP address allocation method, first electronic device and first server | |
CN102333134B (en) | Medium/media access control address conflict detection method, device and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |