Yet again working on my network stack implementation, and just..

I do not enjoy that Layer 2 has to care about stuff from Layer 3

Or that Layer 3 and 4 are/can be entangled with each other,

instead of all of them being able to just work independent of every other layer

 WEH

@k4m1 wdym with l2 caring about l3? packet snooping for building ARP/switching tables?

hugs

@domi

That's whole another can of worms,

this complaint was just provoked by remembering that EtherType field in Ethernet frame is used to indicate type of protocol that'll follow x-x

So 0800 for ipv4, 0806 for arp, and so forth

@k4m1 @domi oh god
@alina @k4m1 you kinda don’t have any other way around this problem tho, it needs to be self-descriptive because as far as Ethernet is concerned, the frame can contain anything. if not for this ID field, you’d need to snoop and try to detect what each packet is x.x
@domi @k4m1 @alina it's a pattern that repeats at every layer tbh. You need a dispatch point to select which of the next layer protocols will process the rest of the packet.

Now if you want to talk about ugly layering violations, meet my dishonourable friend IGMP/MLD snooping

@erincandescent @k4m1 @alina the funny thing is that we designed systems to support a multitude of protocols. then we proceeded to only ever (commonly) use three of them (ARP, IPv4, IPv6)

but fear not! we designed IP to support a multitude of protocols too! and then we proceeded to only really use TCP and UDP. For an unwritten reason everything else has to match one of those now :))))

but fear not! we designed TCP/UDP to support a multitude of protocols too!!! and then we proceeded to block every port other than 80, 443 and 53, because everything is HTTP(S) or DNS now

but fear not! we designed^W slapped websockets on top of HTTP because THERE IS NO GOD

@alina @domi @erincandescent

Was trying to write a clever and funny reply, or something, but the "AAA"s summarize it all perfectly 

@k4m1 @domi @erincandescent ah, right, should've said AAAA because everything is DNS now
@alina @k4m1 @domi @erincandescent dammit u stole my joke

@ity I wish everything was AAAA now, but way too many things are still A only. 😞

@alina @k4m1 @domi @erincandescent

@alina @k4m1 @domi @erincandescent I was assuming it must have just been an address record for the new and lesser known IPv7.
@StryderNotavi @alina @k4m1 @domi @erincandescent
I assumed AAAA twice, with some acceptable loss.

@alina @domi @erincandescent @k4m1

mumble.example.com IN AAAAAAA wss://sakamoto.example.com/mumble

@domi @erincandescent @k4m1 @alina i love how websockets have some weird encryption with a given key on them so that badly-designed middleboxes won't get exploited by protocol confusion attacks.

@domi @erincandescent @k4m1 @alina there are two big workarounds for intermediaries in websockets:
the client sends a random value in the Sec-Websocket-Key header and the server responds with a Sec-WebSocket-Accept header with a value base64(sha1(key || hardcoded_thing)). This is to prevent caching proxies from sending back an existing websocket connection.

To prevent protocol confusion in TLS-stripping intermediaries (and maybe badly designed NICs if using unencrypted websockets), client to server frames must be masked. Frames contain a 32-bit random value which is xored with every word of the payload before sending.

@artemist @domi @erincandescent @k4m1 @alina and then some startup pushes video through websockets over loopback, wonders why that is slower as expected and discovers "oh, yeah, masking 100+MB/s constantly is actually expensive if you do it on many machines and pay AWS prices" : https://www.recall.ai/post/how-websockets-cost-us-1m-on-our-aws-bill 🙃
How WebSockets cost us $1M on our AWS bill

A deep dive where we unexpectedly discover how WebSockets cost us $1M/year in AWS spend and the quest for an efficient high-bandwidth, low-latency IPC.

@artemist @erincandescent @k4m1 @alina my favourite part about this god forsaken protocol is that they picked a static UUID to add as salt to a hash. it never changes, it’s in the RFC

https://git.sakamoto.pl/laudom/http.sh/src/commit/4df7be9a7cbc932fbb5e0c5b56379d01a2cdb398/src/response/101.sh#L17

http.sh/src/response/101.sh at 4df7be9a7cbc932fbb5e0c5b56379d01a2cdb398

http.sh - a web framework written in bash. fully configurable, with a basic templating engine, router and much more

the sakamoto git server
@artemist @domi @erincandescent @k4m1 @alina oh good to see this practice is spreading beyond QUIC
@domi @k4m1 @alina if I got to redesign IP with the benefit of hindsight I'd delete the next protocol header and just fuse UDP in. Alas.
@domi @alina @k4m1 (then take TCP and delete the ports from it's header.. You get the idea)
@alina @domi @k4m1 my favourite thing about the general ossification of the internet is the existence of RFC 9443 which contains this diagram telling you how to demultiplex 7 different protocols on one port by looking at the first byte so you only have to hole punch a NAT once
@alina @domi @k4m1 yes btw all of these protocols now need to coordinate updates in order to keep this monstrosity working and it was recently extended to add QUIC to the pile

@erincandescent @domi @k4m1 @alina I'm tired of knowing how the sausages is made 😭

Like it's really cool in a you probably shouldn't do that even if it'll work kind of way.

@erincandescent @domi @alina

Oh had totally forgotten about this gem :D

Had the joy of having to work with this stunningly quic mess in distant past (x

@erincandescent @domi @k4m1 @alina "(if from TURN server)" oh god
@alilly @domi @k4m1 @alina practically the TURN server will only speak TURN (an extension of STUN) at you, so you can sort of just treat that as a different socket entirely
@domi @k4m1 @erincandescent @alina yeah but now you have to track who is a TURN server
@alilly It's good practice to keep track of who you've turned, if only to know when you can exploit the sire bond. It's also good to know who somebody else has turned at least as a time-saver so you don't attempt to turn them again. Also, turned servers prefer tips in blood, so again good practice to keep track. @domi @k4m1 @erincandescent @alina
@alilly @domi @k4m1 @alina it's the IP/Port combo you've spoken TURN to. This is something you have to remember so you can send TURN packets back that way
@erincandescent @domi @k4m1 @alina this is basically the design I picked for the last fantasy network protocol stack I designed, the routing layer has a service ID and a flag to indicate whether the session layer is used
@erincandescent @k4m1 @alina UDP has some design problems around packet forwarding. and yes, with the benefit of hindsight we could have larger address space and make NAT never happen. but even from a perspective of a flat network, stateful connections have some operational benefits
@domi @k4m1 @alina eh I'm not sure it needs to be a separate router-visible protocol though

The boxes which need to know about state can be configured with ports

@erincandescent @k4m1 @alina in an imaginary world it probably doesn’t need to be, that’s true. moreover, if you built automatic keepalive (pings) into the network stack itself, you’d solve most of the problems of its async nature, and then you’d truly only need one proto.

unfortunately…

@erincandescent @alina @k4m1 i love networking. it’s one of my favorite things in this world. but the more I think about the state of how everything interworks, the more I come to the painful conclusion that we’re building on top of something that had 40+ years of misuse and bad decisions solidified into a status quo
@domi @erincandescent @k4m1 @alina
While we're asking for ponies, how about packet-level encryption? Packet-level authentication?
@domi @erincandescent @k4m1 @alina hmm maybe we could simplify the stack by assigning an EtherType for WebSockets
Proxying Ethernet in HTTP

This document describes how to proxy Ethernet frames in HTTP. This protocol is similar to IP proxying in HTTP, but for Layer 2 instead of Layer 3. More specifically, this document defines a protocol that allows an HTTP client to create Layer 2 Ethernet tunnel through an HTTP server to an attached physical or virtual Ethernet segment.

IETF Datatracker
@huitema @eloy @erincandescent @k4m1 @alina of course it’s fucking google. i think someone should get this person grounded AND have their internet privileges revoked, ASAP
@huitema @alina @eloy @erincandescent @k4m1 i can’t emphasize how mad this draft rfc makes me feel. I literally considered writing to the mailing list to ask for rationale. but what the fuck would I achieve with asking them “hey. maybe don’t make the internet even worse with this”
@domi @erincandescent @k4m1 @alina @eloy
¯\_(ツ)_/¯. The guys who proposed that got plenty of feedback, but had enough convincing use cases to get their draft adopted by the WG.
@domi @k4m1 @alina @eloy @huitema eh it's just an ethernet VPN with QUIC as a substrate
@huitema What could go wrong? Packets want to be free !
@[email protected] @k4m1 @alina @[email protected]
even DNS is sometimes done over HTTPS nowadays

i can't wait to configure my firewall to block everything but port 443, the "internet port."
@postie @alina @erincandescent @k4m1  no! only bad network admins block outgoing ports “just because”!
@postie @erincandescent @k4m1 @alina @domi You need to block HTTPS because botnets now also use it for orchestration! /s

@patrys @postie @erincandescent @k4m1 @alina @domi

Put all computers separated into blocks of concrete and dump them in the sea. Security win.

@domi @erincandescent @k4m1 @alina we defined many different DNS record types and then put every new application in TXT records

@a51c @erincandescent @k4m1 @alina while you’re not wrong, the root cause of this one is entirely different:

normal protocols become bespoke due to layers of compatibility hacks. DNS is like that to a point, but much more of it was sheer convenience. TXT is a dumping ground for everything, therefore so much software flocks to it for storing metadata. This didn’t obsolete any records, and there’s a vast diversity of Stuff that DNS is actually used for ^^

if you want a real kicker, check out the List of DNS record types on wikipedia. Half of those read like they were designed by a lunatic and would never ever work well in the real world.

List of DNS record types - Wikipedia

@a51c @alina @erincandescent @k4m1 my favorites are as follows:

  • LOC, because it’s incredibly ambitious
  • SSHFP, HTTPS, IPSECKEY, OPENPGPKEY… - because it feels like a great idea, but actually provides little to no extra security (and gods, so many variants! you have to love it)
  • EUI48, EUI64 - before I die, I want to learn why the fuck would someone put a MAC address in a DNS record
@domi @k4m1 @alina @a51c the EUIs and DHCID record types are for DHCP servers doing DNS updates to track ownership
@erincandescent @k4m1 @alina @a51c i am not convinced this is a good solution to anything
we made a globally distributed DNS network for shits and giggles

DNS infrastructure is a bespoke pile of interconnected "standards", and its management is often treated as an afterthought. With Project ...

media.ccc.de

@a51c @erincandescent @k4m1 @alina I’m hacking on more cursed DNS-adjacent things right now, which will be published in a future blogpost. equal magnitude of this hack or better ;3

not sure how fast i’ll finish the work, but it’s not unwise to expect it to be out sometime next week

@domi @erincandescent @k4m1 @alina @a51c I kinda like RP because sometimes you just need to get a hold of someone to fix something, but I understand why this might not be safe to be generally queryable. Accountability is easier at small scale and gets complicated in larger and federated systems

If there wasn't DNS, the fastest distributed nosql database in existence, there is an alternate reality where everything is a forest of LDAP service instead with per record and attribute access control.

@domi @erincandescent @k4m1 @alina @a51c hm they don't seem too bad (albeit it feels like all the fingerprint-in-DNS things should be one RR type with quite flexible subtypes)

and the fingerprint-in-DNS stuff only makes sense with DNSSEC, and if one can trust the TLD NIC and all the other intermediate ones, of course.

@domi @erincandescent @k4m1 @alina is it a step forward or backward if we TLS-wrap several protocols and send it all over 443 to get around badly configured firewalls? (on the other end they get separated and routed to loopback interface ports via SNI)

@domi @erincandescent @k4m1 @alina @arrjay This toot makes me angry, not because it's wrong, but because it's right. 😑

And to say "we" "commonly" use IPv6 is... charitable. 😒

@domi @erincandescent @k4m1 @alina the way IP networking was integrated into Unix in the first place is a weird bolt-on hack that doesn't integrate with the overall system design very well, eg a virtual filesystem in /dev would be more on-point than the BSD Sockets API, and there is a weird hand off between what's the job of the kernel and what's in user space that makes new protocols very hard to deploy.

There is probably a better way to do all of it that we'll never know because people are not omniscient, they didn't think of it at the time, and compatibility is more important than perfection

@domi @erincandescent @k4m1 @alina

It could be worse.

Imagine a world where HTTP was never invented and they managed to build everything on top of SMTP and port 25 instead...

(I'm reminded of the scene in "Miri" where they find the abandoned office building and start going through the old records...

SPOCK: Their technological development roughly matches that of your Earth up through the late 1980s when *something* went horribly, horribly wrong.

MCCOY [reading file]: What in God's name is HMTP?

CHILDREN'S VOICES [in the distance, singing]: Nyah, nyah, nyah, nyah nyah.

.

[...and no, I have no idea how they get out of this one...]

@domi @erincandescent @k4m1 @alina @Extelec ooooOoo. ethertype was new to me. I didn’t realise it was there. Lots of obscure protocols to lookup now: https://en.m.wikipedia.org/wiki/EtherType
EtherType - Wikipedia