WO2016034006A1 - 一种报文发送方法及接入设备 - Google Patents

一种报文发送方法及接入设备 Download PDF

Info

Publication number
WO2016034006A1
WO2016034006A1 PCT/CN2015/081671 CN2015081671W WO2016034006A1 WO 2016034006 A1 WO2016034006 A1 WO 2016034006A1 CN 2015081671 W CN2015081671 W CN 2015081671W WO 2016034006 A1 WO2016034006 A1 WO 2016034006A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
access
terminal device
dhcp
location information
Prior art date
Application number
PCT/CN2015/081671
Other languages
English (en)
French (fr)
Inventor
李军
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016034006A1 publication Critical patent/WO2016034006A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a packet sending method and an access device.
  • the network authentication device needs to know the specific access location information of the user.
  • the gateway device can obtain the access location information of the user by capturing a dynamic host configuration protocol (DHCP) message.
  • DHCP dynamic host configuration protocol
  • users with statically configured IP addresses the gateway devices cannot easily obtain their specifics. Access location information can only be complicated by manual manual configuration.
  • the invention provides a method for transmitting a message and an access device, which can enable the gateway device to conveniently obtain the access location information of the user who statically configures the IP address through the DHCP message.
  • a first aspect of the present invention provides a packet sending method, including:
  • the access device receives an access request of the terminal device
  • the access device acquires an IP address, a media access control MAC address, and access location information of the terminal device;
  • the access device simulates generating a dynamic host configuration protocol DHCP message according to the IP address, the MAC address, and the access location information;
  • the access device sends the DHCP packet to the gateway device.
  • the generating, by the access device, the generating the DHCP message according to the IP address, the MAC address, and the access location information includes:
  • the access device associates the IP address, the MAC address, and the access location according to a DHCP standard message format.
  • the information is added to each field of the DHCP packet to generate a DHCP packet.
  • the IP address, the MAC address, and the access location information are written into each field of the DHCP packet.
  • the access device receives the access of the terminal device After the request, the method further includes:
  • the access device acquires an IP address and a MAC address of the terminal device according to the access request, and determines whether a correspondence between the IP address and the MAC address is stored in the dynamic address binding table on the access device. If the correspondence between the IP address and the MAC address is not stored in the dynamic address binding table, it is determined that the IP address used by the terminal device is a static IP address.
  • the method further includes: binding the dynamic address The correspondence between the IP address and the MAC address is stored in the table.
  • a second aspect of the present invention provides an access device, including:
  • a receiving unit configured to receive an access request of the terminal device
  • An acquiring unit configured to acquire an IP address, a media access control MAC address, and access location information of the terminal device when the Internet Protocol IP address used by the terminal device is a static IP address;
  • a generating unit configured to simulate generating a dynamic host configuration protocol DHCP message according to the IP address, the MAC address, and the access location information
  • a sending unit configured to send the DHCP packet to the gateway device.
  • the generating unit includes:
  • the writing unit is configured to write the IP address, the MAC address, and the access location information into each field of the DHCP message according to a DHCP standard message format.
  • the writing unit is specifically configured to:
  • the device further includes:
  • a parsing unit configured to acquire an IP address and a MAC address of the terminal device according to the access request
  • a determining unit configured to determine, in the dynamic address binding table on the access device, whether the mapping between the IP address and the MAC address is stored, if the IP address and the MAC address are not stored in the dynamic address binding table
  • the correspondence between the addresses determines that the IP address used by the terminal device is a static IP address.
  • the access device further includes:
  • a storage unit configured to store, in the dynamic address binding table, a correspondence between the IP address and the MAC address when the correspondence between the IP address and the MAC address is not stored in the dynamic address binding table .
  • the access device receives the access request of the terminal device. If the Internet Protocol IP address used by the terminal device is a static IP address, the access device acquires the IP address, media access control MAC address, and access location information of the terminal device. And generating a dynamic host configuration protocol (DHCP) message according to the IP address, the MAC address, and the access location information, and sending the DHCP message to the gateway device.
  • DHCP dynamic host configuration protocol
  • the gateway device can obtain the access location information of the user who statically configures the IP address by obtaining the DHCP packet, so as to implement precise policy control such as authentication of the user who statically configures the IP address.
  • FIG. 1 is a schematic flowchart of a method for sending a packet according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another method for sending a packet according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of another method for sending a packet according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of another method for sending a packet according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an access device according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an access device according to another embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an access device according to another embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of an access device according to another embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an access device according to another embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a specific application scenario of the access device according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for sending a message and a related device, which is used by the gateway device to conveniently obtain the access location information of the user who statically configures the IP address through the DHCP message.
  • a packet sending method includes:
  • the access device receives an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the access device acquires an IP address, a media access control MAC address, and access location information of the terminal device.
  • the access device simulates generating a dynamic host configuration protocol DHCP message according to the IP address, the MAC address, and the access location information.
  • the upper layer network device obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can analyze the DHCP packet. And obtaining access location information of the terminal device using the static IP address.
  • the access device sends the DHCP packet to a gateway device.
  • the access device may send the DHCP message to the gateway device in the form of broadcast or unicast.
  • the access device generates a DHCP packet according to the IP address, the MAC address, and the access location information of the statically configured IP address, and sends the DHCP packet to the gateway device. After receiving the DHCP packet, the gateway device receives the DHCP packet.
  • the access location information of the user who statically configures the IP address can be conveniently obtained, thereby implementing precise policy control such as authentication of the user who statically configures the IP address.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the statically configured IP address, and sends the DHCP packet to the gateway device.
  • the access device simulates generating a DHCP packet. The following is a description of the process of generating a DHCP packet by the access device, and the method for transmitting the DHCP packet is as follows:
  • the access device receives an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the access device acquires an IP address, a media access control MAC address, and access location information of the terminal device.
  • the gateway device needs to authenticate the terminal device user, the access location information of the terminal device on the access device needs to be utilized, so the access device must obtain the access location information of the terminal device.
  • the access device generates a new DHCP packet.
  • the access device generates a new DHCP packet through the DHCP configuration protocol and commands.
  • the access device writes the IP address in a Client IP address field of the DHCP message, and writes the MAC address in a Client MAC address field.
  • the access device writes the IP address and the MAC address of the terminal device to the Client IP address field and the Client IP address field of the new DHCP message by using a DHCP configuration protocol and a command.
  • a DHCP configuration protocol and a command.
  • the field format of the DHCP packet format is described in the following description.
  • the IP address and the MAC address may also be used to store corresponding fields of DHCP messages in other formats, which are not limited herein.
  • the access device writes the access location information in an option option 82 of the DHCP message.
  • the option field in the DHCP packet contains the option 82.
  • the option 82 is used to store the access location information of the terminal device.
  • the upper layer network device (such as the gateway device) obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can analyze the DHCP packet. And obtaining access location information of the terminal device using the static IP address.
  • the access device sends the DHCP packet to a gateway device.
  • the access device sends the DHCP message to the gateway device in the form of a broadcast.
  • a method for simulating the generation of a DHCP message by the access device is described.
  • the access device simulates the generation of a DHCP message, and uses a standard DHCP message format.
  • the access location information of the user who configures the IP address is written in the DHCP packet.
  • the gateway device can obtain the DHCP packet and obtain the DHCP packet. Configure the access location information of the user whose IP address is configured. Specific generation method for DHCP messages of different formats The same, no further description here.
  • the access device can first determine whether the IP address used by the terminal device is a static IP address.
  • the access device can first determine whether the IP address used by the terminal device is a static IP address.
  • the access device can determine whether the IP address used by the terminal device is a static IP address.
  • Another method for sending a packet in the embodiment of the present invention includes:
  • the access device receives an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the access device parses an access request sent by the terminal device.
  • the access device needs to parse the access request sent by the terminal device.
  • the access device determines whether a correspondence between the IP address and the MAC address is stored in the dynamic address binding table on the access device, and if not, the IP address used by the terminal device is a static IP address. Address, execute 304; if yes, perform other steps.
  • the access device is configured with a dynamic address binding table for storing the correspondence between the IP address and the MAC address of the terminal device. If the terminal device uses a dynamic IP address, after connecting to the access device, the access device pairs the The terminal device performs a dynamic DHCP resolution process and stores the IP address and MAC address of the terminal device in the dynamic address binding table. Therefore, by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table of the access device, it can be determined whether the IP address used by the terminal device is a static IP address.
  • the access device stores, in the dynamic address binding table, a correspondence between the IP address and a MAC address.
  • the access device stores the IP address and the MAC address of the terminal device using the static IP address in the dynamic address binding table, so as to facilitate the access device to obtain the IP address and the MAC address of the terminal device, and When the terminal device accesses the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address relationship binding table.
  • the access device acquires an IP address, a media access control MAC address, and access location information of the terminal device.
  • the gateway device needs to authenticate the terminal device user, the access location information of the terminal device on the access device needs to be utilized, so the access device must obtain the access location information of the terminal device.
  • the access device simulates generating dynamics according to the IP address, the MAC address, and the access location information. Host configuration protocol DHCP packet.
  • the upper layer network device obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can analyze the DHCP packet. And obtaining access location information of the terminal device using the static IP address.
  • the access device sends the DHCP packet to a gateway device.
  • the access device sends the DHCP message to the gateway device in the form of a broadcast.
  • the access device determines whether the IP address used by the terminal device is a static IP address by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table, and if yes, The IP address and the MAC address of the terminal device are stored in the dynamic address binding table, so that the access device can obtain the IP address and the MAC address of the terminal device, and when the terminal device When accessing the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address binding table, which can improve the efficiency of the access device to forward packets.
  • the access device determines whether the IP address used by the terminal device is a static IP address.
  • the following describes how the access device determines whether the IP address used by the terminal device is a static address and generates a DHCP message.
  • another method for sending a message in the embodiment of the present invention includes:
  • the access device receives an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the access device parses an access request sent by the terminal device.
  • the access device needs to parse the access request sent by the terminal device.
  • the access device determines whether a correspondence between the IP address and the MAC address is stored in the dynamic address binding table on the access device, and if not, the IP address used by the terminal device is a static IP address. Address, execute 304; if yes, perform other steps.
  • the access device is configured with a dynamic address binding table for storing the correspondence between the IP address and the MAC address of the terminal device. If the terminal device uses a dynamic IP address, after connecting to the access device, the access device pairs the The terminal device performs a dynamic DHCP resolution process and saves the IP address and MAC address of the terminal device. Stored in the dynamic address binding table. Therefore, by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table of the access device, it can be determined whether the IP address used by the terminal device is a static IP address.
  • the access device stores, in the dynamic address binding table, a correspondence between the IP address and a MAC address.
  • the access device stores the IP address and the MAC address of the terminal device using the static IP address in the dynamic address binding table, so as to facilitate the access device to obtain the IP address and the MAC address of the terminal device, and When the terminal device accesses the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address relationship binding table.
  • the access device acquires an IP address, a media access control MAC address, and access location information of the terminal device.
  • the gateway device needs to authenticate the terminal device user, the access location information of the terminal device on the access device needs to be utilized, so the access device must obtain the access location information of the terminal device.
  • the access device generates a new DHCP packet.
  • the access device generates a new DHCP packet through the DHCP configuration protocol and commands.
  • the access device writes the IP address in a Client IP address field of the DHCP message, and writes the MAC address in a Client MAC address field.
  • the access device writes the IP address and the MAC address of the terminal device to the Client IP address field and the Client IP address field of the new DHCP message by using a DHCP configuration protocol and a command.
  • a DHCP configuration protocol and a command.
  • the field format of the DHCP packet format is described in the following description.
  • the IP address and the MAC address may also be used to store corresponding fields of DHCP messages in other formats, which are not limited herein.
  • the access device writes the access location information in an option 82 of the DHCP message.
  • the option field in the DHCP packet contains the option 82.
  • the option 82 is used to store the access location information of the terminal device.
  • the upper layer network device (such as the gateway device) obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can parse the DHCP packet. For example, the access location information of the terminal device using the static IP address is obtained.
  • the access device broadcasts and sends the DHCP message.
  • the access device sends the DHCP message to the gateway device in the form of a broadcast.
  • the access device determines whether the IP address used by the terminal device is a static IP address by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table, and if yes, The IP address and the MAC address of the terminal device are stored in the dynamic address binding table, so that the access device can obtain the IP address and the MAC address of the terminal device, and when the terminal device When accessing the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address binding table, thereby improving the forwarding efficiency of the access device.
  • the access device simulates the generation of a DHCP packet, and uses the standard DHCP packet format.
  • the access location information of the user who statically configures the IP address can be written into the DHCP packet. If the gateway device does not need to be modified or configured, the DHCP packet can be obtained by means of obtaining a DHCP packet, and the access location information of the user who statically configures the IP address can be conveniently obtained.
  • the specific generation methods are the same for DHCP packets of different formats.
  • the access request includes an address resolution protocol ARP request initiated by the terminal device or a data packet sent by the terminal device;
  • the access location information includes an ID of the access device, a port number or an SSID of the terminal device accessing the access device.
  • the DHCP message includes a DHCP_discover message, a DHCP_request message, and a DHCP_inform message. Applicable to all the above embodiments, which are not described herein.
  • the access device in the embodiment of the present invention includes:
  • the receiving unit 501 is configured to receive an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the obtaining unit 502 is configured to acquire an IP address, a media access control MAC address, and access location information of the terminal device when the Internet Protocol IP address used by the terminal device is a static IP address.
  • the gateway device needs to authenticate the terminal device user, the access location information of the terminal device on the access device needs to be utilized, so the access device must obtain the access location information of the terminal device.
  • the generating unit 503 is configured to simulate generating a dynamic host configuration protocol (DHCP) message according to the IP address, the MAC address, and the access location information.
  • DHCP dynamic host configuration protocol
  • the upper layer network device obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device uses static IP according to the use.
  • the IP address, the MAC address, and the access location information of the terminal device of the address are simulated to generate a DHCP packet. This allows the gateway device to obtain the access location information of the terminal device using the static IP address by parsing the DHCP packet.
  • the sending unit 504 is configured to send the DHCP packet to the gateway device.
  • the access device sends the DHCP message to the gateway device in the form of a broadcast.
  • the generating unit 503 generates a DHCP message according to the IP address, the MAC address, and the access location information of the statically configured IP address, and sends the DHCP message to the gateway device. After receiving the DHCP message, the gateway device receives the DHCP message.
  • the access location information of the user who statically configures the IP address can be conveniently obtained, thereby implementing precise policy control such as authentication of the user who statically configures the IP address.
  • the generating unit 503 simulates generating a DHCP message according to the IP address, the MAC address, and the access location information of the statically configured IP address, and sends the DHCP message to the gateway device.
  • the access device simulates generating the DHCP message. , to follow the standard message format generation. Referring to FIG. 6, the access device according to FIG. 5, in an access device according to another embodiment of the present invention:
  • the generating unit 503 specifically includes:
  • the writing unit 5031 is configured to write the IP address in the Client IP address field of the DHCP message; write the MAC address in the Client MAC address field, and write the connection in the option 82 of the DHCP message Enter location information.
  • the access device writes the IP address and the MAC address of the terminal device to the Client IP address field and the Client IP address field of the new DHCP message by using a DHCP configuration protocol and a command.
  • the field format of the DHCP packet format is described in the following description.
  • the IP address and the MAC address may also be used to store corresponding fields of DHCP messages in other formats, which are not limited herein.
  • the option field in the DHCP packet contains the option 82.
  • the option 82 is used to store the access location information of the terminal device.
  • the upper layer network device (such as the gateway device) obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can analyze the DHCP packet. And obtaining access location information of the terminal device using the static IP address.
  • the access device simulates the generation of a DHCP message, and uses a standard DHCP message format. If the format is not changed, the access location information of the user who statically configures the IP address can be written into the DHCP report. Text
  • the upper-layer network device (such as a gateway device) can obtain the DHCP message by means of obtaining a DHCP packet, and conveniently obtain the access location of the user who statically configures the IP address. information. For a DHCP packet of different formats, the specific generating device is the same, and is not described here.
  • an access device includes:
  • the receiving unit 501 is configured to receive an access request of the terminal device.
  • the terminal device When the terminal device accesses the network, it needs to send an access request to the access device.
  • the parsing unit 505 is configured to parse the access request of the terminal device.
  • the access device needs to parse the access request sent by the terminal device.
  • a determining unit 506 configured to determine whether a correspondence between the IP address and the MAC address is stored in the dynamic address binding table on the access device, if the IP address and the IP address are not stored in the dynamic address binding table The correspondence between the MAC addresses determines that the IP address used by the terminal device is a static IP address.
  • the access device is configured with a dynamic address binding table for storing the correspondence between the IP address and the MAC address of the terminal device. If the terminal device uses a dynamic IP address, after connecting to the access device, the access device pairs the The terminal device performs a dynamic DHCP resolution process and stores the IP address and MAC address of the terminal device in the dynamic address binding table. Therefore, by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table of the access device, it can be determined whether the IP address used by the terminal device is a static IP address.
  • the storage unit 507 is configured to: when the correspondence between the IP address and the MAC address is not stored in the dynamic address binding table, store the correspondence between the IP address and the MAC address in the dynamic address binding table. relationship.
  • the access device stores the IP address and the MAC address of the terminal device using the static IP address in the dynamic address binding table, so as to facilitate the access device to obtain the IP address and the MAC address of the terminal device, and When the terminal device accesses the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address relationship binding table.
  • the obtaining unit 502 is configured to acquire an IP address, a media access control MAC address, and access location information of the terminal device when the Internet Protocol IP address used by the terminal device is a static IP address.
  • the gateway device needs to authenticate the terminal device user, the access location information of the terminal device on the access device needs to be utilized, so the access device must obtain the access location information of the terminal device.
  • the generating unit 503 is configured to simulate generating a dynamic host configuration protocol (DHCP) message according to the IP address, the MAC address, and the access location information.
  • DHCP dynamic host configuration protocol
  • the upper layer network device obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can parse the DHCP packet. For example, the access location information of the terminal device using the static IP address is obtained.
  • the sending unit 504 is configured to send the DHCP packet to the gateway device.
  • the access device sends the DHCP message to the gateway device in the form of a broadcast.
  • the access device determines whether the IP address used by the terminal device is a static IP address by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table, and if so, And storing the IP address and the MAC address of the terminal device in the dynamic address binding table, so that the access device obtains the IP address and the MAC address of the terminal device, and when When the terminal device accesses the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address binding table, which can improve the efficiency of the access device to forward packets.
  • the access device determines whether the IP address used by the terminal device is a static IP address.
  • FIG. 8 on the basis of FIG. 7, in an access device according to another embodiment of the present invention:
  • the generating unit 503 specifically includes:
  • the writing unit 5031 is configured to write the IP address in the Client IP address field of the DHCP message; write the MAC address in the Client MAC address field, and write the connection in the option 82 of the DHCP message Enter location information.
  • the access device writes the IP address and the MAC address of the terminal device to the Client IP address field and the Client IP address field of the new DHCP message by using a DHCP configuration protocol and a command.
  • the field format of the DHCP packet format is described in the following description.
  • the IP address and the MAC address may also be used to store corresponding fields of DHCP messages in other formats, which are not limited herein.
  • the option field in the DHCP packet contains the option 82.
  • the option 82 is used to store the access location information of the terminal device.
  • the upper layer network device (such as the gateway device) obtains the access location information of the terminal device that sends the DHCP packet by parsing the DHCP packet.
  • the access device simulates generating a DHCP packet according to the IP address, the MAC address, and the access location information of the terminal device that uses the static IP address, so that the gateway device can analyze the DHCP packet. And obtaining access location information of the terminal device using the static IP address.
  • the embodiment of the present invention further provides an access device 900, which is used to implement the method shown in Figure 1-4 above.
  • the device 900 includes:
  • the processor 910, the communication interface 920, and the memory 930 communicate with each other via the bus 940.
  • the communication interface 920 is configured to communicate with an external network element. In one embodiment, the communication interface 920 is configured to communicate with multiple network access devices, other network devices in the virtual cluster.
  • Communication interface 920 can be implemented by an optical transceiver, an electrical transceiver, a wireless transceiver, or any combination thereof.
  • the optical transceiver can be a small form-factor pluggable transceiver (sFP) transceiver (English: transceiver), and the enhanced small form-factor pluggable (English: enhanced small form-factor pluggable, Abbreviation: SFP+) Transceiver or 10 Gigabit small form-factor pluggable (XFP) transceiver.
  • sFP small form-factor pluggable transceiver
  • SFP+ small form-factor pluggable
  • XFP 10 Gigabit small form-factor pluggable
  • the electrical transceiver can be an Ethernet (Ethernet) network interface controller (English: network interface controller, abbreviation: NIC).
  • the wireless transceiver can be a wireless network interface controller (English: wireless network interface controller, abbreviation: WNIC).
  • Communication interface 920 can include multiple physical interfaces, such as communication interface 920 including a plurality of Ethernet interfaces.
  • the processor 910 is configured to execute the program 932.
  • program 932 can include program code, the program code including computer operating instructions.
  • the processor 910 may be a central processing unit (English: central processing unit, abbreviated as CPU) or an application-specific integrated circuit (ASIC).
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the memory 930 is configured to store the program 932.
  • the memory 930 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory 930 may also include a non-volatile memory (English: non-volatile memory) ), such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state Drive, abbreviation: SSD); the memory 930 may also include a combination of the above types of memories.
  • ROM read-only memory
  • flash memory English: flash memory
  • HDD hard disk drive
  • SSD solid state drive
  • the processor 910 is configured to invoke the program 932 in the memory, and perform the operations in FIG. 3 and FIG. 5 according to the program 932. The steps performed by the first network device.
  • the access device determines whether the IP address used by the terminal device is a static IP address by determining whether the IP address and the MAC address of the terminal device are stored in the dynamic address binding table, and if so, And storing the IP address and the MAC address of the terminal device in the dynamic address binding table, so that the access device obtains the IP address and the MAC address of the terminal device, and when When the terminal device accesses the network for the second time, the access device can directly obtain the IP address and the MAC address of the terminal device through the dynamic address binding table, which can improve the efficiency of the access device to forward packets.
  • the access device simulates the generation of a DHCP packet, and uses the standard DHCP packet format.
  • the access location information of the user who statically configures the IP address can be written into the DHCP packet. If the gateway device does not need to be modified or configured, the DHCP packet can be obtained by means of obtaining a DHCP packet, and the access location information of the user who statically configures the IP address can be conveniently obtained.
  • the specific generation methods are the same for DHCP packets of different formats.
  • the access request includes an address resolution protocol ARP request initiated by the terminal device or a data packet sent by the terminal device;
  • the access location information includes an ID of the access device, a port number or an SSID of the terminal device accessing the access device.
  • the DHCP message includes a DHCP_discover message, a DHCP_request message, and a DHCP_inform message. Applicable to all the above embodiments, which are not described herein.
  • the access device is a switch
  • the gateway device is a broadband network gateway (BNG)
  • the terminal device is a terminal computer.
  • the computer uses a static IP address, and the IP address of the computer is 1.1. .1.1, the MAC address is ZZZZZZ, the port number of the computer accessing the switch is 34, for example, when the computer accesses the network, according to the implementation process of the present invention, please refer to FIG. 10, the implementation of the present invention
  • an embodiment of a specific application scenario includes:
  • the computer sends an access request to the switch.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明实施例公开了一种报文发送方法及设备。接入设备接收终端设备的访问请求,若终端设备使用的互联网协议IP地址为静态IP地址,则接入设备获取终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息,根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文,将所述DHCP报文发送给网关设备。本发明使得网关设备可以通过获取DHCP报文的方式,方便地获取到静态配置IP地址的用户的接入位置信息,从而实现对静态配置IP地址的用户的认证等精确策略控制。

Description

一种报文发送方法及接入设备
本申请要求于2014年9月5日提交中国专利局、申请号为201410452469.9、发明名称为“一种报文发送方法及接入设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种报文发送方法及接入设备。
背景技术
在互联网上,为了保证网络安全,用户接入网络时通常需要进行接入认证,为了实现面向用户的精确策略控制,网络认证设备需要知道用户的具体接入位置信息。
因为网络上的所有数据都是通过报文形式传送的,网关设备可以通过捕获动态主机配置协议(英文:dynamic host configuration protocol,简称:DHCP)报文来获得用户的接入位置信息。但是,这仅仅只能针对IP地址是通过DHCP服务器动态分配的用户,而对于IP地址是静态配置的用户(以下简称为静态配置IP地址的用户),网关设备将无法方便地获取到它们的具体接入位置信息,只能通过人工手动配置,实现复杂。
发明内容
本发明提供了一种发送报文的方法及接入设备,可使得网关设备可以通过DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。
本发明第一方面提供一种报文发送方法,包括:
接入设备接收终端设备的访问请求;
若所述终端设备使用的互联网协议IP地址为静态IP地址,则所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息;
所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文;
所述接入设备将所述DHCP报文发送给网关设备。
结合第一方面,在第一方面的第一种实现方式中,所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成DHCP报文包括:
所述接入设备按照DHCP标准报文格式,将所述IP地址、MAC地址以及接入位置 信息加入到DHCP报文的各字段中,生成DHCP报文。
结合第一方面的第一种实现方式,在第一方面的第二种实现方式中,所述将所述IP地址、MAC地址以及接入位置信息写入到所述DHCP报文的各字段中包括:
在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址;在所述DHCP报文的选项option82中写入所述接入位置信息。
结合第一方面、或第一方面的第一种实现方式、或第一方面的第二种实现方式,在在第一方面的第三种实现方式中,所述接入设备接收终端设备的访问请求之后,所述方法还包括:
所述接入设备根据所述访问请求获取所述终端设备的IP地址和MAC地址;判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,如果所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系,则确定所述终端设备使用的IP地址为静态IP地址。
结合第一方面的第三种实现方式,在第一方面的第四种实现方式中,若所述终端设备使用的IP地址为静态IP地址,所述方法还包括:在所述动态地址绑定表中存储所述IP地址与MAC地址的对应关系。
本发明第二方面提供一种接入设备,包括:
接收单元,用于接收终端设备的访问请求;
获取单元,用于当所述终端设备使用的互联网协议IP地址为静态IP地址时,获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息;
生成单元,用于根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文;
发送单元,用于将所述DHCP报文发送给网关设备。
结合第二方面,在第二方面的第一种实现方式中,所述生成单元包括:
写入单元,用于按照DHCP标准报文格式,将所述IP地址、MAC地址以及接入位置信息写入到所述DHCP报文的各字段中。
结合第二方面的第一种实现方式,在第二方面的第二种实现方式中,所述写入单元具体用于:
在所述DHCP报文的Client IPaddress字段写入所述IP地址中;在Client MACaddress字段写入所述MAC地址;在所述DHCP报文的选项option82中写入所述接入位置信息。
结合第二方面、或第二方面的第一种实现方式、或第二方面的第二种实现方式,在 第二方面的第三种实现方式中,所述设备还包括:
解析单元,用于根据所述访问请求获取所述终端设备的IP地址和MAC地址;
确定单元,用于判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,如果所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系,则确定所述终端设备使用的IP地址为静态IP地址。
结合第二方面的第三种实现方式,在第二方面的第四种实现方式中,所述接入设备还包括:
存储单元,用于当所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系时,在所述动态地址绑定表中存储所述IP地址与所述MAC地址的对应关系。
本发明中,接入设备接收终端设备的访问请求,若终端设备使用的互联网协议IP地址为静态IP地址,则接入设备获取终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息,根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文,将所述DHCP报文发送给网关设备。这样,网关设备可以通过获取DHCP报文的方式,方便地获取到静态配置IP地址的用户的接入位置信息,从而实现对静态配置IP地址的用户的认证等精确策略控制。
附图说明
图1为本发明实施例中一种报文发送方法的流程示意图;
图2为本发明实施例中另一种报文发送方法的流程示意图;
图3为本发明实施例中另一种报文发送方法的流程示意图;
图4为本发明实施例中另一种报文发送方法的流程示意图;
图5为本发明实施例中接入设备的结构示意图;
图6为本发明另一实施例中接入设备的结构示意图;
图7为本发明另一实施例中接入设备的结构示意图;
图8为本发明另一实施例中接入设备的结构示意图;
图9为本发明另一实施例中接入设备的结构示意图;
图10为本发明实施例中所述接入设备的具体应用场景示意图。
具体实施方式
本发明实施例提供了一种发送报文的方法及相关设备,用于网关设备可通过DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参照图1,本发明实施例提供的一种报文发送方法包括:
101、接入设备接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
102、若所述终端设备使用的互联网协议IP地址为静态IP地址,则所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。103、所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文。
由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用所述静态IP地址的终端设备的接入位置信息。
104、所述接入设备将所述DHCP报文发送给网关设备;
接入设备可以以广播或单播的形式将所述DHCP报文发送给网关设备。
本发明实施例中,接入设备根据静态配置IP地址的用户的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,发送给网关设备,网关设备在接收到所述DHCP报文后,可以方便地获取到静态配置IP地址的用户的接入位置信息,从而实现对静态配置IP地址的用户的认证等精确策略控制。
上面实施例中,接入设备根据静态配置IP地址的用户的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,发送给网关设备,在实际应用中,接入设备模拟生成DHCP报文时,要遵循标准的报文格式,下面对接入设备具体模拟生成DHCP报文的过程进行描述,请参照图2,本发明实施例中另一种报文发送方法包括:
201、接入设备接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
202、若终所述端设备使用的互联网协议IP地址为静态IP地址,则所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。
203、所述接入设备生成新DHCP报文。
接入设备通过DHCP配置协议和命令生成新的DHCP报文。
204、所述接入设备在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址。
所述接入设备通过DHCP配置协议和命令将所述终端设备的IP地址和MAC地址分别写入到新DHCP报文的Client IPaddress字段和Client IPaddress字段中。需要说明的是,此处描述的只是一种DHCP报文格式的字段格式,所述IP地址和MAC地址亦可存放其他格式的DHCP报文的相应字段,此处不作限定。
205、所述接入设备在所述DHCP报文的选项option82中写入所述接入位置信息。
DHCP报文中的option字段包含了option82,所述option82用于存放终端设备的接入位置信息。由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用所述静态IP地址的终端设备的接入位置信息。
206、所述接入设备将所述DHCP报文发送给网关设备。
接入设备以广播的形式将所述DHCP报文发送给网关设备。
本发明实施例中,描述了接入设备具体模拟生成DHCP报文的方法,接入设备模拟生成DHCP报文,使用的是标准DHCP报文格式,并未对格式做出改动,便能将静态配置IP地址的用户的接入位置信息写入DHCP报文中,网关设备不需要做出任何改动和配置,就可以通过获取DHCP报文的方式,解析所述DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。针对不同格式的DHCP报文,具体的生成方法 相同,此处不作赘述。
上面实施例中,描述的是当终端设备使用的IP地址是静态IP地址时之后的操作过程,在实际应用中,接入设备首先可以判断终端设备使用的IP地址是否是静态IP地址,下面对接入设备先判断终端设备使用的IP地址是否是静态IP地址进行具体描述,请参照图3,本发明实施例中另一种报文发送方法包括:
301、接入设备接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
302、所述接入设备解析所述终端设备发送的访问请求。
接入设备要获取终端设备所发送的地址解析或数据,就需要对终端设备发送的访问请求进行解析。
303、所述接入设备判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,若否,则所述终端设备使用的IP地址为静态IP地址,执行304;若是,则执行其他步骤。
接入设备设置有动态地址绑定表,用于存放终端设备的IP地址与MAC地址的对应关系,若终端设备使用的是动态IP地址,在连接到接入设备后,接入设备对所述终端设备会进行一个动态DHCP解析过程,并且将所述终端设备的IP地址与MAC地址存储在动态地址绑定表中。所以通过判断接入设备的动态地址绑定表中是否存储有所述终端设备的IP地址与MAC地址,可以确定所述终端设备使用的IP地址是否是静态IP地址。
304、所述接入设备在所述动态地址绑定表中存储所述IP地址与MAC地址的对应关系。
接入设备在动态地址绑定表中存储使用静态IP地址的终端设备的IP地址与MAC地址,是为了方便所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址关系绑定表中直接获取到所述终端设备的IP地址与MAC地址。
305、所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。
306、所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成动态 主机配置协议DHCP报文。
由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用所述静态IP地址的终端设备的接入位置信息。
307、所述接入设备将所述DHCP报文发送给网关设备。
接入设备以广播的形式将DHCP报文发送给网关设备。
本发明实施例中,接入设备通过判断动态地址绑定表中是否存储有所述终端设备的IP地址以及MAC地址来确定所述终端设备使用的IP地址是否是静态IP地址,若是,则将所述终端设备的IP地址与MAC地址存储到所述动态地址绑定表中,这样,方便了所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址绑定表中直接获取到所述终端设备的IP地址与MAC地址,能够提高接入设备转发报文的效率。
上面实施例中,描述了接入设备判断终端设备使用的IP地址是否是静态IP地址,下面对接入设备如何判断终端设备使用的IP地址是否是静态地址和具体生成DHCP报文的过程进行描述,请参照图4,本发明实施例中另一种报文发送方法包括:
401、接入设备接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
402、所述接入设备解析所述终端设备发送的访问请求。
接入设备要获取终端设备所发送的地址解析或数据,就需要对终端设备发送的访问请求进行解析。
403、所述接入设备判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,若否,则所述终端设备使用的IP地址为静态IP地址,执行304;若是,则执行其他步骤。
接入设备设置有动态地址绑定表,用于存放终端设备的IP地址与MAC地址的对应关系,若终端设备使用的是动态IP地址,在连接到接入设备后,接入设备对所述终端设备会进行一个动态DHCP解析过程,并且将所述终端设备的IP地址与MAC地址存 储在动态地址绑定表中。所以通过判断接入设备的动态地址绑定表中是否存储有所述终端设备的IP地址与MAC地址,可以确定所述终端设备使用的IP地址是否是静态IP地址。
404、所述接入设备在所述动态地址绑定表中存储所述IP地址与MAC地址的对应关系。
接入设备在动态地址绑定表中存储使用静态IP地址的终端设备的IP地址与MAC地址,是为了方便所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址关系绑定表中直接获取到所述终端设备的IP地址与MAC地址。
405、所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。
406、所述接入设备生成新DHCP报文。
接入设备通过DHCP配置协议和命令生成新的DHCP报文。
407、所述接入设备在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址。
所述接入设备通过DHCP配置协议和命令将所述终端设备的IP地址和MAC地址分别写入到新DHCP报文的Client IPaddress字段和Client IPaddress字段中。需要说明的是,此处描述的只是一种DHCP报文格式的字段格式,所述IP地址和MAC地址亦可存放其他格式的DHCP报文的相应字段,此处不作限定。
408、所述接入设备在所述DHCP报文的选项option82中写入所述接入位置信息。
DHCP报文中的option字段包含了option82,所述option82用于存放终端设备的接入位置信息。由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了客服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用静态IP地址的终端设备的接入位置信息。
409、所述接入设备广播发送所述DHCP报文。
接入设备以广播的形式将所述DHCP报文发送给网关设备。
本发明实施例中,接入设备通过判断动态地址绑定表中是否存储有所述终端设备的IP地址以及MAC地址来确定所述终端设备使用的IP地址是否是静态IP地址,若是,则将所述终端设备的IP地址与MAC地址存储到所述动态地址绑定表中,这样,方便了所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址绑定表中直接获取到所述终端设备的IP地址与MAC地址,能够提高接入设备的转发效率。接入设备模拟生成DHCP报文,使用的是标准DHCP报文格式,并未对格式做出改动,便能将静态配置IP地址的用户的接入位置信息写入DHCP报文中,上层网络设备(如网关设备)不需要做出任何改动和配置,就可以通过获取DHCP报文的方式,解析所述DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。针对不同格式的DHCP报文,具体的生成方法相同,此处不作赘述。
在实际应用中,访问请求包括终端设备发起的地址解析协议ARP请求或者终端设备发送的数据报文;接入位置信息包括接入设备的ID、终端设备接入到接入设备的端口号或者SSID;DHCP报文包括DHCP_discover报文、DHCP_request报文和DHCP_inform报文。适用于上述的所有实施例,在此不作赘述。
请参照图5,本发明实施例中的接入设备包括:
接收单元501,用于接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
获取单元502,用于当所述终端设备使用的互联网协议IP地址为静态IP地址时,获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。
生成单元503,用于根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文。
由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP 地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析DHCP报文,获得使用静态IP地址的终端设备的接入位置信息。
发送单元504,用于将所述DHCP报文发送给网关设备。
接入设备以广播的形式将DHCP报文发送给网关设备。
本发明实施例中,生成单元503根据静态配置IP地址的用户的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,发送给网关设备,网关设备在接收到所述DHCP报文后,可以方便地获取到静态配置IP地址的用户的接入位置信息,从而实现对静态配置IP地址的用户的认证等精确策略控制。
上面实施例中,生成单元503根据静态配置IP地址的用户的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,发送给网关设备,在实际应用中,接入设备模拟生成DHCP报文,要遵循标准的报文格式生成。请参照图6,基于图5所述的接入设备,本发明另一实施例的接入设备中:
所述生成单元503具体包括:
写入单元5031,用于在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址,在所述DHCP报文的选项option82中写入所述接入位置信息。
所述接入设备通过DHCP配置协议和命令将所述终端设备的IP地址和MAC地址分别写入到新DHCP报文的Client IPaddress字段和Client IPaddress字段中。需要说明的是,此处描述的只是一种DHCP报文格式的字段格式,所述IP地址和MAC地址亦可存放其他格式的DHCP报文的相应字段,此处不作限定。DHCP报文中的option字段包含了option82,所述option82用于存放终端设备的接入位置信息。由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用所述静态IP地址的终端设备的接入位置信息。
本发明实施例中,接入设备模拟生成DHCP报文,使用的是标准DHCP报文格式,并未对格式做出改动,便能将静态配置IP地址的用户的接入位置信息写入DHCP报文 中,上层网络设备(如网关设备)不需要做出任何改动和配置,就可以通过获取DHCP报文的方式,解析所述DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。针对不同格式的DHCP报文,具体的生成装置相同,此处不作赘述。
上面实施例中,描述的是当终端设备使用的IP地址是静态IP地址的操作过程,在实际应用中,接入设备首先可以判断终端设备使用的IP地址是否是静态IP地址。请参照图7,本发明另一实施例的接入设备包括:
接收单元501,用于接收终端设备的访问请求。
终端设备访问网络时,需要向接入设备发送访问请求。
解析单元505,用于对所述终端设备的访问请求进行解析。
接入设备要获取终端设备所发送的地址解析或数据,就需要对终端设备发送的访问请求进行解析。
确定单元506,用于判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,如果所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系,则确定所述终端设备使用的IP地址为静态IP地址。
接入设备设置有动态地址绑定表,用于存放终端设备的IP地址与MAC地址的对应关系,若终端设备使用的是动态IP地址,在连接到接入设备后,接入设备对所述终端设备会进行一个动态DHCP解析过程,并且将所述终端设备的IP地址与MAC地址存储在动态地址绑定表中。所以通过判断接入设备的动态地址绑定表中是否存储有所述终端设备的IP地址与MAC地址,可以确定所述终端设备使用的IP地址是否是静态IP地址。
存储单元507,用于当所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系时,在所述动态地址绑定表中存储所述IP地址与所述MAC地址的对应关系。
接入设备在动态地址绑定表中存储使用静态IP地址的终端设备的IP地址与MAC地址,是为了方便所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址关系绑定表中直接获取到所述终端设备的IP地址与MAC地址。
获取单元502,用于当所述终端设备使用的互联网协议IP地址为静态IP地址时,获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息。
因为网关设备要对终端设备用户进行认证,需要利用所述终端设备在接入设备上的接入位置信息,所以接入设备必须要获取所述终端设备的接入位置信息。
生成单元503,用于根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文。
由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候,就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了客服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用静态IP地址的终端设备的接入位置信息。
发送单元504,用于将所述DHCP报文发送给网关设备。
接入设备以广播的形式将DHCP报文发送给网关设备。
本发明实施例中,描述了接入设备通过判断动态地址绑定表中是否存储有所述终端设备的IP地址以及MAC地址来确定所述终端设备使用的IP地址是否是静态IP地址,若是,则将所述终端设备的IP地址与MAC地址存储到所述动态地址绑定表中,这样,方便了所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址绑定表中直接获取到所述终端设备的IP地址与MAC地址,能够提高接入设备转发报文的效率。
上面实施例中,描述了接入设备判断终端设备使用的IP地址是否是静态IP地址。请参照图8,在图7所示的基础上,本发明另一实施例的接入设备中:
所述生成单元503具体包括:
写入单元5031,用于在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址,在所述DHCP报文的选项option82中写入所述接入位置信息。
所述接入设备通过DHCP配置协议和命令将所述终端设备的IP地址和MAC地址分别写入到新DHCP报文的Client IPaddress字段和Client IPaddress字段中。需要说明的是,此处描述的只是一种DHCP报文格式的字段格式,所述IP地址和MAC地址亦可存放其他格式的DHCP报文的相应字段,此处不作限定。DHCP报文中的option字段包含了option82,所述option82用于存放终端设备的接入位置信息。由于上层网络设备(如网关设备)获取终端设备的接入位置信息时,是通过解析DHCP报文,来获取发送所述DHCP报文的终端设备的接入位置信息的。当用户使用的是静态IP地址的时候, 就不会产生DHCP报文,所以只能人工手动在网关设备上配置终端设备的接入位置信息。为了克服上述问题,本实施例中,接入设备根据使用静态IP地址的终端设备的IP地址、MAC地址以及接入位置信息模拟生成DHCP报文,这就使得网关设备可以通过解析所述DHCP报文,获得使用所述静态IP地址的终端设备的接入位置信息。
本发明实施例还提供了一种接入设备900,用于实现上述图1-图4所示的方法,如图9所示,所述装置900包括:
处理器(英文:processor)910,通信接口(英文:communications interface)920,存储器(英文:memory)930,总线940。
处理器910,通信接口920,存储器930通过总线940进行相互间的通信。
通信接口920,用于与外部网元通信。在一个实施方式中,所述通信接口920用于与多归接入设备、虚拟集群中的其他网络设备通信。通信接口920可以由光收发器,电收发器,无线收发器或其任意组合实现。例如,光收发器可以是小封装可插拔(英文:small form-factor pluggable transceiver,缩写:SFP)收发器(英文:transceiver),增强小封装可插拔(英文:enhanced small form-factor pluggable,缩写:SFP+)收发器或10吉比特小封装可插拔(英文:10Gigabit small form-factor pluggable,缩写:XFP)收发器。电收发器可以是以太网(英文:Ethernet)网络接口控制器(英文:network interface controller,缩写:NIC)。无线收发器可以是无线网络接口控制器(英文:wireless network interface controller,缩写:WNIC)。通信接口920可以包括多个物理接口,例如通信接口920包括多个以太网接口。
处理器910,用于执行程序932。
具体地,程序932可以包括程序代码,所述程序代码包括计算机操作指令。
处理器910可能是中央处理器(英文:central processing unit,缩写:CPU),或者是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC)。
存储器930,用于存放程序932。存储器930可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器930也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器930还可以包括上述种类的存储器的组合。
处理器910用于调用所述存储器中的程序932,根据程序932执行图3以及图5中 由第一网络设备所执行的步骤。
本发明实施例中,描述了接入设备通过判断动态地址绑定表中是否存储有所述终端设备的IP地址以及MAC地址来确定所述终端设备使用的IP地址是否是静态IP地址,若是,则将所述终端设备的IP地址与MAC地址存储到所述动态地址绑定表中,这样,方便了所述接入设备对所述终端设备的IP地址与MAC地址进行获取,并且当所述终端设备第二次访问网络时,接入设备可以通过动态地址绑定表中直接获取到所述终端设备的IP地址与MAC地址,能够提高接入设备转发报文的效率。接入设备模拟生成DHCP报文,使用的是标准DHCP报文格式,并未对格式做出改动,便能将静态配置IP地址的用户的接入位置信息写入DHCP报文中,上层网络设备(如网关设备)不需要做出任何改动和配置,就可以通过获取DHCP报文的方式,解析所述DHCP报文,方便地获取到静态配置IP地址的用户的接入位置信息。针对不同格式的DHCP报文,具体的生成方法相同,此处不作赘述。
在实际应用中,访问请求包括终端设备发起的地址解析协议ARP请求或者终端设备发送的数据报文;接入位置信息包括接入设备的ID、终端设备接入到接入设备的端口号或者SSID;DHCP报文包括DHCP_discover报文、DHCP_request报文和DHCP_inform报文。适用于上述的所有实施例,在此不作赘述。
下面将接入设备为交换机,网关设备为宽带网络网关(英文:broadband network gateway,简称:BNG),终端设备为终端计算机,所述计算机使用的是静态IP地址,所述计算机的IP地址为1.1.1.1,MAC地址为ZZZZZZ,所述计算机接入到交换机上的端口号为34号为例,具体描述当所述计算机访问网络时,根据本发明的实现过程,请参照图10,本发明实施例中,具体应用场景的实施例包括:
所述计算机向所述交换机发送访问请求。
所述交换机接收到计算机的访问请求;对所述访问请求进行解析,得到所述计算机的IP地址为1.1.1.1,MAC地址为ZZZZZZ;搜索交换机内设置的IP-MAC绑定表,确定所述IP-MAC绑定表中没有存储所述计算机的IP地址和MAC地址;将所述计算机的IP地址1.1.1.1和MAC地址ZZZZZZ存储到IP-MAC绑定表中;获取到所述计算机的IP地址1.1.1.1、MAC地址ZZZZZZ以及所述计算机在所述交换机上的接入端口号34号;通过DHCP配置命令生成一个新的DHCP_discover报文;在所述DHCP discover报文的Client IPaddress字段中写入所述计算机的IP地址1.1.1.1,在Client MACaddress字段写入所述计算机的MAC地址ZZZZZZ,在所述DHCP discover报文的选项option82 中写入接入位置信息34;以广播发送所述DHCP discover报文,以使网关设备能够接收到所述DHCP discover报文。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种报文发送方法,其特征在于,包括:
    接入设备接收终端设备发送的访问请求;
    若所述终端设备使用的互联网协议IP地址为静态IP地址,则所述接入设备获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息;
    所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机配置协议DHCP报文;
    所述接入设备将所述DHCP报文发送给网关设备。
  2. 根据权利要求1所述方法,其特征在于,所述接入设备根据所述IP地址、MAC地址以及接入位置信息模拟生成DHCP报文包括:
    所述接入设备按照DHCP标准报文格式,将所述IP地址、MAC地址以及接入位置信息写入到所述DHCP报文的各字段中,生成DHCP报文。
  3. 根据权利要求2所述方法,其特征在于,所述将所述IP地址、MAC地址以及接入位置信息写入到所述DHCP报文的各字段中包括:
    在所述DHCP报文的Client IPaddress字段写入所述IP地址;在Client MACaddress字段写入所述MAC地址;在所述DHCP报文的选项option82中写入所述接入位置信息。
  4. 根据权利要求1-3中任意一项所述方法,其特征在于,所述接入设备接收终端设备的访问请求之后,所述方法还包括:
    所述接入设备根据所述访问请求获取所述终端设备的IP地址和MAC地址;判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,如果所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系,则确定所述终端设备使用的IP地址为静态IP地址。
  5. 根据权利要求4所述方法,其特征在于,若所述终端设备使用的IP地址为静态IP地址,所述方法还包括:在所述动态地址绑定表中存储所述IP地址与MAC地址的对应关系。
  6. 一种接入设备,其特征在于,包括:
    接收单元,用于接收终端设备发送的访问请求;
    获取单元,用于当所述终端设备使用的互联网协议IP地址为静态IP地址时,获取所述终端设备的IP地址、媒体访问控制MAC地址以及接入位置信息;
    生成单元,用于根据所述IP地址、MAC地址以及接入位置信息模拟生成动态主机 配置协议DHCP报文;
    发送单元,用于将所述DHCP报文发送给网关设备。
  7. 根据权利要求6所述接入设备,其特征在于,所述生成单元包括:
    写入单元,用于按照DHCP标准报文格式,将所述IP地址、MAC地址以及接入位置信息写入到所述DHCP报文的各字段中。
  8. 根据权利要求7所述接入设备,其特征在于,所述写入单元具体用于:
    在所述DHCP报文的Client IPaddress字段写入所述IP地址中;在Client MACaddress字段写入所述MAC地址;在所述DHCP报文的选项option82中写入所述接入位置信息。
  9. 根据权利要求6-8中任意一项所述接入设备,其特征在于,所述设备还包括:
    解析单元,用于根据所述访问请求获取所述终端设备的IP地址和MAC地址;
    确定单元,用于判断所述接入设备上的动态地址绑定表中是否存储有所述IP地址和MAC地址的对应关系,如果所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系,则确定所述终端设备使用的IP地址为静态IP地址。
  10. 根据权利要求9所述接入设备,其特征在于,所述接入设备还包括:
    存储单元,用于当所述动态地址绑定表中没有存储所述IP地址和MAC地址的对应关系时,在所述动态地址绑定表中存储所述IP地址与所述MAC地址的对应关系。
PCT/CN2015/081671 2014-09-05 2015-06-17 一种报文发送方法及接入设备 WO2016034006A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410452469.9 2014-09-05
CN201410452469.9A CN105472054B (zh) 2014-09-05 2014-09-05 一种报文发送方法及接入设备

Publications (1)

Publication Number Publication Date
WO2016034006A1 true WO2016034006A1 (zh) 2016-03-10

Family

ID=55439101

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/081671 WO2016034006A1 (zh) 2014-09-05 2015-06-17 一种报文发送方法及接入设备

Country Status (2)

Country Link
CN (1) CN105472054B (zh)
WO (1) WO2016034006A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200224A (zh) * 2017-12-29 2018-06-22 山东华软金盾软件股份有限公司 Linux下基于DHCP协议的终端IP和MAC地址采集方法和系统

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411882B (zh) * 2016-09-28 2021-01-15 新华三技术有限公司 一种客户端接入网络的方法及装置
CN107483480B (zh) * 2017-09-11 2020-05-12 杭州迪普科技股份有限公司 一种地址的处理方法及装置
CN114362989B (zh) * 2021-09-30 2023-11-10 成都长虹网络科技有限责任公司 终端访问iptv业务的方法、网关、计算机设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1986386A1 (en) * 2006-02-17 2008-10-29 Huawei Technologies Co., Ltd. A method for binding the address of the user terminal in the access equipment
CN101394360A (zh) * 2008-11-10 2009-03-25 北京星网锐捷网络技术有限公司 地址解析协议报文的处理方法、接入设备和通信系统
CN102014174A (zh) * 2010-11-16 2011-04-13 中兴通讯股份有限公司 网络接入方法及网络设备
CN104009999A (zh) * 2014-06-10 2014-08-27 北京星网锐捷网络技术有限公司 防止arp欺骗的方法、装置及网络接入服务器

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101640689B (zh) * 2009-08-27 2013-02-27 中兴通讯股份有限公司 一种静态用户的接入方法及其装置
CN102255918A (zh) * 2011-08-22 2011-11-23 神州数码网络(北京)有限公司 一种基于DHCP Option 82的用户接入权限控制方法
CN103747115B (zh) * 2013-12-30 2017-08-01 武汉邮电科学研究院 基于虚拟网卡的虚拟机ip地址发现方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1986386A1 (en) * 2006-02-17 2008-10-29 Huawei Technologies Co., Ltd. A method for binding the address of the user terminal in the access equipment
CN101394360A (zh) * 2008-11-10 2009-03-25 北京星网锐捷网络技术有限公司 地址解析协议报文的处理方法、接入设备和通信系统
CN102014174A (zh) * 2010-11-16 2011-04-13 中兴通讯股份有限公司 网络接入方法及网络设备
CN104009999A (zh) * 2014-06-10 2014-08-27 北京星网锐捷网络技术有限公司 防止arp欺骗的方法、装置及网络接入服务器

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108200224A (zh) * 2017-12-29 2018-06-22 山东华软金盾软件股份有限公司 Linux下基于DHCP协议的终端IP和MAC地址采集方法和系统

Also Published As

Publication number Publication date
CN105472054A (zh) 2016-04-06
CN105472054B (zh) 2019-05-24

Similar Documents

Publication Publication Date Title
US8650326B2 (en) Smart client routing
WO2017054526A1 (zh) 一种arp条目生成方法和装置
US9485147B2 (en) Method and device thereof for automatically finding and configuring virtual network
US9231908B2 (en) Ensuring symmetric routing to private network
JP6037016B2 (ja) 仮想マシン・マイグレーションを決定するための方法および装置
EP2536092A1 (en) Method and device for port mapping, and communications system
US20180083968A1 (en) Method and system for authorizing service of user, and apparatus
US9883010B2 (en) Method, apparatus, device and system for generating DHCP snooping binding table
US10320788B2 (en) Method for transferring authorization information, relay device, and server
WO2020135574A1 (zh) 报文处理方法、装置、控制面设备和计算机存储介质
TWI577164B (zh) 可縮放位址解析之技術
US10530643B2 (en) Automatic management network provisioning
WO2019128273A1 (zh) 确定网络设备连接关系的方法、设备及系统
WO2016034006A1 (zh) 一种报文发送方法及接入设备
KR20140107173A (ko) 이더넷 스위치들용 룩-업 테이블없이 레이어 2 패킷을 스위치하기
TW201706901A (zh) 用戶端登錄伺服器端的鑑別方法、裝置、系統及電子設備
WO2017028398A1 (zh) 通信处理方法和装置
WO2015054882A1 (zh) 网络设备通信方法及网络设备
WO2014101891A1 (zh) 一种配置ip地址方法和设备
WO2016202059A1 (zh) 一种访问IPv6网络的方法及网关
WO2014142258A1 (ja) 通信システム、制御装置、アドレス割当方法及びプログラム
US9210129B2 (en) Systems and methods for providing a multiple secure link architecture
WO2016177185A1 (zh) 媒体访问控制mac地址的处理方法及装置
WO2013159591A1 (zh) 一种区分无线终端的方法及装置
WO2016095751A1 (zh) 一种域名解析方法及装置

Legal Events

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

Ref document number: 15837991

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15837991

Country of ref document: EP

Kind code of ref document: A1