tcp.md (1741B)
1 # TCP 2 3 ## TCP (Transmission Control Protocol) 4 5 A network protocol ensuring reliable, ordered data delivery between any two 6 machines across a network. 7 8 ## TCP vs TCP/IP 9 10 TCP (Transmission Control Protocol) is a single protocol that operates at the 11 transport layer — it's responsible for breaking data into packets, ensuring they 12 arrive in order, and retransmitting lost ones. 13 14 TCP/IP is not a single protocol but a whole suite (stack) of protocols that work 15 together to enable internet communication. It's named after its two most 16 important protocols — TCP and IP — but it also includes UDP, HTTP, DNS, FTP, and 17 many others. 18 19 ### The Role of Each Layer 20 21 TCP/IP is organized into four layers, each with a distinct job: 22 23 - Application layer — user-facing protocols like HTTP, FTP, SMTP, DNS 24 25 - Transport layer — TCP or UDP (handles delivery, ordering, error checking) 26 27 - Internet layer — IP (handles addressing and routing packets to the right 28 machine) 29 30 - Network Access layer — physical transmission over Ethernet, Wi-Fi, etc. 31 32 ### How TCP and IP Work Together 33 34 IP and TCP are complementary: IP figures out where to send data (routing between 35 machines using IP addresses), while TCP figures out how to send it reliably 36 (ordering, retransmission, flow control). TCP doesn't send data directly to the 37 recipient — it hands packets down to IP, which routes them across the network. 38 39 A simple analogy: IP is like the postal system that routes packages to the right 40 address, and TCP is the careful courier who numbers each box, confirms delivery, 41 and resends anything that got lost. 42 43 So in short: TCP is one piece inside TCP/IP. When people say "TCP/IP," they mean 44 the entire networking framework that powers the internet.