| 1 | # Detailed technical aspects of mapping transfer formats onto data planes |
| 2 | |
| 3 | ## The transfer format |
| 4 | |
| 5 | The transfer format is a descriptor of how certain `Assets` are available for transfer. This means, the same physical |
| 6 | Asset could be available via multiple formats, e.g. HTTP, S3, Azure Blob, etc. In DCAT terms there is one `Distribution` |
| 7 | per format. |
| 8 | |
| 9 | Practically, the format conforms to the following schema: |
| 10 | |
| 11 | ```ebnf |
| 12 | format ::= DESTTYPE DASH FLOWTYPE ; |
| 13 | DESTTYPE ::= [a-zA-Z0-9] ; |
| 14 | DASH ::= "-"; |
| 15 | FLOWTYPE ::= "PUSH" | "PULL" ; |
| 16 | ``` |
| 17 | |
| 18 | The first section, the `DESTTYPE`, is arbitrary, and could be any character sequence. For example one could |
| 19 | define `SuperFastQuantumTransfer-PUSH`, so long as there is a data plane that can fulfil super-fast quantum transfers. |
| 20 | It should be noted that the _format_ is a concept that is immanent only to the control plane. |
| 21 | |
| 22 | When registering data planes with the `DataPlaneSelector`, there must be a link between the (arbitrary) format and the |
| 23 | transmission technology utilized in the data plane. The `DataPlaneSelectorService` must be able to dispatch an |
| 24 | incoming `DataRequest` to an appropriate data plane. Consequently, the format must be _mapped_ onto a data plane |
| 25 | descriptor. |
| 26 | |
| 27 | _Alternate names: catalog format, distribution format, catalog type, transfer type_ |
| 28 | |
| 29 | ## Mapping the format |
| 30 | |
| 31 | The data plane does not know anything about DCAT or `Assets`, thus the _format_ does not exist there as a concept. A |
| 32 | data plane only knows about data sources, data destinations and flow directions. (The source type is not relevant for |
| 33 | this document). |
| 34 | |
| 35 | The _format_ is mapped onto a tuple consisting of the `destType`, which is a String, and the `flowType`, which is |
| 36 | an `Enum`. This tuple is called a `DataPlaneDescriptor` as it identifies a specific data plane: |
| 37 | |
| 38 | ```java |
| 39 | public record DataPlaneDescriptor(String destinationType, FlowType direction) { |
| 40 | } |
| 41 | ``` |
| 42 | |
| 43 | This mapping is done in |
| 44 | the control plane, and it must be extensible, for example some data planes might map |
| 45 | |
| 46 | ``` |
| 47 | Http-PUSH -> destType=Http, flowType=PUSH |
| 48 | ``` |
| 49 | |
| 50 | but others might have a different format representation, that maps to the same technical transmission stack: |
| 51 | |
| 52 | ``` |
| 53 | SuperFastQuantumTransfer-PUSH -> destType=Http, flowType=PUSH |
| 54 | ``` |
| 55 | |
| 56 | from that it follows that there must be a configurable/extensible way of performing the mapping: |
| 57 | |
| 58 | ```java |
| 59 | var tokens = format.split("-"); |
| 60 | var destType = mappingRegistry.getOrDefault(token[0], tokens[0]); |
| 61 | var flowType = FlowType.parse(tokens[1]); |
| 62 | ``` |
| 63 | |
| 64 | This implies, that the mapping from format to `DataPlaneDescriptor` must be unambiguous. Ambiguity may be countered by |
| 65 | random selection. |
| 66 | |
| 67 | ## Impact on Authorization |
| 68 | |
| 69 | Authorization is only possible when the flow type is `PULL`, because only then does the provider data plane retain |
| 70 | access control. (In PUSH scenarios, the consumer data plane may use authorization, however). |
| 71 | |
| 72 | Further, token creation is dispatched based on the _destination type_, as the format does not exist as a concept in the |
| 73 | data plane. If multiple formats are are mapped to the same destination type (and thus: transmission stack), but should |
| 74 | have different auth token schemes and authorization mechanisms, _separate data planes are needed_. |
| 75 | |
| 76 | The `FlowType` will replace the `transferType` field on the `DataFlowStartMessage`. If the `flowType==PUSH` the |
| 77 | authorization is bypassed. |
| 78 | |
| 79 | ## Examples of mapped formats |
| 80 | |
| 81 | * `Http-PULL` -> `destType = Http`, just connects the streams |
| 82 | * `Http-PUSH` -> `destType = Http`, connects the streams _and_ starts the transfer |
| 83 | * `HttpAas-PUSH` -> `destType = Http` |
| 84 | * `HttpAas-PULL` -> `destType = Http` |
| 85 | * `AmazonS3-PULL` -> `destType = AmazonS3`, EDR contains bucket data plus temporary access token. Dataplane may transfer |
| 86 | data into a staging bucket. |
| 87 | * `AmazonS3-PUSH` -> `destType = AmazonS3` |
| 88 | |
| 89 | ## Data plane registration |
| 90 | |
| 91 | Several different _format_ strings could map to the same combination of `destType` and `flowType`. For example there |
| 92 | could be scenarios where the following mapping is implemented: |
| 93 | |
| 94 | ``` |
| 95 | Http-PULL -> destType=Http, flowType=PUSH //only performs basic authentication |
| 96 | HttpSecure-PULL -> destType=Http, flowType=PUSH //adds some highly secure authorization scheme |
| 97 | ``` |
| 98 | |
| 99 | When registering those data planes, the format is needed as additional parameter, to be able to distinguish between |
| 100 | them. In other words, dispatching solely based on the `DataPlaneDescriptor` may produce ambiguous results. |