4 ms·
This is exactly what I have been looking for. One executable, symmetric keys and any port I want. TCP is sometimes a must (library Wi-Fi that supports only kno
by hoschicz 7y ago
This is exactly what I have been looking for. One executable, symmetric keys and any port I want.
TCP is sometimes a must (library Wi-Fi that supports only known ports). But UDP is (i think?) better for wrapping TCP traffic.
- IgorPartola 7y agoUDP is just an IP packet with port information. That is all. That’s why it is so easy to do something like TCP/UDP instead of TCP/IP, even though nobody calls it that. TCP over TCP is bad because the protocol uses congestion for traffic control, and if the underlying connection is lossless and never gets congested, the inner TCP layer cannot work right.
- windexh8er 7y agoJust to clarify... IP = L3, UDP|TCP = L4. In your example TCP/UDP is still TCP/UDP/IP.
- IgorPartola 7y agoYes obviously. But practically it doesn’t matter as UDP doesn’t add anything except expanding the addressing to include port numbers. That’s like saying that we must always list all protocols below TCP: TCP/IP/ETH/Copper wire. It doesn’t matter because what you run IP over can be ETH, 802.11, pigeons, door to door salesmen, etc. Same with TCP/UDP: it doesn’t matter if UDP is implemented on top of something other than IP. In fact, if you don’t make a distinction between IPv4 and IPv6, two wildly different protocols, you don’t actually care what TCP runs on top of in a TCP/IP combo.
- windexh8er 7y ago> That’s like saying that we must always list all protocols below TCP: TCP/IP/ETH/Copper wire. My point was your conflation of L3 and L4. And in fact TCP does have some changes on v6 from v4. Consider, for example that ARP, is replaced by Neighbor Discovery (ND) and that is added to TCP/IPv6. So... If we're splitting hairs now then not exactly.
- IgorPartola 7y agoI am not conflating them. But consider that you can run IP over IP. What level protocol is IP in this case? What about IP/IP/IP/IP? Is IP on the left level 7? Also, when you are using TCP you don’t care whether it is using ND or ARP. That’s what abstraction means. The implementation of course cares, but when you use it you do not and if you do the implementation is incorrect.
- windexh8er 7y ago> I am not conflating them. But consider that you can run IP over IP. What level protocol is IP in this case? What about IP/IP/IP/IP? Is IP on the left level 7? There is only one L3 to the local stack at any given point in packet flow. Sure, you can run IP in IP but the parent, or root, IP stack is the one in control until the encapsulated IP is deencapsulated and moved up. Encapsulating a L3 protocol doesn't magically make it something else as it pertains to OSI. Finally TCP isn't an abstraction and it has rules based on it's version. So, yes, if you're writing network applications at the TCP level you very much do care about ND or ARP.
- IgorPartola 7y agoLook, if you believe in the sanctity of the network layers, sure. I don't. In a TCP/UDP scenario, to me UDP is the packet layer because that's how I'm using it. If I am doing TCP/IPv6/UDP/IPv4, which I have actually done in real life when IPv6 access required that you set up a tunnel over UDP/IPv4, I am free to think of IPv6 as the level 3 protocol because that's functionally what it is. As for ARP vs ND, when I do bind('localhost', 5555, 'TCP') I really don't care whether localhost is IPv6 or IPv4 or pidgeons throwing rocks with notes.
- windexh8er 7y ago> Look, if you believe in the sanctity of the network layers, sure. I don't. And herein lies the issue. A layer 3 protocol can never be anything else. Unless you're writing some sort of dissector or have another use case. This isn't a "belief", it is what it is. But even when said layer 3 protocol rides a higher layer, let's say IPv4 on UDP, it's still a layer 3 protocol that is layer 4 payload until decapsulated and processed as such. What you describe is encapsulation and decapsulation, this isn't new or interesting and in most cases it's generally a bad idea just looking at it from a perspective of overhead. I'm also not sure your pseudo code is legit considering you're binding a socket that's already been defined and the socket() is the real question mark here that differentiates IPv4 and IPv6. I think you may have glossed over the fact that some platforms don't support binding v4 on v6 sockets, while some do. Regardless your example is neither universally correct or ideal in many cases.