creativebytes.net / cb_PMM: Description | Examples | FAQ | Download | IPC@Chip

cb_PMM - Monitoring Demo

This example shows how to monitor client/server connections on TCP-sockets.

In this example the TCP-client software runs on an embedded system, the IPC@CHIP from Beck IPC Gmbh. The IPC@CHIP (DK40) communicates with a corresponding TCP-server on a Windows-PC. The DK40 and the PC are connected to a TCP/IP-network (LAN, Intranet, Internet etc.).

Please note, that the described method can be applied to ANY client/server connection on TCP-sockets, the usage of the IPC@CHIP is only an example.

In normal operation the TCP-client connects to the server on a defined port (e.g. 1024).

To enable TCP-connection monitoring, cb_PMM has to be installed and configured (in this example cb_PMM runs on the same PC as the TCP-server). The server's port has to be changed (e.g. to 1027), and cb_PMM has to be configured to listen on port 1024 and map the connection to port 1027.

When client and server communicate, the transmitted data can be monitored and logged by cb_PMM.

Example:

1) Client opens a TCP-socket to cb_PMM, which mappes the connection to the server:

## 10:17:44:348 Incoming connection from 192.168.1.111:57976 to 192.168.1.3:1024. 
## 10:17:44:348 Mapping connection from 192.168.1.111:57976 to 192.168.1.3:1027. 

2) Client sends data to the server. The data is logged by cb_PMM (in this example logging is done in hex-mode):

## 10:17:46:251 DATA (Client -> Server): Length= 80
33 31 42 55 30 30 38 30 2C 31 2C 32 37 31 31 30 31BU0080,1,27110
31 2C 30 39 32 34 34 33 2C 34 38 31 30 2E 32 34 1,092443,4810.24
31 38 2C 4E 2C 30 31 36 32 30 2E 32 35 36 35 2C 18,N,01620.2565,
45 2C 30 30 30 2E 30 2C 30 30 30 2E 30 2C 56 2C E,000.0,000.0,V,
30 2C 30 30 2C 2C 2C 30 2C 30 2C 30 2C 30 2C 30 0,00,,,0,0,0,0,0

3) Server replies with following data:

## 10:17:46:381 DATA (Server -> Client): Length= 10
30 30 31 32 33 34 30 31 30 31                   0012340101 

4) Client sends next data packet ... server replies ...

## 10:17:49:195 DATA (Client -> Server): Length= 80
33 32 42 55 30 30 38 30 2C 31 2C 32 37 31 31 30 32BU0080,1,27110
31 2C 30 39 32 34 34 38 2C 34 38 31 30 2E 32 34 1,092448,4810.24
31 38 2C 4E 2C 30 31 36 32 30 2E 32 35 36 35 2C 18,N,01620.2565,
45 2C 30 30 30 2E 30 2C 30 30 30 2E 30 2C 56 2C E,000.0,000.0,V,
30 2C 30 30 2C 2C 2C 30 2C 30 2C 30 2C 30 2C 30 0,00,,,0,0,0,0,0
## 10:17:49:316 DATA (Server -> Client): Length= 10
30 30 31 32 33 34 30 31 30 31                   0012340101 

5) Client closes socket, server disconnects:

## 10:17:59:000 DATA (Client -> Server): Length= 0
                     
## 10:17:59:010 Disconnect (incoming). 

6) Communication is finished.

Interested in more examples? Visit the cb_PMM - Examples page!

FAQ for the Monitoring Demo

Q: What do I need to set up a similar system?

A: You need the following components:

  1. A PC with a and a LAN connection. Operating system: Windows (98, NT4.0 or 2000)
  2. An IPC@Chip connected to the LAN
  3. cb_PMM, the Port-Mapping-Monitoring software (download from here)
  4. Any (TCP-) client/server-software which runs on the IPC@Chip and Windows

Q: How do I set up such a test system?

A: Follow these steps:

  1. Verify the connection between PC and IPC@Chip (i.e. using ping)
  2. Verify the function of the client/server software (establish communication between the IPC@Chip and the Windows PC)
  3. Note the "(old) server port" and choose any available port as the "new server port"
  4. Install and configure the cb_PMM as described here. Use the following settings:
    Bind IP: [none]
    Listen Port: [see later]
    Map IP: [see later]
    Map Port: [see later]
    Map: [checked]
    Log: [checked]
    Data Mode: [Hex]
    Log to Screen and/or Log to File: [checked]

    Depending on your client/server environment and the configuration capabilities of the client- and server-software, there are 4 possible ways to configure such a system:
client/server setup

server on PC
client on IPC@Chip

server on IPC@Chip
client on PC
port configuration possible for client server client server
         
configuration for cb_PMM        
listen port new server port old server port new server port old server port
map ip IP of PC IP of PC IP of IPC@Chip IP of IPC@Chip
map port old server port new server port old server port new server port
         
configuration for client        
server IP IP of PC IP of PC IP of PC IP of PC
server port new server port (old server port) new server port (old server port)
         
configuration for server        
listening port (old server port) new server port (old server port) new server port

Now you are ready to start the mapping at cb_PMM, start your client- and server-applications and monitor the transmitted data.

Q: I followed the advice here but something does not work. I think I found a bug. What can I do?

A: View the cb_PMM-FAQ. If this does not answer your question contact us: office@creativebytes.net

Interested in more information? Read the cb_PMM - Description!

contact: office@creativebytes.net | © 2003 creativebytes.net - provided by baumann.at