CN103428311B - A kind of the method for option60, the network equipment and front end are dynamically set - Google Patents
A kind of the method for option60, the network equipment and front end are dynamically set Download PDFInfo
- Publication number
- CN103428311B CN103428311B CN201310369664.0A CN201310369664A CN103428311B CN 103428311 B CN103428311 B CN 103428311B CN 201310369664 A CN201310369664 A CN 201310369664A CN 103428311 B CN103428311 B CN 103428311B
- Authority
- CN
- China
- Prior art keywords
- option60
- line interface
- subscriber line
- value
- dhcp request
- 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
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了一种动态设置option60的方法、网络设备以及前端,其中的一种动态设置option60的方法包括:在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口对应的业务信息;接收前端根据所述每个用户线路接口的对应的业务信息为对应的用户线路接口分配得到的option60值;根据接收得到的所述option60值设置对应的用户线路接口的option60。采用本发明,可以通过前端动态设置网络设备的option60,为用户提供各种业务,从而提高了用户的体验度。
The embodiment of the present invention discloses a method for dynamically setting option60, a network device, and a front end, wherein a method for dynamically setting option60 includes: when the system is initialized, sending option60 request information to the front end, and the option60 request information includes each The service information corresponding to each subscriber line interface; the receiving front end assigns the option60 value obtained for the corresponding subscriber line interface according to the corresponding service information of each subscriber line interface; the corresponding subscriber line interface is set according to the received option60 value obtained option60. By adopting the present invention, the option 60 of the network device can be dynamically set through the front end to provide users with various services, thereby improving the user experience.
Description
技术领域technical field
本发明涉及互联网技术领域,尤其涉及一种动态设置option60的方法、网络设备以及前端。The present invention relates to the technical field of the Internet, in particular to a method for dynamically setting option60, network equipment and a front end.
背景技术Background technique
在互联网迅速发展的时代,IP地址短缺,因此采用为用户终端设备动态分配IP地址的方式来提高IP地址的利用率。网络管理人员将DHCP服务器提供的IP地址根据业务划分成不同的IP地址段,为了使DHCP服务器能够为终端设备分配需求的IP地址,目前公开了一种技术,在终端设备中插入固定的option60,DHCP服务器可以根据option60与IP地址对应关系分配IP地址。所述方法中终端设备的option60不可以改变,使用户无法更换业务,降低了用户的体验度。In the era of rapid Internet development, there is a shortage of IP addresses, so the method of dynamically assigning IP addresses to user terminal equipment is used to improve the utilization of IP addresses. Network administrators divide the IP address provided by the DHCP server into different IP address segments according to the business. In order to enable the DHCP server to assign the required IP address to the terminal equipment, a technology is currently disclosed, which inserts a fixed option60 into the terminal equipment. The DHCP server can assign IP addresses according to the correspondence between option 60 and IP addresses. In the method, the option60 of the terminal device cannot be changed, so that the user cannot change services, and the user experience is reduced.
发明内容Contents of the invention
本发明实施例所要解决的技术问题在于,提供一种动态设置option60的方法、网络设备以及前端,可以通过前端动态设置网络设备的option60,为用户提供各种业务,从而提高用户的体验度。The technical problem to be solved by the embodiments of the present invention is to provide a method for dynamically setting option60, a network device and a front end, through which the front end can dynamically set the option60 of the network device to provide users with various services, thereby improving user experience.
为了解决上述技术问题,本发明实施例提供了一种动态设置option60的方法,包括:In order to solve the above technical problems, an embodiment of the present invention provides a method for dynamically setting option60, including:
在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口的业务信息;When the system is initialized, the option60 request information is sent to the front end, and the option60 request information includes the service information of each user line interface;
接收前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值;receiving the option60 value assigned by the front end to the corresponding subscriber line interface according to the service information of each subscriber line interface;
根据接收得到的所述option60值设置对应的用户线路接口的option60。Set option 60 of the corresponding subscriber line interface according to the received value of option 60 .
相应地,本发明实施例还提供了一种动态设置option60的网络设备,包括:Correspondingly, the embodiment of the present invention also provides a network device for dynamically setting option60, including:
Option60请求发送模块,用于在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口的业务信息;The Option60 request sending module is used for sending the option60 request information to the front end when the system is initialized, and the option60 request information includes the service information of each user line interface;
Option60值接收模块,用于接收前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值;The Option60 value receiving module is used to receive the option60 value assigned by the front end to the corresponding subscriber line interface according to the service information of each subscriber line interface;
Option60设置模块,用于根据接收得到的所述option60值设置对应的用户线路接口的option60。The Option60 setting module is configured to set the option60 of the corresponding subscriber line interface according to the received value of the option60.
本发明实施例还提供了一种动态设置option60的方法,包括:The embodiment of the present invention also provides a method for dynamically setting option60, including:
接收网络设备发送的option60请求信息,所述请求信息中包括所述网络设备每个用户线路接口的业务信息;receiving option60 request information sent by the network device, where the request information includes service information of each subscriber line interface of the network device;
根据所述每个用户线路接口的业务信息为对应的用户线路接口分配option60值;assigning an option60 value to the corresponding subscriber line interface according to the service information of each subscriber line interface;
将所述分配得到的option60值发送给所述网络设备,以使所述网络设备根据所述分配得到的option60值设置对应的用户线路接口的option60。Sending the allocated option60 value to the network device, so that the network device sets option60 of the corresponding subscriber line interface according to the allocated option60 value.
相应地,本发明实施例还提供了一种动态设置option60的前端,包括:Correspondingly, the embodiment of the present invention also provides a front end for dynamically setting option60, including:
Option60判断模块,用于所述根据接收得到的所述option60值设置对应的用户线路接口的option60之后,当获取到所述用户线路接口上的终端设备发送的DHCP请求信息时,判断所述DHCP请求信息中是否存在所述终端设备的option60;The Option60 judging module is used for judging the DHCP request when the DHCP request information sent by the terminal device on the subscriber line interface is obtained after the option60 of the corresponding user line interface is set according to the received value of the option60 Whether option60 of the terminal device exists in the information;
Option60插入模块,用于若所述Option60判断模块判断所述DHCP请求信息中不存在所述终端设备的option60,则在所述DHCP请求信息中插入所述用户线路接口的option60;The Option60 insertion module is used to insert the option60 of the user line interface into the DHCP request information if the Option60 judging module judges that the option60 of the terminal device does not exist in the DHCP request information;
DHCP请求发送模块,将携带所述用户线路接口的option60的DHCP请求信息发送给DHCP服务器,以使所述DHCP服务器根据所述用户线路接口的option60为所述终端设备分配对应的IP地址。The DHCP request sending module sends the DHCP request information carrying the option60 of the user line interface to a DHCP server, so that the DHCP server assigns a corresponding IP address to the terminal device according to the option60 of the user line interface.
实施本发明实施例,具有如下有益效果:本发明实施例中网络设备通过接收前端根据每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值,设置对应的用户线路接口的option60,为用户提供了各种业务,从而提高了用户的体验度。Implementing the embodiment of the present invention has the following beneficial effects: In the embodiment of the present invention, the network device in the embodiment of the present invention sets the option60 value of the corresponding user line interface by receiving the option60 value assigned by the front end to the corresponding user line interface according to the service information of each user line interface , providing users with various services, thereby improving user experience.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是本发明实施例提供的一种动态设置option60的方法的流程图;FIG. 1 is a flowchart of a method for dynamically setting option60 provided by an embodiment of the present invention;
图2是本发明实施例提供的另一种动态设置option60的方法的流程图;FIG. 2 is a flowchart of another method for dynamically setting option60 provided by an embodiment of the present invention;
图3是本发明实施例提供的一种动态设置option60的网络设备的结构示意图;FIG. 3 is a schematic structural diagram of a network device for dynamically setting option60 provided by an embodiment of the present invention;
图4是本发明实施例提供的一种动态设置option60的前端的结构示意图。FIG. 4 is a schematic structural diagram of a front-end for dynamically setting option60 provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
图1是本发明实施例提供的一种动态设置option60的方法的流程图,如图所示本实施例中的动态设置option60的方法可以包括:FIG. 1 is a flow chart of a method for dynamically setting option60 provided by an embodiment of the present invention. As shown in the figure, the method for dynamically setting option60 in this embodiment may include:
S110,在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口的业务信息。具体的,终端设备通过网络设备(如路由器、交换机等设备)提供的用户线路接口接入网络,所述网络设备获取每个用户线路接口上的终端设备的业务信息(高清视频点播业务、电信业务以及宽带业务等)并保存。网络设备在系统初始化时,扫描本身每个用户线路接口,获取之前保存的每个用户线路接口对应的业务信息,将所述获取得到的业务信息根据请求option60的报文格式进行封装,将封装得到的报文发送给前端。S110. When the system is initialized, send option60 request information to the front end, where the option60 request information includes service information of each subscriber line interface. Specifically, a terminal device accesses the network through a user line interface provided by a network device (such as a router, a switch, etc.), and the network device obtains service information (high-definition video-on-demand service, telecommunication service, etc.) of the terminal device on each user line interface. and broadband services, etc.) and save. When the network device is initializing the system, it scans each user line interface of itself, obtains the service information corresponding to each user line interface saved before, and encapsulates the acquired service information according to the message format of the request option60, and encapsulates the obtained The message is sent to the front end.
S120,接收前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值。具体的,前端可以预先对业务信息与option60值的对应关系进行设置,当接收到option60请求信息时,解析所述option60请求信息,获取用户线路接口对应的业务信息,前端根据业务信息与option60值的对应关系,为所述业务信息分配对应的option60值。所述option60值是option60字段中表示业务信息的部分,前端可以为同样的业务信息匹配同一个option60值。例如,前端设置的业务信息与option60的对应关系如表1所示,当前端接收的网络设备的“端口1”、“端口2”和“端口3”的业务信息分别是“宽带业务”、“宽带业务”和“数字电视业务”时,前端则为“端口1”、“端口2”和“端口3”分别分配“00”、“00”和“11”的option60值。网络设备接收前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值。S120. Receive the option60 value allocated by the front end to the corresponding subscriber line interface according to the service information of each subscriber line interface. Specifically, the front-end can pre-set the corresponding relationship between service information and option60 value. When receiving the option60 request information, it parses the option60 request information to obtain the service information corresponding to the user line interface. Corresponding relationship, assign the corresponding option60 value to the service information. The option60 value is a part of the option60 field representing business information, and the front end can match the same option60 value for the same business information. For example, the corresponding relationship between the service information set by the front-end and option60 is shown in Table 1. The service information of "port 1", "port 2" and "port 3" of the network equipment received by the front-end are "broadband service", " In the case of "broadband service" and "digital TV service", the front end assigns option60 values of "00", "00" and "11" to "port 1", "port 2" and "port 3" respectively. The network device receives the option60 value allocated to the corresponding subscriber line interface according to the service information of each subscriber line interface by the front end.
可选的,当在预设的时间内前端没有返回用户线路接口的option60值,网络设备就结束本流程,等待下一次系统初始化。Optionally, when the front end does not return the option 60 value of the user line interface within the preset time, the network device ends this process and waits for the next system initialization.
表1Table 1
S130,根据接收得到的所述option60值设置对应的用户线路接口的option60。具体的,网络设备接收到前端返回的option60值之后,调用系统命令将用户线路接口对应的option60值写入proc文件中,从而实现对option60的设置,所述proc文件中包含了当前系统状态的信息,可以通过例如echo命令将数据写入proc文件中,通过例如cat命令读取proc文件中的数据。可选的,网络设备在接收到前端返回的option60值之后,可以利用例如cat命令或者直接调用上层接口读取proc文件中的每个用户线路接口当前的option60值,将每个用户线路接口当前的option60值与前端返回的对应的option60值进行比较,只有当用户线路接口当前的option60值与前端返回的option60值不同时,才调用系统命令将所述用户线路接口对应的option60值写入proc文件系统的中,触发将option60值写入内核中,以使所述内核保存前端发送的用户线路接口的option60值,所述内核是操作系统的核心,用于管理存储器、文件和系统资源。S130. Set option 60 of a corresponding subscriber line interface according to the received value of option 60. Specifically, after the network device receives the option60 value returned by the front end, it calls the system command to write the option60 value corresponding to the user line interface into the proc file, thereby realizing the setting of option60, and the proc file contains the information of the current system status , data can be written into the proc file through, for example, the echo command, and data in the proc file can be read through, for example, the cat command. Optionally, after receiving the option60 value returned by the front end, the network device can use, for example, the cat command or directly call the upper layer interface to read the current option60 value of each user line interface in the proc file, and convert the current option60 value of each user line interface to The option60 value is compared with the corresponding option60 value returned by the front end, and only when the current option60 value of the user line interface is different from the option60 value returned by the front end, the system command is called to write the option60 value corresponding to the user line interface into the proc file system In , it is triggered to write the option60 value into the kernel, so that the kernel saves the option60 value of the user line interface sent by the front end. The kernel is the core of the operating system and is used to manage memory, files and system resources.
图2是本发明实施例提供的另一种动态设置option60的方法的流程图,本实施例中的动态设置option60的可以包括:FIG. 2 is a flow chart of another method for dynamically setting option60 provided by an embodiment of the present invention. The dynamic setting of option60 in this embodiment may include:
S2110,在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口的业务信息。具体的,终端设备通过网络设备(如路由器、交换机等设备)提供的用户线路接口接入网络,所述网络设备获取每个用户线路接口上的终端设备的业务信息(高清视频点播业务、电信业务以及宽带业务等)并保存。网络设备在系统初始化时,扫描本身每个用户线路接口,获取之前保存的每个用户线路接口对应的业务信息,将所述获取得到的业务信息根据请求option60的报文格式进行封装,将封装得到的报文发送给前端。S2110. When the system is initialized, send option60 request information to the front end, where the option60 request information includes service information of each subscriber line interface. Specifically, a terminal device accesses the network through a user line interface provided by a network device (such as a router, a switch, etc.), and the network device obtains service information (high-definition video-on-demand service, telecommunication service, etc.) of the terminal device on each user line interface. and broadband services, etc.) and save. When the network device is initializing the system, it scans each user line interface of itself, obtains the service information corresponding to each user line interface saved before, and encapsulates the acquired service information according to the message format of the request option60, and encapsulates the obtained The message is sent to the front end.
S2120,接收网络设备发送的option60请求信息。具体的,前端在接收到网络设备发送的option60请求信息之前,需要设置option60值与业务信息的对应关系。所述option60值是option60字段中表示业务信息的部分,前端可以为同样的业务信息匹配同一个option60值。S2120. Receive option60 request information sent by the network device. Specifically, before the front end receives the option60 request information sent by the network device, it needs to set the corresponding relationship between the option60 value and the service information. The option60 value is a part of the option60 field representing business information, and the front end can match the same option60 value for the same business information.
S2130,根据所述每个用户线路接口的业务信息为对应的用户线路接口分配option60值。具体的,前端可以预先对业务信息与option60值的对应关系进行设置,当前端在接收到网络设备发送的option60请求信息时,解析所述option60请求信息,获取用户线路接口对应的业务信息,前端根据业务信息与option60值的对应关系,为所述业务信息分配对应的option60值。例如,前端设置的业务信息与option60的对应关系如表1所示,当前端接收的网络设备的“端口1”、“端口2”和“端口3”的业务信息分别是“宽带业务”、“宽带业务”和“数字电视业务”时,前端则为“端口1”、“端口2”和“端口3”分别分配“00”、“00”和“11”的option60值。S2130. Assign an option60 value to the corresponding user line interface according to the service information of each user line interface. Specifically, the front-end can pre-set the corresponding relationship between service information and option60 values. When the front-end receives the option60 request information sent by the network device, it parses the option60 request information to obtain the service information corresponding to the user line interface. The corresponding relationship between service information and option60 value, assigning the corresponding option60 value to the service information. For example, the corresponding relationship between the service information set by the front-end and option60 is shown in Table 1. The service information of "port 1", "port 2" and "port 3" of the network equipment received by the front-end are "broadband service", " In the case of "broadband service" and "digital TV service", the front end assigns option60 values of "00", "00" and "11" to "port 1", "port 2" and "port 3" respectively.
S2140,将所述分配得到的option60值发送给所述网络设备。具体的,前端将获取到的option60值进行封装,发送给网络设备。S2140. Send the allocated option60 value to the network device. Specifically, the front end encapsulates the obtained option60 value and sends it to the network device.
S2150,接收前端返回的每个用户线路接口的option60值。具体的,网络设备通过解析获取前端返回的每个用户线路接口的option60值。S2150, receiving the option60 value of each subscriber line interface returned by the front end. Specifically, the network device acquires the option 60 value of each subscriber line interface returned by the front end through parsing.
S2160,根据接收得到的所述option60值设置对应的用户线路接口的option60。网络设备接收到前端返回的option60值之后,调用系统命令将用户线路接口对应的option60值写入proc文件中,从而实现对option60的设置,所述proc文件中包含了当前系统状态的信息,可以通过例如echo命令将数据写入proc文件中,通过例如cat命令读取proc文件中的数据。S2160. Set option 60 of the corresponding subscriber line interface according to the received option 60 value. After the network device receives the option60 value returned by the front end, it calls the system command to write the option60 value corresponding to the user line interface into the proc file, so as to realize the setting of option60. The proc file contains the information of the current system status, which can be passed through For example, the echo command writes data into the proc file, and reads the data in the proc file through, for example, the cat command.
S2170,当获取到用户线路接口上的终端设备发送的DHCP请求信息时,判断所述DHCP请求信息中是否存在option60。具体的,当网络设备接收到DHCP请求信息时,解析所述DHCP请求信息,若所述DHCP请求信息中存在option60标识,则判断所述DHCP请求信息中存在option60,则执行步骤S2180;否则执行步骤2190。S2170. When acquiring the DHCP request information sent by the terminal device on the user line interface, determine whether option60 exists in the DHCP request information. Specifically, when the network device receives the DHCP request information, it parses the DHCP request information, and if there is an option60 identifier in the DHCP request information, then it is judged that option60 exists in the DHCP request information, and then step S2180 is performed; otherwise, step S2180 is performed; 2190.
S2180,删除所述DHCP请求信息中的所述终端设备的option60。具体的,当网络设备判断所述DHCP请求信息中存在option60时,删除所述DHCP请求信息中的option60。S2180. Delete option60 of the terminal device in the DHCP request information. Specifically, when the network device determines that option60 exists in the DHCP request information, it deletes option60 in the DHCP request information.
S2190,在所述DHCP请求信息中插入所述用户线路接口的option60。具体的,若所述DHCP请求信息中不存在option60或者在删除所述DHCP请求信息中的option60之后,在所述DHCP请求信息中插入所述用户线路接口的option60。S2190. Insert option60 of the subscriber line interface into the DHCP request information. Specifically, if option 60 does not exist in the DHCP request information or after option 60 in the DHCP request information is deleted, insert option 60 of the user line interface into the DHCP request information.
S2200,将携带所述用户线路接口的option60的DHCP请求信息发送给DHCP服务器,以使所述DHCP服务器根据所述用户线路接口的option60为所述终端设备分配对应的IP地址。具体的,网络设备将携带所述用户线路接口的option60的DHCP请求信息进行封装,发送给DHCP服务器,以使DHCP服务器为终端设备分配与所述option60对应的IP地址。S2200. Send the DHCP request information carrying option60 of the user line interface to a DHCP server, so that the DHCP server allocates a corresponding IP address for the terminal device according to option60 of the user line interface. Specifically, the network device encapsulates the DHCP request information carrying the option60 of the user line interface, and sends it to the DHCP server, so that the DHCP server assigns the terminal device an IP address corresponding to the option60.
图3是本发明实施例提供的一种动态设置option60的网络设备的结构示意图。本发明的网络设备可以包括路由器、交换机等设备,本实施例中的前端可以独立于DHCP服务器,在其他实施例中,前端也可以集成到DHCP服务器中。如图所示本发明实施例中的网络设备至少可以包括Option60请求发送模块310、Option60值接收模块320以及Option60设置模块330,其中:FIG. 3 is a schematic structural diagram of a network device for dynamically setting option60 provided by an embodiment of the present invention. The network devices of the present invention may include routers, switches and other devices. The front end in this embodiment may be independent of the DHCP server. In other embodiments, the front end may also be integrated into the DHCP server. As shown in the figure, the network device in the embodiment of the present invention may at least include an Option60 request sending module 310, an Option60 value receiving module 320, and an Option60 setting module 330, wherein:
Option60请求发送模块310,用于在系统初始化时,向前端发送option60请求信息,所述option60请求信息中包括每个用户线路接口的业务信息。具体实现中,终端设备通过用户线路接口接入网络,Option60请求发送模块310获取每个用户线路接口上的终端设备的业务信息(高清视频点播业务、电信业务以及宽带业务等)并保存。Option60请求发送模块310在系统初始化时,扫描本身每个用户线路接口,获取之前保存的每个用户线路接口对应的业务信息,将所述获取得到的业务信息根据请求option60的报文格式进行封装,将封装得到的报文发送给前端。The Option60 request sending module 310 is configured to send option60 request information to the front end when the system is initialized, and the option60 request information includes service information of each user line interface. In a specific implementation, the terminal device accesses the network through the user line interface, and the Option60 request sending module 310 obtains and saves the service information (HD video-on-demand service, telecommunication service, broadband service, etc.) of the terminal device on each user line interface. The Option60 request sending module 310 scans each user line interface of itself during system initialization, obtains the service information corresponding to each user line interface saved before, and encapsulates the service information obtained according to the message format of the request option60, Send the encapsulated packet to the front end.
Option60值接收模块320,用于接收前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值。具体实现中,前端根据所述每个用户线路接口的业务信息为对应的用户线路接口分配option60值,Option60值接收模块320接收前端返回的每个用户线路接口的option60值。option60值是option60字段中表示业务信息的部分,前端可以为同样的业务信息匹配同一个option60值。可选的,当在预设的时间内前端没有返回用户线路接口的option60值,Option60值接收模块320就结束本流程,等待下一次系统初始化。The Option60 value receiving module 320 is configured to receive the option60 value assigned by the front end to the corresponding subscriber line interface according to the service information of each subscriber line interface. In a specific implementation, the front end assigns an option60 value to the corresponding user line interface according to the service information of each user line interface, and the Option60 value receiving module 320 receives the option60 value of each user line interface returned by the front end. The option60 value is the part of the option60 field that represents business information, and the front end can match the same option60 value for the same business information. Optionally, when the front end does not return the option60 value of the subscriber line interface within the preset time, the Option60 value receiving module 320 ends this process and waits for the next system initialization.
Option60设置模块330,用于根据接收得到的所述option60值设置对应的用户线路接口的option60。具体实现中,Option60值接收模块320接收到前端返回的option60值之后,Option60设置模块330调用系统命令将用户线路接口对应的option60值写入proc文件中,从而实现对option60的设置,所述proc文件中包含了当前系统状态的信息,可以通过例如echo命令将数据写入proc文件中,通过例如cat命令读取proc文件中的数据。可选的,Option60值接收模块320在接收到前端返回的option60值之后,可以利用例如cat命令读取proc文件中的每个用户线路接口当前的option60值,Option60设置模块330将每个用户线路接口当前的option60值与前端返回的对应的option60值进行比较,只有当用户线路接口当前的option60值与前端返回的option60值不同时,才调用系统命令将所述用户线路接口对应的option60值写入proc文件系统的中,触发将option60值写入内核中,以使所述内核保存前端发送的用户线路接口的option60值,所述内核是操作系统的核心,用于管理存储器、文件和系统资源。The Option60 setting module 330 is configured to set the option60 of the corresponding subscriber line interface according to the received value of the option60. In specific implementation, after the Option60 value receiving module 320 receives the option60 value returned by the front end, the Option60 setting module 330 invokes a system command to write the option60 value corresponding to the user line interface into the proc file, thereby realizing the setting of option60, the proc file contains information about the current system status, you can use the echo command to write data into the proc file, and use the cat command to read the data in the proc file. Optionally, after the Option60 value receiving module 320 receives the option60 value returned by the front end, it can use, for example, a cat command to read the current option60 value of each subscriber line interface in the proc file, and the Option60 setting module 330 sets each subscriber line interface Compare the current option60 value with the corresponding option60 value returned by the front end, and only when the current option60 value of the user line interface is different from the option60 value returned by the front end, call the system command to write the option60 value corresponding to the user line interface into proc In the file system, it is triggered to write the option60 value into the kernel, so that the kernel saves the option60 value of the user line interface sent by the front end. The kernel is the core of the operating system and is used to manage memory, files and system resources.
可选的,本发明实施例中的网络设备还可以包括Option60判断模块340、Option60删除模块350、Option60插入模块360以及DHCP请求发送模块370,其中:Optionally, the network device in the embodiment of the present invention may also include an Option60 judging module 340, an Option60 deleting module 350, an Option60 inserting module 360, and a DHCP request sending module 370, wherein:
Option60判断模块340,用于根据接收得到的所述option60值设置对应的用户线路接口的option60之后,当获取到用户线路接口上的终端设备发送的DHCP请求信息时,判断所述DHCP请求信息中是否存在所述终端设备的option60。具体的,Option60判断模块340对所述DHCP请求信息进行解析,对解析后的DHCP请求信息进行检测,若所述DHCP请求信息中存在option60标识,则判断所述DHCP请求信息中存在所述终端设备的option60,则通知Option60删除模块350删除所述DHCP请求信息中的所述终端设备的option60。若所述DHCP请求信息中不存在option60标识,则通知Option60插入模块360在所述DHCP请求信息中插入所述终端设备所在的用户线路接口的option60。The Option60 judging module 340 is used to set the option60 of the corresponding user line interface according to the received value of the option60, and when the DHCP request information sent by the terminal device on the user line interface is obtained, judge whether the DHCP request information is There is option60 of the terminal device. Specifically, the Option60 judging module 340 parses the DHCP request information, detects the parsed DHCP request information, and if there is an option60 identifier in the DHCP request information, then judges that the terminal device exists in the DHCP request information option60, then notify the Option60 deletion module 350 to delete the option60 of the terminal device in the DHCP request information. If there is no option60 identifier in the DHCP request information, notify the Option60 inserting module 360 to insert option60 of the subscriber line interface where the terminal device is located in the DHCP request information.
Option60删除模块350,用于若所述Option60判断模块340判断所述DHCP请求信息中存在所述终端设备的option60,则删除所述DHCP请求信息中的所述终端设备的option60。The Option60 deletion module 350 is configured to delete the option 60 of the terminal device in the DHCP request information if the Option60 judging module 340 judges that the option 60 of the terminal device exists in the DHCP request information.
Option60插入模块360,用于在所述DHCP请求信息中插入所述用户线路接口的option60。具体实现中,若Option60判断模块340判断所述DHCP请求信息中不存在option60或者在Option60删除模块350删除所述DHCP请求信息中的option60之后,Option60插入模块360在所述DHCP请求信息中插入所述用户线路接口的option60。The Option60 inserting module 360 is configured to insert the option60 of the user line interface into the DHCP request information. In specific implementation, if the Option60 judgment module 340 judges that there is no option60 in the DHCP request information or after the Option60 deletion module 350 deletes the option60 in the DHCP request information, the Option60 insertion module 360 inserts the option60 for the subscriber line interface.
DHCP请求发送模块370,用于将携带所述用户线路接口的option60的DHCP请求信息发送给DHCP服务器,以使所述DHCP服务器根据所述用户线路接口的option60为所述终端设备分配对应的IP地址。具体实现中,DHCP请求发送模块370将携带所述用户线路接口的option60的DHCP请求信息进行封装,发送给DHCP服务器,以使DHCP服务器为终端设备分配与所述option60对应的IP地址。The DHCP request sending module 370 is configured to send the DHCP request information carrying the option60 of the user line interface to a DHCP server, so that the DHCP server assigns a corresponding IP address to the terminal device according to the option60 of the user line interface . In specific implementation, the DHCP request sending module 370 encapsulates the DHCP request information carrying the option60 of the user line interface, and sends it to the DHCP server, so that the DHCP server assigns the terminal device an IP address corresponding to the option60.
图4是本发明实施例提供的一种动态设置option60的前端的结构示意图,本发明的网络设备可以包括路由器、交换机等设备,本实施例中的前端可以独立于DHCP服务器,在其他实施例中,前端也可以集成到DHCP服务器中。如图所示本发明实施例中的网络设备至少可以包括Option60请求接收模块410、Option60分配模块420以及Option60发送模块430,其中:Fig. 4 is a schematic structural diagram of a front end of dynamically setting option60 provided by an embodiment of the present invention. The network equipment of the present invention may include devices such as routers and switches, and the front end in this embodiment may be independent of the DHCP server. In other embodiments , the front end can also be integrated into the DHCP server. As shown in the figure, the network device in the embodiment of the present invention may at least include an Option60 request receiving module 410, an Option60 allocating module 420, and an Option60 sending module 430, wherein:
Option60请求接收模块410,用于接收网络设备发送的option60请求信息,所述请求信息中包括所述网络设备每个用户线路接口的业务信息。Option60请求接收模块410在接收到网络设备发送的option60请求信息时,解析所述option60请求信息,获取用户线路接口对应的业务信息。The Option60 request receiving module 410 is configured to receive option60 request information sent by the network device, where the request information includes service information of each subscriber line interface of the network device. When the Option60 request receiving module 410 receives the option60 request information sent by the network device, it parses the option60 request information, and obtains the service information corresponding to the subscriber line interface.
Option60分配模块420,用于根据所述每个用户线路接口的业务信息为对应的用户线路接口分配option60值。具体实现中,Option60设置模块440可以预先对业务信息与option60值的对应关系进行设置,Option60分配模块420根据业务信息与option60值的对应关系,为所述业务信息分配对应的option60值。例如,Option60设置模块设置的业务信息与option60的对应关系如表1所示,当Option60请求接收模块410接收的网络设备的“端口1”、“端口2”和“端口3”的业务信息分别是“宽带业务”、“宽带业务”和“数字电视业务”时,Option60分配模块420则为“端口1”、“端口2”和“端口3”分别分配“00”、“00”和“11”的option60值。The Option60 assigning module 420 is configured to assign an option60 value to the corresponding subscriber line interface according to the service information of each subscriber line interface. In specific implementation, the Option60 setting module 440 may pre-set the corresponding relationship between service information and option60 values, and the Option60 allocation module 420 allocates corresponding option60 values for the service information according to the corresponding relationship between service information and option60 values. For example, the corresponding relationship between the business information set by the Option60 setting module and option60 is shown in Table 1. When the business information of "port 1", "port 2" and "port 3" of the network device received by the Option60 request receiving module 410 is During "broadband service", "broadband service" and "digital TV service", the Option60 allocation module 420 then distributes "00", "00" and "11" for "port 1", "port 2" and "port 3" respectively The option60 value.
Option60发送模块430,用于将所述分配得到的option60值发送给所述网络设备。具体实现中,Option60发送模块430将Option60分配模块420获取得到的option60值进行封装,发送给网络设备。The Option60 sending module 430, configured to send the assigned option60 value to the network device. In specific implementation, the Option60 sending module 430 encapsulates the option60 value obtained by the Option60 allocating module 420 and sends it to the network device.
可选的,本发明实施例中的前端还可以包括Option60设置模块440,其中:Optionally, the front end in the embodiment of the present invention may also include an Option60 setting module 440, wherein:
Option60设置模块440用于设置业务信息与option60的对应关系。具体实现中,网络管理员可以通过Option60设置模块440设置目前的业务与option60值的对应关系,同一种业务可以对应同一个option60值。The Option60 setting module 440 is used to set the corresponding relationship between service information and option60. In a specific implementation, the network administrator can set the corresponding relationship between the current service and the option60 value through the Option60 setting module 440, and the same service can correspond to the same option60 value.
实施本发明实施例,具有如下有益效果:本发明实施例中网络设备通过接收前端根据每个用户线路接口的业务信息为对应的用户线路接口分配得到的option60值,设置对应的用户线路接口的option60,实现了网络设备的用户线路接口option60的动态设置,为用户提供了各种业务,提高了用户体验度。Implementing the embodiment of the present invention has the following beneficial effects: In the embodiment of the present invention, the network device in the embodiment of the present invention sets the option60 value of the corresponding user line interface by receiving the option60 value assigned by the front end to the corresponding user line interface according to the service information of each user line interface , realizes the dynamic setting of the user line interface option60 of the network device, provides various services for the user, and improves the user experience.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), and the like.
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。The above disclosures are only preferred embodiments of the present invention, and certainly cannot limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310369664.0A CN103428311B (en) | 2013-08-22 | 2013-08-22 | A kind of the method for option60, the network equipment and front end are dynamically set |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310369664.0A CN103428311B (en) | 2013-08-22 | 2013-08-22 | A kind of the method for option60, the network equipment and front end are dynamically set |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103428311A CN103428311A (en) | 2013-12-04 |
CN103428311B true CN103428311B (en) | 2016-08-17 |
Family
ID=49652474
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310369664.0A Active CN103428311B (en) | 2013-08-22 | 2013-08-22 | A kind of the method for option60, the network equipment and front end are dynamically set |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103428311B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113542444B (en) * | 2021-05-20 | 2023-04-07 | 新华三大数据技术有限公司 | IP address allocation method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102394950A (en) * | 2011-12-23 | 2012-03-28 | 中国电信股份有限公司 | Method and system for IP address distribution of network security terminal under home gateway |
CN102480476A (en) * | 2010-11-30 | 2012-05-30 | 上海博路信息技术有限公司 | Multi-service access method based on DHCP protocol extension |
-
2013
- 2013-08-22 CN CN201310369664.0A patent/CN103428311B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102480476A (en) * | 2010-11-30 | 2012-05-30 | 上海博路信息技术有限公司 | Multi-service access method based on DHCP protocol extension |
CN102394950A (en) * | 2011-12-23 | 2012-03-28 | 中国电信股份有限公司 | Method and system for IP address distribution of network security terminal under home gateway |
Non-Patent Citations (1)
Title |
---|
采用Option60区分广电新业务;胡宁等;《中国有线电视》;20100331(第03期);第242-245页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103428311A (en) | 2013-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9210124B2 (en) | Method, apparatus, and system for allocating public IP address | |
CN102025798B (en) | Address allocation processing method, device and system | |
EP2169877A1 (en) | Processing method and device for qinq termination configuration | |
CN103440202B (en) | A kind of communication means based on RDMA, system and communication equipment | |
US20220417148A1 (en) | Packet Processing Method and Apparatus | |
CN110445723B (en) | Network data scheduling method and edge node | |
CN105446813A (en) | Resource distribution method and device | |
CN102082835B (en) | Method and device for distributing IP (internet protocol) addresses | |
WO2017000565A1 (en) | User access control method and apparatus, relay device and server | |
CN103338275B (en) | Port assignment method and apparatus | |
CN101883111A (en) | A billing server and method for processing online business logs | |
CN106059888A (en) | IP (Internet Protocol) address assignment method and device based on open network operating system | |
CN103297254B (en) | The method and gateway device of management address resource | |
US20200274948A1 (en) | Service flow configuration method and apparatus | |
CN103095836B (en) | The method of adjustment of internet, applications service quality and device, system | |
CN103428311B (en) | A kind of the method for option60, the network equipment and front end are dynamically set | |
WO2013159591A1 (en) | Method and apparatus for differentiating wireless terminals | |
WO2020048177A1 (en) | Set top box management method and apparatus, and device and storage medium | |
WO2017202034A1 (en) | Data packet sending and receiving method and device, and electronic apparatus | |
CN113596869B (en) | Communication method, device, electronic device and medium | |
CN114095476B (en) | Method for inquiring router interface by electronic equipment, router and communication system | |
CN105791164B (en) | Network resource allocation method and system | |
WO2008122177A1 (en) | Method, system, and terminal for determining qos grade | |
CN104754072B (en) | A kind of method and apparatus of address distribution | |
CN114448942B (en) | A DHCP message processing method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 518000 Guangdong city of Shenzhen province Nanshan District Gao Xin Road Building A14, SKYWORTH Applicant after: Shenzhen Skyworth Digital Technology Co., Ltd. Applicant after: Shenzhen Skyworth Software Co., Ltd. Address before: 518000 Guangdong city of Shenzhen province Nanshan District Gao Xin Road Building A14, SKYWORTH Applicant before: Shenzhen Skyworth Digital Technology Co., Ltd. Applicant before: Shenzhen Skyworth Software Co., Ltd. |
|
COR | Change of bibliographic data | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |