Updated protocol.py to current gateway protocol.