Month: April 2016

TUTORIAL: Command Line Interfaces

Some of you writing servers are only now realizing how limited your use of normal stdin API’s are when working with Twisted. This tutorial shows you how to use Twisted’s command line receiver as well as my more advanced command line interface module. Twisted’s LineReceiver You generally can’t use blocking reads in Twisted and most of the stdin tools you’re used to are, in fact, blocking. For example, “rawinput()” doesn’t…

TUTORIAL: Interception

As promised, here’s the “downlow” on address interception. As a reminder, the chaperone is already configured to support this. Here’s a quick overview of the architecture. In this diagram, a node with address 20161.X.Y.Z. (hereafter X.Y.Z) sends a message to 20161.A.B.C (hereafter A.B.C). The Interceptor has already succeeded at the challenge and arranged to intercept all messages to A.B.C (either destined for, or coming from). Accordingly the message to A.B.C…

TUTORIAL: PyPy Sandboxing, and MobileCode Execution

Setting Up PyPy Thankfully, this is much easier this year. It should only require two simple steps: apt-get install pypy apt-get install python-pypy.sandbox ln -s /usr/lib/python2.7/dist-packages/pypy/ /usr/lib/pypy/dist-packages/ On the class VM’s, this is all you’ll have to do. However, if you’re running this on your own local machine, you may need additional steps. The versions of pypy and python-pypy.sandbox on the virtual machines are both 2.2.1. On my personal virtual…

Crypto Tutorial

This tutorial walks you through some basic crypto operations that you’ll need for the secure layer. For most of this, I’ll be suing the Python Cryptography Toolkit (PyCrypto). This module is imported as “Crypto”, although you usually import one or more submodules. Please make sure you have the right package installed. There are other packages named “crypto” that are not the right one. I’ll also be using a few Playground specific…

TUTORIAL: Stacking up Stacking Protocols

Some individuals have been asking about how to setup the “secure_stream” connection type. Some speculated that you should somehow plug it into “reliable_stream”. That is not accurate. The truth is, “secure_stream”, from the perspective of Playground, is an independent connection type. The stacking is done in the factories. For example, suppose you’ve created a new SecureStreamServer and SecureStreamClient classes in module a.b (both are StackingFactory instances that produce SecureStreamProtocol instances)….

Lab2 Grading [UPDATED 4/6/2016]

The Corporation for Human Understanding of Machine Problems (CHUMP) is interesting in buying PTCL implementations for further research and analysis. They will buy any PTCL implementation that at least performs the PTCL handshake according to the following schedule: +1000BP for a protocol that handshakes +2000 BP for a protocol that sends data and ACK’s it (re-transmission not required) +4000 BP for a protocol that retransmits data lost or corrupted (under minimal…

Bake-Off Results

The submissions were evaluated on three categories: throughput, traffic efficiency, and lines of code. The final rankings (at the bottom) are calculated from scores assigned to each sub-ranking. The “Throughput” category awards 30, 20, and 10 points for first, second, and third place. The “Traffic Efficiency” category awards 15, 10, and 5 points for first, second, and third place. Any ties are broken by the rankings in the source-code category….