Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/20/2017 Unit –6 Network Layer: Logical Addressing.

Similar presentations


Presentation on theme: "4/20/2017 Unit –6 Network Layer: Logical Addressing."— Presentation transcript:

1 4/20/2017 Unit –6 Network Layer: Logical Addressing

2 Overview 4/20/2017 Ipv4 addresses Ipv6 addresses

3 ADDRESSING Four levels of addresses are used in an internet employing the TCP/IP protocols: physical, logical, port, and specific.

4 Physical Addressing A network adapter has a unique and permanent physical address. A Physical address is also called MAC address is a 48-bit flat address burned into the ROM of the NIC (Network Interface Card) card at the factory which is a Layer1 device of the OSI model. On a local area network, low-lying hardware-conscious protocols deliver data across the physical network using the adapter's physical address. On a basic ethernet network, for example, a computer sends messages directly onto the transmission medium. The network adapter of each computer listens to every transmission on the local network to determine whether a message is addressed to its own physical address.

5 Physical Addressing

6 Logical Addressing A Logical address also called IP address is a 32- bit address assigned to each system in a network. This works in Layer-3 of OSI Model. This would be generally the IP address.

7 Logical Addressing

8 Logical Addressing

9 Logical Addressing

10 Logical Addressing

11 IP Addresses

12 The physical addresses will change from hop to hop,
but the logical addresses usually remain the same.

13 Port Address A single wire connects the network to the distant computer, but there may be many applications on that machine-a web server, an ftp server, a telnet server, etc.-waiting for somebody to connect. So the question arises: How do you use one wire and one IP address to connect to the right application? The answer: Ports. Port address is transport layer ID (similar to IP in Network Layer) which identify the application on the host. A port address is a 16-bit address represented by one decimal number as shown. Telnet Port 23 Mail (smtp, or send mail) Port 25 World Wide Web Port 80 Post Office (pop, or get mail) Port 110 News (nntp) Port 119

14 4/20/2017 IPv4 ADDRESSES

15 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. Address Space Notations Classful Addressing Classless Addressing Network Address Translation (NAT)

16 IPv4 ADDRESSES IPv4 protocol address has an address space An address is the total number of addresses used by the protocol. If a protocol uses N bits to define an address the address space is 2N value. Notations Binary Notation and Dotted Decimal Notation Binary Notation: 32 bits are used each octet is referred as byte, 4 byte address Dotted Decimal Notation: Written in Decimal point and each byte is separated by dots.

17 An IP address is a 32-bit sequence of 1s and 0s.
IPv4 ADDRESSES An IPv4 address is 32 bits long. The IPv4 addresses are unique and universal. An IP address is a 32-bit sequence of 1s and 0s. To make the IP address easier to use, the address is usually written as four decimal numbers separated by periods. This way of writing the address is called the dotted decimal format. The address space of IPv4 is 232 or 4,294,967,296.

18 Classful Addressing

19 Defined when IP was standardized in 1981
Internet Addresses (IP Addresses) Defined when IP was standardized in 1981 IP addresses are 32-bit long and consist of: a network address part – network identifier a host address part – host number within that network IP addresses are grouped into classes (A,B,C) depending on the size of the network identifier and the host part of the address A fourth class (Class D) was defined later (1988) for Multicast addresses

20 Class A Class B Class C Internet Address Classes
126 networks (0 and 127 reserved) (1 byte starts from but MSB bit is always 0) Assigned to very large size networks where number of hosts 65K to16M Class B 16384 networks Assigned to Intermediate size networks where number of hosts 256 to 65K Class C networks Assigned to smaller networks where #hosts < 256

21 Finding the classes in binary and dotted-decimal notation
Number of blocks and block size in classful IPv4 addressing

22 Every IP address has two parts:
Network Host IP addresses are divided into classes A,B and C to define large, medium, and small networks. The Class D address was created to enable multicasting. IETF reserves Class E addresses for its own research.

23 Reserved IP ADDRESSES Certain host addresses are reserved and cannot be assigned to devices on a network. An IP address that has binary 0s in all host bit positions is reserved for the network address. An IP address that has binary 1s in all host bit positions is reserved for the broadcast address.

24 Example Change the following IPv4 addresses from binary notation to dotted-decimal notation. Solution

25 Example Change the following IPv4 addresses from dotted-decimal notation to binary notation. Solution

26 Find the error, if any, in the following IPv4 addresses.
Example Find the error, if any, in the following IPv4 addresses. 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.

27 Find the class of each address. a. 00000001 00001011 00001011 11101111
Example Find the class of each address. a b c d 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.

28 Netid and Hostid Netid and Hostid
In classful addressing an IP address in class A,B, C is divided into netid and hostid In class A one byte defines the netid and 3 bytes defines the host ID In class B 2 byte defines the netid and 2 bytes defines the host ID In class C 3 byte defines the netid and 1 bytes defines the host ID

29 Mask Default masks for classful addressing Mask
The mask helps to find the netid and hostid In class A first 8 bits defines the netid; the next 24 bits hostid, hence in this first 8 are 1s. /n i.e 8 or 16 or 24 shows the mask for each class. This /n notation is called Classless Interdomain Routing (CIDR) Default masks for classful addressing

30 Subnets

31 Problems with Classes Class A usually too big Class C often too small Not enough Class Bs Inefficient utilisation of address space Solution: Extending the network part of the address: Subnetting In classful addressing, a large part of the available addresses were wasted.

32 A campus network consisting of LANs for various departments
Subnetting Subnets . A campus network consisting of LANs for various departments

33 Subnetting Subnet Mask
Subnet masks are applied to an IP address to identify the Network portion and the Host portion of the address. A bitwise logical AND operation between the address and the subnet mask s performed in order to find the Network Address or number. Default Subnet Masks Class A Class B Class C

34 Logical Bitwise AND Operation
Subnetting Logical Bitwise AND Operation Example It’s a Class B, so the subnet mask is: In Binary: By doing this, the computer has found that Network Address is

35 What is the Network Address? What is the host portion of the address?
Subnetting Another Example: Suppose we have the address of: ? What class is it? Class C What is the subnet mask? What is the Network Address? What is the host portion of the address?

36 Subnetting You can manipulate your subnet mask in order to create more network addresses. If you have a Class C network, how many individual host addresses can you have? 1 to 254 Remember, you can’t have all “0”s and all “1”s in the host portion of the address (Reserved address). So we cannot use (all “0”s) or (all “1”s) as a host address.\ Remember, an address of all “0”s or all “1”s cannot be used in the last octet (or host portion). All “0”s signify the Network Address and all “1”s signify the broadcast address

37 Subnetting Example We have 1 Class C Network (206.15.143.0)
And we have 254 host address (1 to 254) But what if our LAN has 5 networks in it and each network has no more than 30 hosts on it? Do we apply for 4 more Class C licenses, so we have one for each network? We would be wasting 224 addresses on each network, a total of 1120 addresses

38 Subnetting Subnetting is a way of taking an existing class license and breaking it down to create more Network Addresses. This will always reduce the number of host addresses for a given network. Subnetting makes more efficient use of the address.

39 How Does Subnetting Work?
Additional bits can be added (changed from 0 to 1) to the subnet mask to further subnet, or breakdown, a network. When the logical AND is done by the computer, the result will give it a new Network (or Subnet) Address. Why do computers need to specify their Network Address? For when host doesn’t know what it is it can find out. The restriction of not having all “1”s or “0”s also implies that we cannot have a 1 bit subnet mask.

40 Subnetting We ask our ISP for a Class C license.
They give us the Class C bank of This gives us 1 Network ( ) with the potential for 254 host addresses ( to ). But we have a LAN made up of 5 Networks with the largest one serving 25 hosts. So we need to Subnet our 1 IP address...

41 Subnetting So How Does This Work?
To calculate the number of subnets (networks) and/or hosts, we need to do some math: Use the formula 2n-2 where the n can represent either how many subnets (networks) needed OR how many hosts per subnet needed (where -2 is and addresses are not used).

42 Subnetting So How Does This Work? We know we need at least 5 subnets. So 23-2 will give us 6 subnet addresses (Network Addresses). We know we need at least 25 hosts per network will give us 30 hosts per subnet (network). This will work, because we can steal the first 3 bits from the host’s portion of the address to give to the network portion and still have 5 (8-3) left for the host portion:

43 Let’s go back to what portion is what: We have a Class C address:
Subnetting Break it down: Let’s go back to what portion is what: We have a Class C address: NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH With a Subnet mask of: We need to steal 3 bits from the host portion to give it to the Network portion: NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNHHHHH

44 This will change our subnet mask to the following:
Subnetting Break it down: NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNHHHHH This will change our subnet mask to the following: Above is how the computer will see our new subnet mask, but we need to express it in decimal form as well: =224

45 Subnetting What address is what?
Which of our 254 addresses will be a Subnet (or Network) address and which will be our host addresses? Because we are using the first 3 bits for our subnet mask, we can configure them into eight different ways (binary form):

46 Subnetting What address is what? Which of our 254 addresses will be a Subnet (or Network) address and which will be our host addresses? Because we are using the first 3 bits for our subnet mask, we can configure them into eight different ways (binary form):

47 We are left with 6 useable network numbers.
Subnetting What address is what? We cannot use all “0”s or all “1”s We are left with 6 useable network numbers.

48 Network (Subnet) Addresses
Subnetting Network (Subnet) Addresses Remember our values: Equals Now our 3 bit configurations: 0 0 1 H H H H H 32 0 1 0 H H H H H 64 0 1 1 H H H H H 96 1 0 0 H H H H H 128 1 0 1 H H H H H 160 1 1 0 H H H H H 192

49 Network (Subnet) Addresses
Subnetting Network (Subnet) Addresses 0 0 1 h h h h h 32 0 1 0 h h h h h 64 0 1 1 h h h h h 96 1 0 0 h h h h h 128 1 0 1 h h h h h 160 1 1 0 h h h h h 192 Each of these numbers becomes the Network Address of their subnet...

50 Network (Subnet) Addresses
Subnetting Network (Subnet) Addresses

51 And the last address in the Network will look like this:
Subnetting host Addresses The device assigned the first address will receive the first number AFTER the network address shown before. or 32+1 And the last address in the Network will look like this: *Remember, we cannot use all “1”s, that is the broadcast address ( )

52 Subnetting Host Addresses The next network will start at 206.15.143.64
The first IP address on this subnet network will receive: And the last address in the Network will receive: *Remember, the broadcast address ( )

53 Can you figure out the rest?
Subnetting Can you figure out the rest? Network: Host Range to to to to to to

54 How the computer finds the Network Address:
Subnetting How the computer finds the Network Address: An address on the subnet The new subnet mask When the computer does the Logical Bitwise AND Operation it will come up with the following Network Address (or Subnet Address): = = = This address falls on our 2nd Subnet (Network)

55 Classless Addressing

56 Classfull Addressing: drawbacks
Classless Addressing Classfull Addressing: drawbacks Classful Addressing + Subnetting at least one route per class is advertised in routing updates Number of networks is doubling faster than once per year Memory is not growing that fast Only a few routers can keep the current number of routes

57 Overview: (Classful) IPv4 Addressing Limits
Classless Addressing Overview: (Classful) IPv4 Addressing Limits Provides IP scheme with limitations: Class A – 126 networks: 16,777,214 hosts each Class B – 65,000 networks: 65,534 hosts each Class C – 2 million networks: hosts each While available addresses were running out, only 3% of assigned addresses were actually being used! Subnet zero, broadcast addresses, pool of unused addresses at Class A and B sites, etc.

58 Classless Addressing Introduced by CIDR - Classless Inter Domain Routing Networks are grouped (aggregated) into blocks Blocks of networks are advertised New way of thinking: There are no network numbers, but just address space prefixes There are no subnet masks, just prefix lengths Classless addresses notation /27 with mask Binary representation of mask:

59 Classless Address Notation
Hosts . . . 8 16 32 64 128 256 4096 8192 16384 32768 65535 Prefix . . . /29 /28 /27 /26 /25 /24 /20 /19 /18 /17 /16 Subnet Mask . . . Classful . . . 1 C 16 C’s 32 C’s 64 C’s 128 C’s 1 B

60 The address in a block must be contiguous.
Classless Addressing Rules: The address in a block must be contiguous. The number of address in a block must be a power of 2 (1, 2, 4, 8, . . .) The first address must be evenly divisible by the number of address .

61 Example Figure 19.3 shows a block of addresses, in both binary and dotted-decimal notation, granted to a small business that needs 16 addresses. The addresses are contiguous. The number of addresses is a power of 2 (16 = 24), and the first address is divisible by 16. The first address, when converted to a decimal number, is 3,440,387,360, which when divided by 16 results in 215,024,210.

62 In IPv4 addressing, a block of addresses can be defined as
Classless Addressing Mask: In 32 bit in which n leftmost bits are 1s and the 23-n rightmost bits are 0s In IPv4 addressing, 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. The first address in the block can be found by setting the rightmost 32 − n bits to 0s. The last address in the block can be found by setting the rightmost 32 − n bits to 1s. The number of addresses in the block can be found by using the formula 232−n.

63 If we set 32−28 rightmost bits to 0, we get
Example A block of addresses is granted to a small organization. We know that one of the addresses is /28. What is the first address in the block? Solution: The binary representation of the given address is If we set 32−28 rightmost bits to 0, we get or

64 Find the last address for the block 205.16.37.39/28.
Example Find the last address for the block /28. Solution: The binary representation of the given address is If we set 32 − 28 rightmost bits to 1, we get or Find the number of addresses in Example 19.6. The value of n is 28, which means that number of addresses is 2 32−28 or 16.

65 (twenty-eight 1s and four 0s). Find a. The first address
Example Another way to find the first address, the last address, and the number of addresses is to represent the mask as a 32-bit binary (or 8-digit hexadecimal) number. This is particularly useful when we are writing a program to find these pieces of information. In Example 19.5 the /28 can be represented as (twenty-eight 1s and four 0s). Find a. The first address b. The last address c. The number of addresses.

66 Example Solution a. The first address can be found by ANDing the given addresses 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.

67 Example b. The last address can be found by ORing the given addresses with the complement of the mask. ORing here 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 to 0 and each 0 to 1.

68 Example c. The number of addresses can be found by complementing the mask, interpreting it as a decimal number, and adding 1 to it.

69 Network Addresses Network Addresses
The first address in a block is normally not assigned to any device; it is used as the network address that represents the organization to the rest of the world. The router has 2 addresses one belongs to the granted block the other belongs to the network that is at other side of the router.

70 Hierarchy in a telephone network in North America
IP addresses have levels of hierarchy. In North America telephone network has 3 levels of hierarchy. 1st level defines the area code,2nd level exchange and the last level defines the connection of the local loop.

71 Two levels of hierarchy in an IPv4 address
Each address in the block can be considered as a two-level hierarchical structure: The leftmost n bits (prefix) define the network; The rightmost 32 − n bits define the host, and is called as suffix.

72 Three-level hierarchy in an IPv4 address
An organization that is granted a block of addresses may create clusters of networks called subnets and divide the addresses between the different networks. The rest of the world considers the organization as one entity; however internally has several subnets. All messages are sent to the router, router routes to subnets.

73 Example Suppose an organization is given the block /26, which contains 64 addressees. The organization has three offices and needs to divide the addresses into three subblocks of 32, 16, and16 addresses. Find the new masks. Soln: Mask for the first subnet is n1, then232-n1 must be 32 i.e n1=27 Mask for the second subnet is n2, then232-n2 must be 16 i.e n2=28 Mask for the third subnet is n3, then232-n3 must be 16 i.e n3=28 We can find the subnet addresses from one of addresses in the subnet In subnet 1 the addresses /27 can give us the subnet address if the mask is of /27 Host: Mask: 27 Subnet: =>

74 Example In subnet 2 the addresses /28 can give us the subnet address if the mask is of /28 Host: Mask: 28 Subnet: => In subnet 3 the addresses /28 can give us the subnet address if the mask is of /28 Host: Subnet: =>

75 Configuration and addresses in a subnetted network

76 Addresses Allocation Addresses Allocation
Global Authority called Internet Corporation for Assigned Names and Addresses(ICANN). ICANN allocates addresses to ISP, ISP grants addresses to its customers.

77 Example 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: The first group has 64 customers; each needs 256 addresses. The second group has 128 customers; each needs addresses. 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.

78 Example Group 1: In this group, each customer needs 256 addresses. That is 8 (log2 256) bits are needed to define each host. The prefix length is then 32 − 8 = 24. The addresses are Group 2: In 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

79 Number of granted addresses to the ISP: 65,536
Example 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 Number of granted addresses to the ISP: 65,536 Number of allocated addresses by the ISP: 40,960 Number of available addresses: 24,576

80 An example of address allocation and distribution by an ISP

81 Network Addresses Translation (NAT)

82 Private vs Public IP Addresses
Network Addresses Translation (NAT) Private vs Public IP Addresses Whatever connects directly into Internet must have public (globally unique) IP address There is a shortage of public IPv4 address So Private IP addresses can be used within a private network Three address ranges are reserved for private usage /8 /16 to /16 /24 to /24 A private IP is mapped to a Public IP, when the machine has to access the Internet

83 NAT Network Addresses Translation (NAT) Natting
NAT (Network Address Translation) Maps Private IPs to Public IPs It is required because of shortage of IPv4 Address

84 Network Addresses Translation (NAT)
Natting Static NAT : Maps unique Private IP to unique Public IP Dynamic NAT : Maps Multiple Private IP to a Pool of Public IPs (Port Address Translation : Maps a Public IP and Port Number to a service in Private IP)

85 Addresses for private networks
Network Addresses Translation (NAT) The Internet authorities have reserved three sets of addresses as private addresses Any organization can use an address out of this set without permission from the Internet authorities. Therese addresses are unique inside the organization, but they are not unique globally. The router will not forward a packet that has theses addresses as destination addresses. The site have one single connection to the global Internet through Router that runs the NAT software. Addresses for private networks

86 Network Addresses Translation (NAT)
A NAT implementation

87 Addresses in Translation
Network Addresses Translation (NAT) Addresses in Translation Outgoing packets go through the NAT router replaces the source address in the packet with the global NAT address. All incoming packet destination address are replaced by private address.

88 Network Addresses Translation (NAT)
When the router translates the source address of the outgoing packet it also makes note of the destination address. When response comes back from destination address it checks for its source address from translation table

89 Five-column translation table
Network Addresses Translation (NAT) Five-column translation table

90 NAT and ISP An ISP and NAT
An ISP that serves dial up customers can use NAT to conserve addresses. Suppose ISP has 1000 addresses but has 100,000 customers. Each of the customer is assigned a private network address. The ISP translates each addresses in outgoing packet to one of the 1000 global address. An ISP and NAT

91 IPv6 ADDRESSES

92 IPv6 ADDRESSES Despite all short-term solutions, address depletion is still a long-term problem for the Internet. This and other problems in the IP protocol itself have been the motivation for IPv6. Structure Address Space

93 128 bits are divided into 8 sections, each 2 bytes in length.
IPv6 Addresses Structure: IPv6 address consists of 16 bytes or 128 bits long and specified in hexadecimal colon notation. 128 bits are divided into 8 sections, each 2 bytes in length. 2 bytes in hex notation requires 4 hex digits. IPv6 address in binary and hexadecimal colon notation

94 The leading zeros of a section are omitted.
IPv6 Addresses Abbreviation IP address in hexadecimal format is very long and contains many digits are zero. The leading zeros of a section are omitted. Abbreviated IPv6 addresses

95 Expand the address 0:15::1:12:1213 to its original.
Example Expand the address 0:15::1:12:1213 to its original. 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. This means that the original address is.

96 Type prefixes for IPv6 addresses

97 Type prefixes for IPv6 addresses (continued)

98 Prefixes for provider-based unicast address
IPv6 Addresses Prefixes for provider-based unicast address Type Identifier: 3 bit field , defines the address as a provider based address Registry Identifier: 5 bit field indicates the agency that has registered . INTERNIC center for North America: RIPNIC center for European registration APNIC Asian and Pacific countries Provider Identifier: Internet Provider (ISP) 16 bit

99 Prefixes for provider-based unicast address
IPv6 Addresses Prefixes for provider-based unicast address Subscriber Identifier: 24 bit length is used to identify subscriber (Organization) Subnet Identifier: Each organization has many subnets and 32 bit is used for identification Node Identifier: 48 bit is used to identify node connected to a subnet.

100 Multicast address in IPv6
IPv6 Addresses Multicast address in IPv6 used to define a group of hosts instead of just one Flag is used define group of address as either permanent or transient. Scope: Anycast Addresses

101 Reserved addresses in IPv6
IPv6 Addresses Reserved addresses in IPv6 Unspecified is used when host does not know its own address and sends an inquiry to find its address. Loopback is used by a host to test itself without going into the network.

102 IPv6 Addresses Compatible is used during the transition from IPv4 to IPv6. Node using IPv6 want to send a message to another node using IPv6, but message needs to pass through a part of network that still operates in IPv4. Mapped address is used when node has migrated to Ipv6 wants to send a packet to a node still using IPv4

103 IPv6 Addresses Local addresses in IPv6

104 IPv6 Addresses A large number of consecutive IP address are available starting at Suppose that four organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses, respectively, and in that order. For each of these, give the first IP address assigned, the last IP address assigned, and the mask in the w.x.y.z/s notation. To start with, all the requests are rounded up to a power of two. The starting address, ending address, and mask are as follows: A: – written as /20 B: – written as /21 C: – written as /20 D: – written as /19


Download ppt "4/20/2017 Unit –6 Network Layer: Logical Addressing."

Similar presentations


Ads by Google