Presentation is loading. Please wait.

Presentation is loading. Please wait.

NETE0510 Presented by Dr.Apichan Kanjanavapastit

Similar presentations


Presentation on theme: "NETE0510 Presented by Dr.Apichan Kanjanavapastit"— Presentation transcript:

1 NETE0510 Presented by Dr.Apichan Kanjanavapastit
IP Addresses NETE0510 Presented by Dr.Apichan Kanjanavapastit

2 Introduction The identifier used in the IP layer of the TCP/IP protocol suite to identify each device connected to the Internet is called the Internet address or IP address An IP address is a 32-bit address that uniquely and universally defines the connection of a host or a router to the Internet IP addresses are unique. They are unique in the sense that each address defines one, and only one, connection to the Internet Two devices on the Internet can never have the same address.

3 Notation There are 3 common notations to show an IP address: binary notation, dotted decimal notation, and hexadecimal notation Binary notation. The IP address is displayed as 32 bits. To make the address more readable, one or more spaces is usually inserted between each octet (8 bits)

4 Notation (cont.) Dotted-Decimal Notation. To make the IP address more compact and easier to read, Internet addresses are usually written in decimal form with a decimal point (dot) separating the bytes

5 Example 5.3 Find the error, if any, in the following IPv4 addresses:
b c d Solution a. There should be no leading zeroes (045). b. We may not have more than 4 bytes in an IPv4 address. c. Each byte should be less than or equal to 255. d. A mixture of binary notation and dotted-decimal notation.

6 Notation (cont.) Hexadecimal Notation. Sometimes an IP address is displayed in the format of hexadecimal. Each hexadecimal digit is equivalent to 4 bits. This means that a 32-bit address has 8 hexadecimal digits. This notation is often used in network programming 0x810B0BEF or 810B0BEF16

7 Classful Addressing IP addresses, when started a few decades ago, used the concept of classes This architecture is called classful addressing In the mid-1990s, a new architecture, called classless addressing, was introduced and will eventually supersede the original architecture However, part of the Internet is still using classful addressing, but the migration is very fast

8 Classful Addressing (cont.)
In classful addressing, the IP address space is divided into 5 classes: A, B, C, D and E Each class occupies some part of the whole address space

9 Recognizing Class One can find the class of an address when the address is given in binary notation or dotted-decimal notation If the address is given in binary notation, the first few bits can immediately tell us the class of the address

10 Recognizing Class (cont.)
One can follow the procedure to systematically check the bits and find the class The procedure can be easily programmed in any language

11 Recognizing Class (cont.)
When the address is given in dotted-decimal notation, we need to look at the first byte to determine the class of the address Each class has a specific range of numbers

12 Netid and Hostid In classful addressing, an IP address in classes A, B, and C is divided into netid and hostid These parts are of varying lengths, depending on the class of the address

13 Classes and Blocks One problem with classful addressing is that each class is divided into a fexed number of blocks with each block having a fixed size Class A. Class A is divided into 128 blocks with each block having a different netid Class A addresses were designed for large organization with a large number of hosts or routers attached to their network However, the number of addresses in each block, 16,777,216, is probably larger than the needs of amost all organizations

14 Classes and Blocks (cont.)

15 Classes and Blocks (cont.)
Class B. Class B is divided into 16,384 blocks with each block having a different netid Since each block in this class contains 65,536 addresses, the organization should be large enough to use all of these addresses Class B addresses were designed for mid-size organizations that may have only tens of thousands of hosts or routers attached to their networks

16

17 Classes and Blocks (cont.)
Class C. Class C is divided into 2,097,152 blocks. However, each block in this class contains only 256 addresses, which means the organization should be small enough to need less than 256 address The number of addresses in each block is so limited most organizations do not want a block in this class

18

19 Classes and Blocks (cont.)
Class D. There is just one block of class D addresses. It is designed for multicasting Class E. There is just one block of class E addresses. It was designed for use as reserved addresses

20 Network Addresses Network addresses play a very important role in classful addressing A network address has several properties: The network address is the first address in the block The network address defines the network to the rest of the Inter Given the network address, we can find the class of the address, the block, and the range of the addresses in the block

21 Mask One way we can find the network address is to first find the class of the address and the netid We then set the hostid to zero to find the network address The above method is feasible if we have not subnetted the network; that is, if we have not divided the network into subnetworks A general procedure that can be used involves a mask to find the network address from a given address A mask is a 32-bit number that gives the first address in the block (the network address) when bitwise

22 Masking Concept

23 Default Masks In the AND operation for classful addressing, there are 3 masks, one for each class

24 CIDR Notation Although in classful addressing each address has a default mask, it is sometimes convenient to explicitely indicate the default mask The CIDR (pronounced cider), or classless interdomain routing, notation is used for this purpose In this notation, the number of 1s in the mask is added after a slash at the end of the address For example, the address , which is a class A address with the mask , is written as /8

25 Multihomed Devices A computer that is connected to different networks is called a multihomed computer and will have more than one address, each possibly belonging to a different class A router must be connected to more than one network, otherwise it cannot route

26 Special Addresses Some parts of the address space are used for special addresses

27 Network Address

28 Direct Broadcast Address

29 Limited Broadcast Address
In classes A, B, and C, an address with all 1s for the netid and hostid defines a broadcast address in the current network However, a route will block a packet having this type of address to confine the broadcasting to the local network

30 This Host on This Network
If an IP address is composed of all zeros, it means this host on this network This is used by a host at bootstrap time when it does not know its IP address

31 Specific Host on This Network
An IP address with a netid of all zeros means a specific host on this network It is used by a host to send a message to another host on the same network

32 Loopback Address The IP address with the first byte equal to 127 is used for the loopback address, which is an address used to test the software on a machine When this address is used, a packet never leaves the machine; it simply returns to the protocol software

33 Private Address A number of blocks in each class are assigned for private use. They are not recognized globally These address are used either in isolation or in connection with network address translation techniques

34 Unicast, Multicast, and Broadcast Addrsses
Unicast addresses. Unicast communication is one-to-one. When a packet is sent from an individual source to an individual destination, a unicast communication takes place Multicast addresses. Multicast communication is one-to-many. When a packet is sent from an individual source to a group of destination, a multicast communication takes place Broadcast Addresses. Broadcast communication is one-to-all. The Internet allows broadcasting only at the local level

35 Sample internet

36 Subnetting In subnetting, a network is divided into several smaller subnetworks with each subnetwork having its own subnetwork address IP addresses are designed with 2 levels of hierarchy. However, in many cases, these 2 levels of hierarchy are not enough since the hosts cannot be organized into groups One solution is subnetting, the further division of a network into smaller networks called subnetworks (or subnets)

37

38 Subnetting (cont.) Adding subnetworks creates an intermediate level of hierarchy in the IP addressing system Now we have 3 levels: site, subnet, and host. The site is the first level. The 2nd level is the subnet. This host is the 3rd level The routing of an IP datagram now involves 3 steps: delivery to the site, delivery to the subnetwork, and delivery to the host

39 Subnet Mask When a network is subnetted, we must have a subnet mask
The default mask creates the network address; the subnet mask creates the subnetwork address

40 Number of Subnetworks/ Number of Addresses per Subnet
The number of subnetworks can be found by counting the extra 1s that are added to the default mask to make the subnetmask The number of addresses per subnetwork can be found by counting the number of 0s in the subnet mask

41 Supernetting In supernetting, an organization can combine several class C blocks to create a larger range of addresses

42 Supernet Mask A supernet mask is the reverse of a subnet mask
A supernet mask for class C has less 1s than the default mask for this class

43 Obsolescence The idea of subnetting and supernetting of classful addresses is almost obsolete.

44 Classless IP Addressing
During the 1990s, Internet service providers (ISPs) came into prominece An ISP is granted a large range of addresses and then subdivides the addresses, giving a range to household or a small business To facilitate this evolution the problems of classful addressing, in 1996, the Internet authorities announced a new architecture called classless addressing

45 Variable-Length Blocks
In classless addressing, variable-length blocks are assigned that belong to no class We can have a block of 2 addresses, 4 addresses, 128 addresses, and so on In this architecture, the entire address space (232 addresses) is divided into blocks of different sizes

46 Restrictions Number of addresses in a block. There is only one restriction on the number of addresses in a block; it must be a power of 2 (2, 4, 8, …) First address. The 1st address must be evenly divisible by the number of addresses. For example, if a block contains 4 addresses, the 1st address must be divisible by 4

47 Example 1 Which of the following can be the beginning address of a block that contains 16 addresses? a b c d Solution Only two are eligible (a and c). The address is eligible because 32 is divisible by 16. The address is eligible because 80 is divisible by 16.

48 Restrictions (cont.) Mask. In classless addressing, the address must be accompanied by the mask. The mask is given in CIDR notation with the number of 1s in the mask The n after the slash defines the number of bits that are the same in every address in the block. If n is 20, it means the 20 leftmost bits are identical in each address with 12 bits not the same

49 Restrictions (cont.) Prefix and Prefix length. Prefix is similar to netid and the prefix length is the length of the prefix (n in the CIDR notation). There is a one-to-one relationship between a mask and a prefix length

50 Restrictions (cont.) Suffix and suffix length. The suffix is the varying part (similar to the hostid). The suffix length is the length of the suffix (32-n) in CIDR notation

51 Finding the Block In classless addressing, an organization is assigned a block of address The size of the block is not fixed; it varies according to the needs of the organization However, when a classless address is given, we can find the block We can find the 1st address, the number of addresses, and the last address

52 Finding the First Address
In classless addressing, the prefix length is the mask We can AND the mask and the address to find the first address Just keep the first n bits and change the rest of the bits to 0s

53 Example 2 What is the first address in the block if one of the addresses is /27? Solution The prefix length is 27, which means that we must keep the first 27 bits as is and change the remaining bits (5) to 0s. The following shows the process: Address in binary: Keep the left 27 bits: Result in CIDR notation: /27

54 Finding the Number of Addresses in the Block
The total number of addresses in the block is 232-n Example 3 Find the number of addresses in the block if one of the addresses is /20. Solution The prefix length is 20. The number of addresses in the block is 232−20 or 212 or Note that this is a large block with 4096 addresses.

55 Finding the Last Address in the Block
We give 2 methods that find the last address in the block In the 1st method, we add the number of addresses in the block minus 1 to the first address to find the last address In the 2nd method, we add the first address to the complement of the mask The complement of the mask is found by changing all 0s to 1s and vice versa

56 Example 4 Using the first method, find the last address in the block if one of the addresses is /20. Solution We found in the previous examples that the first address is /20 and the number of addresses is To find the last address, we need to add 4095 (4096 − 1) to the first address.

57 Example 4 (Continued) To keep the format in dotted-decimal notation, we need to represent 4095 in base 256 (see Appendix B) and do the calculation in base 256. We write 4095 as We then add the first address to this number (in base 255) to obtain the last address as shown below: The last address is /20.

58 Example 5 Using the second method, find the last address in the block if one of the addresses is /20. Solution The mask has twenty 1s and twelve 0s. The complement of the mask has twenty 0s and twelve 1s. In other words, the mask complement is or We add the mask complement to the beginning address to find the last address.

59 Example 5 (Continued) We add the mask complement to the beginning address to find the last address. The last address is /20.

60 Finding the Block To find the block, find the first address, the number of addresses, and the last address

61 Find the block if one of the addresses is 190.87.140.202/29.
Example 6 Find the block if one of the addresses is /29. Solution We follow the procedure in the previous examples to find the first address, the number of addresses, and the last address. To find the first address, we notice that the mask (/29) has five 1s in the last byte. So we write the last byte as powers of 2 and retain only the leftmost five as shown below:

62 Example 7 (Continued) The leftmost 5 numbers are ➡ The first address is /29 The number of addresses is 232−29 or 8. To find the last address, we use the complement of the mask. The mask has twenty-nine 1s; the complement has three 1s. The complement is If we add this to the first address, we get /29. In other words, the first address is /29, the last address is /20. There are only 8 addresses in this block.

63 Example 8 Show a network configuration for the block in the previous example. Solution The organization that is granted the block in the previous example can assign the addresses in the block to the hosts in its network. However, the first address needs to be used as the network address and the last address is kept as a special address (limited broadcast address). Figure 5.5 shows how the block can be used by an organization. Note that the last address ends with 207, which is different from the 255 seen in classful addressing.

64

65 Granted Block The block of addresses is granted by an ISP
The granted block is defined by the first address and the prefix length For instance, in the previous example, the block is defined as /29

66 Subnetting When an organization is granted a block of addresses, it can create subnets to meet its needs The network administrator can design a subnet mask for each subnet The prefix length (n) increases to define the subnet prefix length

67 Finding the Subnet Mask
The number of desired subnets defines the subnet prefix If the number of subnets is s, the number of extra 1s in the prefix length is log2s, where s = 2number of extra 1s If we want fixed-length subnets (each subnet has the same number of addresses), the number of subnets needs to be a power of 2

68 Example 9 An organization is granted the block /26. The organization needs 4 subnets. What is the subnet prefix length? Solution We need 4 subnets, which means we need to add two more 1s (log2 4 = 2) to the site prefix. The subnet prefix is then /28.

69 Finding the Subnet Addresses
After finding the subnet mask, it is easy to find the range of addresses in each subnet

70 Example 10 What are the subnet addresses and the range of addresses for each subnet in the previous example? 1. The first address in the first subnet is /28, using the procedure we showed in the previous examples. Note that the first address of the first subnet is the first address of the block. The last address of the subnet can be found by adding 15 (16 −1) to the first address. The last address is /28.

71 Example 10 (Continued) 2.The first address in the second subnet is /28; it is found by adding 1 to the last address of the previous subnet. Again adding 15 to the first address, we obtain the last address, /28. 3. Similarly, we find the first address of the third subnet to be /28 and the last to be /28. 4. Similarly, we find the first address of the fourth subnet to be /28 and the last to be /28.

72

73 Variable-Length Subnets
We can also design subnets having variable-length masks This allows an organization to assign addresses based on the needs of the subnet

74 Example 11 An organization is granted a block of addresses with the beginning address /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.

75 Example 11 (Continuted) 1. We use the first 128 addresses for the first two subnets, each with 64 addresses. Note that the mask for each network is /26. 2. We use the next 64 addresses for the next two subnets, each with 32 addresses. Note that the mask for each network is /27. 3. We use the next 48 addresses for the next three subnets, each with 16 addresses. Note that the mask for each network is /28. 4. We use the last 16 addresses for the last four subnets, each with 4 addresses. Note that the mask for each network is /30.

76

77 Address Allocation Address allocation is the responsibility of a global authority called the Internet Corporation for Assigned Names and Addresses (ICANN) It usually assigns a large block of addresses to an ISP to be distributed to its Internet users Each ISP, in turn, divides its assigned block into smaller subblocks and grants the subblocks to its customers

78 Example 12 An ISP is granted a block of addresses starting with /16 (65,536 addresses). The ISP needs to distribute these addresses to three 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 addresses c. The third group has 128 customers; each needs 64 addresses. Design the subblocks and find out how many addresses are still available after these allocations.

79 Example 12 (Continued) Group 1 For this group, each customer needs 256 addresses. This means the suffix length is 8 (28 =256). The prefix length is then 32 − 8 = 24. The addresses are: 1st Customer / /24 2nd Customer / / th Customer / /24 Total = 64 × 256 = 16,384

80 Example 12 (Continued) Group 2 For this group, each customer needs 128 addresses. This means the suffix length is 7 (27 =128). The prefix length is then 32 − 7 = 25. The addresses are: 1st Customer / /25 2nd Customer / /25 · · · 128th Customer / /25 Total = 128 × 128 = 16,384

81 Example 12 (continued) Group 3 For this group, each customer needs 64 addresses. This means the suffix length is 6 (26 = 64). The prefix length is then 32 − 6 = 26. The addresses are: 1st Customer / /26 2nd Customer / /26 · · · 128th Customer / /26 Total = 128 × 64 = 8,192

82 Example 12 (continued) Number of granted addresses to the ISP: 65,536
Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576

83 5-5 NAT The distribution of addresses through ISPs has created a new problem. If the business grows or the household needs a larger range, the ISP may not be able to grant the demand because the addresses before and after the range may have already been allocated to other networks. In most situations, however, only a portion of computers in a small network need access to the Internet simultaneously. A technology that can help in this cases is network address translation (NAT).

84 Figure NAT

85 Figure 5.40 Address resolution

86 Figure Translation

87


Download ppt "NETE0510 Presented by Dr.Apichan Kanjanavapastit"

Similar presentations


Ads by Google