Grasping Computer Networking - Bottom-Up Approach.

1/ Computers can talk only to their neighbors!

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
 

Keep Current with Ivan Velichko

Ivan Velichko Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @iximiuz

20 Dec 20
The great rise of cloud-native projects (thread).

Microservices don't solve any technical problems. Instead, microservices are trying to solve org challenges.

...by turning org problems into new tech challenges.
In accordance with the complexity conservation law, microservice architectures should be bringing a lot of new problems yet to be solved.

ferd.ca/complexity-has…
Thesis: the goal of the majority of the CNCF projects is to solve those technical problems originated by the microservice transition.

landscape.cncf.io
Read 9 tweets
19 Dec 20
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).
Read 5 tweets
18 Dec 20
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!

opencontainers.org
OCI contains two specifications: the Runtime Specification (runtime-spec) and the Image Specification (image-spec).
Read 14 tweets
12 Dec 20
One of the Kubernetes superpowers is how it tackles the networking problem. Here is my approach to gaining a comprehensive understanding of the topic.

1. Learn the super-simple Kubernetes Network Model: much like VMs, every Pod gets its own IP address.

kubernetes.io/docs/concepts/…
2. Learn that achieving simplicity is hard:

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.

iximiuz.com/en/posts/conta…
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.

kubernetes.io/docs/concepts/…
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!