Live data from Hacker News

What would happen if we didn't use TCP or UDP?

github.com

21–30 of 116 posts

Re: What would happen if we didn't use TCP or UDP?

#21
post #5

Earlier quoted context omitted.

SCTP is really cool, I first found out about it because it’s the basis for WebRTC data channels. It’s basically reliable UDP, but you can turn off the reliability if you want. Makes me wonder why QUIC exists when SCTP does…

> why QUIC exists when SCTP does Because QUIC uses UDP, which is supported by most/all intermediate routing equipment.

The whole point of UDP is to allow alternative protocols to be implemented on top.

SCTPs mistake was it wasn't implemented as a userland library on top of UDP to begin with.

Re: What would happen if we didn't use TCP or UDP?

#22
post #13

Earlier quoted context omitted.

This is outside my area of expertise.. so naiive question.. but ports aren't tied to the protocol .. right? If you open a raw socket, it's still on some associated port number. NAT traversal multiplexes ports.. so why would that preclude using any arbitrary protocol?

Ports are tied to the protocol. IP layer doesn’t have ports (it’s in the name).

I've been trying for a few minutes to figure out what you mean by "it's in the name"... What about Internet Protocol implies that ports are not an inherent property of it?

All I can think of is that an "IP address" does not have a port component and that's all that IP deals with.

Re: What would happen if we didn't use TCP or UDP?

#23
post #13
post #11

Earlier quoted context omitted.

To second this and expand on the reasons behind: The way the NATs (network address translators) are sharing the scarce public IPv4 addresses is by multiplexing on the transport level fields (ports in case of TCP/UDP and IDs or inner packet transport level fields in case of ICMP). Since they are unaware of your protocol, they get into a “special case mode”, which on a naive translator might consume a whole IP address…

This is outside my area of expertise.. so naiive question.. but ports aren't tied to the protocol .. right? If you open a raw socket, it's still on some associated port number. NAT traversal multiplexes ports.. so why would that preclude using any arbitrary protocol?

TCP/IP is a protocol called TCP encapsulated in protocol called IP. Raw IP packets have "protocol number" for use by payload, but not port number. Port number is technically part of custom data that IP layer should not care about.

If you mean socket as in `my_socket = socket(AF_INET, SOCK_STREAM, 0);` that's TCP/IP, not raw IP, so it will have port numbers in the TCP part of the packet. `SOCK_STREAM` and `SOCK_DGRAM` respectively correspond to TCP and UDP. Raw IP sockets on Linux can be created by `socket(AF_INET, SOCK_RAW, protocol);` and that will have no TCP/UDP header attached by the Kernel after the IP header in the packet.

(googling a bit as I write, forgive errors)

Re: What would happen if we didn't use TCP or UDP?

#24
post #9
post #2

You don't need to make up your own for this experiment. There's already a pretty old protocol that's far superior to TCP, but failed to get adoption because of network hardware dropping everything other than TCP and UDP. It's called SCTP.

SCTP is fascinating because it's one of the backbone technologies that makes communication possible for most people on the planet (as the mobile network stack pretty much relies on it), yet it's effectively unsupported on almost every consumer device. If you want to use it, you're probably going to have to ship a userland implementation that needs privileges to open a raw network socket, because kernel implementation…

Diameter in mobile network is heavy user of SCTP, but from what I've read they moving away from diameter into HTTP calls for 6G.

Re: What would happen if we didn't use TCP or UDP?

#25
post #2

You don't need to make up your own for this experiment. There's already a pretty old protocol that's far superior to TCP, but failed to get adoption because of network hardware dropping everything other than TCP and UDP. It's called SCTP.

SCTP is really cool, I first found out about it because it’s the basis for WebRTC data channels. It’s basically reliable UDP, but you can turn off the reliability if you want. Makes me wonder why QUIC exists when SCTP does…

https://news.ycombinator.com/item?id=41488416

Re: What would happen if we didn't use TCP or UDP?

#26
post #22

Earlier quoted context omitted.

Ports are tied to the protocol. IP layer doesn’t have ports (it’s in the name).

I've been trying for a few minutes to figure out what you mean by "it's in the name"... What about Internet Protocol implies that ports are not an inherent property of it? All I can think of is that an "IP address" does not have a port component and that's all that IP deals with.

yep. That is exactly it. The IP layer is specifically a map with destination ip address and source ip address. The port is not included.

Re: What would happen if we didn't use TCP or UDP?

#27
post #13
post #11

Earlier quoted context omitted.

To second this and expand on the reasons behind: The way the NATs (network address translators) are sharing the scarce public IPv4 addresses is by multiplexing on the transport level fields (ports in case of TCP/UDP and IDs or inner packet transport level fields in case of ICMP). Since they are unaware of your protocol, they get into a “special case mode”, which on a naive translator might consume a whole IP address…

This is outside my area of expertise.. so naiive question.. but ports aren't tied to the protocol .. right? If you open a raw socket, it's still on some associated port number. NAT traversal multiplexes ports.. so why would that preclude using any arbitrary protocol?

When using a packet socket you are sending bytes directly to the device driver. The only ports at this level are the physical ports on your machine which will have names like "eth1" etc. Assuming an Ethernet driver, the bytes must be a valid Ethernet frame[0], but that's all. The payload is just bytes.

[0] https://en.wikipedia.org/wiki/Ethernet_frame

Re: What would happen if we didn't use TCP or UDP?

#28
post #6

Earlier quoted context omitted.

Is this a real issue? SCTP runs over IP, so unless your talking about firewalls and such, the support should be there. Edit: a quick search showed that NAT traversal is an issue (of course!)

Yes this is called protocol ossification [1] or ossification for short. Other transport layer protocol rollouts have been stymied by ossification such as MPTCP. QUIC specifically went with UDP to prevent ossification yet if you hang out in networking forums you'll still find netops who want to block QUIC if they can. [1]: https://en.m.wikipedia.org/wiki/Protocol_ossification

Because from an enterprise security perspective, it breaks a lot of tools. You can’t decrypt, IDS/IPS signatures don’t work, and you lose visibility to what is going on in your network.

Re: What would happen if we didn't use TCP or UDP?

#29
post #2

You don't need to make up your own for this experiment. There's already a pretty old protocol that's far superior to TCP, but failed to get adoption because of network hardware dropping everything other than TCP and UDP. It's called SCTP.

SCTP is really cool, I first found out about it because it’s the basis for WebRTC data channels. It’s basically reliable UDP, but you can turn off the reliability if you want. Makes me wonder why QUIC exists when SCTP does…

Others have mentioned protocol ossification which is indeed the primary reason. A secondary reason is that QUIC fuses TLS so its latency is further reduced by one RTT. For high latency networks, the difference is palpable.

Re: What would happen if we didn't use TCP or UDP?

#30

What you want is a packet socket: sock_raw = socket(AF_PACKET , SOCK_RAW , htons(ETH_P_ALL)); IP networks should forward anything, but NAT is a major problem. Would be interesting to try with IPv6.

IPv6 alone won't help if there are some firewalls sitting between the endpoints that will drop anything they don't know. Having two linux hosts without firewalls talk to each other over IPv6 without consumer grade routers (which tend to come with firewalls by default) between them might work.
Post reply on HN