Sie sind auf Seite 1von 26

IPV4 ADDRESSING

THE BASICS

IT: Network: Cisco 1


Fall 2013
Internet Protocol (IP) from last time
Exists to route
Are source and destination nodes on same network?

Defines Packet & Header that is transferred

Defines IP address (32 bit number)


Dotted Decimal (172.17.13.57)
Used to both identify network and host on network
IP Addressing Binary
Base-10 (Decimal)
Power of 10 104 103 102 101 100

Value 10,000 1,000 100 10 1

Base-2
Only two tokens 0 and 1
Places are powers of 2

Power of 27 26 25 24 23 22 21 20
2
Value 128 64 32 16 8 4 2 1
IP Addressing Binary Sequence
Decimal Binary
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
12 1 1 0 0
13 1 1 0 1
14 1 1 1 0
15 1 1 1 1
IP Addressing Structure
Convert Binary to Decimal
What is 1010 1100 in decimal?
Write out the powers of 2 (from Right to Left)

Power 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1

Write the bits of the given Binary number under the correct place values

Power 27 26 25 24 23 22 21 20
Value 128 64 32 16 8 4 2 1
1 0 1 0 1 1 0 0

Add up the Values where the given binary number has a 1
128 + 32 + 8 + 4 = 172

1010 1100 = 172


IP Addressing Structure
Convert decimal to Binary
What is 172 in binary?
Look at place values for Binary numbers:
172
128 172 >= 128 1 in 128s place
44
44 < 64 0 in 64s place
32 44 >= 32 1 in 32s place
12
12 < 16 0 in 16s place
8 12 >=8 1 in 8s place
4
- 4 4 => 4 1 in 4s place
0
0 <= 2 0 in 2s place
0 <= 1 0 in 1s place

172 = 1 0 1 0 1 1 0 0
IP Addressing Structure
Practice converting decimal to 8-bit binary
Convert whole IP address to Binary
Just do each octet on its own!
Fill out Octet with leading 0's.

172 . 17 . 13 . 57
1010 1100 . 0001 0001 . 0000 1101 . 0011 1001

172 . 17 . 11 . 16
1010 1100 . 0001 0001 . 0000 1011 . 0001 0000
Easier way
Microsoft Calculator
Start All Programs Accessories Calculator
Under View menu, choose Scientific (XP) or
Programmer (Win7)
Basic IP Addressing Review
32-bit address
Represented as four 8-bit numbers (octets)
separated by periods (dotted decimal)
8-bits gives decimal values 0 255 for each octet
e.g. 192.168.163.24

Part of address (192.168.163) is network ID


Rest of address (24) is host ID on that network

If two addresses have same network portion, we can


do local delivery
Special IP addresses
Host portion all 0s
Network ID or name of network
172.17.13.0
Cant be assigned to any interface!

Host portion all 1s


Network or Directed broadcast
172.17.13.255
Cant be assigned to any interface!

All bits are 1s


Limited broadcast Routers dont forward this
255.255.255.255
Cant be assigned to any interface!
Subnet mask
This is another 32-bit number

Need to think in binary to really see what this does.

If a bit in subnet mask is a 1, corresponding bit in the IP


address is part of network ID

If a bit in subnet mask is a 0, corresponding bit in the IP


address is part of host ID

All binary '1's will be grouped at start (left) of subnet mask


Full-Octet masking
Look at subnet mask = 255.255.255.0
255 . 255 . 255 . 0 =
11111111.11111111.11111111.00000000

Entire first three octets in IP address are Network ID


Entire last octet is the host ID

192.168.163.24 sends to 192.168.163.145


First three octets are the same Perform local delivery!
Two Other examples
192.168.163.24
with subnet mask of 255.255.255.0
Sends to 192.168.164.145
Local or Not?

192.168.163.24
with subnet mask of 255.255.0.0
Sends to 192.168.164.145
Local or Not?
Classless Inter-Domain Routing (CIDR or
Slash Notation)
Just another way of saying same things as IP address
and Subnet Mask

Specify address and number of bits that represent


network

Combo of address and subnet mask


192.168.163.87 /24 =
n 192.168.163.87 mask 255.255.255.0

100.18.73.201 /8
n 100.18.73.201 mask 255.0.0.0
Default Subnet Masks
Also called Classful subnetting
Class determined by first octet
Class A : 1 127 (0xxxxxxxx) : 255.0.0.0
n 7 bits for network ID
Class B : 128 191 (10xxxxxx) : 255.255.0.0
n 6+8 = 14 bits for network ID
Class C : 192 223 (110xxxxx) : 255.255.255.0
n 5+8+8=21 bits for network ID

Class D: 224 239 (1110xxxx) : multicast


Class E : 240 255 (1111xxxx) : reserved
Classful Examples
15.56.240.18
First
octet (15) between 1 and 127
Class A network

Default mask = 255.0.0.0

204.153.163.200
First
octet (204) between 192 and 223
Class C network

Default mask = 255.255.255.0


What to use?
Class A
Very few networks (127 total)
Each has lots of hosts (224 2 = 16,777,214)

Class B
Happy Medium
n 16,384 (214) networks; 65,534 (216 - 2) hosts per net

Class C
Lotsof networks (221 = 2,097,152)
Only 254 (28 - 2) hosts per network
Example network
Multiple Class C networks

201.47.51.0 201.47.52.0

201.47.50.0 201.47.54.0
201.47.53.0
Multi-Class C Plus/Minus
Positives
Each sub-network has own network address
All subnets can be routed out to Internet

Negatives
Need multiple, full, Class-C addresses
(good luck)
Private IP Addresses
Reserved by Internet committees for internal, private
use
Not routable on The Internet

1 class A :: 10.0.0.0

16 class B's :: 172.16.0.0 172.31.0.0

255 class C's :: 192.168.x.0

APIPA :: 169.254.0.0
Automatic Private IP Addressing
Use Private IP addresses

192.168.10.0 192.168.20.0

192.168.30.0 192.168.1.0 192.168.40.0


Private IP Address Plus/Minus
Positives
Each sub-network has own network address
No real addresses needed
n ONE address needed if want to get out
n (see below)

Negatives
Need something else to get out to internet
n Network Address Translation (NAT)
n Translates the Private addresses inside into a real address
on the outside
Use of NAT
IP Addressing Basics Summary
IP address is 32-bits long
Part of IP address will be network
Rest of IP address with be host
Number of bits in network determined by Subnet Mask
Each node must have unique IP address

Each network (subnet) needs a unique Network


address
Allhosts on a given physical subnet must have the same
network address
Hosts on different physical subnets must have different
network addresses

Das könnte Ihnen auch gefallen