{"action":"created","issue":{"url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/33","labels_url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/33/comments","events_url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/33/events","html_url":"https://github.com/projectcalico/calico-kubernetes/issues/33","id":104640945,"number":33,"title":"Understanding Networking","user":{"login":"Smana","id":4101366,"avatar_url":"https://avatars.githubusercontent.com/u/4101366?v=3","gravatar_id":"","url":"https://api.github.com/users/Smana","html_url":"https://github.com/Smana","followers_url":"https://api.github.com/users/Smana/followers","following_url":"https://api.github.com/users/Smana/following{/other_user}","gists_url":"https://api.github.com/users/Smana/gists{/gist_id}","starred_url":"https://api.github.com/users/Smana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smana/subscriptions","organizations_url":"https://api.github.com/users/Smana/orgs","repos_url":"https://api.github.com/users/Smana/repos","events_url":"https://api.github.com/users/Smana/events{/privacy}","received_events_url":"https://api.github.com/users/Smana/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-03T07:50:49Z","updated_at":"2015-09-03T19:23:30Z","closed_at":null,"body":"Hello,\r\n\r\nSorry to bother you again but i'd like to have more information on how is configured a pod's networking.\r\nI already have a kubernetes cluster working with calico and deployed with Ansible.\r\n\r\n* I've understand that every container has an ip from a calico pool (stored in etcd), and there's a specific route for each pod. These ip are distributed with bgp (bird) to all the nodes.\r\n\r\n* But more precisely, what happens when i create a pod ?\r\n\r\n* What is the process in charge of creating the interface calixxxxx ?\r\n\r\n* What kind of interface is it ? i expected it to be a veth.\r\nBut from my understanding a veth comes in pairs one attached to the default namespace and another one in the container namespace. But there's only one network namespace.\r\n```\r\nip netns list\r\n```\r\n\r\n* What is excatly the purpose of the bridge cbr0 ?\r\n```\r\nbridge name\tbridge id\t\tSTP enabled\tinterfaces\r\ncbr0\t\t8000.000000000000\tno\r\n```\r\n\r\n* How is configured the networking inside the pod ?\r\n\r\n* I've notice that every interface calixxx has the same ip\r\n```\r\n5: cbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default \r\n    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff\r\n    inet 10.233.1.1/24 scope global cbr0\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::10eb:6ff:fedf:9583/64 scope link \r\n       valid_lft forever preferred_lft forever\r\n9: calic5d012a84ff: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\r\n    link/ether 26:fc:40:73:c9:9c brd ff:ff:ff:ff:ff:ff\r\n    inet 10.115.77.87/32 scope global calic5d012a84ff\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::24fc:40ff:fe73:c99c/64 scope link \r\n       valid_lft forever preferred_lft forever\r\n15: califb85ed004ff: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\r\n    link/ether 7a:bd:cc:6d:d3:f3 brd ff:ff:ff:ff:ff:ff\r\n    inet 10.115.77.87/32 scope global califb85ed004ff\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::78bd:ccff:fe6d:d3f3/64 scope link \r\n```\r\n\r\nIt is the gateway for the other nodes to reach the pods.\r\n```\r\nkubenode-2 ~ 0 # ip r\r\ndefault via 10.115.255.253 dev eth0 \r\n10.0.0.0/8 via 10.115.255.254 dev eth0 \r\n10.115.0.0/16 dev eth0  proto kernel  scope link  src 10.115.77.88 \r\n10.233.0.0/24 via 10.115.77.86 dev eth0  proto bird \r\n10.233.1.0/24 via 10.115.77.87 dev eth0  proto bird \r\n10.233.1.2 via 10.115.77.87 dev eth0  proto bird \r\n10.233.1.3 via 10.115.77.87 dev eth0  proto bird \r\n10.233.1.4 via 10.115.77.87 dev eth0  proto bird \r\n10.233.1.5 via 10.115.77.87 dev eth0  proto bird \r\n```\r\nSo i guess that when a packet arrive it is passed to the right interface based on mac address ? right ?\r\n\r\n* How are the packets forwarded to the pod ?\r\n\r\nThank you,\r\nSmana"},"comment":{"url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/comments/137547715","html_url":"https://github.com/projectcalico/calico-kubernetes/issues/33#issuecomment-137547715","issue_url":"https://api.github.com/repos/projectcalico/calico-kubernetes/issues/33","id":137547715,"user":{"login":"Symmetric","id":1524910,"avatar_url":"https://avatars.githubusercontent.com/u/1524910?v=3","gravatar_id":"","url":"https://api.github.com/users/Symmetric","html_url":"https://github.com/Symmetric","followers_url":"https://api.github.com/users/Symmetric/followers","following_url":"https://api.github.com/users/Symmetric/following{/other_user}","gists_url":"https://api.github.com/users/Symmetric/gists{/gist_id}","starred_url":"https://api.github.com/users/Symmetric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Symmetric/subscriptions","organizations_url":"https://api.github.com/users/Symmetric/orgs","repos_url":"https://api.github.com/users/Symmetric/repos","events_url":"https://api.github.com/users/Symmetric/events{/privacy}","received_events_url":"https://api.github.com/users/Symmetric/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T19:23:30Z","updated_at":"2015-09-03T19:23:30Z","body":">> But from my understanding a veth comes in pairs one attached to the default namespace and another one in the container namespace. But there's only one network namespace.\r\n\r\n>Your understanding here is correct. Off the top of my head, I'm not sure why they don't show up in ip netns list - @Symmetric any idea here?\r\n\r\nOnly named namespaces are shown by `ip netns list`. These are namespace fds that are created (or more commonly linked to) in `/var/run/netns/`.\r\n\r\nAll of the namespaces we create are in `/proc/<pid>/ns/net`, i.e. unnamed namespaces."}}