Extended rings - ShadowJonathan/ByteCart GitHub Wiki
Abstract
An extended ring, or ExtRing, is an extension of a ring leading to a group of stations. It allows an economy of time and material to build the railroad, since the main ring can be optimized to go straight from one router to another, leaving extended rings to manage local distribution.
Definition
An ExtRing is a subset of a ring or another ExtRing. An ExtRing can hold from 2 to 255 stations (taken from its parent ring or parent ExtRing). Traffic on an ExtRing is limited to traffic coming from or going to the stations in the ExtRing. A cart crossing a ring from a router to another router will not enter an ExtRing.
ExtRings are rings that must be plugged in the main ring or in another ExtRing. ExtRings must not break the infinite loop rule that defines a ring, i.e. carts must still run in a infinite loop that includes the main ring.
You must use exactly one sign to plug an ExtRing in the main ring or in another ExtRing:
- BC9002 creates a 2-station ExtRing
- BC9004 creates a 4-station ExtRing
- BC9008 creates a 8-station ExtRing
- BC9016 creates a 16-station ExtRing
- BC9032 creates a 32-station ExtRing
- BC9064 creates a 64-station ExtRing
- BC9128 creates a 128-station ExtRing
A second sign of the same type is used to close the ExtRing and provide anticollision feature.
In our exemple, to create a 4-station ExtRing, we would put 2 BC9004 signs under the intersection: one for input, one for output.
You can nest an ExtRing in another ExtRing providing that the nested ExtRing is smaller than the parent ExtRing. For example, you can plug a 2-station ExtRing in a 4-station ExtRing, but the inverse is not true. Nesting ExtRings does not add stations : A 2-station ExtRing nested in a 4-station ExtRing gives 4 stations, with 2 stations in the 2-station nested ExtRing and 2 stations in the 4-station ExtRing.
bcupdater command does not include the (unavailable) station 0 in ExtRings, leaving only 254 stations reachable. As a consequence of this, bcupdater does not include station 1 in an ExtRing. Another consequence is that there is only one 8-station, three 4-station, seven 2-station ExtRings, etc. in a ring configured by bcupdater. The reason for this is that the first ExtRing has 1 station removed: the first 8-station ExtRing becomes a 7-station ExtRing that is removed from bcupdater ExtRing mapping.
If you want use station 1 in an ExtRing, then you must configure it manually. bcupdater will not erase your manual configuration if it is consistent with ExtRing mapping.
Remember that a ring (including ExtRings) can not contain more than 255 stations (plus the unavailable station 0). ExtRing count for their respective amount of address available, even if there is no station built. If you have a 128-station ExtRing, you have only 128 address left in the main ring.
Additional intersection
There are some cases where you want to access another ring from the current ExtRing without going through a router or getting out from the ExtRing by the main output. In this case, you must not use another pair of BC9XXX signs except if you do not use the bcupdater tool.
The solution here is to mimic the behaviour of the BC9XXX sign with a BC9037 (to enter the ExtRing) and a BC9137 (to exit the ExtRing or make U turn). These signs are transparent for the configuration process and will route the updater cart as if the intersection does not exist.
Remember that a single pair of BC9XXX signs must be put at the main access of the ExtRing.
Example
Here is how a ring could look when you use extended rings. bcupdater command will attribute station and subnet numbers, so you don't have to manage them. There is still some address left for other stations, since we do not use all the 255 stations available in a single ring.
In this example there is a 2-station ExtRing, and a 4-station ExtRing with a 2-station nested ExtRing. Each intersection use anti-collision as described in BC9000
Best practice
When designing you physical network, identify groups of stations that could be addressed together. Instead of having all theses stations directly plugged in your main ring, you can put an ExtRing sign to extract carts going to these stations to dispatch them locally.
Using ExtRings, you will save material and travel time, since ExtRing can relieve the main ring of distributing traffic individually, allowing non-local traffic to cross the ring more efficiently.