📄 rfc887.txt
字号:
Network Working Group M. AccettaRequest for Comments: 887 Carnegie-Mellon University December 1983 RESOURCE LOCATION PROTOCOLThis note describes a resource location protocol for use in the ARPAInternet. It is most useful on networks employing technologies whichsupport some method of broadcast addressing, however it may also be usedon other types of networks. For maximum benefit, all hosts whichprovide significant resources or services to other hosts on the Internetshould implement this protocol. Hosts failing to implement the ResourceLocation Protocol risk being ignored by other hosts which are attemptingto locate resources on the Internet. This RFC specifies a draftstandard for the ARPA Internet community.The Resource Location Protocol (RLP) utilizes the User Datagram Protocol(UDP) [1] which in turn calls on the Internet Protocol (IP) [3] todeliver its datagrams. See Appendix A and [6] for the appropriate portand protocol number assignments.Unless otherwise indicated, all numeric quantities in this document aredecimal numbers.1. IntroductionFrom time to time, Internet hosts are faced with the problem ofdetermining where on the Internet some particular network service orresource is being provided. For example, this situation will arise whena host needs to send a packet destined for some external network to agateway on its directly connected network and does not know of anygateways. In another case, a host may need to translate a domain nameto an Internet address and not know of any name servers which it can askto perform the translation. In these situations a host may use theResource Location Protocol to determine this information.In almost all cases the resource location problem is simply a matter offinding the IP address of some one (usually any) host, either on thedirectly connected network or elsewhere on the Internet, whichunderstands a given protocol. Most frequently, the querying host itselfunderstands the protocol in question. Typically (as in the case oflocating a name server), the querying host subsequently intends toemploy that protocol to communicate with the located host once itsaddress is known (e.g. to request name to address translations). Lessfrequently, the querying host itself does not necessarily understand theprotocol in question. Instead (as in the case of locating a gateway),it is simply attempting to find some other host which does (e.g. todetermine an appropriate place to forward a packet which cannot bedelivered locally).Accetta [Page 1]RFC 887 December 1983Resource Location Protocol2. Resource NamingAlthough the resource location problem can, in most cases, be reduced tothe problem of finding a host which implements a given Internet basedprotocol, locating only a particular lowest level Internet protocol(i.e. one assigned a protocol number for transport using IP) is notcompletely sufficient. Many significant network services and resourcesare provided through higher level protocols which merely utilize thevarious lower level protocols for their own transport purposes (e.g. theFTP protocol [2] employs the TCP protocol [4] for its lower leveltransport). Conceptually, this protocol nesting may even be carried outto arbitrary levels.Consequently, the Resource Location Protocol names a resource by theprotocol number assigned to its lowest level Internet transport protocoland by a variable length protocol/resource specific identifier. Forexample, the UDP based Echo Protocol can be named by its assignedprotocol number (17) and its assigned 16-bit "well-known" port number(7). Alternatively, the Internet Control Message Protocol [5] (lackingany higher level client protocols) would be named simply by its assignedprotocol number (1) and an empty protocol specific identifier. On theother hand, some as yet undefined resource protocol (provided via sayTCP), might be named by the assigned protocol number (6), its 16-bit"well-known" TCP port number, and then some additional fixed or variablelength identifier specific to that TCP port.In general, the components of the protocol/resource specific identifierare defined to be the "natural" quantities used to successivelyde-multiplex the protocol at each next highest protocol level. Seesection 5 for some sample assignments.3. Protocol SummaryThe Resource Location Protocol is a simple request/reply procedure. Thequerying host constructs a list of resources which it would like tolocate and sends a request message on the network. A request messagemay be sent either to a particular IP address and host or, on networkswhich provide broadcast address capability, to the IP address whichrefers to all hosts on that network (see [7]). For example, a hostattempting to locate a domain name server might construct a requestcontaining the resource name [17, 53] (referring to the Domain NameServer protocol provided at "well-known" UDP port 53) and then broadcastthat request on its local network.Each receiving host examines the list of resources named in the requestpacket, determines which of the resources it provides, and returns areply message to the querying host in confirmation. The receiving hostdetermines whether or not it provides a resource by successivedecomposition of the resource name until either the name is exhausted orit encounters a component which is not supported. In the previousAccetta [Page 2]RFC 887 December 1983Resource Location Protocolexample, each host on the network receiving the broadcast request wouldexamine the resource name by first consulting its tables to determine ifit provided UDP service. If this was successful, it would then examinethe UDP port component of the name and consult its UDP table todetermine if it provided service on UDP port 53. At this point the namewould be exhausted and if both checks were successful the host wouldreturn a reply message to the querying host indicating support for thatresource.3.1. Request MessagesRLP provides two basic types of request messages which may betransmitted by a querying host. The first type requires any hostreceiving the request message to return a reply message only if itprovides at least one of the resources named in the request list. Thesecond type requires any host receiving the message to always return areply message even if it provides none of the resources named in therequest list.These two types of request messages are:<Who-Provides?> This type requires any host receiving the message to return an appropriate reply message which names all of the resources from the request list which it provides. If the receiving host provides none of the named resources, no reply may be returned.<Do-You-Provide?> This type is identical to the <Who-Provides?> message but with the extra requirement that a reply must always be returned. When a receiving host provides none of the requested resources, it simply returns an empty reply list. This empty reply list allows the querying host to immediately detect that the confirming host provides none of the named resources without having to timeout after repeatedly retransmitting the request.The <Who-Provides?> request message is most typically used whenbroadcasting requests to an entire IP network. The <Do-You-Provide?>request message, on the other hand, is most typically used whenconfirming that a particular host does or does not provide one or morespecific resources. It may not be broadcast (since such a request wouldflood the querying host with reply messages from all hosts on thenetwork).In addition to the two basic types of request messages, an additionaltwo variant types of request messages may also be transmitted by aquerying host. These message types provide a "third-party" resourcelocation capability. They differ from the basic message types byAccetta [Page 3]RFC 887 December 1983Resource Location Protocolproviding space for an additional qualifier with each listed resource toidentify "third-party" hosts which the confirming host believes mayprovide the resource. As before, the first type requires any hostreceiving the request message to return a reply message only if it knowsof some host which provides at least one of the resources named in therequest list. The second type requires any host receiving the messageto always return a reply message even if it knows of no hosts whichprovide any of the resources named in the request list.These two remaining types of request messages are:<Who-Anywhere-Provides?> This message parallels the <Who-Provides?> message with the "third-party" variant described above. The confirming host is required to return at least its own IP address (if it provides the named resource) as well as the IP addresses of any other hosts it believes may provide the named resource. The confirming host though, may never return an IP address for a resource which is the same as an IP address listed with the resource name in the request message. In this case it must treat the resource as if it was unsupported at that IP address and omit it from any reply list.<Does-Anyone-Provide?> This message parallels the <Do-You-Provide?> message again with the "third-party" variant described above. As before, the confirming host is required to return its own IP address as well as the IP addresses of any other hosts it believes may provide the named resource and is prohibited from returning the same IP address in the reply resource specifier as was listed in the request resource specifier. As in the <Do-You-Provide?> case and for the same reason, this message also may not be broadcast.These variant request messages permit "smart" hosts to supply resourcelocation information for networks without broadcast capability (providedthat all hosts on the network always "know" the address of one or moresuch "smart" hosts). They also permit resource location information forservices which are not provided anywhere on a directly connected networkto be provided by "smart" gateways which have perhaps queried othernetworks to which they are attached or have somehow otherwise acquiredthe information.The restriction against returning the same IP address in a reply as wasspecified in the request provides a primitive mechanism for excludingcertain known addresses from consideration in a reply (see section 5,example 3). It may also be used to override the receiving host'spreference for its own IP address in "third-party" replies when this isrequired.Accetta [Page 4]RFC 887 December 1983Resource Location Protocol3.2. Reply MessagesEach of the types of request messages has an associated type of replymessage. The basic reply message type is returned in response to both<Who-Provides?> and <Do-You-Provide?> request messages and suppliesinformation about the resources provided by the confirming host. Theother reply message type is the "third-party" variant returned inresponse to both <Who-Anywhere-Provides?> and <Does-Anyone-Provide?>request messages and supplies information about resources provided byhosts known to the confirming host.These two types of reply messages are:<I-Provide> This reply message contains a list of exactly those resources from the request list which the confirming host provides. These resources must occur in the reply list in precisely the same order as they were listed in the request message.<They-Provide> This reply message similarly contains a list of exactly those resources from the request list (appropriately qualified with IP addresses) which the confirming host provides or believes another host provides. These resources again must occur in the reply list in precisely the same order as they were listed in the request message.Neither type of reply message may be broadcast.A querying host which receives a <They-Provide> reply message from aconfirming host on behalf of a third host is not required tounquestioningly rely on the indirectly provided information. Thisinformation should usually be regarded simply as a hint. In most cases,the querying host should transmit a specific <Do-You-Provide?> requestto the third host and confirm that the resource is indeed provided atthat IP address before proceeding.4. Message FormatsRLP messages are encapsulated in UDP packets to take advantage of themultiplexing capability provided by the UDP source and destination portsand the extra reliability provided by the UDP checksum. Requestmessages are sent from a convenient source port on the querying host tothe assigned RLP destination port of a receiving host. Reply messagesare returned from the assigned RLP source port of the confirming host tothe appropriate destination port of the querying host as determined bythe source port in the request message.The format of the various RLP messages is described in the followingdiagrams. All numeric quantities which occupy more than one octet areAccetta [Page 5]RFC 887 December 1983Resource Location Protocolstored in the messages from the high order octet to the low order octetas per the usual Internet protocol standard. All packet diagramsindicate the octets of the message from left to right and then top tobottom as they occur in the data portion of the encapsulating UDPpacket.Each RLP packet has the general format +--------+--------+--------+--------+ | | | | | Type | Flags | Message-ID | | | | | +--------+--------+--------+--------+ | - | Resource-List - | -
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -