cornsea

无线客户端通过开放无线接入点上网全过程

802.11是现在部署非常广泛的也是支持的客户端最多的无线上网协议。

支持802.11协议的客户端想要通过无线路由上网时,首先必须要知道有哪些无线接入点存在,这就想你想通过有线上网必须要

先找到网口一样。在找到无线接入点之后,客户端要和接入点进行绑定,并在得到接入点的认可之后,才能获得

权限访问网络。整个过程涉及到很多内容,包括客户端和接入点之间协商数据传输速度,协商认证方式等。

为了搞清楚整个客户端通过接入点连接网络的整个过程,我用wireshark工具抓了笔记本和一个开放接入点之间

的网络包,简单分析后,使用mscgen工具描绘了大概的交互过程。

抓包的过程是这样的:首先打开wireshark指定从wlan0抓包,然后在浏览器中输入www.163.com. 当然上图只是从大量的网络包中提取

出来的我认为能够描述主要过程的包。实际上802.11协议需要大量的控制包来协助无线客户端和接入点进行通信,同时你的无线网卡

也会收到大量的其他无线节点发过来的协议包,因为空中的协议包是对任何人开放的。

下面是我画这个交互图的mscgen描述语言。

msc {
arcgradient
= 10;
a [label
="PC"],b [label="AP"];
a
=>b [label="12468 probe request", textcolour="blue", linecolour="blue"];
a
=>b [label="12487 authentication", textcolour="blue", linecolour="blue"];
b
=>a [label="12490 authentication", textcolour="red", linecolour="red"];
a
=>b [label="12492 associate request", textcolour="blue", linecolour="blue"];
b
=>a [label="12494 associate response", textcolour="red", linecolour="red"];
a
=>b [label="12678 dhcp request", textcolour="blue", linecolour="blue"];
b
=>a [label="12687 dhcp ack", textcolour="red", linecolour="red"];
a
=>b [label="12698 igmp/ipv4 mcast", textcolour="blue", linecolour="blue"];
a
=>b [label="15195 dns query www.163.com", textcolour="blue", linecolour="blue"];
b
=>a [label="15217 dns response", textcolour="red", linecolour="red"];
a
=>b [label="15223 tcp [syn]", textcolour="blue", linecolour="blue"];
b
=>a [label="15226 tcp [syn,ack]", textcolour="red", linecolour="red"];
a
=>b [label="15229 tcp [ack]", textcolour="blue", linecolour="blue"];
a
=>b [label="15232 http get", textcolour="blue", linecolour="blue"];
}

我之前用过visio,dia等图形化工具来画这种交互图,但是感觉还是很麻烦,比如摆放箭头,调整颜色

之类的,在发现mscgen这个工具后,我觉得可以放弃visio和dia了。mscgen的作者是受了graphviz的启发才开始开发这个工具的。

graphviz的dot语言也是画各种结构图的一件利器。

posted on 2011-03-20 22:18  cornsea  阅读(1234)  评论(0编辑  收藏  举报

导航