SoFunction
Updated on 2025-04-11

Router basic configuration and transmission protocol

In today's era of rapid development of networks, routers play an important role. Because the router, as the relay system in the network layer, provides a routing and forwarding function of data between the third layer networks. Therefore, the functions, functions and basic configuration of routers are all that we as members of the IT industry must be proficient in.

Below, we will make a brief analysis of the router from two aspects: that is, how to build the simplest network environment in the experiment, and the situations that often encounter in its configuration and corresponding solutions; and compare the transmission rates of different data packaging protocols (HDLC and PPP) and link compression in data transmission in the Internet.

Router configuration and network construction

To form a network, you must have a clear understanding of the network structure in the application, and the correct physical connection, the allocation of IP addresses in the router, the selection of the WAN routing protocol, and the access to the LAN are all necessary to pay great attention to in practical applications. The following are three main aspects that make the entire network run through experiments.

1. Physical connection between networks

In our experimental environment, the simplest point-to-point environment is used to connect the wide-area network ports of two routers through a pair of MODEMs for data transmission. The twisted pair wire (through wire) is connected between MODEMs, and the bandwidth for the line transmission is also required. At the LAN port, the router is directly connected to a microcomputer. However, in actual applications, it is often not just two routers connected, or multiple routers, switches, hubs, etc. This depends on the network structure to further consider the number and location of network devices, and according to the environment and requirements.

2. Router configuration

Because today's routers contain more than just the concept of data forwarding and routing conversion, they can also achieve a variety of meanings and functions, such as: security restrictions, traffic control, etc. So, here we are just briefly introducing a few steps to implement its original functionality. First, enter port mode and give each WAN and Ethernet port an IP address and corresponding address mask. Secondly, the link transmission and packaging protocol of bandwidth and data should be set at the WAN port (we used HDLC and PPP protocols respectively in the experiment). Finally, to configure the routing protocol, there are many different protocols (static routing, dynamic OSPF, EIGRP) available in large networks. We use CISCO's proprietary dynamic routing protocol EIGRP.

3. User terminal settings

For the sake of simplicity of experiments, we only placed a microcomputer in the Ethernet network to connect to the Ethernet port. All devices connected from the Ethernet port must specify an IP address to them and are on the same network segment as the Ethernet port of the router. At the same time, the Ethernet port of the router is used as the gateway to ensure that the Ethernet and the external network segments are exchanged normally.

After the above three configurations, this experimental network can be run. Use the PING command to detect whether the communication between the two microcomputers can be done normally. But during the experiment, in each of the above aspects, there are still many small things to pay attention to. The following are some of the experiences we have gained in the experiment.

1. The connected ASCOM in the WAN is intelligent, so you can communicate after waiting for the clocks of the two MODEMs to be synchronized after connecting. However, it should be noted that in MODEM, one master and one slave or manual settings can be customized. When the main MODEM changes the transmission rate, the link will be automatically disconnected, and the slave MODEM will clock resynchronize with the main MODEM to communicate at a newly set rate.

2. In the router's port status check, when the interface is connected to the downlink device, the port is UP; when the downlink device is in the open state, and the connected link protocol is also configured, the protocol status of the port will appear UP.

3. When configuring the routing protocol, if the protocol has not yet been established, check the status of the router and all ports are UP, but the link is not connected. This is because the router does not transmit the routing information of the downlink device to the routing table of the upper router. When forwarding data, you can only find the directly connected network segment through the routing table of the upper router, but cannot find the address of the next hop connected network segment. Only after the protocol is running normally and the router learns the routing in the network through the routing protocol can forward the obtained data to its next hop. It should also be noted that when using the routing protocol, the network number is specified to refer to the entire network using this routing protocol.

4. The data link layer encapsulation protocol of the router's wide area network must be synchronized, that is, the same encapsulation protocol must be used to send and receive data, otherwise the WAN port will lose data packets that are different from the interface encapsulation type, resulting in link blockage.

5. Since the interface between the microcomputer and the router belongs to the same type of network access equipment, it must be connected by reverse twisted pair cables (crossed cables). In the same situation, the connection between the switch and the hub is also possible. It can also be determined by the port identification. For the same type of mark, cross-line is used, otherwise, straight-through lines are used.

Transmission of data

The significance of the network itself is that it can enable information to be transmitted faster and more conveniently to the entire regional scope covered by the network, thereby realizing the requirements of informationization and globalization in the era. However, the transmission of information must be guaranteed correctly and completely. In the early days of computer communication, people have discovered that for actual links that often cause code errors, communication can be made more reliable by adding appropriate control procedures. These procedures have evolved to the present and have become the data transmission and packaging protocols between the Internet: HDLC, PPP, ATM, frame relay, etc. Therefore, after the two microcomputers can communicate on this experimental network, we not only performed transmission rates of HDLC and PPP, but also compared the states of compressed and uncompressed under these two protocols by CISCO routers.

The software used to test the transmission speed is a registry file of 5.58M, which uses FTP for data transmission. The transmission process applies binary algorithms and HASH sorting.

From the results of the experiment, it can be seen that in the same network environment, HDLC is slightly faster than PPP under normal circumstances. After compression, both protocols are obviously faster than before compression. What is the reason for this? Then let’s start with their structure.

HDLC (High-level Data Link Control), advanced data link control. The former is a bit-oriented procedure SDLC, which is called HDLC after being modified by ISO. In CISCO routers, HDLC is the default transmission protocol, which is similar to the structure of ordinary HDLC. For this reason, we analyze its structure using ordinary HDLC.

HDLC frame structure

The data at the data link layer is in frame units. The structure of a frame has a fixed format. The flag field F (Flag) is placed at the beginning and end of the frame as the boundary of the frame, and is used to solve the problem of bit synchronization. The FCS (Frame Check Sequence) field accounts for a total of 16 bits, and the generated polynomial it uses is CRC-CCITT. The range tested is from the first bit in the address field to the last one in the information field. Control field C has 8 bits in total. Many important functions of HDLC are implemented by control fields.

The frame format of PPP is similar to that of HDLC. Unlike HDLC, there is an additional 2 bytes of protocol field. When the protocol field is 0x0021, the information field is the IP datagram. If it is 0xC021, the information field is link control data, and 0x8021 means that this is network control data. PPP does not provide reliable transmission of usage serial numbers and confirmations. PPP works in the network layer and the data link layer, including NCP and LCP protocols. NCP is a multi-protocol package used in the LAN at the third layer, and LCP is used in the LAN link control protocol of the second layer.

From the perspective of the structure of the two, PPP has a more complex control mechanism than HDLC, and it takes relatively more time to process it. From the perspective of communication connection, HDLC adopts a handshake agreement between the two parties when connecting and disconnecting; PPP uses an authentication mechanism, and the two parties negotiate, identity authentication, and LCP configuration to open the communication until the communication is completed. Therefore, in the entire test, PPP takes more time to process the link connection to data than HDLC. Especially when data transmission in large banks, the transmission speed of HDLC can be better reflected. However, PPP is better than HDLC in terms of security. Its identity verification can detect all received data according to security requirements, and only after passing the authentication will the data be received and forwarded otherwise it will be discarded. Therefore, the requirements for the selection of visual transmission of the two protocols are considered.

In addition, we perform link compression transmission for both protocols. As a result, both have significantly improved in terms of speed. In fact, the so-called compression is the compression of the packet header and load by performing the transmission entity. Link compression does not refer to a special protocol function alone, but CISCO provides two compression algorithms dedicated to routers for data transmission - Stac and Predictor.

But in HDLC structure, Stac is the only option. STAC compresses data in fact by replacing some data streams of redundant strings with specific tags, and these tags with amount of information are significantly shorter than the replaced data stream. If the algorithm cannot find a substitutable string in the data, then there will be no compression, or it will be like the compression function is not activated during transmission. In some applications, for example, when sending encrypted data, compression will only increase the overhead of transmission, so in this case, the original transmission will not be modified. Moreover, the Stac compression algorithm has high requirements for the resource occupancy of CPU and is often not used in routers with high CPU utilization. The Predictor compression algorithm is just like its name. This CISCO priority algorithm is to try to predict the upcoming sequence of feature data from an operational search system, which is generated based on a compressed dictionary. What is a compressed dictionary? In fact, it is an encoding book composed of many possible data sequences. If a feature data stream is found in this dictionary and is exactly consistent with one of the items in the dictionary, then this dictionary entry will be used to replace the data stream. The resulting entry contains smaller and shorter feature sequences. At the far end, these features will be decoded in a comparison with the data dictionary.

The data stream will be found and replaced with appropriate information. The Predictor compression algorithm is like body language. It uses a gesture to express the entire sentence and meaning (compression), which is much simpler than spelling out sentences and meanings (no compression) composed of individual words. Because all groups can understand gesture language, they can communicate well with each other. On the contrary, when one of the people communicates with an unknown body language, communication between them will not occur. There will also be a lack of communication in compression. If a compression algorithm is used on one side, it must also be used on the other side. (It should be noted that the algorithms used on both ends must be consistent.) Stac is a high CPU occupancy, while Predictor is an extremely high memory occupancy. Therefore, if the router is not equipped with large capacity RAM, then you don’t even think about implementing the Predictor algorithm. But if you have enough RAM, using Predictor is also a good choice.

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.