| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 |  | 
|  | 2 | X.25 support within isdn4linux | 
|  | 3 | ============================== | 
|  | 4 |  | 
|  | 5 | This is alpha/beta test code. Use it completely at your own risk. | 
|  | 6 | As new versions appear, the stuff described here might suddenly change | 
|  | 7 | or become invalid without notice. | 
|  | 8 |  | 
|  | 9 | Keep in mind: | 
|  | 10 |  | 
|  | 11 | You are using several new parts of the 2.2.x kernel series which | 
|  | 12 | have not been tested in a large scale. Therefore, you might encounter | 
|  | 13 | more bugs as usual. | 
|  | 14 |  | 
|  | 15 | - If you connect to an X.25 neighbour not operated by yourself, ASK the | 
|  | 16 | other side first. Be prepared that bugs in the protocol implementation | 
|  | 17 | might result in problems. | 
|  | 18 |  | 
|  | 19 | - This implementation has never wiped out my whole hard disk yet. But as | 
|  | 20 | this is experimental code, don't blame me if that happened to you. | 
|  | 21 | Backing up important data will never harm. | 
|  | 22 |  | 
|  | 23 | - Monitor your isdn connections while using this software. This should | 
|  | 24 | prevent you from undesired phone bills in case of driver problems. | 
|  | 25 |  | 
|  | 26 |  | 
|  | 27 |  | 
|  | 28 |  | 
|  | 29 | How to configure the kernel | 
|  | 30 | =========================== | 
|  | 31 |  | 
|  | 32 | The ITU-T (former CCITT) X.25 network protocol layer has been implemented | 
|  | 33 | in the Linux source tree since version 2.1.16. The isdn subsystem might be | 
|  | 34 | useful to run X.25 on top of ISDN. If you want to try it, select | 
|  | 35 |  | 
|  | 36 | "CCITT X.25 Packet Layer" | 
|  | 37 |  | 
|  | 38 | from the networking options as well as | 
|  | 39 |  | 
|  | 40 | "ISDN Support" and "X.25 PLP on Top of ISDN" | 
|  | 41 |  | 
|  | 42 | from the ISDN subsystem options when you configure your kernel for | 
|  | 43 | compilation. You currently also need to enable | 
|  | 44 | "Prompt for development and/or incomplete code/drivers" from the | 
|  | 45 | "Code maturity level options" menu. For the x25trace utility to work | 
|  | 46 | you also need to enable "Packet socket". | 
|  | 47 |  | 
|  | 48 | For local testing it is also recommended to enable the isdnloop driver | 
|  | 49 | from the isdn subsystem's configuration menu. | 
|  | 50 |  | 
|  | 51 | For testing, it is recommended that all isdn drivers and the X.25 PLP | 
|  | 52 | protocol are compiled as loadable modules. Like this, you can recover | 
|  | 53 | from certain errors by simply unloading and reloading the modules. | 
|  | 54 |  | 
|  | 55 |  | 
|  | 56 |  | 
|  | 57 | What's it for? How to use it? | 
|  | 58 | ============================= | 
|  | 59 |  | 
|  | 60 | X.25 on top of isdn might be useful with two different scenarios: | 
|  | 61 |  | 
|  | 62 | - You might want to access a public X.25 data network from your Linux box. | 
|  | 63 | You can use i4l if you were physically connected to the X.25 switch | 
|  | 64 | by an ISDN B-channel (leased line as well as dial up connection should | 
|  | 65 | work). | 
|  | 66 |  | 
|  | 67 | This corresponds to ITU-T recommendation X.31 Case A (circuit-mode | 
|  | 68 | access to PSPDN [packet switched public data network]). | 
|  | 69 |  | 
|  | 70 | NOTE: X.31 also covers a Case B (access to PSPDN via virtual | 
|  | 71 | circuit / packet mode service). The latter mode (which in theory | 
|  | 72 | also allows using the D-channel) is not supported by isdn4linux. | 
|  | 73 | It should however be possible to establish such packet mode connections | 
|  | 74 | with certain active isdn cards provided that the firmware supports X.31 | 
|  | 75 | and the driver exports this functionality to the user. Currently, | 
|  | 76 | the AVM B1 driver is the only driver which does so. (It should be | 
|  | 77 | possible to access D-channel X.31 with active AVM cards using the | 
|  | 78 | CAPI interface of the AVM-B1 driver). | 
|  | 79 |  | 
|  | 80 | - Or you might want to operate certain ISDN teleservices on your linux | 
|  | 81 | box. A lot of those teleservices run on top of the ISO-8208 | 
|  | 82 | (DTE-DTE mode) network layer protocol. ISO-8208 is essentially the | 
|  | 83 | same as ITU-T X.25. | 
|  | 84 |  | 
|  | 85 | Popular candidates of such teleservices are EUROfile transfer or any | 
|  | 86 | teleservice applying ITU-T recommendation T.90. | 
|  | 87 |  | 
|  | 88 | To use the X.25 protocol on top of isdn, just create an isdn network | 
|  | 89 | interface as usual, configure your own and/or peer's ISDN numbers, | 
|  | 90 | and choose x25iface encapsulation by | 
|  | 91 |  | 
|  | 92 | isdnctrl encap <iface-name> x25iface. | 
|  | 93 |  | 
|  | 94 | Once encap is set like this, the device can be used by the X.25 packet layer. | 
|  | 95 |  | 
|  | 96 | All the stuff needed for X.25 is implemented inside the isdn link | 
|  | 97 | level (mainly isdn_net.c and some new source files). Thus, it should | 
|  | 98 | work with every existing HL driver. I was able to successfully open X.25 | 
|  | 99 | connections on top of the isdnloop driver and the hisax driver. | 
|  | 100 | "x25iface"-encapsulation bypasses demand dialing. Dialing will be | 
|  | 101 | initiated when the upper (X.25 packet) layer requests the lapb datalink to | 
|  | 102 | be established. But hangup timeout is still active. Whenever a hangup | 
|  | 103 | occurs, all existing X.25 connections on that link will be cleared | 
|  | 104 | It is recommended to use sufficiently large hangup-timeouts for the | 
|  | 105 | isdn interfaces. | 
|  | 106 |  | 
|  | 107 |  | 
|  | 108 | In order to set up a conforming protocol stack you also need to | 
|  | 109 | specify the proper l2_prot parameter: | 
|  | 110 |  | 
|  | 111 | To operate in ISO-8208  X.25 DTE-DTE mode, use | 
|  | 112 |  | 
|  | 113 | isdnctrl l2_prot <iface-name> x75i | 
|  | 114 |  | 
|  | 115 | To access an X.25 network switch via isdn (your linux box is the DTE), use | 
|  | 116 |  | 
|  | 117 | isdnctrl l2_prot <iface-name> x25dte | 
|  | 118 |  | 
|  | 119 | To mimic an X.25 network switch (DCE side of the connection), use | 
|  | 120 |  | 
|  | 121 | isdnctrl l2_prot <iface-name> x25dce | 
|  | 122 |  | 
|  | 123 | However, x25dte or x25dce is currently not supported by any real HL | 
|  | 124 | level driver. The main difference between x75i and x25dte/dce is that | 
|  | 125 | x25d[tc]e uses fixed lap_b addresses. With x75i, the side which | 
|  | 126 | initiates the isdn connection uses the DTE's lap_b address while the | 
|  | 127 | called side used the DCE's lap_b address. Thus, l2_prot x75i might | 
|  | 128 | probably work if you access a public X.25 network as long as the | 
|  | 129 | corresponding isdn connection is set up by you. At least one test | 
|  | 130 | was successful to connect via isdn4linux to an X.25 switch using this | 
|  | 131 | trick. At the switch side, a terminal adapter X.21 was used to connect | 
|  | 132 | it to the isdn. | 
|  | 133 |  | 
|  | 134 |  | 
|  | 135 | How to set up a test installation? | 
|  | 136 | ================================== | 
|  | 137 |  | 
|  | 138 | To test X.25 on top of isdn, you need to get | 
|  | 139 |  | 
|  | 140 | - a recent version of the "isdnctrl" program that supports setting the new | 
|  | 141 | X.25 specific parameters. | 
|  | 142 |  | 
|  | 143 | - the x25-utils-2.X package from | 
|  | 144 | ftp://ftp.hes.iki.fi/pub/ham/linux/ax25/x25utils-* | 
|  | 145 | (don't confuse the x25-utils with the ax25-utils) | 
|  | 146 |  | 
|  | 147 | - an application program that uses linux PF_X25 sockets (some are | 
|  | 148 | contained in the x25-util package). | 
|  | 149 |  | 
|  | 150 | Before compiling the user level utilities make sure that the compiler/ | 
|  | 151 | preprocessor will fetch the proper kernel header files of this kernel | 
|  | 152 | source tree. Either make /usr/include/linux a symbolic link pointing to | 
|  | 153 | this kernel's include/linux directory or set the appropriate compiler flags. | 
|  | 154 |  | 
|  | 155 | When all drivers and interfaces are loaded and configured you need to | 
|  | 156 | ifconfig the network interfaces up and add X.25-routes to them. Use | 
|  | 157 | the usual ifconfig tool. | 
|  | 158 |  | 
|  | 159 | ifconfig <iface-name> up | 
|  | 160 |  | 
|  | 161 | But a special x25route tool (distributed with the x25-util package) | 
|  | 162 | is needed to set up X.25 routes. I.e. | 
|  | 163 |  | 
|  | 164 | x25route add 01 <iface-name> | 
|  | 165 |  | 
|  | 166 | will cause all x.25 connections to the destination X.25-address | 
|  | 167 | "01" to be routed to your created isdn network interface. | 
|  | 168 |  | 
|  | 169 | There are currently no real X.25 applications available. However, for | 
|  | 170 | tests, the x25-utils package contains a modified version of telnet | 
|  | 171 | and telnetd that uses X.25 sockets instead of tcp/ip sockets. You can | 
|  | 172 | use those for your first tests. Furthermore, you might check | 
|  | 173 | ftp://ftp.hamburg.pop.de/pub/LOCAL/linux/i4l-eft/ which contains some | 
|  | 174 | alpha-test implementation ("eftp4linux") of the EUROfile transfer | 
|  | 175 | protocol. | 
|  | 176 |  | 
|  | 177 | The scripts distributed with the eftp4linux test releases might also | 
|  | 178 | provide useful examples for setting up X.25 on top of isdn. | 
|  | 179 |  | 
|  | 180 | The x25-utility package also contains an x25trace tool that can be | 
|  | 181 | used to monitor X.25 packets received by the network interfaces. | 
|  | 182 | The /proc/net/x25* files also contain useful information. | 
|  | 183 |  | 
|  | 184 | - Henner |