Network notes.

Partially taken from http://www.tomax7.com/mcse/neteworking2005.htm

TCP/IP

Internet Protocol and the Transmission Control Protocol.

IP address is a 32-bit logical number to address a network device. IP are normally represented by decimal numbers, but could be useful sometimes to represent them in binary.

10101100.00010011.01011000.01001001
172. 19. 88. 73

An IP address is divided in 4 parts (each 8 bits), these parts are called octets. In the IPV4 there are 5 address classes:

Class A from 1 to 126, in binary the octet start with 0xxx
127 Reserved for loopback, 01111111
Class B from 128 to 191, in binary the octet start with 10xx
Class C from 192 to 223, in binary the octet start with 110x
Class D from 224 to 239, in binary the octet start with 1110 Don’t use. Reserved for the future.
Class E from 240 to 254, in binary the octet start with 1111

IANA reserved 4 address ranges to be used in private networks, these addresses won’t appear on the Internet avoiding IP address conflicts.

10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 that means:

– 10.0.0.0 through 10.255.255.255
– 172.16.0.0 through 172.31.255.255
– 192.168.0.0 through 192.168.255.255
– 169.254.0.1 through 169.254.255.254 (reserved for Automatic Private IP Addressing)


The meaning of 8,12 and 16 is

8 = 255.0.0.0
12 = 255.240.0.0
16 = 255.255.0.0

These are subnet mask.

A subnet mask is used to determine which part is the network (n) part and which is the host (H) part.
Default subnet masks:
Class A 255.0.0.0 that is nnnnnnnn.HHHHHHHH.HHHHHHHH.HHHHHHHH
Class B 255.255.0.0 that is nnnnnnnn.nnnnnnnn.HHHHHHHH.HHHHHHHH
Class C 255.255.255.0 that is nnnnnnnn.nnnnnnnn.nnnnnnnn.HHHHHHHH

Subnetting

Bitwise (logical AND) between IP address and subnet mask to have the IP of the network

10101100.00010011.01011000.01001001 172.19.88.73
11111111.11111111.11111111.00000000 255.255.255.0
———————————————————————————————–
10101100.00010011.01011000.00000000 172.19.88.0

To calculate how many subnet in a net mask I can have use the formula (2^n) -2 where n is the number of bits in either field. For example the subnet 255.255.240.0 (11111111.11111111.11110000.00000000 could have (2^4) – 2 = 14 subnets.

 

Pubblicato da antenore

I'm a free software addicted and an IT senior consultant, married, father and a funny friend

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.