Computer Network Fundamentals Chapter 4 Network Layer Notes

Virtual circuit and datagram

The network layer provides two services to the transport layer: connection-oriented or connectionless

Virtual circuit (connection-oriented)
makes the network responsible for reliable delivery

Datagram
allows the transport layer to be responsible for reliable delivery. The
network layer only provides connectionless and best-effort datagram services. There
is no need to establish a connection when sending packets.
Each packet is independently routed for forwarding,
making the router simpler and low cost

Network layer overview

Also known as the IP layer or the Internet layer. The
basic device is a router.

Direct delivery: router is not required
Indirect delivery: router must be used

Internet Protocol IP
IP supporting protocol: ICMP IGMP ARP

Intermediate equipment: hub (transponder), bridge, router, gateway The
protocol is horizontal

Classified IP address

The IP address is a unique 32-bit address for each host connected to the Internet .
IP address={<network number>,<host number>} The
network number indicates the network number to which the site belongs

A, B, C, D, E
Type A: The network number occupies one byte, starting with 0 (2^7-2=126)
Type B: Occupying 2 bytes, the first 2 is 10 (2^14-2 =16383)
C: 3 bytes, 110
D:
E:

Features of IP address
1. Hierarchical address structure is
easy to manage, which simplifies the operation of the router
2. It marks the interface between a host and a link
3. Several networks connected by repeaters or bridges are still the same network.

IP layer forwarding packet flow

The router packet forwarding algorithm
first extracts the IP address of the destination host from the header of the datagram

IP datagram format

The header (fixed part: 20 bytes, variable part: 40 bytes at most) and the data constitute the
IP header is aligned with 4 bytes

IP address and MAC address

The IP address is also called a logical address or a software address (stored in the CPU). The
MAC address is also called a physical address or a hardware address (in the ROM chip of the network card)

The role of the IP address: network addressing
the role of the MAC address: link addressing
Hardware check of the network card (exclusive OR operation)

Address acquisition The
destination IP address is obtained by the application layer DNS, and the
destination MAC address is obtained by the ARP protocol.

Subnet

From secondary IP address to tertiary IP address
IP address & subnet mask = network address

Packet forwarding when using a subnet, the
subnet mask is stored in the routing table

Unclassified addressing

CIDR uses the slash method.
Route aggregation.
A CIDR address aggregation can be said to form a supernet.

Longest prefix matching
When looking up the routing table, more than one matching result may be obtained
. The router with the longest network prefix should be selected from the matching results.

Internet Control Message ICMP

ICMP is divided into two categories: error report messages and ICMP query
messages. The situation where error report messages are no longer sent

Routing protocol

The task of the router is packet forwarding

Hierarchical routing protocol The
Internet is divided into many smaller autonomous systems AS
Internal Gateway Protocol IGP: A routing protocol used within an autonomous system
External Gateway Protocol EGP

The interior gateway protocol RIP is a
distributed routing protocol based on distance vectors.
Every router must be maintained.
Provisions: The distance between a router and the directly connected network is 1
distance, also called the number of hops.

RIP allows a path to contain up to 15 routers, and the maximum distance is 16 (indicating unreachable), which is only suitable for small networks

Three points

IPv6 protocol

The IP address is
basically unchanged from the 128-bit IP protocol.
Flexible expansion header.
Zero compression.
There are two consecutive 0s and only one of them can be selected for 0 compression.

Excessive:
Dual protocol stack (disadvantage: cause loss of some fields)
tunnel technology

IP multicast

Purpose: Support one-to-many
in the Internet

Multicast IP address: Class D

VPN and NAT technology

Virtual Private Network VPN

Guess you like

Origin blog.csdn.net/u011612364/article/details/106575528