But First - UDP
Our journey though the internet begins at your computer. Let's imagine that it's only connected to one other computer through a wire. That's the simplest kind of network. Your computer is networked with another. Both computers have a network interface - which is a card or microchip or something on your computer that knows how to connect to the outside world. Think of this device as a telephone.
The telephone allows you to connect with another person at a distance. You can talk and listen. A network interface card (NIC) can send and receive data (as packets) over a network. Your computer talks into its NIC, and its NIC uses the network to talk to other computers...just like your phone!
With the 2 computer network, the NICs in both computers will need to know how to exchange data. The simplest way is to just send the data to the other side. This is called UDP (User Datagram Protocol). This would work well in a simple network like two computers over a single wire. But lets imagine those computers are very far apart - one in New York and another in Los Angeles. And let's imagine they're connected over a telephone wire. And let's imagine they're sending data over that wire.
Since those old phone wires weren't designed for data - they were designed for talking - some of the data might get lost along the way. Luckily there's TCP (Transmission Control Protocol). TCP is a network protocol where the receiver tells the sender that it got the message and how much of the message it got. If it didn't get all of it, the sender sends the missing pieces. Sending this way takes longer, but it makes sure the right message was received.
Protocols are there to make sure we get the right message. They exist in everyday life, we call them manners - the pleases and thank you that ensure clear communications. The army has protocols for sending messages over radio. Imagine if a platoon heard the wrong thing over the radio - it could march straight into enemy hands! There are even communications protocols for Presidents of the United States of America! Those protocols keep the people of the world informed without going into a frenzied panic - or marching straight into enemy hands!
The internet is a wide network - it spans the globe. Even into near-earth orbit. The ISS and its occupants tweet from the space station! This web of computers is very complex - it has smaller networks within and it has branched off networks. It exists over wires and radio signals. Each connection has an address. The address schema (a schema is a way to organize something) is called IP. Don't confuse this IP with Intellectual Property - also technology related. This IP is Internet Protocol.
IP is how the systems that run the network know how to find your computer. It's how your computer knows how to find NASA.gov. It's how your computer sometimes knows how to find your printer...and sometimes when it doesn't.
Your computer can use IP to talk to itself. There's a special address for this: 127.0.0.1 there's also a special name for it (called an alias): localhost. Your computer is also configured with an IP address for the internet - the network gateway. That IP address is where your NIC sends all of your requests that are bound for the internet. There could be other devices connected to your network - like your printer, other computers, servers, storage, your home, TV, etc. Those have their own IP address on your network. They can communicate within your internal network using that IP address. They can also communicate on the internet through the same internet gateway as your computer!
Along with the IP address, computers listen for incoming calls on Ports. Ports allow one computer to have many "conversations" at the same time. Ports can be numbered 0 to 65535 (that's 16-bits unsigned). Some common ports are:
80 - http
443 - https
There are many other common ports for things like ftp, ssh, and mail.
When your NIC sends a message, it opens up a port. It uses that port to send and receive messages to and from the other side.
What the receiver sees is your internet gateway - your router. Actually the last router in your network before your message gets sent into the great beyond of the internet. After that, it gets passed around the internet routers to your destination - if it can be found.
The internet may be a fascinating and complex web of networks that span the globe, but almost every bit of it operates on a few core technologies. TCP/IP is how connections exchange data over a not-so-reliable network and HTTP is how two computers know how to interpret what's sent over the networks.
There is a glaring issue with all of this - if all this data is flying over the network and it really is possible to tap into those messages, how do we keep others from prying in on our messages? The answer is encryption! TSL to be specific - that's https to you. Well see how that works and how your computer knows the IP addresses of websites in upcoming posts in this series.
More information on UDP, TCP and IP is available in Wikipedia: