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!
|