Git Product home page Git Product logo

unet's Introduction

image

uNet

Just another toy userspace TCP/IP stack.

Compiling

This project is only known to work on Linux systems, although it might not be so hard to get it working on BSD systems.

In case you do not have access to a Linux system, you can use the Vagrantfile provided within the project source tree. Using Vagrant, getting a Linux box with all the dependencies installed and properly configured is just a breeze. Just issue the following commands:

$ vagrant up
# change your working directory to the root of the source tree
$ cd /vagrant_data
$ make
$ make check

If you don't want to use Vagrant for some reason, here are the dependencies you are going to need.

  • Make sure you have make and gcc available on your system.
  • Just do a make to compile the entire application.
  • Install scapy packet manipulation tool.
  • You can run tests by issuing a make check

How to use?

unet features an interactive shell to communicate with the stack. The uNet shell itself comes with a bunch of commands that are similar to the UNIX equivalents:

[vagrant@unet-devel vagrant_data]$ ./unet
iface: tap0, hwaddr: 56:85:6f:7f:a0:c1, ipaddr: 172.28.128.44
unet-shell-> help
ip         - set/get interface IP address
hwaddr     - set/get mac address
route      - show/manipulate the routing tables
nc         - arbitrary TCP and UDP connections and listens

To change IP and mac address for the virtual interface:

unet-shell-> hwaddr set aa:bb:cc:11:22:33
unet-shell-> ip set 192.168.1.206/24

Set up a default route with route command.:

unet-shell-> route setgw 10.10.20.24

nc command is very similar to the regular netcat tool that is widely used in the UNIX community:

unet-shell-> nc -u 192.168.1.100 5432

Or you can listen on port 5432:

unet-shell-> nc -ul 5432

Can I use this on a public network?

Of course, you can. Just change your network configuration from within your Vagrantfile.

Features

  • Doesn't do any dynamic memory allocation. It features a very simple memory allocator. This makes it a suitable candidate for resource constrained embedded platforms.
  • Liberally licensed under BSD 3-clause License.

Copyright (c) 2017, Cihangir Akturk

unet's People

Contributors

cakturk avatar

Stargazers

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

Watchers

 avatar  avatar  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.