Skip to content

Commit

Permalink
update simple example
Browse files Browse the repository at this point in the history
  • Loading branch information
ahassany committed Oct 24, 2017
1 parent bbfa52a commit 8f2a60e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,48 @@ SyNET is invoked using the following command


### Example
```bash
TOPO=gridrand4; REQ=5; PROT=bgp; time ./synet.py -i examples/CAV-experiments/$TOPO-$PROT-$REQ.logic -r examples/CAV-experiments/$TOPO-$PROT-$REQ-req.logic -m $PROT
```

A simple example is provided at `examples/simple.logic` of a topology with 3 nodes connected in a triangle shape.
In this example, external BGP traffic is learned via `R2`.
A sample requirement over this topology, is to forward the traffic going externally via the path `R1-R3-R2`.
The requirements are provided in `examples/simple-req.logic`.

To synthesize the configrations for this example, SyNET can be invoked as follow:

```bash
TOPO=AttMpls; REQ=1; PROT=bgp; time ./synet.py -i examples/topozoo/$TOPO-$PROT-$REQ.logic -r examples/topozoo/$TOPO-$PROT-$REQ-req.logic -m $PROT
./synet.py -i examples/simple.logic -r examples/simple-req.logic -m bgp
```

The argument `-i` specifies the input topology. The topology is represented as a set of Datalog predicates.
For instance. `+SetNode("R1"").` adds a router `R1` to the topology, while `+SetLink("R1_I1", "R2_I1").`
specifics that there is a link between the two interfaces `R1_I1` and `R2_I1`.


The argument `-r` specifices the requirements to be implemented on the given topology.
The requirement uses the same syntax as the topology file.

The argument `-m` specifices which protocols to use: `static` will only use static routes,
`ospf` will used static and OSPF routes, and `bgp` will use static, OSPF and BGP routes.




### Provided Examples:
We provide two sets of examples. The first set, in `examples/CAV-experiments`, is a set of synthesized grid topologies
in addition to Internet2 topology. This set were used in evaluating SyNET for CAV'17 paper.

You can run these examples via:

```bash
TOPO=gridrand4; REQ=5; PROT=bgp; time ./synet.py -i examples/CAV-experiments/$TOPO-$PROT-$REQ.logic -r examples/CAV-experiments/$TOPO-$PROT-$REQ-req.logic -m $PROT
```


The second set, are more realistic examples take from [The Internet Topology Zoo](http://www.topology-zoo.org/) and located
at `examples/topozoo`.

You can run these examples via:

```bash
TOPO=AttMpls; REQ=1; PROT=bgp; time ./synet.py -i examples/topozoo/$TOPO-$PROT-$REQ.logic -r examples/topozoo/$TOPO-$PROT-$REQ-req.logic -m $PROT
```
4 changes: 2 additions & 2 deletions examples/simple-req.logic
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+Fwd("R2_N1", "R1", "R3", "ospf").
+Fwd("R2_N1", "R3", "R2", "ospf").

+Fwd("Google", "R1", "R3", "bgp").
+Fwd("Google", "R3", "R2", "bgp").
+Fwd("ExtTraffic", "R1", "R3", "bgp").
+Fwd("ExtTraffic", "R3", "R2", "bgp").
2 changes: 1 addition & 1 deletion examples/simple.logic
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@


+SetNetwork("R2", "R2_N1").
+SetBGPAnnouncement("R2", "R2_N1", "Google", "1;2;3", 3).
+SetBGPAnnouncement("R2", "R2_N1", "ExtTraffic", "1;2;3", 3).

0 comments on commit 8f2a60e

Please sign in to comment.