The OUCH Project - OUCH Server/Client

Related tags

Networkingtheouchteam
Overview

The OUCH Project - OUCH Server/Client

Description

This software simulates OUCH Server/Client communication through a script which initialises a central server and another script which simulates clients connecting to the server. Multiple connections can be handled and supported at once. Additionally there is a prototype web interface where orders can be inputted using an HTML form.

See future considerations for optimisation and features below.

Dependencies

Before running the server and client, the following dependencies are required:

  • tabulate

If running the web interface, additional dependencies are required:

  • flask
  • flask_bootstrap
  • flask_wtf

These dependencies can be installed with pip or another package manager.

pip install tabulate

pip install flask
pip install flask_bootstrap
pip install flask_wtf

Usage

The config.ini file contains items which will be read by the ouch_server and ouch_client as the host and port used to establish a connection. The port which the application listens on can be changed by the user if a different listening address or port is desired.

Start an instance of ouch_server.py first using python. If debug is passed as a command line argument, the console output will be in debugging mode as opposed to printing the orderbook once every second.

python ouch_server.py
python ouch_server.py debug

Then in another terminal/cmd instance, start an instance of ouch_client.py. The client will prompt the user for input and pass completed input into the exchange server (NOT IMPLEMENTED YET - USE PROVIDED TEST INPUTS).

python ouch_client.py

The Client can be initialised with one optional command line argument which specifies a path to a json file containing a sequence of inputs for the client to send to the exchange. Every time the enter key is pressed, one message will be sent in sequence. After all messages have been sent, the client will terminate and disconnect from the server. An example of the json format can be found in the client_inputs folder.

python ouch_client.py test_inputs/client_1.json

Optimisation and Future Extensions

  • Implement a matching engine for the exchange to support order execution.
  • Create a web interface for ease of placing orders.
  • A mechanism for opening and closing the exchange.
  • Orderbook data structure optimisation using numpy or caching (such as using the memcached package).
  • Increase client connection thread handling performance using thread pools and connection pools.
  • Client message data processing can be made faster by setting up and integrating an Apache Pulsar cluster.

Client Input JSON Format

The JSON should be structured as follows:

{
    "_expected_behaviour": [
        "1. ...",
        "2. ...",
        "3. ...",
        ...
    ],
    "actions": [
        {
            "message_type": "O",
            ...
        },
        {
            "message_type": "U",
            ...
        },
        {
            "message_type": "X",
            ...
        },
        ...
    ]
}
  • _expected_behaviour: A list of comment strings describing the expected behaviour of the program for each corresponding action. 1.corresponds to the first action etc. This will not be used in the program, and is for documentation purposes only.
  • actions: A list of json dictionaries which follow the OUCH protocol's Section 6 (Inbound) specifications. The messages will be sent by the client to the exchange in sequence.

Web Interface Usage

This interface allows for easier data entry and provides a GUI that more accurately simulates how a typical client will enter order entries.

python web_application.py

On web browser, type http://127.0.0.1:5000/ to load website.

On a separate terminal/cmd instance start an instance of ouch_server.py. Sudo may be needed.

python ouch_server.py

To create your orders, continually fill in the enter order, replace order and cancel order forms. Once finished, click on the OUCH logo and click submit your order. Continually press enter on command line and observe appropriate response messages on both terminal consoles

Owner
Jahin Z.
Jahin Z.
Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.

🚀 IPpy Parallel testing of IP addresses and domains in python. Reads IP addresses and domains from a CSV file and gives two lists of accessible and i

Shivam Mathur 54 May 21, 2022
A repository to spoof ARP table of any devices and successfully establish Man in the Middle(MITM) attack using Python3 in Linux

arp_spoofer A repository to spoof ARP table of any devices and successfully establish Man in the Middle(MITM) attack using Python3 in Linux Usage: git

Surya Das N 1 Oct 30, 2021
Mass Reverse IP Dibuat Dengan Python 3 Dan Ada Fitur Filter.

Reverse IP Tools Description. Reverse IP is a method to map an IP address to a sub domain. This tool is made in the python 3 programming language. Fea

Wan Naz ID 6 Oct 24, 2022
Start a simple TCP Listener on a specified IP Address and Port Number and receive incoming connections.

About Start a simple TCP Listener on a specified IP Address and Port Number and receive incoming connections. Download Clone using git in terminal(git

AgentGeneric 5 Feb 24, 2022
AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

AV Evasion, a Red Team Tool - Fiber, APC, PNG and UUID

9 Mar 07, 2022
A database-based CDN node supporting PostgreSQL and MongoDB backends.

A simple to use database-based deployable CDN node for hobbyist developers who wish to have their own CDN!

Vish M 10 Nov 19, 2022
ExtDNS synchronizes labeled records in docker-compose with DNS providers.

ExtDNS for docker-compose ExtDNS synchronizes labeled records in docker-compose with DNS providers. Inspired by External DNS, ExtDNS makes resources d

DNTSK 6 Dec 24, 2022
A simple Tor switcher script switches tor nodes in interval of time

Tor_Switcher A simple Tor switcher script switches tor nodes in interval of time This script will switch tor nodes in every interval of time that you

d4rk sh4d0w 2 Nov 15, 2021
pfSense integration with Home Assistant

hass-pfsense Join pfSense with home-assistant! hass-pfsense uses the built-in xmlrpc service of pfSense for all interactions. No special plugins or so

Travis Glenn Hansen 105 Dec 24, 2022
Timeouts for popular Python packages

Python Timeouts An unresponsive service can be worse than a down one. It can tie up your entire system if not handled properly. All network requests s

Andrew Kane 11 Nov 22, 2022
A simple tool to get information about IP

IP Info Tool Just a simple tool to get IP's information, it uses requests module to gather information about IP, if you dont have much knowledge about

0 Dec 01, 2021
🐛 SSH self spreading worm written in python3 to propagate a botnet.

Mirkat SSH self spreading worm written in python3 to propagate a botnet. Install tutorial. cd ./script && sh setup.sh Support me. ⚠️ If this reposito

Ѵιcнч 58 Nov 01, 2022
A network address manipulation library for Python

netaddr A system-independent network address manipulation library for Python 2.7 and 3.5+. (Python 2.7 and 3.5 support is deprecated). Provides suppor

711 Jan 05, 2023
This is the code repository for the USENIX Security 2021 paper, "Weaponizing Middleboxes for TCP Reflected Amplification".

weaponizing-censors Censors pose a threat to the entire Internet. In this work, we show that censoring middleboxes and firewalls can be weaponized by

UMD Breakerspace 119 Dec 31, 2022
Qobuz-rpc - A simple discord rich presence client for qobuz written in Python

qobuz-rpc A simple discord rich presence client for qobuz written in Python It's

Raphael O. 13 Dec 15, 2022
Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries

TriOp Tool for quickly gathering information from Shodan.io about the number of IPs which satisfy large number of different queries For furt

Jan Kopriva 27 Nov 03, 2022
Tool to transfer credential files from Firefox to your local machine to decrypt offline.

Firefox-Dumper Firefox Dumper identifies the current user's Firefox profile directory and exfiltrates the credential files to the attacker's FTP serve

Joe Helle 22 Sep 10, 2022
Rufus is a Dos tool written in Python3.

🦎 Rufus 🦎 Rufus is a simple but powerful Denial of Service tool written in Python3. The type of the Dos attack is TCP Flood, the power of the attack

Billy 88 Dec 20, 2022
Py script to aid in setting up the boot chime in OpenCore.

BootChime Py script to aid in setting up the boot chime in OpenCore. It does so by helping you locate your IOHDACodecDevices, IOHDACodecAddress values

CorpNewt 7 Sep 19, 2022
Visualize the electric field of a point charge network.

ElectriPy ⚡ Visualize the electric field of a point charges network. 🔌 Installation Install ElectriPy package: $ pip install electripy You are all d

Dylan Tintenfich 29 Aug 29, 2022