Skip to content

Examples

Daniel Duclos-Cavalcanti edited this page Sep 20, 2024 · 14 revisions

0. Submodule

  1. Clone repo with Submodule
git clone --recursive https://github.com/duclos-cavalcanti/msc-thesis.git
 # recursive flag needed to include submodule
  1. Update submodule
git add jasper
git commit -m "Updated submodule"
git push origin main

1. Heuristic

2. LemonDrop

3. Jasper

Actions

  1. Create Template
git checkout uab
cd gcp-deploy
python3 run.py create-template -r 10 -p 3 -b 2 -c 1 -rm socket -dm standard -conf 0
  1. Deploy Stack
git checkout uab
cd gcp-deploy
python3 ./run.py deploy-stack
  1. Deploy Stack
git checkout uab
cd gcp-deploy
python3 ./run.py delete-stack
  1. Client Program

    1. cd into the correct directory
    sudo su 
    cd /home/uab2005/dom-tenant-service/src
    1. MAC collection
    ./build/multicast_client -a mac -t 10 -i 0 -s test
    
    1. Run experiment
    ./build/multicast_client -a messages -t 10 -i 0 -s test
    
  2. Proxy/Recipient Program

sudo su 
cd /home/uab2005/dom-tenant-service/src
./build/multicast_<proxy/receiver> 0 1 dpdk 2 0 3 gcp
  1. Startup Logging
  • GCP:
sudo journalctl -f -u google-startup-scripts.service`
# sudo systemctl restart google-startup-scripts.service
  • AWS:
tail -f /var/log/cloud-init-output.log`

4. Debugging

Connectivity

  1. Option: nc and ping
# 1. ssh into node 1 
# 2. ping <ip address of node 2> # 192.168.1.2
ping 192.168.1.2

# ---------------

# 1. ssh into node 2
# 2. Using `nc` to listen on a specific port and ip: nc -l -p <port> -s <ip>
nc -l -p <port>
  1. Option: nc
# 1. ssh into node 1 
# 2. establish connection to node 2: 192.168.1.2
nc <IP address> <port>

# ---------------

# 1. ssh into node 2
# 2. Using `nc` to listen on a specific port and ip: nc -l -p <port> -s <ip>
nc -l -p <port>


# Anything you type on either side will be seem on the other node, if 
# the connection is successful.

# For UDP, simply pass the -u option to netcat (nc)
  1. Option: nc and tcpdump
# 1. ssh into node 1 
# 2. establish connection to node 2: 192.168.1.2
nc <IP address> <port>
# Write stuff

# ---------------

# 1. ssh into node 2
# 2. Using `tcpdump`: tcpdump <udp> port <port>
tcpdump port <port>
  1. Option telnet
telnet <ip> <port>
  1. tc disc
#  100ms delay:
sudo tc qdisc add dev eth0 root netem delay 100ms

# adds delay with variation (e.g., 100ms ± 20ms)
sudo tc qdisc add dev eth0 root netem delay 100ms 20ms

# adds delay with correlation (e.g., 100ms ± 20ms with 25% correlation)
sudo tc qdisc add dev eth0 root netem delay 100ms 20ms 25%

# packet loss
sudo tc qdisc add dev eth0 root netem loss 1%

# packet duplication
sudo tc qdisc add dev eth0 root netem duplicate 1%

# packet corruption
sudo tc qdisc add dev eth0 root netem corrupt 1%

Sockets

  1. netstat: Can be used to evaluate if a given port is being used and by which process.
  • Examples:
    • (i)
    sudo netstat -tulpn
    
    • (ii)
    sudo netstat -tulpn | grep :34260 # grepping for a specific port
    
  1. lsof: Lists open file descriptors, useful after getting a pid from netstat to evaluate what a process is doing with it's given file descriptors.
lsof -i "$pid"
lsof -p "$pid"
  1. ss: Very similar to netcat.
sudo ss -ltnp | grep ':8080'

Dockers

  1. Retrieve IP addresses of docker instances:
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)

Output:

/receiver - 172.17.0.5
/sender - 172.17.0.6
/manager - 172.17.0.4
/web-serve-blog - 172.17.0.2
/dpdk-dev - 172.17.0.3
  1. Remove danlging images
docker images -qf "dangling=true" | xargs docker rmi

Clone this wiki locally