Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
30b6c8a
added getNetwork function to InternetExchange Class
Bruol Apr 2, 2024
b02a184
added link properties to cross connect networks
Bruol Apr 2, 2024
51f392f
added router names to scion link datastructure with backwards compati…
Bruol Apr 2, 2024
39b4c22
added possibility to specify specific routers when configuring scion …
Bruol Apr 2, 2024
2de8796
added latency information from link properties to staticInfoConfig.js…
Bruol Apr 4, 2024
2f4541c
improved link property comments
Bruol Apr 5, 2024
af50114
Add note parameter to ScionAutonomousSystem class
Bruol Apr 5, 2024
ecf52db
Added staticInfoConfig.json provisioning to control service. This inc…
Bruol Apr 5, 2024
384d2b8
fix type annotation
Bruol Apr 5, 2024
9cad8f1
add support for internet exchanges to staticInfoConfig.json provisioning
Bruol Apr 5, 2024
3fe53cc
added Note to Node
Bruol Apr 15, 2024
7095cbf
updated scion example with new way to specify scion routing
Bruol Apr 15, 2024
8c42553
Refactor method setGeo in Node.py to include an optional Address para…
Bruol Apr 15, 2024
496e030
Add Scion link properties and routing configuration example to scion …
Bruol Apr 15, 2024
6c5e81a
Refactor ScionRouting.py to handle missing latency information from l…
Bruol Apr 15, 2024
5a91e67
updated example
Bruol Apr 15, 2024
e9a412a
updated the way staticInfoConfig handles missing link properties
Bruol Apr 16, 2024
c13169a
Add Scion BWtest client service that can be used to run scion bw-test…
Bruol Apr 16, 2024
23c36a9
added example for scion-bwtestclient service
Bruol Apr 16, 2024
d68c445
add feaature flag for generating staticInfoConfig.json
Bruol Apr 18, 2024
365e8e9
fixed bug in generateStaticInfoConfig feature flag
Bruol Apr 18, 2024
797b012
update example to explain how to disable generating the staticInfoCon…
Bruol Apr 18, 2024
7315916
fixed bug in staticConfigInfo generation
Bruol Apr 26, 2024
82604af
changed default behaviour to not generate static info config. As this…
Bruol Apr 26, 2024
7934805
Merge branch 'scion-improvement' into master
wonkr Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/scion/S01-scion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ Inter-AS routing in SCION is based on fixed "links" which are combined during th

The `Scion` layer exposes two methods `addIxLink()` and `addXcLink()` for setting up SCION links over an IX and via direct cross-connect links, respectively. In both methods, we must specify the two endpoints of the link as pairs of ISD and ASN. The order of endpoints matters as SCION transit links are directional (for beaconing purposes, packets are still forwarded in both directions) from `a` to `b`. The reason we must name ASes by ASN and ISD is that only the pair of ISD and ASN uniquely identifies a SCION AS, i.e., a link from (1, 150) to (1, 151) is completely different from a hypothetical link between (2, 150) and (2, 151).

Additionally, there are two optional arguments `a_router` and `b_router`. If there is only one link between a pair of ASN's specifying these is not necessary. But if there are several cross-connects or several routers on the internet exchange, a_router has to be set to the name of the border-router. If you want to see an example of this check out S06-scion-link-properties

Besides the endpoints every SCION link has a type. Currently there are three types:
- `Core` links connect core ASes of the same or different ISDs. The core ASes of every ISD must all be reachable by one another via core links. The BGP analogy to core links is peering between Tier 1 ASes.
- `Transit` links connect core ASes to non-core ASes in the same ISD. They model Internet transit as sold from a provider AS to a customer AS.
Expand Down
39 changes: 39 additions & 0 deletions examples/scion/S06-scion-link-properties/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Scion with link properties

In this example we show how one can specify link properties.

We have three ASes 110,111 and 112. 110 is a core AS and is connected to the other two ASes through a cross connects.

## Setting Cross connect link properties

Setting cross connect link properties works as shown in this exampls:

`as_110_br2.crossConnect(112,'br1','10.3.0.10/29',latency=30,bandwidth=500,packetDrop=0.1,MTU=1100)`


`as110.createNetwork('net0').setDefaultLinkProperties(latency=10, bandwidth=1000, packetDrop=0.1).setMtu(1400)`

Latency, and Bandwidth will be included in the Scion beacons if specified here. If no properties are specified, they will be omitted in the beacons

## Specify border routers for scion routing

If there is more than one link between a pair of ASes one can specify how to set the routes as follows:

`scion.addXcLink((1,110),(1,111),ScLinkType.Transit,a_router='br1',b_router='br1')`
`scion.addXcLink((1,110),(1,111),ScLinkType.Transit,a_router='br2',b_router='br1')`

## Set additional Border Router / AS properties

One can also specify additional information for the Scion-ASes and the border routers. Geolocation, and AS note will also be included in the beacons during the beaconing process

`as110.setNote('This is a core AS')`

`as_110_br1 = as110.createRouter('br1').joinNetwork('net0').setGeo(Lat=37.7749, Long=-122.4194,Address="San Francisco, CA, USA").setNote("This is a border router")`

## Including link properties in beacons

By default, available link properties, Geolocation, Hops and AS-Notes will be included in the `staticInfoConfig.json` file on the control Service nodes. To turn this of one can set the `generateStaticInfoConfig` flag to false as follows:

```python
as110.setGenerateStaticInfoConfig(False)
```
67 changes: 67 additions & 0 deletions examples/scion/S06-scion-link-properties/scion-link-properties.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

from seedemu.compiler import Docker
from seedemu.core import Emulator
from seedemu.layers import ScionBase, ScionRouting, ScionIsd, Scion
from seedemu.layers.Scion import LinkType as ScLinkType

# Initialize
emu = Emulator()
base = ScionBase()
routing = ScionRouting()
scion_isd = ScionIsd()
scion = Scion()

# Create ISDs
base.createIsolationDomain(1)


# Ases

# AS-110
as110 = base.createAutonomousSystem(110)
as110.setNote('This is a core AS')
as110.setGenerateStaticInfoConfig(True) # Generate static info config (This is not neccessary as the default behaviour is to generate static info config)
scion_isd.addIsdAs(1,110,is_core=True)
as110.createNetwork('net0').setDefaultLinkProperties(latency=10, bandwidth=1000, packetDrop=0.1).setMtu(1400)
as110.createControlService('cs_1').joinNetwork('net0')
as_110_br1 = as110.createRouter('br1').joinNetwork('net0').setGeo(Lat=37.7749, Long=-122.4194,Address="San Francisco, CA, USA").setNote("This is a border router")
as_110_br1.crossConnect(111,'br1','10.3.0.2/29',latency=0,bandwidth=0,packetDrop=0,MTU=1280)
as_110_br2 = as110.createRouter('br2').joinNetwork('net0')
as_110_br2.crossConnect(112,'br1','10.3.0.10/29',latency=30,bandwidth=500,packetDrop=0.1,MTU=1100)
as_110_br2.crossConnect(111,'br1','10.3.0.16/29')

# AS-111
as111 = base.createAutonomousSystem(111)
scion_isd.addIsdAs(1,111,is_core=False)
scion_isd.setCertIssuer((1,111),issuer=110)
as111.createNetwork('net0').setDefaultLinkProperties(latency=0, bandwidth=0, packetDrop=0)
as111.createControlService('cs_1').joinNetwork('net0')
as_111_br1 = as111.createRouter('br1').joinNetwork('net0')
as_111_br1.crossConnect(110,'br1','10.3.0.3/29',latency=0,bandwidth=0,packetDrop=0,MTU=1280)
as_111_br1.crossConnect(110,'br2','10.3.0.17/29')

# AS-112
as112 = base.createAutonomousSystem(112)
scion_isd.addIsdAs(1,112,is_core=False)
scion_isd.setCertIssuer((1,112),issuer=110)
as112.createNetwork('net0').setDefaultLinkProperties(latency=0, bandwidth=0, packetDrop=0)
as112.createControlService('cs_1').joinNetwork('net0')
as_112_br1 = as112.createRouter('br1').joinNetwork('net0')
as_112_br1.crossConnect(110,'br2','10.3.0.11/29',latency=30,bandwidth=500,packetDrop=0.1,MTU=1100)


# Inter-AS routing
scion.addXcLink((1,110),(1,111),ScLinkType.Transit,a_router='br1',b_router='br1')
scion.addXcLink((1,110),(1,112),ScLinkType.Transit,a_router='br2',b_router='br1')
scion.addXcLink((1,110),(1,111),ScLinkType.Transit,a_router='br2',b_router='br1')

# Rendering
emu.addLayer(base)
emu.addLayer(routing)
emu.addLayer(scion_isd)
emu.addLayer(scion)

emu.render()

# Compilation
emu.compile(Docker(), './output')
72 changes: 72 additions & 0 deletions examples/scion/S07-scion-bwtest-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SCION Bandwidth Test Client

This example demonstrates how to set up a SCION network for conducting bandwidth tests, using scion-bwtestclient, between Autonomous Systems (ASes) using SeedEmu. It includes configuring ASes, routers, hosts, and bandwidth test services.

## Initializing the bwtestclient Service

First, we initialize the bwtestclient service.

```python
from seedemu.services import ScionBwtestClientService
# other imports

# Create bandwidth test services
bwtest = ScionBwtestService()
bwtestclient = ScionBwtestClientService()
```

## Setting up Bandwidth Test Services

First we create scion-bwtestserver in every AS.

```python
# Bandwidth test server in AS-150
as150.createHost('bwtest').joinNetwork('net0', address='10.150.0.30')
bwtest.install('bwtest150').setPort(40002)
emu.addBinding(Binding('bwtest150', filter=Filter(nodeName='bwtest', asn=150)))

# Bandwidth test server in AS-151
as151.createHost('bwtest').joinNetwork('net0', address='10.151.0.30')
bwtest.install('bwtest151')
emu.addBinding(Binding('bwtest151', filter=Filter(nodeName='bwtest', asn=151)))

# Bandwidth test server in AS-152
as152.createHost('bwtest').joinNetwork('net0', address='10.152.0.30')
bwtest.install('bwtest152')
emu.addBinding(Binding('bwtest152', filter=Filter(nodeName='bwtest', asn=152)))

# Bandwidth test server in AS-153
as153.createHost('bwtestserver').joinNetwork('net0', address='10.153.0.30')
bwtest.install('bwtest153')
emu.addBinding(Binding('bwtest153', filter=Filter(nodeName='bwtestserver', asn=153)))
```

Now we create a scion-bwtestclient in one of the ASes

```python
# Bandwidth test client in AS-153
as153.createHost('bwtestclient').joinNetwork('net0', address='10.153.0.31').addSharedFolder("/var/log", "/absolute/path/to/logs/on/host")
bwtestclient.install('bwtestclient153').setServerAddr('1-151,10.151.0.30').setWaitTime(20)
emu.addBinding(Binding('bwtestclient153', filter=Filter(nodeName='bwtestclient', asn=153)))
```

**Notes:**
- the addSharedFolder("nodePath","hostPath") function makes sure that we can see the bwtestclient output without attaching to the container
- the setServerAddr() function specifies the server address of the bwtestserver
- the setWaitTime() function sets the number of seconds to wait after the container started before running the test. The default is 60 seconds.
- there are also other functions:
- setPort() -- setting the port the server listens on
- setPreference() -- set the preference for sorting paths (check bwtester documentation for more details)
- setCS() -- Client->Server test parameter (default "3,1000,30,80kbps")
- setSC() -- Server->Client test parameter (default "3,1000,30,80kbps")

## Rendering and Compilation

We add the configured layers to the emulator, render the network topology, and compile the configuration into Docker containers.

```python
# Rendering
emu.addLayer(bwtest)
emu.addLayer(bwtestclient)
```

98 changes: 98 additions & 0 deletions examples/scion/S07-scion-bwtest-client/scion-bwtest-client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#!/usr/bin/env python3

from seedemu.compiler import Docker
from seedemu.core import Emulator, Binding, Filter
from seedemu.layers import ScionBase, ScionRouting, ScionIsd, Scion
from seedemu.layers.Scion import LinkType as ScLinkType
from seedemu.services import ScionBwtestService, ScionBwtestClientService

# Initialize
emu = Emulator()
base = ScionBase()
routing = ScionRouting()
scion_isd = ScionIsd()
scion = Scion()
bwtest = ScionBwtestService()
bwtestclient = ScionBwtestClientService()

# SCION ISDs
base.createIsolationDomain(1)

# AS-150
as150 = base.createAutonomousSystem(150)
scion_isd.addIsdAs(1, 150, is_core=True)
as150.createNetwork('net0')
as150.createControlService('cs1').joinNetwork('net0')
as150_router = as150.createRouter('br0').joinNetwork('net0')
as150_router.crossConnect(151, 'br0', '10.50.0.10/29', latency=10, bandwidth=1000000, packetDrop=0.01)
as150_router.crossConnect(152, 'br0', '10.50.0.18/29')
as150_router.crossConnect(153, 'br0', '10.50.0.3/29')

# Create a host running the bandwidth test server
as150.createHost('bwtest').joinNetwork('net0', address='10.150.0.30')
bwtest.install('bwtest150').setPort(40002) # Setting the port is optional (40002 is the default)
emu.addBinding(Binding('bwtest150', filter=Filter(nodeName='bwtest', asn=150)))

# AS-151
as151 = base.createAutonomousSystem(151)
scion_isd.addIsdAs(1, 151, is_core=True)
as151.createNetwork('net0')
as151.createControlService('cs1').joinNetwork('net0')
as151_br0 = as151.createRouter('br0').joinNetwork('net0').addSoftware("iperf3")
as151_br0.crossConnect(150, 'br0', '10.50.0.11/29', latency=10, bandwidth=1000000, packetDrop=0.01)
as151_br0.crossConnect(152, 'br0', '10.50.0.26/29')

as151.createHost('bwtest').joinNetwork('net0', address='10.151.0.30')
bwtest.install('bwtest151')
emu.addBinding(Binding('bwtest151', filter=Filter(nodeName='bwtest', asn=151)))

# AS-152
as152 = base.createAutonomousSystem(152)
scion_isd.addIsdAs(1, 152, is_core=True)
as152.createNetwork('net0')
as152.createControlService('cs1').joinNetwork('net0')
as152_br0 = as152.createRouter('br0').joinNetwork('net0')
as152_br0.crossConnect(150, 'br0', '10.50.0.19/29')
as152_br0.crossConnect(151, 'br0', '10.50.0.27/29')

as152.createHost('bwtest').joinNetwork('net0', address='10.152.0.30')
bwtest.install('bwtest152')
emu.addBinding(Binding('bwtest152', filter=Filter(nodeName='bwtest', asn=152)))

# AS-153
as153 = base.createAutonomousSystem(153)
scion_isd.addIsdAs(1, 153, is_core=False)
scion_isd.setCertIssuer((1, 153), issuer=150)
as153.createNetwork('net0')
as153.createControlService('cs1').joinNetwork('net0')
as153_router = as153.createRouter('br0')
as153_router.joinNetwork('net0')
as153_router.crossConnect(150, 'br0', '10.50.0.4/29')

as153.createHost('bwtestserver').joinNetwork('net0', address='10.153.0.30')
bwtest.install('bwtest153')
emu.addBinding(Binding('bwtest153', filter=Filter(nodeName='bwtestserver', asn=153)))

# AS-153 bwtestclient
as153.createHost('bwtestclient').joinNetwork('net0', address='10.153.0.31').addSharedFolder("/var/log", "/absolute/path/to/logs/on/host") # make logs of bwtestclient available on host
bwtestclient.install('bwtestclient153').setServerAddr('1-151,10.151.0.30').setWaitTime(20) # set the server address and time to wait before starting the test
emu.addBinding(Binding('bwtestclient153', filter=Filter(nodeName='bwtestclient', asn=153)))

# Inter-AS routing
scion.addXcLink((1, 150), (1, 151), ScLinkType.Core)
scion.addXcLink((1, 150), (1, 152), ScLinkType.Core)
scion.addXcLink((1, 151), (1, 152), ScLinkType.Core)
scion.addXcLink((1, 150), (1, 153), ScLinkType.Transit)

# Rendering
emu.addLayer(base)
emu.addLayer(routing)
emu.addLayer(scion_isd)
emu.addLayer(scion)
emu.addLayer(bwtest)
emu.addLayer(bwtestclient)

emu.render()

# Compilation
emu.compile(Docker(internetMapEnabled=True), './output')
9 changes: 9 additions & 0 deletions seedemu/core/InternetExchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def getRouteServerNode(self) -> Node:
@returns RS node.
"""
return self.__rs

def getNetwork(self) -> Network:
"""!
@brief Get the network of Internet Exchange.

@returns Network.
"""

return self.__net

def print(self, indent: int) -> str:
out = ' ' * indent
Expand Down
2 changes: 1 addition & 1 deletion seedemu/core/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def setType(self, newType: NetworkType) -> Network:

return self

def getDefaultLinkProperties(self) -> Tuple[int, int, int]:
def getDefaultLinkProperties(self) -> Tuple[int, int, float]:
"""!
@brief Get default link properties.

Expand Down
Loading