Giter Site home page Giter Site logo

helium-packet-router's People

Contributors

barndon avatar dpezely avatar hwahby avatar jadeallenx avatar jeffgrunewald avatar macpie avatar michaeldjeffrey avatar ruttenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

helium-packet-router's Issues

Create Debian package for HPR

See PR#17

Tasks:

  • construct Debian package .deb file based upon a successful rebar3 release run
  • confirmed .deb generation against router repo; see Draft PR
  • authored systemd config and launch scripts (required)
  • authored /etc/init/ and /etc/rc?.d/ launch scripts
  • authored Dockerfile for testing within a pristine container
  • authored Vagrantfile for testing within a pristine VM
  • confirmed .deb extraction within clean Docker image
  • confirmed .deb extraction within clean Vagrant VM
  • confirmed successful deploy of .deb within clean container
    • Blocked on Helium packet-router main branch having successful make rel
  • confirmed successful deploy of .deb within clean VM
    • Blocked on Helium packet-router main branch having successful make rel

Future efforts:

OUTDATED sketch:

Debian packages can be generated via Makefile, and here's a generic version that just needs to be confirmed against current man pages and refined:

# Excerpt for Makefile to build .deb package

# FIXME: don't use var in this way.  this is just to highlight it in this draft:
MAIN_THING=helium-packet-router

RELEASE=0.1.0
PACKAGE_BUILD=`date +%Y%m%d.%H%M%S`
REVISION=${RELEASE}-${PACKAGE_BUILD}
DEBIAN_PACKAGE_NAME=helium-packet-router

DESTDIR=/opt/hpr

RUNTIME_USER=nobody

package: package-bin package-cfg


# FIXME: change names of .sh scripts
release: ${MAIN_THING}
	rm -rf release
	mkdir -p release${DESTDIR}/{bin,var/{log,run}}
	cp -p ${MAIN_THING}{,.ini,.sh} release${DESTDIR}/bin/

# FIXME: update to accommodate systemd
package-bin: release
	mkdir -p release/DEBIAN
	find release -type d | xargs chmod 755
	sed "s/Version: 1.0-1/Version: ${REVISION}/" < deb-bin-control.txt | sed "s/Architecture: all/Architecture: `dpkg --print-architecture`/" > release/DEBIAN/control
	svn info | egrep 'URL|Revision' | sed 's/^/ /' >> release/DEBIAN/control
	echo "#! /bin/sh" > release/DEBIAN/postinst
	echo 'chown -R `((id ${RUNTIME_USER} >/dev/null && echo ${RUNTIME_USER}:${RUNTIME_USER})|| echo nobody:nogroup)`' ${DESTDIR}/ >> release/DEBIAN/postinst
	echo "ln -s ${DESTDIR}/bin/${MAIN_THING}.sh /etc/init.d/" >> release/DEBIAN/postinst
	echo "ln -s ${DESTDIR}/bin/${MAIN_THING}.sh /etc/rc3.d/S40${MAIN_THING}" >> release/DEBIAN/postinst
	echo "ln -s ${DESTDIR}/bin/${MAIN_THING}.sh /etc/rc1.d/K40${MAIN_THING}" >> release/DEBIAN/postinst
	echo "echo To manually start, use:" >> release/DEBIAN/postinst
	echo "echo su - ${RUNTIME_USER} ${DESTDIR}/bin/${MAIN_THING}.sh start" >> release/DEBIAN/postinst
	echo "#! /bin/sh" > release/DEBIAN/prerm
	echo "${DESTDIR}/bin/${MAIN_THING}.sh stop" >> release/DEBIAN/prerm
	echo "${DESTDIR}/bin/${MAIN_THING}.sh unkind-stop" >> release/DEBIAN/prerm
	echo "${DESTDIR}/bin/${MAIN_THING}.sh clean-logs" >> release/DEBIAN/prerm
	echo "rm -f ${DESTDIR}/var/run/scoreboard.txt*" >> release/DEBIAN/prerm
	echo "rm -f ${DESTDIR}/var/log/console.log.[A-Z]*" >> release/DEBIAN/prerm
	echo "rm -f /etc/init.d/${MAIN_THING}.sh" >> release/DEBIAN/prerm
	echo "rm -f /etc/rc?.d/*${MAIN_THING}" >> release/DEBIAN/prerm
	chmod 755 release/DEBIAN/{postinst,prerm}
	dpkg-deb --build release
	mv release.deb ${DEBIAN_PACKAGE_NAME}-bin_${REVISION}_`arch`.deb
	ls -lh *.deb

package-cfg: ${MAIN_THING}_${RELEASE}.ini
	mkdir -p release-config/DEBIAN
	mkdir -p release-config${DESTDIR}/bin/
	find release-config -type d | xargs chmod 755
	cp -p ${MAIN_THING}_${RELEASE}.ini release-config${DESTDIR}/bin/${MAIN_THING}.ini
	sed "s/Version: 1.0-1/Version: ${REVISION}/" < deb-cfg-control.txt > release-config/DEBIAN/control
	svn info | egrep 'URL|Revision' | sed 's/^/ /' >> release/DEBIAN/control
	echo "#! /bin/sh" > release-config/DEBIAN/postinst
	echo "${DESTDIR}/bin/${MAIN_THING}.sh reload-config" >> release-config/DEBIAN/postinst
	chmod 755 release-config/DEBIAN/postinst
	dpkg-deb --build release-config
	mv release-config.deb ${DEBIAN_PACKAGE_NAME}-cfg-DEL_${REVISION}.deb
	ls -lh *.deb

clean:
	rm -rf release release-config *.deb

Chirpstack multi-region support

Chirpstack Application Server V4 supports multiple Regions through the use of multiple Gateway bridges.

All of these gateway bridges when deployed have different ports, Configurations only know about 1 endpoint, and should continue to do so.

How do we support different regions going to different endpoints without needing to specifically support it in the config service.

Packet Tracking transition

HPR need to have an HTTP port opened to ingest data above and then send to S3. We should only allow keys from known OUIs

GRPC packet ingestion

Helium gateways speak gRPC to Helium LoRaWAN Network Servers (LNS)

EDIT: unnecessary former tasks or accommodated through other means:

  • Tee raw gRPC traffic to local file:
    • Required as an input to our Packet Verify service (lives outside of HPR or LNS)
    • Accommodates replaying traffic for debugging
    • Accommodates live traffic going to next Release Candidate but with all safeguards of Production environment
  • Forward to router as gRPC (#30)
  • Accommodate load-balancer sessions with id/token in gRPC values or headers

Notes:

  • Inbound traffic from gateway-rs will be gRPC flowing through a load-balancer
    • AWS app layer ELB is gRPC aware
  • Handling of large scale traffic volumes will be deferred to load-balancer
    • e.g., Let LB maintain large socket listen queue because setup/shutdown of sockets from LB to packet-router across AWS backbone should be relatively cheap
    • Therefore, nothing special to be done for tuning Linux kernel or Erlang/BEAM
  • This ticket is just for the Listening portion of gRPC
    • The companion use of http2_client for accommodating sending to Class C devices (downlink without an uplink initiating the request) will be implemented as a separate effort

IoT Packet Verifier MVP

Build an initial simple implementation of IoT Packet Verifier based upon #34

  • Compile using HPR's draft Protobufs and decode into Rust struct:
  • Read from S3 using FileStore (e.g., file_sink.rs)
  • Write to S3 using FileStore
  • Read NetID/OUI mappings from Config Server
  • Tests passing

Notes:

  • It's called verifier (not validator) to avoid confusion with other systems currently within The Helium Network
  • This is version zero (not v1 yet)

Intermittent eunit and ct test failures

%%% hpr_routing_SUITE ==> 
Failure/Error: ?assertEqual({25,1}, receive_gateway_limit_exceeded_test ( { 0 , 0 } ))
  expected: {25,1}
       got: {26,0}
      line: 85```

```eunit --module hpr_max_copies```
I lost the example of the eunit test when I re-ran it and it succeeded.

HTTP roaming support

Support routing of packets to roaming partners via HTTP.
Passive routing only will be supported, based on the function and implementation of roaming in Packet Purchaser.

Create boiler-plate config for gRPC and protobufs

Create boiler-plate config for gRPC and protobufs for helium-packet-router:

  • Configuration for gRPC and protobufs replicated from various other Helium repos:
    • e.g., blockchain-core, router, miner, sibyl
    • Followed Mack's excellent trail of breadcrumbs through those repos
  • Since helium-packet-router is more "gateway" than "router", various tweaks were made to this instance of the config
  • Primary differences from router are:
    • Behaviour here reuses helium_router_bhvr, of which its implementation in router was recently updated
    • Here, we'll just use that one rpc's StateChannel param as an envelope around Packet
    • Considered but ruled-out using helium_gateway_bhvr due to rpc end points not needed here
    • See src/grpc/helium_packet_router_service.erl
  • Notes regarding the Erlang "behaviour"
    • hpr doesn't need anything to do with state-channels
    • but some of that info already being sent by gateway-rs may be useful metadata or for logging
    • hpr probably should ignore (pass-through) anything region-specific
    • etc. (please comment on this ticket if you can think of any others)
  • See PR#9

MIC Benchmark

We need to know an approximate limit on how many "MIC brute forcing" we can do before seeing a significant slow down.

Here is the Router code that does the MIC calculation.

Add location based filtering

  • Hotspot send it's h3 index

  • Route can include "no go zones" where it does not want to get data from

  • If hotspot in zone packet is not forwarded

  • h3 index should be sent to Packet verifier adding an extra check

  • what do we do for data only?

roaming on dataonly hotspots

Hi, i was using Senet devices roaming on a data-only hotspot: it stopped working in June, confirmed by Helium staff here. any plans to enable roaming again? please advise if i should post elsewhere, thanks.

Routing Config based on Proto

  • Create proto route matching
{
        net_id=3,
        dev_ranges=[{12, 20}, ..]
        euis=[{appeui, deveui}, ...] 
        lns_address="lora.com|10.0.0.9"
        protol="gwmp|http"
        oui=1
}
  • Save config locally

Packet Verifier design docs

IoT Packet Verifier will be our service inspecting LoRaWAN packets and associated metadata and will validate a Gateway’s stream of Uplinks in part by also inspecting Downlinks.

  • Draft simple document for design criteria: Michael & Daniel
  • Research / Explore protobufs for LoRaWAN bits within ChirpStack (aka don't reinvent the wheel)
  • Learn about FileStore and file_sink.rs from poc5g code (Thank you, madninja!)
  • Draft of simple design doc: Daniel
    • per Madninja's revised criteria: get to parity with existing router billing functionality
    • This is an MVP; i.e., v0 (rather than `v1)

Next will be: MVP implemented in Rust; see #43

This is separate from the Payment System but related. One feeds the other and back again.

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.