===== DeltaShaper ===== Video Stream Synthesis for Internet Censorship Circumvention The machine used for development is a 32bit Ubuntu 14.04 LTS VM. Start by reading how we are able to set up a virtual camera device in [[video:v4l2loopback]] and a video pipeline (with [[video:ffmpeg]]) to feed it. ===== Index ===== **Evaluation** - On how to encode the payload - [[covert:encoding]] - On how to evaluate the system - [[evaluation:metrics]] **Implementation** - Transmitting Video - [[video:v4l2loopback]] - [[video:ffmpeg]] - [[video:snowmix]] - Setting up the covert channel - [[covert:encoding]] - [[covert:sampling]] - [[covert:error_correction]] - Sampling traffic - [[sampling:wanemulator]] - [[sampling:trafficcontrol]] - Datalink Layer - [[datalink:network_containers]] ===== To Do ===== - Error measurements; - Adjust ReedSolomon accordingly; - Throughput tests with FTP, WGET, SMTP, TELNET ==== Optimizations ==== - Lost frame retransmission; - Adjust framerate; ==== Adaptive Control ==== - Have a process compute the EMD in fixed intervals (ex 30s) and adjust parameters (cell size, payload area, framerate, etc) ===== Cheat Codes /Bug Tracker ===== - Login grace time for telnet is raised so that a DS-carried session has enough time to connect. ===== Pipeline =/= ===== It would be nice for the evaluation to have consistent results between (just) ffmpeg baseline runs and DS generated baselines for calibration purposes. Matching FPSs on both pipelines is fundamental so that results come near each other. - Snowmix Pipeline was set to 25 FPS. - TransmissionThread (data overlays) was set to 30 FPS. - InputScript (background video) was set to 25 FPS (the same as Snowmix). - Output ffmpeg was set to 30 FPS (introducing double frames if needed). The issue with this setup is twofold: - A 30fps background video would have dropped frames, which would mean some doubled frames on ffmpeg output (to compensate 5 missing frames). - All Snowmix output was capped to 25 fps, also affecting TransmissionThread 30fps output (although this was not a big deal). Solution: To run Snowmix pipeline at 30 fps, matching the benchmarks framerate. Problem: CVideoOutput out of shm buffers. Setting m_got_no_free_buffers flag. This happens when the output script cannot handle output flushing. Although the output script pipeline was emmiting at an increased 30fps rate, it was somehow unable to deliver to consumer on time. This output script was simple and fast writing to the pipe that connects it to ffmpeg. The problem then resided on the ultimate ffmpeg consumer. By reading the input pipeline with the "-re" option, ffmpeg was supposed to emulate a live video source. FFMPEG documentation seems quite contradictory at this point. "-re" works as it should shall the input video be already recorded into a file and respects its encoded framerate. For a pipe approach as we were doing, ffmpeg should be allowed to read input "asap". Indeed, this speeds up the consuming process (while it is still limited on snowmix output speed) and allowed Snowmix to work as intended at a 30 fps rate. ===== Dependencies ===== - Calibrator script (.py) -python "dpkt" -python "numpy" -python "pyemd" -Video Processing Suites: -ffmpeg -gstreamer -snowmix -ImageProcessing Suites: -openCV (no hard dependency, maybe replace by LodePNG) -png++ (c++ wrapper for libpng) -libnetfilter_queue: provides userspace API to packets that have been queued by the kernel packet filter -requires libnfnetlink