0% found this document useful (0 votes)
67 views17 pages

Dnet2 UserGuide

Uploaded by

w01010665188
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views17 pages

Dnet2 UserGuide

Uploaded by

w01010665188
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

DNet2 User Guide

Network

Project: Dnet2
Product OSK / AK
Synopsis: Principals of Dnet2. How to configure Dnet2.

Document number: Revision:

Customer doc number: Document version:

Contract number: Number of pages: 17


Rev. Date Reason for issue Made by Checked Approved

A 12.12.2005 Initial issue kgt KHE

B 02.05.2007 Official front page and table of contents kgt

Kongsberg Maritime AS
Kongsberg Maritime AS

Table of contents
1 ABOUT THIS DOCUMENT ..................................................................................4
1.1 Document history ...................................................................................................4
1.2 References ..............................................................................................................4
1.3 Definitions / Abbreviations ....................................................................................4

2 INTRODUCTION....................................................................................................5
2.1 Purpose ...................................................................................................................5
2.2 INSTALLATION ON WINDOWS .......................................................................6
2.3 OskConfigure .........................................................................................................6
2.4 Manual trouble shooting on Windows....................................................................7

3 INSTALLATION ON SBC .....................................................................................8

4 CONFIGURATION: ............................................................................................... 8
4.1 ON Windows ..........................................................................................................8
4.2 ON SBC ..................................................................................................................9

5 REFERENCE .........................................................................................................10
5.1 Dnet2Loader .........................................................................................................10
5.1.1 Command line parameters ........................................................................ 10
5.1.2 Usage ........................................................................................................ 10
5.1.3 Dnserv integration .................................................................................... 11
5.1.4 Dnet2 only between XP OS‟es on, example from AIM ........................... 11
5.1.5 Statistics .................................................................................................... 11
5.1.6 Compatibility with Dnet applications. ...................................................... 11
5.1.7 Example on a mixed configuration ........................................................... 12
5.2 API to Dnet statistics and management ................................................................ 14
5.3 Compability ..........................................................................................................15
5.3.1 API‟s ......................................................................................................... 15

/ / Page 2 of 17
Kongsberg Maritime AS

5.3.2 Booting from flash .................................................................................... 16


5.3.3 SBC400, SBC400H and RCU400H in a dnet2 delivery .......................... 16

/ / Page 3 of 17
Kongsberg Maritime AS

1 ABOUT THIS DOCUMENT

1.1 Document history

Revision Description of Change

A First Issue

1.2 References

No Doc No Description

1.3 Definitions / Abbreviations

/ / Page 4 of 17
Kongsberg Maritime AS

2 INTRODUCTION

Dnet2 is a local area dual redundant IP (TCP & UDP) network

DNET 2
Host

172.21.x.x
IP net A
172.23.x.x
IP net AB

IP net B

172.22.x.x

Dnet2 is implemented as a virtual network adapter; the real adapters may still be used.

2.1 Purpose

The main benefit of Dnet2 is:


Implemented under the hood of the operating system as a driver, and is therefore
available for all programs through the native API.
The forking of new messages and discard of duplicates is done by a device driver, and
the dual network will therefore use considerable less resources.

A Dnet2 system must have 2 physical NIC‟s (Network Interface Cards).


The physical NIC‟s are called Net A and Net B.
The Dnet2 is implemented by providing a new virtual adapter (acting as a NIC)
with its own IP address. This is called Net AB.
All traffic which match the network part of Net AB‟s IP address is handled by the
Dnet2.
(Any IP address has a network and host part)

Sample:

/ / Page 5 of 17
Kongsberg Maritime AS

IP Net A 172.21.13.1, Mask 255. 255.0.0 give network 172.21.x.x


IP Net B 172.22.13.1, Mask 255. 255.0.0 give network 172.22.x.x
IP Net AB 172.23.13.1, Mask 255. 255.0.0 give network 172.23.x.x

The addresses used is according to our standard, but can be changed via configuration.
See KM Bookshelf IP addresses and port-number conventions, 1002320.doc.

2.2 INSTALLATION ON WINDOWS

2.3 OskConfigure

The Dnet2 is delivered as device driver and is installed by OskConfigure.

First time, the virtual adapter is installed, and two warning dialogue may occur.

The “Continue Anyway” must be clicked to successfully install the Dnet2.


If installation terminated with “"Please REBOOT before installing again!!”

/ / Page 6 of 17
Kongsberg Maritime AS

OskConfigure must be started again after REBOOT.


After successfully installation, a new item is included in the Network Connection.
(Start -> Connect To -> Show all connections)

It is advisable to rename the connections to reflect the network name.


Net AB should be the adapter which have Device Name “Kongsberg Maritime virtual
Network Adapter”. The IP address must be changed according the configuration, If
standard IP addresses are used it should be 172.23.nnn.nnn where nnn.nnn is the same
as on Net A and Net B. (See sample in introduction).
The Dnet2 software is installed under
\\Program Files\Common Files\Deterministic Networks\Dnet2\bin
Is has no direct dependencies to the OSK

2.4 Manual trouble shooting on Windows


The AkUtils folder of the MA02_Dnet2 package contains the installation script
(Dnet2InstallScript.wsf) and a .bat file to execute it.
Open a CMD window and navigate to the AkUtils folder and start
Dnet2InstallScript.bat

Microsoft (R) Windows Script Host Version 5.6


Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

======== D n e t 2 I n s t a l l ============
Install Dnet2 system from :.xxx
AkUtils
0 = Show install Information
1 = Install DNE
2 = Install Virtuall adapter
3 = Install Dnet2 driver
4 = UnInstall DNE
5 = UnInstall Virtuall adapter
6 = UnInstall Dnet2 driver

/ / Page 7 of 17
Kongsberg Maritime AS

In case of abnormal termination of OskConfigure, the 0 = Show install Information can


give a support technician information about the cause.
Manual installation can be done by selecting 1,2,3 in sequence.
Uninstall should be done by selecting 6,5,4 in sequence.

3 INSTALLATION ON SBC
Dnet2 is included in the AK release (xx.xx.xx) and newer, no additional installation is
needed.

4 CONFIGURATION:
The usage of Dnet2 features is controlled by :T154 in the bootp. This defines the IP
network address used for the AB interface.

dnet:\
:hn:\
:sm=255.255.0.0:\
:T150=ac.15.00.00:\
:T151=ac.16.00.00:
:T154=ac.17.00.00:\
:T152=e6.15.00.00:\
:T153=e6.16.00.00

Sample bootp file.

When this is defined, the driver will start automaticly.

4.1 ON Windows
The driver is loaded and started by dnserv (when T154 exist), and left running after
dnserv exits.
AB net will therefore not be operating before the application is started, but is operating
after the application is terminated.

/ / Page 8 of 17
Kongsberg Maritime AS

If the AB net must be operating immediately, the following must be inserted into
registry.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\
REG_SZ Dnet2= "C:\Program Files\Common Files\Deterministic
Networks\Dnet2\bin\Dnet2Loader.exe" -hide

4.2 ON SBC
The driver starts automatically (when T154 exist), and remain active.

/ / Page 9 of 17
Kongsberg Maritime AS

5 REFERENCE

5.1 Dnet2Loader
The main purpose for the net2Loader is to configure and start the Dnet2Driver on
windows. In addition it has features to show statistics from the Dnet2.
The first instance loaded, will spawn a service thread necessary to serve remote statistic
requests.
When Dnet2loader terminates, the Dnet2Driver is left running. It can be stopped
manually with “net stop dn2aknet” in a cmd window for example to upgrade to new
version.

C:\Documents and Settings\dpos>net stop dn2aknet


The Dualnet IM Driver service was stopped successfully.

NB: The corresponding” net start dn2aknet” will not start the driver correct, the
Dnet2Loader.exe must be used.

5.1.1 Command line parameters


-A | -B | -AB <xxx.xxx.xxx.xxx> defines the network address which should be used.
If not specified, the default is according to KM standard which is equal to:
-A 172.21.0.0 -B 172.21.0.0 -AB 172.23.0.0
- hide No GUI is displayed.

5.1.2 Usage
The normal usage is to launch the first instance with –hide, this will then configure and
start the driver in addition to host the service thread.. If statistics is needed, launch
another instance and use the statistics dialogue.

/ / Page 10 of 17
Kongsberg Maritime AS

5.1.3 Dnserv integration


If Dnserv finds T154 inn bootp, the Dnet2loader is launched from:
\Program Files\Common Files\Deterministic Networks\Dnet2\bin
with the-hide parameter and the IP addresses found in bootp.

5.1.4 Dnet2 only between XP OS’es on, example from


AIM
In this case Dnet2loader must be launched together with the other applications.
On Aim this could be done from run\bin\tools\StartAux1.bat with the following
command:
START %RUN_BASE%\..\dnet2\bin\dnet2loader.exe –hide
It is necessary also to stop the loader process in run\bin\tools\StopAux1.bat
oskill.exe dnet2loader

By stopping the dnet2loader process, the actual driver will remain loaded and active.
This mean that the Dnet2 address (172.23.x.x) will work, but remote statistics requests
will not be served.

5.1.5 Statistics

When T154 exists in bootp, dnserv will include the Dnet2 statistics in the counters for
lost messages.

5.1.6 Compatibility with Dnet applications.


Dnet2 and Dnet machines can communicate if the following rules are met:

Multicasts which shall be used on Dnet machines (including SBC 400) must be in the
range defined by :T152 in bootp (old range)
Dnet machines must always be addressed with A addresses (defined by :T150)
The application on Dnet2 machines must accept both A and AB address as form
address.

/ / Page 11 of 17
Kongsberg Maritime AS

5.1.7 Example on a mixed configuration

# /etc/bootptab: database for bootp server (/etc/bootpd)


network.config:\
:hn:\
:sm=255.255.0.0:\
:T150=ac.15.00.00:\
:T151=ac.16.00.00:\
:T152=e6.15.00.00:\
:T153=e6.16.00.00:\
:T154=ac.17.00.00:

# Individual entries
PCU3a:ht=ethernet:ha=02414c421403:ip=172.21.140.3:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU3b:ht=ethernet:ha=02414c422403:ip=172.22.140.3:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU4a:ht=ethernet:ha=02414c421404:ip=172.21.140.4:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU4b:ht=ethernet:ha=02414c422404:ip=172.22.140.4:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU5a:ht=ethernet:ha=02414c421405:ip=172.21.140.5:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU5b:ht=ethernet:ha=02414c422405:ip=172.22.140.5:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU6a:ht=ethernet:ha=02414c421406:ip=172.21.140.6:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU6b:ht=ethernet:ha=02414c422406:ip=172.22.140.6:bf=/Bin/Ps/rcu500_std.str:tc=network.c
onfig
PCU7a:ht=ethernet:ha=02414c421407:ip=172.21.140.7:bf=/Bin/Ps/rcu400h_std.str:tc=network.
config
PCU7b:ht=ethernet:ha=02414c422407:ip=172.22.140.7:bf=/Bin/Ps/rcu400h_std.str:tc=network.
config
PCU10a:ht=ethernet:ha=02414c42140a:ip=172.21.140.10:bf=/Bin/Ps/rcu400h_std.str:tc=networ
k.config
PCU10b:ht=ethernet:ha=02414c42240a:ip=172.22.140.10:bf=/Bin/Ps/rcu400h_std.str:tc=networ
k.config

#-------------------------------------------------------------------------
# IP Host # MessPort WaitPort PsPsComPort IoPort
#-------------------------------------------------------------------------
172.23.101.1 OS001 # 10100 11100 12100 13100 # OS001
172.23.101.1 DS001 # 10200 11200 12200 13200 # DS001
172.23.101.2 OS002 # 10100 11100 12100 13100 # Main-DP SdpOS
SDP-OS2 101
172.23.101.2 DS002 # 10200 11200 12200 13200 #
172.21.1.1 PS001 # 10500 11500 12500 13500 # Main-DP A Controller
DpPs01 500
172.21.1.2 PS002 # 10500 11500 12500 13500 # Main-DP A IO1
DpPs02 501
172.21.1.11 PS011 # 10500 11500 12500 13500 # Main-DP B Controller
DpPs11 510
172.21.1.12 PS012 # 10500 11500 12500 13500 # Main-DP B IO1
DpPs12 511
172.21.101.2 PS017 # 10517 11517 12517 13517 # Main-DP A Simulator
DpPs17 516 WinPS@OS001
172.21.101.2 PS018 # 10518 11518 12518 13518 # Main-DP A VRM
DpPs18 517 WinPS@OS001

/ / Page 12 of 17
Kongsberg Maritime AS

172.21.1.26 PS026 # 10526 11526 12526 13526 # IndJS A Simulator


DpPs26 525
172.21.1.27 PS027 # 10527 11527 12527 13527 # IndJS A VRM
DpPs27 526
172.21.101.2 PS030 # 10530 11530 12530 13530 # Field Simulator VRM
DpPs30 529 WinPS@OS001
172.23.140.3 PS003 # 10500 11500 12500 13500 # SBC-PS
172.23.140.4 PS004 # 10500 11500 12500 13500 # SBC-PS
172.23.140.5 PS005 # 10500 11500 12500 13500 # SBC-PS
172.23.140.6 PS006 # 10500 11500 12500 13500 # SBC-PS
172.21.140.7 PS007 # 10500 11500 12500 13500 # SBC-PS
172.21.140.10 PS010 # 10500 11500 12500 13500 # SBC-PS
#-------------------------------------------------------------------------
# Multicasts
#-------------------------------------------------------------------------
230.21.101.1 MCOS # 10100
230.21.101.2 MCDS # 10200
230.21.101.3 MCHS # 10300
230.21.1.1 MCPS # 10500
230.21.1.2 MCIO1 # 13500
230.21.1.3 MCIO2 # 13500
230.21.1.4 MCIO3 # 13500
230.21.1.5 MCIO4 # 13500
#---------------------------------------------------------------------------------------
-----------------------
# DP multicast
#---------------------------------------------------------------------------------------
-----------------------
230.21.1.11 MCDPVG1
230.21.1.12 MCDPVG2
230.21.1.13 MCDPVG3
230.21.1.14 MCDPVG4
230.21.1.15 MCDPVG5
230.21.1.16 MCDPVG6
230.21.1.20 MCDPCOM
230.21.1.21 MCTHRCNT
230.21.101.20 MCDPOS
#---------------------------------------------------------------------------------------
-----------------------
# External equipment nodes
#---------------------------------------------------------------------------------------
-----------------------
230.23.1.22 MCAPOS1 # 32080 # HPR 1
230.23.1.23 MCAPOS2 # 32081 # HPR 2
172.23.101.1 RGEN # 32082 # RefsysGen
#---------------------------------------------------------------------------------------
-----------------------
# Loopback
#---------------------------------------------------------------------------------------
-----------------------
127.0.0.1 LOOPBACK # 33000 # Port base for
local net ports (net port address = 33000 + net port number)
#-------------------------------------------------------------------------
# Optional entries
#-------------------------------------------------------------------------

/ / Page 13 of 17
Kongsberg Maritime AS

5.2 API to Dnet statistics and management

/* -----------------------------------------------------------------------------
* Dn2_StartDriver - Start the driver.
*
* RETURNS: ERROR_SUCCESS (0) if OK, or other error values defined in
<WinError.h>
*/
ULONG Dn2_StartDriver()

/* -----------------------------------------------------------------------------
* Dn2_Dn2_StopDriver- Stop the driver.
*
*
* RETURNS: ERROR_SUCCESS (0) if OK, or other error values defined in
<WinError.h>
*/
ULONG Dn2_StopDriver()

/* -----------------------------------------------------------------------------
* Dn2_IsDriverStarted - determines if driver is started
*
*
* RETURNS: 1 if started, or 0 if not. Other errors can be obtained by GetLastError();
*/
ULONG Dn2_IsDriverStarted()

/* -----------------------------------------------------------------------------
* Dn2_SetDriverConfig - Sets the driver configuration.

/ / Page 14 of 17
Kongsberg Maritime AS

* Parameters, IpA, IpB, IpAB Host order IP address for real adapters (A+B) and
virtual (AB)
* NetMask Host order network mask.
* RETURNS: ERROR_SUCCESS (0) if OK, or other error values defined in
<WinError.h>
*/
ULONG Dn2_SetDriverConfig(ULONG IpA,ULONG IpB,ULONG IpAB, ULONG
NetMask)

/* -----------------------------------------------------------------------------
* Dn2_GetNetStat - Retrieve the communication hosts and the absolute traffic counters.
*
* RETURNS: ERROR_SUCCESS (0) if OK, or other error values defined in
<WinError.h>
*/
ULONG Dn2_GetNetStat(HANDLE hDn2,

/* ========================================= Get Statistics */


typedef struct {
ULONG NetIp; /* Network order */
ULONG Sent[4]; /* AB on A, AB on B, A on A B on B */
ULONG Received[4];

} DN2_STATISTICS_ENTRY, *PD2_STATISTICS_ENTRY;

5.3 Compability
5.3.1 API’s
Some API‟s are not 100% as they was when dnet2 is enabled.

dnetSend()
- If the address to send to is a net A address/broadcast dnetSend() works as it
always has.

/ / Page 15 of 17
Kongsberg Maritime AS

- If the address to send to is a net AB unicast/broadcast address, a dnet header


(„old style‟) is added to the message but the duplication into a message sent on
net A and net B is done below the IP stack.
- A dnet header is added ( “old style”) if the address to send to is a multicast
address and if destination internet address equals T152 & netmask (T152 from
bootptab.txt). Otherwise the dnet2 method is used.
dnetRecv()
- Receives messages sent with dnetSend(), the dnet header added with by
dnetSend() are removed. When dnetRecv() are used with net AB messages
the receiver has the “old” way of detect and remove duplicated messages. The
dnet2 way of remove duplicated packets has a theoretical possibility to fail.
Gethostip()
- When dnet2 is enabled gethostip() returns the IP address of net AB instead
of net A. (See chapter “booting from flash)

To maintain compability with mixed dnet and dnet2 deliveries, the dnet and timesync
servers broadcast their messages on the net A and net B internet addresses.

5.3.2 Booting from flash


Flash and booting from flash works as with the “old” dnet but since the gethostip()
returns net AB instead of net A the way to test if an application has been booted from
flash often is like this:
rtbootpar(&bootHost,bootFile,sizeof(bootFile));
if (bootHost == gethostip()) {
printf("Booted from flash!\n");
} else {
printf("Booted from remote host: %s\n",ntoa(bootHost));
}

The test should be changed to something like this:


rtbootpar(&bootHost,bootFile,sizeof(bootFile));
if (htonl(bootHost) == dualNetA(htonl(gethostip()))) {
printf("Booted from flash!\n");
} else {
printf("Booted from remote host: %s\n",ntoa(bootHost));
}
This way of testing is working for both “old” dnet and dnet2 (Backwads compability).

5.3.3 SBC400, SBC400H and RCU400H in a dnet2 delivery

/ / Page 16 of 17
Kongsberg Maritime AS

A requirement for the dnet2 project has been to not introduce these new methods on
SBC400, SBC400H and RCY400H. However because of the way “AIM net” uses
“host” files in a client-server interaction to obtain a stations internet address and the
logistic methods for handling different “host” files in one delivery we have found it
useful for the “old” computers to be aware of the new introduced net AB internet
address.

If a net AB internet address is defined (T154 bootp server) the following routines works
this way:

gethostip()
- Returns net A internet address even if T154 is defined by the BOOTP server.
dnetSend():
- Sending network messages, unicast or broadcast to a net A internet address
works as before.
- Sending multicast messages to a dnet multicast address (BOOTP T152)
works as before.
- Sending network messages to a net AB, unicast or broadcast internet address
will result in a “standard” dnet message on net A and net B. The destination
address in the message is changed from net AB to first net A and then net B
by the dnetSend() API.
- Sending multicast messages to an address not defined by the dnet setup in
the BOOTP server works as before, it fails with “network unreachable”.
dnetRecv():
- Massages with “old” dnet type addresses will be received as before.
- Messages designated for a net AB address will not be received (As before).

/ / Page 17 of 17

You might also like