APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Basic (very basic) TCP/IP


Some material is very old and may be incorrect today

© June 2009 Anthony Lawrence
2009/06/05

I recently had to explain TCP/IP to a non-technical person. What follows is basically what I came up with, though it doesn't have any of the hand waving, pointing or any of the other dramatic gestures and facial expressions I used to fill in the gaps.

Think about the early telegraphs and Morse code. Press the telegraph key in the right pattern and that means the letter "A" to the person at the other end of the line. Morse code is just patterns of "on" and "off".

Technically that's arguable. Morse code is digital, but it has five elements so it isn't just "on" and "off". But it can be represented digitally, so you can argue that side too. I didn't mention any of that in my explanation.

The Internet uses patterns of "on" and "off" too. In Morse code, it's "dahs" and "dits"; on the Internet we call it 0's and 1's. Same idea, different words. "Dah" and "0" are "off", "dit" and "1" are "on".

There is one important difference. Morse code is variable length. An "A" is "dit-dah" and a "B" is "dah-dit-dit-dit". Internet code (ASCII) is always eight units long. An "A" is "01000001" and a "B" is "01000010".

So if my computer wants to send "ABABAB" to your computer, it sends "010000010100001001000001010000100100000101000010". Simple enough, right?

It gets just a teeny bit more complicated. There are a lot of computers out there: yours, mine, a few at Google, IBM, Yahoo.. if I want to send "ABABAB" to Google (think how happy they will be to see that!), how do I get it there?

I wrap it in a packet. Some people like to explain this as an "envelope" and they talk about writing the address on the envelope, but it's just more 0's and 1's and it's always eight at a time. Those eight zero's and ones are a "byte" and some of the bytes in the packet say where it's going and some say where it is coming from.

Let's pretend that there were only a few computers in the world and that mine was number one and yours was number two. Our packet to send "ABABAB" might start with "1" spelled out in eight units, so "00000001" . That says it's coming from me. We follow that with a byte that means "2", or "00000010". Then we send the "010000010100001001000001010000100100000101000010".

In actuality we send a lot more wrapped around the "ABABAB" but it's all the same idea. Your data always is wrapped in bytes that say where it came from and where it is going to (and a lot more). And of course there are a lot of computers in the world, so one byte isn't enough to contain addresses.

Without getting into all that, there is one more thing I want you to notice. That "0100001" that I said was an "A" is also just the number "65". Inside the packet, if we're looking at the part that has the address of the computer the packet came from, the bytes always mean just that: where it came from.

But the data, the "010000010100001001000001010000100100000101000010" part, might not mean "ABABAB". It might mean 65, 66, 65, 66, 65, 66. Or it might mean a color or a sound - it depends on how the other end interprets it. Paul Revere said "one if by land, two if by sea". You can't really know what "ABABAB" means unless you know what it is supposed to mean.


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> Very basic explanation of tcp/ip packets


Inexpensive and informative Apple related e-books:

Take Control of IOS 11

Take Control of Automating Your Mac

Take Control of Apple Mail, Third Edition

Sierra: A Take Control Crash Course

iOS 10: A Take Control Crash Course





More Articles by © Anthony Lawrence





Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





It's a wonderful, wonderful opera, except that it hurts. (Joseph Campbell)




Linux posts

Troubleshooting posts


This post tagged:

Basics

Networking

TCP/IP



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode