IP layer
IP provides addressing and best-effort packet delivery between network interfaces across routers. It does not by itself guarantee that every packet arrives.
TCP
TCP is an important transport-layer protocol specified by RFC 9293. It provides a reliable byte-stream service by tracking sequence, acknowledgements and retransmission between endpoints.
Ports
Transport-layer port numbers help an operating system direct network traffic to the correct application or service endpoint.
Why layers help
Your laptop can use TCP over IPv6 over Wi‑Fi while another device uses TCP over IPv4 over Ethernet. Separating layers allows different local-network technologies to carry the same higher-level applications.