Você está na página 1de 26

IP Addressing

TCP/IP Models
TCP/IP has 4 layers and OSI model has 7 layers
each computer has a the physical address,
each computer needs a unique IP address,
sometimes called logical address

Several methods of assigning an IP address


Static
Dynamic

NF-Chpt 6

page 1

IP Addressing

IP Address
IPv4 addresses are 32 bits long, written in Dotted Decimal,
and separated by (periods).

122

NF-Chpt 6

76

66

108

page 2

IP Addressing

Binary Notation
Binary 00000000 = Decimal 0; Binary 11111111 = Decimal 255
= 0 -255

Convert 211 to binary

Convert 187 to binary

NF-Chpt 6

1 1

0 1

1 0

0 1

211
-128
-----83
- 64
------19
- 16
------3
- 2
------1

187
-128
-----59
- 32
------27
- 16
------11
- 8
------3

page 3

IP Addressing

Review Binary to decimal


convert 0011 0011 to decimal = 51
Binary 1010 1110 to decimal= 174

00 00 0000

=0

01 11 1111

=127

10 00 0000

=128

10 11 1111

=191

110 0 0000

=192

110 1 1111

=223

1110 0000

= 224

NF-Chpt 6

page 4

IP Addressing

IP addressing
An IP address is a 32-bits

= 4 * ( 8 bits) Each 8 bit is called an octet = eight binary digits.


Address = 4 decimal (dotted)

- 192.168.1.8 (dotted decimal notation)

11000000.10101000.00000001.00001000 in binary
notation.

0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0

Write down the decimal


form:__________1.128.2.4__________________
NF-Chpt 6

page 5

IP Addressing

Telephone number example


E.g. a new country using 5 digits
numbers

the phone numbers are divided into 9


regions

1
2
3

How should the numbers be organized?

4
5

How many digits for the region code?1

How many digits for the user numbers?4

How many phones allowed in each


region? 9999

NF-Chpt 6

8
9

page 6

IP Addressing

Grouping of telephone numbers


How does the telephone system work?

233333

HK East

HK West

3
4

Kowloon East

400044

9 NT East
NF-Chpt 6

page 7

IP Addressing

IP also use groups - Networks


Where to send packet??

1.x.x.x

data

2.x.x.x

data

1.0.0.1

2.0.0.1

3.1.1.1

3.x.x.x

data

1.0.0.2.

2.0.0.2.

3.2.2.2.

1.0.0.3

2.0.0.3

3.4.4.3

4.x.x.x
To which path ?????

Router use NETWORK ID (group-id) to choose path.


NF-Chpt 6

page 8

IP Addressing

IP address- rental

Company ABC rent an IP network from ISP, e.g. 200.0.1.0

actually a Network = group of addresses, or


Starting from 200.0.1.1 200.0.1.2, . 200.0.1.255
200.0.1.X belongs to ABC only unique.
Can have one LAN of 255 stations.
200.0.1.
1
2

254

Can you find 200.0.2.22 in the above LAN? __No___


NF-Chpt 6

page 9

IP Addressing

Which part is the network bits


Network = Group = Region
Network part can be 1st byte; 1st two bytes; OR 1st three bytes

Class-A
Network | ----------Host ----------------
Class-B

---- Network ---- | ----Host ---------

Class-C
-------- Network ---------- | Host-
NF-Chpt 6

page 10

IP Addressing

IPv4 addressing
IP addresses have two parts
One part identifies network portion, other identifies (host or PC)

Network | --------Host -------------

E.g. 00000010. 00000100. 00000100. 00001000


Write down the dotted decimal form.
______________________________
NF-Chpt 6

page 11

IP Addressing

IPv4 addressing (class-A)


Network | --------Host -------------------

Using the scheme, how many networks (group or region)?


Hint: 2 bits 4 networks. 8 bit __256__ networks
How many PCs in EACH network (group or region)?
Hint: 5 bits 32 PCs. 24 bit ___16M___ PCs

NF-Chpt 6

page 12

IP Addressing

IPv4 addressing (class-B)


---- Network --- | ----Host --------

How many networks (group or region)?


Hint: 2 bits 4 networks. 16 bit _64K___ networks
How many PCs in EACH network (group or region)?
Hint: 6 bits 64 PCs. 16 bit __64k___ PCs
Suitable for Small, Medium or Large Companys.
NF-Chpt 6

page 13

IP Addressing

IPv4 addressing (class-C)


------------Network --------- |Host

How many networks (group or region)?


Hint: 2 bits 4 networks. 24 bit _16M___ networks
How many PCs in EACH network (group or region)?
Hint: 7 bits 128 PCs. 8 bit __256___ PCs

NF-Chpt 6

page 14

IP Addressing

Pattern of IP addresses

Now we have 3 types of IP addresses


we call them Class A, B, C.
Now, the network part is either 8 bits, 16bits, or 24 bits
Each class has a range of values.
Use value in first octet (byte or 8 bits).
Class A 1 to 127
Class B 128 to __191___
Class C __192_ to ____223___

NF-Chpt 6

page 15

IP Addressing

Class A, B, C, D, and E IP
addresses
Classful addressing
Class

Range

Octet 1

Octet 2

Octet 3

Octet 4

0 - 127

Net

Host

Host

Host

128 191

Net

Net

Host

Host

192 223

Net

Net

Net

Host

224 - 239

Multicasts

240 - 255

Research

Each complete 32bit IP address is


broken down into
a network part and
a host part.
A bit sequence
(0,10,110) at
the start of
each address
determines
the class of
the address
NF-Chpt 6

page 16

IP Addressing

Class A Bit Patterns


# Bits

Class A:

network #

24
host #

8 bits- first bit must be 0


Binary
Decimal
00000001
1
00000010
2
..

01111110
126
01111111
127*
127 is used for testing - loopback
NF-Chpt 6

page 17

IP Addressing

IP Address Bit Patterns


# Bits 1

Class B:

6+8

16

network #

host #

Binary

Decimal

10000000
10000001
..
10111110
10111111

# Bits

Class C:

128
129

190
191

5+8+8

network #

8
host #

Exercise: Find the range for the 1st byte in class C.


11000000

NF-Chpt 6

to

110 11111__ __192___to __223___


page 18

IP Addressing

Count the networks and PCs

NF-Chpt 6

page 19

IP Addressing

Network addresses - all 0s

All 0s in all host bit positions = network address.


router looks at the network address to forwards data on
the Internet.
NF-Chpt 6

page 20

IP Addressing

Broadcast IP addresses

An all 1s in all host bit positions = broadcast address.

Data that is sent to the broadcast address will be read by all


hosts on that network
NF-Chpt 6

page 21

IP Addressing
Network addresses (reserved = cannot be used)

Network broadcast (reserved = cannot be used)

Send to all computers/host in 176.10.0.0 network

NF-Chpt 6

page 22

IP Addressing

Subnet Mask
The classes A,B,C have standard subnet masks.
Class A: 255.0.0.0
Class B: 255.255.0.0

11111111

00000000

00000000

00000000

11111111

11111111

00000000

00000000

11111111 11111111

11111111

Class C: 255.255.255.0
00000000

How is the subnet mask used?

NF-Chpt 6

page 23

IP Addressing

Address & subnet mask (A)


ClassNetwork
A
1st byte is network part, 2nd ,3rd , 4th bytes are the host part (host or PC)
For class A network address use 1st byte & set the host part to all ZEROs
Network address = (represent) the whole network

Network | --------Host -------------


11111111 00000000 00000000 00000000
E.g. 00001111. 00000100. 00000100. 00001000
Write down the network ID.
_____15.0.0.0____________
NF-Chpt 6

page 24

IP Addressing

Broadcast Address Class A


Class A broadcast (means sending to ALL hosts on network)
Set the last three bytes to ALL ONEs.

Network | ------------Host --------------


11111111 00000000 00000000 00000000

NF-Chpt 6

E.g. 00001111. 00000100. 00000100. 00001000


Write down the broadcast Address.
____00001111.11111111. 11111111. 11111111__
= _______.________.________.________
page 25

IP Addressing

Exercise
IP address

Class

standard mask

Network
address

Broadcast
address

211.1.1.7

255.255.255.0

211.1.1.0

211.1.1.255

175.4.4.4

255.255.0.0

175.4.0.0

175.4.255.255

66.7.7.8

255.0.0.0

66.0.0.0

66.255.255.255

NF-Chpt 6

page 26

Você também pode gostar