Week11 lec1

616 views
395 views

Published on

Computer Networks

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
616
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Week11 lec1

  1. 1. Chapter 4 Network Layer Computer Networking: A Top Down Approach 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.
  2. 2. IP Address Classes
  3. 3. Netid and Hostid
  4. 4. Issues with Classful Addressing • Flexibility in Internal addressing: – Thousands of hosts connected to one large network • Inefficient Use of Address Space: – Wastage of limited IP address space. • Router Table Entries: – Increase in router table entries. Example: • Hosts needed by organization are 5000 • Hosts in B 65,536 and in C 256 – Organization with 5,000 hosts is in a dilemma – It can only choose to either waste 90% of a Class B address or use 20 different Class C networks. – Replacing with 20 C networks will increase entries in routers
  5. 5. Subnetting • Subnetting adds an additional level to the hierarchy of structures used in IP addressing. • IP addresses must be broken into three elements instead of two. • Network ID is unchanged • The host ID into a subnet ID and host ID. • These subnet ID bits are used to identify each subnet within the network. • Splitting the host ID into subnet ID and host ID, we reduce the size of the host ID portion of the address • Class A networks have 24 bits to split between the subnet ID and host ID: class B networks have 16, and class C networks only 8.
  6. 6. Subnetting The more bits we use from the host ID for the subnet ID, the more subnets we can have but the fewer hosts we can have for each subnet.
  7. 7. Subnet Mask • In classful addressing without subnetting – Routers use the first octet of the IP address to determine what the class is of the address – From class they know which bits are the network ID and which are the host ID. • In subnetting, the routers also need to know how that host ID is divided into subnet ID and host ID. – This division can be arbitrary for each network. – There is no way to tell how many bits belong to each simply by looking at the IP address. – The additional information about which bits are for the subnet ID and which for the host ID must be communicated to devices that interpret IP addresses. – This information is given in the form of a 32-bit binary number called a subnet mask.
  8. 8. Determining the Subnet Mask • The subnet mask is a 32-bit binary number • It is created so that it has a one bit for each corresponding bit of the IP address that is part of its network ID or subnet ID, and a zero for each bit of the IP address’s host ID. • The mask thus tells TCP/IP devices which bits in that IP address belong to the network ID and subnet ID, and which are part of the host ID.
  9. 9. Determining the Subnet Mask • Suppose we have the Class B network 154.71.0.0. • We decide to subnet this using 5 bits for the subnet ID and 11 bits for the host ID. • In this case, the subnet mask will have 16 ones for the network portion (since this is Class B) followed by 5 ones for the subnet ID, and 11 zeroes for the host ID. • That's “11111111 11111111 11111000 00000000” in binary, with the bits corresponding to the subnet ID highlighted. • Converting to dotted decimal, the subnet mask would be 255.255.248.0
  10. 10. Determining the Subnet Mask Example • A company is granted the site address 210.70.64.0. The company needs six subnets. What is the subnet Mask?
  11. 11. Determining the Subnet Mask Solution • Class C address • 6 subnets means 3 bits in the subnet id • 3 ones in the subnet mask • 11111111 11111111 11111111 11100000 • 255.255.255.224 (decimal)
  12. 12. Using a Subnet Mask • Suppose we have a host on a network with an IP of 154.71.150.42 and subnet mask 255.255.248.0 • A router needs to figure out which subnet this address is on. 154.71.144.0 is the IP address of the subnet to which 154.71.150.42 belongs.
  13. 13. Designing a Subnet • • • • Analyze the requirements Determine the subnet mask Each Subnet address Host Addresses Example: • Network Address: 211.77.20.0 • 8 sub networks • 32 hosts in each
  14. 14. Designing a Subnet
  15. 15. Designing a Subnet 211.77.20.0 in binary is • 11010011 01001101 00010100 00000000 • Subnet 0 – substitute “000” for the subnet ID bits (211.77.20.0) • Subnet 1 – substitute “001” for the subnet ID bits, to yield the following: – 11010011 01001101 00010100 00100000 (211.77.20.32 ) • Subnet 2 – substitute 010 for the subnet ID bits to give: – 11010011 01001101 00010100 01000000 (211.77.20.64) • Subnet 3 – Substitute 01100000 (211.77.20.96) • Subnet 7 (last) – Substitute 11100000 (211.77.20.224)
  16. 16. Designing a Subnet
  17. 17. Determining Host Address • Subnet #0 – First address: 11010011 01001101 00010100 00000000 (211.77.20.0) – Second address: 11010011 01001101 00010100 00000001 (211.77.20.1) – Third address: 11010011 01001101 00010100 00000010 (211.77.20.2) – Last address: 11010011 01001101 00010100 00011111 (211.77.20.31) • Subnet #6. It has “110” for the subnet bits instead of “000”. – First address: 11010011 01001101 00010100 11000000 (211.77.20.192) – Second address: 11010011 01001101 00010100 11000001 (211.77.20.193) – Third address: 11010011 01001101 00010100 11000010 (211.77.20.194) – Last address: 11010011 01001101 00010100 11011111 – (211.77.20.223) Similarly for other subnets •
  18. 18. Designing a Subnet Home Assignment • A company is granted the site address 172.16.0.0. The company needs 1000 subnets. Design the subnets?
  19. 19. Classless Addressing •To overcome address depletion •No classes, but the address are still granted in blocks. •The size of the block( the number of addresses) varies based on the nature and size of the entity. • Household: 2 addresses •Large organization: thousands of addresses • ISP: thousands or hundreds of thousands based on the number of customers it may serve. •The number of addresses in a block must be power of two (2,4,8…..). •Classless Inter Domain Routing (CIDR)
  20. 20. Mask:Slash Notation • Each mask is made of some ones from the left and followed by some 0s. • Instead of 255.255.255.224 – Mask has 27 1s – Attach this number to a classless address –x.y.z.t/n • n defines the number of bits that are same in every block.
  21. 21. Classless Addressing: Mask • The n leftmost bits are 1s • 32-n rightmost bits are 0s • In CIDR, n has a value from 0 to 32 and used to show the mask in the form /n. • A block of addresses can be defined as x.y.z.t/n in which x.y.z.t defines one of the addresses and the /n defines the mask. Example: 172.31.1.2/25
  22. 22. Classless Addressing: Mask
  23. 23. Address allocation with Classful Addressing Need 10 addresses Class C. Give them 256. Need 200 addresses Class C. Give them 256. Need 500 addresses Class B. Give them 65,536. Need 1000 addresses Class B. Give them 65,536. Need 4000 addresses Class B. Give them 65,536. Fig courtesy: Ward Abingdon and Witney College CCNA Exploration
  24. 24. Address allocation with Classless Addressing Need 10 addresses /28. Give them 16. Need 200 addresses /24. Give them 256. Need 500 addresses /23. Give them 512. Need 1000 addresses /22. Give them 1024. Need 4000 addresses /20. Give them 4096. Fig courtesy: Ward Abingdon and Witney College CCNA Exploration
  25. 25. Classless Addressing • A small organization is given a block with a beginning address 205.16.37.24/29.What is the range of the block? • Number of bits for hosts =32-29=3 • Total hosts=8 • The first address is 205.16.37.24 • The last address is 205.16.37.31
  26. 26. Classless Addressing • 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 first address in the block? The given address in binary is • 11001101 00010000 00100101 00100111 • If we set right most 4 bits to 0 we get • 11001101 00010000 00100101 00100000 – 205.16.37.32 (decimal)
  27. 27. Classless Addressing • A block of addresses is granted to a small organization. We know that one of the addresses is 167.199.170.82/27.What is the first address in the block?
  28. 28. Classless Addressing Solution • The last byte is 01010010 • Changing the last 5 bits to 0s we get • 01000000 or 64 • The first address in the block is 167.199.170.64/27
  29. 29. Subnetting • An organization is granted the block 17.12.40.0/26. The organization has three offices and needs to divide the addresses into three sub-blocks of 32,16 and 16 addresses.What are the subnet addresses and the range of addresses for each subnet?
  30. 30. Subnetting Solution: • For subnet 1 that requires 32 addresses – The mask is 32-5=27 • For subnet 2 that requires 16 addresses – The mask is 32-4=28 • For subnet 3 that requires 16 addresses – The mask is 32-4=28 • This means we have the masks 27,28,28 with the organization mask being 26
  31. 31. Subnetting Solution: • For subnet 1 – The first address is 17.12.40.0/27 – The last address is 17.12.40.31/27 • For subnet 2 – The first address is 17.12.40.32/28 – The last address is 17.12.40.47/28 • For subnet 3 – The first address is 17.12.40.48/28 – The last address is 17.12.40.63/28
  32. 32. Subnetting • An organization is granted the block 130.34.12.64/26. The organization needs to have four subnets with 16 hosts. What are the subnet addresses and the range of addresses for each subnet?
  33. 33. Subnetting • For all subnets – The mask is 32-4=28 • For subnet 1 – The first address is 130.34.12.64/28 – The last address is 130.34.12.79/28 • For subnet 2 – The first address is 130.34.12.80/28 – The last address is 130.34.12.95/28 • For subnet 3 – The first address is 130.34.12.96/28 – The last address is 130.34.12.111/28 • For subnet 4 – The first address is 130.34.12.112/28 – The last address is 130.34.12.127/28
  34. 34. Subnetting Home Assignment An organization is granted a block of addresses with the beginning address 14.24.74.0/24. There are 232−24= 256 addresses in this block. The organization needs to have 11 subnets as shown below: a. two subnets, each with 64 addresses. b. two subnets, each with 32 addresses. c. three subnets, each with 16 addresses. d. four subnets, each with 4 addresses. Design the subnets.

×