Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to duplicate an RTP stream over two different (non-reliable) Internet connections.

On the receiver side, I will probably run a custom program that will use a buffer and rebuild the stream before using it.

But I have some trouble in splitting the traffic over the two connections. I did some research and found that maybe tc (part of iproute2) could be what I need.

Can anyone help me?

share|improve this question
    
@Gilles seems like the way to go, your comment should be an answer, so that I can accept it. –  Andrea Spadaccini Apr 4 '11 at 12:25
    
See also Copying packets from an interface to another –  Gilles Apr 4 '11 at 20:16
add comment

3 Answers

up vote 2 down vote accepted

The Linux kernel version 2.6.35 introduces a new configuration option CONFIG_NETFILTER_XT_TARGET_TEE:

This option adds a "TEE" target with which a packet can be cloned and this clone be rerouted to another nexthop.

Iptables supports the -j TEE target since 1.4.8.

Earlier support was through the xtables addons, which include both kernel modules and userland tools. You may still prefer this option if you prefer to stick with your distribution's kernel and it's too old to have TEE.

There's a tutorial by bjou (written before the feature was included in the official kernel and iptables).

share|improve this answer
    
+1 thank you, it's what I need! –  Andrea Spadaccini Apr 4 '11 at 20:28
    
Webpage with tutorial requires password :( –  L.R. Sep 12 '13 at 2:39
add comment

The network protocol stack is designed to limit duplication.

You may be better off tunneling over TCP. Otherwise you will likely need to build your own program to duplicate your output. How unreliable are your connections. Mine are usually well over 99.9% reliable.

share|improve this answer
    
It is a mobility scenario: a mobile user uses two different network providers, so that the same data goes to the receiver in the event that one (or the other) has no signal. I'd avoid TCP if possible. Thanks! –  Andrea Spadaccini Apr 1 '11 at 15:08
    
@Andrea: I would configure the mobile users system to connect using whichever connection is up. This would eliminate the duplication issue. –  BillThor Apr 1 '11 at 15:18
    
I need to do evaluation of different strategies, duplication is just one of them. :) –  Andrea Spadaccini Apr 1 '11 at 15:37
add comment

Perhaps a packet sniffing package such as scapy can help you. I recently used it to intercept packets and modify their headers. It essentially amounts to creating a new program as BillThor suggested, but I found scapy very easy to use. While this may not be the best package of its kind, maybe something similar will suit your needs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.