690 likes | 701 Views
Learn about IP address structure, classes, reserved and private addresses, subnetting, network masks, and broadcast addresses. Suitable for both beginners and advanced users.
E N D
Chapter 4: Network Layer 4. 1 Introduction 4.2 Virtual circuit and datagram networks 4.3 What’s inside a router 4.4 IP: Internet Protocol Datagram format IPv4 addressing ICMP IPv6 4.5 Routing algorithms Link state Distance Vector Hierarchical routing 4.6 Routing in the Internet RIP OSPF BGP 4.7 Broadcast and multicast routing IP address
The Internet Network layer Host, router network layer functions: • ICMP protocol • error reporting • router “signaling” • IP protocol • addressing conventions • datagram format • packet handling conventions • Routing protocols • path selection • RIP, OSPF, BGP forwarding table Transport layer: TCP, UDP Network layer Link layer physical layer IP address Computer network-Link Layer and LANs
Objectives • Concept of IP Address • Class of IP Address • Reserved and Private IP Address • Network Mask and Subnetting • VLSM and CIDR IP address
IP Address • Each computer in a TCP/IP network must be given a unique identifier, or IP address. An IP address is a 32-bit sequence of 1s and 0s. IP address
Representation of IP Address • To make the IP address easier to use, the address is usually written as four decimal numbers separated by periods 192 . 168 . 123 . 2 IP address
Structure of IP Address IP address
IP地址的类别(Class of IP Address) IP address
Class A • Address Range:1-126(127 Reserved) IP address
Class B • Address Range:128-191 IP address
Class C • Address Range:192-223 IP address
Address Allocating • Allocate A class IP:(国际网络信息中心NIC) • Allocate B class IP :InterNIC、APNIC、ENIC • Allocate C class IP (国家或地区的NIC) IP address
Reserved Address • 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. • 0.0.0.0 • An IP address that has binary 0s in all bit positions is reserved for default • route • 255.255.255.255, • An IP address that has binary 1s in all bit positions is reserved for flood broadcast IP address
Private IP Address • Private IP addresses are another solution to the problem of the impending exhaustion of public IP addresses. • Private IP addresses are not routed on the Internet backbone. IP address
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 IP address
IP Address Classes Exercise Answers 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 IP address
Network Mask Class A:255.0.0.0 classB:255.255.0.0 class C:255.255.255.0 IP address
10101100 00010000 00000010 10100000 172.16.2.160 11111111 11111111 00000000 00000000 255.255.0.0 10101100 00010000 00000000 00000000 172.16.0.0 Function of Network Mask Network ID IP address
Subnetting • To efficiently manage a limited supply of IP addresses, all classes can be subdivided into smaller subnetworks. IP address
Reasons for Subnetting • Provides addressing flexibility Provides • Broadcast Containment • Low-level security on the LAN IP address
Introduction to Subnetting • Host bits must are reassigned (or “borrowed”) as network bits. 3 bits borrowed allows 23-2 or 6 subnets 5 bits borrowed allows 25-2 or 30 subnets IP address 12 bits borrowed allows 212-2 or 4094 subnets
Introduction toSubnetting 不考虑子网 Net id Host id Net mask Net id Host id 考虑子网化 Net mask Net id Subnet id Host id Extended net id IP address
Comparison between decimal and binary IP address
E.g1 Two BitsSubnetting for Class C • Subnetrange • 00 000000 0 00000001~00111111 1~62 • 01 000000 64 01000001~01111111 65~127 • 10 000000 128 10000001~10111111 129~191 • 11 000000 192 11000001~11111111 193~255 IP address
Number of Usable Subnets and Hosts • usable subnets= • (2 power of borrowed bits)–2 • usable hosts= • (2 power of remaining host bits)–2 IP address
Summary of Class C Subnetting IP address
Written Exercise: Subnet Masks Address Subnet Mask Class Subnet 172.16.2.10 255.255.255.0 10.6.24.20 255.255.0.0 172.30.36.12 255.255.255.0 202.30.36.82 255.255.255.192 IP address
Subnet Mask Exercise Answers Address Subnet Mask Class Subnet 172.16.2.10 255.255.255.0 B 172.16.2.0 10.6.24.20 255.255.240.0 A 10.6.16.0 10.30.36.12 255.255.255.0 A 10.30.36.0 IP address
Broadcast Addresses Broadcast Subnet Subnet Mask Class Address 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 IP address
Broadcast Addresses Exercise Answers Address Subnet Mask Class Subnet Broadcast 201.222.10.60 255.255.255.248 C 201.222.10.56 201.222.10.63 15.16.193.6 255.255.248.0 A 15.16.192.0 15.16.199.255 128.16.32.13 255.255.255.252 B 128.16.32.12 128.16.32.15 153.50.6.27 255.255.255.128 B 153.50.6.0 153.50.6.127 IP address
Subnets IP address: subnet part (high order bits) host part (low order bits) What’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router 223.1.1.1 223.1.2.1 223.1.1.2 223.1.2.9 223.1.1.4 223.1.2.2 223.1.1.3 223.1.3.27 subnet 223.1.3.2 223.1.3.1 network consisting of 3 subnets IP address
Subnets Recipe To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Subnet mask: /24 IP address
Subnets How many? 223.1.1.2 223.1.1.1 223.1.1.4 223.1.1.3 223.1.7.0 223.1.9.2 223.1.9.1 223.1.7.1 223.1.8.1 223.1.8.0 223.1.2.6 223.1.3.27 223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2 IP address
IP addressing: CIDR CIDR:Classless InterDomain Routing subnet portion of address of arbitrary length address format: a.b.c.d/x, where x is # bits in subnet portion of address host part subnet part 11001000 0001011100010000 00000000 200.23.16.0/23 IP address
30 hosts per subnet Class C address: 201.222.5.0 Other subnets Subnet Programming IP address
Variable-Length Subnet Mask 172.16.0.0/16 HQ IP address
Variable-Length Subnet Mask 172.16.1.0/24 172.16.0.0/16 HQ HQ 172.16.2.0/24 IP address
Variable-Length Subnet Mask 172.16.14.32/27 A 172.16.1.0/24 172.16.14. 64/27 B 172.16.0.0/16 HQ HQ 172.16.2.0/24 172.16.14.96/27 C • Subnet 172.16.14.0/24 is divided into smaller subnets: • Subnet with one mask at first (/27) IP address
Variable-Length Subnet Mask 172.16.14.32/27 172.16.14.132/30 A 172.16.1.0/24 172.16.14. 64/27 172.16.14.136/30 B 172.16.0.0/16 • Subnet with one mask at first (/27) • Further subnet one of these subnets not used elsewhere (/30) HQ HQ 172.16.14.96/27 172.16.2.0/24 C 172.16.14.140/30 IP address
Calculating VLSMs Subnetted Address: 172.16.32.0/20In Binary 10101100. 00010000.00100000.00000000 IP address
Calculating VLSMs Subnetted Address: 172.16.32.0/20In Binary 10101100. 00010000.00100000.00000000 VLSM Address: 172.16.32.0/26In Binary 10101100. 00010000.00100000.00000000 IP address
Calculating VLSMs Subnetted Address: 172.16.32.0/20In Binary 10101100. 00010000.00100000.00000000 VLSM Address: 172.16.32.0/26In Binary 10101100. 00010000.00100000.00000000 1 0 1 0 1 1 0 0 . 0 0 0 1 0 0 0 0 . 0 0 1 0 0 0 0 0 . 0 0 0 0 0 0 0 0 = 172.16.32.0/26 1st subnet: Network Subnet VLSM subnet Host IP address
Calculating VLSMs Subnetted Address: 172.16.32.0/20In Binary 10101100. 00010000.00100000.00000000 VLSM Address: 172.16.32.0/26In Binary 10101100. 00010000.00100000.00000000 1st subnet: 1 0 1 0 1 1 0 0 . 0 0 0 1 0 0 0 0 . 0 0 1 0 0 0 0 0 . 0 0 0 0 0 0 0 0 = 172.16.32.0/26 2nd subnet: 1 7 2 . 16 . 0 0 1 0 0 0 0 0 . 0 1 0 0 0 0 0 0 = 172.16.32.64/26 3rd subnet: 1 7 2 . 16 . 0 0 1 0 0 0 0 0 . 1 0 0 0 0 0 0 0 = 172.16.32.128/26 1 7 2 . 16 . 0 0 1 0 0 0 0 0 . 1 0 0 0 0 0 0 = 172.16.32.192/26 4th subnet: 1 1 7 2 . 16 . 0 0 1 0 0 0 0 1 . 0 0 0 0 0 0 0 0 = 172.16.33.0/26 5th subnet: Network Subnet VLSM Subnet Host IP address
Derived from the 172.16.32.0/20 Subnet Exercise:Design Network Using VLSM (62 Hosts) (62 Hosts) (62 Hosts) (62 Hosts) IP address
Derived from the 172.16.33.0/26 Subnet Derived from the 172.16.32.0/20 Subnet Exercise Answer 172.16.32.0/26 172.16.33.0/30 172.16.32.64/26 172.16.33.4/30 172.16.33.8/30 172.16.32.128/26 172.16.33.12/30 172.16.32.192/26 30-Bit Mask (2 Hosts) 26-Bit Mask (62 Hosts) IP address
Again IP address
Net-id and host-id 0 A class net-id 8 bit host-id 24 bit 1 0 B class net-id 16 bit host-id 16 bit C class 1 1 0 net-id 24 bit host-id 8 bit 1110 D class Multicast address 11110 E class reserved IP address
range Class network No.s from to hostnumber A 126 (27 – 2) 1 126 16,777,214 B 16,384 (214)-2 128.0 191.255 65,534 C 2,097,152 (221)-2 192.0.0 223.255.255 254 IP address
Five classes IP address 1/2 6 1/4 1/8 1/16 1/32 IP address IP地址与网络层
Some special IP address IP address