[SCION] Introductions and a question about SCION python libraries

Frei Matthias matthias.frei at inf.ethz.ch
Sun Jan 24 22:21:51 CET 2021

Hi Chris,

thanks for getting in touch and welcome to the SCION list!

The current implementation of the SCION infrastructure and the "end host stack" with libraries for applications is all written in Go. The sample python code that you saw in the talk slides was based on a python wrapper which had been developed for a programming contest at a student event. As far as I'm aware, this python wrapper has not been maintained since. It had also not been designed for "proper" applications as it only exposed the bear minimum to write "bots" to participate in the game contest.

That being said, there is nothing fundamentally in the way of having either python bindings or a pure python library for SCION applications. If you're interested in working on this, that would seem like a worthy project :-)

Now, how would a connection from your device to a server over SCION look like; one option, which is interesting in the near future as it requires neither your device nor the server to be SCION-aware, is the SCION-IP-gateway (SIG). This is a service, operated e.g. by internet service providers (ISPs), that transparently tunnels your "legacy" IP traffic through SCION. Here, choosing the path is up to the SIGs at the two ends of the tunnel. The SIG's path choice can be configured with a policy that can allow or disallow certain paths or define a preference (see https://scion.docs.anapaya.net/en/latest/PathPolicy.html); conceivably an ISP could offer a "green" plan to its clients and implement this carbon intensity optimization in the SIG's path choice.

The other option are "native" SCION devices and applications. Here, please note that our sample applications in scion-apps are mostly just demos to run _something_ using SCION, but they offer only primitive and direct selection of paths and I really think that this not very representative of how using SCION will eventually look like on your device or in your browser.

I think that once the applications become sufficiently serious, the path choice will be configured using a similar path policy configuration as  mentioned for the SIG above. So for your example of python requests or httpx, I believe that the only significant change to their APIs would be to allow specifying such a policy in some form. This could be something as a simple as preference of high level attributes such as latency, bandwidth or carbon intensity, or a textual description of the policy in some domain specific language like the path policy for the SIG, or a path-ranking python callback function.

What would be a good API for these path policies, and also which policy a server should use for its replies, are both topics that still require some research and experimentation.

Best regards,


From: SCION <scion-bounces at lists.inf.ethz.ch> on behalf of Chris Adams <chris at thegreenwebfoundation.org>
Sent: Sunday, 24 January 2021 5:46:41 PM
To: scion at lists.inf.ethz.ch
Subject: [SCION] Introductions and a question about SCION python libraries

Hi there,

I found out about SCION last week after being introduced to Adrian Perrig and Claude Hahni, and while it’s taking me a while to understand the differences to the regular old internet, I’m finding it fascinating. I work as part of the Green Web Foundation, and my interests with SCION are largely down to the ability to choose multiple paths for requests, and figuring out the carbon intensity of sending data along each hop, to allow clients like browsers and so on to take this into account when sending requests over the internet.

If this is the place to talk about that, I’d be happy to.

But first of all, I think I need some help with a question about the recorded talk at the link below that I saw on the FOSDEM YouTube channel, called SCION Future internet that you can use today:

https://www.youtube.com/watch?v=TtfXrLmOgqY <https://www.youtube.com/watch?v=TtfXrLmOgqY>

Around the 8:30 mark, you can see some python pseudo code, showing how you might import a scion module in python, initialise it, get a series of possible routes, then choose a route to send data along to the host you’re intending to connect to. I’ve written the code into gist,  to avoid this email getting too messy.

https://gist.github.com/mrchrisadams/498411fe39802a800f828b91afd7506d <https://gist.github.com/mrchrisadams/498411fe39802a800f828b91afd7506d>

Sample code for sending requests to a host

Where would I find some more sample python code like this? I’m trying to figure out what connecting my personal laptop, phone or server to a destination over SCION would look like, and in particular, I’m trying to understand how it would look compared to using a common HTTP client in python like requests <https://2.python-requests.org/en/master/> or httpx <https://www.python-httpx.org/>.

I’m aware of the scion apps repo and bat, the CURL like tool written in go, listed at the link below:

https://github.com/netsec-ethz/scion-apps/ <https://github.com/netsec-ethz/scion-apps/>

Where should I be looking to start experimenting with SCION if my main programming language is python?

I’ve had a look on GitHub search, for code like the kind I saw in the FOSDEM slides without much luck, and well… the talk did say get in touch :)



SCION mailing list
SCION at lists.inf.ethz.ch

More information about the SCION mailing list