LEARN MODERN TELECOM
Learn Modern Telecom: From Analog Voice to a Global IP Network
Goal: Uncover the magic behind the modern telecommunications network. Understand how a phone call travels across the city or the world, how your phone connects to the internet, and how the legacy telephone system evolved into the global IP network we use today.
Why Learn About Modern Telecom?
The telecommunications network is the largest, most complex machine humanity has ever built. Understanding its architecture is fundamental to learning about networking, cybersecurity, IoT, and cloud computing. It’s the circulatory system of the digital world.
After completing these projects, you will:
- Understand the difference between the legacy circuit-switched telephone network and the modern packet-switched IP network.
- Know exactly how analog voice is converted to digital bits (PCM) and then into IP packets (VoIP).
- Be able to explain the roles of core telecom protocols like SIP, RTP, and MPLS.
- Understand how telcos provide internet access and connect to the broader web through peering.
- Be able to set up and analyze your own VoIP calls using professional-grade tools.
Core Concept Analysis
The Journey of a Phone Call: From Then to Now
The history of the telephone network is a story of evolution from dedicated copper circuits to a global, shared data network where voice is just another application.
1. The Legacy World: Public Switched Telephone Network (PSTN)
This was a network built for one purpose: voice.
┌────────┐ Analog ┌──────────┐ Digital (TDM) ┌──────────┐
│ Your ├───────────►│ Local ├───────────────────►│ Tandem │
│ Phone │ Copper Wire │ Exchange │ (T1/E1 Trunks) │ Switch │
└────────┘ (Local Loop)└──────────┘ └──────────┘
- Circuit-Switching: When you made a call, a dedicated, physical end-to-end circuit was established for you and you alone. The bandwidth was yours exclusively until you hung up.
- PCM (Pulse-Code Modulation): The first step in digitizing voice. The analog signal from your phone is sampled 8,000 times per second. Each sample is measured (quantized) and assigned an 8-bit value. This creates the fundamental building block of digital voice: a 64 kbps data stream called a DS0 (Digital Signal 0).
- TDM (Time-Division Multiplexing): To save wires, telcos combined multiple DS0 voice channels into a single, higher-speed digital trunk. A T1 line in North America and Japan, for example, interleaves 24 separate 64 kbps voice channels into a single 1.544 Mbps stream.
- SS7 (Signaling System 7): A separate, parallel network that handled all the “control” tasks: setting up the call, routing it, billing, and tearing it down. The voice itself traveled on the TDM network (the “bearer” path).
2. The Modern World: The All-IP Network
Today, the core network is a massive, private data network. Voice is just one of many applications running on it.
┌────────┐ IP ┌───────────┐ IP/MPLS ┌───────────┐
│ Your ├──────────►│ ISP/ ├───────────────►│ IP Core │
│ IP Phone │ (Ethernet) │ Telco │ (Fiber) │ Network │
└────────┘ │ Edge Router │ └─────┬─────┘
└───────────┘ │ Peering
▼
┌───────────┐
│ The Public│
│ Internet │
└───────────┘
- Packet-Switching: All data—voice, video, web pages—is broken into small packets. Each packet is individually addressed and routed across a shared network. There is no dedicated end-to-end circuit. This is vastly more efficient.
- VoIP (Voice over IP): The modern way of carrying voice. Instead of a continuous 64 kbps stream, the audio is encoded, compressed, and placed into packets.
- SIP (Session Initiation Protocol): The new signaling protocol. It’s a text-based protocol, similar to HTTP, used to start, modify, and end a “session” (like a phone call). This is the modern replacement for SS7’s call setup functions.
- RTP (Real-time Transport Protocol): The protocol that carries the actual audio/video data. Each RTP packet contains a small chunk of audio, along with a sequence number and timestamp to help the receiving end reassemble the stream correctly, even if packets arrive out of order.
- Codecs: VoIP uses codecs (coder-decoders) to compress audio. While one codec (G.711) is essentially uncompressed PCM at 64 kbps, others like G.729 or Opus can provide similar quality at a fraction of the bandwidth (e.g., 8-32 kbps).
- How Telcos Connect to the Web: A telco’s private IP core network is just one Autonomous System (AS) on the internet. To connect its customers to the rest of the web (e.g., Google, Netflix), it uses:
- Peering: A direct, often settlement-free, connection to another large network at an Internet Exchange Point (IXP).
- Transit: Paying a larger, “Tier 1” network provider to carry its traffic to parts of the internet it doesn’t have a direct peering relationship with.
3. The Bridge: Do telcos still use PCM?
Yes, but mostly at the edges. The core is all-IP. A Media Gateway is a crucial device that acts as a translator.
- When a call comes from an old T1 line, the media gateway converts the TDM/PCM stream and SS7 signaling into IP packets (RTP/SIP).
- When a VoIP call needs to go out to a legacy number, the gateway does the reverse. So, while your call might start as PCM, it is almost immediately converted to VoIP to travel across the modern core network.
Project List
These projects will take you from the fundamental physics of digital audio to the high-level protocols that run the global internet.
Project 1: PCM Audio Encoder/Decoder
- File: LEARN_MODERN_TELECOM.md
- Main Programming Language: Python
- Alternative Programming Languages: C, C++
- Coolness Level: Level 3: Genuinely Clever
- Business Potential: 1. The “Resume Gold”
- Difficulty: Level 1: Beginner
- Knowledge Area: Digital Signal Processing (DSP) / Audio Fundamentals
- Software or Tool: Standard audio libraries (e.g.,
scipy.io.wavfilein Python) - Main Book: “Understanding Digital Signal Processing, 3rd Edition” by Richard G. Lyons
What you’ll build: A program that reads a standard .wav audio file, resamples it to 8000 Hz, quantizes it to 8-bit µ-law or A-law PCM (the telephone standards), and saves the result. You’ll then write a decoder to convert it back.
Why it teaches modern telecom: This is the absolute foundation of all digital voice. You’ll understand what “digitizing voice” really means and hear the quality trade-offs firsthand. Every VoIP call, at its core, contains PCM data.
Core challenges you’ll face:
- Reading WAV file data → maps to understanding sample rates, bit depth, and raw audio buffers
- Resampling audio → maps to the concept of Nyquist theorem and why 8kHz was chosen for voice
- Implementing µ-law/A-law companding → maps to understanding non-linear quantization and why it’s used to improve dynamic range in 8-bit audio
- Manipulating raw byte buffers → maps to working with data at the level telcos do
Key Concepts:
- Sampling and Quantization: “Understanding Digital Signal Processing” - Chapter 1
- µ-law and A-law Companding: Wikipedia provides the standard formulas.
- WAV File Format: Any online resource explaining the WAV header and data chunk.
Difficulty: Beginner Time estimate: Weekend Prerequisites: Basic programming, understanding of binary data (bytes vs. floats).
Real world outcome: You will have two scripts. One takes a high-quality audio file and produces a scratchy, telephone-quality version. The other converts it back. You can clearly hear the effect of the 64 kbps encoding.
> python pcm_encoder.py --input music.wav --output telephone_voice.u8
Input: music.wav (44100 Hz, 16-bit)
Output: telephone_voice.u8 (8000 Hz, 8-bit u-law)
> python pcm_decoder.py --input telephone_voice.u8 --output music_decoded.wav
# Playing music_decoded.wav sounds like it's coming through an old phone line.
Learning milestones:
- You can read a WAV file into a numerical array → You understand raw audio data.
- You correctly resample the audio to 8kHz → You understand sample rates.
- You implement the µ-law/A-law conversion → You understand the core of telephone-grade PCM.
- You can hear the distinctive quality of 64 kbps voice → You have an intuitive feel for the baseline of digital telephony.
Project 2: RTP Packet Streamer & Player
- File: LEARN_MODERN_TELECOM.md
- Main Programming Language: Python
- Alternative Programming Languages: Go, C++
- Coolness Level: Level 4: Hardcore Tech Flex
- Business Potential: 1. The “Resume Gold”
- Difficulty: Level 2: Intermediate
- Knowledge Area: VoIP / Network Protocols
- Software or Tool: UDP Sockets
- Main Book: “TCP/IP Sockets in C” by Donahoo & Calvert (for socket concepts)
What you’ll build: Two programs. A “streamer” that reads a PCM audio file (like the one from Project 1), chops it into small chunks, wraps each chunk in an RTP header, and sends it as a stream of UDP packets. A “player” that listens for these packets, extracts the audio payload, and plays it out the speaker in real time.
Why it teaches modern telecom: This project teaches you how VoIP actually works at the packet level. You’ll move from a static file (PCM) to a real-time stream (RTP), dealing with the unreliability of a packet network.
Core challenges you’ll face:
- Constructing an RTP header → maps to manually building a 12-byte header with version, sequence number, timestamp, and SSRC
- UDP socket programming → maps to sending and receiving connectionless packets
- Packetization → maps to deciding how much audio data (e.g., 20ms) to put in each packet
- Jitter buffering (simple) → maps to creating a small buffer on the receiver to reorder packets that arrive out of order before playback
Key Concepts:
- RTP Protocol: RFC 3550 - The official specification. You only need to focus on the header.
- UDP Sockets: Python’s
socketlibrary documentation. - Jitter: “VoIP and WebRTC” blog by Tsahi Levent-Levi.
Difficulty: Intermediate Time estimate: 1-2 weeks Prerequisites: Project 1, understanding of IP addresses, ports, and basic networking.
Real world outcome: You can run the streamer on one machine and the player on another. You will hear the audio from the file being played on the remote machine, streamed over your local network.
# On machine 1 (192.168.1.10)
> python rtp_streamer.py --file telephone_voice.u8 --dest 192.168.1.20:12345
Streaming 20ms packets...
# On machine 2 (192.168.1.20)
> python rtp_player.py --listen 0.0.0.0:12345
Listening for RTP packets on port 12345...
(Audio starts playing through the speakers)
Implementation Hints:
- The RTP header is 12 bytes. Use Python’s
structmodule to pack your fields (version, sequence number, etc.) into a binary header. - For the streamer, read 160 bytes from your 8kHz µ-law file. This represents 20ms of audio (
8000 samples/sec * 0.020 sec = 160 samples). This is a typical packetization interval. - Increment the sequence number by 1 for each packet. Increment the timestamp by 160 for each packet.
- For the player, receive a UDP packet, parse the RTP header to get the sequence number, and place the payload into a dictionary keyed by sequence number (this is your simple jitter buffer).
- Have a separate thread that pulls the next-in-sequence packet from the jitter buffer and sends it to an audio playback library (like
pyaudio).
Learning milestones:
- The player receives UDP packets from the streamer → Your basic network code is working.
- The player can parse the RTP header → You understand the RTP protocol structure.
- Audio plays back, even if it’s choppy → You have a complete, end-to-end pipeline.
- Audio playback is smooth, even if you introduce artificial packet reordering → Your jitter buffer is working.
Project 3: A Basic SIP User Agent (Client)
- File: LEARN_MODERN_TELECOM.md
- Main Programming Language: Python
- Alternative Programming Languages: Go, JavaScript (with WebRTC)
- Coolness Level: Level 3: Genuinely Clever
- Business Potential: 2. The “Micro-SaaS / Pro Tool”
- Difficulty: Level 3: Advanced
- Knowledge Area: VoIP / Signaling Protocols
- Software or Tool: SIP Protocol, UDP/TCP Sockets
- Main Book: N/A, rely on RFC 3261 and online tutorials.
What you’ll build: A command-line program that acts as a minimal SIP phone. It will be able to send a REGISTER message to a SIP server to “log in” and an INVITE message to another user to “start a call.” You don’t need to handle the audio (RTP) stream yet; the goal is to master the signaling.
Why it teaches modern telecom: This project demystifies call setup. You’ll learn that a “phone call” in the modern world is just a series of text-based messages, very much like HTTP, that negotiate a media session.
Core challenges you’ll face:
- Constructing SIP messages → maps to learning the specific format of SIP headers (Via, From, To, CSeq, Call-ID) and the request line
- Parsing SIP responses → maps to handling status codes like
200 OK,401 Unauthorized, and404 Not Found - Understanding SIP transaction state → maps to matching responses to requests using the
CSeqandViaheaders - Handling SIP authentication → maps to responding to a
401 Unauthorizedchallenge by re-sending the request with anAuthorizationheader
Key Concepts:
- SIP Protocol: RFC 3261 - It’s huge, so focus on the sections for
REGISTERandINVITE. - SIP Call Flow: Search for “Basic SIP Call Flow” diagrams online.
- SDP (Session Description Protocol): The language inside SIP messages used to describe the media (e.g., “I want to send µ-law audio on UDP port 12345”).
Difficulty: Advanced Time estimate: 2-3 weeks Prerequisites: Project 2, understanding of HTTP request/response flow.
Real world outcome:
You will run your script, and a softphone app (like Zoiper or Linphone) on your desk will ring. When you answer, your script will receive a 200 OK message.
# You need a SIP server. An easy way is to run Asterisk (Project 4)
# or use a free public service.
> python sip_client.py --user me --server sip.example.com --password hunter2 --call user2@sip.example.com
Sending INVITE to user2@sip.example.com
...
Received: 180 Ringing
(The other user's phone is ringing now)
...
Received: 200 OK
Call is now established! (Media would flow now)
Implementation Hints:
- A SIP message is just text sent over UDP (usually). You can construct it with string formatting.
- The
Via,From,To,Call-ID, andCSeqheaders are mandatory for almost all requests. - The
Call-IDshould be a unique random string for the entire call. TheCSeq(Command Sequence) number increments for each new request within a call. - To start, focus on the
INVITErequest and the100 Trying,180 Ringing, and200 OKresponses. - Inside the
INVITE, you’ll need a simple SDP payload. You can hardcode one that says you’re willing to receive G.711 (PCM) audio on a specific port.
Learning milestones:
- Your client can send a
REGISTERrequest and get a200 OKback → You can “log in” to a SIP server. - Your client can send an
INVITEand make another phone ring → You understand basic call setup. - Your client correctly handles the
ACKmessage after receiving a200 OK→ You are managing the SIP transaction correctly. - Your client can handle a
401authentication challenge → You can handle real-world SIP security.
Project 4: Run Your Own Telephone Company with Asterisk
- File: LEARN_MODERN_TELECOM.md
- Main Programming Language: Asterisk Dialplan (a custom configuration language)
- Alternative Programming Languages: N/A
- Coolness Level: Level 4: Hardcore Tech Flex
- Business Potential: 3. The “Service & Support” Model
- Difficulty: Level 2: Intermediate
- Knowledge Area: VoIP / Network Architecture
- Software or Tool: Asterisk, Linux, Softphones (Zoiper/Linphone)
- Main Book: “Asterisk: The Definitive Guide, 5th Edition” by Russell Bryant, et al.
What you’ll build: You will install and configure Asterisk, a powerful open-source PBX (Private Branch Exchange), on a Linux server (a VM is fine). You will then configure it to act as the “telephone company” for two softphones, allowing them to call each other by dialing extensions.
Why it teaches modern telecom: This project gives you a hands-on feel for the “core network.” You’ll be playing the role of the telco, managing users, defining how calls are routed (the “dialplan”), and seeing how a central switch (known as a PBX, PABX, or Softswitch) is the heart of a phone system.
Core challenges you’ll face:
- Installing Asterisk → maps to Linux system administration and package management
- Configuring
sip.conf→ maps to defining SIP users, passwords, and capabilities - Configuring
extensions.conf→ maps to learning dialplan logic: how to handle a call when someone dials “101” - Troubleshooting call failures → maps to reading the Asterisk CLI output to debug why a call isn’t connecting
Key Concepts:
- PBX Functionality: “Asterisk: The Definitive Guide” - Chapter 1
- SIP Configuration: “Asterisk: The Definitive Guide” - Chapter 5
- Dialplan Basics: “Asterisk: The Definitive Guide” - Chapter 6
Difficulty: Intermediate Time estimate: 1-2 weeks Prerequisites: Basic Linux command-line skills.
Real world outcome: You will have two softphone apps (e.g., one on your computer, one on your smartphone) registered to your Asterisk server. You can dial extension “101” from one phone, and the other phone will ring. You can answer and have a conversation, with all the traffic being routed through your Asterisk server.
Asterisk CLI Output:
-- Executing [101@users:1] Dial("SIP/100-00000001", "SIP/101,20") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/101
-- SIP/101-00000002 is ringing
-- SIP/101-00000002 answered SIP/100-00000001
-- Remotely bridging SIP/100-00000001 and SIP/101-00000002
Implementation Hints:
- Install Asterisk on a Debian or CentOS VM.
- Edit
/etc/asterisk/sip.conf. Create two user sections, e.g.,[100]and[101]. Define asecret(password) for each. - Edit
/etc/asterisk/extensions.conf. In the[users]context, create the logic.exten => 101,1,Dial(SIP/101)means “When someone dials 101, the first step is to Dial the SIP phone configured as user 101.”
- Run
asterisk -rvvvto get to the verbose CLI. - Configure your two softphones using the user/secret/server-IP you defined in
sip.conf. - Make a call!
Learning milestones:
- Both softphones can register successfully with Asterisk → Your
sip.confis correct and your network is set up properly. - You can make a call from one phone to the other → Your dialplan (
extensions.conf) is working. - You can add a voicemail box → You can use Asterisk’s built-in applications.
- You can configure a trunk to a real VoIP provider to make outbound calls to the real world → You have bridged your private network to the public telephone network.
Project 5: Visualizing Internet Routing with BGP
- File: LEARN_MODERN_TELECOM.md
- Main Programming Language: Python
- Alternative Programming Languages: JavaScript
- Coolness Level: Level 3: Genuinely Clever
- Business Potential: 2. The “Micro-SaaS / Pro Tool”
- Difficulty: Level 2: Intermediate
- Knowledge Area: Internet Architecture / Routing Protocols
- Software or Tool: RIPEstat API, BGP
- Main Book: “Internet Routing Architectures, 2nd Edition” by Sam Halabi
What you’ll build: A script that uses a public internet routing API (like RIPEstat) to visualize the Autonomous System (AS) path to a given IP address or domain. Your tool will show how packets traverse different telcos and internet backbone networks to reach their destination.
Why it teaches modern telecom: This project moves up to the macro level, answering “how do telcos connect to the web?”. You’ll learn that the internet isn’t a cloud; it’s a collection of thousands of independent networks (ASes) connected by peering agreements and governed by the BGP routing protocol.
Core challenges you’ll face:
- Interacting with a REST API → maps to making HTTP GET requests and parsing JSON responses
- Understanding BGP and Autonomous Systems → maps to learning what an AS Number (ASN) represents
- Mapping IPs to ASNs → maps to using API endpoints to find out which organization owns a block of IPs
- Visualizing path data → maps to printing a clear, hop-by-hop list of the networks involved
Key Concepts:
- BGP and ASNs: “BGP for All” by Andree Toonk (Blog series).
- Internet Exchange Points (IXPs): “Peering Playbook” by Dave Temkin.
- Using REST APIs: Python’s
requestslibrary documentation.
Difficulty: Intermediate Time estimate: Weekend Prerequisites: Basic Python, understanding of what an IP address is.
Real world outcome: A tool that gives you a high-level “traceroute” showing the network providers, not just the individual router hops.
> python bgp_tracer.py google.com
Tracing path to google.com (142.251.32.46)...
Path from RIPE Probe #1234 (Amsterdam, NL):
1. AS3356 - Level 3 Communications (Tier 1)
2. AS174 - Cogent Communications (Tier 1)
3. AS15169 - Google LLC
Destination Reached.
Path from RIPE Probe #5678 (Tokyo, JP):
1. AS2516 - KDDI Corporation (Japanese Telco)
2. AS4713 - NTT America, Inc.
3. AS15169 - Google LLC
Destination Reached.
Implementation Hints:
- Sign up for a free RIPEstat account if needed.
- Your script will make a series of API calls.
- First, resolve the domain name to an IP address.
- Use the “Traceroute” endpoint from the RIPEstat data API. This allows you to request traceroutes from various probes around the world to your destination IP.
- Parse the JSON response. Each hop in the traceroute will have an IP address.
- For each unique AS number in the path, make another API call to get the AS details (like the owner’s name).
- Format and print the results in a human-readable path.
Learning milestones:
- You can fetch data from the RIPEstat API → You can use REST APIs.
- You can map an IP address to its owner AS → You understand the relationship between IPs and ASNs.
- You can trace the path to a major website → You can see how data flows across internet backbones.
-
You can explain the difference between your home ISP’s AS and a Tier 1 provider’s AS → You understand the hierarchy of the internet.
Project Comparison Table
| Project | Difficulty | Time | Core Concept | Fun Factor |
|---|---|---|---|---|
| 1. PCM Encoder/Decoder | Beginner | Weekend | Digital Audio | ★★★☆☆ |
| 2. RTP Streamer & Player | Intermediate | 1-2 weeks | VoIP Bearer | ★★★★☆ |
| 3. Basic SIP Client | Advanced | 2-3 weeks | VoIP Signaling | ★★★☆☆ |
| 4. Asterisk PBX | Intermediate | 1-2 weeks | Network Core | ★★★★★ |
| 5. BGP Path Visualizer | Intermediate | Weekend | Internet Routing | ★★★★☆ |
Recommendation
To get the best foundational understanding, follow this path:
-
Project 1: PCM Encoder/Decoder: Start here. This is non-negotiable. Understanding how analog sound becomes digital bits is the first principle of all digital communication, from a 1980s telephone exchange to a 2025 VoLTE call.
-
Project 2: RTP Packet Streamer & Player: This project directly builds on the first and teaches you the “VoIP” part of the equation. You’ll intuitively grasp what it means for voice to be “just data” and why things like packet loss and jitter matter.
-
Project 4: Run Your Own Telephone Company with Asterisk: This is the most fun and rewarding project. It contextualizes everything else. When you configure Asterisk, you’ll see settings for codecs (Project 1) and RTP timers (Project 2) and SIP authentication (Project 3). It provides the central switch that makes all the other concepts “click.”
After completing these three projects, you will have a robust, hands-on understanding of how modern telecom works, from the individual voice sample to the core network routing it.
Summary
- Project 1: PCM Audio Encoder/Decoder: Python
- Project 2: RTP Packet Streamer & Player: Python
- Project 3: A Basic SIP User Agent (Client): Python
- Project 4: Run Your Own Telephone Company with Asterisk: Asterisk Dialplan
- Project 5: Visualizing Internet Routing with BGP: Python