.\" .\" Copyright (c) 2003 .\" Fraunhofer Institute for Open Communication Systems (FhG Fokus). .\" All rights reserved. .\" .\" Author: Hartmut Brandt .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD: head/share/man/man4/natmip.4 131797 2004-07-08 10:31:12Z ru $ .\" .Dd August 11, 2003 .Dt NATMIP 4 .Os .Sh NAME .Nm natmip .Nd IP over ATM PVCs .Sh SYNOPSIS .Cd "device atm" .Cd "options NATM" .Sh DESCRIPTION The NATM protocol stack includes support for IP over ATM. Without any additional signalling stacks or other modules it is possible to build a CLIP (classical IP over ATM) network based on PVCs. .Pp An ATM network card .Li ( en0 in this example) is configured for IP by something like: .Pp .Dl "ifconfig en0 128.252.200.1 netmask 0xffffff00 up" .Pp IP routing is done with special interface routes (routes with directly reachable destinations) with a link layer gateway address. The link layer address specifies the ATM interface through which the destination can be reached, the virtual channel that connects to the destination and the ATM characteristics of this channel. The address part of the link layer address (see .Xr link_addr 3 ) consists of a fixed part (the first 5 bytes) and a part that depends on the kind of the PVC (UBR, CBR, VBR, ABR). Multi-byte values are big-endian encoded: the bytes with the lower numbers contain the higher order bits. .Bl -tag -width "bytes 12...12" -offset indent .It byte 0 Is a flag byte. Currently only flag 0x20 is used. When set, all IP frames are LLC/SNAP encapsulated before putting them into an AAL5 frame. Setting this flag is recommended and allows interoperability with other CLIP implementations. Note that BPF works only with LLC/SNAP encapsulation. .It byte 1 This is the VPI of the channel. .It bytes 2...3 VCI of the channel. Must not be zero. .It byte 4 Traffic type. One of 0 (UBR), 1 (CBR), 2 (ABR), 3 (VBR). .El .Pp The variable part for UBR connections may be either empty or three bytes: .Bl -tag -width "bytes 12...12" -offset indent .It bytes 5...7 Specifies the peak cell rate for UBR. .El .Pp The variable part for CBR connections must be three bytes: .Bl -tag -width "bytes 12...12" -offset indent .It bytes 5...7 Specifies the peak cell rate for CBR. .El .Pp The variable part for VBR connections must be 9 bytes long and specifies three values: .Bl -tag -width "bytes 12...12" -offset indent .It bytes 5...7 Specifies the peak cell rate for VBR. .It bytes 8...10 This is the sustainable cell rate. .It bytes 11...13 The maximum burst size. .El .Pp The variable part for ABR connections must be 19 bytes long and specifies the following values: .Bl -tag -width "bytes 12...12" -offset indent .It bytes 5...7 Specifies the peak cell rate for ABR. .It bytes 8...10 The minimum cell rate. .It bytes 11...13 The initial cell rate. .It bytes 14...16 The transient buffer exposure. .It byte 17 The NRM value. .It byte 18 The TRM value. .It bytes 19...20 The ADTF value. .It byte 21 The rate increase factor (RIF). .It byte 22 The rate decrease factor (RDF). .It byte 23 The cutoff decrease factor (CDF). .El .Pp To add a PVC the .Xr route 8 utility can be used: .Bd -ragged -offset indent .Nm route Cm add .Fl iface Aq Ar "remote\ IP\ address" .Fl link Ao Ar iface Ac : Ns Aq Ar lladdr .Ed .Pp The .Ar iface is the ATM interface through which .Ar "remote\ IP\ address" can be reached and .Ar lladdr is the link layer address as a string of dot-separated, hexadecimal bytes. .Pp NATM also supports the old, original format. This consists of 4 byte link layer addresses (and the channels are implicit UBR): .Bl -tag -width "bytes 12...12" -offset indent .It byte 0 Flags: .Bl -tag -width "0x02" -offset indent -compact .It 0x01 use AAL5. .It 0x02 if using AAL5, use an LLC/SNAP header. .El .Pp Thus, parameter 3 means AAL5 and LLC/SNAP encapsulation (this is the required setting for interworking with other CLIP clients). Note that BPF works only with LLC/SNAP encapsulation. .It byte 1 VPI for the channel .It bytes 2...3 VCI for the channel .El .Sh EXAMPLES Suppose you have 3 hosts 128.252.200.1, 128.252.200.2 and 128.252.200.3 connected by ATM through PVCs: .Pp .Bl -item -offset indent -compact .It between 128.252.200.1 and 128.252.200.2: 0xc9 UBR .It between 128.252.200.1 and 128.252.200.3: 0xca VBR .It between 128.252.200.2 and 128.252.200.3: 0xcb CBR .El .Pp The parameters for the VBR channel are: PCR 50000, SCR 10000, MBS 10. The peak cell rate for the CBR channel is 100000. .Pp To enable the links use the following commands: .Pp on host 128.252.200.1: .Bd -literal -offset indent -compact ifconfig en0 128.252.200.1 netmask 0xffffff00 up route add -iface 128.252.200.2 -link en0:3.0.0.c9.0 route add -iface 128.252.200.3 -link en0:3.0.0.ca.3.0.c3.50.0.27.10.0.0.a .Ed .Pp on host 128.252.200.2: .Bd -literal -offset indent -compact ifconfig en0 128.252.200.2 netmask 0xffffff00 up route add -iface 128.252.200.1 -link en0:3.0.0.c9.0 route add -iface 128.252.200.3 -link en0:3.0.0.cb.1.1.86.a0 .Ed .Pp on host 128.252.200.3: .Bd -literal -offset indent -compact ifconfig en0 128.252.200.3 netmask 0xffffff00 up route add -iface 128.252.200.1 -link en0:3.0.0.ca.3.0.c3.50.0.27.10.0.0.a route add -iface 128.252.200.2 -link en0:3.0.0.cb.1.1.86.a0 .Ed .Pp This can also be done in .Xr rc.conf 5 : .Pp on host 128.252.200.1: .Bd -literal -offset indent -compact network_interfaces="lo0 en0" ifconfig_en0="inet 128.252.200.1 netmask 255.255.255.0" static_routes="host2 host3" route_host2="-iface 128.252.200.2 -link en0:3.0.0.c9.0" route_host3="-iface 128.252.200.3 -link en0:3.0.0.ca.3.0.c3.50.0.27.10.0.0.a" .Ed .Pp on host 128.252.200.2: .Bd -literal -offset indent -compact network_interfaces="lo0 en0" ifconfig_en0="inet 128.252.200.2 netmask 255.255.255.0" static_routes="host1 host3" route_host1="-iface 128.252.200.1 -link en0:3.0.0.c9.0" route_host3="-iface 128.252.200.3 -link en0:3.0.0.cb.1.1.86.a0" .Ed .Pp on host 128.252.200.3: .Bd -literal -offset indent -compact network_interfaces="lo0 en0" ifconfig_en0="inet 128.252.200.3 netmask 255.255.255.0" static_routes="host1 host2" route_host1="-iface 128.252.200.1 -link en0:3.0.0.ca.3.0.c3.50.0.27.10.0.0.a" route_host2="-iface 128.252.200.2 -link en0:3.0.0.cb.1.1.86.a0" .Ed .Sh SEE ALSO .Xr en 4 , .Xr fatm 4 , .Xr hatm 4 , .Xr natm 4 , .Xr patm 4 .Sh AUTHORS .An Chuck Cranor of Washington University implemented the NATM protocol layer along with the EN ATM driver in 1996 for .Nx .