I understand Transmission Control Protocol (TCP) on some levels, but I feel like I never learned the concepts all that concretely. Can someone give me a really good overview?
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (37)
I took networking in college, and then a bunch of us went to a coffee shop with free refills, so I always demonstrate network packets with sugar packets.
Let us contrast it with UDP. Imagine you're behind me and ask for a sugar packet. I grab one and throw it over my shoulder. It's not my responsibility to throw it to you, and I don't care if you get it. If you're where I think you are, you can ask for more and more, getting enough sugar to sweeten everyone's coffee, which is why UDP is often used for video, but dropped sugar stays dropped.
TCP has the "three-way handshake", which is more like:
I would like a sugar packet
I heard you ask for a sugar packet
I did ask for a sugar packet
Here's the sugar
This way, the sugar packets don't end up all over the floor.
If sugar is the data, shouldn't it be handed over after the three way handshake?
So how much sugar do I get to ask for in the first trip to the counter and each subsequent trip, and why is this so?
you ask for sugar and the server starts a session where he sends a numbered sugar sachets (TCP frames) and you confirm the delivery of each sachet (based on checksums) and as @gldraphael said the sugar arrives after the handshake
And if I understand correctly, the barista will give give me one packet on the first trip, then two, then four, etc. and in data terms, each packet is about 14k in size.
Is TCP British? It sounds like one from the conversation flow.
You and a friend need to share a toy:
You ask a friend if he can play with the toy.
Your friend asks you if you actually asked him for the toy.
You tell your friend that you asked for that toy.
He gives you the toy.
UDP:
The UDP example has me DYING. That's hilarious
UDP is inherently funny.
Maybe a more accurate description will be:
Your friend throws a toy at your direction thinking that it will hit you eventually and walks away.
You're explaining it to a five year old. The less nuance the better.
it's exactly the same information but with more words ;)
(adding info about what he is thinking which is not inherently important)
Well, maybe it's your friend. And it's probably s ball.
I have a five year old. There is nothing beyond this that should be added. You're fantastic. Do you have a five year old? Because this is spot on.
I don't, mostly for the reason above. :)
lol. Fair. :)
ROTFL!!!
I'd suggest you watch this and the next video on the playlist: youtube.com/watch?v=4IMc3CaMhyY&li...
A 5 year old might not understand that, but it'll give you a better overview of how TCP works. For better context read on TCP's features (flow-control, stream and connection oriented, etc.) first.
Thanks, looks great.
I think additionally I could try and expand on this.
TCP is built on
Network Layer connection = how are we physically transporting this sugar
Internet Layer = Who is exchanging this sugar
Transport Layer = Which cup is this sugar going to
Network layer = responsible for physically transporting this data which is (e.g)
someone walking over or even throwing over the sugar to the person that is requesting it.
This can come in many forms such as ethernet or wifi(simplified). Are you throwing the sugar or are you physically walking there.
Internet Layer = You need to know where these packages are going, These layers usually have frames that contain destination IP and source IPs.
The source IP would be where the packet or sugar is coming from(which person) and where the packet should go destination IP(where the sugar is going)
This would be from a host to host level, we do not know which of the cups the sugar is going into
Transport Layer = Imagine the person asking for the sugar has got three cups. We need to know which cup the sugar is going into. for this purpose we describe the cups as having their port addresses.
Putting the sugar into the designated cup would be transporting from an process to process level transportation.
Transport layer will have different methods of transporting the sugar as it was mentioned. Which would be where I would reference the first comment posted of UDP vs TCP
What's the technical purpose for differentiating the Internet Layer and the Transport Layer? Why can't one "layer" handle IP and ports?
I am not sure of any accepted answer but one reasoning for this separation would be for applications that only implement up to one layer.
If there is a router that only implements up to the internet layer(because it doesn't need port control up to that point) it would easily be able to implement this functionality up the internet layer only.
This also proves the same for software that would only implement up to the network layer such as old switches
I agree with this. I'd also expand on this and say that different devices "unwrap" different layers of a packet. So yeah, it wouldn't necessarily make sense for an edge router to care what port is needed. It just needs to know where to send the packet (IP) and the target machine handles the rest.
Layers of misdirection, and I might have to redo this before I can get to the five-year-old level.
My group is in the coffee shop, and there's enough people to require a few tables, and my table runs out. The people at my table know me, and know Dave = "seat nearest the bathroom". This part is MAC address to to IP address, which is done by Address Resolution Protocol, or ARP, and you can use computers your whole life without caring about this.
But next table over doesn't know me or where I sit, so when you ask them (serving as gateway) to pass some sugar, it is the job of the IP layer to handle the sugar-to-table part and the transport to know who to pass it to here.
Plus, on some tables, people just pass left, or right, but some might throw it right to me over the air. Actually, "how it goes" is more the job of transport layer, although which-one's-Dave is part of that.
Not an overview but for the sake of completeness this old joke must be on this thread:)
I could tell you a joke about UDP but you might not get it.
Really, Ben? THIS is the one that bothered you, lol?
Telling this joke in an interview is what got me my current job.
Julia Evans created a good comic to explain twitter.com/b0rk/status/8022561852...
General TCP
You like candy
Your friend likes candy
You ask your friend if you can have the candy
If the candy you have is the same candy that your friend likes you give him some of the candy
If hes greedy he takes all of the candy
UDP
The candy is actually a carrot
TCP is all fun and games until you start doing SACK (Selective ACK).
I am going to start handing you boxes. The boxes are numbered.
Your role is to drop the boxes into a hole in ground in order, based in the numbering.
When I give you a box, you read the number back to me.
If you are missing a number (I didn't give you that box, but I gave you a later one), tell me which is the one I gave you, and which is missing.
Keep doing that for arbitrarily many boxes.
If the boxes get too heavy, or if you feel it is a good idea, you can throw away the out-of-order boxes, and tell me which ones you kept.
I will try and only hand you boxes that you need, but I might send you duplicates now and then if you did not reply fast enough.
A group of kids are trying to talk into the school yard.
They need a technology so simple that would allow communication even if one kid left the circle. They were already talking into tin cans, so they invented the strings (TCP).
On a serious note, a good history lesson on why and how HTTP and TCP/IP was created Jeremy Keith