DEV Community

Discussion on: Explain TCP like I'm five

Collapse
 
ben profile image
Ben Halpern

What's the technical purpose for differentiating the Internet Layer and the Transport Layer? Why can't one "layer" handle IP and ports?

Collapse
 
tgiddings profile image
Trevor Giddings

separating out being able to figure out where a packet goes (internet layer) from anything about it's contents and purpose (transport layer) allows the infrastructure of the internet to be much simpler. It also means that only the machines communicating with each other need to be concerned with what's being sent and why, and developers can create new transport protocols tailored to their use (though this is usually not a good idea since people end up creating a nock-off tcp).

as an analogy: if the transport layer is the methodology for deciding when and how to chuck packets at each other, the internet layer is the muscles in your arms. They only need to be specialized enough to move the arms. They don't need to be concerned with the manner of packet chucking, nor should they be in case you want to chuck packets differently.

Collapse
 
jacoby profile image
Dave Jacoby

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.

Collapse
 
0x424c41434b profile image
0x424c41434b

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

Thread Thread
 
antoinette0x53 profile image
Antoinette Maria

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.