Simple Network Simulation For The Funs!
Project description
EduNet
This application allows you to simulate different network operations in a simple plug-in manner.
The motivation with this project was to simply learn more about sockets, protocols, and making them all talk to one another.
The end result of this project is to be able to craft together any network entities and have them communicate as intended.
Simple Supported Use Case
There is a built-in simple supported use case called SimpleHTTPNode.
Bringing this up will start a TCP listener on localhost on port 9999 accepting valid HTTP requests. What will be sent back are valid HTTP responses.
Complex Use Cases
As it will be supported soon, the intent is by using the core architecture, we will be able to implement a router with basic features like:
- Routing table
- DHCP assignment
- Packet forwarding
- Network Access Translation (NAT)
Simple Example to put it all together
Installing
pip install edunet
Usage
Going back to the Simple use case, as is you can simply do something like:
Starting service
from edunet.core.applications.simple_http_application import SimpleHTTPApplication
from edunet.core.networking.handlers.simple_http_connection_handler import SimpleHTTPConnectionHandler
from edunet.core.networking.listeners.tcp_listener import TCPListener
# create an HTTP application
app = SimpleHTTPApplication()
# create a Connection Handler that takes an application
handler = SimpleHTTPConnectionHandler(app)
# A listener is needed to allow connections to come through
listener = TCPListener("127.0.0.1", 9999, handler)
listener.start()
Calling service
You can now communicate with it over HTTP by any means
curl
curl -X GET http://127.0.0.1:9999
python
import urllib.request
response = urllib.request.urlopen("http://localhost:9999")
print(response.read().decode("utf-8"))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file edunet-0.2.4.tar.gz
.
File metadata
- Download URL: edunet-0.2.4.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35f9670dd4e81be9fe91aeb82733c9194b988827211d27f6f745282b0b37c909 |
|
MD5 | 7aba8d61ae6d0e61975699929362ed13 |
|
BLAKE2b-256 | b2749cc8a468946bb4c8d56cc840f081a7296cd821ea71e04ff5046199018013 |
File details
Details for the file edunet-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: edunet-0.2.4-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.11.10 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cadfe294042b0672949a86f11d60f4369045f8d046dba1f9592ef10da49b7228 |
|
MD5 | 34b5c25cfbdbfdd8b3a033947514c211 |
|
BLAKE2b-256 | 7f0d01fdc90b23e9de2345ba2de0fa93cc5152f5eed379ef78b07cd6e47617cf |