Testlayer1
From mISDN.org
- source code: mISDNuser/example/testlayer1.c
- testlayer1 is able to test layer1 implementations without using any upper layers (layer2/layer3)
- it opens a connection to layer1 in NT mode
- it assumes that every frame send down to S0 bus is looped back immediatly and can be received by the RX fifos
- this can be achieved by plugging an Cross connector to the devices' S0 port
- this way a full D- and all B-Channel fifo test with adjustable packet sizes can be performed
- testlayer1 offers HDLC and TRANSPARENT data loop tests
- cmd line params
--card=<n> use card number n (default 0)
--d enable D channel stream with <n> packet sz
--b1, --b1=<n> enable B channel stream with <n> packet sz
--b2, --b2=<n> enable B channel stream with <n> packet sz
--te use TA in TE mode (default is NT)
--playload=<x> hdlc package payload types:
0: always 0x00
1: incremental playload (default)
0xFF: always 0xFF
--btrans use bchannels in transparant mode
--stop=<n> stop testlayer1 after <n> seconds
--sleep=<n> tweak usleep() duration in mail data loop
-v, --verbose=<n> set debug verbose level
--help Usage ; printout this information
- console output with optimal HDLC data throughput (meaning test layer1 passed):
./testlayer1 --d --b1 --b2 --payload=0 testlayer1 - card(0) debug(0) playload(0) btrans(0) chan B1 stream enabled with packet sz 1800 bytes chan B2 stream enabled with packet sz 1800 bytes chan D stream enabled with packet sz 64 bytes --> D - PH_ACTIVATE_REQ <-- D - PH_ACTIVATE_IND --> B1 - PH_ACTIVATE_REQ <-- B1 - PH_ACTIVATE_IND --> B2 - PH_ACTIVATE_REQ <-- B2 - PH_ACTIVATE_IND waiting for data (use CTRL-C to cancel) stop(0) sleep(200)... B1 rate/s: 7271, rate-avg: 6914.581, rx total: 7271 kb since 1 secs, pkt(rx/tx): 4/6, rx-err:0,0 B2 rate/s: 7352, rate-avg: 6991.677, rx total: 7352 kb since 1 secs, pkt(rx/tx): 4/6, rx-err:0,0 D rate/s: 312, rate-avg: 296.712, rx total: 312 kb since 1 secs, pkt(rx/tx): 6/3, rx-err:0,0 -- snip snip -- B1 rate/s: 7216, rate-avg: 7948.753, rx total: 167827 kb since 21 secs, pkt(rx/tx): 93/95, rx-err:0,0 B2 rate/s: 7216, rate-avg: 7952.593, rx total: 167908 kb since 21 secs, pkt(rx/tx): 93/95, rx-err:0,0 D rate/s: 1972, rate-avg: 1908.532, rx total: 40296 kb since 21 secs, pkt(rx/tx): 594/595, rx-err:0,0 B1 rate/s: 7216, rate-avg: 7914.239, rx total: 175043 kb since 22 secs, pkt(rx/tx): 97/100, rx-err:0,0 B2 rate/s: 7216, rate-avg: 7917.905, rx total: 175124 kb since 22 secs, pkt(rx/tx): 97/100, rx-err:0,0 D rate/s: 2040, rate-avg: 1914.144, rx total: 42336 kb since 22 secs, pkt(rx/tx): 624/624, rx-err:0,0 -- ctrl-c -- exiting... closing socket 'B1' closing socket 'B2' closing socket 'D '
- rate/s: data rate of last second
- rate-avg: rate average per second since start
- rx total: total kbytes received
- pkt(rx/tx): number of packets (PH_DATA_REQ skbs) received and transmitted since start
- rx-err: number of erroneously received frames
