My views on network R & D

Source: Internet
Author: User
I. Summary

Recently, I have completed network R & D, involving the network communication between the lower computer and the upper computer.

 

2. Preparations and common tools before R & D 2.1 preparation before R & D

(1) Before network R & D, you must prepare a crossover network cable. The network cable should not be too long ~ 3 meters is recommended. Check whether the network cable is normal. You can use the network cable to connect two computers and view the network port light. If the network card light is on, the network cable is normal.

(2) IP Address Allocation: IP addresses are allocated to the client and server. There are two different transmission protocols. UDP can be allocated to an IP address segment, the TCP transmission protocol must be allocated to the same IP segment.

(3) port number. In addition to setting the IP address, you also need to set the port number for the network. In addition to some specific ports, other ports can be set at will.

2.2 packet capture tools and Common commands

(1) packet capture tool: to be able to conveniently observe whether the data transmitted over the network is normal on the PC end, it is necessary to use the packet capture tool. We recommend Wireshark, a packet capture tool. You can easily view network data packets, which are used to calculate the transmission speed and view the data packet content.

(2) Common commands: Some commands in PC dos, such as ping and telnet commands, are used to check whether the network is smooth and remote logon.

 

Iii. Network R & D based on lower computer 3.1 Hardware Design of Network chips

Note the following three points:

(1) The power cord of the network chip should be as rough as possible. Ensure that the power supply of the network chip is normal. Sometimes, when pinging the board on the PC end, the power cord is usually related to unstable power supply.

(2) the path between TD +, RD +, TD-, and RD-must be minimized and the path between RJ45.

(3) The network chip should be surrounded by copper, and the attribute is related to the network chip to improve the anti-interference capability.

For more information, see datasheet.

3.2 network chip driver

No matter what protocol is used for implementation, the network chip driver is essential. If you have the ability, refer to the relevant manual of the network chip and write your own Driver Based on the relevant protocols.ProgramReady-made drivers are recommended to shorten the development cycle. If it is not a special network chip, there should be ready-made drivers on the network.

3.3 network chip debugging

Debugging of network chips can be simplified to difficult processes. For example, first test whether the network chip is initialized successfully, then test whether the RJ45 Nic light is on, and then debug the complex protocol. Debugging can also be performed based on the relevant reference program, but the steps should follow the principle of simplicity to difficulty.

It should be noted that when using the TCP transmission protocol, the ping command on the PC side is a convenient way to check whether the network is smooth.

In addition, after the network debugging is smooth, Wireshark packet capture tool is used to observe network data packets, so that you can easily see whether the packets are correct.

In short, skilled use of these auxiliary tools can greatly reduce the difficulty of network R & D for the lower computer and increase the R & D speed.

 

Iv. PC-based network R & D

You can develop multiple tools and languages for implementing the network on the host computer, and there are also a wide range of debugging tools. I will not go into details here.

The recommended development process is as follows: for the convenience of R & D, server programs and client programs are usually compiled on the same computer, and both the server and client programs are debugged through the IP address 127.0.0.1. This improves the development efficiency.

 

V. Joint debugging of the lower computer and the upper computer

Joint debugging is performed to ensure that the Network Program of the lower computer and the upper computer is normal at the same time.

Connect the PC and the Development Board with a crossover network cable, set the IP address and port number, and perform step-by-step debugging.

In this case, the packet capture tool and corresponding commands can still be used as debugging assistants to check whether the data sent and received is correct.

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.