Skip to content

Commit

Permalink
Update transmitter connection procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
7h0ma5 committed Oct 10, 2019
1 parent 4c10451 commit 528f573
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
30 changes: 8 additions & 22 deletions 3_Internal_Programming_Workflows.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ \subsection{Call Service}
\item Maintains a database of all calls
\end{itemize}

The
The

\subsection{Rubric Service}
\begin{itemize}
Expand Down Expand Up @@ -247,29 +247,15 @@ \section{Transmitter Connection}
transmitter configuration and a RabbitMQ connection to receive the data to be
transmitted.

The workflow for a transmitter connection is the following:
The workflow for a new transmitter connection is the following:
\begin{enumerate}
\item Announce new connecting transmitter via Core REST Interface (\ref{protcoldef:transmitters:bootstrap}).
\item Get as response the transmitter configuration or an error message (\ref{protcoldef:transmitters:bootstrap}).
\item Initiate RabbitMQ connection to get the data to be transmitted (\ref{protocoldef:RabbitMQ:Transmitters}).
\item Announce the transmitter via a call to the REST API at \texttt{/transmitter/\_bootstrap} (\ref{protcoldef:transmitters:bootstrap}).
\item The response contains either the transmitter configuration or an error message (\ref{protcoldef:transmitters:bootstrap}).
\item On success, initiate the RabbitMQ connection to receive calls and send telemetry (\ref{protocoldef:RabbitMQ}).
\end{enumerate}

The authentication of the transmitter's REST calls consist of the transmitter
name and its AuthKey, which is checked against the value in the CouchDB for this
transmitter.

\section{Transmitter connections}
If a transmitter wants to connect to DAPNET, the first step is to sign-in and
show its presence via the Core REST interface. This interface is also used for
transmitter configuration like enabled timeslots and keep-alive polling.

\subsection{Authentication of all HTTP-Requests in this context}
All HTTP-requests issued from a transmitter have to send a valid HTTP
authentication, which is checked against the CouchDB. It consists of the
transmitter name and its AuthKey.

\todo{Da es sich bei den Anfragen um POST-Requests mit JSON Body handelt, wäre
es einfacher da den AuthKey mit dazu zu packen, so wie es auch schon in der
Protokoll-Definition umgesetzt ist.}
After the connection has been established, a periodical heartbeat must be sent
to the REST API at \texttt{/transmitter/\_heartbeat}
(\ref{protocoldef:transmitters:heartbeat}).

\section{DAPNET-Proxy}
23 changes: 10 additions & 13 deletions 6_Protocol_Definitions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,7 @@ \subsubsection{GET /transmitter/<transmittername>}

\subsubsection{POST /transmitters/\_bootstrap}
\label{protcoldef:transmitters:bootstrap}
\texttt{POST /transmitter/bootstrap}
\texttt{POST /transmitters/\_bootstrap}
\begin{lstlisting}
{
"callsign": "db0avr",
Expand All @@ -1768,16 +1768,13 @@ \subsubsection{POST /transmitters/\_bootstrap}
\textbf{Answers from the bootstrap REST call}
The application type shall be \verb|application/json|.


\todo{Was mag denn hier der Port sein?}
\texttt{200 OK}
\begin{lstlisting}
{
"timeslots": [true, true, false, true, ...],
"nodes": [
{
"host": "node1.ampr.org",
"port": 4000,
"reachable": true,
"last_seen": "2018-07-03T07:43:52.783611Z",
"response_time": 42
Expand All @@ -1802,12 +1799,12 @@ \subsubsection{POST /transmitters/\_bootstrap}


\subsubsection{POST /transmitters/\_heartbeat}
\texttt{POST /transmitter/heartbeat}
\label{protocoldef:transmitters:heartbeat}
\texttt{POST /transmitters/\_heartbeat}
\begin{lstlisting}
{
"callsign": "db0avr",
"auth_key": "<secretInCleartext>",
"ntp_synced": true
"auth_key": "<secretInCleartext>"
}
\end{lstlisting}

Expand All @@ -1821,7 +1818,7 @@ \subsubsection{POST /transmitters/\_heartbeat}
}
\end{lstlisting}

If network wants to assign new timeslots without disconnecting (for dynamic timeslots)
If network wants to assign new timeslots without disconnecting (for dynamic timeslots).

\texttt{200 OK}
\begin{lstlisting}
Expand Down Expand Up @@ -2384,7 +2381,7 @@ \subsubsection{Auth call reference list}
\newpage

\subsection{RabbitMQ Service}
\label{protocoldef:RabbitMQ}
\label{protocoldef:RabbitMQ:service}

\subsubsection{GET /rabbitmq/*}

Expand Down Expand Up @@ -3379,10 +3376,10 @@ \subsection{Transmitters}
"avatar_picture" : <couchDB attachment>,
"simplified_coverage_polygon": [34.1, -23.3, 34.1 -23.2, 34.3, -23.3],
"coverage_edges": [
[lat1, long1],
[lat2, long2],
[lat3, long3],
[lat4, long4]
[lat1, long1],
[lat2, long2],
[lat3, long3],
[lat4, long4]
]
}
\end{lstlisting}
Expand Down

0 comments on commit 528f573

Please sign in to comment.