WO2017067267A1 - 数据包重定向的方法、系统及ap - Google Patents

数据包重定向的方法、系统及ap Download PDF

Info

Publication number
WO2017067267A1
WO2017067267A1 PCT/CN2016/092123 CN2016092123W WO2017067267A1 WO 2017067267 A1 WO2017067267 A1 WO 2017067267A1 CN 2016092123 W CN2016092123 W CN 2016092123W WO 2017067267 A1 WO2017067267 A1 WO 2017067267A1
Authority
WO
WIPO (PCT)
Prior art keywords
data packet
uplink
packet
wireless network
http
Prior art date
Application number
PCT/CN2016/092123
Other languages
English (en)
French (fr)
Inventor
韩海锋
Original Assignee
华讯方舟科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华讯方舟科技有限公司 filed Critical 华讯方舟科技有限公司
Publication of WO2017067267A1 publication Critical patent/WO2017067267A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols

Definitions

  • the present invention relates to the field of wireless communications technologies, and in particular, to a method, a system, and an AP for packet redirection.
  • the user is involved in the portal authentication process, which involves the problem of packet redirection.
  • the http packet that originally accessed the Internet is redirected to the access point (AP), and the AP responds with an error code of 302 to the http packet.
  • the IP address of the portal server is included. According to the http protocol, the user will automatically access the portal server.
  • the inventor finds that the method for redirecting data packets provided by the prior art is to implement page packet redirection in the application layer by using the iptables command.
  • the number of users is relatively large, The slow redirection of page packets will result in poor user experience.
  • an embodiment of the present invention provides a method, a system, and an AP for redirection of a data packet, so as to solve the method for redirecting a data packet provided by the prior art, when a number of users is relatively large, a message may appear.
  • the slow redirection of page packets leads to a problem of poor user experience.
  • a data packet redirection method includes: a wireless network card driver processes an uplink data packet, and the destination MAC address of the uplink http data packet is an AP MAC address, and the destination port is 9000.
  • the destination IP is the IP of the AP;
  • the wireless network card driver processes the downlink data packet, and modifies the source MAC address of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is the uplink. The original destination IP in the http packet.
  • the destination MAC address of the modified uplink http data packet is the MAC of the AP, and the destination port is 9. 000.
  • the method further includes:
  • the wireless network card driver After receiving the STA data packet from the air interface, the wireless network card driver parses the STA data packet;
  • the wireless network card driver determines whether the wireless user passes the portal authentication according to the analysis result. If the authentication fails, it is determined whether the STA data packet is a data packet in the whitelist.
  • the source MAC address of the modified downlink http data packet is the original purpose in the uplink http data packet.
  • the method further includes: before the MAC address source port is the original destination port in the uplink http data packet, and the source IP address is the original destination IP address in the uplink http data packet, the method further includes:
  • the wireless network card driver parses the Ethernet type data frame from the wireless network card
  • the wireless network card driver determines whether the wireless user passes the portal authentication according to the analysis result. If the authentication fails, it is determined whether the Ethernet type data frame is a data packet in the whitelist.
  • the uplink data packet is processed in the packet receiving function ieee80211_input of the wireless network card driver.
  • an AP in a second aspect, includes a wireless network card driver, and the wireless network card driver includes an uplink data packet processing unit and a downlink data packet processing unit.
  • the uplink data packet processing unit is configured to process an uplink data packet
  • the uplink data packet processing unit includes:
  • the uplink modification module is configured to modify the destination MAC of the uplink http data packet to be the MAC of the AP, the destination port is 9000, and the destination IP is the IP of the AP;
  • the downlink data packet processing unit is configured to process a downlink data packet
  • the downlink data packet processing unit includes:
  • the downlink modification module is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the
  • the uplink data packet processing unit further includes:
  • an uplink parsing module configured to: after receiving the STA data packet from the air interface, perform the STA data packet Parsing
  • the uplink determining module is configured to determine, according to the parsing result, whether the wireless user passes the portal authentication, and if the authentication fails, determine whether the STA data packet is a data packet in the whitelist.
  • the downlink data packet processing unit further includes:
  • a downlink parsing module configured to parse an Ethertype data frame from the wireless network card
  • the downlink determining module is configured to determine, according to the parsing result, whether the wireless user passes the portal authentication, and if the authentication fails, determine whether the Ethernet type data frame is a data packet in the whitelist.
  • the uplink data packet processing unit processes the uplink data packet in the packet receiving function ieee80211_inp ut of the wireless network card driver.
  • a system for packet redirection comprising a user terminal and a portal server, the system further comprising the AP according to the second aspect.
  • the method for packet redirection is implemented in a driver of a wireless network card, and thus is a method for implementing packet redirection in a driver layer, and realizing data in an application layer compared to an existing one.
  • the method of packet redirection when there are a large number of users, there will be no slow redirection of page data packets, and the efficiency is better than the existing method of realizing packet redirection in the application layer.
  • FIG. 1 is a flowchart of an implementation of a method for redirecting data packets according to the present invention
  • FIG. 2 is a flowchart of an implementation of processing an uplink data packet by a wireless network card driver in an embodiment of a method for redirecting data packets according to the present invention
  • FIG. 3 is a flowchart of an implementation of processing a downlink data packet by a wireless network card driver in an embodiment of a method for redirecting data packets according to the present invention
  • FIG. 4 is a structural block diagram of an AP embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a system embodiment of data packet redirection according to the present invention. Embodiments of the invention
  • the wireless network card driver processes the uplink data packet, and the destination MAC address of the uplink http data packet is the MAC of the AP, the destination port is 9000, and the destination IP address is the IP of the AP, so that the uplink
  • the data packet can be redirected to the AP; the wireless network card driver processes the downlink data packet, and the source MAC address of the downlink http data packet is modified as the original destination MAC address in the uplink http data packet, and the source port is the original destination port in the uplink http data packet.
  • the source IP is the original destination IP in the uplink http packet, and the user can receive the redirected http packet.
  • FIG. 1 is a flowchart showing an implementation process of a packet redirection method according to Embodiment 1 of the present invention, which is described in detail below.
  • step S101 the wireless network card driver processes the uplink data packet, and modifies the destination MAC address of the uplink http data packet to be the MAC of the AP, the destination port is 9000, and the destination IP address is the IP of the AP.
  • the packet receiving function i eee 80211_inp U t of the wireless network card driver of the AP parses the STA data packet, and determines the wireless user according to the analysis result. Whether to pass the portal authentication, if the authentication fails, it is determined whether the STA data packet is a data packet in the whitelist, and if not, the STA data packet is an http data packet, and the destination MAC address of the http data packet is modified. The MAC address of the AP, the destination port is 9000, and the destination IP address is the IP of the AP. In this way, the http data packet can be redirected to the AP.
  • the data packet in the whitelist includes an address resolution protocol (ARP, Address Resolution)
  • DHCP Dynamic Host Configuration Protocol
  • DNS Domain Name System
  • the receiving function ieee8021 ljnput modifies the destination MAC of the http data packet in the Ethernet header of the http data packet to be the MAC of the AP, and the destination port of the http data packet in the TCP header of the http data packet is 9000. Modify the destination IP address of the http packet in the IP header of the http packet to the IP of the AP.
  • FIG. 2 a process in which the wireless network card driver processes the STA data packet from the air interface is shown in FIG. 2 .
  • the wireless network card driver determines whether the wireless user's portal authentication passes, and if it passes, does not perform subsequent processing. If not, determines whether the STA data packet is It is a data packet in the whitelist. If yes, no subsequent processing is performed. If not, it indicates that the STA data packet is an http data packet, and the destination MAC address of the http data packet can be modified in the Ethernet header of the http data packet to be an AP.
  • MAC modify the destination port of the http packet in the TCP header of the http packet to 9000, modify the destination IP of the http packet in the IP header of the http packet to the IP of the AP, and continue the original wireless network card driver. The collection process.
  • step S102 the wireless network card driver processes the downlink data packet, and modifies the source MAC address of the downlink http data packet to be the original destination MAC address in the uplink http data packet, and the source port is the original destination port in the uplink http data packet.
  • the source IP is the original destination IP in the uplink http packet.
  • contracting function wireless network card driver an AP wlan_ va p_ Sen d of Ethernet type data from the wireless card frame parsing determines radio whether the user port al authentication based on the analysis result, if the authentication If it is not, it is determined whether the Ethernet type data frame is a data packet in the whitelist. If not, it indicates that the Ethernet type data frame is an http data packet, and the source MAC address of the http data packet is modified into an uplink data packet. The original destination MAC address, the source port is the original destination port in the uplink data packet, and the source IP address is the original destination IP address in the uplink data packet, so that the wireless user can receive the redirected http data packet.
  • the original destination MAC, the original destination port, and the original destination IP are extracted from the uplink http data packet in the process of processing the uplink data packet, and the related information is recorded and recorded by the wireless user.
  • FIG. 3 a process in which the wireless network card driver processes the Ethernet type data frame is as shown in FIG. 3.
  • the wireless network card driver determines whether the wireless user's portal authentication passes. If yes, no subsequent processing is performed. If not, the Ethernet type is determined. Whether the data frame is a data packet in the whitelist. If yes, no subsequent processing is performed. If not, it indicates that the Ethernet type data frame is an http data packet, and the http data packet may be modified in the Ethernet header of the http data packet.
  • the source MAC address is the original destination MAC address in the uplink http data packet
  • the source port is the original destination port in the uplink http data packet
  • the source IP address is the original destination IP address in the uplink http data packet, and continues.
  • the original wireless network card driver is sent out, so that the wireless user can receive the redirected ht tp packet.
  • the method for packet redirection is implemented in a driver of a wireless network card, and thus is a method for implementing packet redirection in a driver layer, which is compared with an existing packet at an application layer.
  • the directional method when there are a large number of users, there will be no slow redirection of page data packets, and the efficiency is better than the existing method of implementing packet redirection in the application layer.
  • the size of the sequence numbers of the foregoing processes does not mean the order of execution sequence, and the execution order of each process should be determined by its function and internal logic, and should not be taken to the embodiment of the present invention.
  • the implementation process constitutes any limitation.
  • the AP4 includes: a wireless network card driver 41, and the wireless network card driver 41 includes: an upstream packet processing unit 411 and a downstream packet processing unit 412.
  • the uplink data packet processing unit 411 is configured to process an uplink data packet.
  • the uplink data packet processing unit 411 includes:
  • the uplink modification module is configured to modify the destination MAC of the uplink http data packet to be the MAC of the AP, the destination port is 9000, and the destination IP is the IP of the AP;
  • the downlink data packet processing unit 412 is configured to process the downlink data packet
  • the downlink data packet processing unit 412 includes:
  • the downlink modification module is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the uplink http data packet.
  • Original purpose IP is configured to modify the source MAC of the downlink http data packet to be the original destination MAC address in the uplink http data packet, the source port is the original destination port in the uplink http data packet, and the source IP is in the
  • the uplink data packet processing unit 411 further includes:
  • an uplink parsing module configured to parse the STA data packet after receiving the STA data packet from the air interface;
  • the uplink determining module is configured to determine, according to the parsing result, whether the wireless user passes the portal authentication, and if the authentication fails, determine whether the STA data packet is a data packet in the whitelist, if the STA data packet is not a whitelist.
  • the STA data packet is determined to be an http data packet, and the uplink modification module may be invoked to modify the destination MAC address of the uplink http data packet to be the MAC of the AP, the destination port being 9000, and the destination IP being the IP of the AP.
  • the downlink data packet processing unit 412 further includes:
  • a downlink parsing module configured to parse an Ethertype data frame from the wireless network card
  • a downlink determining module configured to determine, according to the parsing result, whether the wireless user passes the portal authentication, and if the authentication fails, determining whether the Ethernet type data frame is a data packet in the whitelist, if the Ethernet type data frame is not
  • the data packet in the whitelist may determine that the Ethernet type data frame is an http data packet, and may invoke the downlink modification module to modify the source MAC address of the downlink http data packet to be the original destination MAC address in the uplink http data packet, and the source port is the uplink http.
  • the original destination port and source IP address in the data packet are the original destination IP address in the uplink http data packet.
  • the uplink data packet processing unit 411 processes the uplink data packet in the packet receiving function ieee80211_ input of the wireless network card driver.
  • the downlink data packet processing unit 412 processes the downlink data packet in the packet sending function wlan_vap_send of the wireless network card driver.
  • FIG. 5 is a schematic structural diagram of a system for packet redirection provided by Embodiment 3 of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown.
  • the data packet redirection system includes a user terminal station and a portal server, and further includes the AP described in Embodiment 2.
  • the wireless user portal authentication fails, the TCP header, IP header, and Ethernet header of the uplink and downlink data of the wireless user are modified in the wireless network card driver of the AP, so that the http data originally accessed to the Internet is redirected to the AP, and then The AP responds with an error code of 302 to the http, and the response includes the IP address of the portal server.
  • the wireless user then automatically accesses the portal server, thus realizing the common use in the commercial wifi solution.
  • the disclosed system, 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 manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the 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 electrical, mechanical or otherwise.
  • 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 functions, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including Several instructions are used to make a computer device (which can be a personal computer, server, or network device, etc.) All or part of the steps of the method of the various embodiments of the invention are performed.
  • the foregoing storage medium includes: u disk
  • RAM random access memory
  • disk disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种数据包重定向的方法、系统及AP,所述方法包括:无线网卡驱动程序对上行数据包进行处理,修改上行http数据包的目的MAC为AP的MAC、目的端口为9000、目的IP为AP的IP;无线网卡驱动程序对下行数据包进行处理,修改下行http数据包的源MAC为上行http数据包中的原目的MAC、源端口为上行http数据包中的原目的端口、源IP为上行http数据包中的原目的IP。本发明,相比现有的在应用层实现数据包重定向的方法,当用户数比较多的时候,不会出现页面数据包重定向缓慢的现象,效率上比现有的在应用层实现数据包重定向的方法有一定提高。

Description

技术领域
[0001] 本发明属于无线通信技术领域, 尤其涉及一种数据包重定向的方法、 系统及 A P。
背景技术
[0002] 在商业 wifi解决方案中, 用户进行 portal认证过程中, 都会涉及到数据包重定向 的问题。 在无线用户进行 portal认证未通过吋, 将原本访问互联网的 http数据包重 定向至无线访问节点 (Access Point, AP) , 再由 AP对该 http数据包做出错误码 为 302的响应, 该响应中包含 portal服务器的 IP地址, 按照 http协议规定, 用户接 下来会自动访问 portal服务器。
[0003] 然而, 在实现本发明过程中, 发明人发现现有技术提供的数据包重定向的方法 , 是用 iptables命令在应用层实现页面数据包重定向, 当用户数比较多的吋候, 会出现页面数据包重定向缓慢的现象, 导致用户体验不佳。
技术问题
[0004] 有鉴于此, 本发明实施例提供一种数据包重定向的方法、 系统及 AP, 以解决 现有技术提供的数据包重定向的方法, 当用户数比较多的吋候, 会出现页面数 据包重定向缓慢的现象, 导致用户体验不佳的问题。
问题的解决方案
技术解决方案
[0005] 第一方面, 提供一种数据包重定向的方法, 所述方法包括: 无线网卡驱动程序 对上行数据包进行处理, 修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端 口为 9000、 目的 IP为 AP的 IP;
[0006] 无线网卡驱动程序对下行数据包进行处理, 修改下行 http数据包的源 MAC为上 行 http数据包中的原目的 MAC、 源端口为上行 http数据包中的原目的端口、 源 IP 为上行 http数据包中的原目的 IP。
[0007] 进一步地, 在所述修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端口为 9 000、 目的 IP为 AP的 IP之前, 所述方法还包括:
[0008] 无线网卡驱动程序接收到来自空口的 STA数据包后, 对所述 STA数据包进行解 析;
[0009] 无线网卡驱动程序根据解析结果判断无线用户是否通过 portal认证, 如果认证 未通过, 则判断所述 STA数据包是否是白名单中的数据包。
[0010] 进一步地, 在所述修改下行 http数据包的源 MAC为上行 http数据包中的原目的
MAC、 源端口为上行 http数据包中的原目的端口、 源 IP为上行 http数据包中的原 目的 IP之前, 所述方法还包括:
[0011] 无线网卡驱动程序对来自无线网卡的以太类型数据帧进行解析;
[0012] 无线网卡驱动程序根据解析结果判断无线用户是否通过 portal认证, 如果认证 未通过, 则判断所述以太类型数据帧是否是白名单中的数据包。
[0013] 进一步地, 在无线网卡驱动的收包函数 ieee80211_input中对上行数据包进行处 理。
[0014] 进一步地, 在无线网卡驱动的发包函数 wlan_Vap_send中对下行数据包进行处理
[0015] 第二方面, 提供一种 AP, 所述 AP包括无线网卡驱动程序, 所述无线网卡驱动 程序包括上行数据包处理单元和下行数据包处理单元;
[0016] 所述上行数据包处理单元, 用于对上行数据包进行处理;
[0017] 所述上行数据包处理单元包括:
[0018] 上行修改模块, 用于修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端口 为 9000、 目的 IP为 AP的 IP;
[0019] 所述下行数据包处理单元, 用于对下行数据包进行处理;
[0020] 所述下行数据包处理单元包括:
[0021] 下行修改模块, 用于修改下行 http数据包的源 MAC为上行 http数据包中的原目 的 MAC、 源端口为上行 http数据包中的原目的端口、 源 IP为上行 http数据包中的 原目的 IP。
[0022] 进一步地, 所述上行数据包处理单元还包括:
[0023] 上行解析模块, 用于接收到来自空口的 STA数据包后, 对所述 STA数据包进行 解析;
[0024] 上行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证, 如果认 证未通过, 则判断所述 STA数据包是否是白名单中的数据包。
[0025] 进一步地, 所述下行数据包处理单元还包括:
[0026] 下行解析模块, 用于对来自无线网卡的以太类型数据帧进行解析;
[0027] 下行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证, 如果认 证未通过, 则判断所述以太类型数据帧是否是白名单中的数据包。
[0028] 进一步地, 所述上行数据包处理单元在无线网卡驱动的收包函数 ieee80211_inp ut中对上行数据包进行处理。
[0029] 进一步地, 所述下行数据包处理单元在无线网卡驱动的发包函数 wlan_Vap_send 中对下行数据包进行处理。
[0030] 第三方面, 提供一种数据包重定向的系统, 包括用户终端和 portal服务器, 所 述系统还包括如第二方面所述的 AP。
发明的有益效果
有益效果
[0031] 在本发明实施例, 数据包重定向的方法是在无线网卡的驱动程序中实现, 因此 是一种在驱动层实现数据包重定向的方法, 相比现有的在应用层实现数据包重 定向的方法, 当用户数比较多的吋候, 不会出现页面数据包重定向缓慢的现象 , 效率上比现有的在应用层实现数据包重定向的方法有一定提高。
对附图的简要说明
附图说明
[0032] 图 1是本发明数据包重定向的方法实施例的实现流程图;
[0033] 图 2是本发明数据包重定向的方法实施例中, 无线网卡驱动程序对上行数据包 进行处理的实现流程图;
[0034] 图 3是本发明数据包重定向的方法实施例中, 无线网卡驱动程序对下行数据包 进行处理的实现流程图;
[0035] 图 4是本发明 AP实施例的结构框图;
[0036] 图 5是本发明数据包重定向的系统实施例的结构示意图。 本发明的实施方式
[0037] 为了使本发明的目的、 技术方案及优点更加清楚明白, 以下结合附图及实施例 , 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实施例仅仅用 以解释本发明, 并不用于限定本发明。
[0038] 在本发明实施例中, 无线网卡驱动程序对上行数据包进行处理, 修改上行 http 数据包的目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP, 使上行 htt p数据包可以重定向到 AP; 无线网卡驱动程序对下行数据包进行处理, 修改下行 http数据包的源 MAC为上行 http数据包中的原目的 MAC、 源端口为上行 http数据 包中的原目的端口、 源 IP为上行 http数据包中的原目的 IP, 用户就可以接收到重 定向后的 http数据包。
[0039] 以下结合具体实施例对本发明的实现进行详细描述:
[0040] 实施例一
[0041] 图 1示出了本发明实施例一提供的数据包重定向的方法的实现流程, 详述如下
[0042] 在步骤 S101中, 无线网卡驱动程序对上行数据包进行处理, 修改上行 http数据 包的目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP。
[0043] 在本发明实施例中, AP的无线网卡驱动程序的收包函数 ieee80211_inpUt接收到 来自空口的 STA数据包后, 对所述 STA数据包进行解析, 根据解析结果判断无线 用户是否通过 portal认证, 如果认证未通过, 则判断所述 STA数据包是否是白名 单中的数据包, 如果不是, 则表示所述 STA数据包是 http数据包, 修改所述 http 数据包的目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP, 如此一来 , 所述 http数据包可以重定向到 AP。
[0044] 其中, 白名单中的数据包包括地址解析协议 (ARP, Address Resolution
Protocol) 数据包, 动态主机分配协议 (DHCP, Dynamic Host Configuration Protocol) 数据包和域名系统 (DNS, Domain Name System) 数据包。
[0045] 其中, 收包函数 ieee8021 ljnput在 http数据包的以太头中修改 http数据包的目的 MAC为 AP的 MAC, 在 http数据包的 TCP头中修改 http数据包的目的端口为 9000, 在 http数据包的 IP头中修改 http数据包的目的 IP为 AP的 IP。
[0046] 具体的, 无线网卡驱动程序对来自空口的 STA数据包进行处理的流程如图 2所 示。 在图 2中, 无线网卡驱动程序接收到来自空口的 STA数据包后, 先判断无线 用户的 portal认证是否通过, 如果通过, 则不进行后续处理, 如果没有通过, 则 判断所述 STA数据包是否是白名单中的数据包, 如果是, 则不进行后续处理, 如 果不是, 则表示所述 STA数据包是 http数据包, 可以在 http数据包的以太头中修 改 http数据包的目的 MAC为 AP的 MAC, 在 http数据包的 TCP头中修改 http数据包 的目的端口为 9000, 在 http数据包的 IP头中修改 http数据包的目的 IP为 AP的 IP, 并继续原有无线网卡驱动程序的收包流程。
[0047] 在步骤 S102中, 无线网卡驱动程序对下行数据包进行处理, 修改下行 http数据 包的源 MAC为上行 http数据包中的原目的 MAC、 源端口为上行 http数据包中的原 目的端口、 源 IP为上行 http数据包中的原目的 IP。
[0048] 在本发明实施例中, AP的无线网卡驱动程序的发包函数 wlan_vap_Send对来自 无线网卡的以太类型数据帧进行解析, 根据解析结果判断无线用户是否通过 port al认证, 如果认证未通过, 则判断所述以太类型数据帧是否是白名单中的数据包 , 如果不是, 则表示所述以太类型数据帧是 http数据包, 修改所述 http数据包的 源 MAC为上行数据包中的原目的 MAC、 源端口为上行数据包中的原目的端口、 源 IP为上行数据包中的原目的 IP, 如此一来, 无线用户可以接收到重定向的 http 数据包。
[0049] 其中, 原目的 MAC、 原目的端口和原目的 IP是在对上行数据包处理的过程中, 从上行 http数据包中提取, 并按无线用户保存记录下来相关信息。
[0050] 具体的, 无线网卡驱动程序对以太类型数据帧进行处理的流程如图 3所示。 在 图 3中, 无线网卡驱动程序接收到来自无线网卡的以太类型数据帧后, 先判断无 线用户的 portal认证是否通过, 如果通过, 则不进行后续处理, 如果没有通过, 则判断所述以太类型数据帧是否是白名单中的数据包, 如果是, 则不进行后续 处理, 如果不是, 则表示所述以太类型数据帧是 http数据包, 可以在 http数据包 的以太头中修改 http数据包的源 MAC为上行 http数据包中的原目的 MAC、 源端口 为上行 http数据包中的原目的端口、 源 IP为上行 http数据包中的原目的 IP, 并继续 原有无线网卡驱动程序的发包流程, 如此一来, 无线用户可以接收到重定向的 ht tp数据包。
[0051] 本实施例, 数据包重定向的方法是在无线网卡的驱动程序中实现, 因此是一种 在驱动层实现数据包重定向的方法, 相比现有的在应用层实现数据包重定向的 方法, 当用户数比较多的吋候, 不会出现页面数据包重定向缓慢的现象, 效率 上比现有的在应用层实现数据包重定向的方法有一定提高。
[0052] 应理解, 在本发明实施例中, 上述各过程的序号的大小并不意味着执行顺序的 先后, 各过程的执行顺序应以其功能和内在逻辑确定, 而不应对本发明实施例 的实施过程构成任何限定。
[0053] 本领域普通技术人员可以理解实现上述各实施例方法中的全部或部分步骤是可 以通过程序来指令相关的硬件来完成, 相应的程序可以存储于一计算机可读取 存储介质中, 所述的存储介质, 如 ROM/RAM、 磁盘或光盘等。
[0054] 实施例二
[0055] 图 4示出了本发明实施例二提供的 AP的具体结构框图, 为了便于说明, 仅示出 了与本发明实施例相关的部分。 该 AP4包括: 无线网卡驱动程序 41, 所述无线网 卡驱动程序 41包括: 上行数据包处理单元 411和下行数据包处理单元 412。
[0056] 其中, 所述上行数据包处理单元 411, 用于对上行数据包进行处理;
[0057] 所述上行数据包处理单元 411包括:
[0058] 上行修改模块, 用于修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端口 为 9000、 目的 IP为 AP的 IP;
[0059] 所述下行数据包处理单元 412, 用于对下行数据包进行处理;
[0060] 所述下行数据包处理单元 412包括:
[0061] 下行修改模块, 用于修改下行 http数据包的源 MAC为上行 http数据包中的原目 的 MAC、 源端口为上行 http数据包中的原目的端口、 源 IP为上行 http数据包中的 原目的 IP。
[0062] 进一步地, 所述上行数据包处理单元 411还包括:
[0063] 上行解析模块, 用于接收到来自空口的 STA数据包后, 对所述 STA数据包进行 解析; [0064] 上行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证, 如果认 证未通过, 则判断所述 STA数据包是否是白名单中的数据包, 如果所述 STA数据 包不是白名单中的数据包, 则可以确定所述 STA数据包是 http数据包, 可以调用 上行修改模块修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP。
[0065] 进一步地, 所述下行数据包处理单元 412还包括:
[0066] 下行解析模块, 用于对来自无线网卡的以太类型数据帧进行解析;
[0067] 下行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证, 如果认 证未通过, 则判断所述以太类型数据帧是否是白名单中的数据包, 如果所述以 太类型数据帧不是白名单中的数据包, 则可以确定所述以太类型数据帧是 http数 据包, 可以调用下行修改模块修改下行 http数据包的源 MAC为上行 http数据包中 的原目的 MAC、 源端口为上行 http数据包中的原目的端口、 源 IP为上行 http数据 包中的原目的 IP。
[0068] 进一步地, 所述上行数据包处理单元 411在无线网卡驱动的收包函数 ieee80211_ input中对上行数据包进行处理。
[0069] 进一步地, 所述下行数据包处理单元 412在无线网卡驱动的发包函数 wlan_vap_ send中对下行数据包进行处理。
[0070] 本发明实施例提供的 AP可以应用在前述对应的方法实施例一中, 详情参见上 述实施例一的描述, 在此不再赘述。
[0071] 实施例三
[0072] 图 5示出了本发明实施例三提供的数据包重定向的系统的结构示意图, 为了便 于说明, 仅示出了与本发明实施例相关的部分。 该数据包重定向的系统包括用 户终端 station和 portal服务器, 还包括实施例二中所述的 AP。 无线用户 portal认证 未通过吋, 在 AP的无线网卡驱动程序中对无线用户上下行数据的 TCP头、 IP头 和以太头进行修改, 这样一来, 原本访问互联网的 http数据重定向到 AP, 再由 A P对该 http做出错误码为 302的响应, 该响应中包含 portal服务器的 IP地址, 按照 htt p协议规定, 无线用户接下来会自动访问 portal服务器, 这样就实现了商业 wifi解 决方案中常用的在用户终端弹出 portal页面的功能。 [0073] 本发明实施例提供的数据包重定向的系统可以应用在前述对应的方法实施例一 中, 详情参见上述实施例一的描述, 在此不再赘述。
[0074] 本领域普通技术人员可以意识到, 结合本文中所公幵的实施例描述的各示例的 单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结合来实现
。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特定应用和设 计约束条件。 专业技术人员可以对每个特定的应用来使用不同方法来实现所描 述的功能, 但是这种实现不应认为超出本发明的范围。
[0075] 所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描述的系 统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应过程, 在 此不再赘述。
[0076] 在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现吋可以有另外的 划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些 特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或直接耦 合或通信连接可以是通过一些接口, 装置或单元的间接耦合或通信连接, 可以 是电性, 机械或其它的形式。
[0077] 所述作为分离部件说明的单元可以是或者也可以不是物理上分幵的, 作为单元 显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可 以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。
[0078] 另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可 以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。
[0079] 所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用吋, 可 以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的技术方案 本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产 品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令 用以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网络设备等) 执 行本发明各个实施例所述方法的全部或部分步骤。 而前述的存储介质包括: u盘
、 移动硬盘、 只读存储器 (ROM, Read-Only
Memory) 、 随机存取存储器 (RAM, Random Access Memory) 、 磁碟或者光盘 等各种可以存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到变化 或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护范围应所述 以权利要求的保护范围为准。

Claims

权利要求书
一种数据包重定向的方法, 其特征在于, 所述方法包括:
无线网卡驱动程序对上行数据包进行处理, 修改上行 http数据包的目 的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP;
无线网卡驱动程序对下行数据包进行处理, 修改下行 http数据包的源
MAC为上行 http数据包中的原目的 MAC、 源端口为上行 http数据包中 的原目的端口、 源 IP为上行 http数据包中的原目的 IP。
如权利要求 1所述的方法, 其特征在于, 在所述修改上行 http数据包的 目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP之前, 所 述方法还包括:
无线网卡驱动程序接收到来自空口的 STA数据包后, 对所述 STA数据 包进行解析;
无线网卡驱动程序根据解析结果判断无线用户是否通过 portal认证, 如果认证未通过, 则判断所述 STA数据包是否是白名单中的数据包。 如权利要求 1所述的方法, 其特征在于, 在所述修改下行 http数据包的 源 MAC为上行 http数据包中的原目的 MAC、 源端口为上行 http数据包 中的原目的端口、 源 IP为上行 http数据包中的原目的 IP之前, 所述方 法还包括:
无线网卡驱动程序对来自无线网卡的以太类型数据帧进行解析; 无线网卡驱动程序根据解析结果判断无线用户是否通过 portal认证, 如果认证未通过, 则判断所述以太类型数据帧是否是白名单中的数据 包。
如权利要求 2所述的方法, 其特征在于, 在无线网卡驱动的收包函数 i eee8021 l_input中对上行数据包进行处理。
如权利要求 3所述的方法, 其特征在于, 在无线网卡驱动的发包函数 wlan_vap_send中对下行数据包进行处理。
一种 AP, 其特征在于, 所述 AP包括无线网卡驱动程序, 所述无线网 卡驱动程序包括上行数据包处理单元和下行数据包处理单元; 所述上行数据包处理单元, 用于对上行数据包进行处理;
所述上行数据包处理单元包括:
上行修改模块, 用于修改上行 http数据包的目的 MAC为 AP的 MAC、 目的端口为 9000、 目的 IP为 AP的 IP;
所述下行数据包处理单元, 用于对下行数据包进行处理;
所述下行数据包处理单元包括:
下行修改模块, 用于修改下行 http数据包的源 MAC为上行 http数据包 中的原目的 MAC、 源端口为上行 http数据包中的原目的端口、 源 IP为 上行 http数据包中的原目的 IP。
如权利要求 6所述的 AP, 其特征在于, 所述上行数据包处理单元还包 括:
上行解析模块, 用于接收到来自空口的 STA数据包后, 对所述 STA数 据包进行解析;
上行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证 , 如果认证未通过, 则判断所述 STA数据包是否是白名单中的数据包 如权利要求 6所述的 AP, 其特征在于, 所述下行数据包处理单元还包 括:
下行解析模块, 用于对来自无线网卡的以太类型数据帧进行解析; 下行判断模块, 用于根据解析结果判断无线用户是否通过 portal认证 , 如果认证未通过, 则判断所述以太类型数据帧是否是白名单中的数 据包。
如权利要求 7所述的 AP, 其特征在于, 所述上行数据包处理单元在无 线网卡驱动的收包函数 ieee80211_input中对上行数据包进行处理。 如权利要求 8所述的 AP, 其特征在于, 所述下行数据包处理单元在无 线网卡驱动的发包函数 wlan_vap_send中对下行数据包进行处理。 一种数据包重定向的系统, 包括用户终端和 portal服务器, 其特征在 于, 所述系统还包括如权利要求 5至 10任一项所述的 AP。
PCT/CN2016/092123 2015-10-19 2016-07-28 数据包重定向的方法、系统及ap WO2017067267A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510678841.2 2015-10-19
CN201510678841.2A CN105338528B (zh) 2015-10-19 2015-10-19 数据包重定向的方法、系统及无线访问节点

Publications (1)

Publication Number Publication Date
WO2017067267A1 true WO2017067267A1 (zh) 2017-04-27

Family

ID=55288730

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/092123 WO2017067267A1 (zh) 2015-10-19 2016-07-28 数据包重定向的方法、系统及ap

Country Status (2)

Country Link
CN (1) CN105338528B (zh)
WO (1) WO2017067267A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553448A (zh) * 2020-11-18 2022-05-27 上海汽车集团股份有限公司 一种车载网络信息安全系统

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105338528B (zh) * 2015-10-19 2017-11-10 华讯方舟科技有限公司 数据包重定向的方法、系统及无线访问节点
CN108848198B (zh) * 2018-05-07 2021-06-29 上海中兴易联通讯股份有限公司 一种多业务转发模式AP的Portal差异化推送方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130007286A1 (en) * 2011-06-29 2013-01-03 Juniper Networks, Inc. User session routing between mobile network gateways
CN104283972A (zh) * 2014-10-28 2015-01-14 成都西加云杉科技有限公司 基于浏览器的消息推送方法、设备和系统
CN105338528A (zh) * 2015-10-19 2016-02-17 深圳市华讯方舟科技有限公司 数据包重定向的方法、系统及ap

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8571222B1 (en) * 2003-08-13 2013-10-29 Verizon Corporate Services Group Inc. System and method for wide area wireless connectivity to the internet
CN100452753C (zh) * 2006-04-28 2009-01-14 腾讯科技(深圳)有限公司 一种数据传输系统及方法
CN103491065B (zh) * 2012-06-14 2018-08-14 南京中兴软件有限责任公司 一种透明代理及其实现方法
CN103825881B (zh) * 2013-12-13 2017-05-31 福建三元达网络技术有限公司 基于无线访问控制器ac实现wlan用户的重定向方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130007286A1 (en) * 2011-06-29 2013-01-03 Juniper Networks, Inc. User session routing between mobile network gateways
CN104283972A (zh) * 2014-10-28 2015-01-14 成都西加云杉科技有限公司 基于浏览器的消息推送方法、设备和系统
CN105338528A (zh) * 2015-10-19 2016-02-17 深圳市华讯方舟科技有限公司 数据包重定向的方法、系统及ap

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553448A (zh) * 2020-11-18 2022-05-27 上海汽车集团股份有限公司 一种车载网络信息安全系统
CN114553448B (zh) * 2020-11-18 2024-05-17 上海汽车集团股份有限公司 一种车载网络信息安全系统

Also Published As

Publication number Publication date
CN105338528B (zh) 2017-11-10
CN105338528A (zh) 2016-02-17

Similar Documents

Publication Publication Date Title
EP3032859B1 (en) Access control method and system, and access point
US9729501B2 (en) System and data card for stateless automatic configuration of IPv6 address and method for implementing the same
EP2633667B1 (en) System and method for on the fly protocol conversion in obtaining policy enforcement information
WO2013056675A1 (zh) 一种WiFi接入点接入方法、WiFi接入点及WiFi系统
US8601103B2 (en) Method, apparatus and system for distributing and enforcing authenticated network connection policy
JP2009212617A (ja) 仮想化システム、仮想化方法、及び仮想化用プログラム
WO2014117525A1 (zh) 静态用户终端认证处理方法及装置
JP2013502883A (ja) Ipアドレス割り当て方法および装置
CN113923650A (zh) 网络接入方法、装置和通信系统
WO2011140795A1 (zh) 一种防止介质访问控制地址欺骗攻击的方法和交换设备
CN103825881A (zh) 基于无线访问控制器ac实现wlan用户的重定向方法及装置
US20170201930A1 (en) Service processing method and apparatus
EP3618365B1 (en) Packet forwarding
WO2020038325A1 (zh) 网络接入方法、无线终端接入设备以及下接设备
WO2022048441A1 (zh) 应用数据的传输方法、系统及电子设备
US20160308824A1 (en) Method for determining gre tunnel, gateway device, and access site
US10917406B2 (en) Access control method and system, and switch
WO2017067267A1 (zh) 数据包重定向的方法、系统及ap
US8438390B2 (en) Method and system for using neighbor discovery unspecified solicitation to obtain link local address
WO2014180302A1 (zh) 一种应用上网处理方法、装置及终端
WO2015024373A1 (zh) 一种虚拟机通信方法及装置
WO2013185696A2 (zh) 一种数据处理的方法与设备
WO2017166038A1 (zh) 通信方法和终端
CN107046568B (zh) 一种认证方法和装置
US9467932B2 (en) Access control method for WiFi device and WiFi device

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: 16856702

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: 16856702

Country of ref document: EP

Kind code of ref document: A1