GithubHelp home page GithubHelp logo

hujun-open / zouppp Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 7.0 100 KB

zouppp is a set of GO modules implements PPPoE, PPP and related protocols:

License: GNU General Public License v3.0

Go 100.00%
golang ppp pppoe load-testing dhcpv6

zouppp's Introduction

zouppp

Build Status PkgGoDev

zouppp is a set of GO modules implements PPPoE and related protocols:

  • zouppp/pppoe: PPPoE RFC2516
  • zouppp/lcp: PPP/LCP RFC1661; IPCP RFC1332; IPv6CP RFC5072;
  • zouppp/pap: PAP RFC1334
  • zouppp/chap: CHAP RFC1994
  • zouppp/datapath: linux datapath
  • zouppp/client: PPPoE Client
  • zouppp/client.DHCP6Clnt: DHCPv6 client

note: zouppp focus on client side, a PPPoE/PPP server requires addtional logic/code

PPPoE Client

The main module implements a PPPoE test client with load testing capability. it could also be used as a starting point to implement your own PPPoE client;

It has following key features:

  • Custom VLAN/MAC address without provisioning OS interface (via etherconn)
  • Load testing, able to initiate large amount of PPPoE session at the same time
  • Option to not creating corresponding PPP TUN interface in OS, e.g. only do control plane processing, this is useful for protocol level only load testing.
  • Support BBF PPPoE tag: circuit-id/remote-id
  • IPv4, IPv6 and dual-stack
  • DHCPv6 over PPP, IA_NA and/or IA_PD

Example Client Usage

  1. on interface eth1, create 100 PPPoE session, CHAP, IPv4 only, enable debug logging

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100

  1. #1 variant, using PAP

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -authproto PAP

  1. #1 variant, using QinQ 100.200

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -vlan 100.200

  1. #3 variant, using custom mac

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -vlan 100.200 -mac "aa:bb:cc:11:22:33"

  1. #1 variant, don't create PPP TUN interface

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -apply=false

  1. #1 variant, each session use different username and password, e.g. first one username is "testuser-0", 2nd one is "testuser-1" ..etc; password following same rule

zouppp -i eth1 -u testuser-@ID -p passwd123-@ID -l debug -v6=false -n 100

  1. #1 variant, each session add BBF remote-id tag, first session remote-id tag is "remote-id-0", 2nd one is "remote-id-1" ..etc;

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -rid remote-id-@id

  1. #1 variant, use XDP socket;

zouppp -i eth1 -u testuser -p passwd123 -l debug -v6=false -n 100 -xdp

  1. #1 variant, running DHCPv6 over ppp, requesting IA_NA and IA_PD zouppp -i eth1 -u testuser -p passwd123 -l debug -n 100 -dhcp6iana -dhcp6iapd

CLI

Usage:
a pppoe testing tool
  - apply: if Apply is true, then create a PPP interface with assigned addresses; could be set to false if only to test protocol
        default:true
  - authproto: auth protocol, PAP or CHAP
        default:CHAP
  - cid: BBF circuit-id
  - dhcpv6iana: run DHCPv6 over PPP to get an IANA address
        default:false
  - dhcpv6iapd: run DHCPv6 over PPP to get an IAPD prefix
        default:false
  - excludedvlans: a list of excluded VLAN id, apply to all layer of vlans
  - i: listening interface name
  - interval: amount of time to wait between launching each session
        default:0s
  - l: log levl, err|info|debug
        default:err
  - mac: start MAC address
  - macstep: MAC step to increase for each client
        default:0
  - n: number of PPPoE clients
        default:1
  - p: PAP/CHAP password
  - pppifname: name of PPP interface created after successfully dialing, must contain @ID
        default:zouppp@ID
  - profiling: enable profiling, dev use only
        default:false
  - retry: number of setup retry
        default:0
  - rid: BBF remote-id
  - timeout: setup timeout
        default:0s
  - u: PAP/CHAP username
  - v4: run IPCP
        default:true
  - v6: run IPv6CP
        default:false
  - vlan: start VLAN id, could be Dot1q or QinQ
  - vlanstep: VLAN step to increase for each client
        default:0
  - xdp: use XDP to forward packet
        default:false

  -cfgfromfile: load configuration from the specified file
        default:zouppp.conf

Config File

Thanks to shouchan, beside using CLI parameters, a YAML config file could also be used via "-cfgfromfile <conf_file>", the content of YAML is the client.Setup struct

zouppp's People

Contributors

hujun-open avatar

Stargazers

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

Watchers

 avatar  avatar

zouppp's Issues

NewTUNIf set right destination

destination seems wrong?
zouppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1492
inet 114.238.85.232 netmask 255.255.255.255 destination 114.238.85.232

Support VSNCP

This is very good PPP implementation in Golang. I'd like to use it to support VSNCP on the base of LCP since all negotiation procedures are in common. But currently the Pkt structure is only for IPCP/LCP. Would it be better to use an Interface instead of concrete Pkt structure so that I can have own Serialize/Parse implementation for VSNCP?

Set desired access concentrator name

How to set the desired access concentrator name

How to specify the two PPPOE Servers in the LAN

example pppoe -c

pppoe -h
Usage: pppoe [options]
Options:
-I if_name -- Specify interface (default eth0.)
-D filename -- Log debugging information in filename.
-T timeout -- Specify inactivity timeout in seconds.
-t timeout -- Initial timeout for discovery packets in seconds
-V -- Print version and exit.
-A -- Print access concentrator names and exit.
-S name -- Set desired service name.
-C name -- Set desired access concentrator name.
-U -- Use Host-Unique to allow multiple PPPoE sessions.
-s -- Use synchronous PPP encapsulation.
-m MSS -- Clamp incoming and outgoing MSS options.
-p pidfile -- Write process-ID to pidfile.
-e sess:mac -- Skip discovery phase; use existing session.
-n -- Do not open discovery socket.
-k -- Kill a session with PADT (requires -e)
-d -- Perform discovery, print session info and exit.
-f disc:sess -- Set Ethernet frame types (hex).
-F numfloods -- Set the discovery flood, only used for stress-testing.
-h -- Print usage information.

看日志,已拨号成功,但看本地网卡是并未绑定ip

Failed:0
Duration:0s
Interval:1ms
Setup rate:0.22242203065444716
Fastest success:8.990601643s
Success within 10 seconds:2
Slowest success:8.991900832s
Avg success time:8.991251237s

2023-01-16/10:46:03 INFO l2ep&00:1b:21:4c:c1:8d#0x8863.5B0F.LCP lcp/lcp.go:867 sending echo-request
2023-01-16/10:46:03 INFO l2ep&00:1b:21:4c:c1:8e#0x8863.5B0E.LCP lcp/lcp.go:867 sending echo-request
2023-01-16/10:46:03 INFO l2ep&00:1b:21:4c:c1:8d#0x8863.5B0F.LCP lcp/lcp.go:498 got a EchoReply lcp pkt
2023-01-16/10:46:03 INFO l2ep&00:1b:21:4c:c1:8e#0x8863.5B0E.LCP lcp/lcp.go:498 got a EchoReply lcp pkt
2023-01-16/10:46:08 INFO l2ep&00:1b:21:4c:c1:8d#0x8863.5B0F.LCP lcp/lcp.go:867 sending echo-request

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.