Академический Документы
Профессиональный Документы
Культура Документы
TI 34P02Q51-01E
© Copyright Oct. 2006 (YK)
1st Edition Oct. 31, 2006 (YK)
Blank Page
i
Introduction
The PPP (Point to Point Protocol) connection function of FCN/FCJ enables IP
(Internal Protocol) communications between two FCN/FCJs or between an
FCJ/FCJ and a PC or workstation over a public line or an internal line.
This document provides information on the following topics related to the PPP
connection function:
- Description of the PPP connection function
- Configuration of the PPP connection function
- PPP connection function support of the E-mail function
- PPP connection function support of the JEROS emulator
TIP
This document assumes that the reader has basic knowledge of PPP and IP. For more details on PPP
and IP, read RFC1548 and RFC1011 respectively of the RFC (Request for Comments) document set.
All Rights Reserved Copyright © 2006, Yokogawa Electric Corporation TI 34P02Q51-01E 1st Edition Oct. 31, 2006-00
ii
All Rights Reserved Copyright © 2006, Yokogawa Electric Corporation TI 34P02Q51-01E 1st Edition Oct. 31, 2006-00
iii
STARDOM FCN/FCJ
PPP Connection Function User Guide
TI 34P02Q51-01E 1st Edition
CONTENTS
Introduction ..............................................................................................i
Copyrights and Trademarks ....................................................................ii
1. Overview ...........................................................................................1
1.1 System Location........................................................................................ 2
1.2 Function Overview .................................................................................... 5
1.2.1 Function Architecture ...................................................................... 5
1.2.2 Overview of Subfunctions ............................................................... 6
1.2.3 Files Used ....................................................................................... 7
1.3 Operating Environment............................................................................. 8
1.4 Communications Environment Configuration ....................................... 9
1.4.1 Communications Environment Planning ....................................... 10
1.4.2 Modem Setup.................................................................................11
1.4.3 Remote Machine Setup ................................................................ 12
2 Function Description .....................................................................13
2.1 Function Organization ............................................................................ 13
2.2 Function Explanation .............................................................................. 15
2.2.1 PPP Client Function and PPP Server Function ............................ 15
2.2.2 Application Requests .................................................................... 17
2.2.3 Other Features .............................................................................. 19
2.3 Class Structure ........................................................................................ 21
2.3.1 PppControl .................................................................................... 22
2.3.2 PppStatistics.................................................................................. 25
2.3.3 PppClient....................................................................................... 28
2.3.4 PppServer ..................................................................................... 33
2.3.5 PppException ................................................................................ 35
3 Creating PPP Client Application ...................................................41
3.1 Precautions about Creating PPP Client Application............................ 41
3.2 Sample Program ...................................................................................... 42
4 FCN/FCJ Setup ...............................................................................43
4.1 PPP Connection Function Startup Setting............................................ 43
4.2 IP Routing Setup...................................................................................... 44
4.3 COM Port Setup ....................................................................................... 46
4.4 PPP Connection Function Setup ........................................................... 47
4.4.1 PPP Connection Function Common Settings ............................... 49
4.4.2 PPP Server Function Related Settings ......................................... 50
4.4.3 PPP Client Function Related Settings .......................................... 55
All Rights Reserved Copyright © 2006, Yokogawa Electric Corporation TI 34P02Q51-01E 1st Edition Oct. 31, 2006-00
iv
All Rights Reserved Copyright © 2006, Yokogawa Electric Corporation TI 34P02Q51-01E 1st Edition Oct. 31, 2006-00
<1. Overview> 1
1. Overview
The PPP (Point to Point Protocol) connection function of FCN/FCJ is one of the
standard functions of the FCN/FCJ basic software, which is included in the
JEROS Basic Part module. Using this function enables IP (Internet Protocol)
communications over a public line or internal line:
- between FCN/FCJs, as well as
- between FCN/FCJs and PC or workstations
SEE ALSO
For more details on PPP-related functions, see Appendix 1, “PPP Support of E-mail Function” and
Appendix 2, “PPP Support of JEROS Emulator.”
FCN/FCJ
Java application
Public line,
Modem, internal line
COM port communications
adaptor, etc.
Runs as
PPP server
IP connection
Public line,
Modem GPRS, etc. Modem
Dial-up connection
Runs as Runs as
PPP client PPP server
IP connection
FCN/FCJ FCN/FCJ
Public line,
Modem GPRS, etc. Modem
Dial-up connection
PPP connection
establishment requests Application
PPP connection operation PPP Connection
requests and responses Function
Log messages JEROS basic
setting file
File I/O Class libraries
IP routing file
Connection
management function
COMx port
setting file
PPP Server PPP client
PPP function function
setting file
RS-232-C port
Figure Software Architecture of PPP Connection Function
z Log function
The log function logs the operation of the PPP connection function to the kernel log
(JRLOGCUR.TXT) file. It logs the following events:
- Establishment and termination of PPP connections
- PPP action errors
SEE ALSO
For more details on individual setting files, see Chapter 4, “FCN/FCJ Setup.”
TIP
COM ports of serial communications modules (NFLR111, NFLR121) cannot be used for PPP
connection.
Communications line service Public line or internal line (including PHS, mobile phone and ISDN)
Data communications Modem or communications adaptor satisfying the following conditions:
*1
equipment - is compatible with the communication line service used.
- supports RS-232-C interface connection.
- can be manipulated using AT commands.
Remote machine Machine with PPP client function (running Windows 2000, Windows XP, Linux,
etc.);
Or machine with PPP server function (running Windows 2000, Windows XP,
Linux, etc.);
Or internet service provider supporting PPP connection.
*1: The required data communications equipment depends on the communications line service used: modem for
telephone line, PHS communications adaptor for PHS, mobile phone communications adaptor for mobile phone,
and terminal adaptor for ISDN line, etc. The description in this document assumes a typical setup of telephone
line with modem.
SEE ALSO
For more details on the function specifications and operating environment of the FCN/FCJ Java
Application Development Kit, see:
"FCN/FCJ Java Application Development Kit" (GS34P02Q76-01E).
TIP
There is no need to create Java applications to use the PPP server function.
PPP Connection
Preparation
END
Figure Preparation Flowchart for PPP Connection
z Assign IP address
Assign IP addresses to PPP servers and PPP clients expected to use PPP
connections. In general, a PPP server stores its own IP address and the IP addresses
of its PPP clients.
z Setup precautions
If the FCN/FCJ is to act as a PPP server, you must connect a modem to the FCN/FCJ
using an RS-232-C cable, and switch on the modem before starting up the FCN/FCJ.
When configured to run as a PPP server, the FCN/FCJ attempts to initialize the
modem at system startup and termination of PPP connection. If the modem
initialization fails, a critical error will be written to the log.
For the PPP connection function to run, other equipment in addition to the FCN/FCJ is
required. These include communications devices such as modems, communications
line service such as a public circuit and a remote machine acting as PPP client or
PPP server.
2 Function Description
This chapter describes the following subfunctions, which are provided by the PPP
connection function:
- Connection management function
- PPP client function
- PPP server function
- Log function
Of the above functions, the connection management function, PPP client function and
PPP server function are provided for Java applications as part of the JEROS system
class. The various classes provided by the PPP connection function are included in
the FCN/FCJ Java Application Development Kit.
z Get IP address
Get assigned IP addresses of the FCN/FCJ and its peer when establishing a PPP
connection.
Log Function
The log function writes operation messages of the PPP connection function to the
kernel log (JRLOGCUR.TXT) file. It logs the following events:
Types of States
z Disconnected state
In Disconnected state, neither the PPP client function nor the PPP server function is
running. The telephone line is disconnected in this state. This is the default state at
system startup.
z Trace function
The Trace function outputs a detailed trace of establishment processing and
termination processing of PPP connections by the PPP client function and PPP server
function to the console COM port designated by the "ConsoleComPort" parameter in
the JEROS basic setting file. The Trace function is especially useful for
troubleshooting PPP connection establishment problems.
Besides internal processing trace, the output also includes dialog with the modem and
the internal IP routing table of the FCN/FCJ.
To enable the Trace function, specify “YES for the trace mode setting in the PPP
setting file.
To use the console function, you need to specify a COM port that is not used by the
PPP connection function for the console display COM port setting in the JEROS basic
setting file, and connect a terminal*1 to the COM port. For more details, see the
FCN/FCJ online help documentation.
*1: The connected terminal equipment must be compatible with the COM port of the FCN/FCJ. A good example may
be a PC installed with Windows Hyperterminal or some other terminal emulation software.
z PppControl
This class provides the connection management function.
z PppStatistics
This class provides methods for getting statistical information for PPP connections.
z PppClient
This class provides the PPP client function.
z PppServer
This class provides methods for accessing the PPP server function. An object of this
class can be obtained by calling the PppControl.getServer() method.
z PppException
This class handles exceptions encountered by the PPP connection function.
2.3.1 PppControl
java.lang.Object
└ jeros.ppp.PppControl
Summary
Field Summary
static int BOTH PPP Operation mode: both client function and server function are enabled.
static int CLIENT PPP operation mode: only client function is enabled.
static int NONE PPP operation mode: both client function and server function are disabled.
static int SERVER PPP operation mode: only server function is enabled.
Constructor Summary
PppControl(java.lang.String deviceName) PppControl class constructor
Method Summary
java.lang.String getLocalAddress() Returns IP address assigned to local machine of PPP connection.
Int getPppMode() Returns PppMode setting defined in PPP setting file.
java.lang.String getRemoteAddress() Returns IP address assigned to remote machine of PPP connection.
PppServer getServer() Returns PppServer object.
Field Detail
z CLIENT
public static final int CLIENT
PPP operation mode: only client function is enabled.
z SERVER
public static final int SERVER
PPP operation mode: only server function is enabled.
z BOTH
public static final int BOTH
PPP operation mode: both client function and server function are enabled.
z NONE
public static final int NONE
PPP operation mode: both client function and server function are disabled.
Constructor Detail
z PppControl
public PppControl(java.lang.String deviceName)
throws PppException
Parameters:
deviceName – communications device name ("COM1", "COM2", ...)
Exceptions:
PppException – Exception indicating one of the following error numbers:
- E_PPP_DEVICENAME: Device name is invalid.
- E_PPP_INTERNAL: PPP function internal error
- E_PPP_NONE: PPP client function is not started.
Check the PppStart item of DUNUS.PRP. Any error at startup would have been
logged in the “JRLOGCUR.txt” file.
Method Detail
z getPppMode
public int getPppMode()
Returns PppMode setting defined in the PPP setting file.
Returns:
PppMode setting
- CLIENT: Only client function is enabled.
- SERVER: Only server function is enabled.
- BOTH: Both client function and server function are enabled.
- NONE: Both client function and server function are disabled.
z getLocalAddress
public java.lang.String getLocalAddress()
throws PppException
Returns:
IP address of local machine of PPP connection.
Exceptions:
PppException – Exception indicating one of the following error numbers:
- E_PPP_NO_CONNECTION: Not in PPP connected state.
- E_PPP_INTERNAL: PPP function internal error
z getRemoteAddress
public java.lang.String getRemoteAddress()
throws PppException
Returns:
IP address of remote machine of PPP connection.
Exceptions:
PppException – Exception indicating one of the following error numbers:
- E_PPP_NO_CONNECTION: Not in PPP connected state.
- E_PPP_INTERNAL: PPP function internal error
z getServer
public PppServer getServer()
throws PppException
Returns:
PppServer object
Exceptions:
PppException - Exception indicating one of the following error numbers:
- E_PPP_SERVER_NONE: PPP server function is disabled for the specified
serial device.
Check the PppMode setting in the PPP setting file.
- E_PPP_INTERNAL: PPP function internal error
2.3.2 PppStatistics
java.lang.Object
└ jeros.ppp.PppStatistics
Summary
Constructor Summary
PppStatistics(java.lang.String deviceName) PppStatistics class constructor
Method Summary
int getRecvBytes() Returns the number of bytes received on a PPP connection.
int getRecvIPs() Returns the number of IP packets received on a PPP connection.
int getRecvPackets() Returns the number of PPP packets received on a PPP connection.
int getSendBytes() Returns the number of bytes sent on a PPP connection.
int getSendIPs() Returns the number of IP packets sent on a PPP connection.
int getSendPackets() Returns the number of PPP packets sent on a PPP connection.
Constructor Detail
z PppStatistics
public PppStatistics(java.lang.String deviceName)
throws PppException
Parameters:
deviceName – communications device name ("COM1", "COM2", ...)
Exceptions:
PppException - Exception indicating one of the following error numbers:
- E_PPP_NONE: PPP client function is not started.
Check the PppStart item of DUNUS.PRP. Any error at startup would have been
logged in the “JRLOGCUR.txt” file.
- E_PPP_DEVICENAME: Device name is invalid.
- E_PPP_NO_CONNECTION: Not in PPP connected state.
Use of this constructor is only allowed in PPP connected state.
- E_PPP_INTERNAL: PPP function internal error
Method Detail
z getRecvBytes
public int getRecvBytes()
Returns the number of bytes received on the PPP connection. The returned
value ranges from 0 to 2147483647, and the count is reset to 0 when it
reaches the upper limit.
Returns:
Number of bytes received
z getRecvPackets
public int getRecvPackets()
Returns the number of PPP packets received on a PPP connection.The
returned value ranges from 0 to 2147483647, and the count is reset to 0 when
it reaches the upper limit.
Returns:
Number of PPP packets received
z getRecvIPs
public int getRecvIPs()
Returns the number of IP packets received on a PPP connection. The
returned value ranges from 0 to 2147483647, and the count is reset to 0 when
it reaches the upper limit.
Returns:
Number of IP packets received
z getSendBytes
public int getSendBytes()
Returns the number of bytes sent on a PPP connection. The returned value
ranges from 0 to 2147483647, and the count is reset to 0 when it reaches the
upper limit.
Returns:
Number of bytes sent
z getSendPackets
public int getSendPackets()
Returns the number of PPP packets sent on a PPP connection. The returned
value ranges from 0 to 2147483647, and the count is reset to 0 when it
reaches the upper limit.
Returns:
Number of PPP packets sent
z getSendIPs
public int getSendIPs()
Returns the number of IP packets sent on a PPP connection. The returned
value ranges from 0 to 2147483647, and the count is reset to 0 when it
reaches the upper limit.
Returns:
Number of IP packets sent
2.3.3 PppClient
java.lang.Object
└ jeros.ppp.PppClient
Summary
Field Summary
static int BOTH Force mode: Forcedly terminate and connect even if in client connected state or
server connected state.
static int CLIENT Force mode: Forcedly terminate and connect even if in client connected state.
boolean DEBUG
static int
m_disconnectCount
static int SERVER Force mode: Forcedly terminate and connect even if in server connected state.
Constructor Summary
PppClient(java.lang.String targetName) PppClient class constructor
Method Summary
protected void closer() Terminates the active PPP connection, and immediately disconnects the modem.
void connect() This PPP client connection request method performs PPP connection for the
destination specified in the constructor.
void disconnect() This PPP client disconnection request terminates a PPP connection.
protected void finalize() This is the finalizer method for the class.
void forceConnect Performs a PPP connection using the specified force mode.
(int forceMode)
java.lang.String Returns the device name used by a PPP client.
getDeviceName()
int getIdleTimeout() Returns the IdleTimeout setting defined in the PPP setting file.
boolean getTraceMode() Returns PPP trace mode setting.
boolean isConnected() Returns PPP client connection status.
Field Detail
z CLIENT
public static final int CLIENT
Force mode: Forcedly terminate and connect even if in client connected
state.
z SERVER
public static final int SERVER
Force mode: Forcedly terminate and connect even if in server connected
state.
z BOTH
public static final int BOTH
Force mode: Forcedly terminate and connect even if in client connected
state or server connected state.
z DEBUG
public final boolean DEBUG
z m_disconnectCount
public static int m_disconnectCount
z Constant field value: jeros.ppp.PppClient
public static final int BOTH 3
public static final int CLIENT 1
public final boolean DEBUG false
public static final int SERVER 2
Constructor Detail
z PppClient
public PppClient(java.lang.String targetName)
throws PppException
Parameters:
targetName - destination hostname or destination setting name.
Exceptions:
PppException - Exception indicating one of the following error numbers:
- E_PPP_CLIENT_NONE: PPP client function is not enabled.
Check the PppMode coding in the PPP setting file.
- E_PPP_NONE: PPP client function is not started.
Check the PppStart item of DUNUS.PRP. Any error at startup would have been
logged in the “JRLOGCUR.txt” file.
- E_PPP_HOSTNAME: Illegal hostname
Check the ServerHosts setting in the PPP setting file.
Method Detail
z getTraceMode
public boolean getTraceMode()
Returns the PPP trace mode setting. Always returns FALSE if the device
name is specified as “ETHER”.
Returns:
Trace mode setting
TRUE: tracing is enabled.
FALSE: tracing is disabled.
z connect
public void connect()
throws PppException
This PPP client connection request method performs PPP connection for the
destination specified in the constructor.
When the method exits, either the PPP connection is successfully
established or the PPP connection has failed.
However, the method always exits with success if the device name is
specified as “ETHER”. The PPP connection, once established, will not be
automatically terminated if the original caller thread is aborted during
processing or if the PPP client object is deleted. To terminate a PPP
connection, you need to call the disconnect method or set up a line idle
timeout.
Exceptions:
PppException - Exception indicating one of the following error numbers:
- E_PPP_CLIENT_BUSY: Device is being used by another PPP client.
- E_PPP_SERVER_BUSY: Device is being used by another PPP server.
- E_PPP_MODEM: Failed to communicate with modem.
Check the cable connection with the modem and check whether the modem is
switched on.
- E_PPP_DIAL_BUSY: Failed to establish dial-up connection with PPP server.
The remote machine is busy. If the problem persists despite redialing, check
the telephone number setting.
- E_PPP_CONNECT: Failed to connect to PPP server.
Check the PPP username, password and related settings.
- E_PPP_INTERNAL: PPP function internal error
z forceConnect
public void forceConnect(int forceMode)
throws PppException
Parameters:
forceMode – force mode
CLIENT: Forcedly terminate and connect even if in client connected state.
SERVER: Forcedly terminate and connect even if in server connected state.
BOTH: Forcedly terminate and connect even if in server connected state or client
connected state.
Exceptions:
PppException - Exception indicating one of the following error numbers:
- E_PPP_CLIENT_BUSY: Device is being used by another PPP client.
- E_PPP_SERVER_BUSY: Device is being used by another PPP server.
- E_PPP_MODEM: Failed to communicate with modem.
Check the cable connection with the modem and check whether the modem is
switched on.
- E_PPP_DIAL_BUSY: Failed to establish dial-up connection with PPP server.
The remote machine is busy. If the problem persists despite redialing, check
the telephone number setting.
- E_PPP_CONNECT: Failed to connect to PPP server.
Check the PPP username, password and related settings.
- E_PPP_INTERNAL: PPP function internal error
z disconnect
public void disconnect()
z isConnected
public boolean isConnected()
Returns:
Client connection status
- TRUE: connected
TRUE is always returned if the device name is specified as “ETHER”.
- FALSE: disconnected.
z getIdleTimeout
public int getIdleTimeout()
Returns:
IdleTimeout setting
z getDeviceName
public java.lang.String getDeviceName()
Returns:
Device name
z closer
protected void closer()
2.3.4 PppServer
java.lang.Object
└ jeros.ppp.PppServer
Summary
Method Summary
void abort() Terminates a PPP server connection.
Terminates the active PPP connection, and immediately
protected void closer()
disconnects the modem.
boolean getAcceptMode() Returns PPP server accept mode setting.
boolean getTraceMode() Returns PPP server trace mode setting.
boolean isConnected() Returns PPP server connection status.
Sets PPP server accept mode to accept or deny all client
void setAcceptMode(boolean mode)
connection requests.
Forcedly sets PPP server accept mode to accept or deny all client
void setAcceptModeForce(Boolean mode)
connection requests.
Method Detail
z setAcceptMode
public void setAcceptMode(boolean mode)
Sets PPP server accept mode to accept or deny all client connection
requests.
If this method is called more than once, the last setting applies.
Parameters:
mode – accept mode setting
TRUE: accept client connection requests
FALSE: deny client connection requests
z setAcceptModeForce
public void setAcceptModeForce(boolean mode)
Forcedly sets PPP server accept mode to accept or deny all client
connection requests.
This is an internal method intended for special purposes.
Generally, the setAcceptMode method should be used instead.
Parameters:
mode – accept mode setting
TRUE: accept client connection requests
FALSE: deny client connection requests
Returns:
Accept mode setting
TRUE: accept client connection requests
FALSE: deny client connection requests
z getTraceMode
public boolean getTraceMode()
Returns:
Trace mode setting
TRUE: tracing is enabled.
FALSE: tracing is disabled.
z abort
public void abort()
Returns:
PPP server connection status
TRUE: connected
FALSE: not connected
z closer
protected void closer()
2.3.5 PppException
java.lang.Object
└ java.lang.Throwable
└ java.lang.Exception
└ jeros.ppp.PppException
z See Also
Class jeros.ppp.PppException extends java.lang.Exception and implements
Serializable.
Serialized Fields:
int m_errorCode
Summary
Field Summary
static int E_PPP_CLIENT_BUSY Error number: PPP client is busy (PPP client startup error)
Cause: In PPP client connected state, a method is called requesting for client
connection but the specified destination setting name is different from the destination
setting name of the existing connection.
static int E_PPP_CLIENT_NONE Error number: PPP client function is not configured.
Cause: PPP client function is not enabled in the PPP setting file.
static int E_PPP_COMM Error number: PPP server communication error
Cause: Error encountered while communicating with PPP server.
static int E_PPP_CONNECT Error number: PPP server connect error
Cause: Failed to connect to PPP server.
static int E_PPP_DEVICENAME Error number: Illegal device name
Cause: Serial device name is invalid.
static int E_PPP_DIAL_BUSY Error number: PPP server dial error
Cause: Failed to establish dial-up connection with PPP server.
static int E_PPP_HOSTNAME Error number: Illegal hostname
Cause: No destination setting name corresponding to the hostname is defined.
static int E_PPP_INTERNAL Error number: PPP function internal error
Cause: Internal error encountered in PPP function.
static int E_PPP_MODEM Error number: Modem error
Failed to communicate with modem.
static int E_PPP_MODEM_BUSY Error number: Modem error
Cause: Modem is busy.
static int E_PPP_NO_CONNECTION Error number: No PPP connection
Cause: getRemoteAddress or getLocalAddress method is called but no PPP
connection is active.
static int E_PPP_NONE Error number: PPP not started (PPP function disabled error)
Cause: PPP function is not started due to a coding error in the setting file or some
other reason.
static int E_PPP_PARAM Error number: illegal parameter
Cause: A specified method argument is out of valid range.
static int E_PPP_SERVER_BUSY Error number: PPP server busy (PPP server startup error)
Cause: PPP server function is not running.
static int E_PPP_SERVER_NONE Error number: PPP server function is not configured.
Cause: PPP server function is not enabled in the PPP connection function setup.
static int E_PPP_TARGETNAME Error number: Illegal target name
Cause: Destination setting name is invalid.
Constructor Summary
PppException(int errorCode) PppException class constructor
PppException(int errno, java.lang.String info) Relays exception generated in NativeMethod
Method Summary
int getErrorCode() Returns error code of PppException
java.lang.String getMessage() Returns error message of PppException
Field Detail
z E_PPP_MODEM
public static final int E_PPP_MODEM
z E_PPP_SERVER_NONE
public static final int E_PPP_SERVER_NONE
z E_PPP_NONE
public static final int E_PPP_NONE
Constructor Detail
z PppException
public PppException(int errorCode)
Parameters:
errno – error number
info – error related information
Method Detail
z getErrorCode
public int getErrorCode()
Returns:
Error code
z getMessage
public java.lang.String getMessage()
Returns:
Error message
package duonus.sample.jeros;
import jeros.ppp.*;
import jeros.ftp.*;
//
// GetFile.Java – Gets a file from FTP server using PPP connection.
//
public class GetFile {
// Hostname of FTP server
static final String FTP_SERVER = "ftpserver";
// FTP username
static final String FTP_USER = "ftpuser";
// FTP password
static final String FTP_PASS = "ftppass";
// Name of file to get
static final String FTP_FILE = "/JEROS/WWW/LOG/JRLOGCUR.TXT";
public static void main() {
PppClient ppp = null;
// Connect to PPP server
try {
// Create PppClient object.
ppp = new PppClient(FTP_SERVER);
// Establish PPP connection.
ppp.connect();
}catch(PppException e) {
// Displays details of exception.
System.out.println("getLog: " + e );
}
FtpClient ftp = null;
try {
// Connect to FTP server.
ftp = new FtpClient(FTP_SERVER, FTP_USER, FTP_PASS);
// Get file in binary mode.
ftp.get(FTP_FILE, false);
// Terminate connection with FTP server.
ftp.close();
}catch(FtpException e) {
// Displays details of exception.
System.out.println("getLog: " + e );
}
// Terminate connection with PPP server.
ppp.disconnect();
}
}
4 FCN/FCJ Setup
Before using the PPP connection function, you need to perform the following
setup on the FCN/FCJ:
- PPP connection function startup setting
- IP routing setup
- COM port setup
- PPP connection function setup
SEE ALSO
For more details on the JEROS basic setting file, see the FCN/FCJ online help documentation.
Setup Precautions
Even if you specify to start the PPP connection function at FCN/FCJ system startup, it
may fail to start for any of the following reasons:
- The PPP setting file does not exist.
- The PPP setting file exists but it contains syntax errors.
- Modem initialization failed.
In the event of an error, a critical error message will be written to the kernel log file.
Disable the use of the default gateway in the Ethernet IP routing setup so that the
PPP connection function can automatically set the PPP destination as the default
gateway when it establishes a PPP client connection. When the PPP client
connection is terminated subsequently, this default gateway setting is automatically
deleted.
SEE ALSO
For more details on the JEROS basic setting file and IP routing file, see the FCN/FCJ online help
documentation.
Setup Precautions
If a default gateway in specified for Ethernet, the system cannot set up a default route
for PPP when establishing a PPP client connection.
Setup Example
The figure below shows a sample network structure. The JEROS basic setting file and
IP routing file shown below the figure allow the FCN/FCJ to perform IP connection to
machines 1 to 9 in the sample network structure.
SEE ALSO
For more details on the COMx port setting file, see the FCN/FCJ online help documentation.
Setup Precautions
z Baud rate
To increase transfer efficiency, set the baud rate for transmission between the
FCN/FCJ and modem to a larger value than the line baud rate (baud rate between
modems).
with an equal (=) character coded between a setting name and a setting value. Blank
characters preceding and following the equal character are optional and if present,
are ignored.
The following syntax is used to code multiple setting values for a setting name:
<setting name>={
<setting value 1>
<setting value 2>
<setting value 3>
・・・
}
In the above syntax, each of the setting value is coded on a separate line.
Setup Precautions
Examples:
PppMode1 = SERVER
PppMode2 = NONE
For more details on modem settings, read the manual for your modem.
Example:
ModemAcceptStr1 = ATQ0E0V1&C1&K3S0=1
For more details on modem settings, read the manual for your modem.
When using Ethernet, use a different network address from Ethernet.
Example:
ModemDenyStr1 = ATE0Q0V1&K3&C1S0=0
Example:
LocalAddress1 = 10.20.30.41
TIP
- Private IP addresses (RFC1918)
Private IP addresses are IP addresses which can be freely used in an environment not connected
to the Internet.
If nothing is specified by the destination, select any address from the private address range for
the PPP LocalAddress and RemoteAddress settings.
For more details on private addresses, see RFC1918 (Address Allocation for Private Internets).
Example:
RemoteAddress1 = 10.20.30.40
Example:
SubnetMask1 = 255.255.255.0
Example:
IdleTimeout1 = 600
Example:
UserDef = {
"username" "password"
"PPPuser" "secret"
"user01" "name\"01"
}
Examples:
TraceMode1 = YES
TraceMode2 = NO
Example:
AcceptMode1 = YES
Example:
ModemCommandTimeout1 = 10
Example:
ConnectTimeout1 = 120
Example:
AuthType1 = PAP
ServerHosts = {
<hostname> <destination setting name>
<hostname> <destination setting name>
・・・・・
}
Code each hostname with its corresponding destination setting name, delimited by
blank characters (tab or space characters), on a separate line. If a hostname is
duplicated, the last destination setting name is used.
Example:
ServerHosts = {
sakura @sakura
momo @momo
www @sakura
mail @momo
}
COM# : use COM port ('#' denotes the COM port number (1, 2, …)
ETHER: Use Ethernet (PPP cannot be used)
Example:
DeviceName = COM1
For more details on modem settings, read the manual for your modem.
Example:
ModemInitStr = ATQ0E0V1&C1&K3
Example:
ModemDialStr = ATDT
Example:
IdleTimeout = 300
Phone = {
"<telephone number>"
"<telephone number>"
・・・・
}
Specify one or more telephone numbers for dialing, one on each line, with each
telephone number enclosed within double quote (“) characters. The PPP client
function dials each number in turn, starting from the first telephone number, until a call
is successful *1.
Each telephone number is sent to the modem without modification, and may include
comma (,), hyphen (-) or other special characters required by the modem. For more
details, see the manual of your modem.
Example:
Phone = {
"9,11-1111"
"9,11-1112"
"9,11-1113"
}
With the example settings above, the PPP client function dials a ‘9’ for an external
line, and then dial 111-111 to connect to the PPP server. If the line is busy, it proceeds
to dial “11-1112” and “9,11-1113” in turn.
*1: A call may be unsuccessful because the two modems fail to communicate, the destination is busy or the
destination is not switched on. A call would still be considered successful even if the PPP authentication
subsequently fails.
Example:
SubnetMask = 255.255.255.0
Example:
UserName = "ppppass"
Example:
PassWord = "ppppass"
ChatScript = {
<command>
<command>
・・・
}
The commands which can be used within a chat script are described below.
wait “string”
Wait until the specified string is received. If it is not received within the duration
designated by ChatTimeout, terminates script execution, and generates a
connection error.
send “string”
Sends the specified string. If the specified string cannot be sent successfully
within the duration designated by ChatTimeout, terminates script execution, and
generates a connection error.
sleep <integer value : 0 to 2147483647>
Suspends processing for the specified number of seconds.
Example:
ChatScript = {
wait "login:"
send "pppuser\n"
wait "Password:"
send "himitsu\n"
wait "Login OK"
}
Example:
TraceMode = YES
Example:
ModemCommandTimeout = 10
Example:
ModemConnectTimeout = 120
Example:
RedialInterval = 5
Example:
RedialMax = 10
Example:
ConnectTimeout = 30
Example:
LocalAddress = 10.20.30.50
Example:
AuthType = PAP
Example:
ChatTimeout = 10
########################################################################
#
# [Server] Section
#
# KEY =Default # Description
# The character # in the name represents 1
# for COM1 or 2 for COM2
# ModemAcceptStr# =(*) # Modem command string for Answering
# ModemDenyStr# =(*) # Modem command string for Denying
# LocalAddress# =(*) # Local IP Address
# SubnetMask# =(*) # Subnet Mask
# IdleTimeout# =(*) # PPP Server Idle Timeout (seconds)
#
# UserDef =--- # User Account
#
# RemoteAddress# =--- # Remote IP Address
# TraceMode# =NO # Trace Mode
# AcceptMode# =YES # PPP Server Accept
# ModemCommandTimeout# =5 # Modem Command Timeout (seconds)
# ConnectTimeout# =60 # PPP Connect Timeout (seconds)
# AuthType# =PAP # Authentication Type (NONE,PAP,CHAP)
# DefaultGateway# =NO # Default Gateway
#
# (*) Can not be omitted.
########################################################################
[Server]
# COM1
#ModemAcceptStr1 = ATE0Q0V1S0=1
#ModemAcceptStr1 = ATE0Q0V1&K3&C1S0=1 # DoCoMo 96F2
#ModemAcceptStr1 = ATE0Q0V1&C1S0=1 # DoCoMo MobileArk
#ModemAcceptStr1 = ATE0Q0V1&K0&C1S0=1 # SUNTAC DS96IB
#ModemAcceptStr1 = AT&D2E0Q0V1S0=1 # AIWA MD144XT10V
ModemAcceptStr1 = AT&F1E0Q0V1S32=96S0=1 # 3Com SPORTSTAR SUPER 56K
#ModemDenyStr1 = ATE0Q0V1S0=0
#ModemDenyStr1 = ATE0Q0V1&K3&C1S0=0 # DoCoMo 96F2
#ModemDenyStr1 = ATE0Q0V1&C1S0=0 # DoCoMo MobileArk
#ModemDenyStr1 = ATE0Q0V1&K0&C1S0=0 # SUNTAC DS96IB
#ModemDenyStr1 = AT&D2E0Q0V1S0=0 # AIWA MD144XT10V
ModemDenyStr1 = AT&F1E0Q0V1S32=96S0=0 # 3Com SPORTSTAR SUPER 56K
LocalAddress1 = 192.168.200.101
SubnetMask1 = 255.255.255.0
IdleTimeout1 = 300
RemoteAddress1 = 192.168.200.201
TraceMode1 = NO
AcceptMode1 = YES
ModemCommandTimeout1 = 5
ConnectTimeout1 = 60
AuthType1 = PAP
DefaultGateway1 = NO
# Common Definition
UserDef ={
"pppuser" "ppp9999"
}
########################################################################
#
# [Client] Section
#
# KEY =Default # Description
#
# ModemInitStr =(*) # Modem Initialization Command String
# ModemDialStr =(*) # Modem Dial Command String
# DeviceName =(*) # Device Name (ETHER,COM1,COM2)
# Phone =(*) # Destination Telephone Number
# IdleTimeout =(*) # Idle Timeout (seconds)
#
# SubnetMask =--- # Subnet Mask
# UserName =--- # User Name
# PassWord =--- # Password
# ChatScrpt =--- # Chat Script
# ServerHosts =--- # Hostname
#
# TraceMode =NO # Trace Mode (YES, NO)
# ModemCommandTimeout =5 # Modem Command Timeout (seconds)
# ModemConnectTimeout =60 # Modem Connect Timeout (seconds)
# RedialMax =3 # Redial Interval
# ConnectTimeout =60 # PPP Connection Timeout (seconds)
# LocalAddress =0.0.0.0 # Local IP Address
# AuthType =PAP # Authentication Type
# (NONE,PAP,CHAP,PAP_CHAP,SCRIPT)
# ChatTimeout =3 # Chat Timeout (seconds)
#
# (*) Can not be omitted.
########################################################################
#
# Default Subsection
#
########################################################################
[Client]
ServerHosts = {
smtpsvr @pap
unixsvr @script
}
#ModemInitStr = ATE0Q0V1S0=0
#ModemInitStr = ATE0Q0V1&K3&C1S0=0 # DoCoMo 96F2
#ModemInitStr = ATE0Q0V1&C1S0=0 # DoCoMo MobileArk
#ModemInitStr = ATE0Q0V1&K0&C1S0=0 # SUNTAC DS96IB
#ModemInitStr = AT&D2E0Q0V1S0=0 # AIWA MD144XT10V
ModemInitStr = AT&F1E0Q0V1S32=96S0=0 # 3Com SPORTSTAR SUPER 56K
IdleTimeout = 300
TraceMode = NO
DeviceName = COM1
ModemCommandTimeout = 5
ModemConnectTimeout = 60
RedialMax =3
ConnectTimeout = 60
LocalAddress = 0.0.0.0
##SubnetMask =
AuthType = PAP
UserName = "pppuser"
PassWord = "ppppass"
ChatTimeout =3
########################################################################
# Subsection
# Exsample : Use PAP
########################################################################
@pap:
AuthType = PAP
UserName = "pppuser"
PassWord = " ppppass"
Phone ={
"234-5678"
}
########################################################################
# Subsection
# Exsample : Use SCRIPT
########################################################################
@script:
AuthType = SCRIPT
ChatScript = {
wait "login:" # Wait for "login:" string
send " pppuser \n" # Send your user name with LF character
wait "Password:" # Wait for "Pasword:" string
send " ppppass \n" # Send your password with LF character
wait "Last Login" # Wait for "Last Login" string
}
Phone ={
"123-4567"
}
Additional Setting
We describe here the additional setting required for using PPP in the E-mail function.
SEND : Use PPP for Send Spool function; use Ethernet for
Receive Mail function.
Select this option if the SMTP server is on PPP but the
POP server is on Ethernet.
RECV : Use PPP for Receive Mail function; use Ethernet for
Send Spool function.
Select this option if the POP server is on PPP but the
SMTP server is on Ethernet.
BOTH : Use PPP for both Send Spool function and Receive Mail
function.
NONE : Do not use PPP. Use Ethernet for both Send Spool
function and Receive Mail function.
z Setup procedure
1. Configure the PPP connection function. Register the hostnames of the SMTP
server and POP server using the destination host (ServerHosts) setting in the
[Client] section of the PPP setting file.
2. Specify whether to use PPP for the Send Spool and Receive Spool function using
the UsePpp setting.
3. Specify the interval for sending spooled E-mails and the interval for receiving
E-mails using the SendCycle and RecvCycle settings respectively.
z Setup precautions
- The send (or receive) interval refers to the waiting time starting from the end of a
PPP connection to the beginning of the next connection, and does not include the
time taken for sending (or receiving).
- If both E-mail sending and receiving have the same PPP destination and the
same interval, PPP connection is established once only. Otherwise, separate
PPP connections are established for sending and receiving.
Basic Specifications
The PPP connection function of the JEROS emulator performs dummy processing,
without actually establishing and terminating PPP connections.
The emulator’s PPP client function manages PPP client connection statuses
internally. The emulator’s PPP server function treats the PPP server connection as
always disconnected. The emulator’s connection management function responds to
application requests based on settings read from the PPP setting file and an internal
control table maintained by the emulator. Finally, the emulator’s log function outputs
log messages to standard output.
The JEROS emulator does not support the idle timeout feature, which automatically
terminates a connection when there is no transmission for certain duration.
Application Compatibility
The JEROS emulator enables communications with remote PPP peers over Ethernet
using communications applications originally written for use with the PPP connection
function, without requiring program modification.
TIP
In Ethernet mode of PPP client function, the PPP client function is disabled and actual
communications is carried out using Ethernet. Ethernet mode setup is defined using the PPP setting
file. (For more details, see Section 4.4.3, “PPP Client Function Related Settings”.)
The PPP client function, though disabled in Ethernet mode, behaves as though it is enabled. Using
Ethernet mode allows communications applications using PPP client function to communicate via
Ethernet without code modification.
9 : Supported
U: Supported with restrictions
¯: Dummy function
Appendix 3 Troubleshooting
This appendix describes how to troubleshoot problems related to PPP connection
failures.
If the FCN/FCJ fails to connect successfully as a PPP client to a remote PPP server,
try connecting to the remote PPP server from a PC instead and see if connection is
successful.
1. Connect the modem used by the FCN/FCJ to a PC.
2. From the PC, connect to the same remote PPP server machine
using a dial-up network or other means.