Saturday, 3 August 2013

Networking TCP/IP Math



Example 9
Find the class of the address:           227.12.14.87
Solution
The first byte is 227 (between 224 and 239); the class is D.

Example 10
Find the class of the address:          193.14.56.22
Solution
The first byte is 193 (between 192 and 223); the class is C.

Example 11
In Example 6 we showed that class A has 231 (2,147,483,648) addresses. How can we prove this same fact using dotted-decimal notation?
Solution
The addresses in class A range from 0.0.0.0 to 127.255.255.255. We notice that we are
dealing with base 256 numbers here.
Each byte in the notation has a weight.
The weights are as follows:
2563 , 2562, 2561, 2560
Last address:  127 ´ 2563 + 255 ´ 2562 +
255 ´ 2561 + 255 ´ 2560 = 2,147,483,647
First address:    =   0
If we subtract the first from the last and add 1, we get 2,147,483,648.

CLASSFUL ADDRESSING networking notes



CLASSFUL ADDRESSING
Occupation of the address space

In classful addressing, the address space is divided into five classes:
                                             A, B, C, D, and E.


Example 6
How can we prove that we have 2,147,483,648 addresses in class A?

Solution
In class A, only 1 bit defines the class.
The remaining 31 bits are available
for the address. With 31 bits,
we can have 231 or 2,147,483,648 addresses.

Example 7
Find the class of the address:            00000001  00001011   00001011 11101111

Solution
The first bit is 0. This is a class A address.

Example 8
Find the class of the address:               11000001  10000011   00011011 11111111
Solution
The first 2 bits are 1; the third bit is 0.
This is a class C address.

All Networking numericals Wbut



Example 1
Change the following IP address from binary notation to dotted-decimal notation.
10000001  00001011   00001011 11101111
Solution
129.11.11.239

Example 2
Change the following IP address from dotted-decimal notation to binary notation. 111.56.45.78
Solution
01101111  00111000  00101101  01001110

Example 3
Find the error, if any, in the following IP address:
111.56.045.78
Solution
There are no leading zeroes in dotted-decimal notation (045).

Example 4
Find the error, if any, in the following IP address:
75.45.301.14
Solution
In dotted-decimal notation, each number Is less than or equal to 255; 301 is
outside this range.

Example 5
Change the following IP addresses from binary notation to hexadecimal notation.
10000001  00001011   00001011 11101111

Solution
0X810B0BEF  or    810B0BEF16

Network layer notes



Network  layer
•       Logical Addressing-The network layer is responsible for the source-to-destination delivery of a packet, possibly across multiple networks.
•       The network layer adds a header that includes a logical address(IP address) of the sender and the receiver to the  packet coming from the upper layer.
•        Routing- When independent networks or links are connected together to create an internetwork, routers or switches routes the packets to their final destination.

IP Addresses
An IP address is a 32-bit address.
The IP addresses are unique.

RULE:
If a protocol uses N bits to define an address, the address space is 2N because each bit can have two
different values (0 and 1) and N bits can have 2N values.

The address space of IPv4 is
232
or
4,294,967,296.

NOTATIONS
•       Binary Notation
01110101   10010101   00011101   11101010

•       Dotted-decimal notation


•       Hexadecimal Notation
0111 0101   1001 0101   0001 1101   1110 1010
                       75               95             1D               EA
                                            0x75951DEA

•       Some rules regarding the different notations of IP  addresses:-
1)      There should not  be any leading zero.
2)      There should  not be more than four numbers in an IPv4 address.
3)      Each number should be less than or equal to 255.
4)      A mixture of any two notation in IP addressing is not allowed.