官术网_书友最值得收藏!

Local network

Let's assume that a packet has arrived at your router. It's crucial to understand what exactly is going on and how the router decides the destination of the packet. In your local network (your home), there may be 10 devices such as tablets, smartphones, PC, and laptops. The router has to decide in which of them it should send the packet. This is done with the Network Address Translation (NAT) protocol. So somehow it chooses one device and it sends the packet. Every single device in your home has an IP address. It is not the same as your home IP address that we mentioned earlier. When you connect a device in your local network (router), it automatically gets an IP address such as 192.168.1.101.

To sum up, the internet consists of clients (homes) and servers (endpoints). For example, a client is your home and a server is https://www.facebook.com. A client is connected to the server through some nodes (switches) usually with cables and there are plenty of them out there. What we described earlier is the internet. Going further, the local network consists of a switch, which in this case is called router and some devices such as your smartphone or laptop. Your router is responsible for delivering anything that comes to your home to the appropriate device. Your router and every single device has an IP address.

The structure of your local network is a tree. This means that everything starts from the router and expands. You may have another local network in your garage or in your yard. For example, you can see in the following screenshot that my network consists of some devices and another switch which consists of some more devices.

In the following screenshot, we can see a page of my router and it must be crystal clear that apart from the Wi-Fi there are two Ethernet ports enabled of which one is connected to a computer and the other to something called a switch that has two devices. The first one is again a computer and the second is our Raspberry Pi Zero W. You can find the IP of the Raspberry Pi in the following screenshot:

Your Raspberry Pi Zero W will be one device connected to your router and will have an IP address like every other device. This device depends on your router. Usually, the IP addresses in your home will be of the format 192.168.1.X, where X is in the range of 1 to 254, but even if the numbers differ, the idea is the same. Usually, since the router is the first device connected to the internet, it has an IP address 192.168.1.1, the second device may have 192.168.1.2, the third device 192.168.1.3, and so on as you can see in the upcoming image my raspberry, which has the IP 192.168.1.101. All of the preceding information is important because we will connect to our Raspberry Pi using SSH over the network. But of course to connect to it we will have to find it first.

主站蜘蛛池模板: 兰考县| 舞钢市| 民和| 漳州市| 紫云| 仙游县| 平罗县| 二连浩特市| 大埔区| 札达县| 塔城市| 义马市| 无锡市| 加查县| 满城县| 息烽县| 阿克苏市| 历史| 即墨市| 屯昌县| 吉安市| 东莞市| 江华| 玛沁县| 仁化县| 荆州市| 兴化市| 云南省| 寿光市| 原阳县| 邵阳县| 荔浦县| 石渠县| 原阳县| 华阴市| 荣昌县| 久治县| 庄浪县| 元阳县| 玛沁县| 宁德市|