Skip to content

arnabmondal-eg/dnp3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnp3 Parser

This project is an attempt to simulate the dnp3 protocol often used for communication in SCADA systems. This project is still in its early stages, only part of the spec is implemented.

There are no plans to impelemtent the entire spec however, as this protol is far to large. Only specifc, commonly used parts will be implemented, such that a common packet can be parsed succesfuly.

Goals

  • Pure Swing UI implementiation of;
    • Packet Parser
    • Master Client
    • Child Client
  • Fast, Memory Efficient Proccesing
  • Most of spec (much will have to be skipped however)

Project Structure

dnp3/                                                             
│                                                                 
├──── .vscode/           // settings and configurations for vscode
│                                                                 
├───┬ backend/           // all parser logic (C)                  
│   │                                                             
│   ├──── build/         // build files, binaries, etc.           
│   │                                                             
│   ├──── inc/           // header files                          
│   │                                                             
│   └───┬ src/           // source files                          
│       │                                                         
│       ├──── dnp3/      // struct implementations                
│       │                                                         
│       ├──── helper/    // helper functions                      
│       │                                                         
│       └──── main.c     // backend start                         
│                                                                 
├───┬ frontend/          // all ui (Java Swing)                   
│   │                                                             
│   ├──── build/                                                  
│   │                                                             
│   └───┐ src/                                                    
│       │                                                         
│       ├──── ui/        // window create                         
│       │                                                         
│       ├──── helper/    // helper functions                      
│       │                                                         
│       └──── Main.java  // frontend start                        
│                                                                 
└──── log/               // logs from backend                     

Curently Implmented

  • Parser UI (not hooked up to backend)
  • Parsing of dnp3:
    • Header
    • DLC
    • Transport Header
    • Application Header
    • First Object Header

Usage

The easiest method to run either the frontend or backend is to open the repo in VsCode and use the built in tasks. Manual Methods are also avalible.

Currently, backend and frontend are not linked. Plans are to use Network Sockets to avoid using JNI or JNA

General

  • Clone the repository
  • Install both a C compiler, JDK, and CMake
    • I used Clang and Java 25

Backend

Contains Parser Logic.

vscode Task

  1. Hit Ctrl + Shift + P and type Tasks: Run Task
  2. Select CMake Build or CMake Run Binary, depending on your goal
  3. Select Clean Backend or Clean All to remove build dir

Manual

Backend is compiled with CMake to make your life a little easier

  1. Compile:
    cmake -S backend -B backend/build
    cmake --build backend/build --config Debug
  2. Run the built binary:
    ./backend/build/bin/dnp3

Frontend

Contains UI with Some simulated Data (for now...)

vscode Task

  1. Hit Ctrl + Shift + P and type Tasks: Run Task
  2. Select Java Compile or Run Java Frontend, depending on your goal
  3. Select Clean Frontend or Clean All to remove build dir

Manual

Frontend Compiled with javac

  1. Compile:
    javac -d bin frontend/src/**/*.java
  2. Run the bult binary:
    java -cp frontend/bin Main

About

Simulates the DNP3 Protocol often used in SCADA Systems. Summer project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors