Skip to the content ForoHackers
Log inJoin

Network protocols: start here

Network protocols
#663 · Ophuscado · · Report

A network protocol is an agreement between machines that have never met: what a message looks like, who speaks first, what happens when something is lost. Every email, web page and video call is a stack of protocols, each one solving a small problem and relying on the one below it.

Key concepts

  • Layering: link, network, transport and application layers; each hides the details of the one below.
  • Message format: fixed headers and variable payloads, in text (HTTP/1.1, SMTP) or binary (DNS, TLS records).
  • State machines: a protocol is a set of states and events; handshakes, timeouts and retransmissions are transitions.
  • Reliability and ordering: acknowledgements, sequence numbers and checksums turn an unreliable medium into a usable one.
  • Extensibility and versioning: how a protocol grows without breaking old peers.

Vocabulary

  • RFC: a numbered public specification, the usual home of an internet standard.
  • Endianness: byte order on the wire; network byte order is big-endian.
  • Handshake: the opening exchange that sets up parameters and state.
  • Encapsulation: wrapping one protocol's message inside another's payload.
  • Round trip: one request and its answer; latency is counted in them.

What to study, in order

  1. The layered models (OSI and the internet's four layers) and what each layer promises.
  2. Capture a plain-text exchange, such as HTTP or SMTP on your own lab network, and read it byte by byte.
  3. Read a short RFC end to end and draw its state machine.
  4. Implement a tiny protocol of your own over a socket: framing, errors, a version field.
  5. Break it on purpose with dropped, duplicated and reordered packets, and fix what fails.

Related tags

#tcp-ip #protocol-analysis #http #standards

Log in or join to reply.