What is FlowMate?

FlowMate is a mechanism for clustering TCP flows emerging from a busy server and sharing common bottlenecks. Sample forward packet delays or RTT values are collected during a certain window size (in seconds) and are used in correlation tests. Two flows that successfully pass the correlation test share at least one common bottleneck on their path to their destinations, and are consequently assigned the same cluster (or group). Please refer to the following reference for more information on FlowMate architecture, mechanism, and performance:

Ossama Younis and Sonia Fahmy, "FlowMate: Scalable On-line Flow Clustering," IEEE/ACM Transactions on Networking, volume 13, issue 2, April 2005. [PDF] [Postscript]

FlowMate Implementation

FlowMate is implemented in the Linux kernel v.2.4.17. The files in this folder contain only the kernel files augmented with FlowMate code. FlowMate adds two new files (corr.c and corr.h) and updates 3 other files. Note that the modifications to the existing kernel files are very few, as described below:


A new file added to include/net folder. It contains the header definition of FlowMate structures, procedures, and global variables.


A new file added to net/ipv4 folder. It contains the implementation of FlowMate modules.


The existing tcp.c file is augmented with three new lines of code: (1) corr.h is included with the header files, (2) the global flow correlator structure is created (in function tcp_init), and (3) a flow is removed from the flow table when its connection is shut down (in function tcp_shutdown).


The existing tcp_input.c file is augmented with a few lines of code in order to: (1) include corr.h, (2) report a sample when an ACK is received (in function tcp_ack_saw_tstamp), and (3) hold the socket identifier in a global variable to be used as flow ID (in function tcp_clean_rtx). Note that a global variable, corr_mode, is defined in corr.h. This variable indicates if the collected sample is required to carry an RTT value or forward delay.


The existing Makefile is in the folder net/ipv4. It was modified to include corr.o in the obj-y variable.

In the modified files mentioned above, the inserted code can be found by searching for the word “FlowMate” throughout the file of interest.

How to use FlowMate?

The new files (corr.c and corr.h) should be placed in their specified folders. If you are using the Linux kernel v.2.4.17, then the modified files can also be copied directly to their specified folders. If you are using other Linux kernel versions, then it is better to extract the new pieces of code from the modified files and add them to their corresponding places in your kernel files. This will just take a couple of minutes for searching for the word “FlowMate” and copying the code to your files. After having everything in place, the kernel should be compiled and a system restart should be issued so that the main structure (FlowCorrelator) can start its operation.

The flow correlator generates a set of clusters of flows every few seconds (currently 6). The output is logged to the messages file. To view the generated clusters, use the following command:

           prompt> tail –f /var/log/messages

In order to use the clusters, you need to use the group list after each invocation of the clustering process. The global variable fcorrelator, which is an instance of FLowCorrelator, contains this group list (fcorrelator->groups). The group list is comprised of a linked list of group nodes. Each group node contains a list of flow IDs of member flows. Refer to the FlowCorrelator, GroupNode, and GroupList structures in corr.h for more details.

Copyright Statement

All new files in this distribution are Copyright 2003 by the Purdue Research Foundation of Purdue University. All rights reserved. Redistribution and use in source and binary forms are permitted provided that this entire copyright notice is duplicated in all such copies, and that any documentation, announcements, and other materials related to such distribution and use acknowledge that the software was developed at Purdue University, West Lafayette, IN. No charge may be made for copies, derivations, or distributions of this material without the express written consent of the copyright holder. Neither the name of the University nor the name of the author may be used to endorse or promote products derived from this material without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE.


Please contact: Ossama Younis younis@ece.arizona.edu for any questions or problems with the code.

Created by: Ossama Younis
Last updated by: Sonia Fahmy
July 8th, 2005