Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problem is that the retransmissions are handled by your TCP stack, which lives outside of your program. You are basically asking TCP to not be TCP at this point, so the easiest solution is to just use UDP instead.


I was viewing this with my sysadmin hat on not from a programmer perspective. So firewalls and OS TCP configuration would be within scope and sometimes you have no choice over the lower level link you have. But yes, I agree that the lesson from the article is don't do this if you don't have to but that doesn't mean I'm not interested in ways the problem could be alleviated. From other discussion, it looks like setting a high MTU on the upper layer could help.


If your problem is packet loss due to BER and retransmissions a big MTU is hugely counterproductive. You flip one bit on a 32kb frame and you've gotta resend the whole damn thing, and if you're doing TCP over TCP that retransmission might happen a dozen times or more due to the way the timers interact.

If you absolutely must do TCP over TCP the only sensible thing to do is have the outer tunnel terminate and buffer the stream internally. This is fairly memory intensive so routers won't do it, but applications can get away with it.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: