Computer Networks – CSE331
Lecture 5
 Unique number that represent universally defines connection of a
device (a router, computer etc)
 IPv4 address is 32bit long identifier
 The address space is 232 or 4,294,967,296 (more that 4 billion)
 4 octets each separated by a dot (dotted decimal notation)
 Each octet is of b bits so 0-255 value
 128.11.3.31
 First address is 146.102.29.0 and the last address is 146.102.32.255
 Subtract first address from last in base 256 0.0.3.255
 Convert this to base 10 & add 1
 See more examples from Forouzan book chapter 5
 (Review your concepts for number conversion)
 The network prefix identifies a network and the host number
identifies a specific host (actually, interface on the network).
 Two level addressing
 How do we know how long the network prefix is?
 The network prefix used to be implicitly defined (class-based
addressing, A,B,C,D…)
 The network prefix now is flexible and is indicated by a
prefix/netmask (classless)
network prefix host number
 Address is associated
with interface
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
 When Internet addresses were standardized (early 1980s)
 5 Classes
Network Prefix
 Wastage – not enough addresses an organization require
 Routing table issue
 If 2000 address are required?
 A & B class are much more
 8 class C addresses
 Flexibility required
1 bit reserved so 27 blocks
Hence 128 organizations
24 bits are of host part
Hence 224 hosts in each
127.x.x.x is reserved for loopback address
For complete list see reading material slide
Subnetting
 Problem: Organizations have
multiple networks which are
independently managed
 Solution 1: Allocate an address for
each network
 Difficult to manage
 From the outside of the
organization, each network
must be addressable i.e have
an identifiable address.
 Solution 2: Add another level of
hierarchy to the IP addressing
structure
University Network
Medical
School
Library
Engineering
School
 Split the host number portion of an IP address into a subnet
number and a (smaller) host number
 Result is a 3-layer hierarchy
 Then:
 Subnets can be freely assigned within the organization
 Internally, subnets are treated as separate networks
 Subnet structure is not visible outside the organization
network prefix host number
subnet numbernetwork prefix host number
extended network prefix
Will be more in Lab
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
 Purchase what you need
11001000 00010111 00010000 00000000
subnet
part
host
part
200.23.16.0/23
Can not judge block by looking at address
 230.8.24.56 could belong to many blocks
 So prefix is required, suffix can be changed
 Given 17.63.110.114/24
 Prefix & Suffix length
 No of addresses?
 Network mask?
 First address?
 Last address?
 Given 110.23.120.14/20
 Prefix & Suffix length
 No of addresses?
 Network mask?
 First address?
 Last address?
=> 232-24 = 28 = 256
255.255.255.0
17.63.110.0
17.63.110.255
=> 232-20 = 212 = 4096
20 bits are 1 => 255.255.240.0
First 20 bits => 110.23.112.0
First 20 bits fix, last 12 bits 1 =>
110.23.127.255
24 and 8
20 and 12
CIDR Block Prefix # of Host Addresses
/27 32 hosts
/26 64 hosts
/25 128 hosts
/24 256 hosts
/23 512 hosts
/22 1,024 hosts
/21 2,048 hosts
/20 4,096 hosts
/19 8,192 hosts
/18 16,384 hosts
/17 32,768 hosts
/16 65,536 hosts
/15 131,072 hosts
/14 262,144 hosts
/13 524,288 hosts
206.0.64.0/18
204.188.0.0/15
209.88.232.0/21Internet Backbone
ISP K owns:
Company X :
206.0.68.0/22
ISP Y :
209.88.237.0/24
Organization Z1 :
209.88.237.192/26
Organization Z2 :
209.88.237.0/26
Backbone sends everything
which matches the prefixes
206.0.64.0/18, 204.188.0.0/15,
209.88.232.0/21 to ISP K.
ISP K sends everything which
matches the prefix:
206.0.68.0/22 to Company X,
209.88.237.0/24 to ISP Y
Backbone routers do not know
anything about Company X, ISP
Y, or Organizations Z1, Z2.
ISP K does not know about
Organizations Z1, Z2. ISP Y sends everything which matches
the prefix:
209.88.237.192/26 to Organizations Z1
209.88.237.0/26 to Organizations Z2
 Some Address is 152.4.3.9/21
 We have to make 4 subnets
 Find address for each subnet
 How many bits are now part of subnet address
 How many host we can attach in a subnet
 What is the network mask for each subnet
 What is the first & last address for each subnet
 Forouzan book
 Chapter 5
 Leave NAT
 Reserved addresses
 http://www.inetdaemon.com/tutorials/internet/ip/addresses/specia
l.shtml
 http://www.iana.org/assignments/iana-ipv4-special-registry/iana-
ipv4-special-registry.xhtml
 Or See Original RFC http://www.rfc-editor.org/rfc/rfc5735.txt

Lec 5(Ip Addressing and Subnets)

  • 1.
    Computer Networks –CSE331 Lecture 5
  • 2.
     Unique numberthat represent universally defines connection of a device (a router, computer etc)  IPv4 address is 32bit long identifier  The address space is 232 or 4,294,967,296 (more that 4 billion)  4 octets each separated by a dot (dotted decimal notation)  Each octet is of b bits so 0-255 value  128.11.3.31
  • 3.
     First addressis 146.102.29.0 and the last address is 146.102.32.255  Subtract first address from last in base 256 0.0.3.255  Convert this to base 10 & add 1  See more examples from Forouzan book chapter 5  (Review your concepts for number conversion)
  • 4.
     The networkprefix identifies a network and the host number identifies a specific host (actually, interface on the network).  Two level addressing  How do we know how long the network prefix is?  The network prefix used to be implicitly defined (class-based addressing, A,B,C,D…)  The network prefix now is flexible and is indicated by a prefix/netmask (classless) network prefix host number
  • 5.
     Address isassociated with interface 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2223.1.3.1 223.1.3.27
  • 6.
     When Internetaddresses were standardized (early 1980s)  5 Classes Network Prefix
  • 7.
     Wastage –not enough addresses an organization require  Routing table issue  If 2000 address are required?  A & B class are much more  8 class C addresses  Flexibility required 1 bit reserved so 27 blocks Hence 128 organizations 24 bits are of host part Hence 224 hosts in each 127.x.x.x is reserved for loopback address For complete list see reading material slide
  • 8.
    Subnetting  Problem: Organizationshave multiple networks which are independently managed  Solution 1: Allocate an address for each network  Difficult to manage  From the outside of the organization, each network must be addressable i.e have an identifiable address.  Solution 2: Add another level of hierarchy to the IP addressing structure University Network Medical School Library Engineering School
  • 9.
     Split thehost number portion of an IP address into a subnet number and a (smaller) host number  Result is a 3-layer hierarchy  Then:  Subnets can be freely assigned within the organization  Internally, subnets are treated as separate networks  Subnet structure is not visible outside the organization network prefix host number subnet numbernetwork prefix host number extended network prefix
  • 11.
  • 12.
    CIDR: Classless InterDomainRouting  subnet portion of address of arbitrary length  address format: a.b.c.d/x, where x is # bits in subnet portion of address  Purchase what you need 11001000 00010111 00010000 00000000 subnet part host part 200.23.16.0/23
  • 13.
    Can not judgeblock by looking at address  230.8.24.56 could belong to many blocks  So prefix is required, suffix can be changed
  • 14.
     Given 17.63.110.114/24 Prefix & Suffix length  No of addresses?  Network mask?  First address?  Last address?  Given 110.23.120.14/20  Prefix & Suffix length  No of addresses?  Network mask?  First address?  Last address? => 232-24 = 28 = 256 255.255.255.0 17.63.110.0 17.63.110.255 => 232-20 = 212 = 4096 20 bits are 1 => 255.255.240.0 First 20 bits => 110.23.112.0 First 20 bits fix, last 12 bits 1 => 110.23.127.255 24 and 8 20 and 12
  • 15.
    CIDR Block Prefix# of Host Addresses /27 32 hosts /26 64 hosts /25 128 hosts /24 256 hosts /23 512 hosts /22 1,024 hosts /21 2,048 hosts /20 4,096 hosts /19 8,192 hosts /18 16,384 hosts /17 32,768 hosts /16 65,536 hosts /15 131,072 hosts /14 262,144 hosts /13 524,288 hosts
  • 16.
    206.0.64.0/18 204.188.0.0/15 209.88.232.0/21Internet Backbone ISP Kowns: Company X : 206.0.68.0/22 ISP Y : 209.88.237.0/24 Organization Z1 : 209.88.237.192/26 Organization Z2 : 209.88.237.0/26 Backbone sends everything which matches the prefixes 206.0.64.0/18, 204.188.0.0/15, 209.88.232.0/21 to ISP K. ISP K sends everything which matches the prefix: 206.0.68.0/22 to Company X, 209.88.237.0/24 to ISP Y Backbone routers do not know anything about Company X, ISP Y, or Organizations Z1, Z2. ISP K does not know about Organizations Z1, Z2. ISP Y sends everything which matches the prefix: 209.88.237.192/26 to Organizations Z1 209.88.237.0/26 to Organizations Z2
  • 17.
     Some Addressis 152.4.3.9/21  We have to make 4 subnets  Find address for each subnet  How many bits are now part of subnet address  How many host we can attach in a subnet  What is the network mask for each subnet  What is the first & last address for each subnet
  • 18.
     Forouzan book Chapter 5  Leave NAT  Reserved addresses  http://www.inetdaemon.com/tutorials/internet/ip/addresses/specia l.shtml  http://www.iana.org/assignments/iana-ipv4-special-registry/iana- ipv4-special-registry.xhtml  Or See Original RFC http://www.rfc-editor.org/rfc/rfc5735.txt