CN107154887B - Method and device for determining VLAN (virtual local area network) identification number - Google Patents

Method and device for determining VLAN (virtual local area network) identification number Download PDF

Info

Publication number
CN107154887B
CN107154887B CN201710344427.7A CN201710344427A CN107154887B CN 107154887 B CN107154887 B CN 107154887B CN 201710344427 A CN201710344427 A CN 201710344427A CN 107154887 B CN107154887 B CN 107154887B
Authority
CN
China
Prior art keywords
identification number
request
vlan identification
vlan
determining
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
Application number
CN201710344427.7A
Other languages
Chinese (zh)
Other versions
CN107154887A (en
Inventor
徐佳宏
张帆
冯志华
韩涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
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 Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN201710344427.7A priority Critical patent/CN107154887B/en
Publication of CN107154887A publication Critical patent/CN107154887A/en
Application granted granted Critical
Publication of CN107154887B publication Critical patent/CN107154887B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • H04L12/4645Details on frame tagging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/10Adaptations for transmission by electrical cable

Landscapes

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

Abstract

The invention discloses a method and a device for determining VLAN identification numbers of a virtual local area network, which are applied to a routing module, and the method comprises the steps of firstly receiving two VLAN identification numbers sent by an EOC module, then determining an initial IP request, aiming at the two VLAN identification numbers, executing a data packet detection process by using a carrier taking the initial IP request as the VLAN identification numbers until a target network packet which is sent by a server and responds to the IP request and has the same network protocol type with the initial IP request is captured, finally determining the VLAN identification numbers in the target network packet as VLAN identification numbers of a device for generating the IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device. The method and the device for determining the VLAN identification number of the virtual local area network realize the distinguishing of the two VLAN identification numbers through the routing module without the need of conversion chip processing, reduce the volume of the fusion terminal and save the production cost of the fusion terminal.

Description

Method and device for determining VLAN (virtual local area network) identification number
Technical Field
The invention relates to the field of convergence terminals, in particular to a method and a device for determining a Virtual Local Area Network (VLAN) identification number.
Background
The convergence terminal comprises a set top box, a routing module and an EOC (Ethernet Over Cable, which is an access technology based on a Cable television coaxial Cable network and using an Ethernet protocol) module, and is novel household intelligent terminal equipment. The convergence terminal has the functions of a digital television set top box and an intelligent router at the same time, and can perform deep service convergence aiming at digital television services under the home gateway environment provided by the routing module, thereby meeting the requirements of users on broadband access, wireless internet access, live broadcast, on-demand, review and the like.
Because the set-top box and the routing module are two modules with different functions, and corresponding Network environments also need to be isolated, after the convergence terminal is started, the EOC module issues a Network message containing two VLAN (Virtual Local Area Network) identification numbers to the routing module according to the setting of the server, wherein one of the two VLAN identification numbers corresponds to the set-top box, and the other corresponds to the routing module. In the prior art, before sending two network messages to a router, an EOC module may first identify whether a module corresponding to a VLAN identification number is a set top box or a routing module through a conversion chip, such as an RT8306E chip, according to network data ports of a set top box and a router configured in a system and information carried in the network messages, and write different tag data in the corresponding network messages after identifying the module corresponding to the VLAN identification number, and after receiving the two network messages, the routing module determines which VLAN identification number is its own and which VLAN identification number is the set top box according to the tag data carried in the network messages.
In the prior art, the network message needs to be identified by the conversion chip, and the VLAN identification number of the virtual local area network corresponding to the set top box and the routing module can be determined.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for determining a VLAN identifier, so as to overcome the problems in the prior art that a convergence terminal is large in size and high in cost due to the fact that a conversion chip is required to identify an IP of a virtual local area network corresponding to a set top box and a routing module.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for determining VLAN identification number of virtual local area network is applied to a routing module, and comprises the following steps:
receiving two VLAN identification numbers sent by an EOC module; one VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box;
determining an initial IP request; the initial IP request is generated by the routing module or the set top box;
executing a data packet detection process until capturing a target network packet which is sent by the server and has the same network protocol type as the initial IP request; the data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module;
and determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device.
Optionally, if the initial IP request is an initial IP request of a set top box, and the target network packet is a DHCP packet, the performing a data packet detection procedure until a target network packet that is sent by a server and has the same network protocol type as the initial IP request is captured includes:
executing a data packet detection process until a DHCP packet sent by a server is captured;
the determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request and the correspondingly determining the other VLAN identification number as the VLAN identification number of the other device includes:
and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
Optionally, after determining the VLAN identifier in the DHCP packet as the VLAN identifier of the set-top box and determining another VLAN identifier as the VLAN identifier of the routing module, the method further includes:
and generating a routing module complete IP request based on the determined VLAN identification number of the routing module, and sending the routing module complete IP request to a server through the EOC module.
Optionally, for the two VLAN identification numbers, the following steps are performed alternately: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module, wherein the method comprises the following steps:
alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
Optionally, after determining the VLAN identifier in the target network packet as the VLAN identifier of the device that generates the initial IP request and determining another VLAN identifier as the VLAN identifier of another device, the method further includes:
and setting network data parameters according to the determined VLAN identification number of the routing module and the VLAN identification number of the set-top box.
An apparatus for determining VLAN identification number of virtual local area network, applied to a routing module, includes:
the receiving module is used for receiving the two VLAN identification numbers sent by the EOC module; one VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box;
a request determining module for determining an initial IP request; the initial IP request is generated by the routing module or the set top box;
the detection and grabbing module is used for executing a data packet detection process until a target network packet which is sent by the server and has the same network protocol type as the initial IP request is grabbed; the data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module;
and the identification number determining module is used for determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device.
Optionally, if the initial IP request is an initial IP request of a set top box, and the target network packet is a DHCP packet, the detecting and capturing module is configured to:
executing a data packet detection process until a DHCP packet sent by a server is captured;
the identification number determination module is configured to:
and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
Optionally, the method further includes:
and the request generation module is used for generating a complete IP request of the routing module based on the determined VLAN identification number of the routing module and sending the complete IP request to the server through the EOC module.
Optionally, the detection grabbing module is specifically configured to:
alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
Optionally, the method further includes:
and the parameter setting module is used for setting network data parameters according to the determined VLAN identification number of the routing module and the VLAN identification number of the set-top box.
As can be seen from the above technical solutions, compared with the prior art, the embodiment of the present invention discloses a method for determining VLAN identification numbers of a virtual local area network, which is applied to a routing module, and is implemented by first receiving two VLAN identification numbers sent by an EOC module, then determining an initial IP request, performing a packet detection procedure for the two VLAN identification numbers by using a carrier with the initial IP request as the VLAN identification number until capturing a target network packet which is sent by a server and responds to the IP request and has the same network protocol type as the initial IP request, and finally determining the VLAN identification number in the target network packet as a VLAN identification number of a device generating the IP request, and correspondingly determining another VLAN identification number as a VLAN identification number of another device. The method and the device for determining the VLAN identification number of the virtual local area network realize the distinguishing of the two VLAN identification numbers through the routing module without the need of conversion chip processing, reduce the volume of the fusion terminal and save the production cost of the fusion terminal.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a first flowchart of a method for determining VLAN id of a VLAN according to the present invention;
fig. 2 is a second flowchart of the method for determining VLAN id of VLAN in accordance with the present invention;
fig. 3 is a third flowchart of the method for determining VLAN id of VLAN according to the present invention;
fig. 4 is a schematic diagram of a first structure of the apparatus for determining a VLAN id of a VLAN according to the present invention;
fig. 5 is a schematic diagram of a second structure of the apparatus for determining a VLAN id of a VLAN according to the present invention;
fig. 6 is a schematic diagram of a third structure of the apparatus for determining a VLAN id of a VLAN according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a first flowchart of a method for determining a VLAN id according to an embodiment of the present invention, where the method for determining a VLAN id is applied to a routing module, and as shown in fig. 1, the method may include:
step 101: and receiving two VLAN identification numbers sent by the EOC module.
One VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box. After receiving the two VLAN identification numbers, the routing module cannot determine which VLAN identification number is its own and which VLAN identification number is for the set-top box.
Step 102: an initial IP request is determined.
The initial IP request is generated by the routing module or the set-top box.
After the convergence terminal is powered on, the set-top box and the routing module both need to generate an IP request for requesting an external network IP and send the IP request to the server, and the subsequent set-top box and the routing module can normally perform network work only after the server returns a corresponding IP address according to the IP request. The IP request needs to carry a VLAN identification number, the IP request without the VLAN identification number is an initial IP request, and the IP request written with the VLAN identification number is a complete IP request. The work of writing the VLAN identification number in the initial IP request is completed by the routing module. Since the routing module cannot determine which device the two VLAN identifiers correspond to, the routing module needs to first distinguish the device corresponding to the VLAN identifier by means of packet detection. For a specific packet detection process, see the following.
Step 103: and executing a data packet detection process until capturing a target network packet which is sent by the server and has the same network protocol type as the initial IP request.
The data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
The packet detection process may specifically be: alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
The network communication protocols of the set-top box and the routing module are different, the IP requests generated by the two devices are transmitted by using different network protocols, the IP request of the set-top box is transmitted by using a DHCP (Dynamic host configuration Protocol), which is a network Protocol of a local area network, and the IP request of the routing module is transmitted by using a PPPOE (Point to Point Protocol over Ethernet) Protocol.
Because different IP requests are transmitted by adopting different network protocols, the IP requests and the generating devices (set top boxes or routing modules) thereof have a first corresponding relation, and the VLAN identification codes and the devices (set top boxes or routing modules) have a second corresponding relation, the IP requests and the VLAN identification codes also have an indirect corresponding relation. In this embodiment, any one of the two VLAN identifiers is taken as the VLAN identifier corresponding to the initial IP request, and the corresponding VLAN identifier is written into the initial IP request, so as to generate a complete IP request. Then the complete IP request is sent to a server through an EOC module, and if the subsequent routing module receives a response packet of the server, the corresponding relation between the initial IP request and the VLAN identification code is determined to be correct; and if the response packet of the server is not received, writing another VLAN identification code into the initial IP request to generate a complete IP request, and sending the complete IP request to the server through the EOC module.
It should be noted that the server side is configured with the VLAN identifier of the set-top box and the VLAN identifier of the routing module. Only when the complete IP request is correct corresponding to the VLAN identification number carried by the complete IP request, the switch at the front side of the server end can send the complete IP request to the server according to the corresponding relation between the VLAN identification number and the communication protocol, and the server can respond to the corresponding response packet according to the complete IP request. Therefore, in this embodiment, the routing module writes any VLAN identification number into the initial IP request in a round-robin manner, generates a complete IP request, and sends the complete IP request to the server, and determines whether the VLAN identification number corresponds to the initial IP request according to a response condition of the server, thereby determining a correspondence between a device that generates the initial IP request and the VLAN identification number.
The target network packet also carries a VLAN identification number, and the VLAN identification number is the same as the VLAN identification number carried in the complete IP request received by the server. Because the VLAN tag occupies 4 bytes in the Ethernet frame, namely the data frame with the VLAN tag has 4 bytes more than the common Ethernet frame, the 4 bytes contain the tag protocol identification with 2 bytes and the tag control information with 2 bytes, and whether the network packet carries the VLAN identification number or not can be distinguished by distinguishing the length of the Ethernet frame.
After step 103, the process proceeds to step 104.
Step 104: and determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device.
After receiving a response packet returned by the server according to the complete IP request, the routing module may determine that the VLAN identifier in the complete IP request packet is the VLAN identifier of the device that generated the initial IP request, and that another VLAN identifier corresponds to the VLAN identifier of another device.
In this embodiment, the method for determining a VLAN identification number of a virtual local area network first receives two VLAN identification numbers sent by an EOC module, then determines an initial IP request, and performs a packet detection procedure with a carrier using the initial IP request as the VLAN identification number for the two VLAN identification numbers until a target network packet which is sent by a server and responds to the IP request and has the same network protocol type as the initial IP request is captured, and finally determines the VLAN identification number in the target network packet as a VLAN identification number of a device which generates the initial IP request, and correspondingly determines another VLAN identification number as a VLAN identification number of another device. The method realizes the distinguishing of the two VLAN identification numbers through the routing module without the need of conversion chip processing, reduces the volume of the fusion terminal and saves the production cost of the fusion terminal.
In a case that the initial IP request is a set-top box IP request, and the target network packet is a DHCP packet, referring to fig. 2, fig. 2 is a second flowchart of a method for determining a VLAN identifier in a virtual local area network disclosed in the embodiment of the present invention, where the method for determining a VLAN identifier may include:
step 201: and receiving two VLAN identification numbers sent by the EOC module.
One VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box
Step 202: an initial IP request for the set-top box is determined.
The set-top box initial IP request is generated by the set-top box and then sent to the routing module. All data interaction between the set-top box and the server needs to be relayed through the routing module.
Step 203: and executing the data packet detection process until the DHCP packet sent by the server is grabbed.
The data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: and writing a VLAN identification number into the set-top box initial IP request to generate a set-top box complete IP request, and sending the set-top box complete IP request to a server through an EOC module.
Since the end numbers for DHCP network packets are UDP67 and UDP 68. It is possible to determine whether it is a DHCP packet by determining the port number in the network packet header.
Step 204: and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
Of course, the initial IP request may also be a routing module IP request, and at this time, the target network packet is a PPPOE packet. The specific processing procedure is similar to that shown in fig. 2, and will not be described in detail here.
Since the response speed of the DHCP packet is usually faster than that of the PPPOE packet, the embodiment shown in fig. 2 may be adopted to determine the VLAN id of the VLAN in the case that there is no specific limitation in practical applications.
In other embodiments, after determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box and determining another VLAN identification number as the VLAN identification number of the routing module, the method may further include: and generating a routing module complete IP request based on the determined VLAN identification number of the routing module, and sending the routing module complete IP request to a server through the EOC module.
The set top box and the routing module generate complete IP requests to be sent to the server, and when response packets returned by the server are received, the set top box and the routing module successfully apply for external network IP, and then the routing module and the set top box can perform normal data interaction with the server.
On the basis of the above embodiment disclosed by the present invention, fig. 3 discloses a third flowchart of a method for determining a VLAN id, where the method is applied to a routing module, and as shown in fig. 3, the method may include:
step 301: and receiving two VLAN identification numbers sent by the EOC module.
One VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box
Step 302: an initial IP request for a set-top box is determined.
The initial IP request is generated by the routing module or the set-top box.
Step 303: and executing the data packet detection process until the DHCP packet sent by the server is grabbed.
The data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: and writing a VLAN identification number into the set-top box initial IP request to generate a set-top box complete IP request, and sending the set-top box complete IP request to a server through an EOC module.
Step 304: and determining the VLAN identification number in the target network packet as the VLAN identification number of the set top box, and correspondingly determining the other VLAN identification number as the VLAN identification number of the routing module.
Step 305: and setting network data parameters according to the determined VLAN identification number of the routing module and the VLAN identification number of the set-top box.
Setting network data parameters, subsequently adding the VLAN identification number of the determined set top box to the data sent by the set top box, adding the VLAN identification number of the determined routing module to the data generated by the routing module, and then sending the data to a server, so that the server can accurately receive the data sent by the set top box and the routing module. After receiving the data sent by the server, the routing module may also determine whether the data is sent to the routing module itself or the set-top box according to the VLAN identifier in the data, and if the data is sent to the set-top box, the routing module sends the data to the set-top box.
In this embodiment, after the VLAN identification numbers corresponding to the set-top box and the routing module are determined, network data parameters are set according to the determined VLAN identification number of the routing module and the determined VLAN identification number of the set-top box, so that it is ensured that subsequent data interaction between the routing module and the server, and between the set-top box and the server, can be performed normally and accurately.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
The method is described in detail in the embodiments disclosed above, and the method of the present invention can be implemented by various types of apparatuses, so that the present invention also discloses an apparatus, and the following detailed description will be given of specific embodiments.
Fig. 4 is a schematic view of a first structure of the apparatus for determining a VLAN id according to the present disclosure, where the apparatus for determining a VLAN id is applied to a routing module, and as shown in fig. 4, the apparatus 40 for determining a VLAN id may include:
a receiving module 401, configured to receive the two VLAN identifier sent by the EOC module.
One VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box. After receiving the two VLAN identification numbers, the routing module cannot determine which VLAN identification number is its own and which VLAN identification number is for the set-top box.
A request determining module 402 for determining an initial IP request.
The initial IP request is generated by the routing module or the set-top box.
After the convergence terminal is powered on, the set-top box and the routing module both need to generate an IP request for requesting an external network IP and send the IP request to the server, and the subsequent set-top box and the routing module can normally perform network work only after the server returns a corresponding IP address according to the IP request. The IP request needs to carry a VLAN identification number, the IP request without the VLAN identification number is an initial IP request, and the IP request written with the VLAN identification number is a complete IP request. The work of writing the VLAN identification number in the initial IP request is completed by the routing module. Since the routing module cannot determine which device the two VLAN identifiers correspond to, the routing module needs to first distinguish the device corresponding to the VLAN identifier by means of packet detection. For a specific packet detection process, see the following.
And a probe capture module 403, configured to perform a packet probe process until capturing a target network packet that is sent by the server and has the same network protocol type as the initial IP request.
The data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
The probe capture module may be specifically configured to: alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module. And capturing a target network packet which is sent by the server and has the same network protocol type as the initial IP request.
The network communication protocols of the set-top box and the routing module are different, the IP requests generated by the two devices are transmitted by adopting different network protocols, the IP request of the set-top box is transmitted by adopting a DHCP protocol, and the IP request of the routing module is transmitted by adopting a PPPOE protocol.
Because different IP requests are transmitted by adopting different network protocols, the IP requests and the generating devices (set top boxes or routing modules) thereof have a first corresponding relation, and the VLAN identification codes and the devices (set top boxes or routing modules) have a second corresponding relation, the IP requests and the VLAN identification codes also have an indirect corresponding relation. In this embodiment, any one of the two VLAN identifiers is taken as the VLAN identifier corresponding to the initial IP request, and the corresponding VLAN identifier is written into the initial IP request, so as to generate a complete IP request. Then the complete IP request is sent to a server through an EOC module, and if the subsequent routing module receives a response packet of the server, the corresponding relation between the initial IP request and the VLAN identification code is determined to be correct; and if the response packet of the server is not received, writing another VLAN identification code into the initial IP request to generate a complete IP request, and sending the complete IP request to the server through the EOC module.
It should be noted that the server side is configured with the VLAN identifier of the set-top box and the VLAN identifier of the routing module. Only when the complete IP request is correct corresponding to the VLAN identification number carried by the complete IP request, the switch at the front side of the server end can send the complete IP request to the server according to the corresponding relation between the VLAN identification number and the communication protocol, and the server can respond to the corresponding response packet according to the complete IP request. Therefore, in this embodiment, the routing module writes any VLAN identification number into the initial IP request in a round-robin manner, generates a complete IP request, and sends the complete IP request to the server, and determines whether the VLAN identification number corresponds to the initial IP request according to a response condition of the server, thereby determining a correspondence between a device that generates the initial IP request and the VLAN identification number.
The target network packet also carries a VLAN identification number, and the VLAN identification number is the same as the VLAN identification number carried in the complete IP request received by the server. Because the VLAN tag occupies 4 bytes in the Ethernet frame, namely the data frame with the VLAN tag has 4 bytes more than the common Ethernet frame, the 4 bytes contain the tag protocol identification with 2 bytes and the tag control information with 2 bytes, and whether the network packet carries the VLAN identification number or not can be distinguished by distinguishing the length of the Ethernet frame.
An identification number determining module 404, configured to determine the VLAN identification number in the target network packet as the VLAN identification number of the device that generated the initial IP request, and correspondingly determine another VLAN identification number as the VLAN identification number of another device.
After receiving a response packet returned by the server according to the complete IP request, the routing module may determine that the VLAN identifier in the complete IP request packet is the VLAN identifier of the device that generated the initial IP request, and that another VLAN identifier corresponds to the VLAN identifier of another device.
In this embodiment, the device for determining a VLAN identification number of a virtual local area network first receives two VLAN identification numbers sent by an EOC module, then determines an initial IP request, and performs a packet detection procedure with a carrier using the initial IP request as the VLAN identification number for the two VLAN identification numbers until a target network packet which is sent by a server and responds to the IP request and has the same network protocol type as the initial IP request is captured, and finally determines the VLAN identification number in the target network packet as a VLAN identification number of a device which generates the initial IP request, and correspondingly determines another VLAN identification number as a VLAN identification number of another device. The device realizes the distinguishing of two VLAN identification numbers, does not need to convert a chip for processing, reduces the volume of the fusion terminal and saves the production cost of the fusion terminal.
When the initial IP request is an initial IP request of a set top box and the target network packet is a DHCP packet, the probe capture module 403 may be configured to: and executing the data packet detection process until the DHCP packet sent by the server is grabbed. The identification number determination module 404 may be configured to: and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
Of course, the initial IP request may also be a routing module IP request, and at this time, the target network packet is a PPPOE packet. The specific processing procedure is similar to that when the initial IP request is the set-top box initial IP request, and details are not repeated here.
Fig. 5 is a schematic diagram of a second structure of the apparatus for determining a VLAN identifier in a virtual local area network according to the embodiment of the present invention, as shown in fig. 5, in addition to the receiving module 401, the request determining module 402, the probe crawling module 403, and the identifier determining module 404, the apparatus may further include:
a request generating module 501, configured to generate a complete IP request of a routing module based on the determined VLAN id of the routing module, and send the complete IP request to a server through the EOC module.
The set top box and the routing module generate complete IP requests to be sent to the server, and when response packets returned by the server are received, the set top box and the routing module successfully apply for external network IP, and then the routing module and the set top box can perform normal data interaction with the server.
On the basis of the above embodiment disclosed by the present invention, fig. 6 discloses a schematic diagram of a third structure of a device for determining a VLAN id, where the device is applied to a routing module, and as shown in fig. 6, the device may include:
a receiving module 401, configured to receive the two VLAN identifier sent by the EOC module.
One VLAN identification number is the VLAN identification number of the routing module, and the other VLAN identification number is the VLAN identification number of the set-top box.
A request determining module 402 for determining an initial IP request; the initial IP request is generated by the routing module or the set top box;
and a probe capture module 403, configured to perform a packet probe process until capturing a target network packet that is sent by the server and has the same network protocol type as the initial IP request.
The data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
An identification number determining module 404, configured to determine the VLAN identification number in the target network packet as the VLAN identification number of the device that generated the initial IP request, and correspondingly determine another VLAN identification number as the VLAN identification number of another device.
And the parameter setting module 601 is configured to set network data parameters according to the determined VLAN identification number of the routing module and the determined VLAN identification number of the set top box.
Setting network data parameters, subsequently adding the VLAN identification number of the determined set top box to the data sent by the set top box, adding the VLAN identification number of the determined routing module to the data generated by the routing module, and then sending the data to a server, so that the server can accurately receive the data sent by the set top box and the routing module. After receiving the data sent by the server, the routing module may also determine whether the data is sent to the routing module itself or the set-top box according to the VLAN identifier in the data, and if the data is sent to the set-top box, the routing module sends the data to the set-top box.
In this embodiment, after the VLAN identification numbers corresponding to the set-top box and the routing module are determined, network data parameters are set according to the determined VLAN identification number of the routing module and the determined VLAN identification number of the set-top box, so that it is ensured that subsequent data interaction between the routing module and the server, and between the set-top box and the server, can be performed normally and accurately.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for determining VLAN identification number of virtual local area network is applied to a routing module, and is characterized by comprising the following steps:
receiving two VLAN identification numbers sent by an EOC module; one VLAN identification number is a VLAN identification number of the routing module, the other VLAN identification number is a VLAN identification number of the set-top box, and the network protocols of the set-top box and the routing module are different;
determining an initial IP request; the initial IP request is generated by the routing module or the set top box;
executing a data packet detection process until capturing a target network packet which is sent by a server under the condition that the network protocol of the complete IP request corresponds to the VLAN identification number carried by the complete IP request correctly and has the same type as the network protocol of the initial IP request; the data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module;
and determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device.
2. The method according to claim 1, wherein if the initial IP request is an initial IP request of a set-top box and the target network packet is a DHCP packet, the performing the packet probing procedure until capturing a target network packet sent by a server and having a same network protocol type as the initial IP request comprises:
executing a data packet detection process until a DHCP packet sent by a server is captured;
the determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request and the correspondingly determining the other VLAN identification number as the VLAN identification number of the other device includes:
and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
3. The method of claim 2, wherein after determining the VLAN id in the DHCP packet as the VLAN id of the set-top box and another VLAN id as the VLAN id of the routing module, the method further comprises:
and generating a routing module complete IP request based on the determined VLAN identification number of the routing module, and sending the routing module complete IP request to a server through the EOC module.
4. Method for determining a VLAN identification number according to claim 1, characterized in that said alternating for said two VLAN identification numbers is performed: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module, wherein the method comprises the following steps:
alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
5. The method of claim 1, wherein after determining the VLAN id in the target network packet as the VLAN id of the device generating the initial IP request and determining another VLAN id as the VLAN id of another device, the method further comprises:
and setting network data parameters according to the determined VLAN identification number of the routing module and the VLAN identification number of the set-top box.
6. A device for determining VLAN identification number is applied to a routing module, and is characterized in that the device comprises:
the receiving module is used for receiving the two VLAN identification numbers sent by the EOC module; one VLAN identification number is a VLAN identification number of the routing module, the other VLAN identification number is a VLAN identification number of the set-top box, and the network protocols of the set-top box and the routing module are different;
a request determining module for determining an initial IP request; the initial IP request is generated by the routing module or the set top box;
the detection and grabbing module is used for executing a data packet detection process until a target network packet which is sent by the server under the condition that the network protocol of the complete IP request corresponds to the VLAN identification number carried by the complete IP request correctly and has the same type as the network protocol of the initial IP request is grabbed; the data packet detection process comprises the following steps: alternately performing for the two VLAN identification numbers: writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module;
and the identification number determining module is used for determining the VLAN identification number in the target network packet as the VLAN identification number of the device generating the initial IP request, and correspondingly determining the other VLAN identification number as the VLAN identification number of the other device.
7. The apparatus of claim 6, wherein the initial IP request is an initial IP request of a set-top box, and the target network packet is a DHCP packet, and the probe capture module is configured to:
executing a data packet detection process until a DHCP packet sent by a server is captured;
the identification number determination module is configured to:
and determining the VLAN identification number in the DHCP packet as the VLAN identification number of the set top box, and determining the other VLAN identification number as the VLAN identification number of the routing module.
8. The apparatus for determining VLAN identification number as set forth in claim 7, further comprising:
and the request generation module is used for generating a complete IP request of the routing module based on the determined VLAN identification number of the routing module and sending the complete IP request to the server through the EOC module.
9. The apparatus for determining a VLAN id of a VLAN as claimed in claim 6, wherein said probe capture module is specifically configured to:
alternately performing at fixed time intervals for the two VLAN identification numbers: and writing a VLAN identification number into the initial IP request to generate a complete IP request, and sending the complete IP request to a server through an EOC module.
10. The apparatus for determining VLAN identification numbers of claim 6, further comprising:
and the parameter setting module is used for setting network data parameters according to the determined VLAN identification number of the routing module and the VLAN identification number of the set-top box.
CN201710344427.7A 2017-05-16 2017-05-16 Method and device for determining VLAN (virtual local area network) identification number Active CN107154887B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710344427.7A CN107154887B (en) 2017-05-16 2017-05-16 Method and device for determining VLAN (virtual local area network) identification number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710344427.7A CN107154887B (en) 2017-05-16 2017-05-16 Method and device for determining VLAN (virtual local area network) identification number

Publications (2)

Publication Number Publication Date
CN107154887A CN107154887A (en) 2017-09-12
CN107154887B true CN107154887B (en) 2021-02-09

Family

ID=59794086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710344427.7A Active CN107154887B (en) 2017-05-16 2017-05-16 Method and device for determining VLAN (virtual local area network) identification number

Country Status (1)

Country Link
CN (1) CN107154887B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022250B (en) * 2018-01-10 2021-11-12 中兴通讯股份有限公司 Service processing method, terminal and computer storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620020A (en) * 2003-11-20 2005-05-25 国际商业机器公司 Automatic configuration of the network devices via connection to specific switch ports
CN1956414A (en) * 2005-10-27 2007-05-02 国际商业机器公司 Method of discovering automatic vlan id and net terminal
EP1876754A4 (en) * 2005-04-29 2008-06-18 Huawei Tech Co Ltd Method system and server for implementing dhcp address security allocation
CN101883158A (en) * 2010-06-28 2010-11-10 中兴通讯股份有限公司 Method and client for acquiring VLAN (Virtual Local Area Network) IDs (Identifiers) and network protocol addresses
CN101997778A (en) * 2010-11-19 2011-03-30 中兴通讯股份有限公司 Method and device for sending messages
CN102185766A (en) * 2011-04-26 2011-09-14 杭州华三通信技术有限公司 Unicast forwarding method and forwarding equipment for responding messages by DHCP (Dynamic host configuration protocol) server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620020A (en) * 2003-11-20 2005-05-25 国际商业机器公司 Automatic configuration of the network devices via connection to specific switch ports
EP1876754A4 (en) * 2005-04-29 2008-06-18 Huawei Tech Co Ltd Method system and server for implementing dhcp address security allocation
CN1956414A (en) * 2005-10-27 2007-05-02 国际商业机器公司 Method of discovering automatic vlan id and net terminal
CN100574272C (en) * 2005-10-27 2009-12-23 国际商业机器公司 The method and the network terminal that automatic virtual local area network identifiers is found
CN101883158A (en) * 2010-06-28 2010-11-10 中兴通讯股份有限公司 Method and client for acquiring VLAN (Virtual Local Area Network) IDs (Identifiers) and network protocol addresses
CN101997778A (en) * 2010-11-19 2011-03-30 中兴通讯股份有限公司 Method and device for sending messages
CN102185766A (en) * 2011-04-26 2011-09-14 杭州华三通信技术有限公司 Unicast forwarding method and forwarding equipment for responding messages by DHCP (Dynamic host configuration protocol) server

Also Published As

Publication number Publication date
CN107154887A (en) 2017-09-12

Similar Documents

Publication Publication Date Title
US11405314B2 (en) Packet processing method and apparatus
US9832070B2 (en) Communication terminal with multiple virtual network interfaces
US20110246663A1 (en) Broadband network access
CN106559292A (en) A kind of broad band access method and device
CN102710811B (en) Realize method and the switch of dhcp address safety distribution
US20160226817A1 (en) Apparatus and method for creating block-type structure using sketch-based user interaction
CN105959188B (en) Method and device for controlling user terminal to be on-line
US9992159B2 (en) Communication information detecting device and communication information detecting method
CN111464479B (en) Method and system for identifying user identity of terminal equipment
CN108093390A (en) A kind of smart machine of feature based information finds method
CN112020862B (en) Method, system, and computer-readable storage medium for identifying devices on a remote network
CN104040989B (en) Gateway, and corresponding method, computer program and storage device
CN107154887B (en) Method and device for determining VLAN (virtual local area network) identification number
CN110943962B (en) Authentication method, network equipment, authentication server and forwarding equipment
KR101959733B1 (en) Method and device for configuring a switch which is newly connected to a network by performing auto-ip provision to acqure information on a network by using arp packets passing by itself
CN106375489B (en) Method and device for processing Media Access Control (MAC) address
WO2016095751A1 (en) Domain name analysis method and apparatus
CN104168302A (en) Device control realizing method, device control realizing system and proxy gateway
CN104854930A (en) Method, control node, gateway and computer program for enabling communication with a newly detected device
CN106470249A (en) Gateway-whois domain name registration querying method and device
CN109842692A (en) VxLAN switch, system and method for obtaining host information in physical network
US9912557B2 (en) Node information detection apparatus, node information detection method, and program
CN103001930A (en) Remote data communication system
CN111614791A (en) Access device for entity link analysis and method thereof
CN111343056A (en) Communication method, storage medium, equipment, receiving terminal and sending terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant