@CHIP-RTOS - PPP Interface
IPC@CHIP® Documentation Index
Introduction
- Here is a short description of how to configure the IPC@CHIP® PPP server.
The PPP client and server API calls are part of the TCP/IP API.
These API calls are described in the TCP/IP API
documentation. Only configuration of the PPP server is described here.
Topics:
About PPP
- PPP (the Point to Point Protocol) is a mechanism for creating and running TCP/IP
over a serial link - be that a direct serial connection (using a null-modem cable),
or a link made using a modem.
Other computers can dial into the IPC@CHIP® PPP server and communicate via the TCP/IP link
using FTP, Telnet, Web, etc. in the same manner as with an Ethernet TCP/IP link.
One major difference between a PPP and an Ethernet connection is of course the speed.
A standard Ethernet connection operates at 10 Mbs maximum theoretical throughput,
whereas a modem operates at speeds up to 56 kbps.
PPP is strictly a peer to peer protocol; there is no difference between the machine
that dials in and the machine that is dialed into. However, it is still useful to think
in terms of servers and clients. When you dial into a site to establish a PPP connection,
you are a considered the client. The machine to which you connect (e.g. the IPC@CHIP®) is
considered the server.
PPP on the IPC@CHIP® includes the subprotocols LCP and NCP(IPCP).
Supported authentication protocols are PAP and CHAP.
Top of list Index page
Configuring the PPP Server
- The PPP server must be configured using the chip.ini file sections [PPPSERVER]
and [SERIAL]. All entries for configuring the PPP server are listed in the
config.htm file.
Here is an outline of the steps required to configure the PPP server.
- Disable/enable PPP server
ENABLE=0 or ENABLE=1
By default, PPP server is enabled.
- Select a serial port for the PPP server to use with the
COMPORTdirective.
Important
:
The COM and EXT port of the IPC@CHIP® has only CTS,RTS,RxD and TxD lines,
so you have to configure your modem with DTR always on.
(e.g. AT cmd for a ZyXEL modem: AT&D0)
- Increase the send
and receive
queue sizes of the chosen serial port (EXT or
COM).
Recommended size is 4096 Bytes.
Example chip.ini settings for the EXT port:
[SERIAL]
EXT_RECVQUEUE=4096
EXT_SENDQUEUE=4096
- Select the flow control mode
for the PPP server serial port.
- Set the baud rate of PPP server's serial port e.g.
BAUD
=19200 (default is 38400)
- Select usage of a modem :
MODEM=1.
The default is 0 (null modem cable).
- Define a pio as low-active modem DCD input signal:
DCPPIO=1.
The default is 0 (no pio pin speicifed).
- Set the IP Address
of the PPP server interface e.g. ADDRESS=192.168.206.4
- Set the REMOTE IP Address
for the connected peer.
There are three different possibilities for configuring PPP server IP addresses on the IPC@CHIP®:
a) If valid addresses for IP Address and
REMOTE IP Address
are declared in chip.ini, the PPP server wants to use this configured IP for its own
and wants to configure the remote peer with the defined remote address.
b) If only IP Address is declared in chip.ini and
REMOTE IP Address is set to 0.0.0.0,
the PPP server wants to use this configured IP address and expects the client
to use their own address.
c) If both entries IP Address and
REMOTE IP Address are set to 0.0.0.0,
the PPP server expects an IP address from the peer.
- Define net mask and
router default gateway,
e.g.
NETMASK=255.255.255.0
GATEWAY=192.168.206.4
Note about IP FORWARDING:
The TCP/IP stack of the @CHIP-RTOS supports different network interfaces, Ethernet and PPP,
so the IPC@CHIP® can forward IP packets between these interfaces.
If you define a gateway in the PPPSERVER section of the chip.ini for the PPP
server interface, it becomes the default gateway for all interfaces when a PPP link to the
server is established. During a PPP server connection the command
ipcfg indicates this
default gateway. After the PPP session, the old gateway (if any) for the Ethernet
interface will be restored. As of @CHIP-RTOS version 070, the TCP/IP API supports adding
and deleting a default gateway:
- Choose authentication mode
with the AUTH
directive.
- Initialize the modem.
You can define three sets of modem initialization parameters. These parameters are
used to initialize the modem at the start of the IPC@CHIP® @CHIP-RTOS and after a modem hang-up
following a PPP session.
Each of the three parameter sets consists of the following four parameters:
- INITCMD
string - Command sent to the modem to initialize it.
- INITANSWER
string - Expected modem response to initialization command.
- INITTIMEOUT
integer - Number of seconds to wait on answer from modem.
- INITRETRIES
integer - Number of times to repeat modem initialization sequence
if a previous attempt fails.
Example:
INITCMD0=ATZ
INITANSWER0=OK
INITTIMEOUT0=2
INITRETRIES0=3
INITCMD1=AT&D0
INITANSWER1=OK
INITTIMEOUT1=2
INITRETRIES1=3
INITCMD2=AT
INITANSWER2=OK
INITTIMEOUT2=2
INITRETRIES2=2
A timeout value 0 means wait forever for the modem's answer.
If you enter the string NULL at an INITANSWER (e.g. INITANSWER0=NULL), the IPC@CHIP® PPP
server will not wait for an answer from the modem.
- Define a maximum of three modem commands for getting
connected to the remote peer.
Example:
CONNECTMSG0=RING
CONNECTANSWER0=ATA
CONNECTTIMEOUT0=0
CONNECTMSG1=CONNECT
CONNECTTIMEOUT1=60
These are the default values for modem connect commands.
In this example the PPP server waits forever for the RING message and sends
an ATA to the modem if it responds to the RING. After that the server waits
a maximum of 60 seconds for a response to the CONNECT message. The modem link
is established. The server now establishes the PPP connection to the remote
client.
Note: Do not use the AT command ATS0=1. This will cause the modem to automatically
answer the call without waiting for the PPP server. This is too fast for the PPP server.
- Hang-up the connection.
The PPP server will attempt to hang-up the modem when either a connection
is closed by a remote peer, or if the modem initialization failed during
the IPC@CHIP® boot process.
- Switch the modem into the command mode
(CMDMODE and
HANGUPDELAY)
Example:
CMDMODE=+++
HANGUPDELAY=2
These are the default values.
- Define modem commands and expected answers for
hang-up.
Again, up to three sets of these parameters can be given here.
Example:
HANGUPCMD0=ATH0
HANGUPANSWER0=OK
HANGUPTIMEOUT0=2
HANGUPRETRIES0=1
If you enter the string NULL at an HANGUPANSWERx (e.g. HANGUPANSWER0=NULL), the IPC@CHIP® PPP
server will not wait for an answer from the modem.
- Control the online state while PPP session is open.
You can define three sets of modem control parameters. These parameters are
used to check the online state of the modem during an opened PPP connection.
- Enable online control sequence
MODEMCTRL=1 or
MODEMCTRL=2
The default is 0 (disabled).
Also you have to configure a control time interval (in seconds).
Two different modes are provided:
MODEMCTRL=1:
After each time interval during which the PPP server receive no data,
the server executes the configured modem commands.
MODEMCTRL=2:
After each time interval the server executes the configured modem commands.
In both cases the server closes the connection, if one of the expected answers timed out.
In this mode the configured modem commands are not printed via stdout at execution time, even if
MODEMTRACE is enabled.
Example:
MODEMCTRL=1
- Define a CTRLTIME.
E.g. CTRLTIME=120
default is 60 seconds
Each of the three parameter sets consists of the following four parameters:
- CTRLCMD
string - Command sent to the modem to initialize it.
- CTRLANSWER
string - Expected modem response to control command.
- CTRLTIMEOUT
integer - Number of seconds to wait on answer from modem.
- CTRLRETRIES
integer - Number of times to repeat modem control sequence
if a previous attempt fails.
Example and default settings:
CTRLCMD0=+++
CTRLANSWER0=OK
CTRLTIMEOUT0=3
CTRLRETRIES0=1
CTRLCMD1=AT0
CTRLANSWER1=NULL
CTRLTIMEOUT1=1
CTRLRETRIES1=0
If you enter the string NULL at an CTRLANSWERx (e.g. CTRLANSWER0=NULL), the IPC@CHIP® PPP
server will not wait for an answer from the modem.
- Define a time out
value in seconds after which the PPP server hangs up
the connection if no data comes in from client during this timeout period.
E.g. IDLETIME=160
default is 120
Top of list Index page
IPv6 configuration of the PPP Server
- PPP supports IPv6 with an additional Network control protocol (IPV6CP).
IPv6 address configuration is done by a auto negotiation process.
At connection time the peers negotiate an Interface-ID for the PPP device and
auto configure their link-local scope addresses. The address configuration
and other configuration data are retrievable by calling
Get PPP server configuration .
Top of list Index page
PPP Server API
- The TCP/IP API provides five calls that apply to the PPP server.
- Interrupt 0xAC, Service 0x50:
Check if the PPP server is installed.
- Interrupt 0xAC, Service 0x51:
Suspend PPP server task
- Interrupt 0xAC, Service 0x52:
Activate PPP server
- Interrupt 0xAC, Service 0x53:
Get current state of the PPP server
- Interrupt 0xAC, Service 0x54:
Get the PPP server configuration
- Interrupt 0xAC, Service 0x55:
Set the PPP negotiate options
- Interrupt 0xAC, Service 0x56:
Get PPP server configuration (IPv6)
- Interrupt 0xAC, Service 0x57:
Pause/Resume the PPP server
Top of list Index page
PPP Client API
- The TCP/IP API provides four calls that apply to the PPP client.
- Interrupt 0xAC, Service 0x40:
Check if the PPP client is installed.
- Interrupt 0xAC, Service 0x41:
Establish a PPP connection
- Interrupt 0xAC, Service 0x42:
Close connection
- Interrupt 0xAC, Service 0x43:
Get current state of the PPP client
- Interrupt 0xAC, Service 0x44:
Get PPP primary and secondary DNS IP addresses
- Interrupt 0xAC, Service 0x45:
Set the PPP negotiate options
- Interrupt 0xAC, Service 0x46:
Establish a PPP connection with IPv6 protocol (IPv6CP)
- Interrupt 0xAC, Service 0x47:
Pause/Resume the PPP client
Top of list Index page
Available Examples
- Source code examples can be found at www.beck-ipc.com.
Top of list Index page
End of document
|