Giter Club home page Giter Club logo

deepsea52418 / omnet_tsnkit Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 3.0 69.76 MB

Using TSNkit and OMNeT for TSN network scheduling and simulation

License: GNU General Public License v3.0

Python 2.07% Jupyter Notebook 3.33% C++ 75.60% Makefile 16.48% Batchfile 0.03% SuperCollider 1.59% C 0.09% Shell 0.10% HTML 0.01% CSS 0.01% XSLT 0.05% Tcl 0.06% R 0.11% Perl 0.16% Lex 0.05% Yacc 0.23% FreeMarker 0.05% TeX 0.01% Dockerfile 0.01%
omnetpp time-sensitive-networking tsn

omnet_tsnkit's Introduction

OMNeT_TSNkit

Introduction

This project addresses the scheduling and simulation challenges in Time-Sensitive Networks (TSN), utilizing TSNkit to generate network scheduling schemes. The simulation is conducted using the NeSTiNg framework, allowing the verification of scheduling schemes. A video link is available for the project.

The primary goal of this project is to promote the TSNkit tool and OMNeT++ simulation software, facilitating a quick introduction to TSN. Moreover, it aims to make the replication of classic TSN algorithms from research papers more accessible.

OMNeT++ supports various simulation frameworks. It is recommended to choose an appropriate framework based on simulation goals. This project uses the NeSTiNg framework as an example.

TSNkit supports multiple algorithms, with this project demonstrating the SMT-NW (No-wait Packet Scheduling for IEEE Time-sensitive Networks) algorithm. For more algorithms, refer to this link.

Project Requirements

Code Explanation

  1. Network Topology:
    graph LR
        Client1[Client1]
        Client2[Client2]
        Client3[Client3]
        TSNSwitch1[TSNSwitch1]
        TSNSwitch2[TSNSwitch2]
        Server1[Server1]
        Server2[Server2]
        Server3[Server3]
        Client1 --- TSNSwitch1
        Client2 --- TSNSwitch1
        Client3 --- TSNSwitch1
        TSNSwitch1 --- TSNSwitch2
        TSNSwitch2 --- Server1
        TSNSwitch2 --- Server2
        TSNSwitch2 --- Server3
    
    
  2. Flow Information
FlowID Src Dst Size Period Deadline Jitter
0 1 5 500B 500000ns 408400ns 408400ns
1 2 6 1200B 1000000ns 408400ns 408400ns
2 3 7 200B 200000ns 408400ns 408400ns
  1. File Directory
.
├── omnet
│   └── workspace
│       └── nesting
│           └── teach
│               ├── xml
│               │   ├── teach_gcl.xml (Simulated GCL Information)
│               │   └── teach_routing.xml (Simulated Routing Information)
│               ├── example_teach.ini (Simulated Network Configuration)
│               └── teach.ned (Simulated Network Topology)
└── TSNkit
    └── data
        │  
        ├── input
        │    └── example
        │       ├──  example_net.csv  (Network Topology)
        │       └──  example_task.csv (FLOW Information)
        │        
        │          
        └─ output
            └── example
                 ├── example-DELAY.csv     (Flow Delay Information)
                 ├── example-GCL.csv       (GCL Information)
                 ├── example-OFFSET.csv    (Flow Send Offset)
                 ├── example-QUEUE.csv     (Flow Priority Information)
                 └──  example-ROUTE.csv     (Flow Priority Information)

Usage

Installation

  1. Download and install Ubuntu 18.04, and install OMNeT++ 5.6.1.
  2. Navigate to the OMNeT++ directory: cd [path to your OMNeT++].
  3. git clone https://gitee.com/deepsea52418/omnet_tsnkit.git.
  4. cd OMNET_TSNKIT.
  5. Install and compile INET Framework, specific instructions can be found here.
  6. Install and compile NeSTiNg, specific instructions can be found here.
  7. Install TSNkit, specific instructions can be found here.

Solve using Scheduling Algorithm

  1. cd TSNkit/src
  2. Use python -m tsnkit.models.smt_nw ../data/input/example/example_task.csv ../data/input/example/example_net.csv ../data/output/example for solving, This command loads the network information (net.csv) and flow information (task.csv) in data/input/example for solution
  3. Upon completion, you can find the generated scheduling result files (GCL.csv, OFFSET.csv, etc.) in the "../data/output/example/".

Run Simulation

  1. Open OMNeT++.
  2. Choose OMNET_TSNKIT\omnet\workspace as the OMNeT++ workspace.
  3. Select nesting\teach\example_teach.ini, right-click, and choose Run As to execute.

Tips

The SMT-NW algorithm achieves no-wait transmission of flows by specifying the offset time for flow transmission. In this process, there is no involvement of flow priority-related issues; therefore, all flow priorities are set to 0.

According to the definition in the nesting\src\nesting\ieee8021q\queue\QueuingFrames.h code, with 8 available queues, flows with priority 0 are mapped to Queueing module's queue 1 for transmission.

In the NeSTiNg simulation framework, by default, the oscillator submodule frequency of simulation node modules is set to 1MHz, and simulation time precision is 1μs. To enhance simulation accuracy, in this project, the oscillator module frequency is specified as 1GHz, resulting in a simulation time precision of 1ns.

In the NeSTiNg simulation framework, the default data frame format specified by the 802.3 protocol is used, where the complete data frame size equals the application layer data + preamble (8B) + destination address (6B) + source address (6B) + vlanTag (4B) + length (2B) + CRC (4B).

Currently, frame spacing issues are not considered in TSNkit. You need to modify the INTERFRAME_GAP_BITS parameter in the \inet\src\inet\linklayer\ethernet\Ethernet.h file from 96 to 0.

The calculation of delay in TSNKit subtracts the transmission delay of the source end, and does not subtract the offset, while the calculation of delay in OMNeT starts from the source device starting to send the first bit, which means that the delay in tsnkit The output minus the offset, plus the transmission delay at the source end, is the delay that should appear in OMNeT.

Contribution

If you have any comments or suggestions for this project, feel free to submit an issue on the project page. Thank you for your participation and feedback!

Acknowledgments

  • Chuang Li
  • Callin
  • Contributors to OMNeT++, INET Framework, NeSTiNg, and TSNkit projects

omnet_tsnkit's People

Contributors

chaungli avatar deepsea52418 avatar lxacc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.