Wireless

From CSCWiki
Jump to navigation Jump to search

Motivation

The UW wireless network has a couple of major deficiencies:

  1. Weak signal in MC 3036, preventing some laptops from connecting
  2. Aggressive throttling of bandwidth, even to wired systems within the club office
  3. Ignorance of the "Don't Count" list

The second point is quite important: UW's wireless will begin to throttle high bandwidth connections after a minute or two, decreasing bandwidth slowly from 1MB/s or more down to 40KB/s or less. Members can expect to sit in the office for an hour or more if they want to download many packages off of the CSC mirror.

To work around this problem we have an access point in the Computer Science Club.

Configuration

  • ESSID: csc-wireless
  • AP: 00:19:5B:7D:DB:FE
  • Channel: 36 (5.18 GHz)
  • Network: auth3net (129.96.192.0/23)

Clients must authenticate to the Network Authentication Appliance (NAA) as with uw-wireless, in accordance with this IST policy, points #2 through #4.

Technical Overview

The AP connects to acesulfame-potassium through a secondary NIC. On acesulfame-potassium, the following decision is made:

  • IP packets destined for mathstudentorgsnet are brouted with SNAT to wireless-nat.csclub.uwaterloo.ca
  • All other ethernet frames are bridged to auth3net

The network is identical to connection through uw-wireless in all respects, except for the special treatment of mathstudentorgs traffic. This special treatment bypasses uw-wireless throttling for machines on our network.

Wireless Performance

Tests were done on a 700MB Ubuntu ISO at an off peak time.

  • uw-wireless
    • Initial speed: 1.3MB/s
    • Final speed: 40KB/s
    • Time: aborted after 27 minutes (got bored) with 67% remaining, ETA increased steadily throughout
 mike@freyr:/tmp$ time wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/7.10/ubuntu-7.10-desktop-i386.iso
 --23:54:09--  http://mirror.csclub.uwaterloo.ca/ubuntu-releases/7.10/ubuntu-7.10-desktop-i386.iso
 Resolving mirror.csclub.uwaterloo.ca... 129.97.134.71
 Connecting to mirror.csclub.uwaterloo.ca|129.97.134.71|:80... connected.
 HTTP request sent, awaiting response... 302 Found
 Location: http://citric-acid.csclub.uwaterloo.ca/iso/ubuntu-gutsy/ubuntu-7.10-desktop-i386.iso [following]
 --23:54:09--  http://citric-acid.csclub.uwaterloo.ca/iso/ubuntu-gutsy/ubuntu-7.10-desktop-i386.iso
 Resolving citric-acid.csclub.uwaterloo.ca... 129.97.134.37
 Connecting to citric-acid.csclub.uwaterloo.ca|129.97.134.37|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 729608192 (696M) [application/x-iso9660-image]
 Saving to: `ubuntu-7.10-desktop-i386.iso'
 
 11% [===>                                    ] 86,583,824   377K/s  eta 13m 34ss
 33% [========================>               ] 241,791,104 39.5K/s  eta 55m 48s
 
 
 real	27m40.165s
 user	0m1.008s
 sys	0m4.252s
  • csc-wireless
    • Initial speed: 2.12MB/s
    • Final speed: 2.43MB/s
    • Time: finished in 3m 31s
mike@freyr:/tmp/test$ wget http://mirror.csclub.uwaterloo.ca/ubuntu-releases/hardy/ubuntu-8.04-beta-server-i386.iso
--2008-04-17 05:34:44--  http://mirror.csclub.uwaterloo.ca/ubuntu-releases/hardy/ubuntu-8.04-beta-server-i386.iso
Resolving mirror.csclub.uwaterloo.ca... 129.97.134.71
Connecting to mirror.csclub.uwaterloo.ca|129.97.134.71|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://taurine.csclub.uwaterloo.ca/iso/ubuntu-8.04-beta-server-i386.iso [following]
--2008-04-17 05:34:44--  http://taurine.csclub.uwaterloo.ca/iso/ubuntu-8.04-beta-server-i386.iso
Resolving taurine.csclub.uwaterloo.ca... 129.97.134.34
Connecting to taurine.csclub.uwaterloo.ca|129.97.134.34|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 526323712 (502M) [application/x-iso9660-image]
Saving to: `ubuntu-8.04-beta-server-i386.iso'

 2% [                                        ] 10,988,599  2.12M/s  eta 4m 36s 
 4% [>                                       ] 21,247,679  2.43M/s  eta 3m 58s 
 6% [=>                                      ] 31,897,719  2.41M/s  eta 3m 41s 
16% [=====>                                  ] 85,867,575  2.40M/s  eta 3m 2s  
27% [=========>                              ] 143,900,519 2.36M/s  eta 2m 38s 
38% [==============>                         ] 203,245,351 2.36M/s  eta 2m 11s 
43% [================>                       ] 228,489,783 2.43M/s  eta 2m 2s  
51% [===================>                    ] 269,462,391 2.41M/s  eta 1m 45s 
58% [======================>                 ] 309,395,335 2.48M/s  eta 88s    
67% [=========================>              ] 354,638,095 2.41M/s  eta 70s    
78% [==============================>         ] 410,898,984 2.41M/s  eta 47s    
84% [================================>       ] 444,207,328 2.42M/s  eta 33s    
94% [====================================>   ] 498,937,384 2.39M/s  eta 12s    
97% [======================================> ] 514,212,336 2.39M/s  eta 5s     
99% [======================================> ] 524,255,664 2.43M/s  eta 1s     
100%[=======================================>] 526,323,712 2.43M/s   in 3m 31s  

2008-04-17 05:38:15 (2.38 MB/s) - `ubuntu-8.04-beta-server-i386.iso' saved [526323712/526323712]

These tests are sloppily done, to be sure, but still demonstrate the huge performance advantage of csc-wireless. I will repeat them without aborting, when I have time.

Detailed Configuration

Required Packages

To install required packages, type:

sudo aptitude install madwifi-source madwifi-tools wireless-tools vlan bridge-utils ebtables iptables iproute

Then build the modules for the installed kernel via:

sudo m-a a-i madwifi

Wireless Interface Configuration

First, configure the wireless interface. Use the following snippet:

auto ath0
iface ath0 inet manual
        pre-up wlanconfig ath0 destroy || true
        pre-up wlanconfig ath0 create wlandev wifi0 wlanmode ap
        post-down wlanconfig ath0 destroy
        wireless-mode master
        wireless-channel 36
        wireless-essid csc-wireless

Second, make a bridge between the wireless and auth3net. Use the following snippet, replacing IFACE by the interface connected to auth3net

auto br192
iface br192 inet manual
        bridge_ports IFACE ath0
        bridge_stp yes
        up brctl setbridgeprio br192 40000
        up ip route add 129.97.192.0/23 dev br192

Brouting Configuration

Additional setup is needed to enable fast communication between mathstudentorgsnet and auth3net. We take the minimally invasive approach of pulling packets destined for mathstudentorgsnet off the bridge and routing them, masquerading as wireless-nat.csclub.uwaterloo.ca. Masquerading is needed to ensure responses are routed correctly.

First, add 129.97.134.85 as a secondary IP address. You might do so by adding this snippet, replacing IFACE by the interface connected to mathstudentorgsnet:

auto IFACE:nat
iface IFACE:nat inet static
       address 129.97.134.85
       netmask 255.255.255.0
       network 129.97.134.0

Second, enable routing, by adding the following snippet to sysctl.conf:

net.ipv4.ip_forward=1

Third, configure ebtables to pull packets off the bridge. Type:

ebtables -t broute --flush

ebtables -t broute -A BROUTING -i ath0 \
    -p ipv4 --ip-src 129.97.192.0/23 --ip-dst 129.97.134.0/24 \
    -j redirect --redirect-target DROP

invoke-rc.d ebtables save

Finally, configure iptables to masquerade wireless users as wireless-nat.csclub. Type the following, replacing IFACE by the interface connected to mathstudentorgsnet:

iptables -t nat --flush

iptables -t nat -A POSTROUTING -o IFACE \
    -s 129.97.192.0/23 -d 129.97.134.0/24 \
    -j SNAT --to-source 129.97.134.85

invoke-rc.d iptables save

Ensure the appropriate routing table entry for auth3net exists--masquerading will not work without it. It is included in the bridge configuration snippet above.

External Links