Coder Social home page Coder Social logo

network-protocols's Introduction

Introduction

This skeleton code is the basis for the CSE160 network project. Additional documentation on what is expected will be provided as the school year continues.

General Information

Data Structures

There are two data structures included into the project design to help with the assignment. See dataStructures/interfaces/ for the header information of these structures.

  • Hashmap - This is for anything that needs to retrieve a value based on a key.

  • List - The list is design to have pushfront, pushback capabilities. For the most part, you can stick with an array or even a QueueC (FIFO) which are more robust.

General Libraries

/lib/interfaces

  • CommandHandler - CommandHandler is what interfaces with TOSSIM. Commands are sent to this function, and based on the parameters passed, an event is fired.
  • SimpleSend - This is a wrapper of the lower level sender in TinyOS. The features included is a basic queuing mechanism and some small delays to prevent collisions. Do not change the delays. You can duplicate SimpleSendC to use a different AM type or possibly rewire it.
  • Transport - There is only the interface of Transport included. The actual implementation of the Transport layer is left to the student as an exercise. For CSE160 this will be Project 3 so don't worry about it now.

Noise

/noise/

This is the "noise" of the network. A heavy noised network will cause issues with packet loss.

  • no_noise.txt - There should be no packet loss using this model.

Topography

/topo/

This folder contains a few example topographies of the network and how they are connected to each other. Be sure to try additional networks when testing your code since additional ones will be added when grading.

  • long_line.topo - this topography is a line of 19 motes that have bidirectional links.
  • example.topo - A slightly more complex connection

Each line has three values, the source node, the destination node, and the gain. For now you can keep the gain constant for all of your topographies. A line written as 1 2 -53 denotes a one-way connection from 1 to 2. To make it bidirectional include also 2 1 -53.

Running Simulations

The following is an example of a simulation script.

from TestSim import TestSim

def main():
    # Get simulation ready to run.
    s = TestSim();

    # Before we do anything, lets simulate the network off.
    s.runTime(1);

    # Load the the layout of the network.
    s.loadTopo("long_line.topo");

    # Add a noise model to all of the motes.
    s.loadNoise("no_noise.txt");

    # Turn on all of the sensors.
    s.bootAll();

    # Add the main channels. These channels are declared in includes/channels.h
    s.addChannel(s.COMMAND_CHANNEL);
    s.addChannel(s.GENERAL_CHANNEL);

    # After sending a ping, simulate a little to prevent collision.
    s.runTime(1);
    s.ping(1, 2, "Hello, World");
    s.runTime(1);

    s.ping(1, 10, "Hi!");
    s.runTime(1);

if __name__ == '__main__':
    main()

network-protocols's People

Contributors

ajberchek avatar alexbeltran avatar brando209 avatar nombies 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.