You are on page 1of 37

IP Addressing and

Routing

www.huawei.com

HUAWEI TECHNOLOGIES CO., LTD. All rights reserved


Network layer locates the third layer of
TCP/IP protocol stack, between the
data link layer and transport layer.
Network layer defines some protocols to
ensure the right forwarding of data
packet.

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 2


Upon completion of this course, you will be
able to :

Master the classes of IP address


Subnet address planning in reason
Understand ARP/RARP protocol
principle

Know the working principle of router

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 3


Chapter 1 IP Address

Chapter 2 Protocols of Network Layer

Chapter 3 Working Principle of Router

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 4


Data Encapsulation and De-encapsulation

upper layer Application Application


data layer layer upper layer data
Transport Transport
segment
TCP header upper layer layer layer upper layer data
data

upper layer Network Network


IP header packet
data layer layer TCP+ upper layer data

LLC header upper layer FCS IP+TCP+ upper layer data


data Data link Data link
frame
layer layer
MAC header upper layer FCS LLC header +IP+TCP+ upper layer data
data
Physical Physical
bit
0101110101001000010 layer layer 0101110101001000010

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 5


Data Encapsulation on Network Layer

TCP Header Upper layer


data Transport layer

IP Header Upper layer


Network layer
data

IP Header source destination data


address address

171.17.1.1 IP address

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 6


IP Address

IP address identifies a network device uniquely, it is made up


of 32 binary digit.
IP address is shown as dotted decimal format.
IP address is divided into two parts:
Network address portion
Host address portion

IP address Network address Host address

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 7


Classification of IP Address

Class A 1.0.0.0~126.255.255.255
0 Network(7bit) Host(24bit)

Class B 128.0.0.0~191.255.255.255
1 0 Network(14bit) Host(16bit)

Class C 192.0.0.0~223.255.255.255
1 1 0 Network(21bit) Host(8bit)

Class D 224.0.0.0~239.255.255.255
1 1 1 0 Multicast address

Class E 240.0.0.0~255.255.255.255
1 1 1 1 0 reserve

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 8


Special IP Address

Network part Host part Address type Usage


Network Representing a network
Any all 0
Address Segment

Broadcast All the nodes of a Specially


Any all 1
Address designated network segment
Loopback
127 Any Loop test
Address

As the designate default routes


all 0 All Networks
in Huawei Quidway router

Broadcast All nodes of


all 1
Address Local network segment

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 9


Private IP Address

Private IP address

10.0.0.0~10.255.255.255

172.16.0.0~172.31.255.255

192.168.0.0~192.168.255.255

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 10


Subnet Mask Introduction

Distinguish between network part and host part by subnet mask


The subnet mask format is same as the IP address format
All of the network part and subnet part of subnet mask are 1, and all of
the host part are 0

For example Class Bs subnet


mask is 255.255.0.0

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 11


Network Address and Subnet Mask

IP Address 192.168.1 100

Subnet Mask 255.255.255 0

Network Address: 192.168.1 0

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 12


System Conversion

8bit

Binary system 1 1 1 1 1 1 1 1
27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

Decimal Summation is 255

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 13


Example of System Conversion

Example :

1 1 1 0 1 0 0 1

1*128 1*64 1*32 0*16 1*8 0*4 0*2 1*1

128 + 64 + 32 + 0 + 8 + 0 + 0 + 1

233

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 14


System Conversion of IP Address

IP address192.168.1.11(decimal)

byte8bits byte8bits byte8bits byte8bits

2726252423222120 2726252423222120 2726252423222120 2726252423222120

11000000 10101000 00000001 00001011

192 168 1 11

binary digit11000000.10101000.00000001.00001011

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 15


Addressing without Subnet

Addressing without Subnet means using nature mask, no subdivision of

network segment. Class B segment 172.16.0.0 with mask 255.255.0.0

172.16.30.1/16 172.16.28.1/16

Et her net

172.16.30.10/16

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 16


Addressing with Subnets

Class B segment 172.16.0.0


172.16.4.1/24

Ethernet

Ethernet
172.16.8.1/24

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 17


Subnet Mask Representation

192 . 168 . 1 . 7
IP Address
11000000 10101000 00000001 00000111

255 . 255 . 255 . 240


Subnet mask
11111111 11111111 11111111 11110000

Bits of subnet mask 8 + 8 + 8+ 4 = 28

Subnet mask representation 192 . 168 . 1 . 7 / 28

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 18


Calculation of Network address

IP Address is: 192.168.1.7/28

IP Address 192 . 168 . 1 . 7


11000000 10101000 00000001 00000111

255 . 255 . 255 . 240


Subnet Mask
11111111 11111111 11111111 11110000

Network Address
11000000 10101000 00000001 00000000
(Binary)

Network Address 192.168.1.0/28

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 19


Calculation of Host Number

Subnet Mask

Network Portion Host Portion


1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 00 0 0 0 0 0 00

N bit

Host Number 2n
Valid Host Number : 2n - 2

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 20


Example of Host Number Calculation

IP Address192.168.1.100/28
/28=255.255.255.240

The binary representation of subnet mask:

11111111111111111111111111110000

4bits
28bits
Host portion
network portion
The total number of host: 24

The valid number of host: 24 -2

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 21


Example of Subnet Address Planning

examplea company gets class C address 201.222.5.0. if it needs


20 subnet and 5 host in each subnet. How to plan the IP address?

Subnet address Usable host address

201.222.5.8/29 201.222.5.9~201.222.5.14

201.222.5.16/29 201.222.5.17~201.222.5.22

201.222.5.232/29 201.222.5.233~201.222.5.238

201.222.5.240/29 201.222.5.241~201.222.5.246

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 22


Example of Planning Class B

Subnet address 172.16.2.0

Host address 172.16.2.1172.16.2.254

Broadcast address 172.16.2.255

IP host address 172.16.2.120

Subnet mask 255.255.255.0

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 23


Example of Planning Class C

Subnet address 192.168.5.120

Host address 192.168.5.121-192.168.5.126

Broadcast address 192.168.5.127

IP host address 192.168.5.121

Subnet mask 255.255.255.248

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 24


Classless Inter-Domain Routing (VLSM)

192.168.1.32/27

192.168.1.160/30

192.168.1.64/27
announce
ISP 192.168.1.0 192.168.1.164/30

192.168.1.96/27

192.168.1.168/30

192.168.1.128/27

192.168.1.172/30

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 25


Classless Inter-Domain Routing (CIDR)

CIDR reduces scale of routing table and enhances network


extensibility.

198.168.1.0

Announce route 198.168.2.0


Internet 198.168.0.0/16

ISP

198.168.3.0

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 26


Chapter 1 IP Address

Chapter 2 Protocols of Network Layer

Chapter 3 Working Principle of Router

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 27


ARP
ARP--Address Resolution Protocol

MAC address of 10.0.0.2
: 00-E0-FD-00-00-12
HostA HostB
IP:10.0.0.1/24 ARP Reply IP:10.0.0.2/24
MAC:00-E0-FD-00-00-11 MAC:00-E0-FD-00-00-12


Need MAC ARP Request?
address of broadcast
10.0.0.2?
unicast

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 28


Proxy ARP

If ARP request is sent


from one host in the
Network A
network to another host
ARP Reply
in another network, thus
the router which Network B
connects this two
network can reply this
request, this procedure
is called Proxy ARP. ARP Request

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 29


Gratuitous ARP

Create error
information MAC address of 10.0.0.1
: 00-E0-FD-00-00-12
HostA
HostB
ARP Reply
IP:10.0.0.1/24 IP:10.0.0.1/24
MAC:00-E0-FD-00-00-11 MAC:00-E0-FD-00-00-12


need MAC ARP Request?
address of broadcast
10.0.0.1
unicast

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 30


RARP
RARP--Reverse Address Resolution Protocol

Your IP
address is
10.0.0.1
Diskless RARP Reply RARP Server
workstation

Whats my IP
address?
RARP Request?

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 31


Chapter 1 IP Address

Chapter 2 Protocols of Network Layer

Chapter 3 Working Principle of Router

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 32


The Function of Router

Router runs in the layer 3the core function is interconnection of

the networks

Group data forwarding

Route : establish, refresh, lookup routing table

Rate adapt between the subnetwork

Network isolationto prevent network stormappoint


accessing rule (firewall)

Interconnection of the heterogeneous networks

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 33


The Working Process of Router

Router Router

Network layer Routing protocol Network layer


conversion

Data link layer Data link layer

Physical layer Protocol Physical layer


De-encapsulation encapsulation

LAN1 LAN2
WAN
sending receiving
transmission

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 34


Routing Table
Router keeps a routing table at any time, sending and forwarding of all
messages

Router maintain a routing table all the time, all the message are sent
from corresponding interface via lookup routing table.

Routing table can be static configuration, it also can be generated by

dynamic routing protocols.

Routing table includes the following contents:

Destination address

Network mask

Outgoing interface

Next hop

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 35


Summary

The classification of IP address.


The function of ARP/RARP
protocol.

The work principle of router.

HUAWEI TECHNOLOGIES CO., LTD.. All rights reserved Page 36


Thank You
www.huawei.com
T

You might also like