IP Addressing Lecture Assignment
IP Addressing Lecture Assignment
IP Adressing 2
Recall, IP Addresses
TCP/IP networks use IP for the network layer protocol
IP defines 4 octet addresses
4 billion possible addresses
Usually written in the form A.B.C.D
A, B, C, and D are each 1 octet (0-255), normally written in
decimal notation
Thus, IP addresses fall in the range:
0.0.0.0 – 255.255.255.255
IP Address Classes
Class A:
bit index: 0 1-7 8-31
Class B:
bit index: 0 1 2-15 16-31
1 0 network host
Class C:
bit index: 0 1 2 3-23 24-31
1 1 0 network host
1
7/5/2015
IP Address Classes
• Class A:
– Range: 1.0.0.0 – 126.0.0.0
– Networks: 128 max, Machines: 65537-1.6 million
– e.g. huge networks, such as large military/government organizations
(e.g. FBI), the @Home network, etc…
• Class B:
– Range: 128.1.0.0 – 191.255.0.0
– Networks: 16384 max, Machines: 257-65536
– e.g. Internet service providers (ISPs) (dial-up)
• Class C:
– Range: 192.1.0.0 – 223.255.255.0
– Networks: 2 million max, Machines: 1-256
– e.g. Small businesses
2
7/5/2015
Reserved IP Address
• Directed Broadcast Address
– Used to send data to all devices on a network
– Ex. The network address 172.16.0.0
• Local Broadcast Address
• If an IP device wants to communicate with all devices on the local network
• Local Loopback Address
– 127.0.0.1
Private IP Addresses
Depending on the address class needed by an
organization, a range of internal addresses is available:
Class A: 10.0.0.0 – 10.255.255.255
Class B: 172.16.0.0 – 172.31.255.255
Class C: 192.168.0.0 – 192.168.255.255
IP routers outside a private (connection-shared)
network, will not forward datagrams designated for
addresses in these ranges
Private IP Addresses
RFC 1918 (Request for comments)
Used in local organization
3
7/5/2015
Example: 12.0.0.0
These are actually fairly straightforward calculations. The
easiest way to do it is to depict both the ip address and the
subnet mask in binary. Take 12.0.0.0 with subnet mask
255.0.0.0 listed in binary:
ip address: 00001100.00000000.00000000.00000000
subnet mask: 11111111.00000000.00000000.00000000
If you do a binary AND between these two numbers, you get
the network address:
ip address: 00001100.00000000.00000000.00000000
subnet mask: 11111111.00000000.00000000.00000000
-----------------------------------AND
network address: 00001100.00000000.00000000.00000000
which translated back to dotted decimal notation is 12.0.0.0
To get the host portion, invert the subnet mask and again
perform a binary AND with the ip address: ip address:
00001100.00000000.00000000.00000000
inverted subnet mask:
00000000.11111111.11111111.11111111
-----------------------------------AND
host portion: 00000000.00000000.00000000.00000000
which translated back to dotted decimal notation is 0.0.0.0
4
7/5/2015
Example: 68.12.0.0
To create the subnet mask, first remember that the purpose
of the subnet mask is to separate the (32 bit) ip address into
the network prefix and the host number. If a bit in the subnet
mask is 1, the corresponding bit in the IP address is part of
the network address; if the bit in the subnet mask is 0, the
corresponding bit in the IP address is part of the host
address.
ip address: 01000100.00001100.00000000.00000000
5
7/5/2015
Subnetworks
Smaller networks are easier to manage
Overall traffic is reduced
You can more easily apply network security policies
6
7/5/2015
7
7/5/2015
Exercise 3
• Complete the table for an IP 192.168.10.0 where 6 subnets are
required.
IP Address Network Address Host Range Broadcast Address