Update and rename MantenerFIFO to MantenerFIFO.md
[vsorcdistro/.git] / scripts / basicflow.sh
1 #!/bin/bash
2 : '
3 Written by: Felix G. Tejada
4
5 This script is applied to a linear 3 topo, just for show the example
6 '
7 curl -X DELETE http://localhost:8080/stats/flowentry/clear/1
8 curl -X DELETE http://localhost:8080/stats/flowentry/clear/2
9 echo "adding new flows entry to switches 1 and 2"
10 curl -X POST -d '{
11     "dpid": 1,
12     "cookie": 0,
13     "cookie_mask": 0,
14     "table_id": 0,
15     "idle_timeout": 0,
16     "hard_timeout": 0,
17     "priority": 100,
18     "flags": 0,
19     "match":{
20         "in_port":1
21     },
22     "actions":[
23         {
24             "type":"OUTPUT",
25             "port": 2
26         }
27     ]
28  }' http://localhost:8080/stats/flowentry/add
29 sleep 1
30 curl -X POST -d '{
31     "dpid": 1,
32     "cookie": 0,
33     "cookie_mask": 0,
34     "table_id": 0,
35     "idle_timeout": 0,
36     "hard_timeout": 0,
37     "priority": 101,
38     "flags": 0,
39     "match":{
40         "in_port":2
41     },
42     "actions":[
43         {
44             "type":"OUTPUT",
45             "port": 1
46         }
47     ]
48  }' http://localhost:8080/stats/flowentry/add
49 sleep 1
50 curl -X POST -d '{
51     "dpid": 2,
52     "cookie": 0,
53     "cookie_mask": 0,
54     "table_id": 0,
55     "idle_timeout": 0,
56     "hard_timeout": 0,
57     "priority": 200,
58     "flags": 0,
59     "match":{
60         "in_port":1
61     },
62     "actions":[
63         {
64             "type":"OUTPUT",
65             "port": 2
66         }
67     ]
68  }' http://localhost:8080/stats/flowentry/add
69 sleep 1
70 curl -X POST -d '{
71     "dpid": 2,
72     "cookie": 0,
73     "cookie_mask": 0,
74     "table_id": 0,
75     "idle_timeout": 0,
76     "hard_timeout": 0,
77     "priority": 201,
78     "flags": 0,
79     "match":{
80         "in_port":2
81     },
82     "actions":[
83         {
84             "type":"OUTPUT",
85             "port": 1
86         }
87     ]
88  }' http://localhost:8080/stats/flowentry/add
89
90 echo "Connectivity from h1 to h2"
91 echo "Done"
92