What happens when you press <enter>?
How the magic of the internet works and why it's important.
Keep in mind.
- This is a lot.
- I talk fast.
- Take notes. Questions and discussion after.
- Don't worry about remembering everything.
- Exposure and awareness are everything.
- You can learn this, I promise.
http://www.
The internet is the world's largest and most advanced communication system, but it is not the first.
Let's spend five minutes looking at the past so that the present and the future have some context.
There is no new thing under the sun.A history of communication in emojis.
-
๐40000 BCE
-
โน6000 BCE
-
๐ฏ1300 BCE
-
๐ 300 BCE
-
๐200 BCE
-
๐1000 CE
- Personal, proximal, physical. Tribally precise, preservable, short-term multi-generational.
- Media: dyes, paints, inks.
- Medium: caves, papyrus, scrolls, wood, paper.
- Tech: fingers, brushes, quills, pens, movable type, presses.
๐ 1450 CE
-
๐ฅ800 BCE
-
๐ฅ700 BCE
-
๐ฌ500 BCE
-
๐400 BCE
-
๐1790 CE
-
๐ป1900 CE
-
๐ก๐ฐ1950 CE
- Instrument, distance. Metaphysical, computational, ephemeral.
- Media: smoke, sound, light, waves, radiation.
- Medium: text, audio, visual, data.
- Tech: fire, drums, mirrors, telegraphs, wires, radio, cables.
๐ 1960 CE
Communication is about sending information via signs that have meaning. It's how we connect to each other. ๐
How?
Machines communicating.
Just a super quick history of machinesโฆ
Ben Franklin's electrifying discovery
The kite experiment proved that lightning was electricity. That discovery led to understanding electricity's properties and its potential.
Electricity powers machines. It is the foundation for transmitting information across vast distances: it provides the power for the machines and a medium to transfer information.
1.21 gigawatts?!
Babbage and Lovelace on thinking machines
First the Difference Engine, for solving polynomial equations, and then the theoretical Analytical Engine, which can be "operated" to solve anything.
Lovelace's diagram from Note G, the first published computer algorithm.
Ada Lovelace describes the future of thinking machines:
"A new, a vast, and a powerful language is developed for the future use of analysis, in which to wield its truths so that these may become of more speedy and accurate practical application for the purposes of mankind."
"The science of operations, as derived from mathematics more especially, is a science of itself, and has its own abstract truth and value."
Ada LovelaceMichael Faraday harnesses electricity
Electricity and magnetism are not two separate forces but one interconnected force, electromagnetism, each capable of influencing the other.
Spin a magnet around a copper coil and you generate electricity through the movement of electrons in the coil.
Electrify a magnet and you can reverse its polarity, turning negative to positive.
With a magnet and electricity you can create motion, known as a motor.
With motion, say from steam, you can spin a magnet to generate electricity, known as a generator.
Nikola Tesla creates a modern world
Tesla invents alternating current, which can transport electricity over great distances.
He creates the modern turbines used for generating huge quantities of electricity, including those at Niagara Falls and the Hoover Dam.
He describes the Earth as having "acoustical resonance," capable of amplifying and bouncing waves back and forth, allowing for wireless communication.
The world is now electrified and connected.
Okay, let's move a little faster. Nothing super important (except splitting the atom) happens from 1900 to 1940.
Anyone want to guess why?Turing, Shannon, and Hopper invent computing
Alan Turing designs the "universal machine" and helps build some of the first stored-program computers, including the Manchester Mark 1. Watch The Imitation Game, it's great.
Grace Hopper works on one of the first computers in World War II to solve the imploding sphere problem, and after the war invents the idea of a "compiler" and "human readable" code: COBOL. She was 39 when she started in computing.
Claude Shannon coins the unit of measurement of a bit and creates information theory, a mathematical way of unifying all data into a singular notion.
A Mathematical Theory of Communication
"Information is the resolution of uncertainty, the negative reciprocal value of probability. One bit is typically defined as the uncertainty of a binary random variable that is 0 or 1 with equal probability, or the information that is gained when the value of such a variable becomes known."
Claude Shannon"What lies at the heart of every living thing is not a fire, not warm breath, not a 'spark of life'. It is information, words, instructions. If you want to understand life don't think about vibrant, throbbing gels and oozes, think about information technology."
Richard Dawkins, biologist"It from bit. Every it, every particle, every field of force, even the space-time continuum itself. What we call reality arises in the last analysis from the posing of yes or no questions. All things physical are information-theoretic in origin, and this is a participatory universe. The whole universe is thus seen as a computer, a cosmic information processing machine."
John Archibald Wheeler, physicistKilby, Noyce, Faggin and Xerox PARC invent modern computing
The integrated circuit creates reliable and significantly smaller computers. Kilby makes Texas Instruments and Noyce makes Intel.
Faggin invents the CPU, and the computational power of computers doubles every year (Moore's Law).
Adele Goldberg and Alan Kay at Xerox Palo Alto Research Center invent everything: the personal computer, object orientation, ethernet, the mouse, the graphical user interface, just everything. Apple steals it all.
Vint Cerf networks all the computers together
Vint Cerf created the TCP/IP protocol that allows computers to reliably communicate with each other over long distances of ethernet and fiber optic cables.
The internet is born, but it's mostly used by government and universities for POP, SMTP, FTP, and USENET.
Figure 2. How data travels over the Net.
The integrated circuit and the central processing unit made computers smaller and more reliable. Xerox PARC made computers personal. Apple made computers palatable. Vint Cerf networked them all together.
And now we're ready. How does the internet work?
It's basicallyโฆ
If we hide information, things become simpler.
Everything we just covered that enables the World Wide Web doesn't need to be known by any individual programmer.
Technology creates black boxes of abstractions. You can build on top without needing to know how the box works.
The World Wide Web is an abstraction too. It's all about a standard interface.
You flip it.
You ship it.
You drive it.
Lots of hardware. The OSI model.
Lots of software
- HTTP
- URI
- Browser
- Web server
- DNS
- Operating system
- Interface
- Network
- Router
- HTML
- More
Very physical.
Everything is a signal moving through a medium: radio to an access point, copper to a router, glass across an ocean. The abstraction sits on top of a very real machine.
"It is paradoxical, yet true, to say, that the more we know, the more ignorant we become in the absolute sense, for it is only through enlightenment that we become conscious of our limitations. Precisely one of the most gratifying results of intellectual evolution is the continuous opening up of new and greater prospects."
Nikola TeslaWireless of the future
Before HTTP, before packets, Tesla told the New York Times the world would carry an instrument no bigger than a watch and hear anything, anywhere.
In 1989 he proposed a global hypertext project, to be known as the World Wide Web. He wrote the first World Wide Web server, "httpd", and the first client, "WorldWideWeb", a what-you-see-is-what-you-get hypertext browser and editor which ran in the NeXTStep environment.
The work started in October 1990. The program "WorldWideWeb" was first made available within CERN in December, and on the internet at large in the summer of 1991.
"The web is more a social creation than a technical one. I designed it for a social effect, to help people work together, and not as a technical toy. The ultimate goal of the Web is to support and improve our weblike existence in the world. We clump into families, associations, and companies. We develop trust across the miles and distrust around the corner. The Web does not just connect machines, it connects people."
"The Web as I envisioned it, we have not seen it yet. The future is still so much bigger than the past."
"In an extreme view, the world can be seen as only connections, nothing else. We think of a dictionary as the repository of meaning, but it defines words only in terms of other words. I liked the idea that a piece of information is really defined only by what it's related to, and how it's related. There really is little else to meaning. The structure is everything. There are billions of neurons in our brains, but what are neurons? Just cells. The brain has no knowledge until connections are made between neurons. All that we know, all that we are, comes from the way our neurons are connected."
Tim Berners-Lee
"The very nature of these inventions cries out for the goodness in men; cries out for universal brotherhood; for the unity of us all."
Charlie Chaplin, The Great Dictator, 1940
Connections are everything
Connections are everything
Connections are everything
How do you know what something is about?
Google is a measurement of connections.
The PageRank value for a page depends on the PageRank values of each page linking to it, divided by the number of links from that page.
The internet is important.
It connects us.
The Web in a nutshell.
The server is always online, sitting and waiting for people to request information from it via the World Wide Web. Specifically, via something called an HTTP request, which is just a name for the messages computers pass each other on the internet.
Clients make requests. Servers respond with data from files.
Clients make HTTP/S requests. Clients are anything that can send and process an HTTP/S request.
Phones, cameras, TVs, browsers: all clients.
A specifically formatted string sent from one computer to another.
The string gets converted to TCP/IP packets. Those packets travel across all the computers on the internet until they reach the computer you want. Then the packets are converted back into the HTTP request string.
A real request, as the browser's developer tools show it.
What's in an HTTP request
All together:
GET http://github.com/aviflombaum HTTP/1.1
| HEAD | Asks for a response like a GET but without the body. |
|---|---|
| GET | Retrieves a representation of a resource. |
| POST | Submits data to be processed in the body of the request. |
| PUT | Uploads a representation of a resource in the body of the request. |
| DELETE | Deletes a specific resource. |
| TRACE | Echoes back the received request. |
| OPTIONS | Returns the HTTP methods the server supports. |
| CONNECT | Converts the request to a TCP/IP tunnel (generally for SSL). |
| PATCH | Applies a partial modification of a resource. |
Servers send HTTP responses. Still just a giant, specifically formatted string.
- An HTTP response contains information about the response in the header.
- A response comes in a format: HTML, JSON, XML, binary (images, etc).
- A response has a status code.
HTTP/1.1 200 OK, headers, a blank line, then the body.
HTTP status codes
- 1xx informational
- 2xx success
- 3xx redirect
- 4xx error
- 5xx server error
HTTP Status Rappers. 200 OK.
The server sends back HTML from a file to your browser, which turns it into a graphical representation.
HTML: the language of the web.
Responding to HTTP: anything can do it, any language. That's the beauty of the format. It's all about abstraction.
A global game of catch.
- Clients make requests for information via HTTP.
- Servers receive requests and then send HTTP responses.
- Clients process the response, generally rendering it graphically via the browser.
All these HTTP formatted requests and responses are sent via TCP/IP across the internet.
What the packets actually look like on the wire.
Where do requests go?
DNS servers look up the domain and correspond it to an IP address.
Static sites
- Receive a request.
- Naive processing.
- Serve response from the filesystem.
- Rarely any interactivity.
- No write ability.
- Doesn't change often.
Dynamic sites
- Receive a request.
- Routing.
- Integrate a data source.
- Compose a response.
- Provide write ability.
- Use programming languages for logic.
- Change all the time.
- A standard protocol (format) for HTTP requests and responses over TCP/IP.
- Clients are anything that makes an HTTP request and can receive a response.
- A web application is responsible for receiving HTTP requests and sending an HTTP response.
- HTTP responses are formatted text with a response header, a status, and a body (generally HTML or JSON).
- Web applications provide dynamic responses to HTTP requests.
Clients make requests to URLs. Our applications respond to requests to URLs.
get '/' # loading the homepage
get '/questions/new' # clicking the "New Question" link
post '/questions' # submitting the "New Question" form
get '/questions' # redirecting to list all the questions
Our application code has to respond to all these requests. We map URLs to discrete application logic to process the request and respond with HTML.
"The most important thing that was new was the idea of URI or URL, that any piece of information anywhere should have an identifier, which will allow you to get hold of it."
Tim Berners-LeeAn HTTP request to response is typically a 200 ms roundtrip.
As I said, it's basically magic.
You can become a magician, a sorcerer, part of this timeless narrative of people leveraging technology to make a better world by helping us connect.