home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 600s / rfc672.txt < prev    next >
Text File  |  1992-10-14  |  26KB  |  544 lines

  1. Network Working Group                               Richard Schantz (BBN-TENEX)
  2. Request for Comments: 672                                              Dec 1974
  3. NIC #31440
  4.  
  5.  
  6.  
  7.                      A Multi-Site Data Collection Facility
  8.  
  9.  
  10.  
  11.  
  12.         Preface:
  13.  
  14.         This RFC reproduces most of a working document
  15.         prepared during the design and implementation of the
  16.         protocols for the TIP-TENEX integrated system for
  17.         handling TIP accounting. Bernie Cosell (BBN-TIP)
  18.         and Bob Thomas (BBN-TENEX) have contributed to
  19.         various aspects of this work. The system has been
  20.         partially operational for about a month on selected
  21.         hosts. We feel that the techniques described here
  22.         have wide applicability beyond TIP accounting.
  23.  
  24.  
  25. Section I
  26.  
  27. Protocols for a Multi-site Data Collection Facility
  28.  
  29.  
  30. Introduction
  31.  
  32.  
  33.      The development of computer networks has provided the
  34. groundwork for distributed computation: one in which a job or task
  35. is comprised of components from various computer systems. In a
  36. single computer system, the unavailability or malfunction of any of
  37. the job components (e.g. program, file, device, etc.) usually
  38. necessitates job termination. With computer networks, it becomes
  39. feasible to duplicate certain job components which previously had no
  40. basis for duplication. (In a single system, it does not matter how
  41. many times a process that performs a certain function is duplicated;
  42. a system crash makes all unavailable). It is such resource
  43. duplication that enables us to utilize the network to achieve high
  44. reliability and load leveling. In order to realize the potential of
  45. resource duplication, it is necessary to have protocols which
  46. provide for the orderly use of these resources. In this document,
  47. we first discuss in general terms a problem of protocol definition
  48. for interacting with a multiply defined resource (server). The
  49. problem deals with providing a highly reliable data collection
  50. facility, by supporting it at many sites throughout the network. In
  51. the second section of this document, we describe in detail a
  52. particular implementation of the protocol which handles the problem
  53. of utilizing multiple data collector processes for collecting
  54. accounting data generated by the network TIPs. This example also
  55. illustrates the specialization of hosts to perform parts of a
  56. computation they are best equipped to handle. The large network
  57. hosts (TENEX systems) perform the accounting function for the small
  58. network access TiPs.
  59.  
  60.      The situation to be discussed is the following: a data
  61. generating process needs to use a data collection service which is
  62. duplicately provided by processes on a number of network machines.
  63. A request to a server involves sending the data to be collected.
  64.  
  65.  
  66. An Initial Approach
  67.  
  68.  
  69.      The data generator could proceed by selecting a particular
  70. server and sending its request to that server. It might also take
  71. the attitude that if the message reaches the destination host (the
  72. communication subsystem will indicate this) the message will be
  73. properly processed to completion. Failure of the request Message
  74. would then lead to selecting another server, until the request
  75. succeeds or all servers have been tried.
  76.  
  77.  
  78.  
  79.                                       -2-
  80.  
  81.  
  82.      Such a simple strategy is a poor one. It makes sense to
  83. require that the servicing process send a positive acknowledgement
  84. to the requesting process. If nothing else, the reply indicates
  85. that the server process itself is still functioning. Waiting for
  86. such a reply also implies that there is a strategy for selecting
  87. another server if the reply is not forthcoming. Herein lies a
  88. problem. If the expected reply is timed out, and then a new request
  89. is sent to another server, we run the risk of receiving the
  90. (delayed) original acknowledgement at a later time. This could
  91. result in having the data entered into the collection system twice
  92. (data duplication). If the request is re-transmitted to the same
  93. server only, we face the possibility of not being able to access a
  94. collector (data loss). In addition, for load leveling purposes, we
  95. may wish to send new requests to some (or all) servers. We can then
  96. use their reply (or lack of reply) as an indicator of load on that
  97. particular instance of the service. Doing this without data
  98. duplication requires more than a simple request and acknowledgement
  99. protocol*.
  100.  
  101.  
  102. Extension of the Protocol
  103.  
  104.  
  105.      The general protocol developed to handle multiple collection
  106. servers involves having the data generator send the data request to
  107. some (or all) data collectors. Those willing to handle the request
  108. reply with an "I've got it" message. They then await further
  109. notification before finalizing the processing of the data. The data
  110. generator sends a "go ahead" message to one of the replying
  111. collectors, and a "discard" message to all other replying
  112. collectors. The "go ahead" message is the signal to process the
  113. data (i.e. collect permanently), while the "discard" message
  114. indicates that the data is being collected elsewhere and should not
  115. be retained.
  116.  
  117.      The question now arises as to whether or not the collector
  118. process should acknowledge receipt of the "go ahead" message with a
  119. reply of its own, and then should the generator process acknowledge
  120. this acknowledgement, etc. We would like to send as few messages as
  121. possible to achieve reliable communication. Therefore, when a state
  122. --------------------
  123.  
  124. * If the servers are independent of each other to the extent that if
  125. two or more servers all act on the same request, the end result is
  126. the same as having a single server act on the request, then a simple
  127. request/acknowledgement protocol is adequate. Such may be the case,
  128. for example, if we subject the totality of collected data (i.e. all
  129. data collected by all collectors for a certain period) to a
  130. duplicate detection scan. If we could store enough context in each
  131. entry to be able to determine duplicates, then having two or more
  132. servers act on the data would be functionally equivalent to
  133. processing by a single server.
  134.  
  135.  
  136.                                       -3-
  137.  
  138.  
  139. is reached for which further acknowledgements lead to a previously
  140. visited state, or when the cost of further acknowledgements outweigh
  141. the increase in reliability they bring, further acknowledgements
  142. become unnecessary.
  143.  
  144.      The initial question was should the collector process
  145. acknowledge the "go ahead" message? Assume for the moment that it
  146. should not send such an acknowledgement. The data generator could
  147. verify, through the communication subsystem, the transmission of the
  148. "go ahead" message to the host of the collector. If this message
  149. did not arrive correctly, the generator has the option of
  150. re-transmitting it or sending a "go ahead" to another collector
  151. which has acknowledged receipt of the data. Either strategy
  152. involves no risk of duplication. If the "go ahead" message arrives
  153. correctly, and a collector acknowledgement to the "go ahead" message
  154. is not required, then we incur a vulnerability to (collector host)
  155. system crash from the time the "go ahead" message is accepted by the
  156. host until the time the data is totally processed. Call the data
  157. processing time P. Once the data generator has selected a
  158. particular collector (on the basis of receiving its "I've got it"
  159. message), we also incur a vulnerability to malfunction of this
  160. collector process. The vulnerable period is from the time the
  161. collector sends its "i've got it" message until the time the data is
  162. processed. This amounts to two network transit times (2N) plus IMP
  163. and host overhead for message delivery (0) plus data processing time
  164. (P). [Total time=2N+P+O]. A malfunction (crash) in this period can
  165. cause the loss of data. There is no potential for duplication.
  166.  
  167.      Now, assume that the data collector process must acknowledge
  168. the "go ahead" message. The question then arises as to when such an
  169. acknowledgement should be sent. The reasonable choices are either
  170. immediately before final processing of the data (i.c. before the
  171. data is permanently recorded) or immediately after final processing.
  172. It can be argued that unless another acknowledgement is required (by
  173. the generator to the collector) to this acknowledgement BEFORE the
  174. actual data update, then the best time for the collector to
  175. acknowledge the "go ahead" is after final processing. This is so
  176. because receiving the acknowledgement conveys more information if it
  177. is sent after processing, while not receiving it (timeout), in
  178. either case, leaves us in an unknown state with respect to the data
  179. update. Depending on the relative speeds of various network and
  180. system components, the data may or may not be permanently entered.
  181. Therefore if we interpret the timeout as a signal to have the data
  182. processed at another site, we run the risk of duplication of data.
  183. To avoid data duplication, the timeout strategy must only involve
  184. re-sending the "go ahead" message to the same collector. This will
  185. only help if the lack of reply is due to a lost network message.
  186. Our vulnerability intervals to system and process malfunction remain
  187. as before.
  188.  
  189.      It is our conjecture (to be analyzed further) that any further
  190. acknowledgements to these acknowledgements will have virtually no
  191. effect on reducing the period of vulnerability outlined above. As
  192. such, the protocol with the fewest messages required is superior.
  193.  
  194.  
  195.                                       -4-
  196.  
  197. Data Dependent Aspects of the Protocol
  198.  
  199.  
  200.      As discussed above, a main issue is which process should be the
  201. last to respond (send an acknowledgement). If the data generator
  202. sends the last message (i.e. "go ahead"), we can only check on its
  203. correct arrival at the destination host. We must "take on faith"
  204. the ability of the collector to correctly complete the transaction.
  205. This strategy is geared toward avoiding data duplication. If on the
  206. other hand, the protocol specifies that the collector is to send the
  207. last message, with the timeout of such a message causing the data
  208. generator to use another collector, then the protocol is geared
  209. toward the best efforts of recording the data somewhere, at the
  210. expense of possible duplication.
  211.  
  212.      Thus, the nature of the problem will dictate which of the
  213. protocols is appropriate for a given situation. The next section
  214. deals in the specifics of an implement;tion of a data collection
  215. protocol to handle the problem of collecting TIP accounting data by
  216. using the TENEX systems for running the collection server processes.
  217. It is shown how the general protocol is optimized for the accounting
  218. data collection.
  219.  
  220.  
  221.  
  222.  
  223. Section II
  224.  
  225. Protocol for TIP-TENEX Accounting Server Information Exchange
  226.  
  227.  
  228. Overview of the Facility
  229.  
  230.  
  231.      When a user initially requests service from a TIP, the TIP will
  232. perform a broadcast ICP to find an available RSEXEC which maintains
  233. an authentication data base. The user must then complete s login
  234. sequence in order to authenticate himself. If he is successful the
  235. RSEXEC will transmit his unique ID code to the TIP. Failure will
  236. cause the RSEXEC to close the connection and the TIP to hang up on
  237. the user. After the user is authenticated, the TIP will accumulate
  238. accounting data for the user session. The data includes a count of
  239. messages sent on behalf of the user, and the connect time for the
  240. user. From time to time the TIP will transmit intermediate
  241. accounting data to Accounting Server (ACTSER) processes scattered
  242. throughout the network. These accounting servers will maintain
  243. files containing intermediate raw accounting data. The raw
  244. accounting data will periodically be collected and sorted to produce
  245. an accounting data base. Providing a number of accounting servers
  246. reduces the possibility of being unable to find a repository for the
  247. intermediate data, which otherwise would be lost due to buffering
  248. limitations in the TiPs. The multitude of accounting servers can
  249. also serve to reduce the load on the individual hosts providing this
  250. facility.
  251.  
  252.  
  253.                                       -5-
  254.  
  255. The rest of this document details the protocol that has been
  256. developed to ensure delivery of TIP accounting data to one of the
  257. available accounting servers for storage in the intermediate
  258. accounting files.
  259.  
  260.  
  261. Adapting the Protocol
  262.  
  263.  
  264. The TIP to Accounting Server data exchange uses a protocol that
  265. allows the TIP to select for data transmission one, some, or all
  266. server hosts either sequentially or in parallel, yet insures that
  267. the data that becomes part of the accounting file does not contain
  268. duplicate information. The protocol also minimizes the amount of
  269. data buffering that must be done by the limited capacity TiPs. The
  270. protocol is applicable to a wide class of data collection problems
  271. which use a number of data generators and collectors. The following
  272. describes how the protocol works for TIP accounting.
  273.  
  274. Each TIP is responsible for maintaining in its memory the cells
  275. indicating the connect time and the number of messages sent for each
  276. of its current users. These cells are incremented by the TIP for
  277. every quantum of connect time and message sent, as the case may be.
  278. This is the data generation phase. Periodically, the TIP will scan
  279. all its active counters, and along with each user ID code, pack the
  280. accumulated data into one network message (i.e. less than 8K bits).
  281. The TIP then transmits this data to a set of Accounting Server
  282. processes residing throughout the network. The data transfer is
  283. over a specially designated host-host link. The accounting servers
  284. utilize the raw network message facility of TENEX 1.32 in order to
  285. directly access that link. When an ACTSER receives a data message
  286. from a TIP, it buffers the data and replies by returning the entire
  287. message to the originating TIP. The TIP responds with a positive
  288. acknowledgement ("go ahead") to the first ACTSER which returns the
  289. data, and responds with a negative acknowledgement ("discard") to
  290. all subsequent ACTSER data return messages for this series of
  291. transfers. If the TIP does not receive a reply from any ACTSER, it
  292. accumulates new data (i.e. the TIP has all the while been
  293. incrementing its local counters to reflect the increased connect
  294. time and message count; the current values will comprise new data
  295. transfers) and sends the new data to the Accounting Server
  296. processes. When an ACTSER receives a positive acknowledgement from
  297. a TIP (i.e. "go ahead"), it appends the appropriate parts of the
  298. buffered data to the locally maintained accounting information file.
  299. On receiving a negative acknowledgement from the TIP (i.e.
  300. "discard"), the ACTSER discards the data buffered for this TIP. In
  301. -addition, when the TIP responds with a "go ahead" to the first
  302. ACTSER which has accepted the data (acknowledged by returning the
  303. data along with the "I've got it"), the TIP decrements the connect
  304. time and message counters for each user by the amount indicated in
  305. the data returned by the ACTSER. This data will already be
  306. accounted for in the intermediate accounting files.
  307.  
  308. As an aid in determining which ACTSER replies are to current
  309. requests, and which are tardy replies to old requests, the TIP
  310.  
  311.                                       -6-
  312. maintains a sequence number indicator, and appends this number to
  313. each data message sent to an ACTSER. On receiving a reply from an
  314. ACTSER, the TIP merely checks the returned sequence number to see if
  315. this is the first reply to the current set of TIP requests. If the
  316. returned sequence number is the same as the current sequence number,
  317. then this is the first reply; a positive acknowledgement is sent
  318. off, the counters are decremented by the returned data, and the
  319. sequence number is incremented. If the returned sequence number is
  320. not the same as the current one (i.e. not the one we are now
  321. seeking a reply for) then a negative acknowledgement is sent to the
  322. replying ACTSER. After a positive acknowledgement to an ACTSER (and
  323. the implied incrementing of the sequence number), the TIP can wait
  324. for more information to accumulate, and then start transmitting
  325. again using the new sequence number.
  326.  
  327.  
  328. Further Clarification of the Protocol
  329.  
  330.  
  331. There are a number of points concerning the protocol that
  332. should be noted.
  333.  
  334. 1. The data generator (TIP) can send different (i.e. updated
  335. versions) data to different data collectors (accounting servers) as
  336. part of the same logical transmission sequence. This is possible
  337. because the TIP does not account for the data sent until it receives
  338. the acknowledgement of the data echo. This strategy relieves the
  339. TIP of any buffering in conjunction with re-transmission of data
  340. which hasn't been acknowledged.
  341.  
  342. 2. A new data request to an accounting server from a TIP will
  343. also serve as a negative acknowledgement concerning any data already
  344. buffered by the ACTSER for that TIP, but not yet acknowledged. The
  345. old data will be discarded, and the new data will be buffered and
  346. echoed as an acknowledgement. This allows the TIP the option of not
  347. sending a negative acknowledgement when it is not convenient to do
  348. so, without having to remember that it must be sent at a later time.
  349. There is one exception to this convention. If the new data message
  350. has the same sequence number as the old buffered message, then the
  351. new data must be discarded, and the old data kept and re-echoed.
  352. This is to prevent a slow acknowledgement to the old data from being
  353. accepted by the TIP, after the TIP has already sent the new data to
  354. the slow host. This caveat can be avoided if the TIP does not
  355. resend to a non-responding server within the time period that a
  356. message could possibly be stuck in the network, but could still be
  357. delivered. Ignoring this situation may result in some accounting
  358. data being counted twice. Because of the rule to keep old data when
  359. confronted with matching sequence numbers, on restarting after a
  360. crash, the TIP should send a "discard" message to all servers in
  361. order to clear any data which has been buffered for it prior to the
  362. crash. An alternative to this would be for the TIP to initialize
  363. its sequence number from a varying source such as time of day.
  364.  
  365. 3. The accounting server similarly need not acknowledge receipt
  366. of data (by echoing) if it finds itself otherwise occupied. This
  367. will mean that the ACTSER is not buffering the data, and hence is
  368. not a candidate for entering the data into the file. However, the
  369.  
  370.                                       -7-
  371. TIP may try this ACTSER at a later time (even with the same data),
  372. with no ill effects.
  373.  
  374. 4. Because of 2 and 3 above, the protocol is robust with respect
  375. to lost or garbled transmissions of TIP data requests and accounting
  376. server echo replies. That is, in the event of loss of such a
  377. message, a re-transmission will occur as the normal procedure.
  378.  
  379. 5. There is no synchronization problem with respect to the
  380. sequence number used for duplicate detection, since this number is
  381. maintained only at the TIP site. The accounting server merely
  382. echoes the sequence number it has received as part of the data.
  383.  
  384. 6. There are, however, some constraints on the size of the
  385. sequence number field. It must be large enough so that ALL traces
  386. of the previous use of a given sequence number are totally reMoved
  387. from the network before the number is re-used by the TIP. The
  388. sequence number is modulo the size of the largest number represented
  389. by the number of bits allocated, and is cyclic. Problems generally
  390. arise when a host proceeds from a service interruption while it was
  391. holding on to a reply. If during the service interruption, we have
  392. cycled through our sequence numbers exactly N times (where N is any
  393. integer), this VERY tardy reply could be mistaken for a reply to the
  394. new data, which has the same sequence number (i.e. N revolutions of
  395. sequence numbers later). By utilizing a sufficiently large sequence
  396. number field (16 bits), and by allowing sufficient time between
  397. instances of sending new data, we can effectively reduce the
  398. probability of such an error to zero.
  399.  
  400. 7. Since the data involved in this problem is the source of
  401. accounting information, care must be taken to avoid duplicate
  402. entries. This must be done at the expense of potentially losing
  403. data in certain instances. Other than the obvious TIP malfunction,
  404. there are two known ways of losing data. One is the situation where
  405. no accounting server responds to a TIP for an extended period of
  406. time causing the TIP counters to overflow (highly unlikely if there
  407. are sufficient Accounting Servers). In this case, the TIP can hold
  408. the counters at their maximum value until a server comes up, thereby
  409. keeping the lost accounting data at its minimum. The other
  410. situation results from adapting the protocol to our insistence on no
  411. duplicate data in the incremental files. We are vulnerable to data
  412. loss with no recourse from the time the server receives the "go
  413. ahead" to update the file with the buffered data (i.e. positive
  414. acknowledgement) until the time the update is completed and the file
  415. is closed. An accounting server crash during this period will cause
  416. that accounting data to be lost. In our initial implementation, we
  417. have slightly extended this period of vulnerability in order to save
  418. the TIP from having to buffer the acknowledged data for a short
  419. period of time. By updating TIP counters from the returned data in
  420. parallel with sending the "go ahead" acknowledgement, we relieve the
  421. TIP of the burden of buffering this data until the Request for Next
  422. Message (RFNM) from the accounting server IMP is received. This
  423. adds slightly to our period of vulnerability to malfunction, moving
  424. the beginning of the period from the point when the ACTSER host
  425. receives the "go ahead", back to the point when the TIP sends off
  426.  
  427.                                       -8-
  428.  
  429. the "go ahead" (i.e. a period of one network transit time plus some
  430. IMP processing time). However, loss of data in this period is
  431. detectable through the Host Dead or Incomplete Transmission return
  432. in place of the RFNM. We intend to record such occurrences with the
  433.  
  434. Network Control Center. If this data loss becomes intolerable, the
  435. TIP program will be modified to await the RFNM for the positive
  436. acknowledgement before updating its counters. In such a case, if
  437. the RFNM does not come, the TIP can discard the buffered data and
  438. re-transmit new data to other servers.
  439.  
  440. 8. There is adequate protection against the entry of forged data
  441. into the intermediate accounting files. This is primarily due to
  442. the system enforced limited access to Host-Imp messages and
  443. Host-Host links. In addition, messages received on such designated
  444. limited access links can be easily verified as coming from a TIP.
  445. The IMP subnet appends the signature (address) of the sending host
  446. to all of its messages, so there can be no forging. The Accounting
  447. Server is in a position to check if the source of the message is in
  448. fact a TIP data generator.
  449.  
  450.  
  451. Current Parameters of the Protocol
  452.  
  453.  
  454. In the initial implementation, the TIP sends its accumulated
  455. accounting data about once every half hour. If it gets no positive
  456. acknowledgement, it tries to send with greater frequency (about
  457. every 5 minutes) until it finally succeeds. It can then return to
  458. the normal waiting period. (A TIP user logout introduces an
  459. exception to this behavior. In order to re-use the TIP port and its
  460. associated counters as soon as possible, a user terminating his TIP
  461. session causes the accounting data to be sent immediately).
  462. initially, our implementation calls for each TIP to remember a
  463. "favored" accounting server. At the wait period expiration, the TIP
  464. will try to deposit the data at its "favored" site. If successful
  465. within a short timeout period, this site remains the favored site,
  466. and the wait interval is reset. If unsuccessful within the short
  467. timeout, the data can be sent to all servers*. The one replying
  468. first will update its file with the data and also become the
  469. "favored" server for this TIP. With these parameters, a host would
  470. have to undergo a proceedable service interruption of more than a
  471. year in order for the potential sequence number problem outlined in
  472. (6) above to occur.
  473.  
  474.  
  475. Concluding Remarks
  476.  
  477.  
  478. When the implementation is complete, we will have a general
  479. data accumulation and collection system which can be used to gather
  480. a wide variety of information. The protocol as outlined is geared
  481. to gathering data which is either independent of the previously
  482. accumulated data items (e.g. recording names), or data which
  483. adheres to a commutative relationship (e.g. counting). This is a
  484.  
  485.                                       -9-
  486.  
  487. consequence of the policy of retransmission of different versions of
  488. the data to different potential collectors (to relieve TIP buffering
  489. problems).
  490.  
  491. In the specified version of the protocol, care was taken to
  492. avoid duplicate data entries, at the cost of possibly losing some
  493. data through collector malfunction. Data collection problems which
  494. require avoiding such loss (at the cost of possible duplication of
  495. some data items) can easily be accommodated with a slight adjustment
  496. to the protocol. Collected data which does not adhere to the
  497. commutative relationship indicated above, can also be handled by
  498. utilizing more buffer space at the data generator sites.
  499.  
  500.  
  501. The sequence number can be incremented for this new set of data
  502. messages, and the new data can also be sent to the slow host. In
  503. this way we won't be giving the tardy response from the old favored
  504. host unfair advantage in determining which server can respond most
  505. quickly. If there is no reply to this series of messages, the TIP
  506. can continue to resend the new data. However, the sequence number
  507. should not be incremented, since no reply was received, and since
  508. indiscriminate incrementing of the sequence number increases the
  509. chance of recycling during the lifetime of a message.
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.                                      -10-
  544.