-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
174 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Node } from '../node' | ||
import { Node } from './node' | ||
import { | ||
PKT_TYPE, | ||
type Message, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Node } from '../node' | ||
import { Node } from './node' | ||
import { | ||
PKT_TYPE, | ||
type Message, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Node } from '../node' | ||
import { Node } from './node' | ||
import { | ||
PKT_TYPE, | ||
type Message, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Node } from '../node' | ||
import { Node } from './node' | ||
import { | ||
PKT_TYPE, | ||
type Message, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { Node } from '../node' | ||
import { Node } from './node' | ||
import { | ||
PKT_TYPE, | ||
type Message, | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface Config { | ||
seed: number | ||
num_nodes: number | ||
grid_size: number | ||
tx_range: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export interface Flow { | ||
id: number | ||
e2e_src: number | ||
e2e_dst: number | ||
deadline: number | ||
period: number | ||
workload: number | ||
path: number[] // id's of all nodes in path | ||
editing: boolean // whether or not the user can edit in FlowsPanel | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export * from './config' | ||
export * from './node' | ||
export * from './message' | ||
export * from './packet' | ||
export * from './link' | ||
export * from './routing' | ||
export * from './flow' | ||
export * from './schedule' | ||
|
||
export const PROTOCOL_TYPE = <{ [name: string]: string }>{ | ||
TSCH: '802.15.4', | ||
TSN: '802.1', | ||
FIVE_G: '5G NR' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export interface Link { | ||
// undirected for visualization | ||
uid: number // cantor pairing, uid=0.5*(v1+v2)*(v1+v2+1)+v2 | ||
v1: number | ||
v2: number | ||
type: number | ||
} | ||
|
||
export enum LINK_TYPE { | ||
WIRED, | ||
WIRELESS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Flow } from './flow' | ||
|
||
// Message is used for direct communication (debug, cmd, stats) between nodes and controller | ||
export interface Message { | ||
type: number | ||
id: number // node id | ||
payload: any | ||
} | ||
|
||
export type MsgHandler = (msg: Message) => void | ||
|
||
export enum MSG_TYPE { | ||
INIT, | ||
ASN, | ||
DONE, // finished all activities of the current slot | ||
ROUTING, | ||
FLOW, // install periodic flow | ||
STAT | ||
} | ||
|
||
export interface InitMsgPayload { | ||
id: number | ||
neighbors: number[] | ||
} | ||
|
||
export interface ASNMsgPayload { | ||
asn: number | ||
} | ||
|
||
export interface RoutingMsgPayload { | ||
[dst: number]: number | ||
} | ||
|
||
export interface FlowMsgPayload { | ||
flows: Flow[] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export enum NODE_TYPE { | ||
TSCH, | ||
TSN, | ||
FIVE_G_GNB, | ||
FIVE_G_UE, | ||
END_SYSTEM_SERVER = 11, | ||
END_SYSTEM_SENSOR_CAMERA, | ||
END_SYSTEM_SENSOR_TEMP, | ||
END_SYSTEM_SENSOR_PRESSURE, | ||
END_SYSTEM_SENSOR_HUMIDITY, | ||
END_SYSTEM_ACTUATOR_ROBOTIC_ARM, | ||
END_SYSTEM_ACTUATOR_PNEUMATIC | ||
} | ||
|
||
export const NODE_TYPE_DISPLAY_NAME = <{ [name: string]: string }>{ | ||
[NODE_TYPE.TSCH]: 'TSCH Node', | ||
[NODE_TYPE.TSN]: 'TSN Bridge', | ||
[NODE_TYPE.FIVE_G_GNB]: '5G gNB', | ||
[NODE_TYPE.FIVE_G_UE]: '5G UE', | ||
[NODE_TYPE.END_SYSTEM_SERVER]: 'Edge Server', | ||
[NODE_TYPE.END_SYSTEM_SENSOR_CAMERA]: 'Camera', | ||
[NODE_TYPE.END_SYSTEM_SENSOR_TEMP]: 'Temperature Sensor', | ||
[NODE_TYPE.END_SYSTEM_SENSOR_PRESSURE]: 'Pressure Sensor', | ||
[NODE_TYPE.END_SYSTEM_SENSOR_HUMIDITY]: 'Humidity Sensor', | ||
[NODE_TYPE.END_SYSTEM_ACTUATOR_ROBOTIC_ARM]: 'Robotic Arm', | ||
[NODE_TYPE.END_SYSTEM_ACTUATOR_PNEUMATIC]: 'Pneumatic Actuator' | ||
} | ||
|
||
export interface Node { | ||
id: number | ||
type: number | ||
pos: [number, number] | ||
neighbors: number[] | ||
tx_cnt: number | ||
rx_cnt: number | ||
w: Worker | undefined | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Packet is transfered among nodes, at data-link layer | ||
export interface Packet { | ||
uid: number | ||
protocol: string | ||
type: number | ||
e2e_src: number | ||
e2e_dst: number | ||
mac_src: number | ||
mac_dst: number | ||
asn: number | ||
len: number | ||
payload: any | ||
|
||
// for display on packet sniffer | ||
id: number | ||
children: any | ||
} | ||
|
||
export type PktHandler = (pkt: Packet) => void | ||
|
||
export enum PKT_TYPE { | ||
DATA | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface RoutingGraph { | ||
[id: number]: number[] | ||
} | ||
|
||
export interface RoutingTable { | ||
[id: number]: number | ||
} | ||
|
||
export enum ADDR { | ||
BROADCAST = -1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// the global network schedule | ||
export interface Cell { | ||
slot: number | ||
type: number | ||
mac_src: number | ||
mac_dst: number | ||
flow_id: number | ||
flow_k: number | ||
flow_h: number | ||
} | ||
|
||
export enum CELL_TYPE { | ||
DATA, | ||
MGMT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters