Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
IP Addressing and Routing 1 Objectives 1. Addressing and routing overview 2. Classful IP addressing 3. Classless IP addressing (subnetting) 4. IP routing 2 1. Addressing & Routing Overview 3 Network Layer: Path Determination 4 Network Layer: Path Determination Which Path? • Network layer functions to find the best path through the internetwork 5 Communicate Path 5 2 4 6 9 8 10 1 3 11 7 • Addresses represent the path of media connections (wires) 6 Addressing: Network and Host Network Host 1 1 2 3 2 1 3 1 2.1 1.2 1.3 1.1 3.1 • Network address—Path part used for routing • Host address—Specific port or device on the network 7 TCP/IP Network Addressing 32 bits 8,16, or 24 bits from IANA Varies with subnet mask Network Host Ethernet 8 Router Interface Addressing E1=10.2.5.3 10.2.0.0 10.1.0.0 E2=10.3.15.14 E0=10.1.23.7 10.3.0.0 Destination Network Router Port Router Address 10.1.0.0 E0 10.1.23.7 10.2.0.0 E1 10.2.5.3 10.3.0.0 E2 10.3.15.14 • Network portion of address used to make path selections 9 Router Interface Addressing E1=10.2.5.3 10.2.0.0 10.1.0.0 E2=10.3.15.14 E0=10.1.23.7 10.3.0.0 Destination Network 10.1.0.0 Router Port E0 Router Address 10.1.23.7 10.2.0.0 E1 10.2.5.3 10.3.0.0 E2 10.3.15.14 • Network portion of address used to make path selections • Node portion of address refers to router port 10 Router Interface Addressing E1=10.2.5.3 10.2.0.0 10.1.0.0 E2=10.3.15.14 E0=10.1.23.7 10.3.0.0 Destination Network 10.1.0.0 Router Port E0 Router Address • Network portion of address used to make path selections 10.1.23.7 10.2.0.0 E1 10.2.5.3 • Node portion of address refers to router port 10.3.0.0 E2 10.3.15.14 • On router each interface has different IP address 11 Routing Tables In Routers 10.1.0.0 10.2.0.0 A S1 S0 Routing Table S0 10.3.0.0 B S1 Routing Table 10.4.0.0 S0 C S1 Routing Table 10.1.0.0 S1 0 10.2.0.0 S0 0 10.3.0.0 S0 0 10.2.0.0 S0 0 10.3.0.0 S1 0 10.4.0.0 S1 0 10.3.0.0 S0 1 10.4.0.0 S1 1 10.2.0.0 S0 1 10.4.0.0 S0 2 10.1.0.0 S0 1 10.1.0.0 S0 2 • Router uses the best path to destination 12 Analogy Network Street name Host Building number Router Crossing Routing table Direction signs Packets Taxi with passenger Destination IP address Street address “Please take me to Oxford Street 23!” 13 2. Classful IP Addressing 14 TCP/IP Addresses UNIX Host UNIX Host Internet TCP/IP Company A Company B • Unique addressing allows seamless communication between end stations Path choice is based on location Location is represented by an address 15 Introduction to TCP/IP Addresses UNIX Host UNIX Host Company A Company B • Unique addressing allows seamless communication between end stations • Path choice is based on location Location is represented by an address 16 Introduction to TCP/IP Addresses UNIX Host Company A UNIX Host Company B • Unique addressing allows seamless communication between end stations • Path choice is based on location • Location is represented by a network address 17 IP Addressing 32 Bits Network Host 18 IP Addressing 32 Bits Network 8 Bits Host 8 Bits 8 Bits 8 Bits 19 Dotted Decimal Notation 32 Bits Network 8 Bits 172 Host 8 Bits . 16 8 Bits 8 Bits . 122 . 204 20 Dotted Deciaml Notation 21 Binary Conversion Table 22 IP Address Classes • Class A: N H H H • Class B: N N H H • Class C: N N N H • Class D: for multicast • Class E: for research N = Network number H = Host number 23 IP Address Bit Patterns # Bits Class A: 1 7 0 network # 24 host # 24 IP Address Bit Patterns # Bits Class A: 1 7 0 network # # Bits 1 Class B: 1 1 0 24 14 network # host # 16 host # 25 IP Address Bit Patterns # Bits Class A: 1 7 0 network # # Bits 1 Class B: 1 24 host # 14 16 1 0 # Bits 1 1 1 21 8 1 0 network # host # Class C: 1 network # host # 26 IP Address Classes 27 Number of Networks and Hosts 28 Recognizing Classes in IP Addresses (First Octet Rule) High Order Bits Octet in Decimal Address Class 0 1 – 126 A 10 128 – 191 B 110 192 – 223 C 29 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 30 Written Exercise: IP Address Classes Address 10.2.1.1 Class Network Host A 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 31 Written Exercise: IP Address Classes Address 10.2.1.1 Class A Network Host 10.0.0.0 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 32 Written Exercise: IP Address Classes Address 10.2.1.1 Class A Network 10.0.0.0 Host 0.2.1.1 128.63.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 33 Written Exercise: IP Address Classes Address Class 10.2.1.1 A 128.63.2.100 B Network 10.0.0.0 Host 0.2.1.1 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 34 Written Exercise: IP Address Classes Address Class Network 10.2.1.1 A 10.0.0.0 128.63.2.100 B 128.63.0.0 Host 0.2.1.1 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 35 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 192.6.141.2 130.113.64.16 256.241.201.10 36 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 192.6.141.2 130.113.64.16 256.241.201.10 37 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 192.6.141.2 130.113.64.16 256.241.201.10 38 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 130.113.64.16 256.241.201.10 39 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 130.113.64.16 256.241.201.10 40 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 130.113.64.16 256.241.201.10 41 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 0.0.0.2 130.113.64.16 256.241.201.10 42 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 0.0.0.2 130.113.64.16 B 256.241.201.10 43 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 0.0.0.2 130.113.64.16 B 130.113.0.0 256.241.201.10 44 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 0.0.0.2 130.113.64.16 B 130.113.0.0 0.0.64.16 256.241.201.10 45 Written Exercise: IP Address Classes Address Class Network Host 10.2.1.1 A 10.0.0.0 0.2.1.1 128.63.2.100 B 128.63.0.0 0.0.2.100 201.222.5.64 C 201.222.5.0 0.0.0.64 192.6.141.2 C 192.6.141.0 0.0.0.2 130.113.64.16 B 130.113.0.0 0.0.64.16 256.241.201.10 Nonexistent 46 10 . 1 . 1 . 1 Network Host Host Addresses 172.16.2.1 10.1.1.1 E0 E1 172.16.3.10 10.250.8.11 172.16.12.12 10.180.30.118 IP: 172.16.2.1 172.16 Network . 12 . 12 Host IP: 10.6.24.2 Routing Table Network Interface 172.16.0.0 E0 10.0.0.0 E1 47 3. Classless IP Addressing (subnetting) 48 Addressing without Subnets 172.16.0.0 • Network 172.16.0.0 49 Addressing with Subnets 172.16.3.0 172.16.4.0 172.16.1.0 172.16.2.0 • Network 172.16.0.0 50 Subnet Addressing 172.16.2.200 172.16.3.5 E0 E1 172.16.2.2 172.16.3.100 172.16.2.160 172.16.3.150 Routing Table Subnet Interface 172.16.0.0 E0 172.16.0.0 E1 51 Subnet Addressing 172.16.2.200 172.16.3.5 E0 E1 172.16.2.2 172.16.3.100 172.16.2.160 172.16.3.150 IP: 172.16.2.1 172.16 . Network 2 . 160 Subnet Host IP: 172.16.3.1 Routing Table Subnet Interface 172.16.0.0 E0 172.16.0.0 E1 52 Subnet Addressing 172.16.2.200 172.16.3.5 E0 E1 172.16.2.2 172.16.3.100 172.16.2.160 172.16.3.150 IP: 172.16.2.1 172.16 . Network 2 . 160 Subnet Host IP: 172.16.3.1 New Routing Table Subnet Interface 172.16.2.0 /24 E0 172.16.3.0 /24 E1 53 Subnet Mask IP Address 172 16 2 160 54 Subnet Mask IP Address 172 16 2 Network Default Subnet Mask /16 255 160 Host 255 0 0 55 Subnet Mask IP Address 172 16 2 Network Default Subnet Mask /16 255 Host 255 Network 8-bit Subnet Mask /24 255 160 255 0 0 Subnet Host 255 0 Use host bits, starting at the high order bit position 56 CIDR Notation for Subnets CIDR notation CIDR – Classless Inter Domain Routing 57 Subnet Mask without Subnets Network Host 172.16.2.160 10101100 00010000 00000010 10100000 255.255.0.0 11111111 11111111 00000000 00000000 10101100 00010000 00000000 00000000 172 16 0 0 • CIDR notation /16 58 Subnet Mask with Subnets Network Subnet Host 172.16.2.160 10101100 00010000 00000010 10100000 255.255.255.0 11111111 11111111 11111111 00000000 10101100 00010000 00000010 00000000 172 16 2 0 • CIDR notation /24 59 IP Subnetting Example 189.168. 12. 55 255.255.255.224 --------------189.168. 12. 32 1011 1101 . 1010 1000 . 0000 1100 . 0011 0111 1111 1111 . 1111 1111 . 1111 1111 . 1110 0000 --------------------------------------------1011 1101 . 1010 1000 . 0000 1100 . 0010 0000 • CIDR notation /27 60 Written Exercise: Subnet Masks Address Subnet Mask 172.16.2.10 255.255.255.0 10.6.24.20 255.255.0.0 10.30.36.12 255.255.255.0 Subnet Host 61 Written Exercise: Subnet Masks Address Subnet Mask Subnet 172.16.2.10/24 255.255.255.0 172.16.2.0 10.6.24.20 255.255.0.0 10.30.36.12 255.255.255.0 Host 62 Written Exercise: Subnet Masks Address Subnet Mask Subnet Host 172.16.2.10/24 255.255.255.0 172.16.2.0 0.0.0.10 10.6.24.20 255.255.0.0 10.30.36.12 255.255.255.0 63 Written Exercise: Subnet Masks Address Subnet Mask Subnet Host 172.16.2.10/24 255.255.255.0 172.16.2.0 0.0.0.10 10.6.24.20/16 255.255.0.0 10.6.0.0 10.30.36.12 255.255.255.0 64 Written Exercise: Subnet Masks Address Subnet Mask Subnet Host 172.16.2.10/24 255.255.255.0 172.16.2.0 0.0.0.10 10.6.24.20/16 255.255.0.0 10.6.0.0 0.0.24.20 10.30.36.12 255.255.255.0 65 Written Exercise: Subnet Masks Address Subnet Mask Subnet Host 172.16.2.10/24 255.255.255.0 172.16.2.0 0.0.0.10 10.6.24.20/16 255.255.0.0 10.6.0.0 0.0.24.20 10.30.36.12/24 255.255.255.0 10.30.36.0 66 Written Exercise: Subnet Masks Address Subnet Mask Subnet Host 172.16.2.10/24 255.255.255.0 172.16.2.0 0.0.0.10 10.6.24.20/16 255.255.0.0 10.6.0.0 0.0.24.20 10.30.36.12/24 255.255.255.0 10.30.36.0 0.0.0.12 67 Subnet Planning 20 subnets 5 hosts per subnet Class C address: 201.222.5.0 Other subnets 68 Class C Subnet Planning Example IP Host Address: 201.222.5.121 Subnet Mask: 255.255.255.248 Network Subnet Host 201.222.5.121: 11001001 11011110 00000101 01111 001 255.255.255.248: 11111111 11111111 11111111 11111 000 Subnet: 11001001 11011110 00000101 01111 000 201 • • • • 222 5 120 Subnet Address = 201.222.5.120 Host Addresses = 201.222.5.121–201.222.5.126 Broadcast Address = 201.222.5.127 Five Bits of Subnetting • CIDR notation /29 69 Broadcast Addresses 172.16.3.0 172.16.4.0 172.16.1.0 172.16.2.0 70 Broadcast Addresses 172.16.3.0 172.16.4.0 172.16.1.0 172.16.2.0 255.255.255.255 (Local network broadcast) X 71 Broadcast Addresses 172.16.3.0 172.16.4.0 172.16.1.0 172.16.2.0 172.16.3.255 (Directed broadcast) 255.255.255.255 (Local network broadcast) X 72 Special IP Address Forms 73 Subnet Planning 20 subnets 5 hosts per subnet Class C address: 201.222.5.0 201.222.5.16 Other subnets 201.222.5.32 201.222.5.48 • CIDR notation /29 74 Written Exercise: Broadcast Addresses Address Subnet Mask 201.222.10.60 255.255.255.248 15.16.193.6 255.255.248.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 CIDR Subnet Broadcast 75 Written Exercise: Broadcast Addresses Address Subnet Mask 201.222.10.60 255.255.255.248 15.16.193.6 255.255.248.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 CIDR Subnet Broadcast /29 76 Written Exercise: Broadcast Addresses Address Subnet Mask 201.222.10.60 255.255.255.248 15.16.193.6 255.255.248.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 CIDR /29 Subnet Broadcast 201.222.10.56 77 Written Exercise: Broadcast Addresses Address Subnet Mask 201.222.10.60 255.255.255.248 15.16.193.6 255.255.248.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 CIDR /29 Subnet Broadcast 201.222.10.56 201.222.10.63 78 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR 201.222.10.60 255.255.255.248 /29 15.16.193.6 255.255.248.0 /21 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 Subnet Broadcast 201.222.10.56 201.222.10.63 79 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 80 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 128.16.32.13 255.255.255.252 153.50.6.27 255.255.255.128 15.16.199.255 81 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 128.16.32.13 255.255.255.252 /30 153.50.6.27 255.255.255.128 15.16.199.255 82 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 128.16.32.13 255.255.255.252 /30 128.16.32.12 153.50.6.27 255.255.255.128 15.16.199.255 83 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 /30 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 84 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 /30 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 /25 85 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 /30 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 /25 153.50.6.0 86 Written Exercise: Broadcast Addresses Address Subnet Mask CIDR Subnet Broadcast 201.222.10.60 255.255.255.248 /29 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 /21 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 /30 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 /25 153.50.6.0 153.50.6.127 87 4. IP Routing 88 IP Routing Learns Destinations • Static routes • Default routes • Dynamic routing 89 Static Route Configuration Router (config)# ip route network [ mask ] { address | interface } [ distance ] • Defines a path to an IP destination network or subnet 90 Dynamic Routing Operations Network Routing Protocol Routing Table Routing Protocol A router passes routing information to its neighbors Routing Table • Routing protocol maintains and distributes routing information 91 IP Routing Table Network 10.1.2.0 Internet Network 10.8.4.0 Network 10.1.1.0 S0 E0 To0 Routing Table Network Interface/NextHop 10.1.2.4 Network 10.1.3.0 Default route Token Ring Distance 10.1.2.0/24 E0, Directly Connected 0 10.1.1.0/24 0 10.8.4.0/24 To0,Directly Connected S0, Directly Connected 10.1.3.0/24 10.1.2.4, NextHop 0 1 0.0.0.0/0 S0, NextHop 12 92 Static Routing Configuration Router(config)# interface E0 ip address 10.1.2.1 255.255.255.0 interface S0 ip address 10.8.4.2 255.255.255.0 interface To0 ip address 10.1.1.3 255.255.255.0 ip route 10.1.3.0 255.255.255.0 10.1.2.4 1 ip route 0.0.0.0 0.0.0.0 S0 12 93 Routing Table in Windows 98 C:\WINDOWS>route print Active Routes: Network Address Netmask Gateway Address Interface Metric 0.0.0.0 0.0.0.0 159.148.108.254 159.148.108.217 1 0.0.0.0 0.0.0.0 193.219.192.226 193.219.192.227 1 127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1 159.148.108.128 255.255.255.128 159.148.108.217 159.148.108.217 1 159.148.108.217 255.255.255.255 127.0.0.1 127.0.0.1 1 159.148.255.255 255.255.255.255 159.148.108.217 159.148.108.217 1 193.219.192.224 255.255.255.248 193.219.192.227 193.219.192.227 1 193.219.192.227 255.255.255.255 127.0.0.1 127.0.0.1 1 224.0.0.0 224.0.0.0 193.219.192.227 193.219.192.227 1 224.0.0.0 224.0.0.0 159.148.108.217 159.148.108.217 1 255.255.255.255 255.255.255.255 193.219.192.227 0.0.0.0 1 C:\WINDOWS> 94 Address Resolution Protocol I need the Ethernet address of 176.16.3.2. 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ??? • Map IP Ethernet 95 Address Resolution Protocol I heard that broadcast. The message is for me. Here is my Ethernet address. I need the Ethernet address of 176.16.3.2. 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ??? • Map IP Ethernet 96 Address Resolution Protocol I heard that broadcast. The message is for me. Here is my Ethernet address. I need the Ethernet address of 176.16.3.2. 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ??? IP: 172.16.3.2 Ethernet: 0800.0020.1111 • Map IP Ethernet 97 Address Resolution Protocol I heard that broadcast. The message is for me. Here is my Ethernet address. I need the Ethernet address of 176.16.3.2. 172.16.3.1 172.16.3.2 IP: 172.16.3.2 = ??? IP: 172.16.3.2 Ethernet: 0800.0020.1111 • Map IP Ethernet 98 ARP Table Example 99 Ethernet ARP Message Format 100 Excersise / Assignment #1 101 IP Addressing Example Internet Routing Table Network NextHop Distance 192.168.16.16/28 DirectlyConnected 192.168.16.32/28 Directly Connected 192.168.16.0/28 192.168.16.33 0.0.0.0/0 192.168.16.33 0 0 1 12 102 IP Addressing & Routing Assignment #1 Internet A C B Divide class C address 201.7.8.0 in three subnets with subnet mask 255.255.255.224 Assign IP addresses to all interfaces Design routing tables for A, B, C 103