Dec 25, 2014

AP joining process (1.b) -- What is Discovery mechanism - 2?

Hello everyone

In this post, I will explain that How to use Capwap discovery request and response to find out WLC  --- Discovery by broadcast. 

Before to explain that, It is better to understand the structure of Capwap packet.


Capawap Control Packet (Discover Request / Response)
+ -------------------------------------------------------------------------------+
|IP Hdr | UDP Hdr | CAPWAP Hdr | Control Hdr| Message Element(S)|
+ -------------------------------------------------------------------------------+

As shown in this picture, you can see that there are five parts in the Capwap Control Packet and We will focus on Message Elements.

In Message Elements, it has one element called "Discovery Type" which is 8 bits.

Discovery Type:  The following enumerated values are supported:

0 -     Unknown
1 -     Static Configure
2 -     DHCP
3 -     DNS
4 -     AC Preferral .

In the cisco AP and WLC, Discovery Type 0 is "Discovery by broadcast".


** Topology **
AP  ----   SW3750   ----   SWCat6K  ----   WLC5508

AP IP addr: 172.33.67.231
WLC5508 IP addr: 172.33.67.10

AP and WLC 5508 are in the same Vlan 367
****


I get packet capture of AP port. As shown in the following figure.



In Seq. No. 89,  AP broadcasts a Capwap discovery request (255.255.255.255) in vlan 367 and asks who in the WLC in the vlan 367's room.  Since WLC (172.33.67.10) can listen this discovery request and say to the AP "Hi, guy. I am here". WLC answers to AP as unicast message --- Capwap discovery response  in Seq. No. 90  

Also you can see that the value of discovery type is 0 which means discovery by broadcast.


If you give "debug capwap client event" on AP,  you will see the similar messages.
*Time: CAPWAP Control mesg Sent to 255.255.255.255, Port 5246
*Time: Msg Type   : CAPWAP_PRIMARY_DISCOVERY_REQUEST
*Time: Msg Length : 96
*Time: Msg SeqNum : 0
*Time: %CAPWAP-3-EVENTLOG: Primary Discovery Request sent to 255.255.255.255
*Time: CAPWAP Control mesg Recd from 172.33.67.10, Port 5246
*Time: HLEN 2,   Radio ID 0,    WBID 1
*Time: Msg Type   : CAPWAP_PRIMARY_DISCOVERY_RESPONSE
*Time: Msg Length : 117
*Time: Msg SeqNum : 0
*Time: %CAPWAP-3-EVENTLOG: Primary Discovery Response from 172.33.67.10

Maybe, you will ask what Port 5246 is. Actually, Capwap protocol uses UDP port 5246 to transmit control messages, like here Discovery Request/Response, and uses UDP port 5247 to transmit data messages.


See you next time and Good luck!!

No comments:

Post a Comment