1. Preliminaries
The
serial ports of two computers are connected via a
Null-Modem cable.
Useful background information can be found in the
Serial-HOWTO.
The kernel needs to have both
SLIP and
CSLIP enabled
(under Network device support).
2. Setting up the IP-over-serial-line link
The
program
slattach is used
to create an
interface on each host's
serial port:
slattach -vd -s 115200 -p cslip /dev/ttyS0
This creates an
interface,
sl0, which needs to be
configured. First it is
enabled via
ip link set dev sl0 up
Then a
point-to-point
link is set up as
follows:
| On
the first computer: |
ip
addr add 10.0.0.1/24 peer 10.0.0.2 dev sl0 |
| On
the second computer: |
ip
addr add 10.0.0.2/24 peer 10.0.0.1 dev sl0 |
Testing with
ping
verifies that this connection works. The interface has a
small MTU (296) and
queue length (10):
% ip -s link show sl0
6: sl0: <POINTOPOINT,MULTICAST,NOARP,UP,10000> mtu 296 qdisc pfifo_fast qlen 10
link/cslip
RX: bytes packets errors dropped overrun mcast
47416 893 0 0 0 0
TX: bytes packets errors dropped carrier collsns
639188 2338 0 0 0 1
3. Speed considerations
Before doing any DCCP tests, it is useful to
estimate the maximum link
speed. The maximum line speed depends on the
type of serial port. To find out
the
maximum line speed of the serial port(s), try
setserial -a -g /dev/ttyS* for
standard-PC serial ports and
/dev/ttyUSB*
for USB serial converters. For
the
standard
16550
UART in PCs this is 115200 bps, USB serial port
converters can do higher speeds.
Bytes sent out via the serial port are
framed using a start-bit and a
stop-bit, so that when parity bits are not used the maximum link speed
is 80% of the line speed. The following table shows measured link
speeds when no parity is used.
Line
Speed in kbps
|
2.400
|
9.600
|
19.200
|
38.400
|
57.600
|
115.200
|
Link
Speed in kbps
|
1.6
|
6.4
|
12.8
|
25.5
|
38.3
|
82.0
|
| Ratio |
66.7%
|
66.7%
|
66.7% |
66.4% |
66.5% |
71.2% |
| RTT
in msec |
734
|
185
|
94
|
48
|
33
|
17.7
|
These speeds were
determined using
iperf with
TCP cubic over a 60-second test run each. RTT values are averages of 10
ping measurements each.
The ratio
Link-speed/Line-speed
shows that
additional overhead reduced the maximum link speed available to TCP
from 80% down to approximately 66.7% (2/3). This
overhead includes the
framing used by the SLIP protocol
(RFC 1055) plus other
overhead, minus the reductions afforded by compressing the TCP/IP
headers using CSLIP
(RFC 1144).
The following table shows the impact of performing
header compression,
and compares against the 6-bit mode of SLIP where only a subset of the
ASCII protocol
("printable
SLIP") is used.
Line
Speed in kbps
|
2.400
|
9.600
|
19.200
|
38.400
|
57.600
|
115.200
|
CSLIP
/ kbps
|
1.6
|
6.4
|
12.8
|
25.5
|
38.3
|
82.0
|
SLIP
/ kbps
|
1.6
|
6.3
|
12.6
|
25.2
|
37.8
|
75.6
|
SLIP6
/ kbps
|
1.2
|
4.7
|
9.5
|
18.9
|
28.4
|
56.7
|
For the selected speed ranges, the gains of using CSLIP are not very
high. Since CSLIP compresses TCP headers and not DCCP headers, the
benefit of using CSLIP over using SLIP is even less for DCCP.
Together
with start/stop bits, the throughput utilisation of SLIP6 can not be
more than 6/10 = 60%. In the table, the actual value was close to 49%
in each case.
4. DCCP test runs with iperf
For the DCCP tests, CSLIP was used with a line speed of 115.2 kbps. The
following commands were used for the test run, taking into account
the smaller MTU
(and hence
MPS).
| On
the first computer: |
iperf
-sdb -l 236
|
| On
the second computer: |
iperf
-dc 10.0.01 -l 236 -t 10
|