Skip to content

Instantly share code, notes, and snippets.

View pchaigno's full-sized avatar

Paul Chaignon pchaigno

View GitHub Profile
@pchaigno
pchaigno / minimize-pkt-losses.lua
Last active January 16, 2020 13:06
A MoonGen script that attemps to achieve the highest throughput supported by DUT while minimizing packet losses.
local mg = require "moongen"
local lm = require "libmoon"
local memory = require "memory"
local device = require "device"
local stats = require "stats"
local limiter = require "software-ratecontrol"
local pcap = require "pcap"
function configure(parser)
parser:description("Attemps to achieve the highest throughput supported by DUT while minimizing packet losses.")
@pchaigno
pchaigno / lock-down-gke.yaml
Created July 21, 2020 06:40
CiliumClusterwideNetworkPolicy to lock down GKE nodes with the host firewall.
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
description: "Lock down nodes on GKE. USE AT YOUR OWN RISK."
metadata:
name: "lock-down-gke"
spec:
nodeSelector:
matchLabels:
type: worker
ingress:
@pchaigno
pchaigno / packetdrop-xfrm.py
Last active October 1, 2021 14:02
Script to trace packet drops from Linux's xfrm layer
#!/usr/bin/python
# Copyright (c) Isovalent, 2021.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
import ctypes as ct
import time
import socket
import struct