TCP and UDP
- gen_tcp. gen_tcp speaks TCP: listen, accept, send, recv: sockets as messages or explicit reads.
- Active modes. Sockets deliver data as messages in active mode: with active-once flow control as the honest default.
- gen_udp. gen_udp speaks datagrams: connectionless packets for discovery and telemetry.
Protocol Processes
- Process per connection. The BEAM idiom: one process per connection: thousands of them, each simple and sequential.
- Framing. TCP is a stream: framing (length prefixes, packet options) restores message boundaries.
- Binary protocol parsing. Binary pattern matching parses protocols declaratively: headers matched, payloads sliced.
High-Concurrency Network Systems
- Acceptor pools. An acceptor pool takes connections concurrently: the front door never single-threaded.
- Load shedding. Under overload, shed early: refuse at accept before work is invested.
- The C10K non-problem. A hundred thousand connections is normal BEAM territory: a process each, supervised like anything else.
Before and after this level
- Before: Level 11: Reliability Patterns: Timeouts and Backpressure, Partial Failure, Designing Self-Healing Systems.
- Next: Level 13: Debugging & Observability: Tracing, Observer and Runtime Inspection, Diagnosing Live Systems.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does Erlang Level 12: Networking cover?
TCP and UDP, Protocol Processes, High-Concurrency Network Systems: 3 lessons and 9 ideas.
What should I know before this level?
The level before it, Level 11: Reliability Patterns, which covers Timeouts and Backpressure, Partial Failure, Designing Self-Healing Systems.