PROJECTS
Back to PROJECTS

Research Projects
  GNU/EDMA
  AGNES

GNU/EDMA Projects
  PRISCILA
   · PRISCILA User Manual

Other Projects
  Netkitty
  SBS Processor
  speech server

 NetKitty
Documentation
  Tutorial

Download
  nk Package [257Kb]
  Source Code [13Kb]
  i386 dietlibc [9.8Kb]
  BeagleBoard [38 Kb]
  OpenMoko [30Kb]

NetKitty Tutorial
sometime in 2008!

Netkitty is a small network tool that complements Netcat. In this brief tutorial we will show how to use the NetKitty features not avaliable on Netcat.

Basic Usage

The basic usage of NetKitty is really simple. The command syntax is as follows:

nk [-hub] [-shell] [-os] [-client [T|U|B],address,port] [-server [T|U|B],port]

where:

Specific parameters for clients and servers are specified below: In the rest of this text some examples on how to use nk are show.

Instant Messaging. The -hub flag

The -hub flag converts NetKitty in a simple Instant Messaging system. This flag makes nk to resend anything it gets from any link to any other link it is managing.

Let's see how to use it to set up a simple Instant Messaging System with nk.

You can connect as many clients as you want to your new IM server.

Poor's Man Telnet

The -shell flags instructs NetKitty to start an interactive shell (/bin/sh -i), whenever a connection is established. In order to use this feature almost one server port should be defined.

A simple example, providing shell access to a given device either using a normal TCP connection or a bluetooth link:

nk -shell -server T,5000 B,5

From this point on, any connection to TCP port 5000 or any Bluetooth connection through channel 5, will provide a rudimentary shell to any client.

Network Distributor

You can use NetKitty to distribute a data source to several remote clients in an easy way. We had used this features several times to make a simple one-way client connecting to different servers and sending the same data to each one... without modifying neither the client nor the server.

In order to illustrate our example, a real live example will be taken. Suppose that we have a visual tracking system that send positional information to a simulation engine trough a TCP/IP channel. The simulation engine TCP port will be 10000.

Now, we want to control two different simulation engines from the same optical tracking system, so we use nk for this task. In the machine running the optical tracking system we launch nk with this line:

nk -hub -server T,10000 -client T,ip_server1,10000 T,ip_server2,10000

Now we only need to configure our tracking system to send data to a "virtual" simulation engine running in localhost (127.0.0.1:10000).

Simple backup

NetKitty allows to perform backups in the same way that netcat. As NetKitty allows the server to accept further connections, the -os flags should be used to instruct the server side to finish when the client disconnects.

So, in order to perform a backup, The following commands should be used.

In the machine where the backup will be stored run:

nk -os -server -T,10000 > raw_data.dat

In the machine you want to backup run:

cat whatever | nk -client T,the_ip,10000

That's all.

Bluetooth Connections

NetKitty supports rfcomm bluetooth connection, providing an additional mechanism to connect different devices. We can seamless mix network and bluetooth devices in our communications using nk.

This example show how to use nk to gather information from different sensor devices. Some of then are equipped with wifi devices, so they can be managed as normal TCP connections, but other uses bluetooth to transmit the date collected. So, this nk command-line will do the job.

nk -server -T,10000 -B,4 > raw_data.dat

With the line above, NetKitty will accept TCP connections to port 10000, and rfcomm bluetooth connection on channel 4.

If you don't want to code all the bluetooth socket stuff in your sensor systems applications, just let nk transmit your data out. Let's suppose that your data application dumps data to stdout and that our server is in Bluetooth address 30:F2:61:CE:B2:A3. Then this line will be useful:

data-app | nk -client B,30:F2:61:CE:B2:A3,4

And we are done.

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Please send comments to dmartin AT uvigo DOT es

 

 
OTHER SITES
[www]
[Group]
[YouTube]

[www]
[Blog]
[YouTube]

Personal Blog