Network security

What Is a Network Protocol? TCP, IP, OSI Layers Explained

Your laptop, your router and a server on another continent have nothing in common except one thing: they all follow the same rules. Those rules are network protocols.

Cysoro Security TeamPublished · 8 min read
Application — HTTPTransport — TCPInternet — IPLink — Ethernet TCP : 443 UDP : 53 NETWORK SECURITY What is anetwork protocol? The rules every device agrees on.
Quick answer

A network protocol is a set of agreed rules that governs how devices format, address, transmit and receive data across a network. Every protocol defines the syntax of its messages, the meaning of each field, and the timing of the exchange. No single protocol does everything: the internet runs on a suite of protocols, chiefly TCP/IP, stacked in layers.

Key takeaways

  • A protocol is defined by three elements: syntax, semantics and timing.
  • TCP delivers data reliably and in order; UDP delivers it fast with no guarantee.
  • Protocols stack in layers, so each one solves one job and hides its details from the rest.

Your laptop, your router and a server on another continent have nothing in common — different makers, different operating systems, different hardware. Yet they exchange data flawlessly. The reason is not magic. It is a shared set of rules both sides agreed to follow in advance.

What is a network protocol?

A network protocol is a set of agreed rules that governs how devices format, address, transmit and receive data across a network. The rules cover four jobs: the format of each message, the addressing that says where it goes, the sequencing that keeps data in order, and the error handling that detects and recovers loss.

A protocol is defined by three elements. Syntax sets the format and structure of the data, including the order of bits, headers and fields. Semantics sets the meaning of each field and the action a device takes when it reads one. Timing sets the order and speed of the exchange, so a fast sender does not overwhelm a slow receiver.

Think of it like a postal system. The envelope format, the address layout, the stamps and the delivery rules are all agreed in advance, so a letter written in one country can be delivered in another by people who have never met the sender. Protocols do the same job for bits.

Why are network protocols needed?

Network protocols are needed because devices from different makers must agree on shared rules to exchange data without errors. Without that agreement there is no shared way to interpret a signal, and no exchange succeeds — the bits arriving on the wire would mean nothing.

They deliver four things. Interoperability: hardware and software from different vendors communicate using one standard, not a private format. Data integrity: agreed error-detection rules catch corrupted transmissions and trigger a resend. Addressing: shared rules let each device identify the correct source and destination. Order and flow: agreed sequencing and timing keep data in order and at a rate the receiver can handle.

This is why standards bodies exist. The IETF, the IEEE and the ISO publish protocol specifications so independently built devices interoperate worldwide. Without them, every vendor's devices would only talk to their own.

What are the most common network protocols?

The most common network protocols are IP, TCP, UDP, HTTP, HTTPS, DNS, DHCP, FTP and SMTP, each handling a specific job. The clearest way to learn them is to group them by the job they do rather than memorize a flat list.

ProtocolJobLayerTypical port
IPAddresses and routes packets between networksInternet—
TCPReliable, ordered deliveryTransport—
UDPFast, best-effort deliveryTransport—
HTTP / HTTPSTransfers web pagesApplication80 / 443
DNSTranslates names to IP addressesApplication53
DHCPAssigns IP addresses automaticallyApplication67 / 68
SMTPSends email between serversApplication25
FTPMoves files between client and serverApplication20 / 21
SSHEncrypted remote login and file transferApplication22

IP is the addressing protocol: it puts a source and destination address on every packet so routers can forward it toward its destination. TCP and UDP sit above IP and carry the data the other protocols produce. DNS turns a name such as example.com into the IP address a device connects to, and DHCP hands out IP addresses automatically when a device joins a network.

HTTPS deserves a note of its own. It is HTTP secured with TLS encryption, and it is the reason your passwords and card details are not readable by everyone between you and the website. You can check any site's certificate and headers with our free SSL checker.

One web request, four layers of wrappingApplication — HTTPGET /index.htmlTransport — TCPport 443, sequence numbersInternet — IPsource + destination addressLink — Ethernet / Wi-FiMAC addresses, checksumEach layer adds its own header. The receiver removes them in reverse.
Encapsulation: each layer wraps the data from the layer above. Illustration by Cysoro.

How does TCP differ from UDP?

TCP is connection-oriented and reliable; UDP is connectionless and fast. This is the clearest example of the connection-oriented versus connectionless split, and it decides which protocol an application uses.

TCP sets up a session with a three-way handshake, numbers every segment, acknowledges each one, and retransmits anything lost. RFC 9293, the current TCP specification, defines it as a reliable, in-order, byte-stream service, with losses detected by sequence numbers and errors by per-segment checksums. It is the right choice for web pages, email and file transfer, where every byte must arrive.

UDP sends independent datagrams with no session, no acknowledgment and no reordering. It is best-effort delivery with minimal overhead, defined in RFC 768. It is the right choice for live voice, video and online gaming, where low delay beats perfect delivery — a lost video frame is forgotten in a fraction of a second, while waiting for a retransmission would freeze the picture.

QUIC, the transport behind HTTP/3, is the interesting middle ground: it runs over UDP but adds its own reliability and built-in encryption, which is why modern browsers use it for much of the web.

What are the OSI and TCP/IP models?

The OSI model and the TCP/IP model are two ways of describing the same layered idea. OSI, standardized by the ISO in the 1980s, divides networking into seven layers and became the standard teaching vocabulary. TCP/IP, the model the real internet actually runs, has four layers: link, internet, transport and application.

The seven OSI layers, from top to bottom, are application, presentation, session, transport, network, data link and physical. The four TCP/IP layers cover the same ground more compactly: its application layer includes the top three OSI layers, its transport layer matches OSI layer 4, its internet layer matches OSI layer 3, and its link layer covers OSI layers 1 and 2. The seven OSI layers themselves are described in Cloudflare's OSI model guide.

The mapping is approximate, not exact, because the two models were designed separately. In practice, engineers name the layer rather than numbering it: a cable problem is a physical-layer problem, a routing problem is a network-layer problem, and a firewall that reads applications is a layer-7 firewall. Our guide to securing your Wi-Fi shows the link layer in action at home.

How do protocols govern a single exchange?

Protocols layer on one another by encapsulation, where each layer adds its own header before passing the data down, and the receiver removes the headers in reverse. Loading one web page shows the whole chain at work.

First, your browser produces an HTTP request for the page. Then TCP wraps the request in a segment, numbering it and opening a session so the bytes arrive in order. Next, IP wraps the segment in a packet carrying the source and destination addresses, so routers can forward it. Finally, the packet becomes a frame with hardware (MAC) addresses for the physical medium, such as Ethernet or Wi-Fi.

On arrival, the receiving device unwraps each header in turn, handing a clean HTTP request up to its web server, which sends the page back down the same stack in reverse. Every layer only understands its own header, which is what makes the system so robust: a change at one layer, such as HTTP moving onto QUIC, can ship without rewriting the layers below it.

How are network protocols standardized?

Network protocols are standardized by international bodies, chiefly the IETF, the IEEE and the ISO, so independently built devices interoperate. A standards body publishes a specification, vendors implement it, and a device from one maker then works with a device from another.

The IETF publishes internet protocols as numbered Request for Comments (RFC) documents, including IP in RFC 791, UDP in RFC 768, TCP in RFC 9293 (which replaced the original RFC 793) and DNS in RFC 1035. The IEEE defines link-layer standards such as 802.3 Ethernet and 802.11 Wi-Fi. The ISO defines the OSI reference model, and the IANA assigns the protocol numbers, port numbers and address blocks that keep the standards consistent worldwide.

RFCs are public documents, which is part of why the internet works: anyone can read the exact specification, implement it, and test against everyone else's implementation. That openness is also a security advantage — flaws in a public standard get found and fixed in the open.

What are port numbers in network protocols?

A port number is a 16-bit identifier that directs traffic to the correct application protocol on a device, separating services that share one IP address. A socket — a port plus an IP address — identifies one exact end of a connection.

The IANA divides the range into three bands. Well-known ports (0 to 1023) are standard services, such as HTTP on 80, HTTPS on 443, DNS on 53 and SMTP on 25. Registered ports (1024 to 49151) are specific applications assigned to vendors. Dynamic ports (49152 to 65535) are temporary numbers a client uses for the duration of one connection.

Ports matter for security because an open port is an invitation. Firewalls work largely by deciding which ports are reachable, and attackers scan for open ports to find services to attack.

You can see what your own connection exposes with our what-is-my-IP tool.

Check for leaks with the WebRTC leak test.

Well-known ports worth memorizing80HTTP443HTTPS53DNS25SMTP22SSH67 / 68DHCPPorts 0–1023 are well-known. 1024–49151 are registered. 49152–65535 are dynamic.A port plus an IP address is a socket: one exact end of a connection.
The six port numbers you will meet most often. Illustration by Cysoro.

Are network protocols secure?

Most classic protocols were designed when the internet was a small research network, and they assume the other side is honest. HTTP, DNS, FTP and SMTP all send data in plain text by default, which means anyone on the path can read or change it. That is not a bug in one protocol — it is a property of an era before the internet carried money and secrets.

Security comes from protocols designed for it. TLS encrypts HTTP into HTTPS and secures email and other traffic. DNSSEC signs DNS answers so a spoofed reply is rejected. IPsec encrypts traffic at the network layer, and SSH replaces the plain-text remote login protocols that came before it. Modern practice is to assume the network is hostile and encrypt at every layer you control.

Attackers also abuse protocols themselves. DNS can be used for amplification attacks, TCP handshakes can be flooded in a SYN flood, and ICMP can map a network before an attack. Knowing how the protocols work is the first step to recognizing when they are being misused — which is why protocol knowledge is core to network security, not just to networking.

The bottom line

A network protocol is a shared contract: a published specification of message formats and rules, stacked in layers so each solves one problem. TCP and IP run the internet, UDP trades reliability for speed, and the OSI and TCP/IP models are the maps that keep it all straight.

If you remember one thing, remember the layering. When something breaks, ask which layer it broke at — the cable, the address, the connection or the application — and you will find the fault far faster. You can start by checking your own connection with our what-is-my-IP tool.

Frequently asked questions

What is a network protocol in simple terms?

A network protocol is a set of agreed rules that governs how devices format, address, transmit and receive data across a network. Because every device follows the same rules, hardware and software from different makers can communicate reliably.

What are the three elements of a network protocol?

A protocol defines syntax, semantics and timing. Syntax sets the format and order of the bits and fields, semantics sets the meaning of each field and the action to take, and timing sets the speed and sequence of the exchange.

What is the difference between TCP and UDP?

TCP is connection-oriented: it sets up a session with a handshake, acknowledges every segment and retransmits anything lost, so data arrives complete and in order. UDP is connectionless: it sends datagrams with no session and no delivery guarantee, trading reliability for lower delay.

What is a protocol stack or suite?

A protocol stack, also called a protocol suite, is a set of protocols that work together in layers, where each layer serves the one above and uses the one below. TCP/IP is the dominant suite and organizes the internet's protocols into four cooperating layers.

Who creates and standardizes network protocols?

The Internet Engineering Task Force (IETF) publishes internet protocols as numbered Request for Comments (RFC) documents. The IEEE defines link-layer standards such as Ethernet and Wi-Fi, the ISO defines the OSI reference model, and the IANA assigns port and protocol numbers.

Is HTTP/3 a new network protocol?

Yes. HTTP/3 is the latest version of the web protocol, and it runs over QUIC, a transport protocol built on UDP rather than TCP. QUIC adds its own reliability and built-in encryption, and HTTP/3 is already widely deployed by major CDNs and browsers.

Do network protocols keep my data secure?

Not by themselves. Most classic protocols, including HTTP, DNS and FTP, send data in plain text. Security comes from protocols designed for it, such as TLS for encryption, DNSSEC for signed answers and IPsec for encrypted network traffic.

Sources

  1. IETF — RFC 9293: Transmission Control Protocol (TCP)
  2. IETF — RFC 791: Internet Protocol (IP)
  3. IETF — RFC 768: User Datagram Protocol (UDP)
  4. IETF — RFC 1035: Domain Names — Implementation and Specification (DNS)
  5. Cloudflare Learning Center — What is the OSI model?
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against IETF RFC 9293 for TCP, RFC 768 for UDP, RFC 791 for IP and RFC 1035 for DNS, with the OSI model as described by Cloudflare Learning Center.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free