PPP Interface - SC12 @CHIP-RTOS V1.10
IPC@CHIP Documentation Index
Introduction
- Here is a short description of how to configure the IPC@CHIP PPP server.
The PPP server is available starting with @CHIP-RTOS version SC12V0067PPP. (There also
exists a @CHIP-RTOS version SC12V0067 without the PPP server.) The PPP client API is
available starting with @CHIP-RTOS 070.
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
- Since SC12 @CHIP-RTOS version 067 Beta a PPP server is available in the SC12.
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 an analogue 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 an analogue 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 an analogue modem:
MODEM=1.
The default is 0 (null modem cable).
- Set the IP Address
of the PPP server interface e.g. ADDRESS=192.168.206.4
- Set the REMOTE IP Address
for the connected host.
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:
Since @CHIP-RTOS version 067 the SC12 has two 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 analogue 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 at an open PPP connection.
- Enable online control sequence
MODEMCTRL=1.
The default is 0 (disabled).
Example:
MODEMCTRL=1
Also you have to configure a control time interval (in seconds). After each time interval
during which the PPP server receive no data, the server executes the configured modem commands.
The server closes the connection, if one of the expected answers timed out.
- 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
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
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:
Open a connection to PPP server
- 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
Top of list Index page
Available Examples
- The following example code is available:
- PPP server API test, PPPS.C
- PPP client example, PPPCLIE.C
Top of list Index page
End of document
|