Information for Space Fleet Admirals



    Memo


    My Admiral, your fleet numbers hundreds, maybe thousands of ships. All of them act as a single organism, acting in one information field. Radio communication is used as a communication channel, or laser communication in case of operation under conditions of radio suppression (or radio silence). Most likely, Erlang is used on the ships as the basic software, and each ship is a NodeThe computing cluster of your space armada. Thanks to this, the combat programs carried out on the flagship can manage the resources of any armada ship as their own, coordinating the combat interaction. In the conditions of conducting a space battle in the vicinity of our solar system, this approach has shown high efficiency, both in testing and in real combat. However, the party poses a new task for us: to prevent the penetration of the enemy within the limits of our solar system, to detect the enemy and fight against him at distant frontiers.

    In conditions of sublight speeds and vast distances, a new enemy lies in wait for us. This time technical. This enemy’s name is “ Time Warp”) What it is and how to deal with it (using Erlang version 18 and higher) is described in this memo. The note is based on technical documentation - Time and Time Correction in Erlang .

    Single timeline


    New conditions pose engineers with new technical challenges. The coordinated work of space objects is achieved not only by network interaction, but also by accurate synchronization of clocks with time on Earth. In order for an automatic space object to follow a given program, or to act in conditions of loss of network communication, its internal clock must be synchronized with the time of the Earth. To this end, within our solar system, the government (with taxpayers' money) built and established a constellation of time synchronization satellites. Now, any automatic satellite, even in case of damage to the main batteries, under conditions of operation only directly from solar panels, is able to receive the signal from the nearest time synchronization satellite and determine the exact time.

    Why does this system not help in battle?
    1) In the new environment, we must fight outside the solar system. There are no time synchronization satellites in outer space.
    2) A combat fleet cannot and should not be dependent on civilian systems.
    3) The combat fleet cannot depend on stationary systems.
    The fleet must be completely independent and self-sufficient.

    To do this, fleet ships must independently synchronize time with each other. Most likely, all the clocks need to be synchronized with the flagship clock.

    But you will say: “Atomic clocks are installed on our cruisers, even fighter ships use clocks on rubidium reference generators, and a guided missile does not live so long that its thermally compensated crystal oscillator is mistaken for a significant value.” And you will be right. Yes, you can synchronize once before the battle. During the battle, individual ships may lose contact with the cluster, but continue to carry out combat missions in the same time scale .



    Actions in different time scales


    There are a number of reasons why a different time value can be set in ships:
    - the flagship can approach the scene through a subspace tunnel: in this case, it will instantly change its coordinates without losing synchronization with Earth time;
    - the observation satellite located in the place of events could be there for a long time without the possibility of synchronization, and due to the inaccuracy of the generator in the clock, its time can either “lag behind” the Earth’s time or “go forward”
    - middle class ships can approach relativistic effects
    - automatic ships passing near or through a supermassive black hole - can affect the place of events at sublight speeds and their clocks

    In each case, as soon as the ship appears in the radio visibility zone of the flagship, it will synchronize time, with subsequent connection to the cluster. During the synchronization process, the clock of the synchronized ship will be moved forward , or, even worse, backward . This effect is called Time Warp.



    Technical solution


    OTP 18 (ERTS version 7.0) has expanded the functionality over time. These capabilities are included in the API for working with time and with time warp , which change the behavior of systems when changing system time. The default time-lag mode is the same as the old API, which is still valid. Thus, you can not change anything if you do not want this. However, it is strongly recommended that you use the new API functions instead of the old ones, which are based on erlang: now / 0 . Currently erlang: now / 0marked deprecated because it is a scalability bottleneck. Using the new API, you automatically improve scalability and performance. You also have the opportunity to use the multi-time warp mode, which increases the accuracy of time measurements.

    Erlang platform uses not only a real-time clock, but also an internal processor clock counter. Thanks to Erlang time correction, applications are guaranteed that Erlang monotonic clocks do not have time gaps and are relatively accurate. For a complete understanding of the operation of temporary systems, please refer your engineers to the technical documentation [ 1]. It gives concepts from the new temporary API, such as: “monotonous time”, “strictly monotonous time”, UT1, UTC. POSIX Time, Time Precision, Time Resolution, Time Accuracy, Time Warp, OS System Time, OS Monotonic Time, Erlang System Time, Erlang Monotonic Time, etc. Describes how to obtain both Erlang and system time, gives instructions for updating outdated program code . Erlang team keeps up to date, welcome to the future!





    List of sources used


    1.http : //erlang.org/doc/apps/erts/time_correction.html - Time and Time Correction in Erlang

    Also popular now: