You are currently viewing Network Protocols Explained: DNS, TCP, UDP, TLS, and HTTP

Network Protocols Explained: DNS, TCP, UDP, TLS, and HTTP

Opening a secure website sets several protocols in motion within seconds. DNS finds an address, TCP handles reliable delivery, TLS encrypts the session, and HTTP carries the page request. Each protocol has a limited role, which is why devices and software from different vendors can communicate predictably.

A network protocol is an agreed set of rules for exchanging data. It defines how a connection starts, how messages are formatted, how recipients are identified, what happens when data is lost, and how errors are reported. Protocols are not cables or Wi-Fi signals; they are the rules applied to data traveling across those media.

Why protocols are layered

Networking would be difficult to build or troubleshoot if every application had to understand radio signals, Ethernet frames, routing, encryption, and web-page formats at the same time. Layering separates those concerns. A protocol at one layer uses services from the layer below while providing a clearer service to the layer above.

The Internet is often taught through the TCP/IP model. It is less detailed than the seven-layer OSI reference model, but it maps well to how real networks operate.

TCP/IP layer Main purpose Common examples
Application Protocols used directly by programs HTTP, DNS, SMTP, SSH
Transport Communication between processes TCP, UDP
Internet Addressing and routing across networks IP, ICMP
Link Delivery on a local network segment Ethernet, Wi-Fi, ARP

As data moves down through these layers, each layer adds its own information. This process is called encapsulation. An HTTP request may become TLS-protected data, then a TCP segment, then an IP packet, and finally an Ethernet or Wi-Fi frame. At the destination, those layers process and remove their own information in reverse order.

Data moving through protocol layers between a computer and server

Addresses, names, and ports are different things

Beginners often use the word “address” for several different identifiers. Separating them makes network output much easier to understand.

  • MAC address: a link-layer identifier used for local delivery, usually within one LAN or Wi-Fi network.
  • IP address: a network-layer address used to route packets between networks. IPv4 addresses use dotted decimal notation, while IPv6 addresses use hexadecimal groups.
  • Domain name: a human-friendly name for a site or service. DNS translates a name into one or more IP addresses.
  • Port: a number that identifies a service or application endpoint on a host. Ports allow one computer to run several networked applications at once.

An IP address identifies the destination device or interface. A port helps the operating system deliver received data to the right program. Web servers commonly listen on port 443 for HTTPS, while a client usually uses a temporary high-numbered source port for its side of the conversation.

Core protocols you will encounter

IP: moving packets between networks

Internet Protocol, usually IPv4 or IPv6, provides addressing and routing. Routers examine destination IP addresses and forward packets toward the next appropriate network. IP is intentionally a best-effort protocol: it does not guarantee that packets arrive, arrive only once, or arrive in order. Higher layers handle those requirements when an application needs them.

TCP: reliable, ordered streams

Transmission Control Protocol establishes a connection between two endpoints and provides an ordered stream of bytes. It uses sequence numbers, acknowledgments, retransmission, and flow control to deal with loss and prevent a fast sender from overwhelming a slower receiver. TCP is common for web traffic, file transfer, remote administration, and databases, where missing or reordered data can cause problems.

TCP does not preserve application message boundaries. If an application sends two messages, the receiver might get their bytes in several chunks or in one combined chunk. Software therefore needs its own message format, such as a length field or delimiter.

UDP: lightweight datagrams

User Datagram Protocol sends independent datagrams with less overhead. UDP does not establish a connection or automatically retransmit lost data. That can suit situations where current data matters more than perfect delivery, including voice calls, live video, online games, and some DNS queries. Applications using UDP can add their own checks, retries, or ordering rules when needed.

DNS: turning names into usable addresses

The Domain Name System is often called the Internet’s phone book, although it does more than map names to addresses. DNS records can specify mail servers, verify domain ownership, and direct services to particular endpoints. A device may first check a local cache, then ask a recursive resolver, which consults the DNS hierarchy if needed.

A DNS response should not be trusted automatically just because a name resolves. Secure DNS transport and DNSSEC address different risks, while HTTPS certificate validation helps confirm that the server presenting a website is authorized for its domain name.

HTTP, HTTPS, and TLS

HTTP defines requests and responses for web resources. A browser can request a path, include headers, send a body, and receive a status code such as 200 or 404. HTTPS is HTTP carried inside TLS. TLS encrypts traffic in transit, checks message integrity, and uses certificates to authenticate the server during normal browser use.

The padlock indicator does not mean a website is harmless or that its content is accurate. It means the browser established an encrypted connection and validated the site identity according to certificate rules. Users should still check domains carefully and avoid entering credentials on suspicious pages.

Secure browser connection protected by TLS

How one web request travels

  1. A user enters a domain name in a browser.
  2. The device asks DNS for the server’s IP address unless it has a usable cached answer.
  3. The browser opens a TCP connection to the target IP address and HTTPS port.
  4. TLS negotiates encryption parameters and validates the server certificate.
  5. The browser sends an HTTP request through the encrypted TLS session.
  6. The server returns an HTTP response, and the browser fetches additional resources as needed.

This is a simplified sequence. Modern browsers may reuse connections, use HTTP/2 multiplexing, or use HTTP/3 over QUIC instead of TCP. The core idea remains the same: names, routing, transport, encryption, and application messages address separate problems.

Protocol details that matter for security

Protocols provide mechanisms, not automatic safety. Security also depends on correct configuration, updated software, careful certificate handling, and sensible application design. Plain HTTP, for example, leaves content readable and modifiable by parties able to observe the connection. An administrative interface without strong authentication remains risky even when TLS encrypts the session.

For learning and defensive troubleshooting, inspect only traffic and systems you own or are explicitly authorized to test. Packet captures from a home lab can show protocol headers, DNS lookups, TCP handshakes, and TLS metadata without targeting other people’s networks. Avoid collecting credentials, private content, or traffic from shared networks.

A practical beginner workflow

Start with standard diagnostic tools included with your operating system. Use them on your own machine, home router, or a deliberately created lab service. The goal is to connect protocol theory to observable behavior, not to probe systems without permission.

  • Use ipconfig on Windows or ip addr on Linux to view local interfaces and IP configuration.
  • Use ping to test basic reachability when ICMP is permitted. A failed result does not always mean the host is offline.
  • Use nslookup or dig to compare a domain name with its DNS answers.
  • Use browser developer tools to inspect HTTP response codes and request headers for sites you control.

For a focused exercise, run a small local web application on localhost, open it in a browser, and inspect its request and response headers in developer tools. Change one harmless response header in the application, reload the page, and see exactly where that application-layer protocol data appears.