Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!oliveb!pyramid!prls!mips!dce From: dce@mips.UUCP (David Elliott) Newsgroups: comp.unix.wizards Subject: Re: rwho problems between 4.2 and 4.3 hosts Message-ID: <427@quacky.UUCP> Date: Tue, 26-May-87 10:47:50 EDT Article-I.D.: quacky.427 Posted: Tue May 26 10:47:50 1987 Date-Received: Thu, 28-May-87 03:15:30 EDT References: <7523@brl-adm.ARPA> <12249@topaz.rutgers.edu> <1158@sigi.Colorado.EDU> Reply-To: dce@quacky.UUCP (David Elliott) Distribution: world Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 69 Keywords: gateway, ifconfig, broadcast Previous responses to this have confused me, so I thought I'd give it a try from a more "user-oriented" standpoint. From my readings of the ifconfig(8C) manual page and from learning about how our network is set up, here's what I understand: There are two quantities involved: netmask and broadcast address. The netmask is a mask of 32 bits that says what part of an address is the "network" (1s in the mask) and what part is the "host" (0s). The broadcast address is an address that is understood by all hosts on a given network (which is why you can't broadcast into other networks) as a special address for "broadcast" packets. For example, suppose there are 3 machines whose addresses are 97.0.0.1, 97.0.1.2, and 97.1.0.3. If the netmask is set to 0xff000000, all of these machines are on the network numbered 97, so the broadcast address must be an address of the form 97.x.y.z, but it CAN be any address except for the ones already assigned to the machines listed. If the netmask is 0xffff0000, 97.0.0.1 and 97.0.1.2 are still on the same network, and the broadcast address must be of the form 97.0.x.y. The machine with address 97.1.0.3 is not on this network, and valid broadcast addresses in its network are of the form 97.1.x.y (where x and y do not have to be the same as on the other network). Other netmask values should, according to the documentation, work similarly. This allows you to have hierarchical networks within any physical organization. Now, to answer the real question. In 4.2BSD, the broadcast address defaults to being {host address} & {netmask} That is, all of the 0s in the netmask are zeroed. So, if your netmask is 0xffff0000 and your host address is 128.3.7.86, the broadcast address defaults to 12.3.0.0. In 4.3BSD, the broadcast address defaults to {host address} | ^{netmask} That is, all of the 0s in the netmask are changed to 1s. So, using the same netmask and host address as before, the broadcast address defaults to 128.3.255.255. I believe that the default netmask in all BSD systems is 0xffff0000. When you set up a 4.3BSD system to talk to 4.2BSD-based systems (like Suns), you need to change the ifconfig command(s) in /etc/rc.local to set the broadcast address. Of course, you may not want the 4.3 broadcast packets to mix with others, so decide beforehand and be prepared to change back. The user-oriented documentation on netmask and broadcast addresses is pretty bad. I got a call from someone on Friday night that could not get a MIPS machine to talk to a Sun, and it ended up that they had set the broadcast address to the same as the host address, thus making all host-specific requests broadcasts. Not only did rwho and ruptime not work, but rlogin and rsh were broken as well! Anyway, if any of you network jocks can point out flaws in the above information, please do so publicly. I'd like to add it to the documentation for ifconfig and to our system installation documentation. -- David Elliott {decvax,ucbvax,ihnp4}!decwrl!mips!dce "With an a) like that, you've got a lot of nerve asking for a b)!"-P. Schaeffer