2 .\" Copyright (c) 2002-2006 David Boggs. (boggs@boggs.palo-alto.ca.us)
3 .\" All rights reserved. I wrote this man page from scratch.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" GNU General Public License:
30 .\" This program is free software; you can redistribute it and/or modify it
31 .\" under the terms of the GNU General Public License as published by the Free
32 .\" Software Foundation; either version 2 of the License, or (at your option)
33 .\" any later version.
35 .\" This program is distributed in the hope that it will be useful, but WITHOUT
36 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
37 .\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
40 .\" You should have received a copy of the GNU General Public License along with
41 .\" this program; if not, write to the Free Software Foundation, Inc., 59
42 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA.
44 .\" * * * * * * * * * * * * *
45 .\" * ATTENTION MDOC POLICE *
46 .\" * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
47 .\" * This device driver works on FIVE OSs with NO changes. *
48 .\" * IFDEFS are used to ignore C and Groff code that is *
49 .\" * not relevant to a particular Operating System. *
50 .\" * Author will merge local changes and re-sync copies. *
51 .\" * Please feel free to correct my groff usage, but... *
52 .\" * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
53 .\" * PLEASE DO NOT "UN-IFDEF" THIS FILE! *
54 .\" * * * * * * * * * * * * * * * * * * * * *
56 .\" $NetBSD: lmc.4,v 1.16 2009/05/27 19:23:59 snj Exp $
67 wide-area network interface cards
69 This driver is built into the GENERIC kernel so it should "just work".
71 The driver can be built into a kernel by adding the following to
72 .Pa /sys/arch/ARCH/conf/YOURKERNEL :
73 .Bd -unfilled -offset indent -compact
76 .Cd options ALTQ_HFSC # for altq example
77 .Cd pseudo-device sppp
78 .Cd pseudo-device bpfilter
81 The driver can send and receive raw IP packets even if
82 SPPP is not configured into the kernel.
84 This is an open-source
86 device driver for PCI-bus wide-area network interface cards.
87 It sends and receives packets
88 in HDLC frames over synchronous circuits.
95 wide-area network router.
107 It has been tested on
109 (SMP 32-bit little-end),
113 (64-bit little-end), and
115 (64-bit big-end) architectures.
119 driver works with the following cards:
120 .Bl -tag -width "LMC5200" -offset indent
122 HSSI\[em]High Speed Serial Interface,
123 .Bd -unfilled -compact
124 EIA612/613, 50-pin connector,
125 0 to 52 Mb/s, DTE only.
128 T3, 2xBNC conns, 75 ohm
129 .Bd -unfilled -compact
130 C-Parity or M13 Framing,
134 SSI\[em]Synchronous Serial Interface,
135 .Bd -unfilled -compact
136 V.35, X.21, EIA449, EIA530(A), EIA232,
137 0 to 10 Mb/s, DTE or DCE.
140 T1/E1, RJ45 conn, 100 or 120 ohms,
141 .Bd -unfilled -compact
142 T1-B8ZS-ESF, T1-AMI-SF, E1-HDB3-many,
143 DSX-1 up to 1500 ft; CSU up to 6 Kft.
148 cards contain a high-performance
157 interfaces (HSSI and SSI).
158 .Bl -tag -width "Modem" -offset indent
160 The PCI interface is a
161 .Tn "DEC 21140A Tulip"
163 This chip has an efficient PCI implementation with scatter/gather DMA,
164 and can run at 100 Mb/s full duplex (twice as fast as needed here).
166 The HDLC functions (ISO-3309: flags, bit-stuffing, CRC) are implemented
167 in a Field Programmable Gate Array (FPGA) which talks to the Ethernet
168 chip through a Media Independent Interface (MII).
169 The hardware in the FPGA translates between Ethernet packets and
170 HDLC frames on-the-fly; think of it as a WAN PHY chip for Ethernet.
172 The modem chips are the main differences between cards.
173 HSSI cards use ECL10K chips to implement the EIA-612/613 interface.
175 .Tn TranSwitch TXC-03401
178 .Tn Linear Technology LTC1343
179 modem interface chips.
181 .Tn BrookTree/Conexant/Mindspeed Bt8370
182 framer and line interface chip.
185 Line protocol stacks exist above device drivers
186 and below internet protocol stacks.
187 They typically encapsulate packets in HDLC frames and deal with
188 higher-level issues like protocol multiplexing and security.
189 The driver is compatible with several line protocol stacks:
190 .Bl -tag -width "GenericHDLC" -offset indent
193 implements Synchronous-PPP and Cisco-HDLC in the kernel.
195 The null line protocol, built into the driver, sends and receives
196 raw IPv4 and IPv6 packets in HDLC frames with no extra bytes of
197 overhead and no state at the end points.
202 .Ss ifconfig and lmcconfig
206 manipulates interface parameters beyond the scope of
209 has many flags and options,
210 but in normal operation only a few are needed.
211 .Bd -unfilled -offset indent
214 displays interface configuration and status.
215 .Bd -unfilled -offset indent
216 .Ic lmcconfig lmc0 -X 1
218 selects the built-in RawIP line protocol stack.
219 .Bd -unfilled -offset indent
220 .Ic lmcconfig lmc0 -X 2 -x 2
222 selects the SPPP stack and the PPP protocol.
224 Some configuration options are available through
228 .Bd -unfilled -offset indent -compact
231 lists the available media options.
233 .Bd -unfilled -offset indent
234 .Ic ifconfig lmc0 mediaopt loopback
236 loops the interface transmitter to the receiver for testing.
237 This loopback uses a path present in every card type.
239 can select card-specific loopbacks, such as outbound payload loopback.
241 .Bd -unfilled -offset indent
242 .Ic ifconfig lmc0 debug
244 enables debugging output from the device driver and from
245 the line protocol stack above it.
246 .Bd -unfilled -offset indent
247 .Ic lmcconfig lmc0 -D
249 enables debugging output from the device driver.
251 Debugging messages that appear on the console are also
253 .Pa /var/log/messages .
256 things go very wrong, a torrent of debugging messages
257 can swamp the console and bring a machine to its knees.
260 Configure a PPP link using SPPP with
261 .Bd -unfilled -offset indent -compact
262 .Ic lmcconfig lmc0 -X 2 -x 2
263 .Ic ifconfig lmc0 10.0.0.1 10.0.0.2
266 Configure a Cisco-HDLC link using SPPP with
267 .Bd -unfilled -offset indent -compact
268 .Ic lmcconfig lmc0 -X 2 -x 3
269 .Ic ifconfig lmc0 10.0.0.1 10.0.0.2
272 Configure a RAWIP link with
273 .Bd -unfilled -offset indent -compact
274 .Ic lmcconfig lmc0 -X 1
275 .Ic ifconfig lmc0 10.0.0.1 10.0.0.2
278 .Ss Testing with Loopbacks
279 Testing with loopbacks requires only one card and
280 can test everything on that card.
281 Packets can be looped back at many points: in the PCI chip,
282 in the modem chips, through a loopback plug, in the
283 local external equipment, or at the far end of a circuit.
285 All cards can be looped through the PCI chip.
286 Cards with internal modems can be looped through
287 the modem framer and the modem line interface.
288 Cards for external modems can be looped through
289 the driver/receiver chips.
294 Configure the card with
295 .Bd -unfilled -offset indent -compact
296 .Ic ifconfig lmc0 10.0.0.1 10.0.0.1
299 .Bl -tag -width "T1/E1" -offset indent
301 Loopback plugs can be ordered from SBE (and others).
302 Transmit clock is normally supplied by the external modem.
303 When an HSSI card is operated with a loopback plug, the PCI bus
304 clock must be used as the transmit clock, typically 33 MHz.
305 When testing an HSSI card with a loopback plug,
307 .Bd -unfilled -offset indent -compact
308 .Ic lmcconfig lmc0 -a 2
311 selects the PCI bus clock as the transmit clock.
313 Connect the two BNC jacks with a short coax cable.
315 Loopback plugs can be ordered from SBE (only).
316 Transmit clock is normally supplied by the external modem.
317 When an SSI card is operated with a loopback plug,
318 the on-board clock synthesizer must be used.
319 When testing an SSI card with a loopback plug,
321 .Bd -unfilled -offset indent -compact
322 .Ic lmcconfig lmc0 -E -f 10000000
326 puts the card in DCE mode to source a transmit clock.
328 sets the internal clock source to 10 Mb/s.
331 A loopback plug is a modular plug with two wires
332 connecting pin 1 to pin 4 and pin 2 to pin 5.
335 One can also test by connecting to a local modem (HSSI and SSI)
336 or NI (T1 and T3) configured to loop back.
337 Cards can generate signals to loopback remote equipment
338 so that complete circuits can be tested; see
341 .Ss Testing with a Modem
342 Testing with a modem requires two cards of different types.
343 The cards can be in the same machine or different machines.
345 Configure the two cards with
346 .Bd -unfilled -offset indent -compact
347 .Ic ifconfig lmc0 10.0.0.1 10.0.0.2
348 .Ic ifconfig lmc1 10.0.0.2 10.0.0.1
351 .Bl -tag -width "T3/HSSI" -offset indent
353 If you have a T3 modem with an HSSI interface
354 (made by Digital Link, Larscom, Kentrox etc.\&)
355 then use an HSSI card and a T3 card.
356 The coax cables between the card and the modem
361 If you have a T1 (or E1) modem with a V.35, X.21 or EIA530 interface,
362 then use an SSI card and a T1 card.
363 Use a T1 null modem cable (see below) between
364 the external modem and the T1 card.
367 .Ss Testing with a Null Modem Cable
369 Testing with a null modem cable requires two cards of the same type.
370 The cards can be in the same machine or different machines.
372 Configure the two cards with
373 .Bd -unfilled -offset indent -compact
374 .Ic ifconfig lmc0 10.0.0.1 10.0.0.2
375 .Ic ifconfig lmc1 10.0.0.2 10.0.0.1
378 .Bl -tag -width "T1/E1" -offset indent
380 Three-meter HSSI null-modem cables can be ordered from SBE.
381 In a pinch, a 50-pin SCSI-II cable up to a few meters will
382 work as a straight HSSI cable (not a null modem cable).
383 Longer cables should be purpose-built HSSI cables because
384 the cable impedance is different.
385 Transmit clock is normally supplied by the external modem.
386 When an HSSI card is connected by a null modem cable, the PCI bus
387 clock can be used as the transmit clock, typically 33 MHz.
388 When testing an HSSI card with a null modem cable,
390 .Bd -unfilled -offset indent -compact
391 .Ic lmcconfig lmc0 -a 2
394 selects the PCI bus clock as the transmit clock.
396 T3 null modem cables are just 75-ohm coax cables with BNC connectors.
397 TX OUT on one card should be connected to RX IN on the other card.
398 In a pinch, 50-ohm thin Ethernet cables
400 work up to a few meters, but they will
402 work for longer runs\[em]75-ohm coax is
405 Three-meter SSI null modem cables can be ordered from SBE.
406 An SSI null modem cable reports a cable type of V.36/EIA449.
407 Transmit clock is normally supplied by the external modem.
408 When an SSI card is connected by a null modem cable,
409 an on-board clock synthesizer is used.
410 When testing an SSI card with a null modem cable,
412 .Bd -unfilled -offset indent -compact
413 .Ic lmcconfig lmc0 -E -f 10000000
417 puts the card in DCE mode to source a transmit clock.
419 sets the internal clock source to 10 Mb/s.
423 A T1 null modem cable has two twisted pairs that connect
424 pins 1 and 2 on one plug to pins 4 and 5 on the other plug.
425 Looking into the cable entry hole of a plug,
426 with the locking tab oriented down,
427 pin 1 is on the left.
428 A twisted pair Ethernet cable makes an excellent straight T1 cable.
429 Alas, Ethernet cross-over cables do not work as T1 null modem cables.
436 HSSI and SSI cards should be operational if all three green LEDs are
437 on (the upper-left one should be blinking) and the red LED is off.
438 .Bl -column "YELLOW" "upper-right" -offset indent -compact
439 .It "RED\0" Ta "upper-right" Ta "No Transmit clock"
440 .It "GREEN" Ta "upper-left" Ta "Device driver is alive if blinking"
441 .It "GREEN" Ta "lower-right" Ta "Modem signals are good"
442 .It "GREEN" Ta "lower-left" Ta "Cable is plugged in (SSI only)"
445 T1/E1 and T3 cards should be operational if the upper-left
446 green LED is blinking and all other LEDs are off.
447 For the T3 card, if other LEDs are on or blinking,
448 try swapping the coax cables!
449 .Bl -column "YELLOW" "upper-right" -offset indent -compact
450 .It "RED\0" Ta upper-right Ta "Received signal is wrong"
451 .It "GREEN" Ta upper-left Ta "Device driver is alive if blinking"
452 .It "BLUE" Ta lower-right Ta "Alarm Information Signal (AIS)"
453 .It "YELLOW" Ta lower-left Ta "Remote Alarm Indication (RAI)"
456 .Bl -column "YELLOW" -offset indent -compact
457 .It "RED\0" Ta "blinks if an outward loopback is active."
458 .It "GREEN" Ta "blinks if the device driver is alive."
459 .It "BLUE" Ta "blinks if sending AIS, on solid if receiving AIS."
460 .It "YELLOW" Ta "blinks if sending RAI, on solid if receiving RAI."
465 .Bd -unfilled -compact
466 Maximum transmit and receive packet length is unlimited.
467 Minimum transmit and receive packet length is one byte.
470 Cleaning up after one packet and setting up for the next
471 packet involves making several DMA references.
472 This can take longer than the duration of a short packet,
473 causing the adapter to fall behind.
474 For typical PCI bus traffic levels and memory system latencies,
475 back-to-back packets longer than about 20 bytes will always
476 work (53 byte cells work), but a burst of several hundred
477 back-to-back packets shorter than 20 bytes will cause packets
479 This usually is not a problem since an IPv4 packet header is
480 at least 20 bytes long.
482 The device driver imposes no constraints on packet size.
483 Most operating systems set the default Maximum Transmission
484 Unit (MTU) to 1500 bytes; the legal range is usually (72..65535).
485 This can be changed with
486 .Bd -unfilled -offset indent -compact
487 .Ic ifconfig lmc0 mtu 2000
489 SPPP enforces an MTU of 1500 bytes for PPP and Cisco-HDLC.
490 RAWIP sets the default MTU to 4032 bytes,
491 but allows it to be changed to anything.
492 .Ss ALTQ: Alternate Output Queue Disciplines
493 The driver has hooks for
495 the Alternate Queueing package.
496 To see ALTQ in action, use your favorite traffic generation
497 program to generate three flows sending down one T3 circuit.
498 Without ALTQ, the speeds of the three connections will vary chaotically.
499 Enable ALTQ and two of the connections will run at about 20 Mb/s and
500 the third will run at about 2 Mb/s.
504 and add the following lines to
506 .Bd -unfilled -offset indent -compact
507 .Ic interface lmc0 bandwidth 44M hfsc
508 .Ic class hfsc lmc0 a root pshare 48
509 .Ic filter lmc0 a 10.0.0.2 12345 10.0.0.1 0 6
510 .Ic filter lmc0 a 10.0.0.1 0 10.0.0.2 12345 6
511 .Ic class hfsc lmc0 b root pshare 48
512 .Ic filter lmc0 b 10.0.0.2 12346 10.0.0.1 0 6
513 .Ic filter lmc0 b 10.0.0.1 0 10.0.0.2 12346 6
514 .Ic class hfsc lmc0 c root pshare 4 default
515 .Ic filter lmc0 c 10.0.0.2 12347 10.0.0.1 0 6
516 .Ic filter lmc0 c 10.0.0.1 0 10.0.0.2 12347 6
519 The example above requires the
521 Hierarchical Fair Service Curve
522 queue discipline to be configured in
523 .Pa conf/YOURKERNEL :
524 .Bd -unfilled -offset indent -compact
526 .Ic options ALTQ_HFSC .
528 .Ss BPF: Berkeley Packet Filter
529 The driver has hooks for
531 the Berkeley Packet Filter, a protocol-independent
532 raw interface to data link layers.
534 To test the BPF kernel interface,
535 bring up a link between two machines, then run
539 .Bd -unfilled -offset indent -compact
542 and in a different window:
543 .Bd -unfilled -offset indent -compact
546 The output from tcpdump should look like this:
547 .Bd -unfilled -offset indent -compact
548 .Ic 03:54:35.979965 10.0.0.2 > 10.0.0.1: icmp: echo request
549 .Ic 03:54:35.981423 10.0.0.1 > 10.0.0.2: icmp: echo reply
551 Line protocol control packets may appear among the
552 ping packets occasionally.
554 The kernel must be configured with
555 .Bd -unfilled -offset indent -compact
558 .Ss SNMP: Simple Network Management Protocol
559 The driver is aware of what is required to be a Network Interface
560 Object managed by an Agent of the Simple Network Management Protocol.
561 The driver exports SNMP-formatted configuration and status
562 information sufficient for an SNMP Agent to create MIBs for:
563 .Bl -tag -width "RFC-2233" -offset indent -compact
569 .%T DS1/E1 interfaces
571 .%T RS232-like interfaces
574 An SNMP Agent is a user program, not a kernel function.
575 Agents can retrieve configuration and status information
579 User programs should poll
581 which increments once per second after the SNMP state has been updated.
585 Phone companies usually insist that customers put a
586 .Em Frame Alignment Signal
587 (FAS) in time slot 0.
588 A Cyclic Redundancy Checksum (CRC) can also ride in time slot 0.
589 .Em Channel Associated Signalling
590 (CAS) uses Time Slot 16.
593 is on/off hook, ringing, busy, etc.
594 Signalling is not needed here and consumes 64 Kb/s.
595 Only use E1-CAS formats if the other end insists on it!
596 Use E1-FAS+CRC framing format on a public circuit.
597 Depending on the equipment installed in a private circuit,
598 it may be possible to use all 32 time slots for data (E1-NONE).
602 M13 is a technique for multiplexing 28 T1s into a T3.
603 Muxes use the C-bits for speed-matching the tributaries.
604 Muxing is not needed here and usurps the FEBE and FEAC bits.
605 Only use T3-M13 format if the other end insists on it!
606 Use T3-CParity framing format if possible.
607 Loop Timing, Fractional T3, and HDLC packets in
608 the Facility Data Link are
612 .Ss T1 & T3 Frame Overhead Functions
614 .Bd -unfilled -compact
615 Performance Report Messages (PRMs) are enabled in T1-ESF.
616 Bit Oriented Protocol (BOP) messages are enabled in T1-ESF.
617 In-band loopback control (framed or not) is enabled in T1-SF.
618 Far End Alarm and Control (FEAC) msgs are enabled in T3-CPar.
619 Far End Block Error (FEBE) reports are enabled in T3-CPar.
620 Remote Alarm Indication (RAI) is enabled in T3-Any.
621 Loopbacks initiated remotely time out after 300 seconds.
624 .Ss T1/E1 'Fractional' 64 kb/s Time Slots
626 T1 uses time slots 24..1; E1 uses time slots 31..0.
627 E1 uses TS0 for FAS overhead and TS16 for CAS overhead.
630 overhead, so all 32 TSs are available for data.
631 Enable/disable time slots by setting 32 1s/0s in a config param.
632 Enabling an E1 overhead time slot,
633 or enabling TS0 or TS25-TS31 for T1,
634 is ignored by the driver, which knows better.
635 The default TS param, 0xFFFFFFFF, enables the maximum number
636 of time slots for whatever frame format is selected.
637 56 Kb/s time slots are
659 .Pa http://www.sbei.net/
665 had the idea to use a Fast Ethernet chip as a PCI interface
666 and add an Ethernet-to-HDLC gate array to make a WAN card.
668 designed the Ethernet-to-HDLC gate array and PC cards.
669 We did this at our company,
670 .Tn "LAN Media Corporation (LMC)" .
671 .Tn "SBE Corporation"
674 and continues to make the cards.
676 Since the cards use Tulip Ethernet chips, we started with
682 stripped out the Ethernet stuff and added HSSI stuff.
690 .An Andrew Stanley-Jones
691 added support for three more cards.
693 rewrote everything and now feels responsible for it.
697 .An David Boggs Aq boggs@boggs.palo-alto.ca.us