Search code examples
network-programmingtcpudposi

TCP/UDP vs Circut/Packet Switching confusion


My silly brain is unable to understand the difference between OSI's Transport Layer TCP/UDP and the Circuit/Packet Switching.

Firstly, I am failing to understand which layer should Circuit/Packet Switching be referring to? As it concerns the way the data is being sent (i.e.the "broken down" pieces of information via either different/same routes and orders to destination), isn't it also the Transport Layer?

Also, as TCP/UDP are equally relating to the way data is being sent, I do not know what exactly am I referring to when I'm talking about circuit/packet switching or TCP/UDP anymore. How do these differ? Can anyone try to explain to me the basic difference?

I'm very sorry for my silly brain.


Solution

  • Circuit/Packet Switching operates on Layer 3, the network layer.

    TCP/UDP operates on Layer 4, the transport layer

    The transport code runs entirely on the users' machines, but the network layer mostly runs on the routers... Computer Networks, Andrew S. Tanenbaum, pg 482

    If it runs on a router it's layer 3. If it runs on a host it's layer 4. There are some exceptions to the rule, NAT breaks encapsulation and peeks at the TPC/UDP header (Layer 4), but it's a good rule of thumb.

    The two layers provide similar services (Routing, Congestion Control, Quality of Service, etc.) to different people. The network layer is controlled by ISP's while the transport layer is controlled by the user (or programmer), since users aren't likely to have control of the network layer, and ISP's shouldn't have access to an individual host.