Internet PSTN (iPSTN)


Internet PSTN (iPSTN)

Overview

The goals are:

  • enable data modems to connect in the absence of a PSTN
  • restore/provide period correct communications for retro devices
  • compatible with existing software
  • inspire retro users, BBS sysops, ISP system admins
  • open, cheap and simple, small and modern technology solution
  • Ideally work with analogue telephones too
  • Ideally flexible enough to also support ISDN and ADSL


Issues with exisiting solutions

  • Telephone line emulator/adapter (TLE): local connections only
  • Analogue telephone adapter (ATA): do not support data well, if at all
    • lossy voice codecs
    • data not specifically handled
    • fax may be available by T.38
  • PABX: big, hot, noisy, expensive, complicated to setup, data support unknown
https://dogemicrosystems.ca/wiki/Dial-up_pool#Choosing_Modem_Hardware
"Dial-up over VoIP can be unreliable so it is best to keep speeds low. If you don't already have a modem I would recommend looking for a 14.4k modem for the sake of reliability."

Relevant standards

Telephone number / IP / DNS resolution

  • Telephone number mapping: https://en.wikipedia.org/wiki/Telephone_number_mapping
  • https://en.wikipedia.org/wiki/E.123
  • https://en.wikipedia.org/wiki/E.164

PSTN 

  • electrical levels (DC 48V)
  • electrical signalling: dial tone, ring, busy

Solution strategies

  • modem PSTN socket <-RJ11-> TLE PSTN socket <-> analogue to digital <-> microcontroller <-> IPv4 <-> UDP <-> WiFi
    • carrier board with telephone and power circuitry, socket for mounting off the shelf MCU


Interfaces

PSTN

  • RJ11 socket

TLE

  • Supply PSTN line level voltage
  • PSTN signalling:
    • Dial tone - if wifi connected
    • ring - connected to remote iPSTN
    • busy - rejected by remote iPSTN (busy or no CPE attached)
  • voltage level convert from PSTN line level (48V ??) to 3.3V on the microcontroller side
    • voltage divider
https://www.telephonetribute.com/telco_line_simulators.html

Analogue to digital conversion (ADC)



Microcontroller/Computer

  • wifi/network configuration
  • Detect modem on/off hook
  • Detect DTMF dial tones. Translate phone number into ip address. perhaps a dedicated country code for the internet. 12 digit telephone number for ip addresses, eg 008004004008 for 8.4.4.8. Perhaps an optional extension to specify non-default UDP port. See standards above
  • codec, compression, buffer
  • PSTN service announcements, eg "the number you have dialled is not connected" for an incorrect IP address followed by busy signal so the modem can detect the connection failure

IP Networking

  • Wifi makes the most sense to reduce cabling
  • ethernet may be required to minimise latency and avoid wifi noise

UDP

  • IPv4
  • UDP v TCP: Latency would favour UDP
  • Default port: 21978
  • Is a control channel needed for return signalling, eg ring, busy, or can we work that out from IP/UDP 
  • TLS: confidentiality requirements are not high for expected use (ie BBS and chat), but would be good to have if the latency overhead is acceptable

UDP packet format

  • magic number
  • protocol version
  • unique session id
  • packet type: data, control
  • packet length
  • data / control message

Build

  • arduino/esp with wifi
  • Raspberry Pi Pico PIO ports seem a good fit for higher baud rates. Lack of IP networking 
  • raspberry pi zero for dev. MCU +wifi for single iPSTN device
  • Museum iPSTN: multiple PSTN ports - eg as many ports as a raspberry pi 4 could handle
    • this would centralise the PSTN facility, cabling is standard telephone cable with rj11 connectors
    • saves having iPSTN with power and network connectivity at every modem

Glossary

  • CPE - customer premise equipment, usually the modem in our case but also a telephone handset


Alternate Names

  • Analogue Data Adapter: ADA
  • Internet Plain Old Telephone Service: iPOTS, POTSi
  • PSTN over Internet Protocol: PSTNoIP

Comments