Skip to content

Networking – General questions

What is a network?

To make it as simple as it can be: One computer wants to talk to another computer. This is the heartbeat of all this. OF course it gets way more complex in real life, but to define what a network is, we need to know the true intention behind this.

If you want to achieve more than two computers talking to each other, that’s where a switch enters the picture. A Switch connects devices on the same network so they can talk to each other.

If one network shouldn’t be enough we have to use another device called a router. A router helps one network talk to another network.

What is a Switch?

A switch is a network device, which lets devices connected to it talk to each other intelligently. And yes intelligently is important here, if you know what was before the switch. The hub was the “stupid” brother of the switch. Instead of deciding who gets which packet, the hub just sends the packets to every device connected. It worked of course, but instead of only one device is getting the message, every device connected to the hub gets it as well, that inefficient and insecure.

A switch fixes that. A switch sends traffic where it actually belongs.

But how does the switch know where to send the traffic, it learns. The switch watches the incoming traffic, looks at the source MAC address and says “this device on this port – got it” Then it stores this information. Later on when traffic comes in for a specific device, the switch checks the destination MAC address and forwards the frame to the correct port.

What is a Router?

So a switch let’s devices talk inside the same network. A router helps devices talk between different networks. That’s the really important part. The isn’t “these devices are on different switches”, the issue is “these devices are on different IP networks”. Here comes Layer 3 of the OSI model into the mix. Cause Layer 3 is where ip addresses live.

The default gateway

This is where the term default gateway finally stops sounding weird. Your default gateway in your local network is usually your router (for example 10.1.1.1). So when we want to talk with someone outside of our network, we don’t try to find the remote MAC address directly. The computer already knows that won’t work. We send the traffic to the router, telling him “Hey, you know how to get there. You take it.”

Meaning your computer is constantly making little decisions like “is this destination local, or somewhere else?”. If it’s local, it uses ARP (Address Resolution Protocol) to discover the other device’s MAC address and give the frame to the switch. If it’s remote it uses ARP to discover the router’s MAC address because the router is the next stop. Same local process, different destination.

What is TCP/IP and OSI?

These two are so called models. The model that won is TCP/IP, also called the TCP/IP stack. This is the practical, real-worlds set of standards modern devices use to communicate.

So why still discuss OSI?

This is the strange part. TCP/IP won, but OSI is still everywhere in networking. OSI is another layered model for describing network communication. The OSI model did not “win” the practical standard, but it indeed won the terminology war.

The different between those two:

  • The TCP/IP model uses 5 layers
  • The OSI model uses 7 layers

So, when I am troubleshooting, I don’t start by panicking and saying “The network is broken”. I start by asking “what layer is failing?” If the cable is unplugged, that’s Layer 1. If the switch can’t forward frames, that’s Layer 2. If the frame gets lost on it’s way, it could be a routing problem, that would be Layer 3.

Leave a Reply

Your email address will not be published. Required fields are marked *