News for hackers. Stuff that matters.
Re:NoTCP by kstrauser on Wednesday April 29, 2015 @02:15PM (#9460458)
I couldn't agree more. TCP is wonderful when you need it, but you very often don't need it (and pay a heavy price for features you don't need).

I wouldn't want to write HTTP over UDP, but neither would I want to send telemetry data ('{"timestamp":343821902, "value": 43}') over TCP. UDP is brilliant for systems where you're more concerned about tracking the current state of things than accurately replaying the last n set of transactions.

Re:NoTCP by mholt on Wednesday April 29, 2015 @02:25PM (#9460547)
Well, there's QUIC, which serves HTTP over UDP. But I see your point, and you're correct. TCP and UDP have different advantages (at least for now).
Re:NoTCP by dtech on Thursday April 30, 2015 @03:51AM (#9463787)
However, QUIC provides a lot of the features TCP has but very fine-tuned for HTTP.

This is fine, HTTP is probably the largest layer 7 protocol on the internet, but if you were to design a layer 7 protocol that needed a lot of the features that TCP provides it would be quite dump to reimplement them yourself on top of UDP.

Re:NoTCP by lechuga on Wednesday April 29, 2015 @02:37PM (#9460651)
Disagree. In most cases you want TCP. Rarely do applications gracefully deal with loss.
Re:NoTCP by KaiserPro on Wednesday April 29, 2015 @03:53PM (#9461233)
Why you want TCP:

you care about the data, you want it to arrive in order, and you need it arrive. You want to be notified if there is a problem at the other end. You want the data sent to match exactly the data delivered.

File transfer, simple protocols, advanced critical protocols. Anything where the dev doesn't want to think about how to account for packet loss. Its already done for you in a standard interface.

Why you want UDP:

You want the latest packet of data, and you want it now. it doesn't matter if you lose a few packets. Telephony is the classic example. if you loose a frame its not the end of the world. Streaming video is another, Use FEC to cope with loss.

Tedious real world analogy:

When you send a letter or a parcel, you have two options: Send it recorded, and pay slightly more per go, but not have the worry about phoning up the recipient to see if they received it.

However if the letter is of little worth (like a flyer or something similar) then the notification and or guarantee that it has/will arrive is a pointless cost.

Re:NoTCP by lechuga on Wednesday April 29, 2015 @04:03PM (#9461310)
I'm intimately familiar with cases where you actually would prefer to use UDP. My point is most of the time these cases aren't what you're dealing with.

In addition to reliability, TCP provides congestion control which provides approximate fairness of bandwidth utilization per connection. Fairness here meaning given a limited pipe of size W each connection gets a W/N slice of the pipe's available bandwidth. I don't know that I'd like to live on an internet where every hipster made their own decision about how to handle congestion control, see also congestive collapse.

Re:NoTCP by KaiserPro on Thursday April 30, 2015 @04:56AM (#9463977)
>every hipster made their own decision about how to handle congestion control

Unless they had access to a tier 1/2 network provider it'd be mostly harmless I suspect. They'd spam their local gateway. "Look I can send 300k packets a second over standard DSL"

But yes, TCP is generally a good thing.

Re:NoTCP by dtech on Thursday April 30, 2015 @03:52AM (#9463797)
> My point is most of the time these cases aren't what you're dealing with

Which is why the "default" protocol for most things is still TCP.

Re:NoTCP by kstrauser on Wednesday April 29, 2015 @02:53PM (#9460783)
That's completely dependent on the application. SNMP over TCP would be a net loss because 1) it doesn't buy you anything as SNMP doesn't have any requirements that TCP meets above what UDP provides, 2) TCP would be exceedingly expensive, requiring connection buildup and teardown, ACKs, etc., and 3) it's way easier to implement UDP than TCP, so dumb devices basically need to only construct a single Ethernet frame to make it work.

Many, many applications deal much better with loss than they do with delayed retries. You don't want a VOIP app to perfectly recreate what the other part said 30 seconds ago, games usually only care about current state, and so on. In many of those cases, TCP is the wrong choice but a lot of people use it out of familiarity.

Remember, UDP came after TCP. One isn't "better" than the other and they serve different requirements.

Re:NoTCP by fla on Wednesday April 29, 2015 @03:21PM (#9461002)
Simple example: Player positions in a FPS.

Would you rather wait for a transmission of the missing position update 1 sec ago or just forget about it and continue processing the next one ?

In this context, you'll prefer the second option. It will probably cause a visual glitch but the game can go on, and players will say "lag" :)

Re:NoTCP by rjsw on Wednesday April 29, 2015 @04:56PM (#9461719)
Isn't that kind of use case what DCCP was designed for ?
Re:NoTCP by lechuga on Wednesday April 29, 2015 @03:59PM (#9461284)
Yes. You can show me a relative corner case. But in most cases you want TCP.
Re:NoTCP by fla on Wednesday April 29, 2015 @05:16PM (#9461857)
It's far from being a corner case. UDP is commonly used in multiplayer games to provide a channel for unreliable data.
Re:NoTCP by kstenerud on Wednesday April 29, 2015 @05:19PM (#9461876)
If you want to go with that argument, why not go all the way and say that the common case is HTTP and the corner cases are everything else?

It still won't change the fact that application needs won't always match TCP exactly. And that's the whole point.

Re:NoTCP by vacri on Thursday April 30, 2015 @03:39AM (#9463756)
IP telephony and video streaming are hardly rare applications.
Re:NoTCP by tetha on Wednesday April 29, 2015 @02:43PM (#9460702)
Interesting. I wouldn't want to shove my base monitoring data over UDP. Without my base monitoring, our product devs are blind and things go to shit. I can't risk that.

And, with a bunch of per-site monitoring frontends with batching, compression and deduplication, thrift/protobuf and long-running connections, the TCP overhead is meh.

Re:NoTCP by vidarh on Wednesday April 29, 2015 @03:10PM (#9460898)
If your network is so about to fall apart under load, or so broken due to network issues, or your servers are so overloaded that you start seeing appreciable packet loss with UDP internally at a site, then chances are the last thing you want is loading your system even more and slowing things down by retransmitting samples that are obsolete in a couple of seconds anyway....

Serious exceptions, sure, retry. But serious exceptions are rare. What's not rare is sampled memory usage, cpu usage etc..

Re:NoTCP by rkangel on Wednesday April 29, 2015 @03:19PM (#9460986)
Sure, you can't cope without monitoring. But you can absolutely cope if 1 out of 10 of each of those status updates doesn't get to you. This is the completely standard connection-oriented vs connectionless link tradeoff.