Introduction to networking: IP, DNS, Network Managers

The Net ID is used to identify the network, while the Host ID is used to identify a host in the network 

IPs


IPv4 can increase the number of the connected devices through systems such as NAT, which creates sub-IPs inside one IP. That's why IPv4 is still the most used.

IPv4


The Net ID is used to identify the network, while the Host ID is used to identify a host in the network.
In Class D information is broadcast to multiple computers simultaneously.


Class A

The first bit of the first Octet always starts with 0. As a result, there are a maximum of 126 Class A networks available. The addresses 0000000 and 1111111 are reserved. Each Class A network can have up to 16.7 million unique hosts on its network. The range of host address is from 1.0.0.0 to 127.255.255.255.


Class B

The first two bits of the first octet are always set to binary 10, so there are a maximum of 16,384 (14-bits) Class B networks. The first octet of a Class B address has values from 128 to 191. Each Class B network can support a maximum of 65,536 unique hosts on its network. The range of host addresses is from 128.0.0.0 to 191.255.255.255.


Class C

The first three bits of the first octet are set to binary 110, so almost 2.1 million (21-bits) Class C networks are available. The first octet of a Class C address has values from 192 to 223. Each Class C network can support up to 256 (8-bits) unique hosts. The range of host addresses is from 192.0.0.0 to 223.255.255.255.


IP Assignment

IPs can be manually set (static) or dynamic. In the latter, they change and are assigned by the Dynamic Host Configuration Protocol (DHCP). 


IP Name Resolution

The conversion of the numerical IPs into human-readable version, known as hostnames (the URLs) through the Domain Name System (DNS).

$ hostname
Shows the system's hostname

$ hostname [argument]
Changes the system's hostname. Only upon root permission.

$ host [hostname]
or
nslookup [hostname]
or
dig [hostname]
Show the IP of the hostname and other info depending on the options entered

The IP of the machine is always 127.0.0.1

Key files:
/etc/resolf.conf
/etc/hosts


DNS: how it works

  1. Your browser looks at the local cache memory to resolve the domain, that's finding the IP related to the website you want to visit
  2. If the IP is not present in the local cache memory, your computer sends an enquiry to the Resolver Server, which is your Internet Service Provider (ISP)
  3. The Resolver looks at its own cache to find that IP.
  4. If the Resolver can't find the IP, it sends an enquiry to the Root Server
  5. The Root Server doesn't have a cache to resolve the IP. Instead, it has a list of Top Level Domain Servers (TLD Server) which can know how to resolve the domain based on its Top Level Domain: .com, .org, .net etc. And provides the Resolver with the right one to address to.
  6. The Resolver asks the TLD Server provided by the Root Server to resolve the domain name
  7. If the TLD Server can't find the IP, it redirects the Resolver to an Authoritative Name Server, which is the final authority
  8. The Authoritative Name Servers know everything about that domain, including the IP. It will provide the Resolver with the IP.


Network Manager

Network Manager is the service which directly deals with the network activation.
Depending on the distribution, it can be managed (eg., restarted) with: 
  • $ sudo systemctl restart NetworkManager
  • $ sudo systemctl restart network
  • $ sudo service NetworkManager restart
  • $ sudo service network restart


Comments