DEV Community

Cover image for Kubernetes Networking for beginners (part 1)
Krishnamohan Yerrabilli
Krishnamohan Yerrabilli

Posted on

Kubernetes Networking for beginners (part 1)

Introduction

Networking is one of the most important topics in kubernetes and it was was created to run distributed systems over a cluster of machines. Distributed systems make networking a central and necessary component of implementation, because of this it's crusial to understand how kubernetes facilitates communication inside of the cluster and how external traffic interact with k8s eco-system, I'll make you understand how this things possible with 11-indepth diagrams, before we dive in we want to have a good understanding of networking terminologies.

Basic terminologies

IP address

It is an 4 decimals number separated by periods, for example it's look this 142.250.192.132/24, it is by default whatever device or any other network capable system will be assigned an Ip address from the network provider such as ISP(Internet service provider(jio/airtel/ACT fiber)), the ip is used to find out a particular device in the network either it's a LAN/WAN

Port number

Ok we got the information we needed from the internet to the device we are using, but how the device(kernel) knows which application is requesting this particular information, this is were PORT numbers comes into play, there are set of port numbers are designated to each and every application, for example you're google chrome has a different port number, your database has different port number, whatsapp has a different port and so on, and that's how kernel knows what is the right application is requesting this info and sends it, one quick note you maybe heard about sockets, so what are those, its is your ( IP + port number ) called as socket.

MAC address

Technically called as Media Access Control its a 12 digit hexa-decimal number, and it is tied to the Network Interface Controller (NIC) and it is a sub component of larger device called as NIC(Network Interface Card) this were you connect the internet from like you plugin a ethernet cable, wifi or any other interface, it is fixed to your physical machine, and it is unique to every device in the world.

Router

A router is a mediator between a intranet(inner network) such as organisational network and a outer network such as internet(collection of inter-connected computers), router seats between this two of those
while taking the user request and forward to the appropriate DNS server and get the response back to the client to serve the request

ARP server

Imagine you have 10 devices connected to your network from the help of your router, whenever a packet comes from outer network(WAN) to LAN, how the router knows what's is the appropriate device to send this packet, this is where ARP (Address resoultion protocol ) comes into picture it is a procedure which powers the internet from the early 1980's, it is basically a translator which maps your IP address to MAC address of your machine

It stores all mac address of its Network such as LAN or you're home network, whenever the router needs MAC address the router makes a request to the ARP server to get the MAC address, and the ARP gives the response back to the router, and then the router knows which device is requesting the information.

DNS Server

Computers doesn't understand human languages they only knows numbers, in a high level context Domain name system is a server that maintains all domain address and their IP address, for example domain name is (www.google.com) and it's assigned a IP address (142.250.205.228) this two are stored in the DNS server, Whenever a user or a host requsts a service from a domain, this requests forward to DNS so it can find the right IP address which is then the request goes to the right server, try to paste the above ip address in search bar and see the magic

Image description

Top comments (0)