0% found this document useful (0 votes)
35 views39 pages

04 Network Layer Protocolsand IPAddressing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views39 pages

04 Network Layer Protocolsand IPAddressing

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Network Layer Protocols

and IP Addressing
Contents

1 Network Layer Protocols


• Network Layer Protocols

2 Introduction to IPv4 Addresses

3 Subnetting

4 ICMP

5 IPv4 Address Configuration and Basic Application

Page 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Layer Protocols
The network layer is often called the IP layer.

Application Layer

Transport layer
IP addressing and
Network…………………………………………….
layer ICMP IPX
routing
IP
Data link layer

Physical Layer

Equivalent TCP/IP model

Page 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Internet Protocol
IP Internet Protocol
Internet Protocol is the name of a protocol file with small content. It defines and describes the format of
IP packets.
The frequently mentioned IP refers to any content related directly or indirectly to the Internet Protocol,
instead of the Internet Protocol itself.

Function Version

• Provides logical addresses for


devices at the network layer. • IPv4 (IP Version 4)

• Is responsible for addressing and • IPv6 (IP Version 6)


forwarding data packets.

Page 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Data Encapsulation
Application Layer Data PDU

Transport layer Data Segment

Network layer Data Packet

Data link layer Data Frame

Physical Layer Bit

Ethernet IP TCP
User data Ethernet tail
header header header

Page 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IPv4 Packet Format
Ethernet IP TCP
User data Ethernet tail
header header header

Header Type of
Version Total Length
Length Service
Identification Flags Fragment Offset
Fixed size:
20 bytes TTL Protocol Header Checksum

Source IP Address

Destination IP Address
Optional size:
0–40 bytes Options Padding

Page 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Data Packet Fragmentation
Fragmentation The process of dividing a packet into multiple fragments.
The sizes of IP packets forwarded on a network may be different. If the size of an IP packet exceeds the
maximum size supported by a data link, the packet needs to be divided into several smaller fragments
before being transmitted on the link.
Header Type of
Version Total Length
Length Service
Identification Flags Fragment Offset
Host A Host B
TTL Protocol Header Checksum Data
Source IP Address Data fragment
Destination IP Address
Options Padding

Page 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Time to Live
The TTL field specifies the number of routers that a packet can pass through.

Once a packet passes through a router, the TTL is reduced by 1. If the TTL value is reduced to 0, a data
packet is discarded.
TTL=255 TTL=254 TTL=253
Header Type of
Version Total Length
Length Service
Identification Flags Fragment Offset
Host A Host B
TTL Protocol Header Checksum
Source IP Address
Destination IP Address
Options Padding

Page 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Protocol
The Protocol field in the IP packet header identifies a protocol that will continue to process the packet.

This field identifies the protocol used by the data carried in the data packet so that the IP layer of the
destination host sends the data to the process mapped to the Protocol field.

Header Type of IP header User data


Version Total Length
Length Service
Identification Flags Fragment Offset
Protocol
TTL Protocol Header Checksum
Source IP Address
6/17 TCP/UDP
Destination IP Address
Options Padding 1 ICMP

Page 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1 Network Layer Protocols

2 Introduction to IPv4 Addresses


• Concepts

• Address Classification

3 Subnetting

4 ICMP

5 IPv4 Address Configuration and Basic Application

Page 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
What Is an IP Address?
An IP address identifies a node (or an interface on a network device) on a network.

IP addresses are used to forward IP packets on the network.

IP Address
IP 1 IP 5 An IP address identifies a
node on a network and is
IP 2 IP 4
used to find the destination
IP 3 for data.
DATA

Page 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP address Notation
An IPv4 address is 32 bits long.

It is in dotted decimal notation.

Dotted decimal Decimal 192. 168. 10. 1 4 byte


notation Binary 11000000 10101000 00001010 00000001 32 bits

Power
27 26 25 24 23 22 21 20
Conversion between 128 64 32 16 8 4 2 1
decimal and binary
systems Bit 1 1 0 0 0 0 0 0

= 128 + 64 = 192

IPv4 address range is 0.0.0.0–255.255.255.255.

Page 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP Address Structure
Network part Identifies a network.
Host part Identifies a host and is used to differentiate hosts on a network.
Network part Host part

Network mask Is used to distinguish the network part from the host part in an IP address.
192. 168. 10. 1

192.168.10.1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 IP address

255.255.255.0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 Network mask

Written as Network Host part


part
192.168.10.1 255.255.255.0 = 192.168.10.1/24

Page 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP Addressing
Network part (network ID) Identifies a network.
Host part Identifies a host and is used to differentiate hosts on a network.
Network
part

No. X, Street Y,
Community A
John

Layer 2 network addressing Layer 3 network addressing


Community A (network bits)
Layer 2 network Gateway Layer 2 network

10.0.1.0/24 10.0.2.0/24

10.0.1.1/24 10.0.2.1/24

No. X, Street Y, John


(host bits) Layer 3
network
Page 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1 Network Layer Protocols

2 Introduction to IPv4 Addresses


• Concepts

• Address Classification

3 Subnetting

4 ICMP

5 IPv4 Address Configuration and Basic Application

Page 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP Address Classification (Classful Addressing)
To facilitate IP address management and networking, IP addresses are classified into the following classes:
Class A 0NNNNNNN NNNNNNNN NNNNNNNN NNNNNNNN 0.0.0.0~127.255.255.255
Assigned to
Class B 10NNNNNN NNNNNNNN NNNNNNNN NNNNNNNN 128.0.0.0~191.255.255.255
hosts

Class C 110NNNNN NNNNNNNN NNNNNNNN NNNNNNNN 192.0.0.0~223.255.255.255

Class D 1110NNNN NNNNNNNN NNNNNNNN NNNNNNNN 224.0.0.0~239.255.255.255 Used for multicast

Class E 1111NNNN NNNNNNNN NNNNNNNN NNNNNNNN 240.0.0.0~255.255.255.255 Used for research

• Default subnet masks of classes A, B, and C


▫ Class A :8 bit, 0.0.0.0~127.255.255.255/8
Network part
▫ Class B :16 bit,128.0.0.0~191.255.255.255/16
Host part
▫ Class C :24 bit,192.0.0.0~223.255.255.255/24

Page 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP Address Types
A network range defined by a network ID is called a network segment.
Network address: Identifies a network.
Example: 192.168.10.0/24
192. 168. 10. 00000000
Note
Broadcast address:a special address used to send data to • Network and broadcast
all hosts on a network. addresses cannot be directly
Example: 192.168.10.255/24 used by devices or their
interfaces.
192. 168. 10. 11111111
• Number of available addresses
on a network segment is 2n – 2
Available addresses:IP addresses that can be allocated to (n is the number of bits in the
host part).
device interfaces on a network
Example: 192.168.10.1/24
192. 168. 10. 00000001

Page 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IP Address Calculation
Example: What are the network address, broadcast address, and number of available addresses of class B address
172.16.10.1/16?
172. 16. 00001010. 00000001

IP address
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1
Network mask
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
The network address is
obtained, with all host bits set
Network
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 to 0s.
0 0 0 0 0 0 0 0 172.16.0.0/16
address
The broadcast address is
obtained, with all host bits set to
Broadcast address 1s.
1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 172.16.255.255/16

Number of IP
216=65536 Quiz
addresses
Example: What are the network
Number of available
addresses
216-2=65534 address, broadcast address, and
Range of available number of available addresses of
172.16.0.1/16~172.16.255.254/16
addresses class A address 10.128.20.10/8?

Page 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Private IP Addresses
Public IP address An IP address is assigned by the Internet Assigned Numbers Authority (IANA), and this
address allocation mode ensures that each IP address is unique on the Internet.
Private IP address In practice, some networks do not need to connect to the Internet. For example, on a network of
a lab in a college, IP addresses of devices need to avoid conflicting with each other only within the same network. In
the IP address space, some IP addresses of class A, B, and C addresses are reserved for the preceding situations.
These IP addresses are called private IP addresses.

192.168.1.0/24
▫ Class A: 10.0.0.0–10.255.255.255
10.0.0.0/8
▫ Class B: 172.16.0.0–172.31.255.255 Implemented using
Internet network address
▫ Class C: 192.168.0.0–192.168.255.255 translation (NAT)

10.0.0.0/8 192.168.1.0/24

Connecting a private network to the Internet

Page 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Special IP Addresses
Some IP addresses in the IP address space are of special meanings and functions.

For example:

Special IP Address Address Scope Function


It can be used as a destination address and traffic destined
Limited broadcast
255.255.255.255 for it is sent to all hosts on the network segment to which
address
the address belongs. (Its usage is restricted by a gateway).
It is an address of any network.
Any IP address 0.0.0.0 Addresses in this block refer to source hosts on "this"
network.
Loopback address 127.0.0.0/8 It is used to test the software system of a test device.
If a host fails to automatically obtain an IP address, the
Link-local address 169.254.0.0/24 host can use an IP address in this address block for
temporary communication.

Page 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
IPv4 vs IPv6
IPv4 addresses managed by the IANA were exhausted in 2011. As the last public IPv4 address was
allocated and more and more users and devices access the public network, IPv4 addresses were
exhausted. This is the biggest driving force for IPv6 to replace IPv4.

IPv4 IPv6
• Address length: 32 bits • Address length: 128 bits
• Address types: unicast address, broadcast • Address types: unicast address, multicast
address, and multicast address address, and anycast address
• Characteristics: • Characteristics:
▫ IPv4 address depletion ▫ Unlimited number of addresses
▫ Inappropriate packet header design ▫ Simplified packet header
▫ ARP dependency-induced flooding ▫ Automatic IPv6 address allocation
▫ ... ▫ ...

Page 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1 Network Layer Protocols

2 Introduction to IPv4 Addresses

3 Subnetting

• Subnetting

4 ICMP

5 IPv4 Address Configuration and Basic Application

Page 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Why Subnetting?
172.16.1.0
172.16.4.0

172.16.3.0
172.16.0.1 172.16.0.2 172.16.0.253 172.16.0.254

……

172.16.0.0

172.16.2.0
216 = 65536 IP addresses A network number is divided into multiple subnets, and
each subnet is allocated to a separate broadcast domain.
A class B address is used for a broadcast domain,
wasting addresses.
In this way, the broadcast domain is smaller, and the
The broadcast domain is too large. Once broadcast network planning is more reasonable.
occurs, an internal network is overloaded.
IP addresses are properly used.

Page 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Subnetting - Analyzing the Original Network
Segment
Example: 192.168.10.0/24

192.168.10.1
IP address 192. 168. 10. 0 0 0 0 0 0 0 1
Default 255. 255. 255. 0 0 0 0 0 0 0 0 One class C network:
subnet mask
192.168.10.0/24
……
192.168.10.255 Default subnet mask:
IP address 192. 168. 10. 1 1 1 1 1 1 1 1 255.255.255.0
Default 255. 255. 255. 0 0 0 0 0 0 0 0
subnet mask

Network part Host part


Network address: 192.168.10.0/24
Broadcast address: 192.168.10.255
Total IP addresses: 28 = 256
Available IP addresses: 28 – 2 = 254

Page 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Subnetting - Taking Bits from the Host Part
Bits can be taken from the host part to create subnets.
Take 1 bit from the host part.

IP address 192. 168. 10. 0 0 0 0 0 0 0 0


New mask 255. 255. 255. 1 0 0 0 0 0 0 0
Two subnets:
……
Subnet 1: 192.168.10.0/25
IP address 192. 168. 10. 1 1 1 1 1 1 1 1 Subnet 2: 192.168.10.128/25
New mask 255. 255. 255. 1 0 0 0 0 0 0 0 New mask: 255.255.255.128

Network part Host part

Subnet bits
Total IP addresses: 27 = 128
Variable length subnet mask (VLSM)
Available IP addresses: 27 – 2 = 126

Page 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Subnetting - Calculating the Subnet Network
Address
The network address is obtained, with all host bits set to 0s.

192.168.10.0 192. 168. 10. 0 0 0 0 0 0 0 0


New mask /25 255. 255. 255. 1 0 0 0 0 0 0 0

Network part Host part

Subnet 1's 192.168.10.0/25


192. 168. 10. 0 0 0 0 0 0 0 0
network address

Subnet 2's 192.168.10.128/25


192. 168. 10. 1 0 0 0 0 0 0 0
network address

Page 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Subnetting - Calculating the Subnet Broadcast
Address
The broadcast address is obtained, with all host bits set to 1s.

192.168.10.0 192. 168. 10. 0 0 0 0 0 0 0 0


New mask /25 255. 255. 255. 1 0 0 0 0 0 0 0

Network part Host part

Subnet 1's 192.168.10.0/25


192. 168. 10. 0 0 0 0 0 0 0 0
network address
Subnet 1's
broadcast address 192. 168. 10. 0 1 1 1 1 1 1 1 192.168.10.127/25

Subnet 2's network


address 192. 168. 10. 1 0 0 0 0 0 0 0 192.168.10.128/25

Subnet 2's
broadcast address 192. 168. 10. 1 1 1 1 1 1 1 1 192.168.10.255/25

Page 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Practice: Computing Subnets (1)
Question: An existing class C network segment is
192.168.1.0/24. Use the VLSM to allocate IP
10 hosts addresses to three subnets.
…… 30 hosts
Answer: (Use a network with 10 hosts as an example.)
Step 1: Calculate the number of host bits to be taken.
2n – 2 ≥ 10
n ≥ 4, host bits
Step 2: Take bits from the host part.

……
Take 4 bits from the host part.
……
IP address 192. 168. 1. 0 0 0 0 0 0 0 0
10 hosts
Subnet mask 255. 255. 255. 1 1 1 1 0 0 0 0

Number of subnets:
Subnet bits 24 = 16 subnets

Page 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Practice: Computing Subnets (2)
Question: An existing class C network
192.168.1.0/28
segment is 192.168.1.0/24. Use the VLSM to
10 hosts
allocate IP addresses to three subnets.
…… 30 hosts
Answer: (Use a network with 10 hosts as an example.)
Step 3: Calculate subnet network addresses.

IP address 192. 168. 1. 0 0 0 0 0 0 0 0


New mask 255. 255. 255. 1 1 1 1 0 0 0 0
Network address

……
…… Subnet 1 192. 168. 1. 0 0 0 0 0 0 0 0 192.168.1.0/28

10 hosts Subnet 2 192. 168. 1. 0 0 0 1 0 0 0 0 192.168.1.16/28


192.168.1.16/28
Subnet 3 192. 168. 1. 0 0 1 0 0 0 0 0 192.168.1.32/28


Subnet 16 192. 168. 1. 1 1 1 1 0 0 0 0 192.168.1.240/28

Page 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1 Network Layer Protocols

2 Introduction to IPv4 Addresses

3 Subnetting

4 ICMP

• ICMP协议定义及功能

5 IPv4 Address Configuration and Basic Application

Page 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
ICMP
I C M P Internet Control Message Protocol
ICMP is an auxiliary protocol of the IP protocol. ICMP is used to transmit error and control information between
network devices.
Ethernet header IP header ICMP message Ethernet tail

Type Code Checksum

ICMP message content

Type Code Description


Message
0 0 Echo Reply
3 0 Network Unreachable
Message
3 1 Host Unreachable
Host A
3 2 Protocol Unreachable

3 3 Port Unreachable

5 0 Redirect

8 0 Echo Request

Page 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
ICMP Redirection
ICMP Redirect messages are a type of ICMP control message.

Server A Internet
20.0.0.1/24

20.0.0.2/24

RTA RTB
10.0.0.200/24 10.0.0.100/24
3 1

2 ICMP Redirect message

IP address: 10.0.0.1/24
Host A Default gateway: 10.0.0.100

Page 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
ICMP Error Detection
ICMP Echo messages are used to check network connectivity between the source and destination and
provide other information, such as the round-trip time.

Echo Request [RTA]ping 20.0.0.2


PING 20.0.0.2: 56 data bytes, press CTRL_C to break
10.0.0.0/24 20.0.0.0/24 Reply from 20.0.0.2: bytes=56 Sequence=1 ttl=254 time=70 ms
.1 .2 .1 .2 Reply from 20.0.0.2: bytes=56 Sequence=2 ttl=254 time=30 ms
RTA RTB Server A Reply from 20.0.0.2: bytes=56 Sequence=3 ttl=254 time=30 ms
Echo Reply Reply from 20.0.0.2: bytes=56 Sequence=4 ttl=254 time=40 ms
Reply from 20.0.0.2: bytes=56 Sequence=5 ttl=254 time=30 ms

Function:Ping --- 20.0.0.2 ping statistics ---


Ping is a command used on network devices, Windows 5 packet(s) transmitted
OS, Unix OS, and Linux OS. Ping is a small and useful 5 packet(s) received
application based on the ICMP protocol. 0.00% packet loss
round-trip min/avg/max = 30/40/70 ms
A ping tests the reachability of a destination node.

Page 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
ICMP Error Report
ICMP defines various error messages for diagnosing network connectivity problems. The source can
determine the cause for a data transmission failure based on the received error messages.

Data packet [RTA]tracert 20.0.0.2

10.0.0.0/24 20.0.0.0/24 traceroute to 20.0.0.2(20.0.0.2), max hops: 30 ,packet length:


.1 .2 .1 .2 40,press CTRL_C
RTA RTB Server A to break

Destination Unreachable message 1 10.0.0.2 80 ms 10 ms 10 ms

Function:Tracert 2 20.0.0.2 30 ms 30 ms 20 ms
Tracert checks the reachability of each hop on a
forwarding path based on the TTL value carried in the
packet header.

Page 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents

1 Network Layer Protocols

2 Introduction to IPv4 Addresses

3 Subnetting

4 ICMP

5 IPv4 Address Configuration and Basic Application

• Basic IP Address Conf iguration Commands

Page 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic IP Address Configuration Commands
1. Enter the interface view.

[Huawei] interface interface-type interface-number


You can run this command to enter the view of a specified interface and configure attributes for the interface.
• interface-type interface-number: specifies the type and number of an interface. The interface type and
number can be closely next to each other or separated by a space character.

2. Configure an IP address for the interface.

[Huawei-GigabitEthernet0/0/1] ip address ip-address { mask | mask-length }


You can run this command in the interface view to assign an IP address to the interface on the network devices
to implement network interconnection.
• ip-address: specifies the IP address of an interface. The value is in dotted decimal notation.
• mask: specifies a subnet mask. The value is in dotted decimal notation.
• mask-length: specifies a mask length. The value is an integer ranging from 0 to 32.

Page 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Case:
Configuring an IP address for an Interface
Configure an IP address for a physical
192.168.1.1/24 192.168.1.2/24 interface.
GE0/0/1 GE0/0/1 [RTA] interface gigabitethernet 0/0/1
[RTA-GigabitEthernet0/0/1] ip address 192.168.1.1 255.255.255.0
RTA RTB Or
Loopback 0 Loopback 0
1.1.1.1/32 2.2.2.2/32 [RTA-GigabitEthernet0/0/1] ip address 192.168.1.1 24

Configure an IP address for a logical


interface.
On the preceding network where the two [RTA] interface LoopBack 0
routers are interconnected, configure IP [RTA-LoopBack0] ip address 1.1.1.1 255.255.255.255
addresses for the interconnected physical Or
interfaces and logical IP addresses. [RTA-LoopBack0] ip address 1.1.1.1 32

Page 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network IP Address Planning
IP address planning must be considered together with the network structure, routing protocols, traffic planning, and
service rules. In addition, IP address planning should be corresponding to the network hierarchy and performed in a
top-bottom way.
Reference Planning Rules
In conclusion, IP address planning objectives are to achieve easy management,
easy scalability, and high utilization. Uniqueness, continuity, and
scalability
Structured and service-related
IP Address Planning Example
Background Address Type Address Scope
Network segment of
192.168.1.0/24 Core node
the R&D department

Example: Network segment of


A company is the marketing 192.168.2.0/24 Aggregation
department
assigned node
192.168.0.0/16 Network segment of
as a network the administrative 192.168.3.0/24
department Access
segment
address. Network segment of node
the guest center
192.168.4.0/24
R&D Dept. Marketing Administrati Guest center
Others …… Dept. on Dept.

Page 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summary
▫ To connect a PC to the Internet, apply an IP address from the Internet Service

Provider (ISP).

▫ This presentation provides an overview of the IP protocol and describes concepts

related to IPv4 addresses and subnetting.

▫ This presentation also describes the planning and basic configuration of IP

addresses.

Page 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

You might also like