Layer 3 Routing and Addressing Layer 3 Responsibilities

Layer 3 Routing and Addressing

Layer 3 Responsibilities Move data through a set of networks. n Use a hierarchical addressing scheme. n Segment network and control flow of traffic. n Talk to other networks with services offered by ISPs (Internet Service Providers). n

Layer 3 Devices n Routers n n Interconnect network segments or entire networks. Make logical decisions based on IP addresses. Determines best path for data on an internetwork. A. K. A Layer 3 Switching

Path Determination n The process the router uses to choose the next hop in the path the packet travels. The 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. )

Layer 3 Packet/Datagram VERS HLEN Service Type Identification Time to Live Total Length Flags Protocol Fragment Offset Header Checksum Source IP Address Destination IP Address IP Options (if any) Data Padding

Network Layer Addresses §Network layer addresses are 32 bits long. §They are represented as four octets in dotted decimal format. 233. 14. 17. 0 §The IP address has two components: §The Network ID §The Host Id

Layer 3 Addresses n Network ID n n n 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. n Host ID n n n 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.

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 address. Class A N H H H Class B N N H H Class C N N N H

Number of Hosts n Maximum number of hosts vary for each class. n n 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.

Classes How do you know what class an IP address is in? n If the first octet is between: n n 0 – 127 it is a class A address 128 -191 it is a class B address 192 – 223 it is a class C address

Recognizing Class in Binary Format 128 s place 64 s place Class A 0 Class B 1 0 Class C 1 1 32 s place 0 Initial bit pattern in first octet of IP address.

Reserved Addresses n n Network Address (wire address) – This is an IP address that ends with binary 0 s in all host bits. Class A Network Address example: n n 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.

Reserved Addresses n n n Broadcast Address – is used to send data to all of the devices on a network. Broadcast IP addresses end with binary 1 s in the host part of the address. Class B Broadcast Address example: n 176. 10. 255 (Remember decimal 255 = binary 1111)

Basics of Subnetting Subnetworks are smaller divisions of networks. n They provide addressing flexibility. n A. K. A. subnets n Subnet addresses are assigned locally, usually by a network administrator. n Subnets reduce a broadcast domain. n

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

How many bits can I borrow? §The minimum number of bits you can borrow is two. Size of Host Field Maximum # of borrowed bits Class A 24 22 Class B Class C 16 8 14 6

Default Subnet Masks Class A n Class B n Class C n 255. 0. 0. 0 255. 0

Calculating a Subnet n We will subnet the IP address: n n 223. 14. 17. 0 What class IP address is this? n Class C

Step #1 n Determine the default subnet mask n Class C default subnet mask: n 255. 0

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

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

Step #3 continued… 223. 14. 17. 0 XXXX 16 possible subnets HHHH 16 possible hosts for each subnet

Step #3 continued… n We get 16 possible subnets and 16 possible hosts for each subnet because: n n n 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?

Step #3 continued… Because you cannot use the first and last subnet. n Because you cannot use the first and last address within each subnet. n For each, one is the broadcast address and one is the network address. n

Step #4 n Determine the subnet mask. 223. 14. 17. 0 XXXX n HHHH Where X represents the borrowed bits for subnetting.

Step #4 continued… n 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. 240 n The subnet mask is used to reveal the subnet and host address fields in IP addresses. n

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

Step 5 continued… Subnet # 1 2 3 4 5 6 7 8 Subnet Bits Host Bits In Decimal 0000 -1111. 0 -. 15 0001 0000 -1111. 16 -. 31 0010 0000 -1111. 32 -. 47 0011 0000 -1111. 48 -. 63 0100 0000 -1111. 64 -. 79 0101 0000 -1111. 80 -. 95 0110 0000 -1111. 96 -. 111 0000 -1111. 112 -. 127

Step 5 continued… Subnet # 9 10 11 12 13 14 15 16 Subnet Bits Host Bits In Decimal 1000 0000 -1111. 128 -. 143 1001 0000 -1111. 144 -. 159 1010 0000 -1111. 160 -. 175 1011 0000 -1111. 176 -. 191 1100 0000 -1111. 192 -. 207 1101 0000 -1111. 208 -. 223 1110 0000 -1111. 224 -. 239 1111 0000 -1111. 240 -. 255

Step 5 continued… There are 16 possible subnets. n There are 16 possible hosts on each subnet. n That equals 256 possible hosts. n What are our available subnets? n What are our available hosts on each subnet? Why? ? ? n

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

Figuring Subnet Network Addresses IP Host 172. 16. 2. 120 Subnet Mask 255. 0 10101100. 000100000010. 01111000 AND 11111111. 0000 10101100. 000100000010. 0000 172. 16. 2. 0 This is the subnet network address. It is the lowest numbered address on the subnet network. It can help determine path.
- Slides: 32