You are on page 1of 19

IP Addressing and Subnetting

High Performance Switching and Routing
Telecom Center Workshop: Sept 4, 1997.

1

Topic   IP Addressing Subnetting 2 .

IP Addresses 32 bits version (4 bits) header length Type of Service/TOS (8 bits) flags (3 bits) Total Length (in bytes) (16 bits) Fragment Offset (13 bits) Header Checksum (16 bits) Identification (16 bits) TTL Time-to-Live (8 bits) Protocol (8 bits) Source IP address (32 bits) Destination IP address (32 bits) Ethernet Header IP Header TCP Header Application data Ethernet Trailer Ethernet frame 3 .

143.144 128.143.IP Addresses 32 bits 0x4 0x5 9d08 12810 0x06 128.21 0x00 0102 4410 00000000000002 8bff Ethernet Header IP Header TCP Header Application data Ethernet Trailer Ethernet frame 4 .137.71.

Hosts. and Routers Host 7 Host 1 Network A Host 2 Host 1 Router Network B Network C Unique IP Address = Network Number + Host Number Host 12 Host 2 5 . Networks.

6 .The Most Common Routing Protocols BGP RIP Cisco proprietary TCP UDP OSPF IS-IS EIGRP (and ICMP) IP Routing protocols exchange network reachability information between routers.

Classful Addresses Class A 0nnnnnnn hhhhhhhh hhhhhhhh hhhhhhhh 10nnnnnn nnnnnnnn hhhhhhhh hhhhhhhh 110nnnnn nnnnnnnn nnnnnnnn hhhhhhhh Class B Class C n = network address bit h = host identifier bit 7 .

777.152 254 Leads to very inefficient allocation of addresses … 8 .097.384 65.The Classful Address Space Class A B C Networks Hosts 127 Share of IP address space 16.534 2.214 1/2 1/4 1/8 16.

college campus.g.Subnets     The idea is to share the same IP network number among multiple subnets Subnets of a network should reside in the same general locale (e.. corporate location. …) Routers on an IP network know their local subnets Remote routers need to know only the network address 9 .

Subnetting  Problem: Organizations have multiple networks which are independently managed  University Network Engineering School Library Medical School Solution 1: Allocate a separate network address for each network   Difficult to manage From the outside of the organization. each network must be addressable.  Solution 2: Add another level of hierarchy to the IP addressing structure Subnetting 10 .

0/16 University Network 128.0.143.143.121.56.0/24 Engineering School Medical School 128.Address assignment with subnetting   Each part of the organization is allocated a range of IP addresses (subnets or subnetworks) Addresses in each subnet can be administered locally 128.0/24 128.136.143.71.143.0/24 11 .0/24 Library 128.143.

Result is a 3-layer hierarchy network prefix host number network prefix  subnet number host number Then:    extended network prefix Subnets can be freely assigned within the organization Internally.Basic Idea of Subnetting   Split the host number portion of an IP address into a subnet number and a (smaller) host number. subnets are treated as separate networks Subnet structure is not visible outside the organization 12 .

144 host number 128.Subnetmask  Routers and hosts use an extended network prefix (subnetmask) to identify the start of the host numbers 128.143 network prefix 137.143 network prefix extended network prefix 137 subnet number 144 host number 1111111111111111 1111111100000000 subnetmask 13 .

Since external routers do not know about subnetting. Note: Length of the subnet mask need not be identical at all subnetworks. 14  . the complexity of routing tables at external routers is reduced. IP addresses use a 3-layer hierarchy:  Network  Subnet  Host  Reduces router complexity.Advantages of Subnetting  With subnetting.

0.0.21/16 subnetmask: 255.0 128.143.201/16 subnetmask: 255.0 128.No Subnetting  All hosts think that the other hosts are on the same network 128.137.143.0 128.0 128.255.255.71.137.144/16 subnetmask: 255.143.32/16 subnetmask: 255.255.255.0.0/16 15 .71.0.70.143.143.

0/24 Subnet 16 .With Subnetting  Hosts with same extended network prefix belong to the same network 128.255.143.0/24 Subnet 128.255.0 128.137.0/16 128.71.143.255.137.0 subnetmask: 255.143.143.144/24 subnetmask: 255.255.255.255.143.0 128.71.143.0.0 128.137.21/24 subnetmask: 255.201/24 subnetmask: 255.71.255.32/24 128.143.255.

255.0.0.144/26 128.0/26 Subnet 128.0 128.137.128/26 Subnet 128.143.255.137.71.255.255.143.32/26 128.71.With Subnetting  Different subnetmasks lead to different views of the size of the scope of the network 128.143.0/16 17 .255.255.143.137.143.0 subnetmask: 255.255.0/24 Subnet 128.143.192 128.71.143.137.143.21/24 subnetmask: 255.201/16 subnetmask: 255.192 subnetmask: 255.

172.78.1 220.0 255.128 220.255.168.1 220.64 220.78.0 220.78.78.173.255.78.0 220.78.128 220.1 Routing Table for Router B 255.175.192 220.0 255.78.1 220.168.1 220.78.0 255.78.168.255.0 Routing Routing Table Table for for Router Router BB 220.255.78.78.0 220.0 220.255.0 220.78.174.255.0 255.0 220.168.78.0 220.1 220.78.255.255.78.169.78.168.255.168.0 220.168.0 255.175.78.255.78.0 220.170.168.78.78.78.0 220.171.0 220.1 220.0 220.78.0 255.169.168.0 220.168.78.78.0 220.168.78.0 220.169.78.1 220.0 220.168.78.Optimizing the Allocation of IP Addresses After Subnetting Before After Supernetting: Supernetting: 220.192 220.0 220.255.255.169.64 220.1 220.78.168.255.78.0 255.171.255.169.170.168.174.78.255.78.0 255.78.168.173.78.78.64 Router Router A Route A rA Router B Router B Router B 18 .0 220.170.78.255.255.78.170.168.0 220.168.168.172.78.255.0 220.0 220.78.0 220.169.

END. 19 .