This document explains the networking setup that allows a phone to receive an incoming IP connection using PPP.
This functionality is primarily intended to enable the phone to be used by the PC as a gateway to the Internet. The expected scenario is as follows:
A record in the comms database is appropriately configured for an incoming connection. PPP can then be started, using the connection management API in Esock, to wait for such a connection. This is called running in server mode. Starting server mode can be done either automatically at bootup or by an application at the user's request.
The user connects the phone to the PC over a serial link, and commands the PC to dial out to a null modem connection. Currently, only a EIA-232 (RS232) cable serial link is supported (not virtual serial connections over Bluetooth or USB).
The Symbian OS PPP component processes the incoming connection request, and assigns the PC a private IP address (e.g. from the 192.168.0.0 - 192.168.255.255 address range).
If the PC application requires DNS, then an application on the phone must have obtained a public DNS address to supply to the PC.
Data packets can then be sent over the established PPP link. For the phone to act as an Internet gateway, the phone must provide functionality to forward and route packets between itself and the Internet. The network address translation functionality to do this is not supplied as part of the standard Symbian OS TCP/IP stack, but may be implemented by a licensee.
The following diagram shows the components involved:
Note that:
There is no functionality to authenticate the PC making the connection. However, as the connection is made over a serial link, physical security is sufficient.
IPv4, but not IPv6, is supported.
The rest of this document describes the:
A record must be created in the CommDb database's Dial Out ISP table to handle incoming connections. The settings are as follows:
The ISP_IF_SERVER_MODE
field
must be set to true. Functionality to handle incoming PPP is disabled when this
field is false.
In incoming PPP, the phone assigns a static IP address to the client
PC. This address should be in the private IP address range (e.g. from the
192.168.0.0 - 192.168.255.255 range). Set the address in the
ISP_IP_GATEWAY
field. This address will
always be given to the client: if the client suggests a different IP address,
it is refused with a negative acknowledgement (NAK).
The phone must also specify its own IP address. This can be set
statically in the ISP_IP_ADDR
field. The
ISP_IP_ADDR_FROM_SERVER
field must be set
to false.
For a client to have access to Domain Name Services (DNS), the phone
must provide primary and secondary DNS server addresses to the client. These
addresses are not normally statically set, but obtained and set dynamically by
the Incoming PPP launcher application in the ISP_IP_NAME_SERVER1
and ISP_IP_NAME_SERVER2
fields. The
ISP_IP_DNS_ADDR_FROM_SERVER
field must
always be set to false to enable PPP to use these addresses.
A logon script can be specified through the ISP_USE_LOGIN_SCRIPT
and ISP_LOGIN_SCRIPT
fields. However, these scripts are
run before PPP starts, and so before any incoming connection is made.
When in server mode, the PPP component reads its configuration
parameters from a file called PPPD.INI
instead of the normal
PPP.INI
used in client mode. This allows different, optimized
settings to be used for each mode of PPP.
See PPP INI file for details of the settings.
Incoming PPP mode is typically started by an application that initiates a PPP instance running in server mode. This launch program may run automatically at system start, or by explicit user action. It must perform the following tasks to provide additional configuration, and to start and monitor a connection:
As described above, the IP addresses for the local PPP endpoint and the address for the remote PPP client are stored in CommDB. In most scenarios they can be static, but if not, the application must store appropriate addresses for PPP to use.
If a client requires access to DNS, before starting the PPP server, the launch application must set the DNS addresses to use in CommDB (in the fields described above). The application may need to establish an Internet connection to obtain these addresses.
The launch application starts the PPP server with
RConnection::Start()
, specifying the appropriate CommDb
IAP record.
PPP in server mode will close the link once the connection with the
client closes. To maintain listening for incoming connections, the application
should monitor the connection closing using RConnection
.
It can then restart the connection using
RConnection::Start()
again.