Network Protocols
A network protocol is a set of rules devices follow to exchange messages. It specifies how a message is formatted, what its fields mean and how a receiver should respond. Opening one web page uses several protocols: DNS looks up the name, IP carries packets across networks, and HTTP defines the request and response.
A slice of an HTTPS connection using HTTP/2. Each outer layer carries the one inside it.
What does a network protocol actually specify?
Suppose a building sensor sends the number 24. Its receiver needs to know where the value starts and ends, which sensor sent it and whether it means degrees, volts or a status code. If a reply is required, sender and receiver must agree on what counts as a reply and how long to wait.
Some of that agreement belongs to the application, such as the temperature unit. Other parts are reusable. TCP can deliver the bytes in order without interpreting the reading. Ethernet can carry those bytes across the local link without knowing whether the sender is a sensor or a laptop. A protocol suite is a family of protocols designed to work together. TCP/IP is the familiar name for the Internet protocol suite, which includes UDP and many other protocols.
How network protocols work when you open a website
Follow a laptop opening an HTTPS page on a server beyond its local network. In this example the laptop already has network settings, the browser needs a fresh address lookup, and the browser and server use HTTP/2.
- Find the addressThe browser needs an IP address for the site’s hostname. A DNS resolver returns a suitable record, possibly from its cache. DNS is a separate exchange from the request for the page.
- Open a protected connectionThe laptop connects to the server using TCP, usually to destination port 443. During the TLS handshake the browser checks the server’s identity, establishes encryption keys and negotiates HTTP/2.
- Request the pageHTTP defines what a request such as GET means. The browser sends the request over the protected connection. The server returns a status and, for a successful page retrieval, the requested content.
Take one data-carrying segment from that connection. The diagram shows two Ethernet links with an IPv6 router between them. This example assumes direct routing with no proxy, tunnel or address translation.
- Ethernet destination
- Router’s first interface
- IPv6 destination
- 2001:db8:2::20
- TCP destination port
- 443
- IPv6 Hop Limit
- 64
The laptop addresses the local frame to its default router. The enclosed IP packet already addresses the remote server.
What changes at the router? The router removes the incoming link framing, checks the IP destination, selects the next hop and reduces the IPv6 Hop Limit from 64 to 63. It builds a new frame for the outgoing link. In this example, the server’s IP address and TCP port stay the same. At the server, TCP reconstructs the byte stream, TLS decrypts the data and HTTP interprets the request.
If the browser uses HTTP/3, the middle of the stack changes. HTTP/3 runs over QUIC, which uses UDP and integrates TLS 1.3. QUIC provides reliable, ordered delivery within individual streams. A lost packet affecting one stream need not hold up unrelated streams whose data has arrived. HTTP/3 specification.
Network protocol layers: TCP/IP and OSI compared
Engineers use layers to identify which part of a communication problem a protocol solves. The four-layer TCP/IP model describes an Internet stack. The seven-layer Open Systems Interconnection (OSI) model gives a more detailed vocabulary. The mapping below is approximate.
| TCP/IP layer | Nearest OSI layers | Question it answers |
|---|---|---|
| Application | 7 Application, 6 Presentation, 5 Session | What does this exchange mean? HTTP defines a web request. DNS defines a name lookup. |
| Transport | 4 Transport | Which application endpoint receives the data, and with what delivery behavior? Examples include TCP, UDP and QUIC. |
| Internet | 3 Network | Which IP destination should routers forward the packet toward? IPv4 and IPv6 define addressing and packet formats. |
| Link | 2 Data Link, 1 Physical | How do neighbors exchange frames over this medium? Ethernet and Wi-Fi specify framing and physical signaling. |
A second way to group protocols is by purpose. Communication protocols carry application data, management protocols report or configure device state, and security protocols protect exchanges. The categories overlap. For example, HTTPS carries web traffic using a security protocol, while SNMP is an application-layer protocol used for management.
Common network protocols and their uses
Look up a protocol by name, task or usual port. The port column describes common deployments. A port number alone cannot identify the actual application or establish that its traffic is encrypted.
| Protocol | Role and practical use | Usual port or carrier |
|---|---|---|
| HTTPHypertext Transfer Protocol | ApplicationRequests a web resource and returns a response with a status code. | Usually TCP 80 for cleartext HTTP |
| HTTPSHTTP over a secure connection | ApplicationCarries protected web requests and responses. | Usually TCP 443 for HTTP/1.1 or HTTP/2, UDP 443 for HTTP/3 |
| DNSDomain Name System | ApplicationResolves names and publishes records, including IP addresses and mail destinations. | Classic DNS uses UDP or TCP 53 |
| DHCPDynamic Host Configuration Protocol | ApplicationLeases addresses and supplies network settings to clients. | DHCPv4 uses UDP 67 (server) and 68 (client) |
| SMTPSimple Mail Transfer Protocol | ApplicationTransfers outgoing email between servers or from a mail client to a submission service. | TCP 25 for relay, commonly TCP 587 for submission |
| IMAPInternet Message Access Protocol | ApplicationSynchronizes email folders and messages between client and server. | TCP 143, or TCP 993 with implicit TLS |
| NTPNetwork Time Protocol | ApplicationSynchronizes clocks so measurements and events can be compared. | Usually UDP 123 at the server |
| SNMPSimple Network Management Protocol | ApplicationReads management values and reports events, such as a change in interface state. | Commonly UDP 161 for requests and UDP 162 for notifications |
| SSHSecure Shell | ApplicationProvides authenticated, encrypted remote administration. | Usually TCP 22 |
| FTPFile Transfer Protocol | ApplicationTransfers files using separate control and data connections. Plain FTP provides no built-in encryption. | TCP 21 for control. Data port depends on mode. |
| MQTTPublish/subscribe messaging | ApplicationPublishes sensor readings to topics through an IoT message broker. | Usually TCP 1883, or TCP 8883 with TLS |
| RTPReal-time Transport Protocol | ApplicationAdds timing and sequence information to audio or video media. | Often UDP, with ports chosen by the application |
| BGPBorder Gateway Protocol | ApplicationExchanges reachability and routing policy information between routing peers. | TCP 179 |
| TLSTransport Layer Security | SecurityAuthenticates peers as configured and protects application data in transit. | Shares the protected service’s port |
| TCPTransmission Control Protocol | TransportDelivers an ordered byte stream with retransmission and congestion control. | Runs over IP and supplies ports |
| UDPUser Datagram Protocol | TransportCarries individual messages without built-in retransmission or ordering. | Runs over IP and supplies ports |
| QUICSecure multiplexed transport | TransportCarries independent reliable streams and integrates TLS for security. HTTP/3 uses QUIC. | Runs over UDP. Port depends on the service. |
| IPInternet Protocol (IPv4 and IPv6) | InternetAddresses packets for forwarding between networks. Delivery is best effort. | Carried by a link such as Ethernet |
| ICMPInternet Control Message Protocol | InternetReports network conditions and supports echo requests and replies. IPv6 uses ICMPv6. | Carried directly by IP, without TCP or UDP ports |
| ARPAddress Resolution Protocol | LinkResolves an on-link IPv4 address to a link address, commonly an Ethernet MAC address. IPv6 uses Neighbor Discovery instead. | Carried directly in link frames on Ethernet |
| EthernetIEEE 802.3 | LinkMoves frames between neighbors on a wired local network. | Wired link, no transport port |
| Wi-FiIEEE 802.11 wireless LAN | LinkMoves frames on a local radio link and coordinates access to the shared channel. | Wireless link, no transport port |
A port identifies a transport endpoint, an IP address identifies a network-layer destination, and an Ethernet MAC address identifies a link-layer interface. A client normally uses its own temporary source port when it contacts a service. IANA service name and port registry.
TCP vs. UDP vs. QUIC: what happens if data goes missing?
Imagine three pieces of data reaching a receiver in the order 1, 3, 2. The application’s experience depends on its transport.
- TCP provides one ordered byte stream per connection
- Bytes from piece 3 wait behind the missing bytes from piece 2 before the application can read them. TCP uses acknowledgments, loss recovery, flow control and congestion control. An application still needs its own way to mark message boundaries and confirm that work was completed.
- UDP preserves individual datagrams
- The application may receive datagram 3 before 2, or never receive 2. It can add its own sequence numbers, discard stale values or implement recovery. Small headers and the lack of a transport handshake can help some workloads. Throughput and delay depend on the network and the application’s behavior.
- QUIC provides independent streams over UDP
- If pieces 1 and 2 belong to one stream and piece 3 to another, the receiver can deliver ready bytes on the second stream while the first waits. Bytes within each reliable stream stay ordered. This is one reason HTTP/3 uses QUIC.
Which protocol fits the application?
- Submitting a meter reading every minute
- MQTT lets a gateway publish to a topic so a dashboard and historian can subscribe independently. Decide how to handle duplicates after a reconnect. Where an MQTT acknowledgment is used, it indicates progress at the messaging layer. A physical action needs its own confirmation.
- Sending live audio
- RTP commonly carries media over UDP. Timestamps and sequence numbers let the receiver reconstruct playback timing and notice loss. A packet recovered after its playback deadline has little value for the live conversation.
- Downloading a firmware image
- HTTPS supplies protected transport for the file. A reliable byte stream helps deliver the complete image, and the device should verify the publisher’s signature before installation. Successful delivery and authentic firmware are separate checks.
Why packets, headers and overhead matter
How much application data fits in one packet? Suppose a link allows a 1,500-byte IP packet. An IPv6 base header takes 40 bytes and a minimum TCP header takes 20. That leaves 1,440 bytes of TCP payload under these assumptions. TCP options, IPv6 extension headers or a smaller path MTU leave less room. If the TCP payload contains TLS records, part of it is TLS overhead.
The 1,500-byte limit in this example applies to the IP packet. Ethernet framing adds bytes outside that limit. A large web response therefore spans many segments and frames. One HTTP request or response does not generally correspond to one packet.
What does an error actually tell you?
A DNS name error, a connection timeout and an HTTP 404 describe different events. A DNS name error concerns name resolution. A timeout says the expected operation did not finish in time and has several possible causes. A 404 means an HTTP responder answered the request and reported that it could not find the resource or would not disclose it. Knowing which layer supplied the message narrows the question without guessing which device failed.
Network protocol FAQ
Does IP decide the best route?
IP defines the packet and its destination address. A router forwards packets using its forwarding table. Routing protocols such as OSPF or BGP help populate routing information, and administrators can also configure static routes. The chosen path depends on metrics and policy.
What is the difference between HTTP, HTTPS and TLS?
HTTP defines requests, responses and status codes. HTTPS uses HTTP with an authenticated, encrypted connection. In typical HTTP/2 web use, TLS protects the TCP byte stream. HTTP/3 uses the security mechanisms built into QUIC.
Is DNS always UDP?
Classic DNS supports both UDP and TCP on port 53. Clients commonly start with UDP and may retry over TCP after a truncated response. DNS can also run over encrypted transports, including DNS over HTTPS.
What is the difference between a frame and a packet?
A frame is a link-layer unit, such as an Ethernet frame. It can contain an IP packet as its payload. The packet addresses a network destination, while the frame delivers it across the current link.
Standards and further reading
- RFC 1122, Internet host communication layers, introduces the responsibilities of the link, Internet and transport layers.
- RFC 9293, TCP, specifies the byte stream and its delivery behavior. RFC 9000, QUIC, describes streams carried over UDP.
- RFC 8200, IPv6, defines the base header and Hop Limit used in the packet walkthrough.