Skip to main content

reactive-uart2ip

Application that works as a "bridge" between the Sancus FPGA (through UART) and an external client using TCP/IP. This is implemented with the specific purpose to handle Authentic Execution messages, hence this application is not "general purpose", but strongly dependent to the Sancus application running inside the FPGA.

Installation

# Install reactive-uart2ip - you must be in the root of this repository
pip install .

# run reactive-uart2ip
### <loglevel>: log level, e.g., "debug". Default "info"
### <device>: UART device. Default "/dev/ttyUSB1"
### <port>: port used by the app to listen for TCP connections
reactive-uart2ip -l <loglevel> -d <device> -p <port>

Run reactive-uart2ip with Docker

# Run the reactive-uart2ip Docker image
### <loglevel>, <device> and <port> are the same as above
make run LOG=<loglevel> DEVICE=<device> PORT=<port>

How it works

The application is implemented using asyncio tasks.

Serial task

A first task reads for messages from the serial communication.

  • The messages can either be commands or results (see reactive-net)
  • A Command received from the device is immediately sent to the destination (ip and port are received as well), and there is no response.
    • Sancus only sends RemoteOutput commands
  • A Result of a command previously sent to the device is added to a queue, where the task of the TCP connection that has sent the command will retrieve and send back to the client.

TCP/IP tasks

For each new TCP connection, an asynchronous task is created, but only one task at a time uses the UART (by means of a lock).

  • Each TCP connection has the purpose to send a command to the device. If the command expects a result, the task will wait until it is received (without releasing the lock). A timeout is set to avoid endless wait of other tasks, but this should never happen in a normal situation.
  • Before starting the transmission of the data, a handshake is performed. This is necessary to "wake up" the device, in order not to lose bytes during the transmission. The handshake consists on the exchange of one single dummy byte between the application and the FPGA.
  • Since the FPGA has a RX buffer limited to 127 bytes, we need to split large packets in several chunks. In order not to lose any bytes, the FPGA sends an ACK byte after each chunk received. The application, after sending the chunk, waits for the ACK, and after that continues the transmission.

Metadata

Release files for reactive-uart2ip 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reactive-uart2ip 0.2.1
File Size Uploaded Provenance Actions
reactive-uart2ip-0.2.1.tar.gz 5.9 kB Without provenance Details for reactive-uart2ip-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reactive-uart2ip 0.2.1
File Interpreter ABI Platform Actions
reactive_uart2ip-0.2.1-py3-none-any.whl Python 3 none any Details for reactive_uart2ip-0.2.1-py3-none-any.whl

Total release size: 13.9 kB

Release files / reactive-uart2ip-0.2.1.tar.gz

Download URL reactive-uart2ip-0.2.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
151c04a010a1837e5629d2a8c2ddf8a0f7e5a14bf1729245e2572b40c584b1b3
BLAKE2b-256 checksum
How to use checksums
fb2495e24d732bd6bbb9e524fe38f2f10113f9766558c7be37219c063e74aa5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / reactive_uart2ip-0.2.1-py3-none-any.whl

Download URL reactive_uart2ip-0.2.1-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe21dfc6b3a956928c74723519cb81cd6265d49d4fedb7bc3e30f64c3b37f267
BLAKE2b-256 checksum
How to use checksums
d9d4acd1779c098232e606f475c15ccb39f9784c9157e6695698a8b0183378c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Security for reactive-uart2ip 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page