xref: /OK3568_Linux_fs/kernel/Documentation/networking/decnet.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun=========================================
4*4882a593SmuzhiyunLinux DECnet Networking Layer Information
5*4882a593Smuzhiyun=========================================
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun1. Other documentation....
8*4882a593Smuzhiyun==========================
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun   - Project Home Pages
11*4882a593Smuzhiyun     - http://www.chygwyn.com/				   - Kernel info
12*4882a593Smuzhiyun     - http://linux-decnet.sourceforge.net/                - Userland tools
13*4882a593Smuzhiyun     - http://www.sourceforge.net/projects/linux-decnet/   - Status page
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun2. Configuring the kernel
16*4882a593Smuzhiyun=========================
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunBe sure to turn on the following options:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    - CONFIG_DECNET (obviously)
21*4882a593Smuzhiyun    - CONFIG_PROC_FS (to see what's going on)
22*4882a593Smuzhiyun    - CONFIG_SYSCTL (for easy configuration)
23*4882a593Smuzhiyun
24*4882a593Smuzhiyunif you want to try out router support (not properly debugged yet)
25*4882a593Smuzhiyunyou'll need the following options as well...
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun    - CONFIG_DECNET_ROUTER (to be able to add/delete routes)
28*4882a593Smuzhiyun    - CONFIG_NETFILTER (will be required for the DECnet routing daemon)
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunDon't turn on SIOCGIFCONF support for DECnet unless you are really sure
31*4882a593Smuzhiyunthat you need it, in general you won't and it can cause ifconfig to
32*4882a593Smuzhiyunmalfunction.
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunRun time configuration has changed slightly from the 2.4 system. If you
35*4882a593Smuzhiyunwant to configure an endnode, then the simplified procedure is as follows:
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun - Set the MAC address on your ethernet card before starting _any_ other
38*4882a593Smuzhiyun   network protocols.
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunAs soon as your network card is brought into the UP state, DECnet should
41*4882a593Smuzhiyunstart working. If you need something more complicated or are unsure how
42*4882a593Smuzhiyunto set the MAC address, see the next section. Also all configurations which
43*4882a593Smuzhiyunworked with 2.4 will work under 2.5 with no change.
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun3. Command line options
46*4882a593Smuzhiyun=======================
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunYou can set a DECnet address on the kernel command line for compatibility
49*4882a593Smuzhiyunwith the 2.4 configuration procedure, but in general it's not needed any more.
50*4882a593SmuzhiyunIf you do st a DECnet address on the command line, it has only one purpose
51*4882a593Smuzhiyunwhich is that its added to the addresses on the loopback device.
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunWith 2.4 kernels, DECnet would only recognise addresses as local if they
54*4882a593Smuzhiyunwere added to the loopback device. In 2.5, any local interface address
55*4882a593Smuzhiyuncan be used to loop back to the local machine. Of course this does not
56*4882a593Smuzhiyunprevent you adding further addresses to the loopback device if you
57*4882a593Smuzhiyunwant to.
58*4882a593Smuzhiyun
59*4882a593SmuzhiyunN.B. Since the address list of an interface determines the addresses for
60*4882a593Smuzhiyunwhich "hello" messages are sent, if you don't set an address on the loopback
61*4882a593Smuzhiyuninterface then you won't see any entries in /proc/net/neigh for the local
62*4882a593Smuzhiyunhost until such time as you start a connection. This doesn't affect the
63*4882a593Smuzhiyunoperation of the local communications in any other way though.
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunThe kernel command line takes options looking like the following::
66*4882a593Smuzhiyun
67*4882a593Smuzhiyun    decnet.addr=1,2
68*4882a593Smuzhiyun
69*4882a593Smuzhiyunthe two numbers are the node address 1,2 = 1.2 For 2.2.xx kernels
70*4882a593Smuzhiyunand early 2.3.xx kernels, you must use a comma when specifying the
71*4882a593SmuzhiyunDECnet address like this. For more recent 2.3.xx kernels, you may
72*4882a593Smuzhiyunuse almost any character except space, although a `.` would be the most
73*4882a593Smuzhiyunobvious choice :-)
74*4882a593Smuzhiyun
75*4882a593SmuzhiyunThere used to be a third number specifying the node type. This option
76*4882a593Smuzhiyunhas gone away in favour of a per interface node type. This is now set
77*4882a593Smuzhiyunusing /proc/sys/net/decnet/conf/<dev>/forwarding. This file can be
78*4882a593Smuzhiyunset with a single digit, 0=EndNode, 1=L1 Router and  2=L2 Router.
79*4882a593Smuzhiyun
80*4882a593SmuzhiyunThere are also equivalent options for modules. The node address can
81*4882a593Smuzhiyunalso be set through the /proc/sys/net/decnet/ files, as can other system
82*4882a593Smuzhiyunparameters.
83*4882a593Smuzhiyun
84*4882a593SmuzhiyunCurrently the only supported devices are ethernet and ip_gre. The
85*4882a593Smuzhiyunethernet address of your ethernet card has to be set according to the DECnet
86*4882a593Smuzhiyunaddress of the node in order for it to be autoconfigured (and then appear in
87*4882a593Smuzhiyun/proc/net/decnet_dev). There is a utility available at the above
88*4882a593SmuzhiyunFTP sites called dn2ethaddr which can compute the correct ethernet
89*4882a593Smuzhiyunaddress to use. The address can be set by ifconfig either before or
90*4882a593Smuzhiyunat the time the device is brought up. If you are using RedHat you can
91*4882a593Smuzhiyunadd the line::
92*4882a593Smuzhiyun
93*4882a593Smuzhiyun    MACADDR=AA:00:04:00:03:04
94*4882a593Smuzhiyun
95*4882a593Smuzhiyunor something similar, to /etc/sysconfig/network-scripts/ifcfg-eth0 or
96*4882a593Smuzhiyunwherever your network card's configuration lives. Setting the MAC address
97*4882a593Smuzhiyunof your ethernet card to an address starting with "hi-ord" will cause a
98*4882a593SmuzhiyunDECnet address which matches to be added to the interface (which you can
99*4882a593Smuzhiyunverify with iproute2).
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunThe default device for routing can be set through the /proc filesystem
102*4882a593Smuzhiyunby setting /proc/sys/net/decnet/default_device to the
103*4882a593Smuzhiyundevice you want DECnet to route packets out of when no specific route
104*4882a593Smuzhiyunis available. Usually this will be eth0, for example::
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun    echo -n "eth0" >/proc/sys/net/decnet/default_device
107*4882a593Smuzhiyun
108*4882a593SmuzhiyunIf you don't set the default device, then it will default to the first
109*4882a593Smuzhiyunethernet card which has been autoconfigured as described above. You can
110*4882a593Smuzhiyunconfirm that by looking in the default_device file of course.
111*4882a593Smuzhiyun
112*4882a593SmuzhiyunThere is a list of what the other files under /proc/sys/net/decnet/ do
113*4882a593Smuzhiyunon the kernel patch web site (shown above).
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun4. Run time kernel configuration
116*4882a593Smuzhiyun================================
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun
119*4882a593SmuzhiyunThis is either done through the sysctl/proc interface (see the kernel web
120*4882a593Smuzhiyunpages for details on what the various options do) or through the iproute2
121*4882a593Smuzhiyunpackage in the same way as IPv4/6 configuration is performed.
122*4882a593Smuzhiyun
123*4882a593SmuzhiyunDocumentation for iproute2 is included with the package, although there is
124*4882a593Smuzhiyunas yet no specific section on DECnet, most of the features apply to both
125*4882a593SmuzhiyunIP and DECnet, albeit with DECnet addresses instead of IP addresses and
126*4882a593Smuzhiyuna reduced functionality.
127*4882a593Smuzhiyun
128*4882a593SmuzhiyunIf you want to configure a DECnet router you'll need the iproute2 package
129*4882a593Smuzhiyunsince its the _only_ way to add and delete routes currently. Eventually
130*4882a593Smuzhiyunthere will be a routing daemon to send and receive routing messages for
131*4882a593Smuzhiyuneach interface and update the kernel routing tables accordingly. The
132*4882a593Smuzhiyunrouting daemon will use netfilter to listen to routing packets, and
133*4882a593Smuzhiyunrtnetlink to update the kernels routing tables.
134*4882a593Smuzhiyun
135*4882a593SmuzhiyunThe DECnet raw socket layer has been removed since it was there purely
136*4882a593Smuzhiyunfor use by the routing daemon which will now use netfilter (a much cleaner
137*4882a593Smuzhiyunand more generic solution) instead.
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun5. How can I tell if its working?
140*4882a593Smuzhiyun=================================
141*4882a593Smuzhiyun
142*4882a593SmuzhiyunHere is a quick guide of what to look for in order to know if your DECnet
143*4882a593Smuzhiyunkernel subsystem is working.
144*4882a593Smuzhiyun
145*4882a593Smuzhiyun   - Is the node address set (see /proc/sys/net/decnet/node_address)
146*4882a593Smuzhiyun   - Is the node of the correct type
147*4882a593Smuzhiyun     (see /proc/sys/net/decnet/conf/<dev>/forwarding)
148*4882a593Smuzhiyun   - Is the Ethernet MAC address of each Ethernet card set to match
149*4882a593Smuzhiyun     the DECnet address. If in doubt use the dn2ethaddr utility available
150*4882a593Smuzhiyun     at the ftp archive.
151*4882a593Smuzhiyun   - If the previous two steps are satisfied, and the Ethernet card is up,
152*4882a593Smuzhiyun     you should find that it is listed in /proc/net/decnet_dev and also
153*4882a593Smuzhiyun     that it appears as a directory in /proc/sys/net/decnet/conf/. The
154*4882a593Smuzhiyun     loopback device (lo) should also appear and is required to communicate
155*4882a593Smuzhiyun     within a node.
156*4882a593Smuzhiyun   - If you have any DECnet routers on your network, they should appear
157*4882a593Smuzhiyun     in /proc/net/decnet_neigh, otherwise this file will only contain the
158*4882a593Smuzhiyun     entry for the node itself (if it doesn't check to see if lo is up).
159*4882a593Smuzhiyun   - If you want to send to any node which is not listed in the
160*4882a593Smuzhiyun     /proc/net/decnet_neigh file, you'll need to set the default device
161*4882a593Smuzhiyun     to point to an Ethernet card with connection to a router. This is
162*4882a593Smuzhiyun     again done with the /proc/sys/net/decnet/default_device file.
163*4882a593Smuzhiyun   - Try starting a simple server and client, like the dnping/dnmirror
164*4882a593Smuzhiyun     over the loopback interface. With luck they should communicate.
165*4882a593Smuzhiyun     For this step and those after, you'll need the DECnet library
166*4882a593Smuzhiyun     which can be obtained from the above ftp sites as well as the
167*4882a593Smuzhiyun     actual utilities themselves.
168*4882a593Smuzhiyun   - If this seems to work, then try talking to a node on your local
169*4882a593Smuzhiyun     network, and see if you can obtain the same results.
170*4882a593Smuzhiyun   - At this point you are on your own... :-)
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun6. How to send a bug report
173*4882a593Smuzhiyun===========================
174*4882a593Smuzhiyun
175*4882a593SmuzhiyunIf you've found a bug and want to report it, then there are several things
176*4882a593Smuzhiyunyou can do to help me work out exactly what it is that is wrong. Useful
177*4882a593Smuzhiyuninformation (_most_ of which _is_ _essential_) includes:
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun - What kernel version are you running ?
180*4882a593Smuzhiyun - What version of the patch are you running ?
181*4882a593Smuzhiyun - How far though the above set of tests can you get ?
182*4882a593Smuzhiyun - What is in the /proc/decnet* files and /proc/sys/net/decnet/* files ?
183*4882a593Smuzhiyun - Which services are you running ?
184*4882a593Smuzhiyun - Which client caused the problem ?
185*4882a593Smuzhiyun - How much data was being transferred ?
186*4882a593Smuzhiyun - Was the network congested ?
187*4882a593Smuzhiyun - How can the problem be reproduced ?
188*4882a593Smuzhiyun - Can you use tcpdump to get a trace ? (N.B. Most (all?) versions of
189*4882a593Smuzhiyun   tcpdump don't understand how to dump DECnet properly, so including
190*4882a593Smuzhiyun   the hex listing of the packet contents is _essential_, usually the -x flag.
191*4882a593Smuzhiyun   You may also need to increase the length grabbed with the -s flag. The
192*4882a593Smuzhiyun   -e flag also provides very useful information (ethernet MAC addresses))
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun7. MAC FAQ
195*4882a593Smuzhiyun==========
196*4882a593Smuzhiyun
197*4882a593SmuzhiyunA quick FAQ on ethernet MAC addresses to explain how Linux and DECnet
198*4882a593Smuzhiyuninteract and how to get the best performance from your hardware.
199*4882a593Smuzhiyun
200*4882a593SmuzhiyunEthernet cards are designed to normally only pass received network frames
201*4882a593Smuzhiyunto a host computer when they are addressed to it, or to the broadcast address.
202*4882a593Smuzhiyun
203*4882a593SmuzhiyunLinux has an interface which allows the setting of extra addresses for
204*4882a593Smuzhiyunan ethernet card to listen to. If the ethernet card supports it, the
205*4882a593Smuzhiyunfiltering operation will be done in hardware, if not the extra unwanted packets
206*4882a593Smuzhiyunreceived will be discarded by the host computer. In the latter case,
207*4882a593Smuzhiyunsignificant processor time and bus bandwidth can be used up on a busy
208*4882a593Smuzhiyunnetwork (see the NAPI documentation for a longer explanation of these
209*4882a593Smuzhiyuneffects).
210*4882a593Smuzhiyun
211*4882a593SmuzhiyunDECnet makes use of this interface to allow running DECnet on an ethernet
212*4882a593Smuzhiyuncard which has already been configured using TCP/IP (presumably using the
213*4882a593Smuzhiyunbuilt in MAC address of the card, as usual) and/or to allow multiple DECnet
214*4882a593Smuzhiyunaddresses on each physical interface. If you do this, be aware that if your
215*4882a593Smuzhiyunethernet card doesn't support perfect hashing in its MAC address filter
216*4882a593Smuzhiyunthen your computer will be doing more work than required. Some cards
217*4882a593Smuzhiyunwill simply set themselves into promiscuous mode in order to receive
218*4882a593Smuzhiyunpackets from the DECnet specified addresses. So if you have one of these
219*4882a593Smuzhiyuncards its better to set the MAC address of the card as described above
220*4882a593Smuzhiyunto gain the best efficiency. Better still is to use a card which supports
221*4882a593SmuzhiyunNAPI as well.
222*4882a593Smuzhiyun
223*4882a593Smuzhiyun
224*4882a593Smuzhiyun8. Mailing list
225*4882a593Smuzhiyun===============
226*4882a593Smuzhiyun
227*4882a593SmuzhiyunIf you are keen to get involved in development, or want to ask questions
228*4882a593Smuzhiyunabout configuration, or even just report bugs, then there is a mailing
229*4882a593Smuzhiyunlist that you can join, details are at:
230*4882a593Smuzhiyun
231*4882a593Smuzhiyunhttp://sourceforge.net/mail/?group_id=4993
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun9. Legal Info
234*4882a593Smuzhiyun=============
235*4882a593Smuzhiyun
236*4882a593SmuzhiyunThe Linux DECnet project team have placed their code under the GPL. The
237*4882a593Smuzhiyunsoftware is provided "as is" and without warranty express or implied.
238*4882a593SmuzhiyunDECnet is a trademark of Compaq. This software is not a product of
239*4882a593SmuzhiyunCompaq. We acknowledge the help of people at Compaq in providing extra
240*4882a593Smuzhiyundocumentation above and beyond what was previously publicly available.
241*4882a593Smuzhiyun
242*4882a593SmuzhiyunSteve Whitehouse <SteveW@ACM.org>
243*4882a593Smuzhiyun
244