Skip to content

Commit 8a0d048

Browse files
authored
Bump scion and rains dependencies (#171)
1 parent b082b9e commit 8a0d048

File tree

21 files changed

+934
-213
lines changed

21 files changed

+934
-213
lines changed

.circleci/config.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/golang:1.13
5+
- image: circleci/golang:1.14
66

77
steps:
88
- run:
@@ -31,9 +31,9 @@ jobs:
3131
- "/go/pkg"
3232

3333
integration:
34-
docker:
35-
- image: circleci/golang:1.13-stretch
36-
resource_class: medium
34+
machine:
35+
image: ubuntu-1604:202007-01
36+
3737
steps:
3838
- checkout
3939
# The following step are shared with netsec-ethz/rains
@@ -57,41 +57,39 @@ jobs:
5757
- run:
5858
name: Build SCION services and install python3 dependencies
5959
command: |
60+
# Log tool versions provided by CircleCi
61+
go version
62+
python3 --version
63+
6064
cd ~/scion
61-
for service in "border" "cs" "godispatcher" "sciond" "tools/scion-pki"; do
65+
for service in "posix-router" "cs" "dispatcher" "scion-pki" "sciond"; do
6266
go build -o ./bin/ ./go/${service}/ && echo "Built ${service}";
6367
done
6468
65-
sudo apt-get update && sudo apt-get install --assume-yes python3 python3-pip
6669
pip3 install -U wheel setuptools
6770
pip3 install -r ~/scion/env/pip3/requirements.txt
6871
- run:
6972
name: Configure and start local SCION AS
7073
command: |
71-
export PYTHONPATH=~/scion/python/
7274
cd ~/scion
75+
export PYTHONPATH=python/:.
7376
74-
# Generate Tiny.topo
77+
# Generate tiny4.topo
7578
printf '#!/bin/bash\necho "0.0.0.0"' > tools/docker-ip # Some hackery to make topo scripts run
7679
# Use IPv4 addresses for this test
77-
python/topology/generator.py -c ./topology/Tiny4.topo
80+
python3 python/topology/generator.py -c ./topology/tiny4.topo
7881
# Link the gen directory containing sciond_addresses.json and as_list.json
7982
ln -s ~/scion/gen /home/circleci/project/gen
80-
# Generate gen-certs
81-
mkdir gen-certs gen-cache
82-
openssl genrsa -out "gen-certs/tls.key" 2048
83-
openssl req -new -x509 -key "gen-certs/tls.key" -out "gen-certs/tls.pem" -days 3650 -subj /CN=scion_def_srv
83+
mkdir gen-cache
8484
85-
sudo mkdir /run/shm -m 777
86-
87-
# Start all AS Tiny.topo
85+
# Start all AS tiny4.topo
8886
supervisor/supervisor.sh reload
8987
supervisor/supervisor.sh start all
9088
- run:
9189
name: Prepare integration test
9290
command: |
9391
# Handle the two special ones
94-
make setup_lint
92+
make setup_lint
9593
sudo apt-get update && sudo apt-get install -y libpam0g-dev
9694
- run:
9795
name: Integration tests

Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ BIN = bin
66
# environment as returned by go env, and uses the "Default Values" parameter
77
# expansion ${variable:-default} to implement the fallback sequence:
88
# $GOBIN, else $GOPATH/bin, else $HOME/go/bin
9-
DESTDIR = $(shell set -a; eval $$( go env ); echo $${GOBIN:-$${GOPATH:-$${HOME}/go}/bin})
9+
# If there are multiple entries in GOPATH, take the first.
10+
DESTDIR = $(shell set -a; eval $$( go env ); gopath=$${GOPATH%:*}; echo $${GOBIN:-$${gopath:-$${HOME}/go}/bin})
1011

1112
# HINT: build with TAGS=norains to build without rains support
1213
TAGS =
@@ -31,7 +32,7 @@ test: lint
3132

3233
setup_lint:
3334
@# Install golangci-lint (as dumb as this looks, this is the recommended way to install)
34-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $$(go env GOPATH)/bin v1.26.0
35+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ${DESTDIR} v1.31.0
3536

3637
lint:
3738
@type golangci-lint > /dev/null || ( echo "golangci-lint not found. Install it manually or by running 'make setup_lint'."; exit 1 )

README.md

+40-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sudo apt install scion-apps-*
1717

1818
### Build:
1919

20-
1. Install go 1.13
20+
1. Install go 1.14
2121

2222
See e.g. https://github.com/golang/go/wiki/Ubuntu
2323

@@ -28,7 +28,7 @@ sudo apt install scion-apps-*
2828
```shell
2929
sudo apt-get install -y libpam0g-dev
3030
```
31-
31+
3232
1. Clone this repository
3333

3434
```shell
@@ -41,7 +41,7 @@ sudo apt install scion-apps-*
4141
```shell
4242
make setup_lint
4343
```
44-
44+
4545
1. Run `make` to build all projects (and run linters). Run `make -j` to use multiple jobs to build.
4646

4747
1. Run `make test` to run the linters and unit tests.
@@ -56,6 +56,7 @@ SCION dispatcher and SCION daemon.
5656
Please refer to the [SCIONLab tutorials](https://docs.scionlab.org) to get
5757
started.
5858

59+
5960
#### Environment
6061

6162
The dispatcher and sciond sockets are assumed to be at default locations, but
@@ -70,7 +71,7 @@ When running multiple local ASes, e.g. during development, the address of the
7071
sciond corresponding to the desired AS needs to be specified in the
7172
`SCION_DAEMON_ADDRESS` environment variable.
7273
In this case, the different sciond addresses can be found in their
73-
corresponding `sd.toml` configuration files in the `gen/ISDx/ASy/endhost`
74+
corresponding `sd.toml` configuration files in the `gen/ASx`
7475
directory, or summarized in the file `gen/sciond_addresses.json`.
7576

7677

@@ -90,38 +91,65 @@ This configuration file needs to contain the SCION address of the RAINS
9091
resolver, in the form `<ISD>-<AS>,[<IP>]`.
9192

9293

94+
## _examples
95+
96+
The directory _examples contains a minimal "hello, world" application using SCION that sends one packet from a client to a server. The directory also contains small example programs that show how HTTP can be used over SCION/QUIC for servers, proxies, and clients.
97+
98+
More documentation is available in the [helloworld README](_examples/helloworld/README.md) and in the [shttp README](_examples/shttp/README.md).
99+
100+
93101
## bat
94102

95-
bat is a cURL-like tool for testing, debugging, and generally interacting with HTTP servers over SCION/QUIC. Documentation of the code is available in the [README.md](bat/README.md).
103+
bat is a cURL-like tool for testing, debugging, and generally interacting with HTTP servers over SCION/QUIC. Documentation of the code is available in the [bat README](bat/README.md).
96104

97105
Installation and usage information is available on the [SCION Tutorials web page for bat](https://docs.scionlab.org/content/apps/bat.html).
98106

99107

108+
## bwtester
109+
110+
The bandwidth testing application bwtester enables a variety of bandwidth tests on the SCION network. Documentation of the code and protocol are described in the [bwtester README](bwtester/README.md).
111+
112+
Installation and usage information is available on the [SCION Tutorials web page for bwtester](https://docs.scionlab.org/content/apps/bwtester.html).
113+
114+
100115
## camerapp
101116

102-
Camerapp contains image fetcher and server applications, using the SCION network. Documentation of the code is available in the [README.md](https://github.com/netsec-ethz/scion-apps/blob/master/camerapp/README.md).
117+
Camerapp contains image fetcher and server applications, using the SCION network. Documentation of the code is available in the [camerapp README](camerapp/README.md).
103118

104119
Installation and usage information is available on the [SCION Tutorials web page for camerapp](https://docs.scionlab.org/content/apps/access_camera.html).
105120

106121

122+
## netcat
123+
124+
netcat contains a SCION port of the netcat application. See the [netcat README](netcat/README.md) for more information.
125+
126+
127+
## pkg
128+
129+
Pkg contains underlaying library code for scion-apps.
130+
131+
- appnet: simplified and functionally extended wrapper interfaces for the SCION core libraries
132+
- appquic: a simple interface to use QUIC over SCION
133+
- shttp: a client/server implementation of HTTP/3 over SCION/QUIC
134+
- integration: a simple framework to support intergration testing for the demo applications in this repository
135+
136+
107137
## sensorapp
108138

109139
Sensorapp contains fetcher and server applications for sensor readings, using the SCION network.
110140

111141
Installation and usage information is available on the [SCION Tutorials web page for sensorapp](https://docs.scionlab.org/content/apps/fetch_sensor_readings.html).
112142

113143

114-
## bwtester
144+
## ssh
115145

116-
The bandwidth testing application `bwtester` enables a variety of bandwidth tests on the SCION network.
146+
Directory ssh contains a SSH client and server running over SCION network.
117147

118-
Documentation of the code and protocol are described in the [bwtester README](bwtester/README.md).
119-
120-
Installation and usage information is available on the [SCION Tutorials web page for bwtester](https://docs.scionlab.org/content/apps/bwtester.html).
148+
More documentation is available in the [ssh README](ssh/README.md).
121149

122150

123151
## webapp
124152

125153
Webapp is a Go application that will serve up a static web portal to make it easy to experiment with SCIONLab test apps on a virtual machine.
126154

127-
Installation and usage information is available on the [SCION Tutorials web page for webapp](https://docs.scionlab.org/content/apps/as_visualization/webapp.html).
155+
Installation and usage information is available on the [SCION Tutorials web page for webapp](https://docs.scionlab.org/content/apps/as_visualization/webapp.html) and in the [webapp README](webapp/README.md).

_examples/helloworld/README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ Client:
1212
go run helloworld.go -remote 17-ffaa:1:a,[127.0.0.1]:1234
1313
```
1414

15-
Replace `17-ffaa:1:a` with your local AS address printed by the server.
15+
Replace `17-ffaa:1:a` with the address of the AS in which the server is running.
1616

1717
## Walkthrough:
1818

1919
This SCION application is very simple, and it demonstrates what is needed to send data using SCION:
2020

21-
1. Parse addresses from string to binary structures.
22-
2. Initialize the SCION library.
23-
3. Obtain a path manager.
24-
4. Obtain paths from source to destination.
25-
5. Obtain a connection using one of these paths.
26-
6. Use that connection to send the data.
21+
1. Validate command-line arguments.
2722

28-
You can find these items in the comments of the code.
23+
Server:
24+
2. Open listener connection (appnet.ListenPort).
25+
3. Read packets from connection.
26+
4. Close listener connection.
27+
28+
Client:
29+
2. Open client connection (appnet.Dial).
30+
3. Write packet to connection.
31+
4. Close client connection.

_examples/shttp/README.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Examples for HTTP over SCION/QUIC
2+
3+
This directory contains small example programs that show how HTTP can be used over SCION/QUIC for servers, proxies, and clients:
4+
5+
- fileserver: a server that serves the files from its working directory
6+
- proxy: a proxy server that can translate between HTTP and HTTP-over-SCION
7+
- server: a server with friendly greetings and other examples
8+
- client: a client that talks to the example server
9+
10+
See also the package [shttp](../../pkg/shttp/README.md) for the underlaying library code.
11+
12+
## Build:
13+
14+
Clone the repository netsec-ethz/scion-apps and build the eaxample applications:
15+
16+
```
17+
git clone https://github.com/netsec-ethz/scion-apps.git
18+
cd scion-apps
19+
make example-shttp-fileserver \
20+
example-shttp-proxy \
21+
example-shttp-server \
22+
example-shttp-client
23+
```
24+
25+
## Running:
26+
27+
All examples require a running SCION endhost stack, i.e. a running SCION dispatcher and SCION daemon. Please refer to '[Running](../../README.md#Running)' in this repository's main README and the [SCIONLab tutorials](https://docs.scionlab.org) to get started.
28+
29+
### Generic file server example
30+
31+
Run `example-shttp-fileserver`:
32+
33+
```
34+
bin/example-shttp-fileserver
35+
```
36+
37+
See '[Environment](../../README.md#Environment)' on how to set the dispatcher and sciond environment variables in the server's AS.
38+
39+
Build `scion-bat` as a client for `example-shttp-fileserver`:
40+
41+
```
42+
make scion-bat
43+
```
44+
45+
See also the application '[bat](../../bat/README.md)' for more details on the cURL-like CLI tool `scion-bat`.
46+
47+
Access `example-shttp-fileserver` with `scion-bat`:
48+
49+
```
50+
bin/scion-bat 17-ffaa:1:a,[127.0.0.1]:443/
51+
```
52+
53+
Replace '17-ffaa:1:a' with your server's ISD and AS numbers and see '[Environment](../../README.md#Environment)' on how to set the dispatcher and sciond environment variables in the client's (or proxy's) AS.
54+
55+
Run `example-shttp-proxy` to provide `example-shttp-fileserver` functionality via HTTP:
56+
57+
```
58+
bin/example-shttp-proxy --remote=17-ffaa:1:a,[127.0.0.1]:443 --local=0.0.0.0:8080
59+
```
60+
61+
Access `example-shttp-fileserver` via HTTP with `cURL`:
62+
63+
```
64+
curl -v http://127.0.0.1:8080/
65+
```
66+
67+
(Or navigate to http://127.0.0.1:8080/ in a web browser.)
68+
69+
`example-shttp-proxy` can also be used as a proxy from SCION to HTTP, from SCION to SCION, and from HTTP to HTTP. See package [shttp](../../pkg/shttp/README.md) for more details.
70+
71+
### Simple shttp-based server example
72+
73+
Open a shell in the root of the scion-apps repository and run `example-shttp-server`:
74+
75+
```
76+
cd _examples/shttp/server
77+
go run .
78+
```
79+
80+
Open a new shell in the scion-apps repository and access `example-shttp-server` with `scion-bat`:
81+
82+
```
83+
bin/scion-bat 17-ffaa:1:a,[127.0.0.1]:443/hello
84+
```
85+
86+
or
87+
88+
```
89+
bin/scion-bat 17-ffaa:1:a,[127.0.0.1]:443/json
90+
```
91+
92+
or
93+
94+
```
95+
bin/scion-bat -f 17-ffaa:1:a,[127.0.0.1]:443/form foo=bar
96+
```
97+
98+
Run the custom `example-shttp-client` for `example-shttp-server`:
99+
100+
```
101+
bin/example-shttp-client -s 17-ffaa:1:a,[127.0.0.1]:443
102+
```
103+
104+
Run `example-shttp-proxy` to provide `bin/example-shttp-server` functionality via HTTP:
105+
106+
```
107+
bin/example-shttp-proxy --remote=17-ffaa:1:a,[127.0.0.1]:443 --local=0.0.0.0:8080
108+
```
109+
110+
Access `example-shttp-server` via HTTP with `cURL`:
111+
112+
```
113+
curl http://127.0.0.1:8080/hello
114+
```
115+
116+
or
117+
118+
```
119+
curl http://127.0.0.1:8080/json
120+
```
121+
122+
or
123+
124+
```
125+
curl -d foo=bar http://127.0.0.1:8080/form
126+
```
127+
128+
And, finally, to see the cute dog picture:
129+
130+
Navigate to http://127.0.0.1:8080/image in a web browser.

bwtester/bwtestclient/bwtestclient.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func main() {
332332

333333
// update default packet size to max MTU on the selected path
334334
if path != nil {
335-
InferedPktSize = int64(path.MTU())
335+
InferedPktSize = int64(path.Metadata().MTU)
336336
} else {
337337
// use default packet size when within same AS and pathEntry is not set
338338
InferedPktSize = DefaultPktSize

0 commit comments

Comments
 (0)