SlideShare a Scribd company logo
3
Most read
4
Most read
15
Most read
rtpengine & kamailio
or how to simulate calls at scale
Andreas Granig <agranig@sipfront.com>
AT THE NETWORK EDGE
rtpengine & kamailio
Load Testing
Architecture
RTP Sinkhole NAT Piercing RTP Echo RTP PubSub
LOAD TESTING
ARCHITECTURE
rtpengine & kamailio
● Context
○ At sipfront.com, we develop a
SaaS for Telco Test Automation
● Load testing is resource intensive
○ sipp for signaling
○ tcpreplay for media
● kamailio & rtpengine to the rescue
○ protocol conversion for signaling
○ reflection & termination for media
LOAD TESTING ARCHITECTURE
rtpengine & kamailio
tcpreplay
+ RTP patch 1
sipp
SIP
RTP
kamailio
rtpengine
sinkhole
kamailio sipp
rtpengine
pierce-nat + echo
system
under
test
SDP info ctrl ctrl
NAT NAT
1
https://github.com/agranig/tcpreplay/tree/agranig/sipfront-rtp-edit
RTP SINKHOLE
rtpengine & kamailio
● Sometimes, you just don’t wanna talk…
○ but want to keep track of stats
○ and want to avoid ICMP port
unreachable messages
RTP SINKHOLE
rtpengine & kamailio
rtpengine
kamailio
SIP
RTP
media-echo=sinkhole
RTCP
MQTT stats
route {
# ...
if (outwards) {
rtpengine_offer("
direction=internal direction=external
media-echo=sinkhole generate-RTCP
");
}
# ...
}
reply_route {
# ...
if (outwards) {
rtpengine_answer("
direction=internal direction=external
media-echo=sinkhole generate-RTCP
");
}
# ...
}
RTP SINKHOLE
rtpengine & kamailio
rtpengine 
--interface=internal/192.168.0.100 
--interface=external/192.168.0.100!1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Config rtpengine
NAT PIERCING
rtpengine & kamailio
● “you start first” - “no, you start first”
○ If you’d like to echo media
○ but the peer can’t send you anything
to echo back
NAT PIERCING
rtpengine & kamailio
kamailio
SIP
RTP
pierce-NAT
rtpengine
dummy RTP
NAT
route {
# ...
if (inwards) {
rtpengine_offer("
direction=external direction=internal
pierce-NAT
");
}
# ...
}
reply_route {
# ...
if (outwards) {
rtpengine_answer("
direction=external direction=internal
pierce-NAT
");
}
# ...
}
NAT PIERCING
rtpengine & kamailio
rtpengine 
--interface=internal/192.168.0.100 
--interface=external/192.168.0.100!1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Config rtpengine
RTP ECHO
rtpengine & kamailio
● “You made this? I made this!”
○ send back incoming media with
new SSRC
○ for when you need two-way media
without the generation overhead
RTP ECHO
rtpengine & kamailio
kamailio
SIP
RTP
media-echo=forward | backward
rtpengine
RTP echo
route {
# ...
if (outwards) {
rtpengine_offer("
direction=internal direction=external
media-echo=backward
");
}
# ...
}
reply_route {
# ...
if (outwards) {
rtpengine_answer("
direction=internal direction=external
media-echo=forward
");
}
# ...
}
RTP ECHO
rtpengine & kamailio
rtpengine 
--interface=internal/192.168.0.100 
--interface=external/192.168.0.100!1.2.3.4 
--listen-ng=127.0.0.1:12221
Kamailio Config rtpengine
RTP PUBSUB
rtpengine & kamailio
● “Listen up, everybody…”
○ Send an RTP stream once
○ and duplicate it to multiple
recipients
○ for SFU, SIPREC, Interception, …
RTP PUBSUB
rtpengine & kamailio
rtpengine
Kamailio
SIP - cid=X, ftag=A, ttag=B
RTP
offer
in: SDP
out: SDP
answer
in: SDP
out: SDP
subscribe-request
in: cid=X, ftag=A
out: SDP
SIP - cid=Y, ftag=C, ttag=D
subscribe-answer
in: cid=X, ftag=A, ttag=C, SDP
RTP
send-only
App Interceptor
publish
in: SDP
out: SDP
or optionally (if no SIP context):
RTP PUBSUB
rtpengine & kamailio
https://github.com/davehorton/rtpengine-client hopefully soon!
const Client = require('rtpengine-client').Client;
const client = new Client();
client
.subscribeRequest(12280, '127.0.0.1', {
'call-id': 'test-call-id',
'from-tag': 'test-tag'
})
.then((res) => {
console.log(`Received ${JSON.stringify(res)}`);
})
.catch((err) => {
console.log(`Error: ${err}`);
});
rtpengine 
--interface=internal/192.168.0.100 
--interface=external/192.168.0.100!1.2.3.4 
--listen-ng=127.0.0.1:12221 
--listen-http=127.0.0.1:12280
NodeJS rtpengine-client rtpengine
THANK YOU
Questions?
or any time online
Twitter: @andreasgranig
Email: agranig@sipfront.com
join private beta at
https://sipfront.com

More Related Content

PDF
rtpengine - Media Relaying and Beyond
PDF
Sipwise rtpengine
PDF
Kamailio - SIP Routing in Lua
PDF
Kamailio - API Based SIP Routing
ODP
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
PDF
SIP Attack Handling (Kamailio World 2021)
ODP
Expanding Asterisk with Kamailio
PDF
Scaling FreeSWITCH Performance
rtpengine - Media Relaying and Beyond
Sipwise rtpengine
Kamailio - SIP Routing in Lua
Kamailio - API Based SIP Routing
Using Asterisk and Kamailio for Reliable, Scalable and Secure Communication S...
SIP Attack Handling (Kamailio World 2021)
Expanding Asterisk with Kamailio
Scaling FreeSWITCH Performance

What's hot (20)

PDF
Kamailio, FreeSWITCH, and You
PDF
Scaling Asterisk with Kamailio
PDF
Kamailio :: A Quick Introduction
PDF
Continuous Integration and Kamailio
PDF
Kamailio with Docker and Kubernetes
PDF
Kamailio - Load Balancing Load Balancers
PDF
SIPREC RTPEngine Media Forking
PDF
FreeSWITCH as a Microservice
PDF
Kamailio on Docker
PPTX
Understanding DPDK
PPTX
TRex Realistic Traffic Generator - Stateless support
PDF
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
PDF
Introduction to FreeSWITCH
PPTX
FreeSWITCH as a Kickass SBC
PDF
Linux Networking Explained
ODP
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
PDF
Aynchronous Processing in Kamailio Configuration File
PDF
FreeSWITCH on Docker
PPTX
Bare Metal Cluster with Kubernetes, Istio and Metallb | Nguyen Phuong An, Ngu...
PDF
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Kamailio, FreeSWITCH, and You
Scaling Asterisk with Kamailio
Kamailio :: A Quick Introduction
Continuous Integration and Kamailio
Kamailio with Docker and Kubernetes
Kamailio - Load Balancing Load Balancers
SIPREC RTPEngine Media Forking
FreeSWITCH as a Microservice
Kamailio on Docker
Understanding DPDK
TRex Realistic Traffic Generator - Stateless support
Three Ways Kamailio Can Help Your FreeSWITCH Deployment
Introduction to FreeSWITCH
FreeSWITCH as a Kickass SBC
Linux Networking Explained
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Aynchronous Processing in Kamailio Configuration File
FreeSWITCH on Docker
Bare Metal Cluster with Kubernetes, Istio and Metallb | Nguyen Phuong An, Ngu...
Astricon 10 (October 2013) - SIP over WebSocket on Kamailio
Ad

Similar to rtpengine and kamailio - or how to simulate calls at scale (20)

PDF
netfilter and iptables
PDF
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
PDF
JavaOne - A Sip Of Java - RJ Auburn
PPT
OSTU - hrPING QuickStart Part 1 (by Tony Fortunato & Peter Ciuffreda)
PDF
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
PDF
Automate your Kamailio Test Calls - Kamailio World 2024
PDF
Eplan P8 Data Portal Crackbfdcm
PDF
KCD Zurich 2023 — Bridge Dev & Ops with eBPF.pdf
PPTX
PLNOG 13: P. Kupisiewicz, O. Pelerin: Make IOS-XE Troubleshooting Easy – Pack...
PDF
True stories on the analysis of network activity using Python
PPTX
Brightcove live tech overview
PDF
Architecture Aware Partitioning of Open-CL Programs
TXT
Services
ODP
LCDS - State Presentation
PDF
Detecting Spoofing at IXPs
PDF
Detecting spoofing at IxP's
ODP
nftables - the evolution of Linux Firewall
PDF
Hacking With Nmap - Scanning Techniques
PDF
Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...
PPTX
netfilter and iptables
A Framework for Efficient Rapid Prototyping by Virtually Enlarging FPGA Resou...
JavaOne - A Sip Of Java - RJ Auburn
OSTU - hrPING QuickStart Part 1 (by Tony Fortunato & Peter Ciuffreda)
Comparing On-The-Fly Accelerating Packages: Numba, TensorFlow, Dask, etc
Automate your Kamailio Test Calls - Kamailio World 2024
Eplan P8 Data Portal Crackbfdcm
KCD Zurich 2023 — Bridge Dev & Ops with eBPF.pdf
PLNOG 13: P. Kupisiewicz, O. Pelerin: Make IOS-XE Troubleshooting Easy – Pack...
True stories on the analysis of network activity using Python
Brightcove live tech overview
Architecture Aware Partitioning of Open-CL Programs
Services
LCDS - State Presentation
Detecting Spoofing at IXPs
Detecting spoofing at IxP's
nftables - the evolution of Linux Firewall
Hacking With Nmap - Scanning Techniques
Talk@JanusCon2019: Janus, WebRTC and ML - Fantastic technologies and how to m...
Ad

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Network Security Unit 5.pdf for BCA BBA.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Spectral efficient network and resource selection model in 5G networks
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...

rtpengine and kamailio - or how to simulate calls at scale

  • 1. rtpengine & kamailio or how to simulate calls at scale Andreas Granig <agranig@sipfront.com>
  • 2. AT THE NETWORK EDGE rtpengine & kamailio Load Testing Architecture RTP Sinkhole NAT Piercing RTP Echo RTP PubSub
  • 3. LOAD TESTING ARCHITECTURE rtpengine & kamailio ● Context ○ At sipfront.com, we develop a SaaS for Telco Test Automation ● Load testing is resource intensive ○ sipp for signaling ○ tcpreplay for media ● kamailio & rtpengine to the rescue ○ protocol conversion for signaling ○ reflection & termination for media
  • 4. LOAD TESTING ARCHITECTURE rtpengine & kamailio tcpreplay + RTP patch 1 sipp SIP RTP kamailio rtpengine sinkhole kamailio sipp rtpengine pierce-nat + echo system under test SDP info ctrl ctrl NAT NAT 1 https://github.com/agranig/tcpreplay/tree/agranig/sipfront-rtp-edit
  • 5. RTP SINKHOLE rtpengine & kamailio ● Sometimes, you just don’t wanna talk… ○ but want to keep track of stats ○ and want to avoid ICMP port unreachable messages
  • 6. RTP SINKHOLE rtpengine & kamailio rtpengine kamailio SIP RTP media-echo=sinkhole RTCP MQTT stats
  • 7. route { # ... if (outwards) { rtpengine_offer(" direction=internal direction=external media-echo=sinkhole generate-RTCP "); } # ... } reply_route { # ... if (outwards) { rtpengine_answer(" direction=internal direction=external media-echo=sinkhole generate-RTCP "); } # ... } RTP SINKHOLE rtpengine & kamailio rtpengine --interface=internal/192.168.0.100 --interface=external/192.168.0.100!1.2.3.4 --listen-ng=127.0.0.1:12221 Kamailio Config rtpengine
  • 8. NAT PIERCING rtpengine & kamailio ● “you start first” - “no, you start first” ○ If you’d like to echo media ○ but the peer can’t send you anything to echo back
  • 9. NAT PIERCING rtpengine & kamailio kamailio SIP RTP pierce-NAT rtpengine dummy RTP NAT
  • 10. route { # ... if (inwards) { rtpengine_offer(" direction=external direction=internal pierce-NAT "); } # ... } reply_route { # ... if (outwards) { rtpengine_answer(" direction=external direction=internal pierce-NAT "); } # ... } NAT PIERCING rtpengine & kamailio rtpengine --interface=internal/192.168.0.100 --interface=external/192.168.0.100!1.2.3.4 --listen-ng=127.0.0.1:12221 Kamailio Config rtpengine
  • 11. RTP ECHO rtpengine & kamailio ● “You made this? I made this!” ○ send back incoming media with new SSRC ○ for when you need two-way media without the generation overhead
  • 12. RTP ECHO rtpengine & kamailio kamailio SIP RTP media-echo=forward | backward rtpengine RTP echo
  • 13. route { # ... if (outwards) { rtpengine_offer(" direction=internal direction=external media-echo=backward "); } # ... } reply_route { # ... if (outwards) { rtpengine_answer(" direction=internal direction=external media-echo=forward "); } # ... } RTP ECHO rtpengine & kamailio rtpengine --interface=internal/192.168.0.100 --interface=external/192.168.0.100!1.2.3.4 --listen-ng=127.0.0.1:12221 Kamailio Config rtpengine
  • 14. RTP PUBSUB rtpengine & kamailio ● “Listen up, everybody…” ○ Send an RTP stream once ○ and duplicate it to multiple recipients ○ for SFU, SIPREC, Interception, …
  • 15. RTP PUBSUB rtpengine & kamailio rtpengine Kamailio SIP - cid=X, ftag=A, ttag=B RTP offer in: SDP out: SDP answer in: SDP out: SDP subscribe-request in: cid=X, ftag=A out: SDP SIP - cid=Y, ftag=C, ttag=D subscribe-answer in: cid=X, ftag=A, ttag=C, SDP RTP send-only App Interceptor publish in: SDP out: SDP or optionally (if no SIP context):
  • 16. RTP PUBSUB rtpengine & kamailio https://github.com/davehorton/rtpengine-client hopefully soon! const Client = require('rtpengine-client').Client; const client = new Client(); client .subscribeRequest(12280, '127.0.0.1', { 'call-id': 'test-call-id', 'from-tag': 'test-tag' }) .then((res) => { console.log(`Received ${JSON.stringify(res)}`); }) .catch((err) => { console.log(`Error: ${err}`); }); rtpengine --interface=internal/192.168.0.100 --interface=external/192.168.0.100!1.2.3.4 --listen-ng=127.0.0.1:12221 --listen-http=127.0.0.1:12280 NodeJS rtpengine-client rtpengine
  • 17. THANK YOU Questions? or any time online Twitter: @andreasgranig Email: agranig@sipfront.com join private beta at https://sipfront.com