Networking Foundations


Computer networking allows devices and applications to exchange data across local and wide-area connections. The concepts on this page form the foundation for the more detailed routing, switching, security, and operations articles in this section.

Layered Network Models

Layered models divide network communication into understandable functions. The OSI model is useful for learning and troubleshooting, while the TCP/IP model more closely reflects the protocols used on real networks.

OSI layerFunctionExamples
7 — ApplicationUser-facing network servicesHTTP, DNS, SMTP, SSH
6 — PresentationEncoding, encryption, and data representationTLS, JSON, character encoding
5 — SessionSession establishment and coordinationApplication sessions and RPC behavior
4 — TransportEnd-to-end delivery and portsTCP, UDP, QUIC
3 — NetworkLogical addressing and routingIPv4, IPv6, ICMP
2 — Data LinkLocal delivery, framing, and MAC addressingEthernet, VLANs, Wi-Fi
1 — PhysicalElectrical, optical, and radio transmissionCopper, fiber, transceivers, RF

The model is not a perfect description of every protocol, but it provides a useful troubleshooting question: at which layer does expected behavior stop?

Frames, Packets, and Segments

As application data moves down the network stack, each layer adds information needed for delivery:

  • A transport protocol creates a TCP segment or UDP datagram.
  • IP places that data inside an IPv4 or IPv6 packet.
  • Ethernet or Wi-Fi places the packet inside a local frame.
  • The physical medium transmits the frame as electrical, optical, or radio signals.

Routers replace the Layer 2 frame at every routed hop, but the IP packet generally continues toward the destination with updated hop-limit information.

MAC Addresses, IPv4, and IPv6

A MAC address identifies an interface on a local Layer 2 network. An IP address identifies an interface within a routed address plan. Devices use ARP for IPv4 or Neighbor Discovery for IPv6 to determine the local link-layer address associated with a next-hop IP address.

IPv4

IPv4 uses 32-bit addresses. A prefix length such as /24 identifies how many bits belong to the network portion. Network Address Translation has extended the useful life of IPv4, but it also adds state and complexity.

IPv6

IPv6 uses 128-bit addresses and was designed for large-scale end-to-end addressing. A normal IPv6 LAN is typically assigned a /64. Networks should deploy and monitor IPv6 intentionally rather than allowing unmanaged dual-stack behavior to develop.

Practice address planning with the Subnet Calculator, then continue to the detailed IPv6 guide.

Switching and Routing

  • Switching: Forwards Ethernet frames within a Layer 2 network using a MAC address table.
  • Routing: Forwards IP packets between networks using a routing table.
  • VLAN: Creates a separate logical Layer 2 broadcast domain.
  • Default gateway: The router a host uses to reach destinations outside its local subnet.

A host decides whether a destination is local by comparing the destination with its own address and prefix. Local traffic is sent directly to the destination. Remote traffic is sent to the default gateway.

Transport Protocols and Ports

  • TCP: Connection-oriented delivery with sequencing, acknowledgement, and retransmission.
  • UDP: Connectionless datagrams with low protocol overhead.
  • QUIC: A modern encrypted transport built over UDP and used by HTTP/3.
ServiceCommon portTransport
SSH22TCP
DNS53UDP and TCP
DHCPv467/68UDP
HTTP80TCP
HTTPS443TCP and UDP for HTTP/3
NTP123UDP
SNMP161/162UDP
BGP179TCP

Core Network Services

  • DNS: Resolves names and publishes service information.
  • DHCP: Assigns addressing and related configuration to clients.
  • NTP: Synchronizes time for logs, authentication, and distributed systems.
  • Routing protocols: Exchange reachability between routers.
  • Monitoring: Collects status, metrics, logs, and traffic information.

Essential Networking Tools

  • ping: Tests IP reachability and latency.
  • traceroute or tracepath: Shows the routed path toward a destination.
  • dig: Queries DNS records and servers.
  • ip: Displays and changes Linux interfaces, addresses, neighbors, and routes.
  • ss: Displays listening ports and active sockets.
  • tcpdump and Wireshark: Capture and analyze packets.
  • iperf3: Measures network throughput between controlled endpoints.
  • nmap: Discovers hosts and services when used with authorization.

A Practical Learning Order

  1. Learn binary, prefixes, and subnetting.
  2. Understand Ethernet switching, VLANs, trunks, and spanning tree.
  3. Learn routing tables, static routes, and default routes.
  4. Study DNS, DHCP, NAT, and firewall state.
  5. Practice troubleshooting with packet capture.
  6. Add OSPF, BGP, VPNs, monitoring, and automation as the network grows.