August 2015: Reflection and SDN

Food at 6:30 pm. Please RSVP at Meetup or Google+.

News and Talks at 6:45.

Talks

Introduction to Reflection

Nicholas Boers gave an introduction to reflection, motivated by a real problem: loading text configuration files with gcfg left him creating structs and setting default values outside them. He reviewed Go's type system — static types, zero values, and how an interface value stores a (type descriptor, value) pair — noting that non-interface types describe data while interface types describe behavior (such as io.Reader/io.Writer). Reflection is simply the mechanism for examining that type-and-value pair at runtime through the reflect package. He then worked through two examples: an isZero function that reports whether a value is its type's zero value, and setDefaults, which walks a struct with reflection and fills fields from a default struct tag — the idea he originally wanted.

Key points:

  • Motivation: avoid duplicating struct defaults when loading config.
  • Non-interface types describe data; interfaces describe behavior.
  • An interface value holds a type descriptor and a value.
  • Reflection inspects that pair via the reflect package.
  • isZero detects zero values generically.
  • setDefaults recursively initializes fields from default struct tags.
  • Struct tags (as with encoding/json) make reflection-driven configuration possible.

Nicholas Boers (slides)

Software Defined Networking

Gerrit Renker and Curtis Collicutt introduced software-defined networking and why containers need it. They explained SDN's core idea — separating the control plane from the data plane and centralizing control (OpenFlow) — along with overlay networking technologies like VXLAN and GRE that tunnel virtual networks over the physical one. After covering container basics (Docker vs LXC, namespaces, cgroups, orchestration), the talk traced how Docker's networking evolved from the pipework shell script through tenus and libcontainer to the vishvananda/netlink library and docker/libnetwork. The demo used the Go netlink library to configure bridges, interfaces, and GRE tunnels that connect containers across hosts, concluding that SDN is young, Go is well placed for it, and that "SDN is Startup Defined Networking".

Key points:

  • SDN separates the control plane from the data plane (OpenFlow).
  • Overlays (VXLAN, GRE) tunnel virtual networks over the physical one, escaping VLAN limits.
  • Containers need networking across hosts, with multi-tenancy and segregation.
  • Docker networking evolved from pipework to vishvananda/netlink and libnetwork.
  • Go's netlink library can add links, addresses, and routes.
  • The demo built bridges and GRE tunnels to connect containers across hosts.
  • Go can use the same netlink/iproute2 plumbing Docker does.

Gerrit Renker and Curtis Collicutt

presentation

What's New in Go 1.5

Matthias Stone

News and Articles

Online Talks

Learning Resources

Events