2006年12月27日 星期三

chillispot installion

為了Support FON今天試著把chillispot裝到ECS040的平台上,記錄一下裝的過程.

1.Download fonear.tar.gz
2.解開並patch
3.修改configure:20961

else
if test "$cross_compiling" = yes; then
ac_cv_func_malloc_0_nonnull=yes <---------------------------------原來是no改成yes
else

4.CFLAGS="-O2 -G 0 -mips32" LDFLAGS="-lcrypt" ./configure --host=mipsel-linux --target=mipsel-linux --cache-file=/dev/null
5.make
6.在來就將src/chilli擺到target上跑跑看.對了,還需要對應FON hotspot的config file
##############################################################################
#
# Fon ChilliSpot configuration file
# Powered by FON (www.fon.com)
#
##############################################################################
radiusserver1 radius01.fon.com
radiusserver2 radius02.fon.com
radiussecret garrafon
uamserver https://login.fon.com/cp/index.php
uamsecret garrafon
uamallowed www.fon.com,www.paypal.com,www.paypalobjects.com,www.skype.com
uamanydns

7.執行囉.注意要停止原本ath0上的dhcp server
./chilli -c ./chilli.conf --dns1=168.95.1.1 --dhcpif=ath0

8.有個地方有bug.在wireless client連線上由dhcp取得IP後送出的封包會轉送到eth0,這會造成skb_buf的錯誤,然後就panic

/fsdata # skput:under: 8010d2e0:54 put:14 dev:eth0Break instruction in kernel code in traps.c::do_bp, line 689:
$0 : 00000000 10008400 00000028 00000000 801bf900 00000001 00000001 00000001
$8 : 00000001 ffffd95e 0000195e 00000000 fffffffa ffffffff 0000000a 00000001
$16: 811b51a0 82c0f920 803aa0a2 810e6e24 00019923 801b3aa8 801b3a80 82a4de60
$24: 82a4dc89 803b4967 82a4c000 82a4dd70 00000005 800df800
Hi : 00000188
Lo : 002b0cdd
epc : 800df800 Tainted: P
Status: 10008403
Cause : 10800024
PrId : 0001800b
Process chilli (pid: 740, stackpage=82a4c000)
Stack: 00019923 8010d2e0 00000036 0000000e 801cb784 82a4dd90 8010d2f0
80000000 803d7780 82a4ddb8 811b51a0 811b51a0 00000008 810e6e24 801cb784
811b51a0 80107a94 80107d28 80154e54 80154fa4 00000036 801c0cb4 00000000
80107fa0 80000000 82a4de00 82a4de68 00000000 00000000 811b51a0 00000008
00000040 800e5558 800dfe18 811b51a0 8368c2e0 00000000 00000000 810e6e24
00000000 ...
Call Trace: [<8010d2e0>] [<8010d2f0>] [<80107a94>] [<80107d28>] [<80154e54>]
[<80154fa4>] [<80107fa0>] [<800e5558>] [<800dfe18>] [<800e5778>] [<800e593c>]
[<8001b20c>] [<800df938>] [<800e5174>] [<800516c0>] [<800c9190>] [<800c9158>]
[<800c921c>] [<8003ddf4>] [<800dd198>] [<8000ba60>]

Code: 248446c8 0c0057bc afa30010 <0000800d> 8fbf0018 03e00008 27bd0020 3c02803c 8c4289e4
Kernel panic: Aiee, killing interrupt handler!
In interrupt handler - not syncing


Trace一下吧

net/core/skbuff.c

void skb_under_panic(struct sk_buff *skb, int sz, void *here)
{
printk("skput:under: %p:%d put:%d dev:%s",
here, skb->len, sz, skb->dev ? skb->dev->name : " ");
BUG(); <-------------------------------------------就在這裡死啦
}

include/linux/skbuff.h

/**
* skb_push - add data to the start of a buffer
* @skb: buffer to use
* @len: amount of data to add
*
* This function extends the used data area of the buffer at the buffer
* start. If this would exceed the total buffer headroom the kernel will
* panic. A pointer to the first byte of the extra data is returned.
*/

static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len)
{
skb->data-=len;
skb->len+=len;
if(skb->data head) {
skb_under_panic(skb, len, current_text_addr());
}
return skb->data;
}

馬的,找到真正的原因了,Inferone提供的kernel裡有個Netfilter->Turbo NAT.拿掉就好了







2006年12月21日 星期四

Wireless Destribute System (WDS)



http://www.homeoffice.idv.tw/archives/000689.html

http://en.wikipedia.org/wiki/Wireless_Distribution_System


WDS can be used to provide two modes of wireless AP-to-AP connectivity:


  • Wireless Bridging in which WDS APs communicate only with each other and don't allow wireless clients or Stations (STA) to access them
  • Wireless Repeating in which APs communicate with each other and with wireless STAs

http://www.geocities.com/backgndtest/wlan_tut.html


http://www.meshnode.org/wiki/index.php/Madwifi-WDS-Bridge


WDS is used between Access Points to allow transparent bridging of two ethernets over a wireless link.


Linux wireless WDS


Model




<1.1>.P-to-P WDS support
/*Create WDS device*/
wlanconfig wds0 create wlandev wifi0 wlanmode wds
/*Add WDS peer MAC address*/


iwpriv wds0 wds_add XX:XX:XX:XX:XX:XX
/*Enable WDS*/
iwpriv wds0 wds 1


/*Set ip address*/


/*Attention !!! Both WDS peer must at the same network*/
ifconfig wds0 172.16.100.1


/*Destroy it*/
wlanconfig wds0 destroy




<2.1>.Access Point with WDS support (Multi Bridge)
wlanconfig wds0 create wlandev wifi0 wlanmode ap


iwconfig wds0 essid "WDS_AP"


< Modify Mac filter >


/*Enable WDS support*/
iwpriv wds0 wds 1
iwconfig wds0 key s:xxxxx <------可支援WEP


iwpriv wds0 maccmd X


iwpriv wds0 addmac XX:XX:XX:XX:XX:XX <------可支援Mac filter

brctl addif br0 wds0 <------加入DHCP server服務範圍


ifconfig wds0 up


/*Destroy it*/
brctl delif br0 wds0
wlanconfig wds0 destroy


<2.2>.Access Point + WDS Station (Repeater)
/*Create WDS station*/
wlanconfig wds0 create wlandev wifi0 wlanmode sta nosbeacon
iwconfig wds0 essid "WDS_AP"
iwpriv wds0 wds 1


iwconfig wds0 key s:xxxxx <------可支援WEP


ifconfig wds0 up


brctl addbr br1


brctl addif br1 ath0
brctl addif br1 wds0 <------透過WDS通道使用DHCP服務


/*Destroy it*/
brctl delif br0 wds0
wlanconfig wds0 destroy


2006年12月11日 星期一

802.11技術規格筆記

1.規格簡述


802.11a : Freq 5 GHz, Max speed 54 Mbps, PHY OFDM(Orthogonal frequency division multiplexing)


802.11b : Freq 2.4 GHz, Max speed 11 Mbps, PHY HR/DSSS(High Rate/Direct Sequence Spread Spectrum)


802.11g : Freq 2.4 GHz, Max speed 54 Mbps, PHY OFDM


 


2.IEEE 802.11 specification


Including 3 layer : LLC (Logical Link Control), MAC(Media Access Control), PHY(Phyical layer)


There are one MAC and two PHY layer in 802.11


Component : Station, Access point, Wireless media (RF), Distribution system (Bridge)


Network type (Basic Service Set) : 


  -> Independent BSS (ad hoc bss) : Peer to peer network


  -> Infrastructure BSS : Station type network


  -> ESS (Extended Service Set) : 以骨幹網路將BSS串聯在一起提供服務,並擁有相同的SSID (Service Set Identifier)


 


Wi-Fi Multimedia (WMM) and WMM Power Save modes. WMM adds Quality of Service (QoS) capabilities to Wi-Fi networks. WMM Power Save is an improvement to the 802.11e amendment adding advanced power management functionality to WMM. WMM Power Save is based on Unscheduled Automatic Power Save Delivery (U-APSD), which, like WMM, is based on Enhanced Distributed Channel Access (EDCA). U-APSD is a solution well suited for dynamic environments where Wi-Fi is generally deployed and allows clients supporting U-APSD to download all or some of the frames buffered by the access point during unscheduled service periods.


關於WME


考慮到基於時間的數據傳輸的QoS重要性,在IEEE正式批准802.11e標準(預計在2005年上半年)之前,已經有一些無線設備製造商開始在實施能基本滿足近期需要的QoS機制,這些大都是基於EDCF的,最有代表性的就是由Wi-Fi聯盟開發的WME(Wireless Mutimedia Enhancements)技術。WME技術並不是除802.11e標準之外的又一個標準,它實際上只是部份地使用了EDCF的標準,所以WME技術是802.11e的一個子集,或者說是在802.11e正式批准之前的過渡標準。一旦802.11e被批准,採用WME技術的設備都可以升級到802.11e標準。


另外,Wi-Fi聯盟還提出了無線計畫媒體(WSM,Wireless Scheduled Multimedia)技術,這是基於HCF機制的增強QoS的技術。Wi-Fi聯盟將初步使用WME,當802.11e標準最終批准之後才有可能採用WSM。