Skip to main content

The Problem of Finding Your Partner on the Internet

When two devices need to communicate with each other, both need to know the other’s IP address.
In some cases, you can contract a fixed IP from the provider, although this usually involves additional cost and is not always available (example: cooperatives that provide private subnets).
To solve these limitations, signaling protocols were developed, among them the most important: SIP (Session Initiation Protocol).

What is SIP?

SIP is a communication protocol between devices connected to the Internet.
Its main function is to allow two devices to find each other and establish a session without previously knowing their IP addresses.
  • Each SIP client has an address with a format similar to email:
    sip:user@server.com
  • Both clients must register with a SIP Server, which keeps the IP list updated.
  • The server acts as an “initial intermediary”, but data transfer is peer-to-peer between clients.
  • The system validates identity through username + password.

Basic SIP Call Flow

  1. Client A sends an INVITE to the SIP Server.
  2. The server forwards the request to B.
  3. B responds with RINGING → server forwards it to A.
  4. If B accepts, sends OK → forwarded to A.
  5. Both clients receive IP addresses and session parameters (SDP: sample rate, channels, codec).
  6. Audio/data flows directly between A and B.
  7. To end, BYE → OK is sent.
SIP is similar to email, but in real-time.
A client can even subscribe to presence notifications from their contacts.
In scenarios with routers/firewalls, NAT comes into play, adding complexity to the connection.
Complete specification: RFC 3261 – SIP: Session Initiation Protocol
https://datatracker.ietf.org/doc/html/rfc3261

How Do I Get a SIP Account?

There are many providers (free and paid).
Some offer limited free accounts; others include minutes to conventional telephony through monthly subscription.

Practical Guide

You can check the official guide:
Linphone SIP Accounts Configuration Guide
When creating an account, the provider delivers the following data:
  1. SIP Address
    Example:
    • sip:user@sipProvider.com
      Sometimes fields are delivered separately (user + server).
      Also called SIP identity, SIP URL or SIP URI.
  2. Domain
    Example:
    • sip:radiovirtual.linphone.org
    • sip:radiovirtual.onsip.com
      Also known as URL of Registrar or Reg Server.
  3. Realm (Authentication realm)
    • Can be the same as domain.
    • Usually configured as ”*”.
  4. Username / Auth Username
    • Some systems differentiate between generic user and authentication user.
    • Example:
      • Username: Luis_Garcia
      • Auth Username: lgarcia77
    • If provider delivers a single data → both are the same.
  5. Password
    • Password provided to validate against the server.

Example SIP Addresses

sip:studioFM@radiovirtual.onsip.com sip:productionstudio@linphone.org
Just like with emails, there is no restriction:
a client on one SIP provider can call another registered on a different provider.

Other Theoretical Definitions

IP Address

  • Each device connected to the Internet has an IP.
  • Format: four numbers separated by dots (e.g.: 192.168.0.100).
  • Hierarchical organization enables message routing.

Public IP vs Private IP

  • Within a LAN, devices use private IPs, not visible externally.
  • The router assigns a public IP to the entire network and functions as a firewall.

NAT (Network Address Translation)

  • Translates private IPs in the LAN to the router’s public IP.
  • Allows multiple devices to share a single external IP.
  • Different types of NAT exist, which can affect SIP.
More info: RFC 2663 – NAT Terminology
https://datatracker.ietf.org/doc/html/rfc2663

STUN

Session Traversal Utilities for NAT
Allows a client behind NAT to discover its public IP and the type of NAT in use.
Defined in RFC 5389.

TURN

Traversal Using Relays around NAT
Uses intermediate servers for clients behind symmetric NAT.
Defined in RFC 8656.

ICE

Interactive Connectivity Establishment
Combines NAT traversal techniques (STUN, TURN) to achieve connection between two devices in different LANs.
Defined in RFC 8445.