Mobile Multimedia Lab



P2PWNC: Peer-to-peer Wireless Network Confederation RI - Documentation





This is the implementation of the Traffic Control module of the P2PWNC protocol. The main component (tc) is an iterative TCP server that waits for URRQ messages from P2PWNC access points (ap module). When receiving such a message it makes the appropriate calculations in order to provide a guaranteed bandwidth and a maximum bandwidth to the p2pwnc roamer users. It also provides a seperate traffic class for the home user in order to protect the home network from disturbing users. The QoS operations are performed using the tc/iptables packages.



This is free software, available under the GNU General Public Licence. For more information see COPYING.



This is version 1.0aplha of the P2PWNC tc software.



  • tc: Main component. It includes the iterative TCP server (p2pwnc-tc.c)

  • conf: Configuration file


This module runs on Linux and it has been tested under Linux 2.4 and 2.6. For the qdisc management operations we make use of tc (iproute2) executable and iptables (netfilter) for the traffic classification. If theese packages are not available to your system check dependecies section for downloading.



To build the software, you can follow the steps below:

  • Untar the archive (tar xvfz p2pwnc-tc-vXXX.tar.gz)

  • Compile the source (gcc p2pwnc-tc.c -o p2pwnc-tc)


After building the software copy the p2pwnc-tc executable wherever you want


The tc server reads information from a configuration file (optionally, these information can be provided as command line options). The default location for the configuration file of the ap server is /etc/p2pwnc/tc.conf. However, you can override this setting using the -c flag when starting up the server (that is, ./p2pwnc-tc -c myconf.conf, or ./p2pwnc-tc -c - for reading the configuration options from stdin). A sample configuration file is shown below:

#Traffic control module configuration file
inet-dev eth0
p2pwnc-dev eth1
real-uplink 512
real-downlink 1024
p2pwnc-uplink 256
p2pwnc-downlink 512
port 7777
tc-path /sbin/tc
iptables-path /sbin/iptables
cfull-qdisc htb
cless-qdisc pfifo limit 100
team-members local
p2pwnc-server 127.0.0.1
connection-timeout 20

Lines starting with a "#" are ignored. You can also write comments after the parameters by using "#" (everything after "#" is ignored) The first column represents configuration variables and the second is their value. These options are explained below:
  • inet-dev: Internet gateway network interface (eth0, ppp0, ...)

  • p2pwnc-dev: Network interface that handles roamers traffic (eth0, ppp0, ...)

  • real-uplink: Internet uplink bandwidth in Kbits (for a 128/384Kbps DSL Cable this is 128)

  • real-downlink: Internet downlink bandwidth in Kbits (for a 128/384Kbps DSL Cable this is 384)

  • p2pwnc-uplink: Uplink bandwidth assigned for p2pwnc purposes (this must be less than real-uplink)

  • p2pwnc-downlink: Downlink bandwidth assigned for p2pwnc purposes (this must be less than real-downlink)

  • port: The TCP port that the server is listening for connections

  • tc-path: Path of the tc executable

  • iptables-path: Path of the iptables executable

  • cfull-qdisc: The classfull qdisc to use (only htb is supported for now). You may also supply r2q and quantum parameters (htb r2q 1 quantum 1500)

  • cless-qdisc: The classless qdisc to use with the classfull. Bfifo, pfifo and sfq are the qdiscs supported. You can use limit parameter with bfifo and pfifo (pfifo limit 100) and limit, quantum and perturb with sfq (sfq limit 100 quantum 1450 perturb 10).

  • team-members: Use p2pwnc to treat team members as p2pwnc users or local to classify their traffic with the home traffic

  • p2pwnc-server: IP list with the ap modules that can connect with this tc server separated with space

  • connection-timeout: Connection time out (seconds) on a session



To start the tc software:
  • Execute the p2pwnc-tc (tc) program. You can specify the configuration file using the -c option. For a list of available options, type ./p2pwnc-tc --help or ./p2pwnc-tc -h (the available command line options are the same as the configuration options described above).