勇闖新世界︰ W!o《卡夫卡村》變形祭︰圓局定向‧四

不論用什麼樣的『 金文尺 』尺來度量,都得了解那根尺的構成,以及量到數值的意義,要如何校正資料,方能有實際的用途。為此特別介紹一個稱之為『地壘』 horst 的軟體︰

spiralsun_smallbr1 blog

high-tech or low-life?

horst

“horst” is a small, lightweight IEEE802.11 wireless LAN analyzer with a text interface. Its basic function is similar to tcpdump, Wireshark or Kismet, but it’s much smaller and shows different, aggregated information which is not easily available from other tools. It is mainly targeted at debugging wireless LANs with a focus on ad-hoc (IBSS) mode in larger mesh networks. It can be useful to get a quick overview of what’s going on on all wireless LAN channels and to identify problems.

  • Shows signal (RSSI) values per station
  • Calculates channel utilization (“usage”) by adding up the amount of time the packets actually occupy the medium
  • “Spectrum Analyzer” shows signal levels and usage per channel
  • Graphical packet history, with signal, packet type and physical rate
  • Shows all stations per ESSID and the live TSF per node as it is counting
  • Detects IBSS “splits” (same ESSID but different BSSID – this is a common driver problem)
  • Statistics of packets/bytes per physical rate and per packet type
  • Has some support for mesh protocols (OLSR and batman)
  • Can filter specific packet types, source addresses or BSSIDs
  • Client/server support for monitoring on remote nodes

“horst” is a Linux program and can be used on any wireless LAN monitor interface. The latest version is 4.2 from Oct 1 2014.

……

【主畫面】

horst-main_0

 

【訊號‧雜訊‧歷史】

horst-history_1

 

【頻譜分析】

horst-spec1

 

以期加深讀者對無線網路的認識。由於這個程式使用 IEEE802.11 的『monitor』操作模式,讀者可用『 iw list 』來確認 USB 無線 dongle 是否具有這個模式︰

 

# iw 工具安裝
pi@raspberrypi ~ sudo apt-get install iw  # 如果 iw list 顯示空行,那個 USB WiFi dongle 不具 IEEE802.11 相容模式。  pi@raspberrypi ~ iw list
Wiphy phy0
# ………
# USB WiFi dongle 提供哪些模式
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * AP/VLAN
		 * WDS
# 有 monitor 模式
		 * monitor
		 * mesh point
	software interface modes (can always be added):
		 * AP/VLAN
		 * monitor
	valid interface combinations:
		 * #{ AP, mesh point } <= 8,
		   total <= 8, #channels <= 1

 

地壘 horst 之安裝及執行︰

# 將 IEEE802.11 的 USB WiFi dongle 設定為 monitor only 模式
pi@raspberrypi ~ iwconfig  wlan0     IEEE 802.11bgn  ESSID:off/any             Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:off            lo        no wireless extensions.  eth0      no wireless extensions.  # 刪除 wlan0 managed 模式 pi@raspberrypi ~ sudo iw dev wlan0 del
pi@raspberrypi ~ iwconfig  lo        no wireless extensions.  eth0      no wireless extensions.  # 增加命名為 mono0 的 monitor 模式 pi@raspberrypi ~ sudo iw phy phy0 interface add mon0 type monitor
pi@raspberrypi ~ iwconfig  lo        no wireless extensions.  mon0      IEEE 802.11bgn  Mode:Monitor  Frequency:2.412 GHz  Tx-Power=20 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:off            eth0      no wireless extensions.  # 取得 horst,編譯地壘,以及執行 pi@raspberrypi ~ wget http://br1.einfach.org/horst_dl/horst-4.2.tar.gz
pi@raspberrypi ~ tar -zxvf horst-4.2.tar.gz pi@raspberrypi ~ cd horst-4.2/
pi@raspberrypi ~/horst-4.2 make pi@raspberrypi ~/horst-4.2 sudo ./horst -i mon0