Try   HackMD

How to Set Up a Website on ESP32 - Week 5

Review the Basics Concepts of Networking

How does Network work?

Let's review the content from the first and second weeks of the courses.
The reason why networks can communicate mutally is that they are all connected to each other.

image
image

And 中華電信 plays the role of an ISP.
The data is transmitted to WAN (Wide Area Network) through 中華電信 and other cable companies.

 

Typical Setup

Typically, there is a device at your house called modem, which is provided by 中華電信, often referred to as "小烏龜"

image

 
Modem is connected to the home's Wi-Fi router.

image
If there are more network ports needed in the house, a switch is added.
image

So, the setup would look like this:
Modem -> Switch -> Wi-Fi Router

Basic Concepts of Networking

When transferring data from A to B, there are some information required to deliver the data successfully. We can liken data transmission to online shopping.

Internal Server Routing

  • Analogy :
    When you order a computer online, the item will be picked from the warehouse and loaded onto a truck.
  • Practical :
    Similarly, in networking, what we call "packet" corresponds to the package. When a server receives a request, it sends the packet to the modem.

Public Network Routing

  • Analogy :
    Once your package is on the truck, it carrys the package and travels on the highway.
  • Practical :
    For the network, this operation occurs in 中華電信 's backbone network for packet transmission.

Packet Arrival at the Client

  • Analogy :
    Finally, when the truck gets off the highway and arrives at your house, you carry the computer to your room.
  • Practical :
    The packet is transmitted to the modem at your home and reaches your computer.

Question

During the entire process, how does the deliveryman know the location of your house? It's the address you enter when placing the order that provides the information.
Similarly, we must provide basic information to send the packets.

In the world of networking, this address is called
IP (Internet Protocol).

But with so many people in the house, how does the deliveryman know who is the receiver? This is when he asks your name.
Likewise, after the packet arrives at the modem in your home, it asks the network devices in your home whose packet it is.

In the network world, the name is called
MAC address.