Network layer protocol and IP addressing

Network layer protocol and IP addressing

network layer protocol

The network layer is often referred to as the IP layer.

IP protocol

The IP protocol (Internet Protocol) itself is the name of a protocol file, which mainly defines and explains the format of IP packets. IP, which is often mentioned, generally does not specifically refer to the Internet Protocol, the protocol file itself, but generally refers to any content directly or indirectly related to the IP protocol.
Role:
• Provide logical addresses for devices at the network layer
• Responsible for addressing and forwarding
versions
of data packets • IPv4 (IP Version 4)
• IPv6 (IP Version 6)

data encapsulation

insert image description here

packet fragmentation

Fragmentation:

The process of dividing a message into multiple fragments.
The lengths of IP packets forwarded in the network can be different, but if the packet length exceeds the maximum length supported by the data link, the packet needs to be divided into several smaller fragments before being transmitted on the link.
insert image description here

Time to Live (TimetoLive, TTL)

The TTL field sets the number of routers the packet can pass through.
Once passing through a router, the TTL value will be decremented by 1, and when the value of this field is 0, the packet will be discarded.
insert image description here

Protocol No. ( Protocol )

The protocol number field in the IP packet header identifies the protocol that will continue to process the packet.
That is, it indicates which protocol is used for the data carried by the data packet, so that the IP layer of the destination host reports the data part to which process for processing.
insert image description here

Introduction to IPv4 Addresses

An IP address is used to identify a node (or interface on a network device) in a network.
IP addresses are used to address IP packets in the network.
An IP address is like an address in reality, it can identify a node in the network through which data finds its destination.
IP address means that
an IPv4 address has 32 bits.
IPv4 addresses are usually expressed in "dotted decimal notation".

dotted decimal notation
insert image description here

Decimal and binary conversion
insert image description here
IPv4 address range: 0.0.0.0~255.255.255.255.

The IP address forms
the network part:
it is used to identify a network.
Host part:
used to distinguish different hosts within a network.
insert image description here

Netmask:
Distinguishing between the network part and the host part of an IP address.
insert image description here

The IP address addressing
network part is used to identify a network and represents the network to which the IP address belongs.
The host part is used to distinguish different hosts in a network, and can uniquely identify a certain device on a network segment.

IP address classification
In order to facilitate IP address management and networking, IP addresses are divided into five categories:
insert image description here
A/B/C default network mask
▫ A category: 8 bits, 0.0.0.0~127.255.255.255/8
▫ B category: 16 bit, 128.0.0.0~191.255.255.255/16
▫ Type C: 24 bit, 192.0.0.0~223.255.255.255/24

IP address type
We usually call the network range defined by a network number a network segment.
Network address:
Used to identify a network.
For example: 192.168.10.0/24
broadcast address:
a special address used to send data to all hosts in the network.
For example: 192.168.10.255/24
Available addresses:
Addresses that can be assigned to nodes in the network or network device interfaces.
For example: 192.168.10.1/24

Private network IP address
In the IP address space, some addresses are reserved in each of the three types of addresses A, B, and C, which are called private network IP addresses.
Public IP address
IP addresses are uniformly assigned by IANA to ensure the uniqueness of any IP address on the Internet.
Public IP address In fact, some networks do not need to be connected to the Internet, such as the network in a closed laboratory of a university, as long as the IP addresses of network devices in the same network do not conflict.

Special IP address
In the IP address space, there are some special IP addresses, these IP addresses have special meanings and functions, examples are as follows.
The limited broadcast address
255.255.255.255 can be used as the destination address and sent to all hosts on the network segment (limited by the gateway)
to any address
0.0.0.0 "any network" network address; the IP address of "this host interface on this network" is
looped back Address 127.0.0.0/8 Local link address
of the software system of the test equipment itself 169.254.0.0/24 When the host fails to obtain the address automatically, an address in this network segment can be used for temporary communication


ICMP protocol

ICMP Internet Control Message Protocol
Internet Control Message Protocol is an auxiliary protocol of IP protocol. It is used to transmit various error and control information between network devices.
insert image description here
ICMP redirect
ICMP redirect message is a kind of ICMP control message.
insert image description here
ICMP Error Detection
ICMP Echo messages are often used to diagnose the network connectivity between the source and destination, and can also provide other information, such as the round-trip time of the packet.
Function: Ping
Ping is a command on network equipment, Windows, Unix and Linux platforms. It is actually a small and practical application program based on the ICMP protocol. Ping is often used to detect the network reachability of the destination node.

[RTA]ping 20.0.0.2
PING 20.0.0.2: 56 data bytes, press CTRL_C to break
Reply from 20.0.0.2: bytes=56 Sequence=1 ttl=254 time=70 ms
Reply from 20.0.0.2: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 20.0.0.2: bytes=56 Sequence=3 ttl=254 time=30 ms
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
--- 20.0.0.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/40/70 ms

insert image description here
ICMP Error Reporting
ICMP defines various error messages for diagnosing network connectivity problems; from these error messages, the source device can determine the cause of the data transmission failure.
Function: Tracert
Tracert traces the forwarding path of a packet hop by hop based on the TTL value in the packet header.

[RTA]tracert 20.0.0.2
traceroute to 20.0.0.2(20.0.0.2), max hops: 30 ,packet length: 
40,press CTRL_C
to break 
1 10.0.0.2 80 ms 10 ms 10 ms
2 20.0.0.2 30 ms 30 ms 20 ms

insert image description here

Basic configuration commands for IP addresses

1. Enter the interface view

[Huawei] interface interface-type interface-number

Through this command, you can enter the specified interface view and configure related attributes of the interface.
• interface-type interface-number: Specifies the interface type and interface number. There may or may not be a space between the interface type and the interface number
.
2. Configure the IP address of the interface

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

In the interface view, use this command to configure an IP address for an interface on a network device to realize network interconnection.
• ip-address: Specifies the IP address of the interface in dotted decimal notation.
• mask: Specify the subnet mask in dotted decimal notation.
• mask-length: specifies the length of the mask, in integer form, and the value range is 0 to 32.

Case: Configure the interface IP address

In the above-mentioned network where the two routers are interconnected, configure the addresses of the interconnected physical interfaces of the devices and their respective logical addresses.
insert image description here
Configure the physical interface address:

[RTA] interface gigabitethernet 0/0/1
[RTA-GigabitEthernet0/0/1] ip address 192.168.1.1 255.255.255.0
或
[RTA-GigabitEthernet0/0/1] ip address 192.168.1.1 24

Configure the logical interface address:

[RTA] interface LoopBack 0
[RTA-LoopBack0] ip address 1.1.1.1 255.255.255.255
或
[RTA-LoopBack0] ip address 1.1.1.1 32

Network IP address planning

IP address planning should be considered in combination with network structure, routing protocols, traffic planning, and service rules. The planning of IP addresses should correspond to the network level as much as possible, and should be a top-down planning.
The goals of IP address planning are: easy to manage, easy to expand, and high utilization.
Reference Planning Principles
Uniqueness, continuity, scalability, structuring, and business relevance
insert image description here

I P v 4 v s I P v 6

The IPv4 addresses managed by the global IP address assignment agency, IANA (Internet Assigned Numbers Authority), were completely exhausted in 2011. With the allocation of the last IPv4 public network address and the increasing number of users and devices accessing the public network, the problem of IPv4 address depletion is becoming more and more serious. This is the biggest driving force for IPv6 to replace IPv4.
IPv4
• Address length: 32 bit
• Address classification: unicast address, broadcast address, multicast address
• Features:
▫ Address exhaustion
▫ Unreasonable header design
▫ Reliance on ARP, resulting in broadcast flooding
IPv6
• Address length: 128 bit
• Address Classification: unicast address, multicast address, anycast address
Features:
▫ Unlimited addresses
▫ Simplified packet header
▫ IPv6 address automatic deployment

Guess you like

Origin blog.csdn.net/weixin_61805348/article/details/128498436