• Post author:Bhaskar Soni
  • Post published:
  • Post category:Networking
  • Post comments:1 Comment
  • Reading time:3 mins read

The TCP/IP model is the practical framework the internet actually runs on. It describes how data moves from an application on one device to an application on another, across any number of networks. While the OSI model is great for learning, engineers troubleshoot real networks with TCP/IP in mind.

This guide explains the four layers, the main protocols, how encapsulation works and how TCP/IP compares with OSI.

TCP/IP model

A little history

TCP/IP grew out of US research networks in the 1970s. On 1 January 1983, ARPANET switched to TCP/IP, which many consider the birth of the modern internet. RFC 1122 later described the model’s layers formally.

The four layers

LayerPurposeExample protocolsData unit
ApplicationNetwork services for applicationsHTTP/HTTPS, DNS, SMTP, SSH, FTP, DHCPData / message
TransportEnd-to-end delivery between programsTCP, UDP, QUICSegment (TCP) / datagram (UDP)
InternetAddressing and routing between networksIPv4, IPv6, ICMPPacket
Link (network access)Delivery on the local networkEthernet, Wi-Fi, ARPFrame

Some textbooks split the link layer into data link and physical layers, giving a five-layer version.

Application layer

This layer provides the services users notice: web browsing, email, file transfer and name resolution. It combines the jobs of the OSI application, presentation and session layers. For instance, TLS encryption for HTTPS sits here in practice.

Transport layer

The transport layer delivers data between programs using port numbers.

  • TCP is reliable and connection-oriented: it uses a three-way handshake, numbers segments, acknowledges them and retransmits lost data.
  • UDP is lightweight and connectionless, so it suits DNS queries, voice and video.
  • QUIC, which runs over UDP, powers HTTP/3 with built-in encryption.

Internet layer

Here, IP gives every device a logical address and lets routers forward packets across networks. ICMP carries error and diagnostic messages, such as those used by ping and traceroute.

Link layer

The link layer moves frames over a physical network, such as Ethernet or Wi-Fi, using MAC addresses. ARP maps IPv4 addresses to MAC addresses on the local network.

Encapsulation

As data goes down the layers, each one adds its own header:

  1. The application creates data, for example an HTTP request.
  2. The transport layer adds a TCP header with source and destination ports.
  3. The internet layer adds an IP header with source and destination addresses.
  4. The link layer adds an Ethernet header and trailer with MAC addresses.

At the receiver, each layer removes its header and passes the rest upward. This is decapsulation.

TCP/IP vs OSI

OSI layersTCP/IP layer
7 Application, 6 Presentation, 5 SessionApplication
4 TransportTransport
3 NetworkInternet
2 Data link, 1 PhysicalLink

OSI is a reference model with seven layers, useful for teaching and troubleshooting language. TCP/IP is the protocol suite that real networks use. Learn more in the OSI model and our OSI model analogy.

Example: opening a website

  1. DNS (application, over UDP) finds the server’s IP address.
  2. TCP sets up a connection to port 443, or QUIC over UDP for HTTP/3.
  3. TLS encrypts the session.
  4. HTTP requests the page.
  5. IP routes packets across the internet, and Ethernet or Wi-Fi carries them on each local link.

Troubleshooting with the model

  • Link: is the cable plugged in or Wi-Fi connected?
  • Internet: can you ping the gateway? Is the IP address correct?
  • Transport: is the port open? Try nc -vz host 443.
  • Application: does DNS resolve? Does the service respond?

Sources

Need help with network security? We test routers, firewalls, ACLs and segmentation as part of our VAPT services and hardening audits. Contact us for a quote.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

This Post Has One Comment

Leave a Reply