dpp
DPP
DPP(Device Provision Protocol)提出的目的是为了通过Configurator将不同的设备(包括路由器、手机以及各种IoT设备等)加入网络。例如,通过手机(作为Configurator)扫描某个设备(作为Enrollee)上的二维码,就可以将该设备连接上配置好的AP(这个AP也是一个Enrollee,被Configurator配置过)。WiFi联盟官方名字是WiFi Easy Connect,DPP是这个feature的协议。
DPP中的概念
Configurator:作为配置网络的控制器,将不同的其他设备连接入无线局域网,也用于配置AP。
Enrollee:需要接入无线局域网的设备(可能是AP,也可以是作为STA的设备)。
Initiator:在DPP authentication 过程中的发起者。
Responser:对应Initiator,在DPP authentication过程中的回复者。
Connector:有点类似于介绍信,Configurator发放Connector给Enrollee,Enrollee使用Connector向AP发起网络连接请求。
DPP的流程
DPP主要包括以下4个流程:bootstrapping,authentication,configuration以及network introduction。
bootstrapping
bootstrapping的目的就是让其中一方获取到另一方的Public key。可以通过NFC,扫描二维码,蓝牙等获取。
authentication
发起authentication过程的一方称之为Initiator。authentication protocol结束之后,Initiator就相信这个Responder确实是它获取到(比如扫二维码得到)的Public key的真正所有者,同时确定哪一方做Configurator或Enrollee。authentication过程包含三条消息,request,response以及confirm,用于认证和交换各自的capabilities(是否充当Configurator)。此外,authentication过程还生成了会话密钥key用于后面的configuration阶段。
综上,authentication有三大作用:1)认证 2)确定双方的角色 3)生成key。
configuration
通过authentication过程的双方进入到configuration阶段。这个阶段必须由Enrollee发起(不管前边authentication过程中是不是Initiator)且发送的信息通过key加密。在configuration阶段,Enrollee需要告诉Configurator自己是AP还是STA(还有可能是Configurator)。在收到Enrollee发起的request消息后,Configurator发送配置信息给Enrollee,其中包含目标网络的SSID,AKM,以及Credential信息(根据目标网络的类型以及DPP协议版本可能需要提供不同的信息,如Pre-shared key,Connector等)。如果Enrollee收到的Credential信息是Pre-shared key,那么DPP流程结束,直接进入WPA2或WPA3的连接过程(auth,assoc,etc.)
综上,configuration的作用有:1)确定Enrollee角色 2)提供网络配置信息
introduction
introduction只会发生在1)Enrollee是STA 2)在configuration过程中收到的回复信息包含Connector。而且,这个过程和configurator没关系了,是发生在STA和AP之间的。STA拿着Configurator给的介绍信(Connector)找到AP,并发起连接。STA发送DPP Peer Discovery Request frame给AP,AP收到request后根据获取的信息生成PMK,并回复Response信息,STA收到response后也导出PMK。随后进入传统的WiFi连接流程(auth,assoc,etc.)
DPP Demo
RG AP(Enrollee+Configurator) + RE STA(Enrollee)
on AP side, Enable a radio and run a VAP
默认@wifi-iface[0]已经up,且工作正常
1 |
|
on STA side, Enable a radio and run a STA
1 |
|
on STA side,creat config file
1 |
|
On STA side, run command
1 |
|
On AP side ,run command
1 |
|