Hello.
I am looking for a fast and reliable protocol for streaming big amount of small text data in real time (text strings might be between 20 and maybe 500 bytes long).
I do not care about order and when they arrive, i care just to get them to my server (100% delivery). I will have like almost 100 endpoints sending to one big server, so it will have heavy traffic.
I don't look for TCP as it is not connection-less and it might be heavy for the network, has large header.
I was thinking about using UDP but I saw that I loose some packets, sometimes even 1%+, which is not acceptable. I already did some testing.
I am also implemented KCP but i don't know if this is the right solution. I am still doing tests.
The implementation has to be compatible with C and Node.JS as i will run my app in different environments.
What do you recommend?
Thank you.

"Overview. kcp is a Kubernetes-like control plane focusing on: A control plane for many independent, isolated “clusters” known as workspaces."

Sorry but that's the first hit on Google. I don't see how this applies here.

commented: i am talking about this +0

Recently I found KCP, https://github.com/skywind3000/kcp/tree/master

From my benchmarks, the results are quite fascinating.

TEST C1 - for 120 minutes with UDP
    SERVER :
        10638635 packets captured
        10638635 packets received by filter
        0 packets dropped by kernel
        1.3G    server.pcap

        cat output.log | grep BEGIN | wc -l
        10637462
        only 3129 lost

    CLIENT:
        10640591 packets captured
        10640591 packets received by filter
        0 packets dropped by kernel
        1.3G    client.pcap
        only 1956 packets lost

        cat output.log | grep BEGIN | wc -l
        10640591



TEST C2 - for 120 minutes with KCP
    SERVER:
        cat output.log | grep BEGIN | wc -l
        13250431
        -- all data is transfered

        795172 packets captured
        795172 packets received by filter
        0 packets dropped by kernel
        990M    server.pcap
        -- no packet lost

    CLIENT:
        cat output.log | grep BEGIN | wc -l
        13250431
        -- all data is transfered

        795172 packets captured
        795172 packets received by filter
        0 packets dropped by kernel
        990M    client.pcap
        -- no packet lost

KCP advantage over simple UDP:

  • 1.3G - 990M = 310MB less data over the network
  • got 2.611.796 more data in same amount of time (24.55% more data transferred)
  • send all the data with 9.843.463 less packets sent packets over the network (you will send only 7.47% packets, +10 times better)

HTTP Live Streaming (HLS) ...
Dynamic Adaptive Streaming over HTTP (MPEG-DASH) ...
WebRTC. ...
Secure Reliable Transport (SRT) ...
Real-Time Messaging Protocol (RTMP) ...
Real-Time Streaming Protocol (RTSP) ...
Transmission Control Protocol (TCP) ...
User Datagram Protocol (UDP)

In today's digital age, YouTube has become a powerful platform for individuals and businesses alike to showcase their talent, products, and services. With millions of active users and countless videos being uploaded every day, it can be challenging to stand out from the crowd. That's where "Famups" comes in. As a trusted brand in the industry, "Famups" offers a reliable solution to help you gain more visibility and credibility on YouTube by allowing you to buy YouTube subscribers.

For streaming text, WebSocket is a fast and reliable protocol. It enables real-time, bidirectional communication with low latency, making it ideal for continuous, efficient text streaming and interactive applications.

For streaming text, the Transmission Control Protocol (TCP) is often used because it is reliable, ensuring that data packets are delivered in order and without loss. However, if speed is more critical than reliability (such as in real-time applications), User Datagram Protocol (UDP) can be used, possibly with custom error-checking and correction mechanisms. For a balance between speed and reliability, QUIC (Quick UDP Internet Connections) is a modern protocol that combines the benefits of both TCP and UDP and is optimized for faster, reliable transport, making it a great choice for streaming applications.

QUIC is the preferred transport protocol for quickly and reliably streaming text, optimized for low-latency communication.

For fast and reliable text streaming, I recommend HTTP/2. It offers low latency, multiplexing, and efficient data transmission.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.