1 / 97

Behrouz A. Forouzan TCP/IP Protocol Suite, 3 rd Ed.

Behrouz A. Forouzan TCP/IP Protocol Suite, 3 rd Ed. IP Addressing. IPv4 Addresses. An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet.

tpenny
Download Presentation

Behrouz A. Forouzan TCP/IP Protocol Suite, 3 rd Ed.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed. IP Addressing

  2. IPv4 Addresses • An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet. • The address space of IPv4 is 232 or 4,294,967,296. • There are two prevalent notations to show an IP address: binary notation and dotted decimal notation.

  3. IPv4 Address • Each number in dotted-decimal notation is a value ranging from 0 to 255.

  4. Example 1 Change the following IP addresses from binary notation to dotted-decimal notation. a. 10000001 00001011 00001011 11101111b. 11000001 10000011 00011011 11111111c. 11100111 11011011 10001011 01101111d. 11111001 10011011 11111011 00001111 SolutionWe replace each group of 8 bits with its equivalent decimal number and add dots for separation: a. 129.11.11.239 b. 193.131.27.255c. 231.219.139.111 d. 249.155.251.15

  5. Example 2 Change the following IP addresses from dotted-decimal notation to binary notation. a. 111.56.45.78 b. 221.34.7.82c. 241.8.56.12 d. 75.45.34.78 Solution We replace each decimal number with its binary equivalent: a. 01101111 00111000 00101101 01001110b. 11011101 00100010 00000111 01010010c. 11110001 00001000 00111000 00001100d. 01001011 00101101 00100010 01001110

  6. Example 3 Find the error, if any, in the following IP addresses: a. 111.56.045.78 b. 221.34.7.8.20 c. 75.45.301.14 d. 11100010.23.14.67 Solution a. There are no leading zeroes in dotted-decimal notation (045). b. We may not have more than four numbers in an IP address. c. In dotted-decimal notation, each number is less than or equal to 255; 301 is outside this range. d. A mixture of binary notation and dotted-decimal notation is not allowed.

  7. Classful Addressing • In classful addressing, the address space is divided into five classes: A, B, C, D, and E. • Each class occupies some part of the address space. • If the address is given in binary notation, the first few bits can immediately tell us the class of the address. • If the address is given in decimal-dotted notation, the first byte defines the class.

  8. Finding the Classes in Binary and Dotted-Decimal Notation

  9. Finding the Address Class

  10. Addresses per Class

  11. Example 5 • 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

  12. Classes and Blocks • One problem with classful addressing is that each class is divided into a fixed number of blocks with each block having a fixed size.

  13. Classes and Blocks • Class A addresses were designed for large organizations with a large number of attached hosts or routers. • Class B addresses were designed for midsize organizations with tens of thousands of attached hosts routers. • Class C addresses were designed for small organizations with a small number of attached hosts or routers.

  14. Classes and Blocks • Class D addresses were designed for multicasting. • Each address in this class is used to define one group of hosts on the Internet. • Class E addresses were reserved for future use. • In classful addressing, a large part of the available addresses were wasted!.

  15. Netid and Hostid • An IP address in class A, B, or C is divided into Netid and Hostid. • These parts are of varying lengths, depending on the class of the address. • In class A, one byte defines the netid and three bytes define the hostid. • In class B, two bytes define the netid and two bytes define the hostid. • In class C, three bytes define the netid and one byte defines the hostid.

  16. Netid and Hostid

  17. Blocks in Class A

  18. Blocks in Class B

  19. Blocks in Class C

  20. Network Addresses • Network addresses play a very important role in classful addressing. • The network address is the first address in the block. • The network address defines the network to the rest of the of the Internet. • Given the network address, we can find the class of the address, the block, and the range of the addresses in the block.

  21. Example 6 Given the network address 17.0.0.0, find the class, the block, and the range of the addresses. SolutionThe class is A because the first byte is between 0 and 127. The block has a netid of 17. The addresses range from 17.0.0.0 to 17.255.255.255.

  22. Example 7 Given the network address 132.21.0.0, find the class, the block, and the range of the addresses. SolutionThe class is B because the first byte is between 128 and 191. The block has a netid of 132.21. The addresses range from 132.21.0.0 to 132.21.255.255.

  23. Example 8 Given the network address 220.34.76.0, find the class, the block, and the range of the addresses. SolutionThe class is C because the first byte is between 192 and 223. The block has a netid of 220.34.76. The addresses range from 220.34.76.0 to 220.34.76.255

  24. Mask • How we can find the beginning address of the block (network address) if an address is given? • This is important because to route a packet to the correct network, a router needs to extract a network address from the destination address in the packet header. • The general procedure that can be used involves a mask to find the address from a given address.

  25. Mask Concept • A mask is a 32-bit number that gives the first address in the block when bitwise ANDed with an address in the block.

  26. Default Masks • The network address is the beginning address of each block. It can be found by applying the default mask to any of the addresses in the block (including itself). It retains the netid of the block and sets the hostid to zero

  27. Applying the Mask • Applying the mask to an unsubnetted network is simple. Two rules can help find the network address without applying the AND operation to each bit. • If the mask byte is 255, retain the corresponding byte in the address. • If the mask byte is 0, set the corresponding byte to 0.

  28. Example 9 Given the address 23.56.7.91, find the beginning address (network address). SolutionThe default mask is 255.0.0.0, which means that only the first byte is preserved and the other 3 bytes are set to 0s. The network address is 23.0.0.0

  29. Example 10 Given the address 132.6.17.85, find the beginning address (network address). SolutionThe default mask is 255.255.0.0, which means that the first 2 bytes are preserved and the other 2 bytes are set to 0s. The network address is 132.6.0.0

  30. Example 11 Given the address 201.180.56.5, find the beginning address (network address). SolutionThe default mask is 255.255.255.0, which means that the first 3 bytes are preserved and the last byte are set to 0s. The network address is 201.180.56.0

  31. Multi-homed Devices • Any device connected to more than one network must have more than one Internet address. • A computer that is connected to different networks is called a multi-homed computer and will have more than one address. • A router must be connected to more than one network. Why? • Therefore, a router definitely has more than one IP address, one for each interface.

  32. Multi-homed Devices

  33. Special Addresses

  34. Network Address

  35. Direct Broadcast Address

  36. Limited Broadcast Address

  37. This Host on This Network

  38. Specific Host on This Network

  39. Loop-back Address

  40. Private Addresses

  41. Unicast, Multicast, and Broadcast • Unicast addresses • When a packet is sent from an individual source to an individual destination. • One-to-one • Unicast addresses belong to classes A, B, or C. • Multicast addresses • When a packet is sent from an individual source to a group of destinations. • One-to-many • A multicast address is a class D address. • Broadcast addresses • One-to-all

  42. Subnetting • In subnetting, a network is divided into several smaller sub-networks with each subnet having its own subnet address.

  43. A Network Without Subnetting

  44. A Network With Subnetting

  45. Addresses in A Network With and Without Subnetting

  46. Default Mask and Subnet Mask

  47. Example 12 What is the subnetwork address if the destination address is 200.45.34.56 and the subnet mask is 255.255.240.0? SolutionWe apply the AND operation on the address and the subnet mask. Address ➡ 11001000 00101101 00100010 00111000 Subnet Mask ➡ 11111111 11111111 11110000 00000000 Subnetwork Address ➡ 11001000 00101101 00100000 00000000.

  48. Default Mask and Subnet Mask

  49. Default Mask and Subnet Mask • Number of Subnets • The number of subnets can be found by counting the extra 1s that are added to the default mask to make the subnet mask. • E.g. the number of extra 1s in the previous figure is 3; therefore, the number of subnets is 23 or 8. • Number of addresses per subnet • The number of addresses per subnet can be found by counting the number of 0s in the subnet mask. • E.g. the number of 0s is 13; therefore, the number of possible addresses in each subnet is 213 = 8192.

  50. Supernetting • In supernetting, an organization can combine several class C blocks to create a larger range of addresses. • Supernet mask • A supernet mask has less 1s than the default mask. • In subnetting, we need the first address of the subnet and the subnet mask to define the range of addresses. • In supernetting, we need the first address of the supernet and the supernet mask to define the range of addresses.

More Related