Lecture-1-IP V.4 Add..

doctorheavenlyNetworking and Communications

Oct 24, 2013 (4 years and 2 months ago)

93 views

Edited by Aj.Preecha Pangsuban@YRU

Lecture 1


IP V.4 Addressing



IP Address Format



IP Address Class



IP Subnet Addressing



Special Addresses

Edited by Aj.Preecha Pangsuban@YRU

2

IP Addressing


Each host on a TCP/IP network is assigned a unique
32
-
bit logical address that is divided into two main
parts :


The network number


The host number



The network number identifies a network and must be
assigned by the
Internet Network Information Center
(InterNIC)

if the network is to be part of the Internet.

Edited by Aj.Preecha Pangsuban@YRU

3

IP Addressing


An Internet service provider (ISP)

can
obtain blocks of network addressed from
the InterNIC and can itself assign address
space as necessary.


The host number identifies a host on a
network and is assigned by the local
network administrators.


Edited by Aj.Preecha Pangsuban@YRU

4

IP Address Format


The 32
-
bit IP address is grouped 8 bits at a
time, separated by dots and represented in
decimal format (known as dotted decimal
notation).




Edited by Aj.Preecha Pangsuban@YRU

5

Network ID

Host ID

32 bits

8 bits

8 bits

8 bits

8 bits

172

16

122

204

Dotted

Decimal

notation

An IP Address Consists of 32 Bits, Grouped into 4 Octets

IP Address Format

Edited by Aj.Preecha Pangsuban@YRU

6

IP Address Class


IP addressing supports
five

different address classed:
A, B, C, D and E
.


Only classes A, B and C are available for commercial
use. The left
-
most ( high
-
order ) bits indicate the
network class.




Edited by Aj.Preecha Pangsuban@YRU

7

IP

Address

Class


A



B



C




D



E





Format



N.H.H.H



N.N.H.H



N.N.N.H




-



-




Purpose


Few large

Organizations


Medium
-

size

Organizations


Relatively

Small

Organizations


Multicast

Groups (RFC

1112)


Experimental


High



Order

Bit (s)


0



1,0



1,1,0





1,1,1,0



1,1,1,1



Address


Range


1.0.0.0 to

126.0.0.0


128.1.0.0 to

191.254.0.0


192.0.1.0 to

223.255.254.0


224.0.0.0 to

239.255.255.255



240.0.0 to

254.255.255.255

Number of

Bits Network/

Host


7/24



14/16



21/8




Not for

commercial

use


-




Max. Hosts



16,777,214

(2
24
-
2)


65,534

(2
16
-
2)



254

(2
8
-
2)




-



-



IP Address Class

Edited by Aj.Preecha Pangsuban@YRU

8

Host

Host

Host

Network

0

64

32

16

8

4

2

1

Network

1

0

Network

Host

Host

Network

1

0

Network

Network

Host

1

24

16

14

21

8

Class A

Class B

Class C

Bits

A Range of Possible Values Exists for the First Octet of Each Address Class

IP Address Class

7

Edited by Aj.Preecha Pangsuban@YRU

9



Edited by Aj.Preecha Pangsuban@YRU

10

IP Address Class


The class of address can be determined easily
by examining the first octet of the address and
mapping that value to a class range in the
following table.




Edited by Aj.Preecha Pangsuban@YRU

11

Address

class

First octet

In decimal

High


order

bits

Class A


Class B


Class C


Class D


Class E

1


126


128


191


192


223


224


239


240
-

254

0


10


110


1110


1111

A Range of Possible Values Exists for the First Octet

of Each Address Class

IP Address Class

Edited by Aj.Preecha Pangsuban@YRU

12

IP Subnet Addressing


IP networks can be divided into smaller called

subnetworks

or
subnets



Subnetting provides the network administrator
with several benefits, including extra
flexibility, more efficient use of network
addressed, and the capability to contain
broadcast traffic (a broadcast will not cross a
router).








Edited by Aj.Preecha Pangsuban@YRU

13

broadcast traffic


Broadcast traffic
is traffic that is simultaneously
addressed to all computers connected to the
network


Ss opposed to unicast or multicast traffic



For example in the network 192.168.0.0/24

(
192.168.0
.
xxx with subnet mask 255.255.255.0
)
the broadcast address is 192.168.0.255


In MAC addressing
(
layer 2 on the OSI model
)
, the
broadcast address is the MAC address
FF
:
FF
:
FF
:
FF
:
FF
:
FF


Edited by Aj.Preecha Pangsuban@YRU

14

Example : YRU Network

Edited by Aj.Preecha Pangsuban@YRU

15

YRU Subnetwork

Concept

Edited by Aj.Preecha Pangsuban@YRU

16

IP Subnet Mask


A subnet address is created by borrowing bits from
the host field and designing them as the Subnet field.


The number of borrowed bits varies and is specified
by the subnet mask.


Subnet masks use the same format and representation
technique as IP addresses. The subnet mask,
however, has binary 0s in all bits specifying the Host
field.



Edited by Aj.Preecha Pangsuban@YRU

17

1

2

IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

18

IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

19

IP Subnet Mask

3

Edited by Aj.Preecha Pangsuban@YRU

20

IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

21

1

0

Host

Host

1

0

Subnet

Host

Bits Are Borrowed from the Host Address Field to Create

the Subnet Address Field

Class B Address : after subneting

Class B Address : before subneting

IP Subnet Mask

Example subnet mask for Class B address

Edited by Aj.Preecha Pangsuban@YRU

22

Network

Network

Subnet

Host

Example subnet mask for Class B address

Binary

representation

11111111

11111111

11111111

00000000

Dotted decimal

representation

255

255

255

0

A Sample Subnet Mask Consists of All Binary 1s and 0s

IP Subnet Mask

Subnet Mask bits should come from the high
-
order (left
-
most)
bits of the host field. Default of Class B and C subnet mask
types follow.

Edited by Aj.Preecha Pangsuban@YRU

23

128

64

32

16

8

4

2

1

1

0

0

0

0

0

0

0

1

1

0

0

0

0

0

0

1

1

1

0

0

0

0

0

1

1

1

1

0

0

0

0

1

1

1

1

1

0

0

0

1

1

1

1

1

1

0

0

1

1

1

1

1

1

1

0

1

1

1

1

1

1

1

1

=

=

=

=

=

=

=

=

128

192

224

240

248

252

254

255

Subnet Mask Bits Come From the High
-
Order Bits of the Host Field

IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

24

IP Subnet Mask

Number of Bits


2

3

4

5

6

7

8

9

10

11

12

13

14


Subnet Mask


255.255.192.0

255.255.224.0

255.255.240.0

255.255.248.0

255.255.252.0

255.255.254.0

255.255.255.0

255.255.255.128

255.255.255.192

255.255.255.224

255.255.255.240

255.255.255.248

255.255.255.252


Number of Subnets


4

8

16

32

64

128

256

512

1024

2048

4096

8192

16,384


Number of Hosts


16,382

8190

4094

2046

1022

510

254

126

62

30

14

6

2


Class B Subnetting Reference Chart


Edited by Aj.Preecha Pangsuban@YRU

25


The default subnet mask for a Class B address that
has no
subnetting

is 255.255.0.0, while the subnet
mask for Class B address 158.108.0.0 that specifies 8
bits of
subnetting

is 255.255.255.0.


The reason for this is that 8 bits of
subnetting
, or
2
8


(1 for the network address and 1 for the broadcast
address) =
256
subnets possible, with 2
8
-
2 = 254
hosts per subnet
.




IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

26

NO

Subnet address

First Address

Last Address

0

158.108.0.0

158.108.0.1

158.108.0.254

1

158.108.1.0

158.108.1.1

158.108.1.254

2

158.108.2.0

158.108.2.1

158.108.2.254

3

158.108.3.0

158.108.3.1

158.108.3.254

:

:

:

:

:

:

:

:

252

158.108.252.0

158.108.252.1

158.108.252.254

253

158.108.253.0

158.108.253.1

158.108.253.254

254

158.108.254.0

158.108.254.1

158.108.254.254

255

158.108.255.0

158.108.255.1

158.108.255.254

IP Subnet Mask

Class B address 158.108.0.0 Subnetting Reference Chart


Edited by Aj.Preecha Pangsuban@YRU

27

Class C Subnetting Reference Chart

Number of Bits


2

3

4

5

6



Subnet Mask


255.255.255.192

255.255.255.224

255.255.255.240

255.255.255.248

255.255.255.252



Number of Subnets



4


8


16


32


64

Number of Hosts



62


30


14


6


2

IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

28

Subnet bit

Prefix

Subnet

Host/Subnet

Subnetmask

0

/24

0

254

255.255.255.0

1

/25


2 126 255.255.255.128

2

/26

4

62

255.255.255.192

3

/27

8

30

255.255.255.224

4

/28

16

14

255.255.255.240

5

/29

32

6

255.255.255.248

6

/30

64

2

255.255.255.252

7

/31

Not allowed

IP Subnet Mask

Class C Subnetting Reference Chart

Edited by Aj.Preecha Pangsuban@YRU

29


The subnet mask for a Class C address 192.168.2.0
that specifies 5 bits of
subnetting

is 255.255.255.248
With 5 bits available for
subnetting
, 2
5
-
2 =
32
subnets
possible, with 2
3
-
2 = 6 hosts per subnet.




IP Subnet Mask

Edited by Aj.Preecha Pangsuban@YRU

30

How Subnet Masks Are Used to Determine the
Network Number


The router performs a set process to determine the
network (or, more specially, the subnetwork) address.


First, the router extracts the IP destination address
from the incoming packet and retrieves the internal
subnet mask. It then performs a logical AND
operation to obtain the network number.

Edited by Aj.Preecha Pangsuban@YRU

31

How Subnet Masks Are Used to Determine the
Network Number


This causes the host portion of the IP destination
address to be removed, while the destination network
number remains.


The router then looks up the destination network
number and matches it with an outgoing interface.


It forwards the frame to the destination IP address.
Specifics regarding the logical AND operation are
discussed in the following section.

Edited by Aj.Preecha Pangsuban@YRU

32

Logical AND Operation

Input

1

1

0

0




Input

1

0

1

0




Output

1

0

0

0


Input

Output

Edited by Aj.Preecha Pangsuban@YRU

33

00000001


11111111

00000010


00000000

00000001

00000000

Destination IP

address

Subnet Mask

171.16.1.2

255.255.255.0

Network

Subnet

Subnet

Applying a Logical AND to the Destination IP Address



the Subnet Mask Produces the Subnetwork Number

Logical AND Operation

Subnetwork Number


171.16.1.0

Edited by Aj.Preecha Pangsuban@YRU

34

Edited by Aj.Preecha Pangsuban@YRU

35

Example of Network addresses

Edited by Aj.Preecha Pangsuban@YRU

36

Example of direct broadcast address

Edited by Aj.Preecha Pangsuban@YRU

37

Example of limited broadcast address

Edited by Aj.Preecha Pangsuban@YRU

38

This

host on
This

address

Edited by Aj.Preecha Pangsuban@YRU

39

Example of specific host on
this

network

Edited by Aj.Preecha Pangsuban@YRU

40

Example of loopback address

Edited by Aj.Preecha Pangsuban@YRU

41

Edited by Aj.Preecha Pangsuban@YRU

42