Routers are required to forward data between different network segments.
A, routing,
By default, a router only knows the directly connected network segment. The non-directly connected network segment needs to be informed by static and dynamic routes.
1.1. Static routes
- The administrator manually added route information
- Applicable to small-scale networks
- Type C represents direct connection (connected)
- Type S stands for static (static)
Router Search Router (next hop) : The IP addresses of interfaces on router 0 and router 1 must be on the same network segment to communicate with each other, and the IP addresses cannot conflict with those of connected devices.
Generally, network segments are configured for static routes. If you want to specify a device IP address, set the network (network segment) to a specified IP address and the mask to 255.255.255.255.
The following uses Router 0 as an example. Method 1: Configure each network segment
-
Network (network segment) : 193.169.1.0
-
Mask: 255.255.255.0
-
Next hop: 200.168.1.2
-
Network (network segment) : 193.169.2.0
-
Mask: 255.255.255.0
-
Next hop: 200.168.1.2
Method 2: Merge network segments
- Network (Network segment) :
193.169.0.0
- Mask:
255.255.0.0
- The next-hop:
200.168.1.2
Method 3: Default route (if route does not know how to go, go to the next hop, like else in if-else)
- Network (Network segment) :
0.0.0.0
- Mask:
0.0.0.0
- The next-hop:
200.168.1.2
1.2. Dynamic routing
- The router automatically obtains routing information through routing protocols, such as RIP and OSPF
- Applicable to large-scale networks
1.3. Transmission process of data packets
Simple hint:
192.168.1.10 sends data to 192.168.3.10. Address process: MA -> M0 -> M1 -> M2 -> M3 -> MF
2. Explanation of nouns
2.1. Network/Internet/Internet
Network: A network formed by connecting computers through switches/Bridges/hubs.
The Internet: Connecting multiple networks through routers is called the Internet.
Internet: The world’s largest Internet (computers all over the world are connected together).
Internet with a capital I is used to refer to the Internet, and a lower case is used to refer to the Internet.
The computer is not connected to the Internet.
2.2. The ISP
Internet Service Provider (ISP) : Internet Service providers, such as mobile, telecom, and Netcom.
Most of the broadband we use (the services we buy) is connected to the Internet via an ISP.
2.3. Server Equipment Room
If the computer is connected to the telecom broadband, access to the resources of the telecom room, the telecom ISP will directly find the telecom room. Access to the resources of the mobile machine room, the telecom ISP will first find the mobile ISP, and then the mobile ISP will find the mobile machine room. By contrast, direct access to the telecom room is certainly faster than mobile room. The two-line machine room contains all the resources of telecommunication and mobile, and the access speed is basically the same.
Usually when downloading resources, there will be many download addresses, mainly for faster access.
2.4. Network classification
According to the scope of network classification, can be divided into: LOCAL area network, metropolitan area network, wide area network, etc.
-
Local Area Network (LAN)
- Generally, it is a computer network composed of computers in a range of several hundred meters to ten kilometers. Usually used in companies, homes, schools, hospitals, buildings, etc.
- The most widely used networking technologies in lans are:Ethernet(Ethernet).
- You see it all the time on your computer, on your phoneWLAN(Wireless LAN), meansWireless LAN.
-
Metropolitan Area Network (MAN)
- The general range is tens of kilometers to hundreds of kilometers, can cover a city.
-
Wide Area Network (WAN)
- The general range is hundreds to thousands of kilometers, can cover a country. You usually need to rent an ISP line.
2.5. Common interfaces
- FastEthernet
- Fast Ethernet interface (100M)
- Most of the connections between lans are Ethernet ports
- GigabitEthernet
- Gigabit Ethernet interface
- Serial
- Serial interface
- Routers are connected through serial ports
2.6. Internet Access
- Telephone line access
This is usually called “Asymmetric Digital Subscriber Line” (ADSL). Asymmetric digital subscriber line, providing asymmetric transmission bandwidth up and down.
A Modem, a Modem, converts digital signals to analog signals (telephone lines transmit analog signals, computers transmit digital signals).
- The optical fiber as
An Optical Modem converts digital signals to Optical signals.
- Cable entry
2.7. Logical structure of home wireless router
2.8. Public IP address and private IP address
IP addresses are classified into public IP addresses and private IP addresses.
-
Public IP Address (Public)
- Routers on the Internet have only the routing table to the public network, but not the routing table to the private network
- Public IP addresses are centrally assigned and managed by the Internet Network Information Center (Inter NIC)
- An ISP needs to apply for a public IP address from the Inter NIC
-
Private IP Address (Private)
- Mainly used for local area networks. The following are reserved private network segments:
- Class A:
10.0.0.0/8
, 1 Class A network - Class B:
Along / 16 ~ 172.31.0.0/16
, 16 class B networks - Class C:
192.168.0.0/24 ~ 192.168.255.0/24
, 256 Class C networks
- Class A:
- Mainly used for local area networks. The following are reserved private network segments:
2.9. NAT (Network Address Translation)
A private IP address needs to be translated into a public IP address to access the Internet (this step can be performed by a router).
NAT features:
- You can save public IP address resources
- Will hide the internal REAL IP (will actually be checked by the water meter)
NAT classification:
- Static conversion
- Manually configure the NAT mapping table
- One-to-one conversion
- The dynamic transformation
- Define external address pool, dynamic random conversion
- One-to-one conversion
- PAT,Port Address Translation)
- Many-to-one conversion to minimize public IP address resources
- Port multiplexing is used to identify different data flows by port numbers
- The most widely used NAT implementation
For more articles in this series, please pay attention to wechat official account [1024 Planet].