Network Card composition principle

Source: Internet
Author: User
Tags rfc high cpu usage
1. Recognize NICs, one of the essential components for accessing the Internet.
The network adapter works on the last two layers of OSI. The physical layer and the data link layer define the electrical and optical signals, line statuses, clock benchmarks, data encoding, and circuits required for data transmission and reception, provides standard interfaces to data link layer devices. The Physical Layer Chip is called Phy. The data link layer provides addressing mechanisms, data frame construction, data error check, transfer control, and standard data interfaces to the network layer. The data link layer chip in the ethernet card is called the Mac controller. Many NICs work together. The relationship between them is that the PCI bus is connected to the Mac bus, the Mac is connected to the phy, And the PHY is connected to the network cable (of course, it is not directly connected, there is also a pressure change device ).

Next, let's take a look at how data is transmitted and communicated between PHY and Mac. Standard MII/gigamii (media) defined by IEEE
Independed
Interfade, independent media interface. This interface is defined by IEEE. The MII interface controls all the data and data on the network.
Mac determines the operating status of the PHY and controls the PHY by using SMI (Serial Management
Interface. Some registers in the PHY are also defined by IEEE. In this way, the PHY reflects its current status to the Register, mac constantly reads the Status Register of the PHY through the SMI bus to get the current PHY status, such as connection speed and duplex capability. Of course, you can also set the register of the PHY through SMI to achieve the purpose of control. For example, if the throttling is enabled or disabled, the self-negotiation mode or the forced mode can be used.

We can see that both the MII interface of physical connection and the status registers and control registers of SMI bus and PHY have IEEE specifications. Therefore, Mac and PHY of different companies can coordinate their work. Of course, in order to match the features specific to PHY of different companies, the driver needs to be modified accordingly.

The implementation of the main functions of a NIC is basically the above. In addition, there is an EEPROM chip, usually a 93c46 chip. It records the NIC chip supplier ID, subsystem supplier ID, Nic MAC address, Nic configurations, such as the PHY address on the SMI bus and bootrom capacity, whether to enable the bootrom boot system.

Many NICs also have bootrom. It is used to boot the operating system with a diskless workstation. Since there is no disk, some of the programs and protocol stacks necessary for boot are put in it, such as RPL and PXE. In fact, it is a standard PCI
Rom. Therefore, some hard disk write protection cards can be implemented by burning the bootrom of the NIC. In fact, the ROM of the PCI device can be placed in the BIOS of the motherboard. The ROM can be detected and correctly identified when the computer is started. The configuration of AGP is the same as that of PCI in many places. Therefore, the BIOS of many graphics cards can also be placed in the BIOS of the motherboard. This is why we have never seen bootrom for onboard NICs.

2. Working Process

When sending data, phy receives data from MAC (for phy, there is no frame concept, and for it, it is data regardless of the address, data or CRC ), an Error Code of 1 bit is added for every 4 bits. Then, parallel data is converted into serial stream data, and the data is encoded according to the physical layer encoding rules (NRZ encoding of 10based-t or Manchester encoding of 100based-t, then the analog signal is used to send the data. Otherwise. Now let's take a look at the following part of the output of Phy. When a CMOS chip is working, the signal level is always greater than 0 V (depending on the chip's process and design requirements ), however, if such a signal is sent to a location of 100 meters or longer, there will be a great loss of DC components. In addition, if the external network is directly connected to the chip, electromagnetic induction (Thunder) and static electricity can easily cause damage to the chip.

In addition, if the grounding method of the device is different, the power grid environment may cause the 0 V levels of both parties to be inconsistent. In this way, the signal is transmitted from A to B because the 0 V level of the device is different from the 0 V level of the B point, this will lead to a large amount of current flowing from devices with high potential to devices with low potential. How can we solve this problem?
The transformer (isolating transformer) device appears. It filters the differential signals sent by PHY with the difference mode coupled coil to enhance the signal, and is coupled to the other end of the connected network cable through the electromagnetic field conversion. In this way, not only does the network cable and the PHY have no physical connection, but the signal is transferred instead, the DC component in the signal is cut off, and data can be transmitted in devices of different 0 V levels.

The isolating transformer is designed to withstand 2kv ~ 3kv voltage. It also plays a role in Lightning Protection (I personally think it is inappropriate to use lightning protection. Some of my friends' network devices are easily burned out during thunderstorms. Most of them are caused by unreasonable PCB design, and most of them burn down the interfaces of the devices, with few chips burned out, isolation transformer plays a protective role.

When data is sent, the network adapter first listens on whether the media has a carrier (the carrier is indicated by the voltage). If yes, the network adapter considers that other sites are transmitting information and continues to listen on the media. Once the communication medium is quiet for a certain period of time (known as the interframe gap IFG = 9.6 microseconds), that is, it is not occupied by other sites, frame data transmission starts, at the same time, continue to listen on communication media to detect conflicts. If a conflict is detected during data transmission, immediately stop sending the message and send a "blocking" signal to the media to inform other sites that a conflict has occurred, this discards corrupted frame data that may be received all the time, and waits for a random period of time (CSMA/CD determines the wait time algorithm is the Binary Index Backoff Algorithm ). Wait for a random period of time before sending a new message. If a conflict still occurs after multiple retransmission (more than 16 times), the sender will be abandoned.
When receiving, the network adapter browses each frame transmitted on the media. If the frame length is smaller than 64 bytes, it is considered as a conflict fragment. If the received frame is not a conflict fragment and the destination address is a local address, the frame integrity is verified. If the frame length is greater than 1518 bytes (referred to as ultra-long frame, may be caused by an incorrect LAN Driver or interference) or fails to pass CRC verification, the frame is considered to be distorted. The frame that passes the verification is considered valid. The NIC receives the frame for local processing.

Principles and testing technology of NICs
A network adapter acts as a physical interface or connection between a computer and a network cable to convert a digital signal from a computer to an electrical or optical signal (
Network interface card
). Data is transmitted in parallel in the computer bus, that is, data is transmitted side by side. In the physical cable of the network, data is transmitted in a serial bit stream mode, the NIC converts the serial data and parallel data. Before sending data, the network adapter needs to talk to the receiving network adapter to determine the maximum size of data to be sent, the size of the data to be sent, the interval between the two sent data, the waiting time for confirmation, and each maximum data volume and data transmission speed that the network adapter can withstand before the overflow.
I. basic structure of the network card
Nic includes hardware and firmware programs (software routines in read-only memory ), this firmware program implements Logical Link Control and media access control functions. The NIC includes hardware and firmware programs (software routines in read-only memory ), the firmware program implements Logical Link Control and media access control. It also records the unique hardware address, that is, the MAC address, which is generally cached on the NIC. The ENI must be allocated with the IRQ interrupt and basic I/O port addresses, and the basic memory address (Base
Memory Address) and transceiver (transceiver)
Nic control chip
It is the most important component of the network card. It is the control center of the network card, such as the CPU of a computer. It controls the work of the entire network card and is responsible for data transmission and signal detection during connection. Early 10/100 M dual-speed NICs used two control chips (units) to control operations in two different rate environments, currently, more advanced products only have one chip to control two speeds.
Crystal Oscillator
It is responsible for generating computation clocks for all chips of the NIC. The principle is like the crystal oscillator on the motherboard. Generally, the NIC uses a 20 or 25Hz crystal oscillator.
Boot Rom slot
If there is no special requirement, the slot in the NIC is vacant. Usually with boot
ROM chip used together, its main function is to guide the computer through the server boot into Win9x.
Boot Rom
It is to start the chip so that the computer can boot directly through the server without a hard drive, a soft drive and a drive without a hard drive. Data cannot be output without a software drive, which can also achieve the data confidentiality function. At the same time, you can save the cost of purchasing these computer components. When using Boot
Pay attention to what kind of network operating system you use when using ROM, which usually includes boot ROM for NT and boot ROM
UNIX, boot ROM for NetWare, etc. Boot ROM boot chips should be purchased by yourself.
EPROM
In the past, the old-fashioned NICs were configured with jumpers or DIP switches to set IRQ, DMA, and I/O.
Port equivalent, while the current Nic uses software settings, almost invisible to the existence of jumper. Data such as the status and information of various NICs are stored in this small EEPROM and can be set automatically through it.
Internal Converter
As long as the NIC with BNC connector has this chip, it is close to the BNC connector. Its function is to convert data between the NIC and BNC connector, enable the NIC to send or receive data from the BNC connector.
RJ-45 and BNC connector
RJ-45 is a kind of NIC interface which uses twisted pair wires as transmission media and is most often used in Mbps network. BNC uses fine coaxial cables as transmission media
Signal Indicator
There are two to three signal lights behind the network adapter. The function is to display the current network connection status, usually with TX and Rx information. TX indicates that the data is being sent, RX indicates that the data is being received, and if two lights are on at the same time, the data is currently in full-duplex operation, you can also identify whether the full-duplex Nic is in the full-duplex network environment (see the middle part of the two interfaces ). Some low-speed NICs only use one lamp to represent the signal, and different light transformations are used to indicate whether the network is turned on.
Ii. Classification of network cards
Differentiate network card types by bandwidth
Currently, Ethernet cards are divided into 10 Mbps, 1000 Mbps, and
Mbps three kinds of bandwidth, the current common three architectures are 10 BaseT, 100basetx and base2, the first two are RJ-45 twisted pair transmission media, bandwidth has 10 Mbps and 100 Mbps respectively. The twisted pair wires are classified into category.
1 to category
Five specifications are available for different purposes and bandwidths. category is usually referred to as Cat. cat5 twisted pair wires can be used for NICs with a bandwidth of 10/100 Mbps. The 10base2 architecture uses a fine coaxial cable as the transmission medium with a bandwidth of only 10 Mbps. The bandwidth 10 or Mbps mentioned here refers to the maximum transmission bandwidth on the network card, and the bandwidth is not equal to the actual transmission speed on the network. The actual speed must take into account the transmission distance and line quality, and whether the network is crowded or not. BPS here refers to the bit transmitted per second (1 byte = 8 bits ). And Mbps is called high-speed Ethernet Card (fast
Ethernet). Most of them are PCI interfaces. Because of its high speed, most of the new local area networks have adopted a Mbps transmission bandwidth, and the trend has gradually replaced 10 Mbps network cards. Currently, PCI NICs on the market have a 10/100 Mbps automatic switch function, which automatically adjusts the network speed based on the network connection environment. 1000
Mbps Ethernet cards are mostly used for high-speed links or backbone between switches or switches and servers.
Differentiate network card types by Interface Type
According to the interface type, the most common interfaces for NICs are ISA interface, PCI interface, USB interface, and PCMCIA Interface for laptops. Currently, the ISA interface Nic adopts 16-bit bus width. Its feature is programmed.
In I/O mode, a small window must be opened on the I/O through the CPU during data transmission, which serves as the communication channel between the network card and the PC and requires a high CPU usage, the transmission efficiency of a large amount of data is poor. The NIC of the PCI interface adopts the 32bit bus bandwidth and the bus
Master Data Transmission Mode. data transmission is controlled by the control chip on the NIC. The CPU usage can be greatly reduced without having to use the I/O port and CPU, currently, most of the products are 10/100 Mbps dual-speed automatic detection and switching of NICs.
Use full/half duplex to differentiate network card types
The Network has half duplex (Half Duplex) and Full Duplex (full
Duplex). half-duplex NICs cannot receive and transmit data at the same time. For example, the network architecture of 10base2 using a thin coaxial cable is a half-duplex network, data can only be transmitted or received at the same time, with low efficiency. To use a full-duplex network, twisted pair wires must be used as transmission lines, and a full-duplex hub must also be used. The network architecture of 10base or 100basetx must be used, of course, Nic is also a full-duplex product.
Differentiate NICs by network physical cable connector
At present, the commonly used network adapter RJ-45 and BNC two types, some network adapter has two types of connectors at the same time, can be applied to the two network cables, but cannot be used at the same time. In addition, there are also network cards with Optical Fiber interfaces, usually with a bandwidth of 1000
Mbps.
Other features wol
Some NICs have the wol function and the wol network startup function (Wake on
Lan ). It can be sent to a computer with a Wol Nic by using software to create a special format information package. After receiving the information package in these special formats, now more and more network adapters support the function of starting the network.
Other NICs
There is also a wireless network adapter on the physical media transmitted over the network, and data is transmitted using a 2-4 GHz radio wave. Currently, IEEE has two specifications: 802.11 and 802.11b. The highest transmission rates are 2 m and 11 m respectively, and interfaces include PCI, USB, and pcmcia.
Iii. Nic Testing Technology
Operating system-based testing
An important performance of NICS is to check whether they support a variety of network operating systems. The popular network operating systems include WindowsNT and Unix (Linux, FreeBSD, SCO, Solaris, and HP protocol), Novell, Dec, etc. At the same time, the Network Adapter should support a variety of network protocols, such as TCP/IP, IPX/SPX, apple, and netbeui.
Host-Based compatibility testing
The compatibility on the hardware is also very important, especially when the compatibility problem on the laptop is prominent. Based on my actual experience, even some famous network cards have serious compatibility problems on some laptops. These problems do not often occur on servers or desktops.
Nic transmission rate test (data throughput)
The transmission rate of the test Nic generally includes two methods: hardware and software. The hardware uses some dedicated instruments such as network analyzer, Smartbits
Smartcards and other devices use ICMP
Echo requests and UDP packets are used to detect data traffic. The following items are usually tested:
Autonegotiation Test
Test Nic rate, full/half duplex, and traffic control negotiation. The negotiation determines whether to use "suspend pause"
Frame to allow traffic control.
ARP Test
Test whether the network adapter can correctly respond to ARP requests and whether to respond within the specified time. This time is set by the tester.
Error Test
This test is usually performed at a low transmission rate (0.5% transmission rate) to test the network adapter's ability to handle frame errors. The test involves the following aspects:
The NIC receives the correct frame and processes it.
When the network adapter receives a frame with a CRC check error, the network adapter discards the frame.
When the network adapter receives a frame with an incorrect transmission order, the network adapter discards the frame.
When the network adapter receives a frame containing a small number of BITs errors, the Network Adapter should receive and process all the frames.
When the NIC receives an ultra-small frame, the NIC should discard it.
When the network adapter receives an ultra-long frame, the Network Adapter should discard it.
Packets Loss Test
RFC requires to test the frame processing capability of the network adapter under various transmission bandwidth utilization rates, from initializing data transmission to constantly changing transmission rates until the transmission ends, and check the frame loss.
Throughput Test
The data throughput test is also a test content specified by RFC. The test results reflect the maximum bandwidth utilization of transmission, the number of frames processed per second, and the number of BITs processed per second.
Back-to-Back Test
This test also sets out the rfc-2544 to test the number of concurrent frames that the NIC can process at a set maximum transfer rate. The maximum number of frames that can be concurrently transmitted without data packet loss.
Software testing usually uses ZD's netmask for testing, and generally only uses it to test the maximum transmission rate of the network card. A network structure and a WindowsNT should be formed during testing.
Server, several Windows9x or WindowsNT
The station client transmits large-capacity files such as 100 Mbps. The test result shows the maximum transfer rate of the NIC. Another test item is to test the NIC's ability to respond to small packet requests. It is necessary to discuss the ping command mechanism of TCP/IP. Ping uses send and receive ICMP
To detect the link status and protocol settings. The data link layer encapsulates a frame with a size of 64 KB ~ Between and, when a frame is sent, the network adapter must first read the MAC address of the Expires header and the suffix when receiving the frame, and then encapsulate the read IP address when the MAC address matches. When the network adapter continuously receives a frame, it must process each frame. When the network adapter or system cannot process these packets, these packets will be discarded. This often happens when a very small frame is continuously sent. Ping sends an ICMP packet and receives an ICMP packet.
Then, send the next ICMP packet. Therefore, a small continuous frame will put a lot of pressure on the NIC and system. In netmask, one test is to test the processing capability of the network adapter or the system for consecutive small packets.
Stability Test
A good network card should have good stability. Specifically, it should have stable performance in different working environments and under different working conditions. Generally, the test mainly involves high temperature and transmission of large files.
High temperature testing is generally in the range of 30 ~ Testing programs running on NICs at 35 degrees Celsius can take more than two hours to check the stability of NICs at high temperatures. PCMCIA interfaces generally have two types of 32-bit and 16-bit NICs. The former is also called the carw.nic, and the data bandwidth increases from 16-bit to 32-bit, this makes PCMCIA's Nic calorific value a significant problem.
Another test is to transmit large files. Some poor network adapters are prone to errors when transferring large-capacity files such as files larger than 2 Gbps.
To sum up, a comprehensive software, hardware, and compatibility test should be conducted when testing a network card. You can select a testing project according to the specific application and different requirements, correctly reflect the performance metrics of the network card.

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.