A free, open, interactive course on the Session Initiation Protocol (SIP), for support/NOC engineers and developers. Every concept is a call flow you can step through message by message, with the exact RFC sentence that defines it.
- Course plan: COURSE_STRUCTURE.md
- Technical design: TECH_DESIGN.md
- Status: Module 13 (Digest authentication) is the reference lesson. The other modules follow.
Needs Node.js 24 (see .nvmrc).
nvm use
npm install
npm run dev # http://localhost:4321| Command | What it does |
|---|---|
npm run dev |
Development server with hot reload |
npm run build |
Content checks, then the static site in dist/ |
npm run check:content |
Protocol checks and diagram language checks on every flow, and on every combination of the flow generators |
npm run verify:rfc |
Checks every RFC quote word for word against rfc-editor.org |
npm run sync:rfc-index |
Refreshes rfc-index.json (titles, dates, status, obsoletes/updates) from the official RFC index, for the RFCs in rfcs.yaml |
npm test |
Unit tests (parser, checks, digest maths, transaction timers, dialog state, routing, DNS, registrar, security, SDP and offer/answer, RTP, RTCP, SRTP, transports, NAT, STUN, ICE, and the flow generators) |
npm run verify |
check:content, verify:rfc, and test together |
npm run check |
TypeScript and Astro type check |
All course content lives in src/content/.
| File | Holds |
|---|---|
modules/NN-slug.mdx |
One lesson. Frontmatter is validated (see src/content.config.ts). |
flows/*.yaml |
Call flows: lanes, steps, captions, and raw SIP messages |
rfc-quotes.yaml |
Exact RFC quotes, referenced by id |
rfcs.yaml |
The RFCs on the RFC map: area, summary, and modules. Run npm run sync:rfc-index after editing. |
rfc-index.json |
Generated from the official RFC index. Do not edit by hand. |
glossary.yaml |
The controlled vocabulary. Lane labels and diagram labels must use these terms. |
headers.yaml |
Explanations for the message inspector |
header-reference.yaml |
The header reference: group, and who adds, changes, and removes each header (meanings come from headers.yaml) |
codes.yaml |
The response code atlas: meaning, causes, origin, and Q.850 causes for each code (phrases follow IANA) |
methods.yaml |
The method cards: facts and a short ladder for each SIP method (checked like a flow) |
elements.yaml |
The element gallery cards: each points at a flow and the steps the element receives and sends |
<Flow id="register-401" /> full stage: ladder + inspector + player
<Scrolly flow="invite-407"> <Step n={1}>…</Step> </Scrolly> text scrolls past a pinned ladder
<BrokenFixedFlow broken="invite-407-no-ack" fixed="invite-407-ack" />
<Digest flow="invite-407" step={4} /> calculator pre-filled from a flow step
<RfcQuote id="rfc3261-22.2-cseq-increment" />
<Term t="nonce" /> glossary hover definition
<Note kind="tip|warn|note">…</Note>
<Mistakes><Mistake title="…">…</Mistake></Mistakes>
<Stats><Stat value="407" label="…" /></Stats>
<CompareFlows a="udp-options" b="tcp-options" labels={['UDP', 'TCP']} /> two flows behind a switch
<ElementGallery initial="stateful" /> one card per SIP element (elements.yaml)
<HeaderReference initial="Via" /> <HeaderJourney flow="header-journey" /> <CodeAtlas initial={486} /> <MethodCards initial="INVITE" /> <CapabilityLab /> <MessageAnatomy /> <FramingLab /> <UriDissector mode="header" />
<UriDissector /> <LocationService /> <AddressClassifier /> <NatRewrite /> <PacketExplorer flow="…" step={1} />
<TransactionPlayer /> <TimerTimeline /> <TransactionMatcher /> transaction state machines, timers, matching (src/sip/transaction.ts)
<DialogTable flow="dialog-call" /> <ForkingTree flows={['fork-one-answers', 'fork-two-answer']} labels={[…]} /> dialog state per UA (src/sip/dialog.ts)
<RoutingLab /> <ViaStack flow="via-stack" /> Record-Route paths and the Via stack (src/sip/routing.ts)
<DnsResolver /> NAPTR, SRV, A lookups and failover (src/sip/dns.ts)
<RegistrarView flow="register-lifecycle" /> <RegistrarView flows="a,b" labels="A|B" /> bindings step by step (src/sip/registrar.ts)
<ExpiryClock initial={{ asked: 3600, natTimeout: 60 }} /> registration expiry vs NAT mapping (src/sip/expiry.ts)
<AttackMap /> <CertCheck /> attacks and defences; RFC 5922 certificate check (src/sip/attacks.ts, cert.ts)
<SdpLinter /> <OfferAnswer /> <HoldPlayer /> SDP lines, offer/answer, hold and resume (src/sip/sdp.ts)
<RtpHeader /> <JitterBuffer /> <BandwidthCalc /> RTP header bits, jitter buffer, bandwidth per layer (src/net/rtp.ts)
<RtcpExplorer /> <RttTimeline /> <MosCalc /> RTCP reports, round-trip time, R-factor and MOS (src/net/rtcp.ts)
<SrtpPacket /> <KeyExchange /> SRTP with real AES/HMAC; where the keys travel (src/net/srtp.ts)
<TransportRace /> one message over UDP (fragments) and TCP (src/net/transport.ts)
<NatSimulator /> <IceChecker /> a call through two NAT routers; ICE candidates and checks (src/net/nat.ts, nat-call.ts, ice.ts)
<FlowBuilder kind="call" preset={{ outcome: 'busy' }} /> a flow builder: options above a full ladder; kinds call, reinvite, transfer, events, trunk, balance, webrtc, imsreg, volte, stir (src/sip/generators.ts)
<FlowPair a="flow-id" b={{ kind: 'transfer', preset: {} }} /> Broken/Fixed where either side is a flow file or a generated flow
<NumberNormaliser /> a dialled number to E.164, tel URI, and user=phone (src/sip/numbers.ts)
<ElementCompare /> <SbcExplorer /> proxy vs B2BUA, message by message; SBC functions (src/sip/elements.ts, sbc.ts)
<SdpCompare /> <WebrtcGateway /> WebRTC SDP vs classic SDP; what a WebRTC gateway converts (src/sip/webrtc.ts)
<ImsMap /> the IMS functions, their headers, and the paths of REGISTER and calls (src/sip/ims.ts)
<PassportDecoder /> an Identity header decoded, with a live ES256 check (src/sip/stir.ts, stir-data.ts)
<QualityBudget /> <DscpExplorer /> delay, jitter, loss → MOS; DSCP, ToS, and priorities (src/net/quality.ts)- Write messages as they appear on the wire. The loader converts them to CRLF.
Content-Length: {auto}becomes the real body length in bytes.response="{digest}"becomes the real digest response, calculated from the header's parameters and the flow'scredentials.{digest:INVITE}calculates it for another method (an ACK copies the INVITE credentials).at:gives a step's time in seconds, andregistrar: { lane: … }checks a registration flow against the registrar model.trust: [lanes]marks the trust domain for the P-Asserted-Identity check. Akind: mediastep withoneway: trueis drawn with one arrowhead (hold, early media).- A flow with
broken: truemust list the rules it breaks inbreaks: [...]. The build fails if it breaks other rules, or does not break the listed ones. - Captions: at most 2 sentences of 20 words each, active voice. Labels: at most 5 words, starting with a method, a status code, or a glossary term.
Live site: https://sip.nanthakumar.com/
GitHub Actions builds and deploys to GitHub Pages on every push to main (.github/workflows/deploy.yml).
- Push the repository to GitHub (
https://github.com/nanthakumarg/sip-mastery). - In Settings → Pages, set Source to GitHub Actions.
- In Settings → Pages → Custom domain, enter
sip.nanthakumar.com, then tick Enforce HTTPS. DNS: aCNAMErecord fromsiptonanthakumarg.github.io. - Push to
main. The workflow builds forhttps://sip.nanthakumar.comwith base path/.