Skip to Content
LearnNetworkingNetwork

Network

Published on

Networking moves application data between hosts through a stack of protocols. The TCP/IP model describes the Internet protocol suite in four layers. The OSI model divides network communication into seven conceptual layers; it is useful for explaining responsibilities and narrowing down faults. The mapping is approximate because real protocols do not always fit one OSI layer exactly.

TCP/IP and OSI layers

OSI layerTCP/IP layerResponsibility and examples
7. ApplicationApplicationServices used by applications: HTTP, DNS, SMTP
6. PresentationApplicationData representation and protection: text encoding, serialization, TLS
5. SessionApplicationManaging an exchange: session state and connection management
4. TransportTransportEnd-to-end delivery and ports: TCP, UDP
3. NetworkInternetLogical addressing and routing: IPv4, IPv6, ICMP
2. Data linkLinkFraming and local delivery: Ethernet, Wi-Fi, MAC addresses
1. PhysicalLinkSending bits over copper, fiber, or radio

Some diagrams split TCP/IP’s link layer into data link and physical layers and call it a five-layer model. OSI layers 5–7 are usually implemented together by application protocols and libraries rather than as three separate components.

Follow one request through the stack

For an HTTP request over TCP on an Ethernet network:

  1. The application creates an HTTP message.
  2. TCP uses ports and divides the byte stream into segments. It handles ordering and retransmission.
  3. IP places each segment in a packet with source and destination IP addresses so routers can forward it.
  4. Ethernet puts the packet in a frame for the next local hop; the physical medium carries the bits.

The receiving host removes these layers in reverse order. IP addresses identify network endpoints, TCP or UDP ports identify the receiving service, and MAC addresses identify interfaces on the local link. A router replaces the link-layer frame at each hop while forwarding the IP packet.

Troubleshoot by layer

SymptomStart checking
No link or interfacePhysical medium, interface state, Wi-Fi association, local link
Name does not resolveDNS records, resolver configuration, DNS reachability
Host or subnet unreachableIP address, subnet, route, gateway, firewall rules
Connection refused or timed outDestination port, listener, TCP handshake, network policy
Connected but request failsTLS handshake, HTTP status, application logs

Use Linux network commands for hands-on checks and Network Knowledge for related protocol notes. The four TCP/IP layers follow RFC 1122 ; the OSI layer breakdown is described in NIST’s networking reference .

Last updated on