Skip to the content ForoHackers
Log inJoin

Network protocols: start here

Network protocols
#3169 · · Quote · 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

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply