Tunnel segment activation

Tunnel-Segment states

Initiation

An initiator is a duct point that starts the creation of a new tunnel. These are typically of mode Server or ReverseClient types of duct points, and they are the first duct point in the tunnel definition (JSON). Initiation is an ongoing role that spawns new activation. A non-existent tunnel is in the conceptual initiation stage on a given host before activation has begun.

Activation

This is the period of time that a tunnel is being built with processes, and encapsulation. There is an activation cycle (see below) that runs through configured duct-points. Interconnection is always the final step of activation before the tunnel is operational.

Operational

When this tunnel state is reached, application software may begin to communicate through the tunnel as if the remote endpoint was local. At this stage, only processes from protocol encapsulation are active. The processes within encapsulation may be quite complex and even involve dynamic behaviour, but are most easily perceived as a simple static protocol stack and route.

Disposal

Any disruption to a tunnel will cause it to fail fast. A disruption will usually begin on a single host, and can be caused by a network error, or an error in a duct encapsulated protocol. Failure on the host will result in error logging, then controlled disposal of each duct before the tunnel resource itself is removed from memory. Each duct may perform some cleanup local work during disposal. At either end of a tunnel-segment on a host, there is typically a network interface; disposal of such a duct will result in a disconnection message being sent out to peers. So, after a tunnel has been disposed on a single host, other hosts linked to the same tunnel may receive the disconnection and cascade the disposal. If a controlled disconnection message isn't recieved, then tunnel peers will fail and dispose based on timeout conditions within one of the ducts.

The two activation phases

Diagram
JSON
Activation phases
"TEST-PC VNC": {
"TCP-Server": "testhost.local:5900",
"AES-Encryption-Client":"R08FGx2lnCUzL8olm",
"Meet-Subscriber": "TEST-PC",
"TCP-Client": "192.168.90.1:3000"
}

As you can see in the visual diagram above, activation occurs in two specific phases, top-down, then bottom-up. Each configured duct-point can perform some processing on the way down and also on the way up, but typically only one or the other, not on both activation phases.

In the example above, the first duct-point, TCP-Server, participates on the way down being the initiator - a new tunnel starts when a new client has connected. The remaining 3 duct-points are bypassed during the top down activation phase. On the bottom-up phase, the 3 duct-points participate.

With both phases of the activation cycle, it's possible to build any kind of tunnel and encapsulate as needed.

In the Getting-Started guide, you can see the visualisation of different kinds of configurations.

Encapsulation

Diagram
JSON
Encapsulation and Interconnection
"TEST-PC VNC": {
"TCP-Server": "testhost.local:5900",
"AES-Encryption-Client":"R08FGx2lnCUzL8olm",
"Meet-Subscriber": "TEST-PC",
"TCP-Client": "192.168.90.1:3000"
}

Encapsulation tightly follows the way a duct-point participates with the activation phase. For example, in the activation and encapsulation diagrams above, the AES-Encryption-Client duct-point encapsulates downstream, therefore, it needs to internally activate during the bottom-up activation phase.

After activation, some duct points may not participate anymore. For example, in the encapsulation diagram above you can see that the meet-subscriber duct-type is only used during activation but it doesn't encapsulate. The Meet-Subscriber helps to add context to an initiating tunnel, but does not provide encapsulation once the tunnel is operational.

Interconnection

Encapsulation and Interconnection

At either end of a node tunnel configuration, there are ultimately two ends of a tunnel protocol that need to interconnect.

In the encapsulation diagram above, you can see where interconnection occurs pictured with connecting lines with diamond ends.

A special kind of interconnection exists, where two tunnel-segments are interconnected. The meet-point is a duct which interconnects in this way. Two separate tunnel-segments are activated, and when they are correlated by topic, the ducts are moved from one tunnel-segment into the other, the empty tunnel-segment is disposed.