a protocol
Two people who have never met can still have a phone call, because both know an unspoken script: one says 'hello?', the other answers, they take turns, and one says 'bye' before hanging up. That shared script — what to say, in what order, and what to do at each step — is a protocol. A network protocol is the same idea for machines: an agreement that lets devices built by strangers cooperate.
Crucially, a protocol is not merely a data format. It defines three things: the format of the messages exchanged (which bytes mean what), the order in which messages may be sent and received, and the actions each side takes on sending or receiving a message (including what to do on errors or timeouts). A precise example is opening a TCP connection: the client sends a SYN, the server replies SYN-ACK, the client sends ACK (the three-way handshake). The format says what a SYN looks like; the order says SYN comes before ACK; the actions say 'on receiving a SYN, allocate state and reply SYN-ACK.' All three together are the protocol.
Protocols are everywhere and they stack: HTTP carries your web request, running over TCP for reliability, running over IP for addressing, running over Ethernet or Wi-Fi for the actual link. Each is a separate, well-documented agreement (many written down as IETF RFCs). Because the rules are public and exact, anyone can build a device that interoperates — which is precisely why a phone made by one company can talk to a server made by another across networks owned by a dozen more.
The three-way handshake to open a TCP connection — SYN, SYN-ACK, ACK — is a tiny protocol: it fixes the message formats, the order (SYN before ACK), and the action each side takes on receiving each message.
Format + order + actions — all three, not just a data layout.
Common misconception: a protocol equals a file format. The format is only one third of it; the ordering rules and the on-send/on-receive actions are just as much a part of the agreement.