Giter VIP home page Giter VIP logo

mahimahi's People

Contributors

anirudhsk avatar brucespang avatar deepakn94 avatar dterei avatar frankw2 avatar greghill avatar joerango avatar keithw avatar leitao avatar ravinet avatar robfig 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mahimahi's Issues

For replayshell: Hostname lookups can be slow

When I'm connected to MIT Wi-Fi, /etc/resolv.conf contains other nameservers. These are not available inside replayshell but they're tried anyway, resulting in hostname lookup times of 5+ seconds. Therefore, page load times of URLs with hostnames are much higher than URLs with direct IP addresses. This can be manually fixed by making sure that /etc/resolv.conf is blank.

Search for a pair of unused IP addresses and name for "egress"

DelayShell should search for a pair of IP addresses that are unused for the ingress and egress, rather than hardcoding two specific IP addresses. This will allow us to nest one program inside another (e.g. cellsh inside httpreplaysh).

The IP address search should start at 100.64.0.1 and end at 100.64.0.255 (Carrier-grade NAT range).

We should use the getifaddrs() function to list the interfaces on the machine and their addresses.

We should also pick a name for the egress interface that's not just "egress", because that might be taken (if multiple users are running delayshell at the same time). Probably just doing egress + pid is a good idea.

DNS proxy

Delayshell needs to ferry DNS traffic between the container and the host. We should:

  • outside the container, listen on UDP and TCP ports
  • inside the container, listen for UDP and TCP traffic on port 53
  • inside the container, send the UDP datagrams and TCP traffic to the egress IP address (on the ports previously opened)
  • outside the container, receive traffic and resend it to 127.0.0.1, port 53 (to the local nameserver)
  • outside the container, proxy the reply back to the source

Shouldn't the ingress tun device have a unique ID attached to it, as well?

If I run the following sequence of commands:
delayshell 2
screen
Ctrl-A Ctrl-D (detaches from screen)
delayshell 2
ifconfig

Now, in a new terminal:
screen -r
ifconfig

Both ifconfigs show an "ingress" tun device. Wondering if this will lead to trouble later on. Maybe not because they are in separate network namespaces?

On an additional cosmetic note, screen -r doesn't return our cool "[delay 2]" prompt, and uses the standard bash login prompt instead.

Change from tundevices to venet

Venet is two tun devices directly connected, where one is inside and one is outside. This way, we don't have to deal with ferrying packets from tun device (and adding delay) since delay is 0.

Be setuid root, and drop privileges inside child process

(1) Edit Makefile.am to make the program get installed setuid root. (Add chmod u+s $(bindir)/delayshell as an install hook?)

(2) Make the child process drop privileges immediately after executing unshare.

(a) Change group first.
(b) Then change UID.
(c) The Internet will have instructions on how to do this.

Parent should drop privileges

Wrapping call to eventloop, parent should

(1) Create ChildProcess
(2) (Inside ChildProcess: drop privileges, then run eventloop)
(3) wait for ChildProcess to finish

locking up with netperf

I can lock it up with netperf in a matter of seconds on
3.11.0-19-generic #33-Ubuntu SMP. Which is too bad as toke is making
huge progress with netperf-wrapper and a new gui...

I setup two delay shells, then start netserver in one, and try to connect to the
other. Fire up netperf -H 10.64.0.2 and inside of a few thousand packets, it
hangs...

[delay 10 ms] d@nuc:~/git/mahimahi$ ifconfig
ingress Link encap:UNSPEC HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:100.64.0.2 P-t-P:100.64.0.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:6627 errors:0 dropped:0 overruns:0 frame:0
TX packets:4376 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:9929172 (9.9 MB) TX bytes:248836 (248.8 KB)

other window:

d@nuc:/git/netperf-wrapper$ delayshell 10
[delay 10 ms] d@nuc:
/git/netperf-wrapper$ netperf -H 100.64.0.2
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
100.64.0.2 () port 0 AF_INET : demo

Delete all the test programs

(hello, unsharenet, forktest, simple-ferry)

Including where they're mentioned in Makefile.am, and all their source files that aren't used elsewhere.

Handle UDP datagrams

Want to use dnat and then receive UDP datagram, obtain original destination, and handle request in new thread (create socket, send datagram, receive response, ferry back to original source). This is similar to how we handle UDP DNS.

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.