why?
the internet is one of the most epic breakthroughs ever. it’s why you can read this!
yet almost no one knows how it works. tragic! 🥲
the best way to learn something is to just build it!
so let’s build it!
how
every sunday i build for 3-7 hrs
i’ve never done this before so i’m learning most of it as I go
i’ll live-stream when I can, if i can’t i’ll write notes!
i’m ~60% done and it’s amazing how much I’ve learned by just showing up to try
i’ll clean up notes + publish code + DIY guide once done!!
progress
part 1: tf is the internet? (4hrs) / June 5, 2022
computer receives data: 0s and 1s
encode data into some format: 😃 HI! catpic.png, sandstorm.wav
change data into TCP packet
TCP: breaks down packets into tiny IP
computer software sends packets to hardware on computer via drivers/controllers
hardware sends data through the sky (wifi) or wires (ethernet) or some other way
data is received by another computer after going through routers/modems/ISPS etc
that other computer builds up the data
routers / modems
internet service providers
datacenter: store data /does compute
domain registars: GODADDY
URL
top-level domain names. .COM, .net
DNS
- going to purely send IP address, no DNS/ISP
- assume we have technology available as of 1990s, but nothing more
- c++, python
- payload gets from A to B at least once
- payload is broken down into packets
- all the packets get to other machine
- message is recreated
- latency/throughput/don’t matter
- don’t care about lost packets sometimes
- wireless: bcz cool
- send meaningful data: a cat pic or text
design
Software world
make a client: listens for HTTP
send HTTP request to another local process using sockets
—
Hardware world
- hack raspberry pi to take in morriscode IP packets
- implement morriscode pattern
- other PI has mic that listens to morriscode, encodes packets into IP format
- decodes to IP packets
- encodes into HTTP format
- prints cat text / pic
in physics: most things seem to be waves
- wifi: radio waves
- sonar: sound waves
- LiFI: light waves
- ethernet: cables. NOPE. magnetic waves
when was internet defined
when tcp/ip was made
the darkweb is just TCP/IP with proxies/encryption to hide from ISPs
part 2: Implementing the TCP/IP Handshake (4.5hrs) / June 12, 2022
part 3: Bit Hacking & Building a WIFI Driver (7 hrs) / June 26, 2022
part 4: How Radio Works + Designing Wifi Hardware (4hrs, July 17, 2022)
How does a Wifi device work?
wifi device 1 ——> radio waves(bits) ——> wifi device 2
wtf is going on
What are radio waves?
- like a bunch of slinkies that travel through the sky, or water, or some other medium
- the slinkies are “energy”
- feel like energy could be a whole thesis so i’m going to reduce tf out of it
- i like to think of energy as spiral power like they use to pilot mechas in gurren lagann
- or chakra they use to fight in naruto
- i know there’s a bunch of detail on what energy actually and its got constraints and math behind it but this makes physics more fun so 🤷
- physics are just a bunch of models that explain how we observe the world
- you can describe something with different physics models
- e.g., how glasses work can be described via quantum mechanics, or using magnetic fields, or rays of light
- so physics seems like abstractions created above reality based on observations
so tl;dr in physics we assume some equation is true based on observations + modelling, and from it we create planes, trains, etc and so via a crazy amount of eng progress that validate the principle is true.
this doesn’t mean it is true tho, perhaps we’ll extend out of our earth environment and models break. So laws of physics imo are only as valuable as the degree to which they let us built useful things on top of them
a belief I have is that an idea or law or principle is only as valuable as the things you can do with it. so i care about chemistry/physics/math only insofar as you can build valuable things with them
a corollary from this, is that a great way to find which areas of physics/chemistry/math to learn, is to reverse engineer useful things and see what laws they depend on, and study those
aircraft, vaccines, anesthetics, antibiotic, engines (for cars etc), electricity, internet
what’s preventing teleportation? renewable energy? anti-death? AGI?
how are bits encoded in radio waves?
thing called modulation
waves have frequency (how fast they are) and amplitude (how high they go)
you can modulate along these 2 things
here’s Amplitude Modulation (AM)
[figure]
here’s how u put 0/s and 1/s in Frequency Modulation (RM)
[figure]
tangent: Why does wifi only travel up to ~100ish meters? why not 10000?
limited power/amplitude, you could make it go further!
yep if you have multiple wifi signals on the same channel they will intefere
wifi channel is range of frequencies
so if you live near people and they have wifi running on the same frequency you’ll prob interfere
2.4 GHz and 5 GHz are the main frequencies
2.4GHZ has 14 channels but only 3 are non-overlapping
but only 3 don’t overlap
so if you have >3 people using 2.4GHZ you’ll have interference unless you physically block it with strong walls separating your houses
5GHZ has 24 non-overlapping channels so much less likely of major interference
tangent: so if wifi interference is a thing can i just blast a signal that knocks out wifi in a region?
EMPs? otherwise wifi signals don’t travel very far so not as big a problem
the amplitude of radio wave is based on how much energy is put into it
can use an amplifier + higher power source to make wave bigger
then in theory you could send a normal 2.4GHz wifi signal further out, and increase risk of conflict with other wifi devices
if you blast packets you can confuse networks a bunch to make them deauthenticate by sending them shutdown requests
- tangent: hilarious side project would be to use mk3d to jam/shut down a local wifi network (that I setup)
ok so design looks like this
Each compute has a tranceiver + antenna
tranceiver sends/receives radio signals and converts to from digital 0/1s
tranceiver has 2 components: transmitter, receiver 😮 🧠
transmitter has a modulator to turn 0/1s into waves, and amplifier to make the waves thicc
receiver design: demodulator to go from waves to 0/1s, and amplifies to make smol
Do we need a raspberry or adruino even?
probably easier to program/interface /w the hardware using
but in theory prob could just plug this into my laptop port
don’t wanna break my shit so i’m gonna get a pi lol
how do i build a transceiver?
you can buy one here https://www.elecrow.com/serial-wifi-transceiver-module-esp8266-p-1136.html
that seems lame
it has tcp/ip built in
that’s not building from scratch
let’s zoom in 🔍
so tranceiver has an amplifier + modulator + demodulator
one caveat to think about since i’m only sending to/from one device i don’t gotta do scanning for networks do need 802.11 packet frame tho so receiving device can partition an incoming signal into a packet and then store that packet on compute to be processed
anyway…
how to build an amplifier
lmfao this almost looked like satire but its legit i love tech
how to build a modulator
ok so at this point I roughly get how radio works at a high level, and know there’s a few hw components needed
computer 1 writes packet to arduino/pi etc wifi controller
wifi controller converts the packet file into wifi frames (0-1s)
wifi frame is sent through transceiver on board
transceiver first modulates signal into FM radio, then antenna amplifies it
another transceiver on other side has antenna & de-modulator to receive signal
signal is read onto wifi controller:
this is a state machine that reads 0/1s and outputs wifi IP packets
IP packets stored in buffer and written to filesystem over USB connection to other laptop
if this flow works then my tcp/ip handshake will handle the rest, so long as this HW reads/writes successfully
next up… finish designing WIFI hardware, buy parts!
wifi transmitter is a modem + antenna
part 5: Buying HW
falling back from building radio from scratch. not necessary bcz radio was a primitive that existed >50 years before the internet
What I have
raspberry pi 3 A+ + power cable + microSD card (for OS) + breadboard
jumper cables: help spread out bread board layout
2x raspberry pi
setting up raspberry pi
found this tutorial: https://pimylifeup.com/raspberry-pi-on-screen-keyboard/
going to try sending fm radio through gpio4 pin on raspberry pi 3 A+
tangent: the PI 3 A+ has 1gb GpU ram + 32gb storage on my ssd
if i find a way to load one layer of torch inference server 1 at a time i can technically do a full gptj inference on raspberry pi
tangent: this raspberri pi is more than 100 thousand times stronger compute than the control system that helped us get to the moon in the Apollo 11 mission
to setup the radio device followed this guide: https://www.section.io/engineering-education/broadcasting-a-pirate-fm-radio-station-using-a-raspberry-pi/
iphone seems blocked on this bcz it doesn’t have internal fm radio receiver so just uses apps that listen to stations and shares to iphone over wifi, not true radio
android has fm tuner but need wired headphones to act as receiver antenna