Chapter 3
Chapter 3
Chapter 3
Chapter 3
Network Layer:
Logical Addressing
3-1 IPv4 ADDRESSES
3.2
Note
3.3
Figure 3.1 Dotted-decimal notation and binary notation for an IPv4 address
3.4
Example 3.1
Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation.
3.5
Example 3.2
Solution
We replace each decimal number with its binary equivalent
.
3.6
Example 3.3
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.
3.7
In classful addressing, the address
space is divided into five classes:
A, B, C, D, and E.
3.8
Figure 3.2 Finding the classes in binary and dotted-decimal notation
3.9
Example 3.4
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.
3.10
Table 3.1 Number of blocks and block size in classful IPv4 addressing
3.11
Table 3.2 Default masks for classful addressing
3.12
Example
3.13
Example
Solution
3.14
Example 3.6
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.15.37.32.
3.15
Note
3.16
Example 3.7
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.15.37.47
This is actually the block shown in Figure 5.3.
3.17
Example 3.8
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
3.18
Note
3.19
Subnetting – Example
Host IP Address: 138.101.114.250
Network Mask: 255.255.0.0
Subnet Mask: 255.255.255.192
Given the following Host IP Address, Network Mask and Subnet mask find the
following information:
Major Network Information
Major Network Address
Major Network Broadcast Address
Range of Hosts if not subnetted
Subnet Information
Subnet Address
Range of Host Addresses (first host and last host)
Broadcast Address
Other Subnet Information
Total number of subnets
Number of hosts per subnet
3.20
Major Network Information
Host IP Address: 138.101.114.250
Network Mask: 255.255.0.0
Subnet Mask: 255.255.255.192
3.21
Step 1: Convert to Binary
128 64 32 16 8 4 2 1
Step 1:
Translate Host IP Address and Subnet Mask into binary notation
3.22
Step 2: Find the Subnet Address
138. 101. 114. 250
IP Address 10001010 01100101 01110010 11111010
Mask 11111111 11111111 11111111 11000000
Network 10001010 01100101 01110010 11000000
138 101 114 192
Step 2:
Determine the Network (or Subnet) where this Host address
lives:
1. Draw a line under the mask
2. Perform a bit-wise AND operation on the IP Address and the Subnet
Mask
Note: 1 AND 1 results in a 1, 0 AND anything results in a 0
3. Express the result in Dotted Decimal Notation
4. The result is the Subnet Address of this Subnet or “Wire” which is
138.101.114.192
3.23
Step 3: Subnet Range / Host Range
G.D. S.D.
3.24
Step 4: First Host / Last Host
G.D. S.D.
Host Portion
Subnet Address: all 0’s
First Host: all 0’s and a 1
Last Host: all 1’s and a 0
Broadcast: all 1’s
3.25
Step 5: Total Number of Subnets
G.D. S.D.
Total
First number
Host of subnets
10001010 01100101 01110010 11 000001
138 101 114 193
Number
Last Host
of subnet
10001010
bits 10
01100101 01110010 11 111110
210 = 1,024 138 101 114 254
Total
Firstnumber
Host of hosts01100101
10001010 per subnet
01110010 11 000001
138 101 114 193
Number of host bits 6
Last Host 10001010 01100101 01110010 11 111110
2 = 64
6
138 101 114 254
Solution
Figure 3.9 shows the situation.
Group 1
For this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to define each host.
The prefix length is then 32 − 8 = 24. The addresses are
3.29
Example 3.10 (continued)
Group 2
For this group, each customer needs 128 addresses. This
means that 7 (log2 128) bits are needed to define each host.
The prefix length is then 32 − 7 = 25. The addresses are
3.30
Example 3.10 (continued)
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
3.32
Table 3.3 Addresses for private networks
3.33
Example 3.11 :A company is granted the site address 211.80.64.0 .The company
needs six subnets. Design the subnets?
Solution:
No. of subnet must be power of 2 therefore we design 8 subnets
No.of subnet bits=Log2(8)=3 bits
3.34
Subnet NET . Subnet . Host Subnet IP
211.80.64 000 00000 211.80.64.0
Subnet 0
211.80.64 000 11111 211.80.64.31
211.80.64 001 00000 211.80.64.32
Subnet 1
211.80.64 001 11111 211.80.64. 63
211.80.64 010 00000 211.80.64.64
Subnet 2
211.80.64 010 11111 211.80.64. 95
Subnet 3 211.80.64 011 00000 211.80.64.96
211.80.64 011 11111 211.80.64. 127
Subnet 4 211.80.64 100 00000 211.80.64. 128
3.35
Broadcast Address
172.16.3.0
172.16.4.0
172.16.1.0
172.16.1.255 172.16.2.0
(Directed Broadcast)
255.255.255.255 X
(Local Network Broadcast)
172.16.255.255
(All Subnets Broadcast)
3.36
3-2 IPv6 ADDRESSES
3.37
Features of IPv6
Larger Address Space
Efficient and Extensible IP datagram
Security
3.38
Major Improvements of
IPv6 Header
No option field: Replaced by extension
header. Result in a fixed length, 40-byte IP
header.
No header checksum: Result in fast
processing.
No fragmentation at intermediate nodes:
Result in fast IP forwarding.
3.39
An IPv6 address is 128 bits long.
3.40
128-bit IPv6 Address
3FFE:085B:1F1F:0000:0000:0000:00A9:1234
3FFE:85B:1F1F::A9:1234
3.41
Figure 3.15 Abbreviated IPv6 addresses
3.42
Example 3.12
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.