CS 100 (Learn)CS 100 (Web)Module 03


TCP/IP (TCP)

(direct YouTube link)

NOTE: If your internet access is restricted and you do not have access to YouTube, we have provided alternate video links.

TRANSCRIPT

Note: This video transcript has been slightly modified. Significant corrections are marked with strikethrough, and alternative wording has been placed in [square brackets] to correct some of the awkward or confusing phrasing in the videos.

We have described the internet Protocol (the IP layer) and tightly coupled with that is the TCP layer or the Transmission Control Protocol.

The way you should think about [TCP is that] it's a bit of quality control

[Consider that] you want to send a message to [another] other computer on the internet.

[Perhaps] you want to visit a webpage or you want to download a file.

The first thing that is going to happen is establishing what is [known as] a TCP session. This is [type of] handshake protocol.

The first thing you do is send the other computer a message saying "hey, can we talk?". Then, the other computer will come back with another postcard [message] that says "sure, we can talk... here [are] some details [regarding] how we can talk. [Finally,] you send a third message back to the other computer saying "great, I acknowledge that we're going to be talking according to these rules... let's talk!"

Three messages go back and forth between you and the destination computer before anything else happens.

Let's take a look at the final piece of the puzzle and this is where our postcard analogy really shines.

You've written a novel... it's a fantastic novel, and you want your friend to read it and give you a feedback.

What we are going to do is actually send your novel [via] postcards. We are going to take your giant novel and break it into a whole bunch of little tiny pieces and send each piece [on a] postcard to your friend.

That is how messages are actually transmitted over the internet. You might download big files, but they're broken up into little tiny pieces. Whenever you view an image on the internet it was broken up into a whole bunch of little tiny pieces.

We break up your big book into a whole bunch of postcards and then the person receiving the postcards reassembles those postcards into a book.

The postcard analogy really works well because you can imagine if you were to do this in the real world you would get all [the] postcards and drop them in the mailbox. All of your postcards would be sent through the mail, [but] some of them will arrive on different days. They may arrive out of order, and some of them may get lost.

That is actually what happens on the real internet. [Continuing this] analogy we [will] refer to these little postcard messages as packets. Packets, just like postcards, can arrive out of order and they can go missing. The TCP protocol handles all of this.

It takes your big message and breaks it up into packets and numbers [each] packets. For example, [with] your novel you might say "this is the first postcard of 1428 postcards". This is number one, and then this one's number two, and this one's number three...

The TCP protocol breaks your big message up into tiny small packets and it numbers them and then sends them off to the destination. The destination looks at all these postcards and acknowledges: "I got this postcard", "oh, I'm missing postcard number 52", [or] "I'm missing packet number 52... can you resend packet number 52?"

[Once] this protocol is established, all the postcards arrive (all [of] the packets are there), [and] then the destination computer reassembles them and you get the big file you were downloading off [of] the internet.

This postcard analogy really holds [up] well. It is good for you to think about all these little tiny packets going all over the internet: multiple hops between different computers.

That's what actually happens whenever you communicate over the internet.

That concludes our middle layer. If you recall, the low layer was all about the physical connection... how you can get from your computer (or device) to the internet. What physical medium is it going to be there? All of the computers on the internet are also physically connected by very different [methods], but once you have that connection, [and] you can get physically from one spot in the world to another spot... how do we actually deliver something? That is what the middle layer is all about: the TCP/IP protocol.