Networks for a beginner IT-specialist. Mandatory base

Approximately 80% of us who graduate from university with an IT major do not end up becoming a programmer. Many get jobs in technical support, system administrators, computer device setup wizards, digital technology sales consultants, IT managers, and so on.

This article is just for those 80% who have just graduated from university with some IT specialty and have already started monitoring vacancies, for example, for the position of a system administrator or his assistant, or a field engineer for an outsourcing company, or for technical support of the 1st / 2nd line.

And also for self-study or for training new employees.

During my career in IT, I encountered such a problem that universities do not provide the most basic base on networks. I first encountered this myself, when, after graduating from university, I went to interviews in 2016 and could not answer simple (as it seems to me now) questions. Then, of course, it seemed to me that I had messed up and did not finish my studies at the university. But as it turned out, the matter was in the educational program. Since now, I also face this knowledge gap when I train new employees.

And that then, I had to study many articles on the Internet before I understood the basic points, and that now, when asking young professionals topics to study, they find it difficult to find and learn what they need. This is due to the fact that there are a huge number of articles on the Internet and all of them are scattered by topic, or written in too complex a language. Plus, most of the information at the beginning of their articles contains mostly simple scientific definitions, and then immediately complex technologies of use. As a result, a lot of things are obtained that are still completely incomprehensible for a beginner.

That is why I decided to collect the main topics in one article and explain them as simply as possible “on the fingers”.

I immediately warn you that there will be no in-depth information in the article, only the very base and the most basic.

Topics covered:

  1. Global and local networks
  2. White and gray IP addresses
  3. NAT
  4. DHCP server and subnets
  5. Network routing devices (router, switch, switch, hub)
  6. Basic network analysis commands
  7. Transport protocols UDP and TCP

1. Global and Local networks

The entire Internet network is divided into global (WAN) и local (LAN).

All user devices within the same apartment or office or even building (computers, smartphones, printers / MFPs, TVs, etc.) are connected to a router that combines them into local area network.

Members of the same local network can exchange data between their devices without connecting to an Internet provider. But to go online (for example, go to the Yandex or Google search engine, go to VK, Instagram, YouTube or AmoCRM), you need access to global network.

Exit in global network provides an Internet provider, for which we pay him a subscription fee. The provider sets the speed level on its routers for each connection in accordance with the tariff. The provider sends us a twisted pair or optics to our router (our local network) and after that any device of our local area network can go out to global network.

For an analogy, networks can be compared to roads.
For example, the roads of your city N are the local network. These roads connect you to shops, institutions, parks and other places in your city.
To get to another city N, you need to go to the federal highway and drive a certain number of kilometers. That is, go to global network.

For a better understanding of what is global and local network I drew a sketch.

Networks for a beginner IT-specialist. Mandatory base

2. White and gray IP addresses

Each device on the network has its own unique IP address. It is needed so that network devices understand where to send the request and response.
It's the same as our houses and apartments have their exact address (zip code, city, street, house number, apartment number).

Within your local network (apartment, office or building) there is a range of unique addresses. I think many have noticed that the ip-address of the computer, for example, starts with the numbers 192.168.XX

So this is the local address of your device.

Exist allowed LAN ranges:

Networks for a beginner IT-specialist. Mandatory base

I think from the presented table it immediately becomes clear why the most common range is 192.168.XX

To find out, for example, the ip-address of your computer (based on windows OS), type the command in the terminal ipconfig

Networks for a beginner IT-specialist. Mandatory base

As you can see, my computer's ip address is on my home LAN 192.168.88.251

To access global networks, your local ip address replaced by a router globalgiven to you by your ISP. Global ip addresses do not fall under the ranges from the table above.

So local ip addresses are gray ip addresses and global ip addresses are white.

For a better understanding, consider the diagram below. On it, I signed each device with my ip-address.

Networks for a beginner IT-specialist. Mandatory base

The diagram shows that the provider releases us to global networks (on the Internet) with white ip address 91.132.25.108

For our router, the provider issued a gray ip address 172.17.135.11
And in our local network, all devices, respectively, also have gray ip addresses 192.168.X.X

You can find out under what ip-address you access the global network on the website 2ip.ru

Networks for a beginner IT-specialist. Mandatory base

But out of all this, it's worth remembering one very important factor!
Currently, the problem of the lack of white ip-addresses has become aggravated, since the number of network devices has long exceeded the number of available ip-addresses. And for this reason, Internet providers give users gray ip addresses (within the local network of the provider, for example, within several apartment buildings) and released into the global network under one common white ip address.

To find out the gray ip-address is given to you by the provider or the white one, you can go to your router and see what ip-address your router receives from the provider.

Or go, for example, to the site mobilon.ru and at the very bottom (in the footer of the site) you will see the ip-address of your router.

For example, here I logged in from my home Internet:

Networks for a beginner IT-specialist. Mandatory base

As you can see, in fact I have gray ip address 172.17.132.2 (see local address range). To connect a white ip-address, providers usually provide additional. service with a subscriber payment.

In fact, for home Internet, this is not critical at all. And here for company offices, it is recommended to buy a white IP address from the provider, since the use of a gray ip-address entails problems with the operation of ip-telephony, and it will also not be possible to configure a remote VPN connection. That is, a gray ip-address will not allow you to bring your configured server to the Internet and will not allow you to set up a remote connection to a server from another network.

NAT

In the previous section, I noted that “the problem of lack of white ip-addresses is now aggravated” and therefore, a common connection scheme for Internet providers now is to connect many clients with gray ip-addresses, and release them to the global Internet under one common white ip.

But this was not always the case, initially everyone was given white ip-addresses, and soon, in order to avoid the problem of a shortage of white ip-addresses, it was just invented NAT (Network Address Translation) - IP address translation mechanism.

NAT works on all routers and allows us to access the global network from the local network.

For a better understanding, let's look at two examples:

1. First case: bought from you white ip address 91.105.8.10 and several devices are connected in the local network.

Networks for a beginner IT-specialist. Mandatory base

Each local device has its own gray ip address. But access to the Internet is possible only from a white ip-address.

Therefore, when, for example, PC1 with the ip-address 192.168.1.3 decided to enter the Yandex search engine, the router, by issuing a request from PC1 to the global network, connects the mechanism NATWhich converts PC1 ip address to white global ip address 91.105.8.10

Also in the opposite direction, when the router receives a response from the Yandex server, it uses the mechanism NAT will direct this response to the ip address 192.168.1.3 to which PC1 is connected.

2. Second case: you also have several devices connected to the local network, but you did not buy a white IP address from an Internet provider.

Networks for a beginner IT-specialist. Mandatory base

In this case, the local address PC1(192.168.1.3) first converted NAT'ohm of your router and turns into gray ip address 172.17.115.3, which was given to you by the Internet provider, and then your gray ip-address is converted NAT'ohm of the provider's router white ip address 91.105.108.10, and only after that access to the Internet (global network) is carried out.

That is, in this case, it turns out that your devices are behind a double NAT'ohm.

This scheme has a higher degree of security for your devices, but also has a number of big disadvantages. For example, unstable sip-registration of VoIP equipment or one-way audibility when making calls via ip-telephony.

More details about the mechanism NAT, about its pros and cons, about port allocation, about sockets and about types NAT I will write a separate article.

4. DHCP - server and subnets

To connect a device, for example, a computer to the Internet, you usually simply connect a wire (twisted pair) to the computer and then to a free port on the router, after which the computer automatically receives an ip-address and Internet access appears.

Also with Wi-Fi, for example from a smartphone or laptop, you connect to the network you need, enter the password, the device receives an ip-address and you have the Internet.

А what allows the device to get a local ip address automatically?
This function is performed DHCP server.

Each router is equipped DHCP server. The IP addresses obtained automatically are dynamic ip addresses.

Why dynamic?

Because, with each new connection or reboot of the router, DHCP server also reboots and can give devices different ip-addresses.

That is, for example, now your computer has an ip-address 192.168.1.10, after rebooting the router, the ip-address of the computer may become 192.168.1.35

To prevent the ip-address from changing, you can set it statically. This can be done both on the computer in the network settings, and on the router itself.

And, DHCP server on the router, you can generally disable and set ip-addresses manually.

You can set up multiple DHCP servers on one router. Then the local network is divided into subnets.

For example, we will connect computers to the zero subnet in the range 192.168.0.2-192.168.0.255, printers to the first subnet in the range 192.168.1.2-192.168.1.255, and we will distribute Wi-Fi to the fifth subnet with the range 192.168.5.2-192.168.5.255 ( see diagram below)

Networks for a beginner IT-specialist. Mandatory base

Usually, subnetting is not necessary. This is done when the company has a large number of devices connected to the network and when setting up network security.

But such a scheme in companies is quite common.
Therefore, it is necessary to know a very important point.

Attention!
If you need to access a web interface from a PC, for example, a printer or an IP phone, and at the same time your PC is on a different subnet, then you will not be able to connect.

To understand, let's take an example:

Networks for a beginner IT-specialist. Mandatory base

Let's say you work for PC1 with local ip address 10.10.5.2 and want to go to the web interface ip phone with local ip address 192.168.1.3, you will not be able to connect. Because the devices are on different subnets. To ip-phone located in the subnet 192.168.1.X, you can only connect with PC3 (192.168.1.5).

Also to MFP (172.17.17.12) you can only connect with PC4 (172.17.17.10).

Therefore, when you connect remotely to a user on a PC in order to access the web interface of an ip phone, be sure to first check their local ip addresses to make sure that both devices are connected to the same subnet.

5. Network routing devices (router, switch, switch, hub)

Strange as it may seem, but there is such a fact that newcomers to IT (sometimes already existing system administrators) do not know or confuse such concepts as router, switch, switch, network gateway and hub.

I think the reason for this confusion arose due to the fact that they have spawned synonyms and jargon in the names of network equipment and this is now misleading many novice engineers.

Let's deal.

a) Router, router and network gateway

Everyone knows what is router. That this is exactly the device that distributes the Internet connected from the Internet provider in the room.

So router and network gateway this is the router.

This equipment is the main device in the organization of the network. In the engineering environment, the most commonly used name is “router".

By the way, not only a set-top box can be a router, but also a computer system unit, if you install another network card there and roll, for example, RouterOS Mikrotik. Next, split the network into many devices using a switch.

Networks for a beginner IT-specialist. Mandatory base

b) What is a Switch and how it differs from a Switch and a Hub

Switch and Switch it is too synonyms. But the hub slightly different device. About him in the next paragraph (c).

Networks for a beginner IT-specialist. Mandatory base

Switch (switch) serves to branch out the local network. Like a tee or surge protector, where we connect our devices to power them with electricity from a single outlet.

Networks for a beginner IT-specialist. Mandatory base

The switch does not know how to route the network like a router. It will not give your device an IP address and without the help of a router it will not be able to let you out on the Internet.

A standard router usually has 4-5 ports for connecting devices. Accordingly, if your devices are connected by wires and there are more of them than ports on the router, then you need a switch. You can connect a 24-port switch to one port of the router and easily organize a local network for 24 devices.

And if you have another router lying around, then you can turn on the switch mode in its web interface and also use it as a switch.

c) hub

Hub performs the same functions as the switch. But its distribution technology is heavily wooden and already outdated.

Networks for a beginner IT-specialist. Mandatory base

Hub distributes packets coming from the router to all connected devices indiscriminately, and the devices themselves must figure out if it is a packet or not.

А the switch has a MAC table and therefore distributes incoming packets to one specific device, which requested this packet. Hence data transfer switch faster and more efficient.

Nowadays, it is rare to find the use of hub, but still they come across, you need to be ready for this and be sure to recommend that the user replace the hub with a switch.

6. Basic commands for network analysis

a) Ping command

To understand whether the ip-address or the device itself is active, you can “ping” it.
To do this, on the command line, write the command ping "ip address".

Networks for a beginner IT-specialist. Mandatory base

Here we “pinged” the google dns server and, as we can see, the server is active (there is a response to pings and is equal to 83 ms).

If the addressee is not available or the given ip-address does not exist, then we will see the following picture:

Networks for a beginner IT-specialist. Mandatory base

That is, we do not receive a response to pings.

But Ping much more useful to use with keys:
-t - “ping” continuously (to stop, press the combination Ctrl + C)
-A -display the name of the “pinged” host (site/device/server)

Networks for a beginner IT-specialist. Mandatory base

Accordingly, the key-A” showed us that the name of the pinged host is “dns.google”.
And thanks to the key-t” ping went non-stop, I stopped it by pressing Ctrl+C.

With continuous ping, you can see whether the pinged node behaves adequately and the approximate quality of the Internet channel.

As you can see from the screenshot, there are periodic delays in receiving a packet up to 418 ms, this is a rather critical value, since a jump from 83 ms to 418 ms would have affected video communications by slowing down / freezing the image or in ip-telephony by degrading voice quality.

In my case, most likely my home Internet is storming.
But in order to establish the cause in more detail, it is necessary to run a dump. And this is a topic for an entire article.

Attention! Sometimes sending is disabled on routers ICMP packets (someone disables it on purpose, but somewhere it is not enabled by default), in this case, such a node will not respond to "pings", although it will itself be active and function normally in the network.

Another possibility to "ping" is find out what ip-address is hidden behind the site domain. Namely, on which server the site host is installed.

To do this, simply write the site instead of the ip-address:

Networks for a beginner IT-specialist. Mandatory base

As you can see, the habr has an ip-address 178.248.237.68

b) Tracing

Sometimes it is very important to see which way a packet goes to a certain device.
Perhaps somewhere there is a hole and the package does not reach the addressee. So here the trace utility helps determine at what stage this package is stuck.

On Windows OS, this utility is called by the command “tracert” ip address or domain:

Networks for a beginner IT-specialist. Mandatory base

Here we saw through which nodes our request passes before it reaches the ya.ru server

On the Linux OS this utility is called by the command traceroute.

Some devices, routers or VoIP voice gateways also have a trace utility.

c) whois utility

This the utility allows you to find out all the information about the ip-address or about the domain registrar.

For example, let's check ip address 145.255.1.71. To do this, enter the command in the terminal whois 145.255.1.71

Networks for a beginner IT-specialist. Mandatory base

Got information about provider ip address, country, city, address, range, etc.

I only use it on Linux. The utility downloads and installs easily from the standard operating system repository.

But I also read that on Windows there is a similar solution.

7. Transport protocols TCP and UDP

All transmission of requests and reception of responses between devices in the network are carried out using transport protocols TCP and UDP.

The TCP protocol guarantees the delivery of a request and the integrity of its transmission. It pre-checks the availability of the node before sending the packet. And if the integrity of the package is violated along the way, then TCP complement the missing ingredients.

In general, this is a protocol that will do everything so that your request reaches the addressee correctly.

therefore TCP the most widely used transport protocol. It is used when a user surfs the Internet, climbs sites, services, social networks. networks, etc.

Networks for a beginner IT-specialist. Mandatory base

UDP the protocol does not have such guaranteed data transfer as TCP. It does not check the reachability of the end node before sending it, and does not regenerate the packet if it is degraded. If a packet or several packets are lost along the way, then the message will reach the addressee in such an incomplete form.

Why is UDP needed then?

The fact is that this transport protocol has a huge advantage over TCP in data transfer rate. That's why UDP is widely used to send real-time voice and video packets.. Namely, in ip-telephony and video calls.
For example, any call via WhatsApp or Viber uses the transport protocol UDP. Also with video calls, for example, via Skype or the same instant messengers WhatsApp and Viber.

Networks for a beginner IT-specialist. Mandatory base

It is precisely because UDP does not guarantee the absolute transmission of data and the integrity of the transmitted packet that problems often arise when making calls over the Internet.
This is voice interruption, delay, echo or robotic voice.

This problem occurs due to a busy Internet channel, double NAT or radio channel.

It would be nice, of course, in such cases to use TCP, but alas, instantaneous transmission of complete packets is necessary for voice transmission, and for this task it is ideal UDP.

To avoid problems using UDP protocol, you just need to organize a high-quality Internet channel. And also set up a dedicated band on the router for UDPto load from other devices that use TCP did not interfere with the operation of the transport protocol UDP.

That's all.

I did not pile up the article and copy-paste here the scientific definitions of all the terms used, for those who need it, just google it.

I tried to put together the 7 most important, in my opinion, points, the knowledge of which will help a young “IT specialist” pass the first stages of an interview for “IT” positions, or at least just make it clear to the employer that you clearly know more than an ordinary user.

Study, outline. I hope that the article will be useful to many.

Source: habr.com

Add a comment