RTP ports and rtptunnel

This page explains what rtptunnel is and how it works.

Gphone or Gnome-O-Phone is an internet telephone program for Linux written by Roland Dreier. Please visit the official homepage of gphone to learn more about it. The following figures illustrate how gphone transmits information over the net. There is no information about soundcards, mikes, and speakers here, since that is in not the focus of this page.

Table of contents

Normal gphone operation
Gphone behind a firewall (4 machines)
A 3-machine setup
A 2-machine setup

Normal gphone operation

gphone For using gphone you need two computers connected to the net. The two small boxes on each computer represent the RTP ports allocated for receiving audio and control information. This is exclusive allocation, that is once gphone allocated them, no other program can allocate them again until gphone stops. Since RTP is defined over UDP, gphone sends and receives UDP packets.

gphone When someone talks to the mike connected to Host A, audio and control information travels on the net on the way shown by this figure.
gphone When someone talks to the mike connected to Host B, audio and control information travels on the net on the way shown by this figure.

You can specify the port numbers gphone listens to and sends information to. For the gphone running on Host A, you should specify the following options:

Back to the top

Gphone behind a firewall (4 machines)

Since gphone uses UDP packets to communicate, it is hard to talk to someone behind a firewall. To work around this problem, Roland wrote rtptunnel.

gphone The figure shows a setup with four machines. People are sitting at Hosts A and B, and they are keen on talking to each other on the gphone. The computers Slave A and B are running rtptunnel that has the task of tunneling those RTP packets (UDP) through a TCP tunnel. The tunnel is already there, and it is now waiting for packets to tunnel. The figure does not show the firewall, since the system works regardless of the presence of a firewall, however, if there is a firewall, it should be between the machines Slave A and Slave B.

gphone When someone talks to the mike connected to Host A, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host A
  2. to the RTP ports allocated on Slave A by the rtptunnel program (UDP packets)
  3. to the computer Slave B through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host B by the gphone program (UDP packets)
  5. to the speakers attached to Host B

gphone When someone talks to the mike connected to Host B, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host B
  2. to the RTP ports allocated on Slave B by the rtptunnel program (UDP packets)
  3. to the computer Slave A through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host A by the gphone program (UDP packets)
  5. to the speakers attached to Host A

With this 4 machine setup, there is no need to change any of the default ports used by gphone or by rtptunnel. Suppose that, for this example, the hostnames of the four computers are hosta, slavea, hostb and slaveb.

For this setup, you need to launch the following program on Host A:

and on Slave A:

Rtptunnel sends and recieves at port number 5004, which is the port number gphone uses. This is possible because rtptunnel and gphone are running on separate hosts.

For Host B, you need to run:

and on Slave A:

Back to the top

A 3-machine setup

It is possible on Linux to run multiple programs at a time (surprise, surprise ;-)). In consequence, gphone and rtptunnel can be run on one machine.

gphone The figure shows a setup with three machines. People are sitting at Hosts A and B, and they are keen on talking to each other on the gphone. The computers Host A and Slave B are running rtptunnel. The tunnel is already there, and it is now waiting for packets to tunnel. The figure does not show the firewall, since the system works regardless of the presence of a firewall, however, if there is a firewall, it should be between the machines Host A and Slave B.

gphone When someone talks to the mike connected to Host A, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host A
  2. to the RTP ports allocated on Host A by the rtptunnel program (UDP packets)
  3. to the computer Slave B through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host B by the gphone program (UDP packets)
  5. to the speakers attached to Host B

gphone When someone talks to the mike connected to Host B, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host B
  2. to the RTP ports allocated on Slave B by the rtptunnel program (UDP packets)
  3. to the computer Host A through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host A by the gphone program (UDP packets)
  5. to the speakers attached to Host A
Back to the top

A 2-machine setup

Yes, now we proceed to the most complicated setup, where 2 hosts are running 4 programs.

gphone The figure shows a setup with two machines. People are sitting at Hosts A and B, and they are keen on talking to each other on the gphone. Their computers are also running rtptunnel. The tunnel is already there, and it is now waiting for packets to tunnel. The figure does not show the firewall, since the system works regardless of the presence of a firewall, however, if there is a firewall, it should be between the machines Host A and Host B. ;-)

gphone When someone talks to the mike connected to Host A, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host A
  2. to the RTP ports allocated on Host A by the rtptunnel program (UDP packets)
  3. to the computer Host B through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host B by the gphone program (UDP packets)
  5. to the speakers attached to Host B

gphone When someone talks to the mike connected to Host B, audio and control information travels on the net on the way shown by this figure:
  1. from the gphone program running on Host B
  2. to the RTP ports allocated on Host B by the rtptunnel program (UDP packets)
  3. to the computer Host A through the TCP tunnel (TCP packets), possibly through the firewall
  4. to the RTP ports allocated on Host A by the gphone program (UDP packets)
  5. to the speakers attached to Host A

In order to get this configuration to work, you need 4 port numbers on both machines. This is so, because both gphone and rtptunnel need their exclusive ports to receive audio and control information.

Let's suppose for the sake of the example, that for Host A, you picked port number 5004 for gphone to listen to, and port number 5010 for rtptunnel to listen to. For Host B, you picked port number 5014 for gphone to listen to, and port number 5020 for rtptunnel to listen to. All the former port numbers are UDP port numbers and you go for the default TCP port number. The host name of Host A is hosta and the host name of Host B is hostb.

For this setup, you need to launch the following programs on Host A:

Rtptunnel sends to port number 5004, which is the port number gphone listens to. Rtptunnel receives on port number 5010, which is the port number gphone sends to. For gphone it appears, that it talks to someone sitting at the same machine.

On Host B, you need to launch the following programs:

Back to the top

Written by Ivan Szanto on 25th November, 1999
Modified by Roland Dreier on 4th December, 1999