{"action":"created","issue":{"url":"https://api.github.com/repos/Igalia/snabbswitch/issues/3","labels_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/3/comments","events_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/3/events","html_url":"https://github.com/Igalia/snabbswitch/pull/3","id":70708169,"number":3,"title":"Implement basic support for connection tracking","user":{"login":"dpino","id":11567,"avatar_url":"https://avatars.githubusercontent.com/u/11567?v=3","gravatar_id":"","url":"https://api.github.com/users/dpino","html_url":"https://github.com/dpino","followers_url":"https://api.github.com/users/dpino/followers","following_url":"https://api.github.com/users/dpino/following{/other_user}","gists_url":"https://api.github.com/users/dpino/gists{/gist_id}","starred_url":"https://api.github.com/users/dpino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpino/subscriptions","organizations_url":"https://api.github.com/users/dpino/orgs","repos_url":"https://api.github.com/users/dpino/repos","events_url":"https://api.github.com/users/dpino/events{/privacy}","received_events_url":"https://api.github.com/users/dpino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-24T14:45:10Z","updated_at":"2015-04-24T14:56:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Igalia/snabbswitch/pulls/3","html_url":"https://github.com/Igalia/snabbswitch/pull/3","diff_url":"https://github.com/Igalia/snabbswitch/pull/3.diff","patch_url":"https://github.com/Igalia/snabbswitch/pull/3.patch"},"body":"How to run it:\r\n\r\n```\r\nsudo ./snabb snsh apps/conntrack/main.lua\r\nResults written at: /tmp/output.pcap\r\nConntrack:report\r\nTotal connections: 127\r\nTotal packets: 3146\r\n```\r\n\r\nImplements three-way handshake protocol for TCP. Once a three-way handshake between two parties is completed, a new connection identifier is created. A connection identifier is determined by the following tuple: {src-port, src-ip, dst-port, dst-ip}, or the other way around (a connection is bi-directional).\r\n\r\nI modified ```core/app.lua```. All apps that process packets are registered. When ```core/app.lua:report``` is called, it will also call the ```report``` method of all applications called.\r\n\r\nI believe connection tracking shouldn't be an app *per se*, but a library that other apps can use (for instance, DNAT or DPI (deep-packet inspection)).\r\n\r\n* src/core/app.lua: Applications that implement method report(), gets automatically called.\r\n* src/apps/conntrack/conntrack.lua: Basic implementation of connection tracking.\r\n* src/apps/conntrack/input.pcap: Link to techcrunch.pcap.\r\n* src/apps/conntrack/main.lua: Instances a connection tracking object and process reads input.pcap file.\r\n* src/apps/conntrack/techcrunch.pcap: Traffic captured to techcrunch."},"comment":{"url":"https://api.github.com/repos/Igalia/snabbswitch/issues/comments/95955067","html_url":"https://github.com/Igalia/snabbswitch/pull/3#issuecomment-95955067","issue_url":"https://api.github.com/repos/Igalia/snabbswitch/issues/3","id":95955067,"user":{"login":"kbara","id":1588250,"avatar_url":"https://avatars.githubusercontent.com/u/1588250?v=3","gravatar_id":"","url":"https://api.github.com/users/kbara","html_url":"https://github.com/kbara","followers_url":"https://api.github.com/users/kbara/followers","following_url":"https://api.github.com/users/kbara/following{/other_user}","gists_url":"https://api.github.com/users/kbara/gists{/gist_id}","starred_url":"https://api.github.com/users/kbara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbara/subscriptions","organizations_url":"https://api.github.com/users/kbara/orgs","repos_url":"https://api.github.com/users/kbara/repos","events_url":"https://api.github.com/users/kbara/events{/privacy}","received_events_url":"https://api.github.com/users/kbara/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T14:56:30Z","updated_at":"2015-04-24T14:56:30Z","body":"LGTM as a WIP; tell me if you want a more pernickity review."}}