Unit 6 1
Unit 6 1
Unit 6 1
Network Layer:
Logical Addressing
• Notations
• Binary Notation and Dotted Decimal Notation
• Binary Notation: 32 bits are used each octet is referred as
byte, 4 byte address
• Dotted Decimal Notation: Written in Decimal point and each
byte is separated by dots.
Class A
• 126 networks (0 and 127 reserved) (1 byte starts from but
MSB bit is always 0)
• Assigned to very large size networks where number of
hosts 65K to16M
Class B
• 16384 networks
• Assigned to Intermediate size networks where number of
hosts 256 to 65K
Class C
• 2097152 networks
• Assigned to smaller networks where #hosts < 256
Solution
Solution
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
04\08\2010 Unit-VI Network Layer 26
Example
Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
04\08\2010 Unit-VI Network Layer 27
Netid and Hostid
Netid and Hostid
In classful addressing an IP address in class A,B, C is divided
into netid and hostid
In class A one byte defines the netid and 3 bytes defines the
host ID
In class B 2 byte defines the netid and 2 bytes defines the
host ID
In class C 3 byte defines the netid and 1 bytes defines the
host ID
10001100.10110011.11110000.11001000
11111111.11111111.00000000.00000000
10001100.10110011.00000000.00000000
NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNHHHHH
Above is how the computer will see our new subnet mask,
but we need to express it in decimal form as well:
255.255.255.224 128+64+32=224
0 0 1 h h h h h 32
0 1 0 h h h h h 64
0 1 1 h h h h h 96
1 0 0 h h h h h 128
1 0 1 h h h h h 160
1 1 0 h h h h h 192
206.15.143.32
206.15.143.64
206.15.143.96
206.15.143.128
206.15.143.160
206.15.143.192
206.15.143.33 or 32+1
0 0 1 0 0 0 0 1
And the last address in the Network will look like this:
206.15.143.62
0 0 1 1 1 1 1 0
11001000.00001111.10001111.01011001= 200.15.143.89
11111111.11111111.11111111.11100000 = 255.255.255.224
11001000.00001111.10001111.01000000 = 200.15.143.64
Rules:
1. The address in a block must be contiguous.
2.The number of address in a block must be a
power of 2 (1, 2, 4, 8, . . .)
3.The first address must be evenly divisible by the
number of address .
The last address in the block can be found by setting the rightmost
32 − n bits to 1s.
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.
Group 3
For this group, each customer needs 64 addresses. This
means that 6 (log264) bits are needed to each host. The
prefix length is then 32 − 6 = 26. The addresses are
NAT
NAT (Network Address Translation) Maps Private
IPs to Public IPs
It is required because of shortage of IPv4 Address
Addresses in Translation
• When the router translates the source address of the outgoing packet it
also makes note of the destination address.
• When response comes back from destination address it checks for its
source address from translation table
Structure
Address Space
Solution
We first need to align the left side of the double colon to the
left of the original pattern and the right side of the double
colon to the right of the original pattern to find how many
0s we need to replace the double colon.
Anycast Addresses
04\08\2010 Unit-VI Network Layer 100
IPv6 Addresses
Reserved addresses in IPv6