pragmatically-dev / PNG2Rm-System

This repository implements a gRPC service for converting PNG files to Remarkable tablet documents. Clients can stream PNG images, which are processed and converted to .rmdoc format. The service, written in Go, receives PNG files in chunks, saves them, converts them with the drawj2d tool, and streams the resulting document back to the client
MIT License
2 stars 0 forks source link

Create a PoC using QUIC Protocol #1

Closed pragmatically-dev closed 2 months ago

pragmatically-dev commented 2 months ago

https://github.com/sssgun/grpc-quic/ https://github.com/sssgun/grpc-quic/blob/main/examples/helloworld/server/grpc_over_quic_server.go

pragmatically-dev commented 2 months ago

Migrating to HTTP/3 with QUIC can offer improvements:

  1. Reduced Latency and Improved Connection Establishment Time Fast Connection Start: HTTP/3 reduces the time needed to establish a secure connection, meaning files can begin transferring more quickly. Lower Latency: Lower latency in both connection establishment and data transfer will result in a faster and smoother user experience.

  2. More Efficient Connection Handling Quick Reconnection: If there is a network change (e.g., the user switches from Wi-Fi to mobile data), QUIC can maintain the active connection without needing to restart it, reducing interruptions during file transfer.

  3. Multiplexing Without Head-of-Line Blocking No Head-of-Line Blocking: In HTTP/2, if a packet is lost, the entire connection is blocked until the packet is recovered, which can affect file transfer. With HTTP/3, lost packets are retransmitted without blocking other data streams, improving file transfer efficiency.

  4. Improved Handling of Packet Loss Efficient Packet Loss Recovery: QUIC retransmits only the lost data, not the entire connection, reducing recovery time in case of packet loss. This is especially useful in unstable networks where packet loss is common.

  5. Simplified Deployment and Updates Easier Updates and Deployment: Operating over UDP and being managed at the application level, QUIC allows for improvements and updates without requiring changes to the operating system, facilitating infrastructure management.

  6. Better Congestion Control Advanced Congestion Control Algorithms: QUIC uses more advanced congestion control algorithms that can improve the efficiency of file transfers under varying network conditions.

  7. Built-in and Enhanced Security Integrated Security: QUIC integrates TLS 1.3, providing robust security without the need for an additional layer, simplifying configuration and enhancing the security of file transfers.

Concrete Benefits in the Context of File Transfers:

pragmatically-dev commented 2 months ago

A Modern implementation:

https://docs.libp2p.io/concepts/transports/quic/

QUIC in libp2p

libp2p only supports bidirectional streams and uses TLS 1.3 by default. Since QUIC already provides an encrypted, stream-multiplexed connection, libp2p directly uses QUIC streams, without any additional framing.

pragmatically-dev commented 2 months ago

https://discuss.libp2p.io/t/how-to-send-a-file-from-a-to-b/764/7

pragmatically-dev commented 2 months ago

Reverse proxy that supports UDP https://localxpose.io/

pragmatically-dev commented 2 months ago

After more research and with a second opinion, this might not be the best use case and it wouldn't worth the time and effort.