GithubHelp home page GithubHelp logo

jz-lu / xv6-net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pandax381/xv6-net

0.0 0.0 0.0 20.04 MB

xv6 OS with TCP/IP Network Stack

License: Other

Emacs Lisp 0.02% Makefile 2.28% C 87.75% Assembly 2.33% Perl 1.25% Shell 1.39% OpenEdge ABL 0.48% Objective-C 0.85% Ruby 0.62% C++ 3.00% Dockerfile 0.05%

xv6-net's Introduction

xv6-net

This project is implement TCP/IP Network Stack on xv6.

The network stack uses https://github.com/pandax381/microps

microps is a user-mode TCP/IP stack that I'm developing. This project ported it to the xv6 kernel.

demo

Features

  • Network device
    • PCI
      • Bus scan
      • Find device driver
    • Intel 8254x (e1000) driver
      • Initialization
      • Basic operation of RX/TX with DMA
      • Interrupt trap
      • Detect interrupt souce (if multiple NICs)
    • Device abstraction
      • Define structure for physical device abstraction (struct netdev)
      • Support multiple link protocols and physical devices
  • Protocols
    • Ethernet
    • ARP
    • IP
    • ICMP
    • UDP
    • TCP
  • Network Interface
    • Interface abstraction
      • Define structure for logical interface abstraction (struct netif)
      • Support multiple address family and logical interfaces
    • Configuration
      • ifconfig
  • Socket API
    • Systemcalls
      • socket
      • bind
      • connect
      • listen
      • accept
      • recv
      • send
      • recvfrom
      • sendto
    • Socket descriptor (compatible with File descriptor)
    • Socket address (struct sockaddr)

Task

  • ARP resolution waiting queue (Currently discards data)
  • TCP timer (Currently retransmission timer is not working)
  • DHCP client
  • DNS stub resolver

Tutorial

Build & Run

$ sudo make docker-build
$ sudo make docker-run

...(xv6-net starts on qemu in the container)...

$ ifconfig net1 172.16.100.2 netmask 255.255.255.0
$ ifconfig net1 up
$ tcpechoserver
Starting TCP Echo Server
socket: success, soc=3
bind: success, self=0.0.0.0:7
waiting for connection...

...(client connection information and received data are output)...

(switch to qemu monitor with Ctrl-a + c and exit by typing `quit`)

Ping Test (at another terminal)

$ sudo docker exec -it xv6-net ping 172.16.100.2

TCP Test (at another terminal)

$ sudo docker exec -it xv6-net nc 172.16.100.2 7

License

xv6: Under the MIT License. See LICENSE file.

Additional code: Under the MIT License. See header of each source code.

xv6-net's People

Contributors

kaashoek avatar pandax381 avatar rsc avatar phf avatar aclements avatar mikecat avatar zeldovich avatar chibby0ne avatar gw avatar icenowy avatar beordle avatar saarett avatar tchajed avatar kehao95 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.