What is a neighbor? It's a network node residing on the same Layer 2 segment.
Curious, what is an L2 segment? Then read on!
A simplest possible example of an L2 segment is a point-to-point connection of two computers (as above).
But to interconnect multiple computers, an additional multi-port device is needed.
For wired networks, such a device is called "switch" or "bridge".
There are lots of switches in data centers. But you probably have one at home too.
It's your Wi-Fi router! See those RJ45 ports on the backside? Then it's not a router but a bridge combined with a router.
Switches have a limited number of ports. So, often multiple switches are interconnected to make a bigger L2 segment.
However, logically it's a flat structure:
2/ Nodes on L2 segment exchange frames, not IP packets!
Frames have a fairly simple format:
3/ Two types of communication are possible in an L2 segment.
- Ad-hoc (using destination's MAC address) - a frame is delivered only to a single destination node.
- Broadcast (using a special ff:ff:ff:ff:ff:ff destination MAC) - a frame is delivered to every node of the segment.
4/ Unique MAC addresses assigned by hardware vendors and L2 broadcasting are super-handy.
...because they simplify life for higher-layer protocols.
5/ IP (Layer 3) protocol heavily relies on L2 capabilities.
How to talk to a neighbor knowing only its IP address?
Send a broadcast "Who has 192.168.0.5?" frame first.
A good neighbor would reply. And the source MAC of the reply will be your destination. Then encapsulate IP!
6/ To send IP packets between L2 segments you need a router.
A router is a multi-home node that resides on (at least) two network segments at the same time.
To send an IP packet to an arbitrary computer on the Internet, you first need to send it (wrapped into an Ethernet frame) to your local router.
The local router always resides on the same L2 segment as you do. So, it's no different from talking to any other neighbor.
The router then extracts the IP packet from the frame and resends it to the right network segment (following the described L2 communication procedure).
The actual path of a packet will consist of a series of such routers, called hops.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Kubernetes is a Distributed Operating System (thread):
1. One of the primary goals of a traditional operating system (e.g Linux) is to share a machine's resources between apps. While "Kubernetes is all about sharing machines between applications."
2. An operating system gives you a handy way to launch your apps. So does Kubernetes.
3. An operating system gives you a handy way to install apps. So does Kubernetes (through raw YAML or a package manager like Helm).
Kubernetes is deprecating Docker as a container runtime after v1.20. But nobody cares. Why? Because images built with Docker will keep working on Kubernetes.
So does images created with Podman and most of the other build tools around. Why? Because of the great standardization effort called OCI!
2.1. Networking on a single Node. How containers communicate within a Pod, how Pods talk to each other within a Node. Long story short, it's all about Linux namespaces and network virtualization capabilities.
2.2. Cross-node Pod-to-Pod networking. Kubernetes demands that every Pod should get its own IP. But it doesn't say how. Makes sense actually, because it's highly infra-specific. Use a plugin like Flannel or Calico instead. Keyword - overlay networks.