Skip to content

Commit 9bcd42c

Browse files
committed
docs(notes): update network layer documentation for 2025-03-22
1 parent 94bf40f commit 9bcd42c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

notes/2025-03-22-network-layer-en.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@ Okay, let's dive into a detailed tutorial on the Network Layer, specifically tai
1111

1212
## Network Layer Tutorial
1313

14-
The Network Layer (网络层) is the third layer in the OSI model and the TCP/IP model. Its primary responsibility is to facilitate the movement of data packets from a source host to a destination host across one or more networks. Think of it as the postal service for the internet – it figures out the best route and ensures your "package" (data packet) gets to the correct address.
14+
The Network Layer is the third layer in the OSI model and the TCP/IP model. Its primary responsibility is to facilitate the movement of data packets from a source host to a destination host across one or more networks. Think of it as the postal service for the internet – it figures out the best route and ensures your "package" (data packet) gets to the correct address.
1515

1616
Here's a breakdown of the key topics within this chapter:
1717

18-
### 1. Functions of the Network Layer (网络层的功能)
18+
### 1. Functions of the Network Layer
1919

2020
The Network Layer performs three main functions:
2121

22-
#### a) Logical Addressing (逻辑寻址)
22+
#### a) Logical Addressing
2323

2424
* **Purpose:** To uniquely identify each host on a network. This is different from the physical address (MAC address) which identifies a device within a local network. Logical addresses are hierarchical and allow for efficient routing.
2525
* **Key Concept:** IP addresses (Internet Protocol addresses) are the primary form of logical addressing used in the Network Layer.
2626
* **Analogy:** Think of your home address. It's a logical address that helps the postal service find your specific house within a city and country, regardless of the physical location of the post office.
2727

28-
#### b) Routing (路由选择)
28+
#### b) Routing
2929

3030
* **Purpose:** To determine the best path for a data packet to travel from the source to the destination. This involves selecting a sequence of network devices (routers) that the packet will traverse.
3131
* **Key Concept:** Routing algorithms are used by routers to build and maintain routing tables, which contain information about the best paths to different networks.
3232
* **Analogy:** Imagine planning a road trip. You look at a map or use a GPS to figure out the best route to your destination, considering factors like distance and traffic. Routers do something similar for data packets.
3333

34-
#### c) Forwarding (转发)
34+
#### c) Forwarding
3535

3636
* **Purpose:** The actual process of moving a data packet from an input port of a router to the appropriate output port based on the routing decision.
3737
* **Key Concept:** When a router receives a packet, it examines the destination IP address and consults its routing table to determine the next hop (another router or the destination host).
3838
* **Analogy:** Once you've planned your route, forwarding is like actually driving your car along that route, moving from one point to the next.
3939

40-
### 2. IP Addressing (IP地址)
40+
### 2. IP Addressing
4141

4242
IP addresses are fundamental to the Network Layer. There are two main versions: IPv4 and IPv6.
4343

44-
#### a) IPv4 Structure (IPv4结构)
44+
#### a) IPv4 Structure
4545

4646
* **Format:** A 32-bit numerical address written in dotted decimal notation (e.g., 192.168.1.10). It's divided into four 8-bit octets.
4747
* **Address Classes (Historically):** While largely obsolete now due to Classless Inter-Domain Routing (CIDR), understanding the historical classes (A, B, C, D, E) can be helpful for foundational knowledge.
@@ -57,7 +57,7 @@ IP addresses are fundamental to the Network Layer. There are two main versions:
5757
* **Private IP Addresses:** Ranges reserved for use within private networks (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). These addresses are not routable on the public internet.
5858
* **Public IP Addresses:** Addresses that are routable on the public internet.
5959

60-
#### b) IPv6 Structure (IPv6结构)
60+
#### b) IPv6 Structure
6161

6262
* **Format:** A 128-bit numerical address written in hexadecimal format, grouped into eight 16-bit segments separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
6363
* **Advantages over IPv4:** Larger address space (solves IPv4 address exhaustion), improved security (IPsec is often integrated), simplified header format, better support for mobile devices.
@@ -71,7 +71,7 @@ IP addresses are fundamental to the Network Layer. There are two main versions:
7171
* **Link-Local Addresses (fe80::/10):** Used for communication within a single network link.
7272
* **Global Unicast Addresses:** Globally routable addresses on the internet.
7373

74-
#### c) Subnetting (子网划分)
74+
#### c) Subnetting
7575

7676
* **Purpose:** To divide a larger network into smaller, more manageable subnetworks (subnets). This helps in organizing networks, improving security, and optimizing network performance.
7777
* **Mechanism:** Subnetting is achieved by borrowing bits from the host portion of an IP address and using them to create subnet IDs. This is done using a **subnet mask**.
@@ -85,11 +85,11 @@ IP addresses are fundamental to the Network Layer. There are two main versions:
8585
5. Identify the valid subnet addresses, broadcast addresses, and usable host ranges for each subnet.
8686
* **Subnetting in IPv6:** While the concept of subnetting exists in IPv6, the vast address space makes it less about conserving addresses and more about network organization. IPv6 subnets are typically a fixed size (/64).
8787

88-
### 3. Routing Algorithms (路由算法)
88+
### 3. Routing Algorithms
8989

9090
Routing algorithms are used by routers to determine the best path for data packets. They can be broadly classified into:
9191

92-
#### a) Static vs. Dynamic Routing (静态路由 vs. 动态路由)
92+
#### a) Static vs. Dynamic Routing
9393

9494
* **Static Routing:**
9595
* Routing tables are manually configured by the network administrator.
@@ -101,23 +101,23 @@ Routing algorithms are used by routers to determine the best path for data packe
101101
* More complex to configure initially but highly adaptable to network changes and failures.
102102
* Scalable for larger and more complex networks.
103103

104-
#### b) Distance Vector Routing (距离向量路由)
104+
#### b) Distance Vector Routing
105105

106106
* **Principle:** Each router maintains a routing table that lists the best known distance (e.g., number of hops) and the direction (next hop router) to each destination network.
107107
* **Information Exchange:** Routers periodically exchange their entire routing tables with their directly connected neighbors.
108108
* **Algorithm Example:** The **Bellman-Ford algorithm** is a common algorithm used in distance vector routing protocols.
109109
* **Protocols:** RIP (Routing Information Protocol) is a well-known example of a distance vector routing protocol.
110110
* **Limitations:** Can suffer from slow convergence (takes time for the network to adapt to changes) and the "count-to-infinity" problem (routing loops can occur).
111111

112-
#### c) Link State Routing (链路状态路由)
112+
#### c) Link State Routing
113113

114114
* **Principle:** Each router maintains a complete map of the network topology. It knows about all the routers and the links between them, along with the cost of each link.
115115
* **Information Exchange:** Routers exchange information about the state of their directly connected links with all other routers in the network. This information is called a Link State Advertisement (LSA).
116116
* **Algorithm Example:** The **Dijkstra's algorithm** (Shortest Path First - SPF) is used by each router to calculate the shortest path to all other destinations based on the collected link state information.
117117
* **Protocols:** OSPF (Open Shortest Path First) and IS-IS (Intermediate System to Intermediate System) are popular link state routing protocols.
118118
* **Advantages:** Faster convergence, less prone to routing loops compared to distance vector routing.
119119

120-
### 4. Protocols (协议)
120+
### 4. Protocols
121121

122122
Several key protocols operate at the Network Layer:
123123

@@ -139,11 +139,11 @@ Several key protocols operate at the Network Layer:
139139
* **Process:** When a host needs to send a packet to another host on the same network, it knows the destination IP address but needs the destination MAC address to frame the packet at the Data Link Layer. The sending host broadcasts an ARP request containing the destination IP address. The host with that IP address responds with an ARP reply containing its MAC address.
140140
* **ARP Cache:** Hosts maintain an ARP cache to store recently resolved IP-to-MAC address mappings to avoid sending ARP requests for every communication.
141141

142-
### 5. Network Devices (网络设备)
142+
### 5. Network Devices
143143

144144
The Network Layer primarily involves two key types of network devices:
145145

146-
#### a) Routers (路由器)
146+
#### a) Routers
147147

148148
* **Primary Function:** To forward data packets between different networks based on their destination IP addresses.
149149
* **Key Features:**
@@ -152,7 +152,7 @@ The Network Layer primarily involves two key types of network devices:
152152
* Perform packet forwarding based on routing decisions.
153153
* Can implement security features like firewalls and access control lists (ACLs).
154154

155-
#### b) Gateways (网关)
155+
#### b) Gateways
156156

157157
* **Broader Term:** A gateway is a device that acts as an entry point to another network. It can be a router, firewall, or another type of device.
158158
* **Default Gateway:** In the context of IP networking, the default gateway is a router on the local network that a host uses to send traffic to destinations outside its own network.
@@ -173,4 +173,4 @@ The Network Layer primarily involves two key types of network devices:
173173
* **Relate to real-world scenarios:** Think about how these concepts apply to your own internet usage and network setups.
174174
* **Review past exam papers:** Understand the types of questions that are typically asked on this topic in the Chinese Self-Study Exam.
175175

176-
By thoroughly understanding these concepts, you will build a strong foundation in the Network Layer, which is essential for further studies in computer networking. Good luck with your studies!
176+
By thoroughly understanding these concepts, you will build a strong foundation in the Network Layer, which is essential for further studies in computer networking. Good luck with your studies!

0 commit comments

Comments
 (0)