Computer Network Technology and Application

Chapter 16 Network Interconnection Technology

Chapter 16 Network Interconnection Technology (1)
In the Internet, a large-scale network, tens of millions of networks are interconnected, and the network interconnection protocol plays a key role.In the TCP/IP system, the main task of the network layer protocol is to realize the interconnection of the network. The interconnection of the network is to connect different networks through the network equipment, and realize the forwarding of the data packet through the network protocol.In order to realize network interconnection, issues such as topological structure, path selection, and data transmission of different networks must be considered.This chapter focuses on routing devices and introduces routing protocols and optimal path algorithms.

【Main content of this chapter】

The role and application of routers.

Routing protocol OSPF.

Example of network interconnection.

5.1 The basis of network interconnection
The main content of this section is to discuss the purpose of network interconnection, the differences between networks and the problems that must be solved.

5.1.1 Differences between networks

Taking the Internet as an example, there are the following differences between networks: ① different addressing schemes; ② different maximum packet (data carrier) lengths; ③ different network access mechanisms; ④ different timeout controls; recovery methods; ⑥ different status reporting methods; ⑦ different routing technologies; ⑧ different services; ⑨ different management and control methods, etc.

5.1.2 Network interconnection problems to be solved
To achieve sharing of services and resources across networks, the differences between networks must first be shielded so that they cannot be perceived by users receiving services.

1. The goals that must be achieved by the interconnection between networks

(1) The services provided are not directly related to each network.

(2) The number, type, and topology of the network are transparent to data transmission.

(3) No matter how many networks are crossed, a unified address format should be adopted for the transmitted data source and destination networks.

2. Problems that need to be solved in network interconnection
It is mainly "how the packets of the sending node are efficiently and quickly transmitted to the receiving node", as follows:

(1) Network addressing, looking for the source and destination computer addresses of data packets; (2) Routing search and selection, the network environment is complex, and it is necessary to determine the appropriate path before or during the data transmission; (3) Routing information Switching, the structure and state of the network are understood by routing information, and exchanging routing information is necessary; (4) Forwarding data packets, forwarding data packets/packets from one network to another network until reaching the destination network; (5) ) provides quality of service to the upper layers, and provides good network connection services for data transmission and application services.

5.2 Network interconnection equipment - router
When different networks are interconnected, the following issues are mainly considered: first, the path of data transmission, to balance the load of the network (the pressure of data transmission), to avoid excessive local traffic, resulting in network congestion; second, to consider security issues, Which data packets are allowed to pass and which are filtered out.At present, the best solution to these two problems is to rely on the router as a network device.

5.2.1 Know the router

A router is used to connect multiple logically separated network devices, and a logical network often represents a separate network or a subnet.When data is transferred from one subnet to another, it is done through a router.

Therefore, the router has the function of judging the network address and selecting the path, and it can establish a flexible connection in a multi-network interconnection environment.It does not care about the hardware devices used by each subnet, but requires running software consistent with the network interconnection layer protocol.

The main job of the router is to find an optimal transmission path for each data packet (the data carrier in the network interconnection protocol) passing through the router, and effectively transmit the data packet to the destination site.

It can be seen that the strategy of choosing the best path, that is, the routing algorithm is the key to the router.

In order to complete this work, a routing table (Routing Table) is kept in the router, which includes data related to various transmission paths for use in routing selection.The routing table also stores content such as network identification information, the number of routers on the network, and the name of the next router.

The routing table can be statically set by the system administrator or dynamically modified by the system; it can be automatically adjusted by the router or controlled by the computer host.

The software of the router plays a very important role in routing selection and network security, so a good router should not only have good hardware configuration, but also good software configuration.

5.2.2 Structure of a Typical Router
1. "Forwarding" and "Routing"

The function of a router includes two parts: forwarding and routing.

During data transmission, after the data packet arrives at the router, the router "forwards" the user's data packet from the appropriate port according to the forwarding table.

"Routing" (Routing) is to dynamically change the selected route according to the distributed algorithm according to the change of the network topology obtained from other routers.

So, what is the relationship between routing and forwarding?Typical router structure, it can be seen that the function of the router includes two parts: routing and forwarding.The routing table is derived from the routing algorithm, and the forwarding table is derived from the routing table.That is, routing determines where to forward packets.

2. The input port processes the packets received on the line
In the data link layer protocol, after the header and tail of the frame are stripped from the data packet, the packet is sent to the queue of the network layer to wait for processing, and a certain delay will be generated.

3. Cache package (packet)

The cache packet caches the packet transmitted by the switching structure first, and then the data link layer protocol adds the header and tail of the link layer to the packet, and then sends it to the external line after handing it over to the physical layer.

4. Processing speed
If the rate at which the router processes packets cannot catch up with the rate at which packets enter the queue, the storage space of the queue will gradually decrease to zero, and subsequent packets entering the queue will be discarded due to lack of storage space.

The overflow of the input or output queue in the router is an important cause of packet loss.

5.2.3 Working Process of IP Router
The current Internet is a large-scale network interconnected by thousands of IP networks through routers.A router is not only responsible for forwarding IP packets, but also responsible for sharing network information with other routers, jointly determining route selection and maintaining routing tables.

Taking the router of the Internet as an example, the specific working process of the router is as follows.

(1) When a host in the IP network sends an IP packet to another host on the same IP subnet, it only needs to send the IP packet directly to the network, and the other party can receive it.

(2) For packets forwarded to the external network, when the router forwards, it selects an appropriate port according to the destination IP address of the IP packet, and sends the IP packet out.For this reason, the router has to determine whether the port is connected to the destination network.If yes, send the packet directly to the local network through the port; otherwise, select the next router to forward the packet.

(3) There is a default gateway in the routing table, which is used to transmit IP packets that do not know the next router.In this way, the IP packet that knows the next hop is correctly forwarded through the router, and the IP packet that does not know the next router is sent to the "default gateway" router.In this way, the IP packets are transmitted step by step, and the IP packets are finally sent to the destination, and the IP packets that cannot be sent to the destination will be discarded by the network.

5.3 Network address
For Internet networks, IP address is a very important concept. It is the ID card of every computer and routing device on the Internet. Many services and features are provided through IP addresses.

5.3.1 The concept of IP address

When two computers connected to the Internet communicate with each other, the addresses of the computer that sends the data and the address of the computer that receives the data are added to the data packets they transmit.For the convenience of communication, it is necessary to assign an identification address similar to a telephone number to each computer in advance - an IP address.According to the TCP/IP 4th edition (IPv4) protocol, an IP address is composed of 32-bit binary numbers and is unique within the Internet.

For example, the IP address of a computer: 11010010010010001000110000000011.

For the convenience of memory, the 32-bit binary IP address is divided into 4 bytes, each byte is 8 bits, separated by a decimal point in the middle, and then each 8-bit binary is converted into a decimal number, so that the IP address of the above computer becomes: 210.72.140.3, this method is called the dot method.

For web addresses:

(1) The network address must be unique.

(2) The network ID cannot start with the number 127.In class A addresses, 127 is reserved for internal loopback functions.

(3) The first byte of the network identifier cannot be 255 (all 1s).The number 255 is used as the broadcast address.

(4) The first byte of the network identification cannot be "0". "0" indicates that the address is the local host and cannot be transmitted.

For host IDs:

(1) The host ID must be unique within the same network.

(2) The bits of the host identification cannot all be "1", if all the bits are "1", then the address is a broadcast address, not the address of the host.

(3) The bits of the host identification cannot all be "0", if they are all "0", it means "only this network", and there is no host on this network.

5.3.2 Classification of IP addresses

A telephone number is 64495073. The first four digits in this number indicate which branch office the phone belongs to, and the following numbers indicate a certain telephone number under the office.Similar to the telephone, the 4 bytes of the IP address of the computer are also divided into two parts, namely the network identifier and the host identifier. The network identifier indicates which network the address belongs to, and the host identifier indicates which computer or routing device in which network it is. Layer protocol switches do not have IP addresses.All hosts on the same physical network use the same network ID, and each workstation, server, and router on the network has a corresponding host ID.

For example, if the IP address of a server in a network is 202.210.175.12, for this IP address, it can be written as:

Network ID: 202.210.175.0
Host ID: 12
IP address: 202.210.175.12
According to the size of the network, the 32-bit address is divided into five ways, which correspond to the IP addresses of A, B, C, D and E respectively.

1. Class A IP address
Among the 4 bytes of the IP address, the first byte number is the network identifier, and the remaining 3 bytes are the identifier of the local computer.If the IP address is expressed in binary, the Class A IP address consists of a 1-byte network address and a 3-byte host address, and the highest bit of the network address must be "0". In a class A IP address, the length of the network identifier is 7 bits, and the length of the host identifier is 24 bits. The number of class A network addresses is small, and it can be used in large-scale networks with more than 1600 million hosts.

2. Class B IP address
Among the 4 bytes of the IP address, the first two bytes are the network identifier, and the Class B IP address is composed of a 2-byte network address and a 2-byte host address, and the highest bit of the network address must be "10". . In a class B IP address, the length of the network identifier is 14 bits, and the length of the host identifier is 16 bits. Class B network addresses are suitable for medium-sized networks, and each network can accommodate more than 6 computers.

3. Class C IP address
Among the 4 bytes of the IP address, the first 3 bytes are the network number, and the other byte number is the local computer identification.If the IP address is expressed in binary, the Class C IP address consists of a 3-byte network address and a 1-byte host address, and the highest bit of the network address must be "110". In a Class C IP address, the length of the network identifier is 21 bits, and the length of the host identifier is 8 bits. Class C network has a large number of addresses and is suitable for small-scale local area networks. Each network can only contain 254 computers at most.

除了A、B、C三种类型的IP地址外,还有两种特殊类型的IP地址。TCP/IP协议规定,凡是IP地址中的第1个字节以“1110”开始的地址都是多点广播或组播地址。因此,任何第1个字节大于223小于240的IP地址都是多点广播地址;凡是IP地址中的第1个字节以“1111”开始的地址都是保留地址。

5. Special IP address
An IP address in which every byte is zero ("0") corresponds to the current host.

The IP address ("1") with every byte in the IP address being 255.255.255.255 is the broadcast address of the current subnet.

127.0.0.0 in the IP address is used for loop test, for example, to test the network card of the machine, you can use 127.0.0.1.

The IP addresses 10.0.0.0 and 192.0.0.0 can only be used in the internal network and cannot be used in the Internet.

The fourth byte in the IP address is all 0, indicating that it is a network address.

The fourth byte in the IP address is all 1s, indicating that it is the broadcast address of the local network.

5.3.3 Address mask
1. Know the mask
The mask is a 32-bit address. Its function is to shield the host identification part of the IP address to distinguish the network identification from the host identification, and to indicate whether the IP address is on the local area network or on other networks.

When the mask is used, the destination address and the mask are "ANDed", and the result of the "AND" is the destination network address.For example, after a data packet arrives at a router, if the router decides whether to forward the packet to another router or directly to the connected network, it must compare the result of the "AND" operation with the entries in the routing table to determine the exit of the target network.

2. Default mask
1. Understand subnet addressing
Subnetting is to divide a large network into several smaller networks. Standard A, B, and C class IP addresses can be divided into subnets.Subnetting is to add an intermediate level to the two-level structure of IP addressing, so that the IP address becomes a three-level structure, that is, the network address, subnet address, and host address.

Subnet addressing allows one network address to evolve into several network addresses, which can better solve the problem of insufficient network addresses.

2. Determine the subnet mask
The number of possible subnets and the number of hosts per subnet can be determined by using the number of bits in the subnet mask.Before defining the subnet mask, you must figure out the number of subnets and hosts originally used.The steps to define the subnet mask are as follows:

(1) Determine the address.For example, the applied IP is "200.100.10.Y", the network address is a class C IP address, the network ID is "200.100.10", the host ID is "Y", and its default subnet is 255.255.255.0.

(2) According to the number of subnets required and the number of subnets that may be expanded in the future, use the high bits of the host to define the subnet code.

For example, 10 subnets are needed now, and it may be expanded to 15 in the future. The first four bits of the Y byte are used as the subnet code, and the lower 4 bits continue to be used as the host address identifier.

(3)将第4个字节的子网掩码高4位置“1”,即“11110000”,则子网掩码的点分二进制形式为“11111111.11111111.11111111.11110000”。

(4) Convert this number into dotted decimal form: 255.255.255.240, which is the subnet mask of the network.

(End of this chapter)

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like