WO2017071350A1 - Port data separation method and device - Google Patents

Port data separation method and device Download PDF

Info

Publication number
WO2017071350A1
WO2017071350A1 PCT/CN2016/092424 CN2016092424W WO2017071350A1 WO 2017071350 A1 WO2017071350 A1 WO 2017071350A1 CN 2016092424 W CN2016092424 W CN 2016092424W WO 2017071350 A1 WO2017071350 A1 WO 2017071350A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
local area
vlanid
virtual local
identifier
Prior art date
Application number
PCT/CN2016/092424
Other languages
French (fr)
Chinese (zh)
Inventor
封春望
Original Assignee
华讯方舟科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华讯方舟科技有限公司 filed Critical 华讯方舟科技有限公司
Publication of WO2017071350A1 publication Critical patent/WO2017071350A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • 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
    • 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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication

Definitions

  • the present invention belongs to the field of communications, and in particular, to a port data separation method and apparatus.
  • a method for implementing port data separation generally sends a data packet through a protocol stack, creates a vlan interface through a standard vlan channel, and then encapsulates and distributes the user data packet in the protocol stack.
  • the access point fitAP may be overloaded. This is because the packet efficiency of the access point of the accessAP protocol stack is low. Since the user data packet needs to be forwarded through the protocol stack layer, this will occupy a large amount of system resources, and the network device receives the data packet, Also need to unpack, remove the ta g logo. In this way, each time a data packet is sent, the data packet needs to be encapsulated once.
  • the data packet needs to be unpacked once, and the system resources are required to complete the packet encapsulation and unpacking operation in the protocol stack, when the user is very ⁇ , it will affect the normal operation of the field network, in response to normal use by users.
  • An object of the present invention is to provide a method for separating port data, so as to solve the problem that if the data of the user connected by the access point is very large, and the system resources need to be consumed to complete the packetization and unpacking operation of the protocol stack, Affect the normal operation of the on-site network and respond to problems with normal user use.
  • an embodiment of the present invention provides a port data separation method, where the method includes:
  • the protocol stack packet process After receiving the data sent by the downlink port, the protocol stack packet process is ignored, and the data is sent Up to the upper layer network, determining a corresponding virtual local area network identifier vlanid according to the received data, and adding the data to the virtual local area network identifier vlanid;
  • the received data is parsed to obtain a virtual local area network identifier vlanid, and the data is forwarded to the corresponding port according to the virtual local area network identifier vlanid.
  • the determining, by the received data, the corresponding virtual local area network identifier vlanid includes:
  • the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid
  • the step of adding the data to the virtual local area network identifier vlanid includes:
  • the data is moved backward, and a structure control head space is obtained before the data storage location of the data storage area;
  • the port data separation method is based on a ⁇ base station fit AP.
  • an embodiment of the present invention provides a port data separation method, where the method includes: [0022] an identifier adding unit, configured to ignore a protocol stack packet process after receiving data sent by a downlink port, And after transmitting the data to the upper layer network, determining a corresponding virtual local area network standard according to the received data Identify vlanid, and add the data to the virtual local area network identifier vlanid;
  • the identifier parsing unit is configured to: after receiving the data sent by the upper layer network, parse the received data to obtain a virtual local area network identifier vlanid, and forward the data to the corresponding port according to the virtual local area network identifier vlanid.
  • the identifier adding unit includes
  • an extraction subunit configured to extract a source MAC address and a source network card device name in the received data
  • a determining subunit configured to determine whether the source network card device name is the same as a preset network card device name; [0027] a first identifier subunit, configured to: if the source network card device name and a preset network card device If the name is the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
  • a second identifier subunit configured to: if the source network card device name and the preset network card device name are different, search for a corresponding wireless interface according to the source MAC address, and determine a corresponding virtual local area network according to the wireless interface. Identifies the vlanid.
  • the identifier adding unit includes
  • a shift subunit configured to: in the data storage area, move the data backward, and obtain a structure control head space before the data storage location of the data storage area;
  • the identifier writing subunit is configured to clear the value of the structure control header space and write the corresponding virtual local area network identifier vlanid.
  • the identifier parsing unit is specifically configured to:
  • the port data separation method is based on a ⁇ base station fit AP.
  • the packet flow of the protocol stack is ignored, and the data is After being sent to the upper layer network, determining a corresponding virtual local area network identifier according to the data, adding the virtual network identifier to the data, and receiving the data of the upper layer network, parsing the received data to obtain a virtual local area network identifier, according to the The virtual local area network identifier forwards the data to the corresponding port, thereby avoiding data entry into the protocol stack and unpacking operations, improving data processing efficiency, reducing system resource consumption, and thus being better adapted to multi-user peer use. Claim.
  • FIG. 1 is a flowchart of an implementation of a method for separating port data according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of implementing a method for determining a corresponding virtual local area network identifier according to received data according to a second embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a port data separating apparatus according to a third embodiment of the present invention.
  • the purpose of the embodiment of the present invention is to solve the problem that in the prior art, because multiple people use the same access point, such as an access point, the access point may be overloaded, because the access point is It is necessary to use the protocol stack to perform layer-by-layer forwarding of data packets, which will occupy a large amount of system resources. After receiving data, it needs to be unpacked, and a data packet needs to be packetized, which wastes a lot of system resources, thereby causing network data congestion. Speed requirements that affect the normal use of the user.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • FIG. 1 shows an implementation flow of a port data separation method according to a first embodiment of the present invention, which is described in detail below.
  • step S101 after receiving the data sent by the downlink port, the protocol stack packet process is ignored, and after the data is sent to the upper layer network, the corresponding virtual local area network identifier vlan id is determined according to the received data, and Add the data to the virtual local area network identifier vlanid.
  • the data sent by the receiving downlink port in the embodiment of the present invention refers to an access point, such as a routing device such as a ⁇ access point.
  • the lower-link port is the one that is close to the user side in the network, and the one that is close to the server in the network is the upper-layer network described in the embodiment of the present invention.
  • the packet flow process of the protocol stack refers to that the protocol stack layer-by-layers data according to the protocol layer, that is, data enters each protocol stack layer, and adds header information to the data according to the protocol of the layer.
  • the protocol stack packet process is neglected, and the identification information of the packet may be implemented by modifying the data.
  • the triggering of the packet instruction may be performed by other means, so that the protocol stack packet process is ignored.
  • the data is sent to the upper layer network, and the virtual local area network identifier vlanid corresponding to the data is obtained according to the identification information in the data, and the virtual local area network identifier vlanid is added to the data, thereby
  • the data including the identification can be accurately transmitted to the target location, and the packetizing operation on the data can be reduced.
  • step S102 after receiving the data transmitted by the upper layer network, the received data is parsed to obtain a virtual local area network identifier vlanid, and the data is forwarded to the corresponding port according to the virtual local area network identifier vlanid.
  • the target location of the data needs to be parsed.
  • the present invention parses the virtual local area network identifier vlanid according to the received data, according to the preset correspondence between the virtual local area network identifier and the port. , thereby forwarding data to the corresponding port.
  • the source physical MAC address and the network card device name may be obtained according to the data analysis, and according to the network card device name and the source physical MAC address, combined with the preset correspondence, the port corresponding to the data may be obtained, thereby separating the data.
  • the packet flow of the protocol stack is ignored, and after the data is sent to the upper layer network, the corresponding virtual local area network identifier is determined according to the data, and the virtual data is added to the data.
  • the network identifier after receiving the data of the upper layer network, parses the received data to obtain a virtual local area network identifier, and forwards the data to the corresponding port according to the virtual local area network identifier, thereby avoiding data entry into the protocol stack packet and unpacking operation.
  • Improve the processing efficiency of data reduce the consumption of system resources, and thus better adapt to the requirements of multi-user peer use.
  • FIG. 2 is a flowchart showing an implementation process of determining a corresponding virtual local area network identifier vlanid according to the received data according to the second embodiment of the present invention.
  • the specific step is described as follows: In step S201, the source MAC address and the source network card device name are extracted in the received data.
  • the source MAC address and the source network card device name are extracted in the received data, and the add_vlan code may be added in the NIC interface egress module, and the source mac address field and the source NIC device name field are extracted in the data part of the sk_buff.
  • the sk_buff is the most important structure of the TCP/IP protocol stack. It is the representation of the network datagram in the kernel. The corresponding source mac address and the source network card device name information can be extracted in the data data part.
  • step S202 it is determined whether the source network card device name is the same as the preset network card device name.
  • the name of the wired network card device is preset.
  • the preset network card device name may be Ethl, and then the cable network port identification can be quickly performed by comparing the network card device names. .
  • step S203 if the source network card device name and the preset network card device name are the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid.
  • the interface may be determined as the wired interface Ethl vlanic according to the network card device name.
  • step S204 if the source network card device name and the preset network card device name are different, the corresponding wireless interface is searched according to the source MAC address, and the corresponding virtual local area network identifier vlanid is determined according to the wireless interface.
  • the network card device name is different from the preset network card device name, the current interface is a wireless interface, and the virtual local area network identifier of the wireless interface is further determined according to the correspondence between the source mac address and the virtual local area network identifier vlanid. Vlanid. That is, different source mac addresses correspond to different virtual local area network identifiers vlanid. Thereby different wireless interfaces can be distinguished.
  • the step of distinguishing the virtual local area network identifier vlanid of the wired interface and the virtual local area network identifier vlanid of the different wireless interfaces further includes the steps of further adding data to the virtual local area network identifier vlanid, including:
  • the data is moved backward, and the structure control header space is obtained before the data storage location of the data storage area; the structure control header space is zeroed and the corresponding virtual local area network identifier is written.
  • the data area can be pushed backward by the skb_push command, and the head storage space is added for adding the vlan_ethhdr structure.
  • the V l an _ethhd r structure control header is cleared, the corresponding virtual local area network identifier vlanid is written into the h_vlan_TCI element.
  • the virtual LAN ID vlanid can be added to the data.
  • step S102 in the first embodiment when receiving the data sent by the upper layer network, parsing the received data to obtain a virtual local area network identifier vlanid, and forwarding the data according to the virtual local area network identifier vlanid
  • the steps to the corresponding port include:
  • the embodiment of the present invention further distinguishes the wired network interface data from the wireless network interface data and the different wireless network interface data, and effectively reduces the system resource consumption of the network device. , also improves the convenience of data differentiation.
  • Embodiment 3 is a diagrammatic representation of Embodiment 3
  • FIG. 3 is a schematic structural diagram of port data separation according to a third embodiment of the present invention, which is described in detail below: [0072]
  • the port data separating apparatus according to the embodiment of the present invention includes: [0073]
  • the identifier adding unit 301 is configured to: after receiving the data sent by the downlink port, ignore the protocol stack packet process, and after transmitting the data to the upper layer network, determine a corresponding virtual local area network identifier vlanid according to the received data, And adding the data to the virtual local area network identifier vlanid;
  • the identifier parsing unit 302 is configured to: after receiving the data sent by the upper layer network, parse the received data to obtain a virtual local area network identifier vlanid, and forward the data to the corresponding port according to the virtual local area network identifier vlanid.
  • the identifier adding unit includes:
  • an extraction subunit configured to extract a source MAC address and a source network card device name in the received data
  • a determining subunit configured to determine whether the source network card device name is the same as a preset network card device name;
  • a first identifier subunit configured to: if the source network card device name and a preset network card device If the name is the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
  • a second identifier subunit configured to: if the source network card device name and the preset network card device name are different, search for a corresponding wireless interface according to the source MAC address, and determine a corresponding virtual local area network according to the wireless interface Identifies the vlanid.
  • the identifier adding unit includes:
  • a shift subunit configured to: in the data storage area, move the data backward, and obtain a structure control head space before the data storage location of the data storage area;
  • the identifier writing subunit is configured to clear the value of the structure control header space and write the corresponding virtual local area network identifier vlanid.
  • the identifier parsing unit is specifically configured to:
  • the port data separation method is based on a ⁇ base station fit AP.
  • the port data separating apparatus in the embodiment of the present invention corresponds to the port data separating method in the first embodiment and the second embodiment, and details are not described herein.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division, and the actual implementation may have another division.
  • multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the unit described as a separate component may or may not be physically distributed, and the component displayed as a unit may or may not be a physical unit, that is, may be located in one place, or may be distributed to multiple On the network unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .

Abstract

A port data separation method, comprising: when receiving data sent by a downlink cascaded port, ignoring a protocol stack packing process, and when sending the data to an upper layer network, determining the corresponding virtual local area network identifier vlanid according to the received data, and adding the data with the virtual local area network identifier vlanid; and when receiving data sent by the upper layer network, parsing the received data to obtain the virtual local area network identifier vlanid, and forwarding the data to the corresponding port according to the virtual local area network identifier vlanid. The present invention can avoid protocol stack packing and unpacking operations performed on data, improve the data processing efficiency and reduce system resource consumption, thereby being better adapted to the requirements of simultaneous use of multiple users.

Description

发明名称:一种端口数据分离方法和装置  Invention name: A port data separation method and device
技术领域  Technical field
[0001] 本发明属于通信领域, 尤其涉及一种端口数据分离方法和装置。  [0001] The present invention belongs to the field of communications, and in particular, to a port data separation method and apparatus.
背景技术  Background technique
[0002] 在使用痩接入点 (英文全称为 fitAP)设备进行数据通信吋, 一般用于实现控制 数据报文与用户数据报文的虚拟局域网 vlan分离, 从而使得控制数据报文和用户 数据报文互不干扰。  [0002] In the data communication using the access point (English full name called fitAP) device, it is generally used to separate the control data packet from the virtual local area network vlan of the user data packet, thereby making the control data message and the user datagram The text does not interfere with each other.
[0003] 目前用于实现端口数据分离的方法, 一般是在发送数据包经过协议栈吋, 通过 规范的 vlan通道创建 vlan接口, 然后在协议栈中对用户的数据报文进行封装分发  [0003] Currently, a method for implementing port data separation generally sends a data packet through a protocol stack, creates a vlan interface through a standard vlan channel, and then encapsulates and distributes the user data packet in the protocol stack.
[0004] 但是, 如果接入点连接的用户的数据非常多吋, 比如说是在展览会场, 演唱会 现场等, 痩接入点 fitAP可能会超负荷运行。 这是因为痩接入点 fitAP协议栈的封 包效率较低, 由于需要对用户数据包需要经过协议栈层层转发, 这样会占用大 量的系统资源, 并且, 网络设备在接收到数据包吋, 也同样需要去解包, 去除 ta g标识。 这样, 每发送一个数据包, 需要对数据包进行一次封装, 每接收到一个 数据包, 需要对数据包进行一次解包, 需要消耗系统资源完成在协议栈的封包 和解包操作, 当用户非常多吋, 则会影响现场网络的正常运行, 响应用户正常 使用。 [0004] However, if the data of the user connected by the access point is very high, for example, at the exhibition venue, the concert site, etc., the access point fitAP may be overloaded. This is because the packet efficiency of the access point of the accessAP protocol stack is low. Since the user data packet needs to be forwarded through the protocol stack layer, this will occupy a large amount of system resources, and the network device receives the data packet, Also need to unpack, remove the ta g logo. In this way, each time a data packet is sent, the data packet needs to be encapsulated once. Each time a data packet is received, the data packet needs to be unpacked once, and the system resources are required to complete the packet encapsulation and unpacking operation in the protocol stack, when the user is very吋, it will affect the normal operation of the field network, in response to normal use by users.
技术问题  technical problem
[0005] 本发明的目的在于提供一种端口数据分离方法, 以解决现有技术如果接入点连 接的用户的数据非常多吋, 需要消耗系统资源完成在协议栈的封包和解包操作 , 则会影响现场网络的正常运行, 响应用户正常使用的问题。  [0005] An object of the present invention is to provide a method for separating port data, so as to solve the problem that if the data of the user connected by the access point is very large, and the system resources need to be consumed to complete the packetization and unpacking operation of the protocol stack, Affect the normal operation of the on-site network and respond to problems with normal user use.
问题的解决方案  Problem solution
技术解决方案  Technical solution
[0006] 第一方面, 本发明实施例提供了一种端口数据分离方法, 所述方法包括:  [0006] In a first aspect, an embodiment of the present invention provides a port data separation method, where the method includes:
[0007] 在接收到下联端口发送的数据吋, 忽略协议栈封包流程, 并在将所述数据发送 至上层网络吋, 根据接收的数据确定对应的虚拟局域网标识 vlanid, 并将所述数 据添加虚拟局域网标识 vlanid; [0007] After receiving the data sent by the downlink port, the protocol stack packet process is ignored, and the data is sent Up to the upper layer network, determining a corresponding virtual local area network identifier vlanid according to the received data, and adding the data to the virtual local area network identifier vlanid;
[0008] 当接收到上层网络发送的数据吋, 对接收的数据进行解析得到虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid将所述数据转发至对应的端口。 [0008] When the data sent by the upper layer network is received, the received data is parsed to obtain a virtual local area network identifier vlanid, and the data is forwarded to the corresponding port according to the virtual local area network identifier vlanid.
[0009] 结合第一方面, 在第一方面的第一种可能实现方式中, 所述根据接收的数据确 定对应的虚拟局域网标识 vlanid步骤包括: With reference to the first aspect, in a first possible implementation manner of the first aspect, the determining, by the received data, the corresponding virtual local area network identifier vlanid includes:
[0010] 在接收的数据中提取源 MAC地址和源网卡设备名称; [0010] extracting a source MAC address and a source network card device name in the received data;
[0011] 判断所述源网卡设备名称是否和预设的网卡设备名称相同; [0011] determining whether the source network card device name is the same as the preset network card device name;
[0012] 如果所述源网卡设备名称和预设的网卡设备名称相同, 则所述虚拟局域网标识 vlanid为有线接口虚拟局域网标识 vlanid; [0012] If the source network card device name and the preset network card device name are the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
[0013] 如果所述源网卡设备名称和预设的网卡设备名称不同, 则根据所述源 MAC地 址査找对应的无线接口, 根据所述无线接口确定对应的虚拟局域网标识 vlanic [0014] 结合第一方面, 在第一方面的第二种可能实现方式中, 所述将所述数据添加虚 拟局域网标识 vlanid步骤包括: [0013] If the source network card device name and the preset network card device name are different, the corresponding wireless interface is searched according to the source MAC address, and the corresponding virtual local area network identifier vlanic is determined according to the wireless interface. [0014] In a second possible implementation manner of the first aspect, the step of adding the data to the virtual local area network identifier vlanid includes:
[0015] 在数据存储区中, 将所述数据向后推移, 在数据存储区的数据存储位置之前得 到结构控制头空间; [0015] in the data storage area, the data is moved backward, and a structure control head space is obtained before the data storage location of the data storage area;
[0016] 将所述结构控制头空间清零赋值, 写入对应的虚拟局域网标识 vlanic  [0016] Clearing the structure control header space to a corresponding virtual local area network identifier vlanic
[0017] 结合第一方面, 在第一方面的第三种可能实现方式中, 所述当接收到上层网络 发送的数据吋, 对接收的数据进行解析得到虚拟局域网标识 vlanid, 并根据所述 虚拟局域网标识 vlanid将所述数据转发至对应的端口步骤包括:  [0017] In combination with the first aspect, in a third possible implementation manner of the first aspect, when receiving the data sent by the upper layer network, parsing the received data to obtain a virtual local area network identifier vlanid, and according to the virtual The step of forwarding the data to the corresponding port by the LAN identifier vlanid includes:
[0018] 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到所述数据 对应的网络接口;  [0018] when receiving data sent by the upper layer network, parsing the structure control header of the data, and obtaining a network interface corresponding to the data;
[0019] 将所述数据发送至对应的网络接口。  [0019] transmitting the data to a corresponding network interface.
[0020] 结合第一方面, 在第一方面的第四种可能实现方式中, 所述端口数据分离方法 基于痩基站 fit AP。  [0020] With reference to the first aspect, in a fourth possible implementation manner of the first aspect, the port data separation method is based on a 痩 base station fit AP.
[0021] 第二方面, 本发明实施例提供了一种端口数据分离方法, 所述方法包括: [0022] 标识添加单元, 用于在接收到下联端口发送的数据吋, 忽略协议栈封包流程, 并在将所述数据发送至上层网络吋, 根据接收的数据确定对应的虚拟局域网标 识 vlanid, 并将所述数据添加虚拟局域网标识 vlanid; [0021] In a second aspect, an embodiment of the present invention provides a port data separation method, where the method includes: [0022] an identifier adding unit, configured to ignore a protocol stack packet process after receiving data sent by a downlink port, And after transmitting the data to the upper layer network, determining a corresponding virtual local area network standard according to the received data Identify vlanid, and add the data to the virtual local area network identifier vlanid;
[0023] 标识解析单元, 用于当接收到上层网络发送的数据吋, 对接收的数据进行解析 得到虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid将所述数据转发 至对应的端口。 [0023] The identifier parsing unit is configured to: after receiving the data sent by the upper layer network, parse the received data to obtain a virtual local area network identifier vlanid, and forward the data to the corresponding port according to the virtual local area network identifier vlanid.
[0024] 结合第二方面, 在第二方面的第一种可能实现方式中, 所述标识添加单元包括  [0024] With reference to the second aspect, in a first possible implementation manner of the second aspect, the identifier adding unit includes
[0025] 提取子单元, 用于在接收的数据中提取源 MAC地址和源网卡设备名称; [0025] an extraction subunit, configured to extract a source MAC address and a source network card device name in the received data;
[0026] 判断子单元, 用于判断所述源网卡设备名称是否和预设的网卡设备名称相同; [0027] 第一标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名称相同, 则所述虚拟局域网标识 vlanid为有线接口虚拟局域网标识 vlanid; a determining subunit, configured to determine whether the source network card device name is the same as a preset network card device name; [0027] a first identifier subunit, configured to: if the source network card device name and a preset network card device If the name is the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
[0028] 第二标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名称不同, 则根据所述源 MAC地址査找对应的无线接口, 根据所述无线接口确定对应的虚 拟局域网标识 vlanid。 [0028] a second identifier subunit, configured to: if the source network card device name and the preset network card device name are different, search for a corresponding wireless interface according to the source MAC address, and determine a corresponding virtual local area network according to the wireless interface. Identifies the vlanid.
[0029] 结合第二方面, 在第二方面的第二种可能实现方式中, 所述标识添加单元包括  [0029] With reference to the second aspect, in a second possible implementation manner of the second aspect, the identifier adding unit includes
[0030] 推移子单元, 用于在数据存储区中, 将所述数据向后推移, 在数据存储区的数 据存储位置之前得到结构控制头空间; [0030] a shift subunit, configured to: in the data storage area, move the data backward, and obtain a structure control head space before the data storage location of the data storage area;
[0031] 标识写入子单元, 用于将所述结构控制头空间清零赋值, 写入对应的虚拟局域 网标识 vlanid。 [0031] The identifier writing subunit is configured to clear the value of the structure control header space and write the corresponding virtual local area network identifier vlanid.
[0032] 结合第二方面, 在第二方面的第三种可能实现方式中, 所述标识解析单元具体 用于:  [0032] In combination with the second aspect, in a third possible implementation manner of the second aspect, the identifier parsing unit is specifically configured to:
[0033] 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到所述数据 对应的网络接口, 将所述数据发送至对应的网络接口。  [0033] When receiving the data sent by the upper layer network, parsing the structure control header of the data, obtaining a network interface corresponding to the data, and transmitting the data to the corresponding network interface.
[0034] 结合第二方面, 在第二方面的第四种可能实现方式中, 所述端口数据分离方法 基于痩基站 fit AP。 [0034] With reference to the second aspect, in a fourth possible implementation manner of the second aspect, the port data separation method is based on a 痩 base station fit AP.
发明的有益效果  Advantageous effects of the invention
有益效果  Beneficial effect
[0035] 在本发明中, 在接收到下联端口的数据吋, 忽略协议栈的封包流程, 在将数据 发送至上层网络吋, 根据数据确定对应的虚拟局域网标识, 并对所述数据添加 所述虚拟网标识, 当接收到上层网络的数据吋, 对接收的数据进行解析得到虚 拟局域网标识, 根据所述虚拟局域网标识将数据转发至对应的端口, 从而可以 避免对数据进入协议栈封包和解包操作, 提高了数据的处理效率, 减少了系统 资源的消耗, 从而能够更好的适应多用户同吋使用的要求。 [0035] In the present invention, after receiving the data of the downlink port, the packet flow of the protocol stack is ignored, and the data is After being sent to the upper layer network, determining a corresponding virtual local area network identifier according to the data, adding the virtual network identifier to the data, and receiving the data of the upper layer network, parsing the received data to obtain a virtual local area network identifier, according to the The virtual local area network identifier forwards the data to the corresponding port, thereby avoiding data entry into the protocol stack and unpacking operations, improving data processing efficiency, reducing system resource consumption, and thus being better adapted to multi-user peer use. Claim.
对附图的简要说明  Brief description of the drawing
附图说明  DRAWINGS
[0036] 图 1是本发明第一实施例提供的端口数据分离方法的实现流程图;  1 is a flowchart of an implementation of a method for separating port data according to a first embodiment of the present invention;
[0037] 图 2是本发明第二实施例提供的根据接收的数据确定对应的虚拟局域网标识的 实现流程图; 2 is a flowchart of implementing a method for determining a corresponding virtual local area network identifier according to received data according to a second embodiment of the present invention;
[0038] 图 3是本发明第三实施例提供的端口数据分离装置的结构示意图。  3 is a schematic structural diagram of a port data separating apparatus according to a third embodiment of the present invention.
本发明的实施方式 Embodiments of the invention
[0039] 为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图及实施例 , 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅仅用 以解释本发明, 并不用于限定本发明。  The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0040] 本发明实施例的目的在于解决现有技术中由于多人使用同一个接入点, 比如痩 接入点吋, 痩接入点可能会超负荷运行, 其原因在于, 痩接入点需要使用协议 栈对数据包进行层层转发, 会占用大量的系统资源, 在接收到数据吋需要进行 解包, 发送一个数据包需要进行封包操作, 浪费大量的系统资源, 从而造成网 络数据堵塞, 影响用户的正常使用的速度要求。 下面结合附图对本发明具体进 行说明。  [0040] The purpose of the embodiment of the present invention is to solve the problem that in the prior art, because multiple people use the same access point, such as an access point, the access point may be overloaded, because the access point is It is necessary to use the protocol stack to perform layer-by-layer forwarding of data packets, which will occupy a large amount of system resources. After receiving data, it needs to be unpacked, and a data packet needs to be packetized, which wastes a lot of system resources, thereby causing network data congestion. Speed requirements that affect the normal use of the user. The invention will now be described in detail with reference to the accompanying drawings.
[0041] 实施例一:  [0041] Embodiment 1:
[0042] 图 1示出了本发明第一实施例提供的端口数据分离方法的实现流程, 详述如下  1 shows an implementation flow of a port data separation method according to a first embodiment of the present invention, which is described in detail below.
[0043] 在步骤 S101中, 在接收到下联端口发送的数据吋, 忽略协议栈封包流程, 并在 将所述数据发送至上层网络吋, 根据接收的数据确定对应的虚拟局域网标识 vlan id, 并将所述数据添加虚拟局域网标识 vlanid。 [0044] 具体的, 本发明实施例中所述接收下联端口发送的数据, 是指接入点, 比如痩 接入点等路由设备。 所述下联端口, 是指在网络中的靠近用户侧的一端, 而在 网络中靠近服务器的一端, 则为本发明实施例中所述的上层网络。 [0043] In step S101, after receiving the data sent by the downlink port, the protocol stack packet process is ignored, and after the data is sent to the upper layer network, the corresponding virtual local area network identifier vlan id is determined according to the received data, and Add the data to the virtual local area network identifier vlanid. [0044] Specifically, the data sent by the receiving downlink port in the embodiment of the present invention refers to an access point, such as a routing device such as a 痩 access point. The lower-link port is the one that is close to the user side in the network, and the one that is close to the server in the network is the upper-layer network described in the embodiment of the present invention.
[0045] 所述协议栈的封包流程, 是指协议栈按照协议层的规定, 对数据进行层层封包 , 即数据进入到每一个协议栈层吋, 按照该层的协议对数据添加包头信息。 在 本发明实施例中忽略协议栈封包流程, 可以通过修改数据进行封包的标识信息 实现, 当然也可以通过其它方式不进行封包指令的触发, 实现对协议栈封包流 程的忽略。  [0045] The packet flow process of the protocol stack refers to that the protocol stack layer-by-layers data according to the protocol layer, that is, data enters each protocol stack layer, and adds header information to the data according to the protocol of the layer. In the embodiment of the present invention, the protocol stack packet process is neglected, and the identification information of the packet may be implemented by modifying the data. Of course, the triggering of the packet instruction may be performed by other means, so that the protocol stack packet process is ignored.
[0046] 在忽略所述封包流程后, 将数据发送至上层网络吋, 根据数据中的标识信息, 获取数据对应的虚拟局域网标识 vlanid, 并将所述虚拟局域网标识 vlanid添加至 所述数据, 从而可以将包括标识的数据准确的发送至目标位置, 并且可减少对 数据的封包操作。  [0046] After ignoring the packet process, the data is sent to the upper layer network, and the virtual local area network identifier vlanid corresponding to the data is obtained according to the identification information in the data, and the virtual local area network identifier vlanid is added to the data, thereby The data including the identification can be accurately transmitted to the target location, and the packetizing operation on the data can be reduced.
[0047] 在步骤 S102中, 当接收到上层网络发送的数据吋, 对接收的数据进行解析得到 虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid将所述数据转发至对 应的端口。  [0047] In step S102, after receiving the data transmitted by the upper layer network, the received data is parsed to obtain a virtual local area network identifier vlanid, and the data is forwarded to the corresponding port according to the virtual local area network identifier vlanid.
[0048] 在接收到由上层网络发送的数据吋, 需要对数据的目标位置进行解析, 本发明 根据接收的数据解析得到虚拟局域网标识 vlanid, 根据预设的所述虚拟局域网标 识与端口的对应关系, 从而将数据转发至对应的端口。  [0048] After receiving the data sent by the upper layer network, the target location of the data needs to be parsed. The present invention parses the virtual local area network identifier vlanid according to the received data, according to the preset correspondence between the virtual local area network identifier and the port. , thereby forwarding data to the corresponding port.
[0049] 比如, 可以根据数据解析得到源物理 MAC地址以及网卡设备名称, 根据网卡 设备名称以及源物理 MAC地址, 结合预设的对应关系, 可以得到数据所对应的 端口, 从而将数据进行分离。  [0049] For example, the source physical MAC address and the network card device name may be obtained according to the data analysis, and according to the network card device name and the source physical MAC address, combined with the preset correspondence, the port corresponding to the data may be obtained, thereby separating the data.
[0050] 本发明实施例在接收到下联端口的数据吋, 忽略协议栈的封包流程, 在将数据 发送至上层网络吋, 根据数据确定对应的虚拟局域网标识, 并对所述数据添加 所述虚拟网标识, 当接收到上层网络的数据吋, 对接收的数据进行解析得到虚 拟局域网标识, 根据所述虚拟局域网标识将数据转发至对应的端口, 从而可以 避免对数据进入协议栈封包和解包操作, 提高了数据的处理效率, 减少了系统 资源的消耗, 从而能够更好的适应多用户同吋使用的要求。  [0050] In the embodiment of the present invention, after receiving the data of the downlink port, the packet flow of the protocol stack is ignored, and after the data is sent to the upper layer network, the corresponding virtual local area network identifier is determined according to the data, and the virtual data is added to the data. The network identifier, after receiving the data of the upper layer network, parses the received data to obtain a virtual local area network identifier, and forwards the data to the corresponding port according to the virtual local area network identifier, thereby avoiding data entry into the protocol stack packet and unpacking operation. Improve the processing efficiency of data, reduce the consumption of system resources, and thus better adapt to the requirements of multi-user peer use.
[0051] 实施例二: [0052] 图 2示出了本发明第二实施例提供的根据接收的数据确定对应的虚拟局域网标 识 vlanid的实现流程, 在实施例一的基础上, 对该步骤进行具体的介绍说如下: [0053] 在步骤 S201中, 在接收的数据中提取源 MAC地址和源网卡设备名称。 [0051] Embodiment 2: [0052] FIG. 2 is a flowchart showing an implementation process of determining a corresponding virtual local area network identifier vlanid according to the received data according to the second embodiment of the present invention. On the basis of the first embodiment, the specific step is described as follows: In step S201, the source MAC address and the source network card device name are extracted in the received data.
[0054] 具体的, 在接收的数据中提取源 MAC地址和源网卡设备名称, 可以在网卡接 口出口模块添加 add_vlan代码, 在 sk_buff的 data部分中提取源 mac地址字段和源 网卡设备名称的字段。 其中, 所述 sk_buff是 TCP/IP协议栈最重要的结构, 它是 网络数据报在内核中的表现形式, 可在其中的 data数据部分中提取对应的源 mac 地址和源网卡设备名称的信息。 [0054] Specifically, the source MAC address and the source network card device name are extracted in the received data, and the add_vlan code may be added in the NIC interface egress module, and the source mac address field and the source NIC device name field are extracted in the data part of the sk_buff. The sk_buff is the most important structure of the TCP/IP protocol stack. It is the representation of the network datagram in the kernel. The corresponding source mac address and the source network card device name information can be extracted in the data data part.
[0055] 在步骤 S202中, 判断所述源网卡设备名称是否和预设的网卡设备名称相同。 [0055] In step S202, it is determined whether the source network card device name is the same as the preset network card device name.
[0056] 在本发明实施例中, 预先设定有线网卡设备名称, 比如, 所述预设的网卡设备 名称可以为 Ethl, 那么通过网卡设备名称的比较, 即可快速的进行有线网口的识 别。 [0056] In the embodiment of the present invention, the name of the wired network card device is preset. For example, the preset network card device name may be Ethl, and then the cable network port identification can be quickly performed by comparing the network card device names. .
[0057] 在步骤 S203中, 如果所述源网卡设备名称和预设的网卡设备名称相同, 则所述 虚拟局域网标识 vlanid为有线接口虚拟局域网标识 vlanid。  [0057] In step S203, if the source network card device name and the preset network card device name are the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid.
[0058] 由于预先设定所有的有线网卡的名称相同, 那么, 如果网卡设备名称识别为预 设选定的名称, 则可以快速的对有线网口进行识别。  [0058] Since all the names of the wired network cards are set in advance, if the network card device name is identified as the preset name, the wired network port can be quickly identified.
[0059] 通过对有线网卡名称的识别, 可以克服现有技术中对于有线用户与无线用户进 行识别困难的问题。 在现有技术中, 对于痩接入点所连接的有线口和无线口的 数据, 都是统一转发, 这样也给管理带来很多的不便, 如果我们要提取无线用 户, 就必须从用户列表里面剔除有线用户, 以此来获得无线用户, 再者, 当今 的 fitAP设备一般至少有一个无线接入点, 大多数都集中在 2-10个无线接入点之 间, 这样分离不同的接入点用户就更加艰难。 而本发明通过网卡设备名称的识 另 lj, 即可快速的识别有线接口。  [0059] By identifying the name of the wired network card, it is possible to overcome the problem of difficulty in identifying wired users and wireless users in the prior art. In the prior art, the data of the wired port and the wireless port connected to the access point are uniformly forwarded, which also brings a lot of inconvenience to the management. If we want to extract the wireless user, it must be from the user list. Eliminate wired users to gain wireless users. Furthermore, today's fitAP devices generally have at least one wireless access point, most of which are concentrated between 2-10 wireless access points, thus separating different access points. Users are even harder. However, the invention can quickly identify the wired interface by using the name of the network card device.
[0060] 比如, 如果预设的源网卡设备名称为 Ethl, 当解析所述设备的网卡设备名称为 Ethl吋, 则根据所述网卡设备名称即可确定该接口为有线口 Ethl的 vlanic  [0060] For example, if the default source network card device name is Ethl, and the network card device name of the device is Ethl, the interface may be determined as the wired interface Ethl vlanic according to the network card device name.
[0061] 在步骤 S204中, 如果所述源网卡设备名称和预设的网卡设备名称不同, 则根据 所述源 MAC地址査找对应的无线接口, 根据所述无线接口确定对应的虚拟局域 网标识 vlanid。 [0062] 如果比较得到网卡设备名称与预设的网卡设备名称不同, 则表示当前接口为无 线接口, 则需要进一步根据源 mac地址与虚拟局域网标识 vlanid的对应关系, 进 一步确定无线接口的虚拟局域网标识 vlanid。 即不同的源 mac地址对应不同的虚 拟局域网标识 vlanid。 从而能够将不同的无线接口进行区分。 [0061] In step S204, if the source network card device name and the preset network card device name are different, the corresponding wireless interface is searched according to the source MAC address, and the corresponding virtual local area network identifier vlanid is determined according to the wireless interface. [0062] If the network card device name is different from the preset network card device name, the current interface is a wireless interface, and the virtual local area network identifier of the wireless interface is further determined according to the correspondence between the source mac address and the virtual local area network identifier vlanid. Vlanid. That is, different source mac addresses correspond to different virtual local area network identifiers vlanid. Thereby different wireless interfaces can be distinguished.
[0063] 在区分有线接口的虚拟局域网标识 vlanid, 以及不同的无线接口的虚拟局域网 标识 vlanid, 还包括进一步将数据添加虚拟局域网标识 vlanid的步骤, 包括: [0063] The step of distinguishing the virtual local area network identifier vlanid of the wired interface and the virtual local area network identifier vlanid of the different wireless interfaces further includes the steps of further adding data to the virtual local area network identifier vlanid, including:
[0064] 在数据存储区中, 将所述数据向后推移, 在数据存储区的数据存储位置之前得 到结构控制头空间; 将所述结构控制头空间清零赋值, 写入对应的虚拟局域网 标识 vlanid° [0064] in the data storage area, the data is moved backward, and the structure control header space is obtained before the data storage location of the data storage area; the structure control header space is zeroed and the corresponding virtual local area network identifier is written. Vlanid°
[0065] 可以通过 skb_push指令将数据区向后推, 为添加 vlan_ethhdr结构控制头存储空 间, 对 Vlan_ethhdr结构控制头清空赋值后, 将相应的虚拟局域网标识 vlanid写入 至h_vlan_TCI元素中即可完成对数据添加虚拟局域网标识 vlanid。 [0065] The data area can be pushed backward by the skb_push command, and the head storage space is added for adding the vlan_ethhdr structure. After the V l an _ethhd r structure control header is cleared, the corresponding virtual local area network identifier vlanid is written into the h_vlan_TCI element. The virtual LAN ID vlanid can be added to the data.
[0066] 与实施例一中步骤 S102对应的, 所述当接收到上层网络发送的数据吋, 对接收 的数据进行解析得到虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid 将所述数据转发至对应的端口步骤包括:  Corresponding to step S102 in the first embodiment, when receiving the data sent by the upper layer network, parsing the received data to obtain a virtual local area network identifier vlanid, and forwarding the data according to the virtual local area network identifier vlanid The steps to the corresponding port include:
[0067] 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到所述数据 对应的网络接口; 将所述数据发送至对应的网络接口。  [0067] When receiving data sent by the upper layer network, parsing the structure control header of the data, obtaining a network interface corresponding to the data; and transmitting the data to a corresponding network interface.
[0068] 与上述添加虚拟局域网标识 vlanid相对应的, 对于接收的数据进行解析吋, 根 据结构控制头的结构, 在网卡接口接入添加 rem0ve_vlan代码, 当网络设备入口 收到数据包吋, 先提取结构控制头的结构数据, 根据提取的数据中的虚拟局域 网标识 vlanid确定是发往哪个网络接口, 比如有线网络接口以及具体的无线网络 接口等, 将数据转发至对应的网络接口。 [0068] corresponding to the addition of the virtual local area network identifier vlanid, after parsing the received data, according to the structure of the structure control header, adding a re m 0ve _vl an code to the network card interface access, when the network device portal receives the data packet吋, first extract the structure data of the structure control header, and determine which network interface, such as a wired network interface and a specific wireless network interface, is sent to the corresponding network interface according to the virtual local area network identifier vlanid in the extracted data.
[0069] 本发明实施例在实施例一的基础上, 进一步对有线网络接口数据与无线网络接 口数据, 以及不同的无线网络接口数据进行区分, 在有效的减少网络设备的系 统资源消耗的同吋, 也提高了数据区分的便利性。  [0069] On the basis of the first embodiment, the embodiment of the present invention further distinguishes the wired network interface data from the wireless network interface data and the different wireless network interface data, and effectively reduces the system resource consumption of the network device. , also improves the convenience of data differentiation.
[0070] 实施例三:  [0070] Embodiment 3:
[0071] 图 3示出了本发明第三实施例提供的端口数据分离的结构示意图, 详述如下: [0072] 本发明实施例所述端口数据分离装置, 包括: [0073] 标识添加单元 301, 用于在接收到下联端口发送的数据吋, 忽略协议栈封包流 程, 并在将所述数据发送至上层网络吋, 根据接收的数据确定对应的虚拟局域 网标识 vlanid, 并将所述数据添加虚拟局域网标识 vlanid; [0071] FIG. 3 is a schematic structural diagram of port data separation according to a third embodiment of the present invention, which is described in detail below: [0072] The port data separating apparatus according to the embodiment of the present invention includes: [0073] The identifier adding unit 301 is configured to: after receiving the data sent by the downlink port, ignore the protocol stack packet process, and after transmitting the data to the upper layer network, determine a corresponding virtual local area network identifier vlanid according to the received data, And adding the data to the virtual local area network identifier vlanid;
[0074] 标识解析单元 302, 用于当接收到上层网络发送的数据吋, 对接收的数据进行 解析得到虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid将所述数据 转发至对应的端口。 [0074] The identifier parsing unit 302 is configured to: after receiving the data sent by the upper layer network, parse the received data to obtain a virtual local area network identifier vlanid, and forward the data to the corresponding port according to the virtual local area network identifier vlanid.
[0075] 优选的, 所述标识添加单元包括: [0075] Preferably, the identifier adding unit includes:
[0076] 提取子单元, 用于在接收的数据中提取源 MAC地址和源网卡设备名称;  [0076] an extraction subunit, configured to extract a source MAC address and a source network card device name in the received data;
[0077] 判断子单元, 用于判断所述源网卡设备名称是否和预设的网卡设备名称相同; [0078] 第一标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名称相同, 则所述虚拟局域网标识 vlanid为有线接口虚拟局域网标识 vlanid; [0077] a determining subunit, configured to determine whether the source network card device name is the same as a preset network card device name; [0078] a first identifier subunit, configured to: if the source network card device name and a preset network card device If the name is the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
[0079] 第二标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名称不同, 则根据所述源 MAC地址査找对应的无线接口, 根据所述无线接口确定对应的虚 拟局域网标识 vlanid。 [0079] a second identifier subunit, configured to: if the source network card device name and the preset network card device name are different, search for a corresponding wireless interface according to the source MAC address, and determine a corresponding virtual local area network according to the wireless interface Identifies the vlanid.
[0080] 优选的, 所述标识添加单元包括: [0080] Preferably, the identifier adding unit includes:
[0081] 推移子单元, 用于在数据存储区中, 将所述数据向后推移, 在数据存储区的数 据存储位置之前得到结构控制头空间;  [0081] a shift subunit, configured to: in the data storage area, move the data backward, and obtain a structure control head space before the data storage location of the data storage area;
[0082] 标识写入子单元, 用于将所述结构控制头空间清零赋值, 写入对应的虚拟局域 网标识 vlanid。 [0082] The identifier writing subunit is configured to clear the value of the structure control header space and write the corresponding virtual local area network identifier vlanid.
[0083] 优选的, 所述标识解析单元具体用于: [0083] Preferably, the identifier parsing unit is specifically configured to:
[0084] 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到所述数据 对应的网络接口, 将所述数据发送至对应的网络接口。  [0084] When receiving the data sent by the upper layer network, parsing the structure control header of the data, obtaining a network interface corresponding to the data, and transmitting the data to the corresponding network interface.
[0085] 优选的, 所述端口数据分离方法基于痩基站 fit AP。 [0085] Preferably, the port data separation method is based on a 痩 base station fit AP.
[0086] 本发明实施例所述端口数据分离装置, 本实施例一、 二所述的端口数据分离方 法对应, 在此不作重复赘述。  The port data separating apparatus in the embodiment of the present invention corresponds to the port data separating method in the first embodiment and the second embodiment, and details are not described herein.
[0087] 在本发明所提供的几个实施例中, 应该理解到, 所揭露的装置和方法, 可以通 过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现吋可以有另外的划分方 式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些特征可 以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦合或通 信连接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以是电性 , 机械或其它的形式。 [0087] In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division, and the actual implementation may have another division. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
[0088] 所述作为分离部件说明的单元可以是或者也可以不是物理上分幵的, 作为单元 显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可 以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。  [0088] The unit described as a separate component may or may not be physically distributed, and the component displayed as a unit may or may not be a physical unit, that is, may be located in one place, or may be distributed to multiple On the network unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
[0089] 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可 以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用软件功能单元的形式 实现。  [0089] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0090] 所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用 吋, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技 术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分 可以以软件产品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令用以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网 络设备等) 执行本发明各个实施例所述方法的全部或部分。 而前述的存储介质 包括: U盘、 移动硬盘、 只读存储器 (ROM, Read-Only Memory) 、 随机存取 存储器 (RAM, Random Access Memory) 、 磁碟或者光盘等各种可以存储程序 代码的介质。  [0090] The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
[0091] 以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发明的 精神和原则之内所作的任何修改、 等同替换和改进等, 均应包含在本发明的保 护范围之内。  The above description is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the present invention. Within the scope of protection of the invention.

Claims

权利要求书  Claim
[权利要求 1] 一种端口数据分离方法, 其特征在于, 所述方法包括:  [Claim 1] A method for separating port data, wherein the method includes:
在接收到下联端口发送的数据吋, 忽略协议栈封包流程, 并在将所述 数据发送至上层网络吋, 根据接收的数据确定对应的虚拟局域网标识 vlanid, 并将所述数据添加虚拟局域网标识 vlanid;  After receiving the data sent by the downlink port, the protocol stack packet process is ignored, and after the data is sent to the upper layer network, the corresponding virtual local area network identifier vlanid is determined according to the received data, and the data is added to the virtual local area network identifier vlanid. ;
当接收到上层网络发送的数据吋, 对接收的数据进行解析得到虚拟局 域网标识 vlanid, 并根据所述虚拟局域网标识 vlanid将所述数据转发至 对应的端口。  After receiving the data sent by the upper layer network, the received data is parsed to obtain a virtual local area network identifier vlanid, and the data is forwarded to the corresponding port according to the virtual local area network identifier vlanid.
[权利要求 2] 根据权利要求 1所述方法, 其特征在于, 所述根据接收的数据确定对 应的虚拟局域网标识 vlanid步骤包括:  [Claim 2] The method according to claim 1, wherein the determining the corresponding virtual local area network identifier vlanid according to the received data comprises:
在接收的数据中提取源 MAC地址和源网卡设备名称;  Extracting the source MAC address and the source NIC device name in the received data;
判断所述源网卡设备名称是否和预设的网卡设备名称相同; 如果所述源网卡设备名称和预设的网卡设备名称相同, 则所述虚拟局 域网标识 vlanid为有线接口虚拟局域网标识 vlanid;  Determining whether the source network card device name is the same as the preset network card device name; if the source network card device name and the preset network card device name are the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier vlanid;
如果所述源网卡设备名称和预设的网卡设备名称不同, 则根据所述源 MAC地址査找对应的无线接口, 根据所述无线接口确定对应的虚拟 局域网标识 vlanid。  If the source network card device name is different from the preset network card device name, the corresponding wireless interface is searched according to the source MAC address, and the corresponding virtual local area network identifier vlanid is determined according to the wireless interface.
[权利要求 3] 根据权利要求 1所述方法, 其特征在于, 所述将所述数据添加虚拟局 域网标识 vlanid步骤包括:  [Claim 3] The method according to claim 1, wherein the step of adding the virtual local area network identifier vlanid to the data comprises:
在数据存储区中, 将所述数据向后推移, 在数据存储区的数据存储位 置之前得到结构控制头空间;  In the data storage area, the data is moved backward, and the structure control header space is obtained before the data storage location of the data storage area;
将所述结构控制头空间清零赋值, 写入对应的虚拟局域网标识 vlanid  Clearing the structure control header space to the corresponding virtual local area network identifier vlanid
[权利要求 4] 根据权利要求 1所述方法, 其特征在于, 所述当接收到上层网络发送 的数据吋, 对接收的数据进行解析得到虚拟局域网标识 vlanid, 并根 据所述虚拟局域网标识 vlanid将所述数据转发至对应的端口步骤包括 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到 所述数据对应的网络接口; [Claim 4] The method according to claim 1, wherein, when receiving the data sent by the upper layer network, parsing the received data to obtain a virtual local area network identifier vlanid, and according to the virtual local area network identifier vlanid The step of forwarding the data to the corresponding port includes: when receiving the data sent by the upper layer network, parsing the structure control header of the data, and obtaining a network interface corresponding to the data;
将所述数据发送至对应的网络接口。 The data is sent to a corresponding network interface.
根据权利要求 1所述方法, 其特征在于, 所述端口数据分离方法基于 痩基站 fit AP。 The method according to claim 1, wherein the port data separation method is based on a 痩 base station fit AP.
一种端口数据分离方法, 其特征在于, 所述方法包括: A port data separation method, the method comprising:
标识添加单元, 用于在接收到下联端口发送的数据吋, 忽略协议栈封 包流程, 并在将所述数据发送至上层网络吋, 根据接收的数据确定对 应的虚拟局域网标识 vlanid, 并将所述数据添加虚拟局域网标识 vlanid 标识解析单元, 用于当接收到上层网络发送的数据吋, 对接收的数据 进行解析得到虚拟局域网标识 vlanid, 并根据所述虚拟局域网标识 via nid将所述数据转发至对应的端口。 An identifier adding unit, configured to: after receiving the data sent by the downlink port, ignore the protocol stack packet process, and after sending the data to the upper layer network, determine a corresponding virtual local area network identifier vlanid according to the received data, and The data adding virtual local area network identifier vlanid identifier parsing unit is configured to: after receiving the data sent by the upper layer network, parse the received data to obtain a virtual local area network identifier vlanid, and forward the data to the corresponding according to the virtual local area network identifier via nid Port.
根据权利要求 6所述装置, 其特征在于, 所述标识添加单元包括: 提取子单元, 用于在接收的数据中提取源 MAC地址和源网卡设备名 称; The apparatus according to claim 6, wherein the identifier adding unit comprises: an extracting subunit, configured to extract a source MAC address and a source network card device name in the received data;
判断子单元, 用于判断所述源网卡设备名称是否和预设的网卡设备名 称相同; a determining subunit, configured to determine whether the source network card device name is the same as a preset network card device name;
第一标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名 称相同, 则所述虚拟局域网标识 vlanid为有线接口虚拟局域网标识 via nid; a first identifier subunit, configured to: if the source network card device name and the preset network card device name are the same, the virtual local area network identifier vlanid is a wired interface virtual local area network identifier via nid;
第二标识子单元, 用于如果所述源网卡设备名称和预设的网卡设备名 称不同, 则根据所述源 MAC地址査找对应的无线接口, 根据所述无 线接口确定对应的虚拟局域网标识 vlanid。 And a second identifier subunit, configured to: if the source network card device name and the preset network card device name are different, search for a corresponding wireless interface according to the source MAC address, and determine a corresponding virtual local area network identifier vlanid according to the wireless interface.
根据权利要求 6所述装置, 其特征在于, 所述标识添加单元包括: 推移子单元, 用于在数据存储区中, 将所述数据向后推移, 在数据存 储区的数据存储位置之前得到结构控制头空间; The device according to claim 6, wherein the identifier adding unit comprises: a shifting subunit, configured to move the data backward in the data storage area, and obtain a structure before the data storage location of the data storage area Control head space;
标识写入子单元, 用于将所述结构控制头空间清零赋值, 写入对应的 虚拟局域网标识 vlanid。 [权利要求 9] 根据权利要求 6所述装置, 其特征在于, 所述标识解析单元具体用于 当接收到上层网络发送的数据吋, 解析所述数据的结构控制头, 得到 所述数据对应的网络接口, 将所述数据发送至对应的网络接口。 The identifier writing subunit is configured to clear the value of the structure control header space and write the corresponding virtual local area network identifier vlanid. [Claim 9] The device according to claim 6, wherein the identifier parsing unit is configured to: when receiving data sent by the upper layer network, parse the structure control header of the data, and obtain the data corresponding to the data A network interface that sends the data to a corresponding network interface.
[权利要求 10] 根据权利要求 6所述装置, 其特征在于, 所述端口数据分离方法基于 痩基站 fit AP。 [Claim 10] The apparatus according to claim 6, wherein the port data separation method is based on a 痩 base station fit AP.
PCT/CN2016/092424 2015-10-29 2016-07-29 Port data separation method and device WO2017071350A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510724402.0 2015-10-29
CN201510724402.0A CN105392132B (en) 2015-10-29 2015-10-29 A kind of port data separation method and device

Publications (1)

Publication Number Publication Date
WO2017071350A1 true WO2017071350A1 (en) 2017-05-04

Family

ID=55423874

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/092424 WO2017071350A1 (en) 2015-10-29 2016-07-29 Port data separation method and device

Country Status (2)

Country Link
CN (1) CN105392132B (en)
WO (1) WO2017071350A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105392132B (en) * 2015-10-29 2019-01-18 华讯方舟科技有限公司 A kind of port data separation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070127459A1 (en) * 2005-12-03 2007-06-07 Hon Hai Precision Industry Co., Ltd. Network apparatus and method for forwarding multicast packets for the same
CN101030915A (en) * 2007-03-26 2007-09-05 中兴通讯股份有限公司 Method for sharing V-Switch transparent-transferring data load
CN103139037A (en) * 2011-11-30 2013-06-05 国际商业机器公司 Method and device used for achieving flexible virtual local area network
CN104348696A (en) * 2014-11-17 2015-02-11 京信通信系统(中国)有限公司 Method and equipment for dividing multiple VLANs (Virtual Local Area Network)
CN105392132A (en) * 2015-10-29 2016-03-09 深圳市华讯方舟科技有限公司 Port data separating method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100337450C (en) * 2002-08-05 2007-09-12 华为技术有限公司 Communication method between virtual local area webs
JP5074314B2 (en) * 2008-07-07 2012-11-14 株式会社日立製作所 Frame transfer device
CN102055658B (en) * 2009-11-05 2013-01-16 杭州华三通信技术有限公司 Method and equipment for realizing failure protection in rapid ring protection protocol single-ring networking
CN103220117B (en) * 2012-01-19 2017-07-28 芯域通信有限公司 The multiple service supporting method of power line carrier communication wireless aps terminal installation
US8867367B2 (en) * 2012-05-10 2014-10-21 Telefonaktiebolaget L M Ericsson (Publ) 802.1aq support over IETF EVPN
CN104168186B (en) * 2014-07-01 2018-01-02 汉柏科技有限公司 A kind of message forwarding method and system based on bridge

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070127459A1 (en) * 2005-12-03 2007-06-07 Hon Hai Precision Industry Co., Ltd. Network apparatus and method for forwarding multicast packets for the same
CN101030915A (en) * 2007-03-26 2007-09-05 中兴通讯股份有限公司 Method for sharing V-Switch transparent-transferring data load
CN103139037A (en) * 2011-11-30 2013-06-05 国际商业机器公司 Method and device used for achieving flexible virtual local area network
CN104348696A (en) * 2014-11-17 2015-02-11 京信通信系统(中国)有限公司 Method and equipment for dividing multiple VLANs (Virtual Local Area Network)
CN105392132A (en) * 2015-10-29 2016-03-09 深圳市华讯方舟科技有限公司 Port data separating method and device

Also Published As

Publication number Publication date
CN105392132A (en) 2016-03-09
CN105392132B (en) 2019-01-18

Similar Documents

Publication Publication Date Title
US9065766B2 (en) Medium for storing packet conversion program, packet conversion apparatus and packet conversion method
EP3958521A1 (en) Method and apparatus for providing service for service flow
US11606223B2 (en) Broadband remote access server (BRAS) system-based packet encapsulation
WO2015143982A1 (en) Packet forwarding method and system
EP2224645A1 (en) A method and equipment for transmitting a message based on the layer-2 tunnel protocol
WO2016086670A1 (en) Vxlan packet transmission method and apparatus, and storage medium
WO2016107122A1 (en) Method and device for converting between rapidio packet and ethernet packet
EP2773073A1 (en) Entry generation method, message receiving method, and corresponding device and system
US9883010B2 (en) Method, apparatus, device and system for generating DHCP snooping binding table
JP2016522627A (en) Packet processing method and apparatus
CN106559302A (en) Single tunnel method for building up, device and system
EP4037267A1 (en) Method, apparatus and system for sending message
WO2021174943A1 (en) Data forwarding method and apparatus, and device and storage medium
EP3618365A1 (en) Packet forwarding
EP3425860B1 (en) Tunnel type selection methods and apparatuses
WO2009021424A1 (en) A device and method for handling messages
WO2018090980A1 (en) Packet forwarding
EP4283938A1 (en) Packet forwarding method, packet processing method, and device
US20160080532A1 (en) Method for generating input parameter and device
CN108156034A (en) A kind of message forwarding method and message forwarding system based on deep neural network auxiliary
WO2017071350A1 (en) Port data separation method and device
US9847929B2 (en) Cluster and forwarding method
CN109150925B (en) IPoE static authentication method and system
WO2023125056A1 (en) Network data control method and apparatus, and storage medium and electronic device
JP6718739B2 (en) Communication device and communication method

Legal Events

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

Ref document number: 16858789

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16858789

Country of ref document: EP

Kind code of ref document: A1