blob: 626a2ba40cf652ffa3b4a9c1cf2bfb113497efdc [file] [log] [blame]
Pavlin Radoslavov6fbf1192013-04-02 19:02:41 +00001#! /usr/bin/env python
2import itertools
3import sys
4
5src_port=1
6dst_port=1
7
8n=int(sys.argv[1])
9a=range(2,n+1)
10nflow=int(sys.argv[2])
11
12print "# For %d nodes cluster, %d flows per network pair, total %d flows" % (n, nflow, (n-1)*(n-2)/2 * nflow * 2)
13
14flow_id=1
15pair_id=1
16for i in itertools.combinations(a,2):
17 for f in range(2, nflow+2):
18 snet_id=int(i[0])
19 dnet_id=int(i[1])
20 term_id=f
21 print "%d ps_%d_1 00:00:00:00:00:00:%02x:%02x %d 00:00:00:00:00:00:%02x:%02x %d matchSrcMac 00:00:c0:a8:%02x:%02x matchDstMac 00:00:c0:a8:%02x:%02x" % (flow_id,pair_id,snet_id,term_id,src_port,dnet_id,term_id,dst_port,snet_id,term_id,dnet_id,term_id)
22 flow_id = flow_id + 1
23 print "%d ps_%d_2 00:00:00:00:00:00:%02x:%02x %d 00:00:00:00:00:00:%02x:%02x %d matchSrcMac 00:00:c0:a8:%02x:%02x matchDstMac 00:00:c0:a8:%02x:%02x" % (flow_id,pair_id,dnet_id,term_id,dst_port,snet_id,term_id,src_port,dnet_id,term_id,snet_id,term_id)
24 flow_id = flow_id + 1
25 pair_id = pair_id + 1