maybe dumb question. but technically. all of these...
# random
c
maybe dumb question. but technically. all of these api protocols are handled over "raw" sockets. right?
🚫 1
e
Technically I'd say yes, at some point towards the bottom of the stack all of these use some type of raw socket abstraction (whether it's actually called a socket or not).
e
raw socket has a particular meaning: https://man7.org/linux/man-pages/man7/raw.7.html
none of those are (unless you are bypassing the OS and implementing your own TCP and UDP stack)
some of those aren't even protocols
e
I think that's why "raw" is in quotes
e
AMQP and MQTT are streams on TCP. EDA and EDI aren't protocols. everything else runs over HTTP.
💯 1
👍 1
in practice "somebody" (OS or library) is translating those into socket operations, but it's not part of the protocol
e
It doesn't seem like the question was meant to be taken literally. HTTP runs on TCP which is implemented with sockets. Implementations of EDA and EDI are probably implemented with sockets at some point down the stack.
e
AMQP and MQTT are just defined as streams (and can run on any other reliable transport), it doesn't have to be sockets even
e
It doesn't have to be sockets, but it probably is 😅
To me, the question seemed to be directed towards finding out what happens at the bottom of the stack for all of these. The answer is sockets, except in rare cases where they might be implemented with something that isn't called a socket, but functions like one.
Well not the actual bottom of the stack, but towards the bottom parts of the stack (lest I hear about link and physical layers)
c
gotcha. yeah. i feel like my understanding of networking the past few months has improved. because i thought i knew what was going on, but then i felt completely lost again. and i feel a bit more comfortable again. i've worked with rest and graphl a bunch. and actually a bit of wss a few years ago. then i recently started working with raw sockets via ktor and that has been interesting. then i watched a video on someone saying "you can implement a web server in like 10 lines of code". and it seems like it was basically raw tcp socket listening at certain port. then return some html. lol.
e
I think one of @ephemient points was to not call them raw sockets, since a raw socket means something specific. You can just call them sockets. But yes, a TCP socket listening at a port is a server, just a very basic one.
c
on top of that. ive been trying some "nearby" stuff. so ive tried the google nearby library. but thats basically just dns service discovery, then connecting via tcp socket. but... it looks like there are OTHER ways to do it. like UPnP. and SSDP. So out of interest for this I created a question on reddit networking. and man. i got downvoted for asking "so... what are ALL the ways you can scan a network for devices. in the context of a programmer thats trying to figure out ways that two devices in the same room + a router" and everyone was like "use wireshark". and im like. i just want to know what options are available for two devices to find each other so i can weigh tradeoffs. lol
i think i ended up saying "raw sockets" as a distinction between websockets. and ktor docs calls tcp udp raw sockets. so i just thought that was "sockets" but maybe there something more for me to learn here.
i want to find a good group/slack to talk about networking in a software context.
e
I don't use ktor but I definitely find its use of "raw" to be quite atypical. it has a well-known meaning already. it's only mentioned in the docs once as far as I see (though also it doesn't have much docs…)
e
In my experience "sockets" refers to TCP or UDP sockets, and websockets refers to websockets. Interesting that that's how ktor refers to them.
e
on the wider internet, in current times basically every level 4 protocol other than TCP and UDP is DoA, although you can maybe see SCTP and MPTCP in some limited scenarios
1
c
cool. maybe ill stop calling them raw sockets. and just sockets (for tcp/udp) and websockets for ws://
s
@ephemient what about QUIC 🧌
e
the OSI model is a bit ill-fitted but QUIC, in practice, not deployed like a level 4 protocol, as it operates over UDP. there are attempts to do the same for SCTP to rescue it from the grave of network hardware ossification, https://datatracker.ietf.org/doc/html/rfc6951
👍 1