FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-17-2010, 10:05 AM
Jure Pečar
 
Default udp stream multiply

Hello,

Not strictly a CentOS question, but I hope someone can hint me in the right direction ...

I have an incoming udp data stream to public interface that I want to duplicate and multipy to three or more destinations on the internal interface.

Currently I've managed to put together netcat listener with output to pipe and socat reading from that pipe to a single destination. I hoped I could have more than one socat reader from the pipe, but that does not seem to be the case. So I'm able to only redirect stream to a single destination on lan.

I'd also like to avoid this mess of shell tools and pipes and am looking for a cleaner solution.

Any hints?


--

Jure Pečar
http://jure.pecar.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 10:36 AM
Nicolas Thierry-Mieg
 
Default udp stream multiply

Jure Pečar wrote:
> I have an incoming udp data stream to public interface that I want to
> duplicate and multipy to three or more destinations on the internal
> interface.
>
> Currently I've managed to put together netcat listener with output to
> pipe and socat reading from that pipe to a single destination. I
> hoped I could have more than one socat reader from the pipe, but that
> does not seem to be the case. So I'm able to only redirect stream to
> a single destination on lan.
>
> I'd also like to avoid this mess of shell tools and pipes and am
> looking for a cleaner solution.
>
> Any hints?

if you control the app on the destinations, you could use multicast?
Otherwise maybe broadcast on your LAN, all interested clients can pick
up the packets.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 10:41 AM
"Simon Billis"
 
Default udp stream multiply

Jure Pečar sent a missive on 2010-02-17:

>
> Hello,
>
> Not strictly a CentOS question, but I hope someone can hint me in the
> right direction ...
>
> I have an incoming udp data stream to public interface that I want to
> duplicate and multipy to three or more destinations on the internal
> interface.
>
> Currently I've managed to put together netcat listener with output to
> pipe and socat reading from that pipe to a single destination. I hoped
> I could have more than one socat reader from the pipe, but that does
> not seem to be the case. So I'm able to only redirect stream to a
> single destination on lan.
>
> I'd also like to avoid this mess of shell tools and pipes and am
> looking for a cleaner solution.
>
> Any hints?
>
>

Perhaps retransmitting to a multicast address?




_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 12:16 PM
Jure Pečar
 
Default udp stream multiply

On Wed, 17 Feb 2010 12:36:33 +0100
Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg@imag.fr> wrote:

> if you control the app on the destinations, you could use multicast?
> Otherwise maybe broadcast on your LAN, all interested clients can pick
> up the packets.

Yes, these are the options, but what if I'm limited to unicasts? How do I take one packet, clone it into three, change destination address and send them out?

--

Jure Pečar
http://jure.pecar.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 12:35 PM
Les Mikesell
 
Default udp stream multiply

Jure Pečar wrote:
> On Wed, 17 Feb 2010 12:36:33 +0100
> Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg@imag.fr> wrote:
>
>> if you control the app on the destinations, you could use multicast?
>> Otherwise maybe broadcast on your LAN, all interested clients can pick
>> up the packets.
>
> Yes, these are the options, but what if I'm limited to unicasts? How do I take one packet, clone it into three, change destination address and send them out?

I don't think there is a generic tool for that, but it would be fairly simple to
write a C program to do exactly what you want. If it is something like a video
or audio stream you might get vlc (videolan client) to receive and convert to
multicast.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 01:55 PM
Jure Pečar
 
Default udp stream multiply

On Wed, 17 Feb 2010 07:35:46 -0600
Les Mikesell <lesmikesell@gmail.com> wrote:

> I don't think there is a generic tool for that, but it would be fairly simple to
> write a C program to do exactly what you want. If it is something like a video
> or audio stream you might get vlc (videolan client) to receive and convert to
> multicast.

Ok, seems like the right time to dust off my C skillz and learn some socket & network programming


--

Jure Pečar
http://jure.pecar.org
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 03:12 PM
Les Mikesell
 
Default udp stream multiply

On 2/17/2010 8:55 AM, Jure Pečar wrote:
> On Wed, 17 Feb 2010 07:35:46 -0600
> Les Mikesell<lesmikesell@gmail.com> wrote:
>
>> I don't think there is a generic tool for that, but it would be fairly simple to
>> write a C program to do exactly what you want. If it is something like a video
>> or audio stream you might get vlc (videolan client) to receive and convert to
>> multicast.
>
> Ok, seems like the right time to dust off my C skillz and learn some socket& network programming

I'd cheat and start with the netcat source. Since it's udp you don't
have to wait for the receiver - just open multiple output sockets and
write to them like it already does with one.

--
Les Mikesell
lesmikesell@gmail.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 05:32 PM
John R Pierce
 
Default udp stream multiply

Jure Pečar wrote:
> On Wed, 17 Feb 2010 07:35:46 -0600
> Les Mikesell <lesmikesell@gmail.com> wrote:
>
>
>> I don't think there is a generic tool for that, but it would be fairly simple to
>> write a C program to do exactly what you want. If it is something like a video
>> or audio stream you might get vlc (videolan client) to receive and convert to
>> multicast.
>>
>
> Ok, seems like the right time to dust off my C skillz and learn some socket & network programming
>

probably be pretty easy in perl or python...

perhaps start with this,
http://perldoc.perl.org/perlipc.html#UDP%3a-Message-Passing
and turn it around so its listening for one UDP socket coming in, and
sending it to however many destinations you need.



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-17-2010, 11:37 PM
Philip Manuel
 
Default udp stream multiply

Les Mikesell wrote:
> Jure Pečar wrote:
>
>> On Wed, 17 Feb 2010 12:36:33 +0100
>> Nicolas Thierry-Mieg <Nicolas.Thierry-Mieg@imag.fr> wrote:
>>
>>
>>> if you control the app on the destinations, you could use multicast?
>>> Otherwise maybe broadcast on your LAN, all interested clients can pick
>>> up the packets.
>>>
>> Yes, these are the options, but what if I'm limited to unicasts? How do I take one packet, clone it into three, change destination address and send them out?
>>
>
> I don't think there is a generic tool for that, but it would be fairly simple to
> write a C program to do exactly what you want. If it is something like a video
> or audio stream you might get vlc (videolan client) to receive and convert to
> multicast.
>
>
If speed wasn't an issue couldn't you use socat, tee, pipes and fifo's
and socat again to rebroadcast it ? i.e socat as the listener redirect
to a fifo, have cat or socat as a listener to rebroadcast , use tee to
send to another fifo and another socat instance to send to another
host. Horrible I know but feasible.


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-18-2010, 01:20 AM
Les Mikesell
 
Default udp stream multiply

Philip Manuel wrote:
>
>>>> if you control the app on the destinations, you could use multicast?
>>>> Otherwise maybe broadcast on your LAN, all interested clients can pick
>>>> up the packets.
>>>>
>>> Yes, these are the options, but what if I'm limited to unicasts? How do I take one packet, clone it into three, change destination address and send them out?
>>>
>> I don't think there is a generic tool for that, but it would be fairly simple to
>> write a C program to do exactly what you want. If it is something like a video
>> or audio stream you might get vlc (videolan client) to receive and convert to
>> multicast.
>>
>>
> If speed wasn't an issue couldn't you use socat, tee, pipes and fifo's
> and socat again to rebroadcast it ? i.e socat as the listener redirect
> to a fifo, have cat or socat as a listener to rebroadcast , use tee to
> send to another fifo and another socat instance to send to another
> host. Horrible I know but feasible.

Maybe - but but I'd expect tee to run buffered and you probably need to preserve
the packet boundaries instead of just sending the stream. It might work to tell
netcat to forward to a multicast group address if the end points can listen
appropriately.

--
Les Mikesell
lesmikesell@gmail.com

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 05:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org