I am reading this wikipedia article:


It talks about how TCP and UDP are transport layer protocols which are designed to connect one host to another either through connection-oriented or connectionless measures respectively. It mentions that IP is an internet layer protocol in that it reaches one host to the next by using a gateway to transit packets to the appropriate link layer. And the link layer is the physical network component used to interconnect hosts within a local network.

And it says the following:

"Data coded according to application layer protocols are then encapsulated into one or (occasionally) more transport layer protocols (such as TCP or UDP), which in turn use lower layer protocols to effect actual data transfer."

What does it mean something like FTP being encapsulated into TCP?

closed as off-topic by sciurus, joeqwerty, mdpc, Falcon Momot, Tim Brigham Jul 30 '13 at 11:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – sciurus, joeqwerty, mdpc, Tim Brigham
If this question can be reworded to fit the rules in the help center, please edit the question.


What does it mean something like FTP being encapsulated into TCP?

One analogy that I think helps here is to compare TCP/IP's 4 layers to transportation network:

  • Application layer - cargo (application instructions / data)
  • Transport layer - cities (reliability, topology hiding)
  • Internet layer - cars (addressing, packet exchange, routing)
  • Link layer - roads (physical connectivity)

Here's a sample:

  • Application layer - "Hi Mark - listen, I need this letter (application data) sent to my friend Alicia. Could you send it for me?"
  • Transport layer - "Hi Joe, can you get this box to Chicago? That's where Alicia is (topology hiding). I know you know the road to Chicago, thanks! And here's the contents of the box (error correction). Let me know if it doesn't make it, I'll send a copy (flow control)"
  • Internet layer - OK, so I'm at 35th west and Lexington Ave. How do I get to King St and 9th east (addressing)? Let's open Google maps on my new flashy Android. OK, so the shortest / least busy way is this one (translates to: number of router hops / bandwidth)... Let's go! (routing)
  • Link layer - Here I am at the crossing. The only thing I see is the next traffic light. Let's get there without hitting anybody or anything. (Error correction - if you do get hit by another car and only if it's a minor damage, you might get a mechanic in this part of the street to repair your car and you can still continue delivering the package)

It's a somewhat crude analogy, but hope it helps. To return to your original question:

What does it mean something like FTP being encapsulated into TCP?

FTP allows you to transfer files. So e.g. you can connect to a server with address (how you get there is handled by IP and that you actually reach reliably it is handled by TCP). So you can say e.g.:

ftp> get file.txt

which will fetch file named file.txt from the remote FTP server. Here get file.txt is a FTP command with data. This is cargo in the above transport analogy. FTP client wants server to get this and do something. The file (i.e. contents of file.txt) that server sends back is also cargo, just in the other direction.

Application layer (FTP) doesn't care about how this cargo will get there. That's the job of the next underlying layer, which is TCP. So what happens is this:

  • FTP (application layer) tells TCP: "Hey TCP, here's a letter (get file.txt). Please make sure this reaches my destination"
  • TCP (transport layer) will take that and put it into a bigger box, stamping it with some additional data such as "Contents: one letter". That bigger box is the encapsulation. TCP needs some more information to do what it does (flow control, error correction, etc.). When the other side receives it, the TCP layer on the other end can say something like "OK, I'm expecting this box to contain one letter" and searches the box. If one letter is found, all good (error correction). If not, then this might be a box destined for somebody else, so let me see what to do...
  • TCP then sends this down to (link layer) IP ("Hey IP, please send this box to"), etc.

Hope this helps.

  • If only frames were better drivers than humans, eh? – john Jul 30 '13 at 5:34

Yes it does. You can see this visually in any packet diagram of how an IP packet is built. That payload can be anything, and at the IP layer is entirely meaningless; it's up to higher level protocols to figure out.

The effect of this is that Application Layer protocols can run on top of many different Transport Protocols. In theory, anyway. W-a-y back in the day, you really could get things like FTP working on top of both IP, and Novell's IPX, which was another connection-oriented transport layer protocol that has fallen out of use. Though these days it's pretty much all IP all the time.

Not the answer you're looking for? Browse other questions tagged or ask your own question.