Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is zeromq the right solution for peer to peer video chat

I was wondering if my idea of zeromq is right? I was thinking of writing a peer to peer chat application using zeromq but as i read further into it zeromq seems to be more low level than what one would use (tcp sockets). Is zeromq good for writing peer to peer chat app or is this use case not applicable?

like image 489
Claire Avatar asked Jan 06 '12 01:01

Claire


People also ask

What is ZeroMQ good for?

ZeroMQ is a high-performance asynchronous messaging library, aimed at use in distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ZeroMQ system can run without a dedicated message broker.

What transports are supported by ZeroMQ?

ZeroMQ supports common messaging patterns (pub/sub, request/reply, client/server and others) over a variety of transports (TCP, in-process, inter-process, multicast, WebSocket and more), making inter-process messaging as simple as inter-thread messaging.

Why use ZeroMQ?

ZeroMQ provides a whole slew of language APIs which run on most operating systems and allows you to communicate seamlessly between all sorts of programs. It also provides a collection of patterns, such as request-reply and publish-subscribe which assist you in creating and structuring your network.

What is ZMQ socket?

ZeroMQ (also known as ØMQ, 0MQ, or zmq) looks like an embeddable networking library but acts like a concurrency framework. It gives you sockets that carry atomic messages across various transports like in-process, inter-process, TCP, and multicast.


1 Answers

Firstly, I would disagree with your statement that zeromq is more low-level than sockets. AFAICT zeromq presents an API that is similar to the socket API. However it can also handle other things such as sending messages to multiple clients with the same send call.

Secondly, your question is not very clear: what do you mean by good: Easy to write ( since you refer to low-level), reliable, efficient enough, etc? You can use anything you want, the level of implementation complexity will of course differ.

Also, you should probably use udp instead of tcp in a video chat application, since it is more important that data arrives timeously than that all data arrives, but that is a whole different topic. If you can use zeromq with udp (and you'll have to research that), I see no reason why you couldn't use it for video chat.

The main factor you need to consider is whether you can send data between the peers fast enough in order to provide an acceptable QoS: AFAIR a maximum RTT of around 300ms is perceived as ok for conversational services.

The following link applies to VOIP but should also apply to video chat reqirements:

Most callers notice round-trip delays when they exceed 250mSec, so the one-way latency budget would typically be 150 mSec. 150 mSec is also specified in ITU-T G.114 recommendation as the maximum desired one-way latency to achieve high-quality voice. Beyond that round-trip latency, callers start feeling uneasy holding a two-way conversation and usually end up talking over each other. At 500 mSec round-trip delays and beyond, phone calls are impractical, where you can almost tell a joke and have the other guy laugh after you've left the room.

like image 118
Ralf Avatar answered Sep 20 '22 06:09

Ralf