Network Working Group Smoot Carl-Mitchell
Request for Comments: 1027 Texas Internet Consulting
John S. Quarterman
Texas Internet Consulting
October 1987
Using ARP to Implement Transparent Subnet Gateways
1. Motivation
The Ethernet at the University of Texas at Austin is a large installation connecting over ten buildings. It currently has more than one hundred hosts connected to it [5]. The size of the Ethernet and the amount of traffic it handles prohibit tying it together by use of repeaters. The use of subnets provided an attractive alternative for separating the network into smaller distinct units.
Carl-Mitchell & Quarterman [Page 1]
RFC 1027 ARP and Transparent Subnet Gateways October 1987 2. Design 2.1 Basic methodOn a network that supports ARP, when host A (the source) broadcasts an ARP request for the network address corresponding to the IP address of host B (the target), host B will recognize the IP address as its own and will send a point-to-point ARP reply. Host A keeps the IP-to-network-address mapping found in the reply in a local cache and uses it for later communication with host B.
Carl-Mitchell & Quarterman [Page 2]
RFC 1027 ARP and Transparent Subnet Gateways October 1987 2.2 RoutingAs part of the implementation of subnets, it is expected that the elements of routing tables will include network numbers including both the IP network number and the subnet bits, as specified by the subnet mask, where appropriate. When an ARP request is seen, the ARP subnet gateway can determine whether it knows a route to the target host by looking in the ordinary routing table. If attempts to reach foreign IP networks are eliminated early (see Sanity Checks below), only a request for an address on the local IP network will reach this point. We will assume that the same network mask applies to every subnet of the same IP network. The network mask of the network interface on which the ARP request arrived can then be applied to the target IP address to produce the network part to be looked up in the routing table.
Carl-Mitchell & Quarterman [Page 3]
RFC 1027 ARP and Transparent Subnet Gateways October 1987 2.3 Multiple gatewaysThe simplest subnet organization to administer is a tree structure, which cannot have loops. However, it may be desirable for reliability or traffic accommodation to have more than one gateway (or path) between two physical networks. ARP subnet gateways may be used in such a situation: a requesting host will use the first ARP response it receives, even if more than one gateway supplies one. This may even provide a rudimentary load balancing service, since if two gateways are otherwise similar, the one most lightly loaded is the more likely to reply first.
2.4 Sanity checks
Care must be taken by the network and gateway administrators to keep the network masks the same on all the subnet gateway machines. The most common error is to set the network mask on a host without a subnet implementation to include the subnet number. This causes the host to fail to attempt to send packets to hosts not on its local subnet. Adjusting its routing tables will not help, since it will not know how to route to subnets.
Carl-Mitchell & Quarterman [Page 4]
RFC 1027 ARP and Transparent Subnet Gateways October 1987 2.5 Multiple logical subnets per physical networkThe most straightforward way to assign subnet numbers is one to one with physical networks. There are, however, circumstances in which multiple logical subnets per physical network are quite useful. One of the more common is when it is planned that a group of workstations will be put on their own physical network but the gateway to the new physical network needs to be tested first. (A repeater might be used when the gateway was not usable). If a rule of one subnet per physical network is enforced, the addresses of the workstations must be changed every time the gateway is tested. If they may be assigned addresses using a new subnet number while they are still on the old physical network, no further address changes are needed.
2.6 Broadcast addresses
There are two kinds of IP broadcast addresses: main IP directed network broadcast and subnet broadcast. An IP network broadcast address consists of the network number plus a well-known value in the rest (local part) of the address. An IP subnet broadcast is similar, except both the IP network number and the subnet number bits are included. RFC-922 standardized the use of all ones in the local part, but there were two conventions in use before that: all ones and all zeros. For example, 4.2BSD used all zeros, and 4.3BSD uses all ones. Thus there are four kinds of IP directed broadcast addresses still currently in use on many networks.
Carl-Mitchell & Quarterman [Page 5]
RFC 1027 ARP and Transparent Subnet Gateways October 1987
Thus a subnet gateway in a network with hosts that do not understand subnets must take care not to use subnet broadcast addresses: instead it must use the IP network directed broadcast address instead.
3. Implementation in 4.3BSD
Subnet gateways using ARP have been implemented by a number of different people. The particular method described in this memo was first implemented in 4.2BSD on top of retrofitted beta-test 4.3BSD subnet code, and has since been reimplemented as an add-on to the distributed 4.3BSD sources. The latter implementation is described here.
Carl-Mitchell & Quarterman [Page 6]
RFC 1027 ARP and Transparent Subnet Gateways October 1987
The file netinet/route.c has a static routing entry structure definition added, and modifications of about eight lines are made to the main routing table lookup routine, rtalloc, to recognize a pointer to that structure (when passed by if_subarp) as a direction to not use the default route in this routing check. The processor priority level (critical section protection) around the inner routing lookup check is changed to a higher value, as the routine may now be called from network interface interrupts as well as from the internal software interrupts that drive processing of IP and other high level protocols. This raised processor priority could conceivably slow the whole kernel somewhat if there are many routing checks, but since the critical section is fast, the effect should be small.
Carl-Mitchell & Quarterman [Page 7]
RFC 1027 ARP and Transparent Subnet Gateways October 1987 4. AvailabilityThe 4.3BSD implementation is currently available by anonymous FTP (login anonymous, password guest) from sally.utexas.edu as pub/subarp, which is a 4.3BSD "diff -c" listing from the 4.3BSD sources that were distributed in September 1986.