LMC(4)

< 19) .nr ssfix 1 : : : : ) .nr allos 1

NAME
lmc - device driver for LMC (and some SBE) wide-area network interface cards

SYNOPSIS
The driver can be loaded into a running kernel with modload(8).
    modload if_lmc.o

The kernel must be built with support for Loadable Kernel Modules, lkm(8).

securelevel must be 0 to load modules; see init(8).

The driver can be built into a kernel by adding the following to /sys/arch/ARCH/conf/YOURKERNEL:
    lmc* at pci?
    pseudo-device sppp
    pseudo-device bpfilter

The driver can send and receive raw IP packets even if SPPP is not configured into the kernel.

DESCRIPTION
This is an open-source Unix device driver for PCI-bus wide-area network interface cards. It sends and receives packets in HDLC frames over synchronous circuits. A computer plus UNIX plus some LMC cards makes an open wide-area network router.

The lmc driver works with FreeBSD, NetBSD, OpenBSD, BSD/OS, and Linux OSs. It has been tested on i386 (SMP 32-bit little-end), PowerPC (32-bit big-end), Alpha (64-bit little-end), and Sparc (64-bit big-end) architectures.

The lmc driver works with the following cards:

LMC5200
    HSSI—High Speed Serial Interface,
        EIA612/613, 50-pin connector,
        0 to 52 Mb/s, DTE only.

LMC5245
    T3, 2xBNC conns, 75 ohm
        C-Parity or M13 Framing,
        DSX-3 up to 910 ft.

LMC1000
    SSI—Synchronous Serial Interface,
        V.35, X.21, EIA449, EIA530(A), EIA232,
        0 to 10 Mb/s, DTE or DCE.

LMC1200
    T1/E1, RJ45 conn, 100 or 120 ohms,
        T1-B8ZS-ESF, T1-AMI-SF, E1-HDB3-many,
        DSX-1 up to 1500 ft; CSU up to 6 Kft.

LMC cards contain a high-performance PCI interface, an HDLC function and either integrated modems (T1, T3) or modem interfaces (HSSI and SSI).

PCI The PCI interface is a DEC 21140A Tulip Fast Ethernet chip. This chip has an efficient PCI implementation with scatter/gather DMA, and can run at 100 Mb/s full duplex (twice as fast as needed here).

HDLC
    The HDLC functions (ISO-3309: flags, bit-stuffing, CRC) are implemented in a Field Programmable Gate Array (FPGA) which talks to the Ethernet chip through a Media Independent Interface (MII). The hardware in the FPGA translates between Ethernet packets and HDLC frames on-the-fly; think of it as a WAN PHY chip for Ethernet.

Modem
    The modem chips are the main differences between cards. HSSI cards use ECL10K chips to implement the EIA-612/613 interface. T3 cards use a TranSwitch TXC-03401 framer chip. SSI cards use Linear Technology LTC1343 modem interface chips. T1 cards use a BrookTree/Conexant/Mindspeed Bt8370 framer and line interface chip.

Line protocol stacks exist above device drivers and below internet protocol stacks. They typically encapsulate packets in HDLC frames and deal with higher-level issues like protocol multiplexing and security. The driver is compatible with several line protocol stacks:
sppp(4) implements Synchronous-PPP and Cisco-HDLC in the kernel.

RawIP
    The null line protocol, built into the driver, sends and receives raw IPv4 and IPv6 packets in HDLC frames with no extra bytes of overhead and no state at the end points.

EXAMPLES

  ifconfig and lmcconfig
The program lmcconfig(8) manipulates interface parameters beyond the scope of ifconfig(8). lmcconfig has many flags and options, but in normal operation only a few are needed.

    lmcconfig lmc0

displays interface configuration and status.

    lmcconfig lmc0 -X 1

selects the built-in RawIP line protocol stack. lmcconfig lmc0 -X 2 -x 2

selects the SPPP stack and the PPP protocol. Some configuration options are available through ifconfig as well as lmcconfig.
    ifconfig -m lmc0

lists the available media options.

    ifconfig lmc0 mediaopt loopback

loops the interface transmitter to the receiver for testing. This loopback uses a path present in every card type. lmcconfig can select card-specific loopbacks, such as outbound payload loopback.

    ifconfig lmc0 debug

enables debugging output from the device driver and from the line protocol stack above it.

    lmcconfig lmc0 -D

enables debugging output from the device driver.

Debugging messages that appear on the console are also written to file /var/log/messages. Caution: when things go very wrong, a torrent of debugging messages can swamp the console and bring a machine to its knees.

  Operation
    lmcconfig lmc0 -X 2 -x 2
    ifconfig lmc0 10.0.0.1 10.0.0.2

Configure a Cisco-HDLC link using SPPP with
    lmcconfig lmc0 -X 2 -x 3
    ifconfig lmc0 10.0.0.1 10.0.0.2

Configure a RAWIP link with
    lmcconfig lmc0 -X 1
    ifconfig lmc0 10.0.0.1 10.0.0.2

TESTING

  Testing with Loopbacks
Testing with loopbacks requires only one card and can test everything on that card. Packets can be looped back at many points: in the PCI chip, in the modem chips, through a loopback plug, in the local external equipment, or at the far end of a circuit.

All cards can be looped through the PCI chip. Cards with internal modems can be looped through the modem framer and the modem line interface. Cards for external modems can be looped through the driver/receiver chips. See lmcconfig(8) for details.

Configure the card with
    ifconfig lmc0 10.0.0.1 10.0.0.1

HSSI
    Loopback plugs can be ordered from SBE (and others). Transmit clock is normally supplied by the external modem. When an HSSI card is operated with a loopback plug, the PCI bus clock must be used as the transmit clock, typically 33 MHz. When testing an HSSI card with a loopback plug, configure it with
        lmcconfig lmc0 -a 2

    “-a 2” selects the PCI bus clock as the transmit clock.

T3  Connect the two BNC jacks with a short coax cable.

SSI Loopback plugs can be ordered from SBE (only). Transmit clock is normally supplied by the external modem. When an SSI card is operated with a loopback plug, the on-board clock synthesizer must be used. When testing an SSI card with a loopback plug, configure it with
        lmcconfig lmc0 -E -f 10000000

    “-E” puts the card in DCE mode to source a transmit clock. “-f 10000000” sets the internal clock source to 10 Mb/s.

T1/E1
    A loopback plug is a modular plug with two wires connecting pin 1 to pin 4 and pin 2 to pin 5.

One can also test by connecting to a local modem (HSSI and SSI) or NI (T1 and T3) configured to loop back. Cards can generate signals to loopback remote equipment so that complete circuits can be tested; see lmcconfig(8) for details.

  Testing with a Modem
Testing with a modem requires two cards of different types. The cards can be in the same machine or different machines.

Configure the two cards with
    ifconfig lmc0 10.0.0.1 10.0.0.2
    ifconfig lmc1 10.0.0.2 10.0.0.1

T3/HSSI
    If you have a T3 modem with an HSSI interface (made by Digital Link, Larscom, Kentrox etc.) then use an HSSI card and a T3 card. The coax cables between the card and the modem must “cross over” (see below).

T1/V.35
    If you have a T1 (or E1) modem with a V.35, X.21 or EIA530 interface, then use an SSI card and a T1 card. Use a T1 null modem cable (see below) between the external modem and the T1 card.

  Testing with a Null Modem Cable
Testing with a null modem cable requires two cards of the same type. The cards can be in the same machine or different machines.

Configure the two cards with
    ifconfig lmc0 10.0.0.1 10.0.0.2
    ifconfig lmc1 10.0.0.2 10.0.0.1

HSSI
    Three-meter HSSI null-modem cables can be ordered from SBE. In a pinch, a 50-pin SCSI-II cable up to a few meters will work as a straight HSSI cable (not a null modem cable). Longer cables should be purpose-built HSSI cables because the cable impedance is different. Transmit clock is normally supplied by the external modem. When an HSSI card is connected by a null modem cable, the PCI bus clock can be used as the transmit clock, typically 33 MHz. When testing an HSSI card with a null modem cable, configure it with
        lmcconfig lmc0 -a 2

    “-a 2” selects the PCI bus clock as the transmit clock.

T3  T3 null modem cables are just 75-ohm coax cables with BNC connectors. TX OUT on one card should be connected to RX IN on the other card. In a pinch, 50-ohm thin Ethernet cables usually work up to a few meters, but they will not work for longer runs—75-ohm coax is required.

SSI Three-meter SSI null modem cables can be ordered from SBE. An SSI null modem cable reports a cable type of V.36/EIA449. Transmit clock is normally supplied by the external modem. When an SSI card is connected by a null modem cable, an on-board clock synthesizer is used. When testing an SSI card with a null modem cable, configure it with
        lmcconfig lmc0 -E -f 10000000

    “-E” puts the card in DCE mode to source a transmit clock. “-f 10000000” sets the internal clock source to 10 Mb/s.

T1/E1
    A T1 null modem cable has two twisted pairs that connect pins 1 and 2 on one plug to pins 4 and 5 on the other plug. Looking into the cable entry hole of a plug, with the locking tab oriented down, pin 1 is on the left. A twisted pair Ethernet cable makes an excellent straight T1 cable. Alas, Ethernet cross-over cables do not work as T1 null modem cables.

OPERATING NOTES

  LEDs
HSSI and SSI cards should be operational if all three green LEDs are on (the upper-left one should be blinking) and the red LED is off.
RED | upper-right | No Transmit clock
GREEN | upper-left | Device driver is alive if blinking
GREEN | lower-right | Modem signals are good
GREEN | lower-left | Cable is plugged in (SSI only)

T1/E1 and T3 cards should be operational if the upper-left green LED is blinking and all other LEDs are off. For the T3 card, if other LEDs are on or blinking, try swapping the coax cables!
RED | upper-right | Received signal is wrong
GREEN | upper-left | Device driver is alive if blinking
BLUE | lower-right | Alarm Information Signal (AIS)
YELLOW | lower-left | Remote Alarm Indication (RAI)

RED | blinks if an outward loopback is active.
GREEN | blinks if the device driver is alive.
BLUE | blinks if sending AIS, on solid if receiving AIS.
YELLOW | blinks if sending RAI, on solid if receiving RAI.

  Packet Lengths
    Maximum transmit and receive packet length is unlimited.
    Minimum transmit and receive packet length is one byte.

Cleaning up after one packet and setting up for the next packet involves making several DMA references. This can take longer than the duration of a short packet, causing the adapter to fall behind. For typical PCI bus traffic levels and memory system latencies, back-to-back packets longer than about 20 bytes will always work (53 byte cells work), but a burst of several hundred back-to-back packets shorter than 20 bytes will cause packets to be dropped. This usually is not a problem since an IPv4 packet header is at least 20 bytes long.

The device driver imposes no constraints on packet size. Most operating systems set the default Maximum Transmission Unit (MTU) to 1500 bytes; the legal range is usually (72..65535). This can be changed with
    ifconfig lmc0 mtu 2000