Title:

Serial Number Arithmetic

Home
Publication List
deutsch
  
ISBN: 3423050012   ISBN: 3423050012   ISBN: 3423050012   ISBN: 3423050012 
 
|<< First     < Previous     Index     Next >     Last >>|
  Wir empfehlen:       
 

5. Examples

5.1. A trivial example

The simplest meaningful serial number space has SERIAL_BITS == 2. In this space, the integers that make up the serial number space are 0, 1, 2, and 3. That is, 3 == 2^SERIAL_BITS - 1.

In this space, the largest integer that it is meaningful to add to a sequence number is 2^(SERIAL_BITS - 1) - 1, or 1.

Then, as defined 0+1 == 1, 1+1 == 2, 2+1 == 3, and 3+1 == 0. Further, 1 > 0, 2 > 1, 3 > 2, and 0 > 3. It is undefined whether 2 > 0 or 0 > 2, and whether 1 > 3 or 3 > 1.

5.2. A slightly larger example

Consider the case where SERIAL_BITS == 8. In this space the integers that make up the serial number space are 0, 1, 2, ... 254, 255. 255 == 2^SERIAL_BITS - 1.

In this space, the largest integer that it is meaningful to add to a sequence number is 2^(SERIAL_BITS - 1) - 1, or 127.

Addition is as expected in this space, for example: 255+1 == 0, 100+100 == 200, and 200+100 == 44.

Comparison is more interesting, 1 > 0, 44 > 0, 100 > 0, 100 > 44, 200 > 100, 255 > 200, 0 > 255, 100 > 255, 0 > 200, and 44 > 200.

Note that 100+100 > 100, but that (100+100)+100 < 100. Incrementing a serial number can cause it to become "smaller". Of course, incrementing by a smaller number will allow many more increments to be made before this occurs. However this is always something to be aware of, it can cause surprising errors, or be useful as it is the only defined way to actually cause a serial number to decrease.

The pairs of values 0 and 128, 1 and 129, 2 and 130, etc, to 127 and 255 are not equal, but in each pair, neither number is defined as being greater than, or less than, the other.

It could be defined (arbitrarily) that 128 > 0, 129 > 1, 130 > 2, ..., 255 > 127, by changing the comparison operator definitions, as mentioned above. However note that that would cause 255 > 127, while (255 + 1) < (127 + 1), as 0 < 128. Such a definition, apart from being arbitrary, would also be more costly to implement.

6. Citation

As this defined arithmetic may be useful for purposes other than for the DNS serial number, it may be referenced as Serial Number Arithmetic from RFC1982. Any such reference shall be taken as implying that the rules of sections 2 to 5 of this document apply to the stated values.

7. The DNS SOA serial number

The serial number in the DNS SOA Resource Record is a Serial Number as defined above, with SERIAL_BITS being 32. That is, the serial number is a non negative integer with values taken from the range [0 .. 4294967295]. That is, a 32 bit unsigned integer.

The maximum defined increment is 2147483647 (2^31 - 1).

Care should be taken that the serial number not be incremented, in one or more steps, by more than this maximum within the period given by the value of SOA.expire. Doing so may leave some secondary servers with out of date copies of the zone, but with a serial number "greater" than that of the primary server. Of course, special circumstances may require this rule be set aside, for example, when the serial number needs to be set lower for some reason. If this must be done, then take special care to verify that ALL servers have correctly succeeded in following the primary server's serial number changes, at each step.

Note that each, and every, increment to the serial number must be treated as the start of a new sequence of increments for this purpose, as well as being the continuation of all previous sequences started within the period specified by SOA.expire.

Caution should also be exercised before causing the serial number to be set to the value zero. While this value is not in any way special in serial number arithmetic, or to the DNS SOA serial number, many DNS implementations have incorrectly treated zero as a special case, with special properties, and unusual behaviour may be expected if zero is used as a DNS SOA serial number.

  
Bürgerliches Gesetzbuch BGB
von Helmut Köhler
Siehe auch:
Handelsgesetzbuch HGB: ohne Seehandelsrech...
Arbeitsgesetze
Grundgesetz GG: Menschenrechtskonvention, Europäischer Gerichtsh...
Strafgesetzbuch StGB
Aktiengesetz · GmbH-Gesetz: mit Umwandlungsgesetz, Wertpapiererw...
Zivilprozeßordnung. ZPO
 
   
 
     
|<< First     < Previous     Index     Next >     Last >>| 

Back to the topic site:
ScientificPublication.com/Startseite/Informatik/Spezifikationen

External Links to this site are permitted without prior consent.

Publication List:
Serial Number Arithmetic
   
  Home  |  deutsch  |  Set bookmark  |  Send a friend a link  |  Impressum