Linux Network Administrator Manual (3)
2000-07-28 13:14
Publisher: NetBull Readings: 3095 Translation: Zhao Wei GoHigh@shtdu.edu.cn Chapter 3 Configuring Network Hardware 3.1 Devices, Drivers, etc. Now, we have discussed many related network interfaces and general TCP / IP issues. But there is no truly including what happens exactly when "network code" in the kernel accesses a hardware. In this regard, we will briefly discuss the concept of interfaces and drivers. Of course, the first is the hardware itself, such as an Ethernet card: this is an epoxy resin plate, which is spread on a small chip with confused numbers, which is inserted into a slot of your PC. This is the equipment we usually referred to. In order to allow you to use this Ethernet card, your kernel must contain some special functions, which knows how to access the specific method of this device. These are so-called device drivers. For example, Linux has several Ethernet card brand device drivers, which are functionally similar. They are well known as "Becker Series Drivers", with their author of the same name, Donald Becker. Another example is the D-Link driver for processing the D-LINK pocket adapter connected to the parallel port. However, when we say a driver "processing" means? Let's go back to the Ethernet board discussed above. The driver must be able to communicate with some logic circuits on the peripheral board: it must send commands and data on the board, and the board should be able to pass any received data to the driver. Figure 3.1 Driver, interface, and hardware relationship. In the PC, communication is performed by mapping an I / O memory (memory) that maps the register or the like on the board. All commands and data sent to the kernel to the board have passed through these registers. The I / O memory is typically described with a given start address or base address (base address). The Typical base address of the Ethernet board is 0x300, or 0x360. Typically, you don't have to worry about any hardware problem in the base address, because the kernel tries to detect the location of the board on the base address at the time of boot. This is called AutoProbing, which means that the kernel reads several memory locations and compares the data that reads the data if an Ethernet card should be installed. However, some Ethernet cards cannot be automatically detected; this is sometimes encountered when using other manufacturers. Sometimes it is sometimes encountered in the cheap Ethernet board replication according to the standard board. Similarly, when booting, the kernel will only try to detect a Ethernet device. If you use more than one network card, you must clear the network card inform the kernel. Another such parameter you must tell the kernel is an interrupt request channel (Interrupt Request Channel). When the hardware components need to be cared, the operation of the kernel is often interrupt, for example, when the data is coming, or a special case occurs. In a PC, the interrupt can occur on one of the 15 interrupt channels, numbered from 0, 1, and 3 to 15. The interrupt number assigned to one hardware component is called an interrupt request number, or IRQ. [1] As mentioned in Chapter 2, the kernel is accessible through a so-called interface. The interface provides an abstract function (function) set as all hardware types, such as sending or receiving a datagram. The interface is identified by the name. These names are defined in the kernel instead of defined in the device file in the / dev directory. For Ethernet interfaces, typical names are eth0, eth1, and so on. Interface allocation to the device usually depends on the order of configuring devices; for example, the first block installed Ethernet card will become Eth0, the next one will become Eth1, and so on.
An exception to this rule is a SLIP interface, which is dynamically assigned; that is, the serial port assigns an interface for the serial port whenever a SLIP connection is established. The pictures given in Figure 3.1 attempt to display the relationship between hardware, device drivers, and interfaces. When booted, the kernel shows what device detected, and what interface it has installed. Below is an excerpt of a typical boot screen:.. This Processor Honours The WP bit even when in supervisor mode. Good. Floppy Drive (s): fd0 IS 1.44M Swansea University Computer Society Net3.010 IP Protocols: ICMP, UDP, TCP PPP: version 0.2.1 (4 channels) OPTIMIZE_FLAGS TCP compression code copyright 1989 Regents of the University of California PPP line discipline registered SLIP:. version 0.7.5 (4 channels) CSLIP: code copyright 1989 Regents of the University of California Dl0: D-Link DE-600 Pocket Adapter, Ethernet Address: 00: 80: C8: 71: 76: 95 Checking 386/387 Coupling ... OK, FPU Using Exception 16 Error Reporting. Linux Version 1.1.11 (Okir @ monad) # 3 SAT May 7 14:57:18 Met DST 1994 This indicates that the kernel is compiled in a state of TCP / IP activation and includes SLIP, CSLIP, and PPP drivers. The countdown third line note detected a D-Link Pocket Adapter and installed as an interface DL0. If you have a different type of Ethernet card, the kernel usually prints a line of information starting with Eth0, which is next to the type of card detected. If an Ethernet card has been installed, but did not see any such message, which means that the kernel does not detect your network card correctly. This will be discussed in a later section. 3.2 Most Linux versions of the kernel with boot boot disk, which can be used on all common PC types. This indicates that the kernel on those discs is configured into all kinds of drivers, some of which you will never use, but they will waste valuable system memory, because some kernels cannot be exchanged. Therefore, you usually configure your own kernel, including those that you actually need or want. When running a Linux system, you should be familiar with the establishment of the kernel. The basic principle of this work explains in Matt Welsh's "Installation and Getting Started" manual. This manual is also a copy of the document plan series. Therefore, in this section, we will only discuss those configuration options that affect the network. When you run make config, you will first ask some normal configurations, for example, if you need kernel mathematical simulation, and so on. One of these inquiry is to ask if you want TCP / IP network support. You must answer with Y to get a kernel that supports the network. 3.2.1 LINUX 1.0 and the above version of the kernel options are completed in the normal option section, the configuration will continue to ask you various features, such as SCSI drivers, and more. The issues related to network support are then listed. Due to the developmental development development, the exact configuration option set is in non-stop.
A typical option list provided by most 1.0 to 1.1 kernel versions look like this (annotation with oblique body): * * NetWork Device Support * NetWork device support? (Config_ethercards) [Y] Regardless of the macro name in square brackets ( What is Macro Name? If you want to use any type of networking device, you must answer this question with Y, regardless of whether it is Ethernet, SLIP, or PPP. When you answer this question with Y, the support of Ethernet type devices is automatically activated. Support for other network driver types must be activated: SLIP (SLIP Compressed Headers (SL_COMPRESSED) [Y] PPP (Point-to-Point) Support (Config_ppp) [Y] PLIP (Parallel Port) Support (config_plip) [n] These issues involve various link layer protocols supported by Linux. SLIP allows you to transfer IP datagrams on the serial line. The compressed first option provides support for CSLIP, a technique that compresses TCP / IP headers into only three bytes. This kernel option does not automatically open CSLIP, which only provides the desired kernel function. PPP is another protocol that transmits network traffic on the serial line. It is more flexible than SLIP, and is not limited to IP, and once development is completed, IPX will also be supported. Since PPP support is only completed recently, this option may not appear in your kernel. PLIP provides a method of issuing an IP datagram on a parallel port connection. It is mainly used to communicate with the PC running DOS. The following problems involve Ethernet cards of individual suppliers. As more drivers are developed, you are likely to see more problems to be added. If you want to build a kernel that can be used in many different machines, you can activate more than one driver. NE2000 / NE1000 support (CONFIG_NE2000) [y] WD80 * 3 support (CONFIG_WD80x3) [n] SMC Ultra support (CONFIG_ULTRA) [n] 3c501 support (CONFIG_EL1) [n] 3c503 support (CONFIG_EL2) [n] 3c509 / 3c579 support ( CONFIG_EL3) [N] HP PCLAN Support (config_hplan) [N] AT1500 and NE2100 (Lance and PCNET-ISA) Support (config_lance) [N] AT1700 Support (config_at1700) [N] DEPCA Support (config_DEPCA) [N] D-LINK DE600 POCKET Adaptor Support (config_de600) [Y] At-lan-tec / realtek poket adaptor support (config_atp) [n] * * CD-ROM Drivers * ... Finally, in the file system section, the configuration script will ask you if you need to support NFS, network file system. NFS allows you to output a file system to several hosts, which makes files show like they are on a regular hard drive of the host. NFS FILESYSTEM Support (config_nfs_fs) [Y] 3.2.2 Linux 1.1.14 and the above version of the kernel option starts from Linux 1.1.14, (where ALPHA support for IPX) is added, and the configuration process changes slightly. In the normal option section, you will now ask if you need universal network support. This issue is immediately a few various network option issues.
* NetWorking Options * TCP / IP Networking (config_inet) [Y] In order to use the TCP / IP network, you must answer this question with y. However, if you answer N, you will still compile the kernel supporting IPX. IP forwarding / gatewaying (config_ip_forward) [N] You must activate this option, if your system will run between two Ethernet, or between any Ethernet and SLIP links as a gateway. Despite the default activation of this option and harmless, you may want to disable this option to configure the host into a so-called firewall (FireWall). The firewall is a host that connects two or more networks, but is not routed between networks. They are usually used to provide Internet access for users of the company's network to the internet. The user will be allowed to log in to the firewall and use the Internet service, but the company's machine will be protected from an external attack because any entry connection cannot pass the firewall. * * (IT IS SAFE TO Leave these Untouched * PC / TCP Compatibility Mode (config_inet_pctcp) [N] This option is used to compensate for the incompatibility with some PC / TCP versions, a TCP on DOS-based PC / IP commercial version. If you activate this option, you will still communicate with normal machines, but performance in slow connection may be affected. Reverse arp (config_inet_rarp) [n] This feature activates RARP, reverse address resolution protocol. RARP is used for diskless customers and X terminals, i.e., for querying their IP addresses when booted. This option is only activated when you plan to serve these customer services. The latest network kit (NET-0.32D) includes a gadget name to RARP, which allows you to add the system to the RARP buffer. Assume SubNets Are Local (config_inet_snarl) [Y] When transmitting data over TCP, the kernel must divide the data stream into several packets between delivery to IP. For hosts that can be reached through local networks, such as Ethernet, a large packet will be used, and a slightly smaller packet is used for hosts to connect through long distances. [2] If you don't activate Snarl, the kernel will assume that only the network that actually has an interface connection is local. However, if you consider the Class B network of Groucho Marx, the entire B network is local, but most hosts have only one or two subnet interfaces. If you activate Snarl, the kernel will assume that all subnets are local and all the subnets are local and use big packets. If you really want to use a bag that is smaller than a larger packet length to transfer data to a special host (for example, because the data is to pass the SLIP connection), you can use the Route's MTU option, which will summary in this chapter . Disable Nagle Algorithm (Normally Enabled) [N] Nagle Rules A heuristic avoidance of a particularly small IP package is also a tinygrams. Micro reports are typically created by interactive network tools, which typically only deliver a single keystroke, such as Telnet or RSH. Micro reports on low bandwidth, such as SLIP, may become particularly wasted. Nagle Algorithm Attempts to temporarily suppress transmission of TCP data in some cases to avoid this problem. You only disable the Nagle algorithm when you encounter a serious packet loss problem. The ipx protocol (config_ipx) [N] This activates the support of IPX, and the transfer protocol used for Novell network.
This feature is still in development, and there is nothing to use. The advantage of using it is that you can exchange data with IPX-based DOS utilities and route traffic between Novel-based networks through a PPP link. Support for Novell Network High-level protocols has not been eyebrows, because these protocols are only available for terrible high prices and can be obtained under an agreement that cannot be leaked. From the 1.1.16 kernel, Linux supports another driver type, the virtual [Pseudo] (Dummy) driver. The following problems appear in the beginning of the device driver section. Dummy Net Driver Support (config_dummy) [Y] The virtual driver actually does not do a lot of things, but it is useful for stand-alone (not connected) or SLIP hosts. It is basically a camouflage return interface. The reason for this type of interface is to have a SLIP without an Ethernet host, you have to have an interface that has always been burdening your IP address. This will discuss further discussions in the virtual interface in Chapter 5. 3.3 Linux Network Device List Linux kernel supports many hardware drivers of many various device types. This section gives a brief overview of existing driver families, as well as the interface name they use. In Linux, there are many standard names in the interface, now in the following. Many drivers support multiple interfaces, in which case the interface is compiled, such as Eth0, EHT1, etc. LO local return interface. It is used to test purposes, as well as several network programs. It works like a closed circuit, and any datagram sent to it will be immediately returned to the network layer of the host. There is always a return device in the kernel, and there are several or more almost meaningless. Ehes N Ethernet Card. This is a normal interface name of most Ethernet cards. DLN These interfaces access D-Link DE-600 pocket adapter is another Ethernet device. It has a special place that DE-600 is driven by parallel ports. SLN Nth SLIP interface. The SLIP interface is related to the order of the SLIP, related to the serial line; for example, the first serial line configured to SLIP becomes SL0, and so on. The kernel supports up to four SLIP interfaces. PPP Nth PPP interface. As the SLIP interface. A PPP interface is associated with a serial line that converts a PPP mode. Currently, up to four interfaces. PLIPN Nth PLIP interface. PLIP transmits IP datagram on a parallelline. At the same time, three PLIP interfaces can be supported. They are allocated by the PLIP driver when the system boot starts and is mapped to the parallel port. For other interface drivers that may be added in the future, ISDN, or AX.25 will introduce other names. IPX drivers (Novell's network protocol), and AX.25 (for amateur radio enthusiasts) are in the development phase, still in the alpha phase. In the following section, we will discuss details using the above drivers. 3.4 Ethernet installation The current Linux network code supports various brands of Ethernet cards. Most drivers are prepared by Danald Becker (Becker@cesdis.gsfc.nasa.gov), which has prepared a driver for NICs based on national semiconductor-8390 chips; these have been known as a Becker series driver . There are also a few drivers of D-Link products, where D-Link's pocket adapter allows you to access an Ethernet through a parallel port. This driver is compiled by bjørn ekwall (bj0rn@blox.se). The DEPCA driver is compiled by David C. Davies (Davies@wanton.lkg.dec.com). 3.4.1 Ethernet cable If you are the first time to install Ethernet, you will be relatively appropriate.
Ethernet network is very discerning the cable. The two ends of the cable must be used with a 50 ohm resistor, and there is no branch (i.e., three cables are connected to a star). If you use a fine coaxial cable and a T-BNC connector, these connections must be directly rotated on the connector of the NIC; you can't insert a cable. If you are connected to a crude cable, you must connect the host through a transceiver to the web (sometimes called an Ethernet attachment unit). You can directly insert the transceiver into the 15-pin AUI port of the NIC, but you can use a shielded cable. 3.4.2 Supported boards There is a full list of support cards in Ethernet Howtos, which is delivered to comp.OS.Linux.announce monthly monthly. [3] The following is a list of a widely known board supported by Linux. The actual length of the list in HOWTO has about three times longer. However, even if you find your network card in this list, you still have to check the Howto document first; sometimes it includes important details of these network card operations. A related occasion is that certain DMA-based Ethernet cards are the same as DMA with the default DMA channel of the Adaptec 1542 SCSI controller. At this point, the Ethernet card will write the packet data to your hard drive, so that you nerves Tight! 3COM EtherLINK 3C503 and 3C503 / 16 are supported, and 3C507 and 3C509 are also supported. Also support 3C501, but it is too slow, not worth buying. Novell Eagle NE1000 and NE2000, as well as a wide variety of imitation. NE1500 and NE2100 are also supported. Western Digital / SMC WD8003 and WD8013 (same as SMC ELITE and SMC Elite Plus) support, the same support new SMC Elite 16 Ultra. Hewlett Packard HP 27252, HP 27247B, and HP J2405A. D-LINK DE-600 Pocket Adaptors, DE-100, DE-200, and DE-220-T. There is also a patch for DE-650-T, which is a PCMCIA card [4]. DEC DE200 (32K / 64K), DE202, DE100, and DEPCA REV E. Allied Teliesis AT1500 and AT1700. To use one of these NICs in Linux, you can use a precompiled kernel from the primary Linux release. Usually these drivers are compiled into the kernel. For the long run, it is best to configure your own kernel and compile the driver you actually use into the kernel. 3.4.3 Automatic Detection (Probe) of Ethernet Card When boot, Ethernet program code will try to locate your network card and determine its type. The network card is detected in the following address and sequence. Board Addresses probed for WD / SMC SMC 16 Ultra 3c501 3c503 NEx000 HP DEPCA 0x300, 0x280, 0x380, 0x240 0x300, 0x280 0x280 0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2a0, 0x2e0 0x300, 0x280, 0x320, 0x340, 0x360 0x300, 0x320, 0x340, 0x280, 0x2c0, 0x200, 0x240 0x300, 0x320, 0x340, 0x360 automatic detection code exists in two limitations. First, it is not able to correctly identify the network card. Especially for those big roadbed boards that are very cheap currency (imitation) will not be recognized. Some WD80X3 boards also can't be detected.
The second question is that the kernel cannot automatically detect more than one network card at this time. This is a feature because the kernel assumes that you want to control which piece of the card is assigned. If you are using multiple network cards, or automatic detection does not detect your network card, you must explicitly tell the core of the base address and name of the network card. In Net-3, you can have two different solutions to do this. One method is to change or increase information in the driver / net / space.c file of the kernel code. This method is recommended when you are very familiar with the network code. A better way is to provide this information to the kernel during system boot. If you start your system with Lilo, you can pass to the kernel by specifying these parameters in lilo.conf. In order to notify the kernel about an Ethernet device, you can pass the following parameters: ether = IRQ, base_ addr, param1, param2, name the first four parameters of Name are digital, and the last one is the device name. All digital values are optional; if omitted or set zero, the kernel will try to detect these values or use a default. The first parameter setting is assigned to the IRQ of the device. By default, the kernel will automatically detect the IRQ channel of the device. The 3C503 driver has a special feature that can select an unused IRQ from 5, 9, 3, and 4, and configure the network card to use this interrupt. The base_addr parameter gives the I / O base address of the NIC; zero value indicates that the kernel probe is listed above the address. The remaining two parameters have different uses for different drivers. For shared memory boards, such as WD30X3, they specify the initiation and end address of the shared memory area. Other network cards typically use Param1 to set the level of debugging information to display. Values 1 to 7 indicate the length of the display information, but 8 is displayed by closing all information; 0 means using the default value. 3C503 uses PARAM2 to select an internal transceiver (default) or an external transceiver (set to 1). The former uses the BNC connector on the board; the latter uses the AUI port on the board. If you have two Ethernet cards, you can let Linux automatically detect a piece, and use LILO to pass the parameters of the second board to the kernel. However, you must be sure that the driver does not accidentally find the second board, otherwise the other network card will not be registered at all. You can add a RESERVE option to LILO, which explicitly informs the kernel to avoid detecting the I / O space occupied by the second block of NIC. For example, in order to install the second Ethernet card as Eth1, you should pass the following parameters to the kernel: reserve = 0x300, 32 ether = 0, 0x300, and the eth1 reserve option determines when a device is detected, no The device driver accesses the I / O space of this board. You can also use kernel parameters to override automatic detection of ETH0. Reverse = 0x340, 32 ether = 0, 0x340, ETH0 In order to completely turn off automatic detection, you can specify base_addr to -1: ether = 0, -1, and Eth0 3.5 PLIP driver PLIP represents parallel line IP (Parallel line IP), and This is a cheap way when you just want to connect two machines. It uses a parallel port and a special cable that can reach 10kbps to 20kbps. PLIP was originally developed by CryNWR. Its design is quite straightforward (or creative): For a long time, the parallel port on the PC is only used as a one-way printer port; that is, 8 data lines can only be used from PC Send data to the peripheral instead of reverse use.
PLIP achieves the purpose by using the five state lines of the port, which limits it only by half byte (HALF BYTES) to transmit all data. This mode of operation is called mode zero PLIP. Today, these one-way ports are no longer widely used. Therefore, there is a PLIP extension called mode 1, which uses a full 8-bit interface. Currently, Linux only supports mode 0. Not like an earlier version of PLIP code, it is now trying to implement with CryNWR's PLIP, and the PLIP driver in the NCSA Telnet is compatible. [5] In order to connect two machines with a PLIP, you need a special cable to be sold as "NULL Printer" or "Turbo Laplink" in some stores. However, you can easily make yourself. Appendix A shows how to make it. Linux's PLIP driver is almost countless work results. It is currently maintained by Niibe Yutaka. If it is compiled into the kernel, it will set a network interface for each possible printer port, and PLIP0 corresponds to the parallel port LP0, and PLIP1 corresponds to LP1, and the like. The map currently interface-port mapping is this: Interface I / O Port IRQ PLIP0 PLIP1 PLIP2 0x3BC 0x378 0x278 7 7 5 If you have configured your printer into a different way, you must change in Linux core Code Drivers / The value in Net / Space.c and establishes a new kernel. However, this mapping is not to say that you can't use these parallel ports like usually. They are only accessed by the PLIP driver only if the corresponding interface is configured. 3.6 SLIP and PPP Driver SLIP (Serial Line IP), PPP (Point-to-Point Protocol) is a wide range of use of IP-packets on a serial line link Agreement. Many organizations provide SLIP and PPP dial-up access to the machine on the interconnect, which provides IP connectivity for individuals (this is difficult to use other methods). In order to run SLIP or PPP, you can use any serial port without modifying the hardware; you can use any serial port. Since the configuration of the serial port is independent of the TCP / IP network, it will be discussed in the independent chapter. See Chapter 4, please refer to the details. Note [1] IRQS 2 and 9 are the same because the PC has two laminated interrupt processors, each processor has eight IRQs; the second processor is connected to the IRQ-2 of the first processor. . [2] This is to avoid fragments produced by a very small maximum package length. [3] You can contact Paul with gpg109@rsphysse.rantu.edu.au. [4] It can be obtained from the Packages / Laptops of TSX-11.Mit.edu, along with other software related to the portable. [5] NCSA Telnet is a popular program of DOS, running TCP / IP on Ethernet or PLIP, and supports Telnet and FTP. source:
Linux free pigeon