Eli5: What is a protocol stack? How do you interpret a stack like this, for example a TCP/IP protocol stack?

271 views

Eli5: What is a protocol stack? How do you interpret a stack like this, for example a TCP/IP protocol stack?

In: 1

4 Answers

Anonymous 0 Comments

If you want to send data from one place to another, you need to tell the other end that the data is for them, what they’re receiving and what to do with it once they have it all. That’s protocol, in a nutshell.

Think of it like snail-mailing a letter (I’m going to keep this as simple as I can). The data you want to send is the letter you’ve written, now you need to get it to Grandma’s house in Rustwater, Kansas. You put Grandma’s address on an envelope, your return address in the corner, slap a stamp on it, stick your letter in the envelope and drop it in the mailbox. The envelope and everything on it is the protocol for the letter you’ve sent. It tells the postal service where the letter is from, where it’s going, and the maximum size of the letter from the number of stamps you put on it.

That letter now goes to the post office. The post office looks at the your Grandma’s address, checks the stamp to make sure it’s the right amount, and puts the envelope into a box marked “Kansas” and off it goes to the airport. That box is the protocol for this part of the trip, and it’s “stacked” on top of the protocol that was already present, the envelope you addressed. If the box has to make multiple stops, it’ll probably end up in *another* box, which is another layer of protocol “stacked” on top of the previous one.

So now the box of Kansas mail arrives at the distribution center in Kansas, and everything is unpacked, revealing the original envelope and your Grandma’s address. Your Grandma’s address tells them which post office to transport your letter to, thanks to the Zip Code. That post office looks at the street address and gives the letter to the mail carrier for delivery to your Grandma. It shows up at your Grandma’s house, she looks at the address and verifies that, yes, the letter is for her. She then looks at the return address and sees that the letter is from you and she shouldn’t throw it out or send it back. She then removes the letter from the envelope and reads the letter.

That’s what a protocol stack is and how it works, broken down Barney-style. You (well, your software) gives the data you’re trying to send a source and destination address, tell them how much data is being moved, and any special handling instructions (like writing “fragile” or “do not bend” on an envelope or box). Once you pass it off to the network, it slaps it own protocol on top of yours that tells the next node in the network where your data is headed and how to get it there (Next Day Air, Ground, Certified, Insured, etc.). Each node gets the data, strips off the top layer of protocol and preplaces it with their own (takes out of one box, puts in another) and passes it to the next node, until it comes to the node that services your destination address. That node sends it through the various routers that get it to your destination (Zip Code, mail carrier, etc.), your destination strips off that layer of protocol and looks at your original to see if it’s really for it, and see if its from an address that hasn’t been blocked or designated as SPAM, then strips off the next layer of protocol and sends it to whatever application the data is meant for.

It’s a good deal more complicated than that, but that should give you an idea of what it is and how it works.

You are viewing 1 out of 4 answers, click here to view all answers.