|
|
Log in / Subscribe / Register

A two-part series on LXC networking (Flockport Labs)

Flockport Labs has a two-part "LXC networking superguide" that covers a bunch of LXC networking concepts, as well as practical ideas on connecting containers (Part1 and Part 2). Part 1 starts with an introduction to LXC networking, then moves into extending layer 2 to remote hosts using a layer 3 tunnel. Part 2 looks at using LXC containers as routers. "We are going to create a bridge on 2 remote hosts over their public IPs and connect the bridges with Ethernet over GRE or L2tpv3 so containers connecting to these bridges are on the same layer 2 network. We will first show you how to do this with Ethernet over GRE and then L2tpv3. The main difference is Ethernet over GRE is less well known while L2tpv3 is more widely used for l2 extension and uses UDP, and thus could be more flexible."

to post comments

A two-part series on LXC networking (Flockport Labs)

Posted Jan 23, 2015 21:21 UTC (Fri) by Lennie (guest, #49641) [Link] (9 responses)

Why do people have this fascination with L2 networking ? Instead of just plain routing on the host, just use a routing protocol to have the the hosts discover the IP-ranges ranges on the other hosts ?

Is it because infrastructure people think developers don't understand networking and want to simplify it by using L2-networking ? Or think developers are lazy ?

Or is it developers trying to do networking and not understanding how to do it ?

I mean slightly smart lazy developers use service discovery to talk to other services. Which makes the IP-addresses used irrelevant.

For stateless (microservices) this is obviously easy, maybe they still have problems with stateful services ? Like databases. So maybe even if they move the container to an other machine they need to keep the original IP-address ?

If that last bit is never a requirement, then I wouldn't know why you'd need L2.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 23, 2015 22:19 UTC (Fri) by raven667 (subscriber, #5198) [Link]

> Why do people have this fascination with L2 networking

Because it requires less state on the endpoint server host, there are standard discovery protocols to find layer2 neighbors and safely pass traffic on a layer2 path without loops, you can easily move an IP between nodes and even sites and the network will almost instantly relearn the path without the application needing to do anything or even lose TCP connections. Learning a different IP for a service requires much more interaction from higher layers in the stack such as the application and only makes sense if you think you should be writing a bunch of new code rather than just using the well worn working systems that already exist.

> So maybe even if they move the container to an other machine they need to keep the original IP-address ?

Yes, absolutely, this needs to work reliably not only across a single cluster but across different datacenters as well for maximum effect.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 23, 2015 22:20 UTC (Fri) by dlang (guest, #313) [Link]

I hate to say it, but most developers actually don't understand networking.

And the problem with using some discovery process is that the discovery is expensive, and so the result is always going to be cached somewhere (and frequently it ends up being cached at multiple levels), even if it's not cached, there's a race condition between updating the discovery source of truth and moving the service.

So moving the service and keeping it on the same IP address is a very practical win in terms of simplicity and reliability.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 23, 2015 22:21 UTC (Fri) by gerdesj (subscriber, #5446) [Link] (4 responses)

"Is it because infrastructure people think developers don't understand networking and want to simplify it by using L2-networking ? Or think developers are lazy"

No (I for example don't) but they do have a habit of creating things that want to live in L2 land. eg Elasticsearch systems automatically cluster if you rub them together on the same collision domain.

Anyway, I don't think this is a bad thing but it's nice to have the flexibility to do either or both.

"Stretched trombone" anyone 8)

A two-part series on LXC networking (Flockport Labs)

Posted Jan 23, 2015 23:54 UTC (Fri) by tobby (guest, #100752) [Link] (3 responses)

Thanks for posting this! We have been exploring container networking and this post was meant to consolidate all we have learnt and touch on a few new areas hence the Flockport labs monicker. Most of this stuff is of course old hat for the readers here.

Flockport is actually about providing ready to deploy instances of web stacks and various apps based on LXC containers, and getting more users excited about the ease, flexibility and portability of LXC containers.

We covered layer 3 tunnels with Ipsec, Tinc, GRE in our previous posts. Layer 2 extensions appear not to recommended by most networking gurus because of increased complexity and this was just about putting all the options out there along with the caveats.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 28, 2015 17:49 UTC (Wed) by idupree (guest, #71169) [Link] (2 responses)

Would you mind linking to your posts about layer 3 Ipsec, Tinc, GRE? I wasn't sure which posts you mean.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 30, 2015 13:12 UTC (Fri) by tobby (guest, #100752) [Link] (1 responses)

Hi idupree, they are linked in the second paragraph of the post and are in the Documentation page under LXC Guides.

I am not sure if its appropriate to post so many links but here they are. Mods please feel feel to delete the below

Connect LXC containers across hosts with IPsec VPNs

Connect LXC hosts with IPsec VPNs

Connect LXC hosts with GRE Tunnels

Connecting LXC containers across hosts with Tinc VPNs

Connecting LXC hosts with Tinc VPNs

A two-part series on LXC networking (Flockport Labs)

Posted Jan 30, 2015 14:47 UTC (Fri) by idupree (guest, #71169) [Link]

Thank you!

A two-part series on LXC networking (Flockport Labs)

Posted Jan 24, 2015 8:45 UTC (Sat) by ms (subscriber, #41272) [Link]

Slightly repeating points made earlier: doing discovery of other services implies some sort of database that keeps track of where everything is - dynamic DNS at a minimum. That isn't necessarily the problem. The problem comes much more when you try to scale to lots of machines with different providers, in geographically very different locations, dynamic provisioning of machines, changing IPs etc, and you want: i) all private traffic between containers on these machines kept private (i.e. encrypted); ii) a few public IPs that actually represent the service being offered but are internally routed to a changing set of machines; iii) the ability to scale the various different subservices up and down without manually editing configuration files. Really, at the end of the day it just comes down to another layer of indirection and abstraction: you can hide some of the changing complexity of the exterior and avoid those messy details leaking into the configuration of your services. It gets you decoupled from the specifics of your deployment.

Also, sometimes you need features that the "real" network isn't providing. For example, with weave, you end up with an overlay network that supports multicast even if the "real" network doesn't, copes with different MTUs in different parts of the "real" network very well, does encryption at the network layer so for some applications you won't need to configure every service with its own crypto, does multi-hop routing, and copes with failure very well.

A two-part series on LXC networking (Flockport Labs)

Posted Jan 28, 2015 0:06 UTC (Wed) by caitlinbestler (guest, #32532) [Link]

There are numerous advantages to using L2 networking if your software switch properly understands datacenter bridging.

Of course since very few software engineers understand advanced switch theory it is not surprising that most softswitches share that lack of understanding.

A two-part series on LXC networking (Flockport Labs)

Posted Feb 25, 2015 12:44 UTC (Wed) by JamesChen6681 (guest, #101084) [Link]

Dears,

I have to know how to implement ethernet over GRE?
Any help would be appreciated.


Copyright © 2015, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds