This content originally appeared on Level Up Coding - Medium and was authored by Ayaan Javed
This series aims to deconstruct the working of Internet, starting right from the bottom.
Aimed at someone who would also like to code their way up, along with theory of course.
We first start from a single computer, and then onwards.
Let’s say you have a computer sitting out there peacefully. Bliss.
You can perform calculations on it, play games, and do tons of things.

It’s like you, sitting out there. Sure, you could do plenty of things on your own. But hey, it gets pretty boring after a while. Maybe you need someone to talk with, share your knowledge with, or just hang out with.
Following this same analogy, a single computer sitting alone isn’t very exciting. Let’s bring in another computer.

Now, a wire connects these two computers. This wire allows them to send messages back and forth, just like how you might talk to a friend. This simple connection is the most basic form of a computer network.

You might expect these computers to start talking naturally — transferring files, sharing movies, and sending messages back and forth. It seems like it should just work, right? But since we’re dealing with computers, we need to break this down to the most basic level — Level Zero
Lets get started.
I started with the idea of being able to connect two computers with a USB cable, and then transferring individual bits through it. But getting fine control over the data lines of the cable seems tough. Its too abstracted.
What we’ll need are simpler piece of machines — I see you there, Arduino.

Our goal is simple — We have got these Digital I/O pins. (That convert digital 1’s and 0’s to actual square wave signals) on Arduino. Our goal would be to send a 0 and 1 from one Arduino to another. Plain and Simple

Open up a project in Tinkercad. Drag two Arduino Uno’s next to each other.
And now connect the 7th pin of the first board — with 8th pin of the second board.
You should end up with something like the image below.

Focusing on the first board — Let’s try and send alternating 0 and 1’s with a delay of 1 second.
And we’ll do this infinitely.
Here’s the code for the Sender Board
const int senderPin = 7;
void setup()
{
pinMode(senderPin, OUTPUT);
}
void loop()
{
digitalWrite(senderPin, HIGH);
delay(500);
digitalWrite(senderPin, LOW);
delay(500);
}
And here’s the code for the Receiver Board -
const int receiverPin = 8;
void setup() {
pinMode(receiverPin, INPUT);
Serial.begin(9600);
}
void loop() {
int signal = digitalRead(receiverPin);
if (signal == HIGH) {
Serial.print("Received 1");
} else {
Serial.print("Received 0");
}
Serial.print("\n");
}
Here’s what we are doing at the Sender Board -
Send 1 (High) for half second. Send 0 (Low) for half a second. Rinse and repeat.
Now at the Receiver Board -
Continually loop and read the signal at pin 8. Print 1 or 0 accordingly.
And hey, we need to connect ground too. Forgot about that.

Here’s how it should look finally.
Running this and checking the serial monitor gives us the following output-
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 1
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
Received 0
A series of 0’s followed by a series of 1’s.
This pattern occurs because the receiving board’s loop runs much faster without any delay. During each half-second interval, it reads the same signal (either 0 or 1) about 20 times before the signal changes.
That’s great, we now have two machines — that can send 1’s and 0’s from one to another.
It’s just one way communication though. There is a designated sender and receiver. But hey, we have a start.
Sending 1’s and 0’s is cool…but it doesn’t carry any reasonable info though. I don’t want my computer to send 1’s for 10 seconds and then 0’s for another 10 seconds. Won’t solve anything..lol
I want to start by sending something meaningful, profound and truly world changing. That will transform the history of mankind forever.
And that will be ………… A
Gotta start with something I guess, so yeah — A
Here’s the thing. The wire can’t just send “A”. All it can do is send voltages — Either HIGH or LOW.
1 or 0.
Need to come up with a way to translate “A” to 0’s and 1’s. And both the machines need to follow this way that we come up with.
Luckily, this problem has already been solved. There’s this American National Standards Institute (ANSI) that came up with rules to define this translation.
This is a repeated pattern you are going to see in our journey to understand the Internet. At the core of it, it’s always about rules, regulations and protocols.

Here’s the table (mapping) they came up with — https://www.ascii-code.com/
Side Note — We could totally come up with a different set of rules. Maybe something that says “A” means “011”. And then we make our machines follow those rules. That would work, but only for the machines that follow OUR rules. So if you want to come up with your own table, definitely try that.
Looking up the table, “A” translates to “01000001”.
Alright, so the task is simple. We need to send “01000001” to the other side.
And that’s the content for Part 2 of the series. Churning that up right now.
Understanding Internet from Scratch (while trying to build it) was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.
This content originally appeared on Level Up Coding - Medium and was authored by Ayaan Javed

Ayaan Javed | Sciencx (2025-01-07T18:35:08+00:00) Understanding Internet from Scratch (while trying to build it). Retrieved from https://www.scien.cx/2025/01/07/understanding-internet-from-scratch-while-trying-to-build-it/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.