« ConnexLink 900 MHz link: NSLU2 | Main | Violence en France »

octobre 24, 2005

ConnexLink 900 MHz link: PPP

With the slug happily running OpenSlug, it was now time to set up a Serial/PPP link between my linux server (ali) and the slug.

It was one of the first times in about every project that I have done where everything worked on the first try!

USB-Serial Converter

Since the slug doesn't have a serial port, the first thing that I had to do was to connect my USB-Serial converter. I reused an old one used for connecting my Palm to my PowerBook.

I then installed the necessary module (pl2303) with ipkg install kernel-module-pl2303 followed by a modprobe pl2303. Since I'm using the memstick version of OpenSlug, I have almost no log file and therefore no way of knowing if it had work, but a lsmod listed both the pl2303 and the usbserial modules loaded -- a good sign.

Serial/PPP link

It was time to set up the serial link. I plugged the USB-Serial adapter to ali using a serial cross-over cable. The first thing that I had to do was to install the required software with ipkg install ppp ppp-tools kernel-module-ppp-async kernel-module-ppp-deflate kernel-module-ppp-generic. I then followed the instructions of the Serial-Laplink-HOWTO.

I was surprised to see how easy it was, I just copied and pasted the code example, changed ppp_laplink_server to ali's IP address and ppp_laplink_client to the IP address that I wanted to give to the slug via the PPP link (different than the one it got from the ethernet). VoilĂ ! It worked on the first try!


root@ali:/etc/ppp# /usr/sbin/pppd /dev/ttyS1 nodetach
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS1
PAP peer authentication succeeded for gfk
Deflate (15) compression enabled
found interface eth0 for proxy arp
local IP address 192.168.0.2
remote IP address 192.168.0.43
-----
root@slug:/etc/ppp# /usr/sbin/pppd /dev/ttyUSB0 nodetach
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
Remote message: Login ok
PAP authentication succeeded
Deflate (15) compression enabled
local IP address 192.168.0.43
remote IP address 192.168.0.2

Benchmarks

I tested the reliability of the link with a 15 minutes ping flood:

gfk@ali:~$ sudo ping -f 192.168.0.43
PING 192.168.0.43 (192.168.0.43) 56(84) bytes of data.
.
--- 192.168.0.43 ping statistics ---
74602 packets transmitted, 74601 received, 0% packet loss, time 997772ms
rtt min/avg/max/mdev = 15.099/19.923/39.925/0.239 ms, pipe 3, ipg/ewma 13.374/19.929 ms

Then I measured the bandwidth with iperf. Note that those speeds are all half-duplex.

gfk@ali:~$ iperf -c 192.168.0.43
------------------------------------------------------------
Client connecting to 192.168.0.43, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 5] local 192.168.0.2 port 43315 connected with 192.168.0.43 port 5001
[ 5] 0.0-10.0 sec 3.65 MBytes 3.05 Mbits/sec

I was a bit stunned by these results -- getting 3 Mbps on a 0.12 Mbps link is a little too good to be true -- but I realised that iperf must have been using really simple data for its test. And everyone should know that simple data compresses really well. When using "real world" data or even compressed data, I get more realistic figures:

gfk@ali:~$ iperf -c 192.168.0.43 -F maildir.tar
------------------------------------------------------------
Client connecting to 192.168.0.43, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 6] local 192.168.0.2 port 43312 connected with 192.168.0.43 port 5001
[ 6] 0.0-10.4 sec 400 KBytes 314 Kbits/sec
gfk@ali:~$ iperf -c 192.168.0.43 -F maildir-best.tar.gz
------------------------------------------------------------
Client connecting to 192.168.0.43, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 6] local 192.168.0.2 port 43310 connected with 192.168.0.43 port 5001
[ 6] 0.0-11.5 sec 136 KBytes 96.9 Kbits/sec

These numbers are still very impressing, in my planning I estimated that I would get about 37% of speed gain, but these "real world" results give around 224% of speed gain. If anyone has an explanation, I'd be happy to hear it.

Auto reconnect

The Serial-Laplink-HOWTO talks about a getty-like installation of pppd. getty is the program that allows you to use the PC screen as a terminal, it is started automatically when linux boots and restarted every time it's closed. That's pretty much what we're looking for our ppp link!

To use this, I added this line to /etc/inittab on ali:

pd:2345:respawn:/usr/sbin/pppd /dev/ttyS1 nodetach

On the slug, I needed to load the pl2303 (USB-Serial converter) module before starting the PPP link, so I made a simple script /usr/local/ppp_link:


#!/bin/sh
/sbin/modprobe pl2303
/usr/sbin/pppd /dev/ttyUSB0 nodetach

Then I added this line to /etc/inittab on the slug:

pd:2345:respawn:/usr/local/ppp_link

With this setup, the PPP link is started on boot and is automatically restarted if it goes down.

With this working so well, the next step will be to order a pair of ConnexLink Radio Modems!

Posted by gfk at octobre 24, 2005 3:20 PM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?