lecture 17 & 18
TRANSCRIPT
-
7/27/2019 Lecture 17 & 18
1/46
-
7/27/2019 Lecture 17 & 18
2/46
2
Network Layer
-
7/27/2019 Lecture 17 & 18
3/46
3
Network Layer Topics to Cover
Logical Addressing
I nternet Protocol
Address M apping Delivery, F orwarding, Routing
-
7/27/2019 Lecture 17 & 18
4/46
4
IPv4 Addresses
An IPv4 address is a 32-bit address thatuniquely and universally defines theconnection of a device (for example, acomputer or a router) to the Internet.
The address space of IPv4 is 2 32 or
4,294,967,296.
-
7/27/2019 Lecture 17 & 18
5/46
5
Dotted-decimal Notation and Binary notation for an IPv4 address
-
7/27/2019 Lecture 17 & 18
6/46
6
Change the foll owing I Pv4 addresses f rom binary notation to dotted-decimal notation.
Example
Solution We replace each group of 8 bits with i ts equi valent decimal number (see Appendix B) and add dots for separation.
-
7/27/2019 Lecture 17 & 18
7/46
7
Change the following I Pv4 addresses f rom dotted-decimal notation to binary notation.
Example
Solution We replace each decimal number with its binary equi valent (see Appendix B).
-
7/27/2019 Lecture 17 & 18
8/46
8
F ind the er ror, i f any, in the foll owing I Pv4 addresses.
Example
Solution a. There must be no leading zero (045).b. There can be no c. Each number needs to be less than or equal to 255.d. A mixture of binary notation and dotted-decimal
notation i s not al lowed.
-
7/27/2019 Lecture 17 & 18
9/46
9
In classful addressing, the addressspace is divided into five classes:A, B, C, D, and E.
Note
-
7/27/2019 Lecture 17 & 18
10/46
10
Finding the classes in binary and dotted-decimal notation
-
7/27/2019 Lecture 17 & 18
11/46
11
F ind the class of each address.a. 0 0000001 00001011 00001011 11101111b. 110 00001 10000011 00011011 11111111c. 14 .23.120.8
d. 252 .5.15.111
Example
Solution a. The f ir st bi t i s 0. This is a class A address.
b. The f ir st 2 bi ts are 1; the third bi t is 0. This is a class C address.
c. The f ir st byte is 14; the class is A.d. The f ir st byte is 252; the class is E.
-
7/27/2019 Lecture 17 & 18
12/46
12
Number of blocks and block size in classful IPv4 addressing
-
7/27/2019 Lecture 17 & 18
13/46
13
In classful addressing, a large part of theavailable addresses were wasted.
Note
-
7/27/2019 Lecture 17 & 18
14/46
14
Defaul t masks for classful addressing
-
7/27/2019 Lecture 17 & 18
15/46
15
Classful addressing, which is almostobsolete, is replaced with classlessaddressing.
Note
-
7/27/2019 Lecture 17 & 18
16/46
16
Subnet Addressing
Subnet addressing introduces another hierarchical levelTransparent to remote networksSimplifies management of multiplicity of LANsMasking used to find subnet number
Originaladdress
Subnettedaddress
Net ID Host ID1 0
Net ID Host ID1 0 Subnet ID
-
7/27/2019 Lecture 17 & 18
17/46
17
Subnets
IP address: subnet part (high order bits)host part (low order
bits)Whats a subnet ? device interfaces withsame subnet part of IPaddresscan physically reacheach other withoutintervening router
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2 223.1.3.1
223.1.3.27
network consisting of 3 subnets
LAN
-
7/27/2019 Lecture 17 & 18
18/46
18
Subnets
How many? 223.1.1.1
223.1.1.3
223.1.1.4
223.1.2.2 223.1.2.1
223.1.2.6
223.1.3.2 223.1.3.1
223.1.3.27
223.1.1.2
223.1.7.0
223.1.7.1 223.1.8.0 223.1.8.1
223.1.9.1
223.1.9.2
-
7/27/2019 Lecture 17 & 18
19/46
-
7/27/2019 Lecture 17 & 18
20/46
20
Supernetting (Address Aggregation)
Allows several networks to be combined tocreate a larger range of addresses.For example this allows an organisation tocombine several Class C blocks together.It aggregates a contiguous block of addresses to form a single larger network.
Identified by less bits of 1s (i.e. shorter network part) in the mask than default one.
-
7/27/2019 Lecture 17 & 18
21/46
21
Supernetting
Summarize a contiguous group of class C addressesusing variable-length maskExample: 200.158.16.0/20IP Address (200.158.16.0) & mask length (20)IP add = 11001000 10011110 00010000 00000000Mask = 11111111 11111111 1111 0000 00000000Contains 16 Class C blocks:From 11001000 10011110 0001 0000 00000000i.e. 200.158.16.0Up to 11001000 10011110 0001 1111 00000000i.e. 200.158.31.0
-
7/27/2019 Lecture 17 & 18
22/46
22
Supernet : an example
Internet part
Host ID
Local part
11000000 11100110 000101 00 00000000
11000000 11100110 000101 01 0000000011000000 11100110 000101 10 0000000011000000 11100110 000101 11 00000000
Network ID
4 Class C IP network addresses
-
7/27/2019 Lecture 17 & 18
23/46
23
Supernet : an example
Four class C networks were put together to form thesupernet:
192.230.20. 0
192.230.21. 0192.230.22. 0
192.230.23. 0
The address of lowest network together with thesupernet mask is required in the global routers for routing : 192.230.20.0 / 22
11000000 11100110 010100 00 00000000
11000000 11100110 010100 01 00000000
11000000 11100110 010100 10 00000000
11000000 11100110 010100 11 00000000
-
7/27/2019 Lecture 17 & 18
24/46
24
Classless Addressing
-
7/27/2019 Lecture 17 & 18
25/46
25
F igur e below shows a block of addresses, in both binary and dotted-decimal notation, granted to a small business that needs 16 addr esses.
Example
-
7/27/2019 Lecture 17 & 18
26/46
-
7/27/2019 Lecture 17 & 18
27/46
27
The first address in the block can befound by setting the rightmost32 n bits to 0s.
Note
-
7/27/2019 Lecture 17 & 18
28/46
28
A block of addresses is granted to a small organization.We know that one of the addresses is 205.16.37.39/28.What is the f irst address in the block?
Solution The binary representation of the given address is 11001101 00010000 00100101 00100111
If we set 3228 rightmost bits to 0, we get
11001101 00010000 00100101 0010000 or
205.16.37.32 .
Example
-
7/27/2019 Lecture 17 & 18
29/46
29
The last address in the block can befound by setting the rightmost32 n bits to 1s.
Note
-
7/27/2019 Lecture 17 & 18
30/46
30
F ind the last address for the block in last Example.
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.16.37.47
Example
-
7/27/2019 Lecture 17 & 18
31/46
31
The number of addresses in the blockcan be found by using the formula2 32n .
Note
-
7/27/2019 Lecture 17 & 18
32/46
32
F ind the number of addresses in last Example.
Example
Solution The value of n is 28, which means that number
of addr esses is 2 32 28
or 16.
-
7/27/2019 Lecture 17 & 18
33/46
-
7/27/2019 Lecture 17 & 18
34/46
34
Solutiona. The first address can be found by ANDing the givenaddresses 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.
Example (continued)
-
7/27/2019 Lecture 17 & 18
35/46
35
b. The last address can be found by ORing the givenaddresses with the complement of the mask. ORinghere is done bit by bit. The result of ORing 2 bits is 0 if
both bits are 0s; the result is 1 otherwise. The
complement of a number is found by changing each 1to 0 and each 0 to 1.
Example (continued)
-
7/27/2019 Lecture 17 & 18
36/46
36
c. The number of addresses can be found bycomplementing the mask, interpreting it as a decimalnumber, and adding 1 to it.
Example (Contd.)
-
7/27/2019 Lecture 17 & 18
37/46
37
A network configuration for the block 205.16.37.32/28
-
7/27/2019 Lecture 17 & 18
38/46
38
The first address in a block isnormally not assigned to any device;it is used as the network address that
represents the organizationto the rest of the world.
Note
-
7/27/2019 Lecture 17 & 18
39/46
39
Configuration and Addresses in a Subnetted Network
32
16
16
-
7/27/2019 Lecture 17 & 18
40/46
40
Three-level hierarchy in an IPv4 address
-
7/27/2019 Lecture 17 & 18
41/46
41
An ISP is granted a block of addresses starting with 190.100.0.0/16(65,536 addresses). The ISP needs to distribute these addresses tothree groups of customers as follows:a. The first group has 64 customers; each needs 256
addresses.
b. The second group has 128 customers; each needs 128addresses.c. The third group has 128 customers; each needs 64
addresses.Design the subblocks and find out how many addresses are stillavailable after these allocations.
Example
-
7/27/2019 Lecture 17 & 18
42/46
42
Solution
Example (continued)
Group 1 F or this group, each customer needs 256 addresses. This
means that 8 (log2 256) bits are needed to def ine each host. The prefix length is then 32 8 = 24. The addr esses are
-
7/27/2019 Lecture 17 & 18
43/46
43
Example (continued)
Group 2 F or this group, each customer needs 128 addresses. This means that 7 (log2 128) bits are needed to def ine each host. The pref ix length i s then 32 7 = 25. The addr esses
are
-
7/27/2019 Lecture 17 & 18
44/46
44
Example (continued) Group 3
F or this group, each customer needs 64 addresses. This means that 6 (log 2 64) bi ts are needed to each host. The pref ix l ength is then 32 6 = 26. The addresses are
Number of granted addresses to the I SP: 65,536 Number of allocated addresses by the I SP: 40,960 Number of avai lable addresses: 24,576
-
7/27/2019 Lecture 17 & 18
45/46
45
An example of address allocation and distribution by an ISP
-
7/27/2019 Lecture 17 & 18
46/46
Example
An organization has a class C network: 200.1.1.0,and it wants to form subnets for 4 departmentswith the number of hosts as follows:Subnet A: 72 hosts
Subnet B: 35 hostsSubnet C: 20 hostsSubnet D: 18 hostsThere are 145 hosts in total.
Provide a possible arrangement of the networkaddress space, together with the respective rangeof IP addresses for each subnet. Explain your work!