72 points · by taf2 · 11y ago · 20 comments
Also, all the major SIP platforms are thousands of lines of C or C++ just to parse this fucked up format. One particular popular project has almost 1M lines of C in its repo. And not a single CVE issued. Anyone taking bets on if it's more likely that there's never been an issue, or if we just don't notice? I mean, with switch statements spanning 1000+ lines, we can be sure it's top quality everywhere, right? One popular system allowed you to put shell commands in SIP headers, and it'd just go and execute them, due to ... creative[1] ... escaping and evaluation rules.
Not to mention that on every SIP network I've tested, even simple, trivial, things like IP-based auth don't actually work. It's mind-boggling. It's just that there's even lower-hanging fruit so no one bothers with remotely fun attacks.
1: Insane and terribly thought-out.
It's an interesting problem any time you are routing in an overlay network. It's probably tricky enough selecting a single optimal connection point for two clients to connect to minimize the end-to-end latency between the clients.
So the problem of "how do I route request X to user Y" has to be solved by either Google or the Provider that delivers the short message. -- Actually, with their current setup they don't even need to know where a user is located geographically, since they simply choose a proxy server by asking Route53 for a list of close servers (I presume close to the calling user) and then use their connect-then-disconnect-hack to choose the "best" server from that list.
> Instead we decided to write our own minimal signaling protocol
> and use push notifications (at first SMS, then eventually GCM when
> it was introduced) in order to initiate calls.
So I imagine you could just stick the address of the switch that was chosen by the caller into the message that gets delivered to the called device when a call is initiated.Obviously this doesn't solve the hard part of "how not to drop a call when your switch goes down mid-call" though.
In the second part they're describing TURN which is a 3rd party packet relay which you bounce your packets through when you can't directly route between two endpoints (usually because of NAT). As in, the call has been signaled, the keys exchanged, and now I just need to get packets of audio between Alice and Bob every 20ms or so and how nice would it be if they could do that between themselves and my servers could stay out of it?!
Broken NAT (the need for TURN) is probably the thing that frustrates me most about the Internet. If any two endpoints could always simply and easily connect just through direct routing it makes a lot of applications lives much easier, and many applications possible which otherwise end up centralized.
This is just one case in point. Just like Skype, the IP isn't even really in the actual "product" but in the hacks it takes to make the product work in the reality of pathologically NAT'd networks.
I do like the idea of load balancing on the client, that is pretty cool. I did something similar on the local LAN.
Apple uses TCP multipath for cases where connection might drop out wonder if that would be an option here as well.
As far as I've seen, that's for Siri only. I don't think any of the other mobile platforms allow MPTCP for apps, either. (I would love to be wrong though)
This problem, and the entirety of the resulting "solution¹" and the engineering complexity that stems from it in the article, is completely solved by IPv6, because it renders NAT obsolete.
¹not that they had a choice.
https://en.m.wikipedia.org/wiki/Orders_of_magnitude_(numbers... (not to be a smartass about what orders of magnitude means, just because the article has some really cool examples)