19
NODES NETWORK OVERLAY: DISTRIBUTED & EXTENSIBLE SERVICES COMP 410, SPRING 2015

NODES NETWORK OVERLAY: DISTRIBUTED & EXTENSIBLE SERVICES COMP 410, SPRING 2015

Embed Size (px)

Citation preview

NODESNETWORK OVERLAY: DISTRIBUTED & EXTENSIBLE SERVICES

COMP 410, SPRING 2015

So What’s Going on Here?Goal: Type-safe network that supports arbitrary functionality and message typeso Nodes can send, receive, or do both. o Node operation is completely undefinedo Receivers make sure they are able to receive all of the sender’s data types

Potential uses for this kind of network:o Data Pipelineo Multiplexing/Demultiplexingo Parallel Computation Engineo And so much more!

Example Use Case

Temperature Sensor

Is the temperature

too high?> 100 °F

If yes, SOUND THE

ALARM!

Example Use Case

Temperature Sensor

Is the temperature

too low?< -10 °F

If yes, SOUND THE

ALARM!

How is the System Used?

Design Phase◦The Network Team

◦ Developed underlying technology for node connection

◦The Node API Team ◦ Decided what a node could access within the network

◦The Message Team◦ Created messages to send data and commands over the network ◦ Focus was implementation specific to demonstrate our technology

Implementation Phase◦The Shared Library Team

◦ Coded the API + network backbone◦The Message Library Team

◦ Standardized serialization/deserialization mechanism◦The Expert Implementation Team

◦ Implemented more complicated node behaviors for the demo◦The Demo & Presentation Team

◦ Planned the demo network◦ Created the presentation of network capabilities

How the Components Fit Together

The Three Types of Nodes

Temperature Sensor

Is the temperature

too high?

If yes, SOUND THE

ALARM!

Source Relay Display

The Three Types of Nodes

SenderIs the

temperature too high?

Receiver

Source Relay Display

SenderReceiver

Sender

Sender(Set<String> outgoingTypes)

void Sender#connectTo(String host, int port)

void Sender#send(String type, Byte[] serializedMessageBody)

void Sender#disconnectFromAll()

Receiver

Receiver(Map<String, Action<Byte[]>> handlers)

void Receiver#listen(int port)

void Receiver#stopListening()

Motivation for the Network Library

Our Goal:◦ Provide reliable and convenient data transfer mechanism

Our Solution◦ Used tcp/ip C# socket ◦ Alternatives: WCF. Added unneeded complexity◦ Network library is decoupled

Create Sender

CreateReceiver

Connect Check Types

Kill

Keep Alive

Send Messages

Receive Messages

Sender Receiver

Motivation for the Message Library

Our Goal:◦ Handle new, arbitrary data types in both information and commands

Our Solution◦ Shared Message Library with packaging/serialization tools that can

be expanded for any information type/command.

A Shared Extendable Message Library

Commands, information types, all treated similarly◦ Information/command stored in a message object◦ Message is JSON-serialized and then sent.

The string is arbitrary, so the message types can be extended arbitrarily

Actor A

Type of Data

DataPrepares

Prepares

Packet

Actor BType of Data

Data

System A

System B

Merged and sent

Handlers

Used to make descisions

Feeds into

Event

Prepares

Handles Data based on Type to produce

Network

Data Types Data types/commands we implemented:◦IntDataCmd, FloatDataCmd, StringDataCmd, ArrayDataCmd, FileDataCmd

◦ShutdownCmd, ConnectToChildCmd, BroadcastCmd, JavaScriptCmd, ResetStateCmd