46
Layer 3 Routing and Addressing

Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Embed Size (px)

Citation preview

Page 1: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Layer 3

Routing and Addressing

Page 2: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Layer 3 Responsibilitiesmove data through a set of networksuse a hierarchical addressingscheme (opposed to MACaddressing, which is flat)segment network and control flow of trafficreduce congestiontalk to other networks

Page 3: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Layer 3 DevicesRouters interconnect network

segments or entire networks make logical decisions

based on IP addresses determine best path for

data on an internetwork (routing of packets)

Page 4: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Path Determination

the process the router uses to choose the next hop in the path the packet travelsThe router uses the network address to identify the destination network of a packet within an internetwork.IP addresses can be assigned by a network administrator or automatically (dynamically).

Page 5: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Routers connect separate networks, routers make best path decisions based on Layer 3 information, and routers actually switch packets from incoming ports to appropriate outgoing ports. Without routers you could not connect separate networks efficiently, there would be no devices intelligent enough to route packets along a best path nor to switch them to that best path.

Page 6: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Layer 3 Packet/Datagram Header includes

source AND destination addresses

Page 7: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Network Layer Addresses

233.14.17.0

IP addresses are 32 bits long.

They are represented as four octets in dotted decimal format.

The IP address has two components:

The network ID

The host ID

Page 8: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,
Page 9: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Layer 3 AddressesNetwork ID assigned by ARIN

(www.arin.net) identifies the

network to which a device is attached

may be identified by one, two, or three of the first three octets

Host ID assigned by a

network administrator

identifies the specific device on that network

may be identified by one, two, or three of the last three octets

Page 10: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

IP Addresses

32 bit address represented as 8 bit dotted decimals

different class addresses reserve different amounts of bits for the network and host portions of the addressClass A N H H H

Class B N N H H

Class C N N N H

Page 11: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Number of HostsThe maximum number of hosts vary for each class. Class A has 16,777,214 available hosts (224 –2) Class B has 65,534 available hosts (216 –2) Class C has 254 available hosts (28 –2)

The first address in each network is reserved for the network address and the last address is reserved for the broadcast address.

Page 12: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

ClassesHow do you know what class an IP address is in?

0–127 Class A address128-191 Class B address192–223 Class C address224–239 Class D - Multicast240–255 Class E - Research

Page 13: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

There are certain IP address ranges reserved for private IP addressing schemes. Not everyone needs connectivity to the Internet. Another relevant discussion is IP address depletion. Various schemes are being pursued to deal with IP address depletion. First there is NAT. Second there is CIDR. Third there is IP v6. While all of these have there benefits, you should be well-grounded in classful IP addresses.

Page 14: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Recognizing Class in Binary Format

011Class C

01Class B

0Class A

32s place

64s place

128s place

Initial bit pattern in first

octet of IP

address.

Page 15: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Reserved Addresses

Network Address (wire address) – This is an IP address that ends with binary 0s in the host part of the address.Class A network address example: 113.0.0.0

Hosts on a network can only communicate directly with other hosts if they have the same network ID. If they don’t, they will not be able to communicate unless there is another device connecting the networks.

Page 16: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Reserved Addresses

Broadcast Address – is used to send data to all of the devices on a network. Broadcast IP addresses end with binary 1s in the host part of the address.Class B broadcast address example: 176.10.255.255

(Remember decimal 255 = binary 11111111)

Page 17: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

For a Class A address 99.0.0.0 would be a reserved network number and 99.255.255.255 would be a broadcast number.

For a Class B address 156.1.0.0 would be a reserved network "wire" number and 156.1.255.255 would be a broadcast number.

For a Class C address 203.1.17.0 would be a reserved network number and 203.1.17.255 would be a broadcast number.

Once subnets are created, the reserved network numbers and broadcast numbers become less obvious and require more work to compute.

Page 18: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Remember that the first address on each segment is reserved for the network number and the final address on each segment is reserved for broadcasts.

You must recognize the number of bits in the network and host portions of all three classes of IP addresses. If you can recognize this, then it is a matter of powers of 2 to determine how many hosts are intrinsically part of classful IP addressing.

Page 19: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Network administrators sometimes need to divide networks, particularly large networks, into smaller networks, called subnetworks, in order to provide extra flexibility. Most of the time subnetworks are simply referred to as subnets.

Page 20: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

The primary reason for using a subnet is to reduce the size of a broadcast domain. Broadcasts are sent to all hosts on a network or subnetwork. When broadcast traffic begins to consume too much of the available bandwidth, network administrators may chose to reduce the size of the broadcast domain.

Page 21: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

An unfortunate by-product of creating subnetworks is that the reserved network and broadcast numbers now exist for each and every subnetwork created. Thus entire blocks of IP addresses, which begin with these subnetwork ID and subnetwork broadcast numbers, are wasted. So the network administrator must strike a balance between the number of subnets required, the hosts per subnet that is acceptable, and the resulting waste of addresses.

Page 22: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Basics of SubnettingSubnetworks are smaller divisions of networks.They provide addressing flexibility.Subnet addresses areassigned locally, usually by a network administrator.Subnets reduce a broadcast domain.

Page 23: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Subnet Addresses

Include Class A, B, or C network portion plus a subnet field and a host field.Bits are borrowed from the host field and are designated as the subnet field.

Network

Subnet Host

Page 24: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

How many bits can I borrow?

Size of Host Field

Maximum # of borrowed bits

Class A 24 22

Class B 16 14

Class C 8 6

The minimum number of bits you can borrow is two.

Page 25: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

To create a subnet address, a network administrator borrows bits from the host field and designates them as the subnet field. The minimum number of bits that can be borrowed is 2. If you were to borrow only 1 bit, to create a subnet, then you would only have a network number - the .0 network - and the broadcast number - the .1 network. The maximum number of bits that can be borrowed can be can any number that leaves at least 2 bits, remaining, for the host number.

Page 26: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

The longer name for subnet mask is instructive -- "extended network prefix". The mask's ones show how far we are extending the network number (at the expense of the host numbers).

Page 27: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Default Subnet Masks

Class A 255.0.0.0Class B 255.255.0.0Class C 255.255.255.0

Page 28: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Calculating a Subnet

We will subnet the IP address: 223.14.17.0

What class IP address is this? Class C

Page 29: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #1

Determine the default subnet mask

Class C default subnet mask: 255.255.255.0

Page 30: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #2

Determine the number of subnets needed and the number of hosts needed on each subnet to determine how many bits to borrow from the host ID.Need: 13 subnets 10 hosts on each subnet

Page 31: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #3

Figure the actual number of subnets and hosts by borrowing bits from host ID.Let’s see how many subnets and hosts we will have by borrowing 4 bits from the host.

Page 32: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #3 continued…

223.14.17.0

X X X X H H H H

16 possible subnets

16 possible hosts for each

subnet

Page 33: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #3 continued…

We get 16 possible subnets and 16 possible hosts for each subnet because: For the 4 bits borrowed each bit can be a 1

or a 0 leaving you with 24 or 16 possible combinations.

The same goes for the 4 leftover host bits.

Important: There are only 14 available subnets and hosts on each subnet. Why?

Page 34: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #3 continued…

Because you cannot use the first and last subnet.Because you cannot use the first and last address within each subnet.For each, one is the broadcast address and one is the network address.

Page 35: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #4

Determine the subnet mask.

223.14.17.0

X X X X H H H H

Where X represents the borrowed bits for subnetting.

Page 36: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step #4 continued…

Add the place values of X together to get the last octet decimal value of the subnet mask.

128 + 64 + 32 + 16 = 240

The subnet mask is: 255.255.255.240

The subnet mask is used to reveal the subnet and host address fields in IP addresses.

Page 37: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step 5Determine the ranges of host addresses for each subnet.Subnet # Subnet

BitsHost Bits In Decimal

1 0000 0000-1111 .0 -.15

2 0001 0000-1111 .16 - .31

3 0010 0000-1111 .32 - .47

4 0011 0000-1111 .48 - .63

5 0100 0000-1111 .64 - .79

6 0101 0000-1111 .80 - .95

7 0110 0000-1111 .96 - .111

8 0111 0000-1111 .112 - .127

Page 38: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step 5 continued…

Subnet # Subnet Bits Host Bits In Decimal

9 1000 0000-1111 .128 -.143

10 1001 0000-1111 .144 - .159

11 1010 0000-1111 .160 - .175

12 1011 0000-1111 .176 - .191

13 1100 0000-1111 .192 - .207

14 1101 0000-1111 .208 - .223

15 1110 0000-1111 .224 - .239

16 1111 0000-1111 .240 - .255

Page 39: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Step 5 continued…

There are 16 possible subnets.There are 16 possible hosts on each subnet.That equals 256 possible hosts.What are our available subnets?What are our available hosts on each subnet? Why?????

Page 40: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Figuring SubnetNetwork Addresses

Step #1: Change the IP host address to binary.Step #2: Change the subnet mask to binary.Step #3: Use the boolean operator AND to combine the two.Step #4: Convert the network binary address to dotted decimal.

Page 41: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Figuring SubnetNetwork Addresses

IP Host 172.16.2.120

Subnet Mask255.255.255.0

10101100.00010000.00000010.0111100011111111.11111111.11111111.0000000010101100.00010000.00000010.00000000 172.16.2.

0This is the subnet network address. It is the lowest numbered address on the subnet network. It can help determine path.

AND

Page 42: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

Types of IP Addressing Problems

Problem: Given 195.137.92.0 and needing 8 usable subnets, find the subnetwork numbers, the ranges of host numbers, and subnetwork broadcast numbers.

Page 43: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

SOLUTION: IP Address is a class C. Default subnet mask is 255.255.255.0. We need to extend the network number by enough bits to give 8 usable subnets.

Stealing 2 bits yields 2 usable subnets, stealing 3 bits yields 6 usable subnets, so we must steal 4 bits to get 14 usable subnets, of which we needed 8.

This makes the subnet mask 255.255.255.240. So the Network number is 195.137.92.NNNN HHHH where Ns stand for network extension bits (subnets) and Hs stand for host numbers.

Next we must number the subnets; there are 16 combinations of 4 bit binary numbers but they retain their place value within the last octet.

Page 44: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

The key to understanding the result of the Boolean ANDing of an IP address and a subnet mask is to realize that once created, subnetworks are valid network numbers as far as the "outside" world is concerned. So as with the earlier calculation, the bit-by-bit ANDing of the IP address and the subnet mask gives the subnetwork number.

Page 45: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,

The router performs the Boolean operations, the most important of which is the AND operation. In order to find the network ID of a subnet, the router must take the IP address, and the subnet mask, and logically, AND them together. The resulting number is the network/subnetwork number.

Page 46: Layer 3 Routing and Addressing. Layer 3 Responsibilities move data through a set of networks use a hierarchical addressing scheme (opposed to MAC addressing,