Git Product home page Git Product logo

ng-sume's Introduction

ng-sume

Mockup driver for NetFPGA SUME on FreeBSD made with iflib(4) using netgraph(4) for RX/TX.

DANGER

This is an experimental driver for me to play with iflib and to learn how it works in order to write a device driver for NetFPGA SUME sometimes in the future. It is mostly made by copying/pasting the existing code from ng_eiface(4) and if_em(4) thus creating something that kind of works, but panics when something happens (I am not yet sure what something is).

NetFPGA SUME reference NIC

For this mockup module, the NetFPGA does not need to be flashed, but here are instructions for flashing it with reference NIC project (I used another Linux machine to do it):

  1. install Digilent Adept Tools (Runtime and Utilities) from https://reference.digilentinc.com/reference/software/adept/start
  2. connect your machine with the NetFPGA via USB
  3. build or download the NIC from http://www.cl.cam.ac.uk/research/srg/netos/projects/netfpga/bitfiles/NetFPGA-SUME-live/1.9.0/reference_nic/reference_nic.bit
  4. flash the board with:
dsumecfg -d NetSUME write -verbose -s 2 -f reference_nic.bit # flash to flash section 2
dsumecfg -d NetSUME setbootsec -s 2 # load flash section 2 on board boot-up
dsumecfg -d NetSUME reconfig -s 2 # reconfigure the board from section 2

Instructions to try ng-sume

  1. Load the module with make load - this will create a virtual ngf0 interface.
  2. Create an eiface:
printf "mkpeer eiface ether ether" | ngctl -f -
printf "name ngeth0: eifc0" | ngctl -f -
  1. Connect both interfaces:
printf "mkpeer eifc0: pipe ether upper" | ngctl -f -
printf "name eifc0:ether pipe" | ngctl -f -
printf "connect pipe: ngf0: lower ether" | ngctl -f -
ifconfig ngeth0 name eifc0
  1. Jail the eiface:
jail -c name=out vnet children.max=2 persist
ifconfig eifc0 vnet out
jexec out ifconfig eifc0 10.0.0.1/24 promisc up
  1. Set the ngf0 and ping:
ifconfig ngf0 10.0.0.2/24 promisc up
ping 10.0.0.1
  1. ???

  2. Panic at some point.

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.