Skip to content

Instantly share code, notes, and snippets.

View raffysommy's full-sized avatar

Raffaele Sommese raffysommy

View GitHub Profile
@raffysommy
raffysommy / as2org.py
Last active May 13, 2021 11:27
Caida AS2Org Python converter
#!/usr/bin/env python3
from datetime import datetime
import pandas as pd
import argparse
import sys
import gzip
import os
def convert(filename):
head, tail = os.path.split(filename)
date = datetime.strptime(tail,'%Y%m%d.as-org2info.txt.gz')
@raffysommy
raffysommy / gist:cd5f77dd2adb0dcbed55f5030ba5518b
Last active September 7, 2020 09:57
Manycast2 - Notice to operators
If you see this message you intercept a packet that belongs to Manycast2.
If you are a network operator and you believe your servers may be experiencing problems due to our measurements, please consult the information below on what you can expect to see from us, and as a last resort how you can contact us to block our traffic.
We thank you in advance for working with us to resolve any issues and apologize in advance if we have inadvertently caused problems through our measurement.
Manycast2 is a project that aims to scan the IPV4 network address space to detect anycast instances.
We make use of ICMP echo request packets (ping) targeting USC/ICI hitlist IP addresses https://ant.isi.edu/datasets/ip_hitlists/.
We generate a very small amount of traffic (1 packet per each prefix, each 20 minutes) that should not affect your systems.
However, if this cause you inconveniences don't hesitate to contact us at:
r.sommese [at] utwente dot nl
#/bin/bash
cd /home/raffaele/network-testing/pktgen
case "$1" in
"-36")
./pktgen_sample05_flow_per_thread.sh -i enp1s0f0 -s 64 -d 192.168.1.20 -m 00:0a:f7:ec:08:a8 -t 4 -f 0 -n 0 -b 32;
exit 0;
;;
"-25,6")
export DELAY=10000;
./pktgen_sample05_flow_per_thread.sh -i enp1s0f0 -s 64 -d 192.168.1.20 -m 00:0a:f7:ec:08:a8 -t 8 -f 0 -n 0 -b 32;
#!/bin/bash
#
# Script will generate one flow per thread (-t N)
# - Same destination IP
# - Fake source IPs for each flow (fixed based on thread number)
#
# Useful for scale testing on receiver, to see whether silo'ing flows
# works and scales. For optimal scalability (on receiver) each
# separate-flow should not access shared variables/data. This script
# helps magnify any of these scaling issues by overloading the receiver.
#!/usr/bin/env python
#
from bcc import BPF
import ctypes as ct
# define BPF program
prog = """
#include <linux/sched.h>
#include <linux/bpf.h>
#!/usr/bin/env python
#
from bcc import BPF
import time
# define BPF program
prog = """
#include <linux/sched.h>
#include <linux/bpf.h>
#!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# This is an example of tracing an event and printing custom fields.
# run in project examples directory with:
# sudo ./trace_fields.py"
from time import sleep
from bcc import BPF
import ctypes as ct
@raffysommy
raffysommy / xdp_load_balancer.c
Created March 17, 2018 18:05 — forked from summerwind/xdp_load_balancer.c
XDP based load balancer with L3DSR support
#define KBUILD_MODNAME "load_balancer"
#include <uapi/linux/bpf.h>
#include <linux/in.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
BPF_HASH(counter, uint32_t, long);
@raffysommy
raffysommy / calico.json
Created April 3, 2017 09:44
Json Kubernets Calico
[
{
"action": "get",
"node": {
"key": "/calico/v1/Ready",
"value": "true",
"nodes": null,
"createdIndex": 711,
"modifiedIndex": 711
},
#!/bin/sh
PUBLICIP=$1
wget $2 -O client1.tgz
tar -xzpmvf client1.tgz
sed -i "s/remote.*$/remote $PUBLICIP/g" client.ovpn
openvpn --daemon --config client.ovpn