IP
IP is Internet Protocol.
There are IP addresses, IP protocol and IP packets.
1-IP addresses
-There are IP version 4 and IP version 6. IP version 5 was used for making tests.
IP version 4:
IPv4 addresses are on 32 bits with 4 bytes. The base is 10: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
There are at all (2 exponent 32) IPv4 addresses, =about 4 billions, but most of all are not available anymore.
Classes of IP addresses version 4:
-IPv4 Class A: from 1.0.0.0 to 127.255.255.255
-IPv4 Class B: from 128.0.0.0 to 191.255.255.255
-IPv4 Class C: from 192.0.0.0 to 223.255.255.255
-IPv4 Class D: from 224.0.0.0 to 239.255.255.255
-IPv4 Class E: from 240.0.0.0 to 255.255.255.255
The PRIVATE IPv4 addresses (so NOT routable) are the following:
-IPv4 Private Class A: from 10.0.0.0 to 10.255.255.255 (there are at all 2 exponent 24= 16,777,216 IPv4 private class a addresses);
-IPv4 Private Class B: from 172.16.0.0 to 172.31.255.255 (there are at all 2 exponent 20= 1,048,576 IPv4 private class B addresses);
-IPv4 Private Class C: from 192.168.0.0 to 192.168.255.255 (there are at all 2 exponent 16= 65,536 IPv4 private class C addresses).
Some remarks about IP addresses version 4:
-1byte.1byte.1byte.1byte format is called DDN format= Dotted Decimal address.
-The Decimal Format is another format than DDN. For example, the Decimal Format of the address 192.168.1.0 is 11000000.10101000.00000001.00000000
-0.0.0.0 is a non-routable address, it designates an invalid, unknown or non-applicable host.
-127.0.0.1 is the localhost (loopback).
-Some IP v4 addresses are classless, for example 203.0.113.0/30, 10.10.20.0/30, 50.50.50.1/24 and 40.40.40.2/24.
-all addresses of the form 127.xx.yy.zz are used for loopback testing only.
-If the DhCP server is unavailable, then the hosts will receive the IP addresses like 169.254.xx.yy
-255.255.255.255 is a broadcast address (but blocked by routers).
how to get decimal format from DDN format?
Each number Y is between 0 and 255, so this number can be written: Y= 128x(0 or 1)+ 64x(0 or 1)+ 32x(0 or 1)+ 16x(0 or 1)+ 8x(0 or 1)+ 4x(0 or 1)+ 2x(0 or 1)+ 1x(0 or 1).
For example:
255= 64x1 + 32x1+ 16x1+ 8x1+ 4x1+ 2x1 +1x1= 11111111
192= 128x1+ 64x1 + 32x0+ 16x0+ 8x0+ 4x0+ 2x0 +1x0= 11000000
172= 128x1+ 64x0 + 32x1+ 16x0+ 8x1+ 4x1+ 2x0 +1x0= 10101100
168= 128x1+ 64x0+ 32x1+ 16x0+ 8x1+ 4x0+ 2x0 +1x0= 10101000
16= 128x0+ 64x0+ 32x0+ 16x1+ 8x0+ 4x0+ 2x0 +1x0= 00010000
10= 128x0+ 64x0+ 32x0+ 16x0+ 8x1+ 4x0+ 2x1 +1x0= 00001010
56= 128x0+ 64x0+ 32x1+ 16x1+ 8x1+ 4x0+ 2x0 +1x0= 00011100
1= 128x0+ 64x0+ 32x0+ 16x0+ 8x0+ 4x0+ 2x0 +1x1= 00000001
0= 128x0+ 64x0+ 32x0+ 16x0+ 8x0+ 4x0+ 2x0 +1x0= 00000000
So the address 192.168.1.0 can be written 11000000.10101000.00000001.00000000
and the address 172.16.10.56 can be written 10101100.00010000.000001010.00011100
-for each IPv4 address, what is the address of the network and the address of the machine?
*for class A, the address of the network is the first byte, and the address of the machine is the three other bytes;
*for class B, the address of the network is the first two bytes, and the address of the machine is the two other bytes;
*for class C, the address of the network is the first three bytes, and the address of the machine is the last byte.
IPv4 class A:
The addresses are from 1.0.0.0 to 127.255.255.255
network.host.host.host
-class a addresses are for very big networks
-there are 127 networks with up to 16 million hosts each
For example an Internet Service Provider (ISP) has a class a network because it needs million IP addresses to distribute to customers
-the private addresses (not routable) are: from 10.0.0.0 to 10.255.255.255
IPv4 class B:
The addresses are from 128.0.0.0 to 191.255.255.255
network.network.host.host
-class B addresses are for medium-sized networks
-there are 16,384 networks with up to 65,536 hosts each
For example a company having 60,000 computers can have a class B network
-the private addresses (not routable): from 172.16.0.0 to 172.31.255.255
IPv4 class C:
The addresses are from 192.0.0.0 to 223.255.255.255
network.network.network.host
-class C addresses are for small networks
-there are 2 million networks with up to 254 hosts each
For example a school having 200 computers can have a class C network
-the private addresses (not routable): from 192.168.0.0 to 192.168.255.255
IPv4 class D:
The addresses are from 224.0.0.0 to 239.255.255.255
These addresses are used for multicast technology (the information is addressed to a group of destination computers simultaneously).
IPv4 class E:
The addresses are from 240.0.0.0 to 255.255.255.255
These addresses are used for making tests.
The SUBNET MASK
Definition: the subnet mask is an IP address used to determine to which network belongs an IP address. The other name is "classful subnet-mask".
-For IPv4 class A, subnet mask looks like: 255.x.x.x
-For IPv4 class B, subnet mask looks like: 255.255.x.x
-For IPv4 class C, subnet mask looks like: 255.255.255.x
Remark: 192.168.1.0 with the mask 255.255.255.0 can be written 192.168.1.0/24.
192.168.1.0/24 is CIDR notation, CIDR= Classless INterDomain Routing. The other name of CIDR is "Slash notation".
Moreover, 192.168.1.0 with the mask 255.255.0.0 can be written 192.168.1.0/16.
192.168.1.0 with the mask 255.0.0.0 can be written 192.168.1.0/8.
-Exercise: if the subnet mask is 255.255.240.0, determine the network of the IP address 150.215.17.9
Response: 150.215.16.0
IP version 6:
IPv6 addresses are created on a base of 16 hexadecimal which is: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, B, C, D, E, F.
Each IPv6 address is composed of 8 blocks of 16 bits (= 8 blocks of hextet) separated by colon:
8x16= 168 bits so each IPv6 address has 128 bits.
a bit is 0 or 1 (2 values are possible) so there are all all 2 (exp) 128= 3 trillions IPv6 addresses, which is a huge amount and really more than with IPv4.
Examples of three IPv6 addresses:
2001:db8:0:85a3:0:0:ac1f:8001
FE80:0000:0000:0000:0202:B3FF:FE1E:8329
2001::4F:0:0:F1
There are 3 rules used to reduce the lenght of IPv6 addresses:
-Rule 1: sequences of hextets of zeros can be replaced by ::, but only one time per IPv6 address.
For example 2001:0000:0000:0000:004F:0000:0000:00F1 can be written 2001::004F:0000:0000:00F1.
-Rule 2: each hextet of 4 zeros can be written 0.
For example 2001::004F:0000:0000:00F1 can be written 2001::004F:0:0:00F1.
-Rule 3: each zero starting an hextet can be removed.
For example 2001::004F:0:0:00F1 can be writen 2001::4F:0:0:F1.
-Conclusion: the IPv6 address 2001:0000:0000:0000:004F:0000:0000:00F1 can be written 2001::4F:0:0:F1 after applying rules 1, 2 and 3.
Examples: With these three above rules, the following IPv6 addresses can be reduced:
2340:0000:0010:0100:1000:aBCD:0101:1010 can be written 2340:0:10:100:1000:aBCD:101:1010
30a0:aBCD:EF12:3456:0aBC:B0B0:9999:9009 can be written 30a0:aBCD:EF12:3456:aBC:B0B0:9999:9009
2222:3333:4444:5555:0000:0000:6060:0707 can be written 2222:3333:4444:5555::6060:707
3210:0000:0000:0000:0000:0000:0000:0000 can be written 3210::
210F:0000:0000:0000:CCCC:0000:0000:000D can be written 210F::0:CCCC:0:0:D
34Ba:000B:000B:0000:0000:0020:0000:0000 can be written 34Ba:B:B::20
FE80:0000:0000:0000:DEaD:BEFF:FEEF:CaFE can be written FE80::0:DEaD:BEFF:FEEF:CaFE
FE80:0000:0000:0000:FaCE:BaFF:FEBE:CaFE can be written FE80::FaCE:BaFF:FEBE:CaFE
Moreover, with IPv6:
-Subnet mask is with CIDR notation only.
-Broadcast messages are forbidden.
-Routing protocols are IS-IS, RIPng, OSPFv3, EIGRPv6 and MP-BGP.
-Network part of the IP address is called prefix part, and machine part is called interface ID part.
-another name of IPv6 is IPng like IP next generation.
-Neighbor Discovery Protocol (NDP) used in IPv6 networks has the same role than address Resolution Protocol (aRP) used in IPv4 networks.
-a network using both IPv4 and IPv6 addresses is called "dual stack network", and uses dual stack routing.
Examples of IPv6 addresses, subnet masks with CIDR notation and prefix parts:
If 34Ba:B:B:0:5555:0:6060:707/80, then the prefix part is 34Ba:B:B:0:5555
If 3124::DEaD:CaFE:FF:FE00:1/80, then the prefix part is 3124::DEaD:CaFE
If 2BCD::FaCE:BEFF:FEBE:CaFE/48, then the prefix part is 2BCD::
If 3FED:F:E0:D00:FaCE:BaFF:FE00:0/48, then the prefix part is 3FED:F:E0
If 210F:a:B:C:CCCC:B0B0:9999:9009/40, then the prefix part is 210F:a:00
If 34Ba:B:B:0:5555:0:6060:707/36, then the prefix part is 34Ba:B:0
If 3124::DEaD:CaFE:FF:FE00:1/60, then the prefix part is 3124::DEa
If 3210::aBCD:101:1010/64, then the prefix part is 3210:0000:0000:0000
There are four IPv6 CLASSES:
-GLOBAL unicast addresses. These addresses started by figures 2 or 3 and are liked IPv4 PuBLIC addresses. Examples: 2001::1 and 3001::1.
-LOCAL unicast addresses. These addresses started by letters FC or FD and are liked IPv4 PRIVaTE addresses. Examples: FC00::1 and FD01::1.
-LINK locAl addresses. Theses addresses are automatically generated by routers.
-MULTICAST addresses. These addresses started by FF02.
Below are some commands that you can write on Cisco routers:
-ipv6 enable
-no shutdown
-ipv6 unicast-routing
-ipv6 writeheretheaddress autoconfig
-show ipv6 route
-do show ipv6 interface brief
2-IP protocol
IP is the most important network protocol.
IP is used not only on internet but also in LaN, MaN and WaN.
IP is used for transferring data.
IP offers a best-effort service of delivering datagrams between hosts, which may be lost, delayed, corrupted, or duplicated.
There are IP version 4 (IPv4) and IP version 6 (IPv6).
IP version 5 was experimental.
RFC 791 describes IPv4 and RFC 2460 describes IPv6.
IP belongs to OSI layer 3.
Remark 1: "internet protocols" is different than "the internet protocol IP". Indeed, internet protocols are protocols used on internet like hTTP, FTP, Telnet, usenet...
Remark 2: IP often works with TCP protocol (TCP/IP is very popular), but sometimes with uDP protocol too.
3-IP packets
Each IP packet contains the data that have to be transferred through network(s).
an IP PaCKET= a headER + the DaTa
On IPv4: the header has 20 bytes, with 13 fields.
On IPv6: the header has 40 bytes, with 7 fields only (so the routers process packets faster with IPv6 than with IPv4).
The maximum size of an IP packet is of 65515 bytes,
but:
-the maximum size of an IP packet encapsulated on an ethernet network is of 1500 bytes;
-the exact size of each IP packet encapsulated on an aTM network is of 53 bytes;
-the maximum size of an IP packet encapsulated on a Frame Relay network is of 4096 bytes.
IP is very popular and very used, so we can say:
-"Everything over IP", because IP can transport photos, videos, music, voice, data, text…
-"IP over everything", because IP can be transported by aTM, Frame Relay, ethernet, Wi-Fi, optical fiber, twisted pair, satellite…
Back to IT courses page
Back to website main page