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:
-Class A: from 1.0.0.0 to 127.255.255.255

-Class B: from 128.0.0.0 to 191.255.255.255

-Class C: from 192.0.0.0 to 223.255.255.255

-Class D: from 224.0.0.0 to 239.255.255.255

-Class E: from 240.0.0.0 to 255.255.255.255



The PRIVATE IPv4 addresses (so NOT routable) are the following:
-in class A: from 10.0.0.0 to 10.255.255.255 (there are at all 2 exp.24 IP addresses= 16,777,216 IP addresses);

-in class B: from 172.16.0.0 to 172.31.255.255 (there are at all 2 exp.20 IP addresses= 1,048,576 IP addresses);

-in class C: from 192.168.0.0 to 192.168.255.255 (there are at all 2 exp.16 IP addresses= 65,536 IP addresses).


Some remarks about IP addresses version 4:
-1byte.1byte.1byte.1byte format is called DDN format= Dotted Decimal Address.
-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 on 128 bits with 16 bytes (or 8 hextets). The base is 16 hexadecimal: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
There are at all (2 exponent 128) IPv6 addresses, so about 3 trillions addresses.
Examples of three IPv6 addresses: 2001:db8:0:85a3:0:0:ac1f:8001, FE80:0000:0000:0000:0202:B3FF:FE1E:8329 and 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.

With these three 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.

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