3 IP: Internet Agreement
3.1 Introduction IP is the most core protocol in the TCP / IP protocol. All TCP, UDP, ICMP, and IGMP data are transmitted in IP datagram (Figure 1.4). Many people who have just started to contact TCP / IP provide unreliable, unconnected datagram, especially those with X.25 or SNA background knowledge. Unreliable means that it does not guarantee that IP data is successfully reached to destinations. IP only provides the best transmission service. If something happens, if a router temporarily runs out of the buffer, IP has a simple error handling algorithm: discard the datagram, and then send ICMP messages to the source. Any requiring reliability must be provided (such as TCP). ConnectionLess This term means that IP does not maintain any status information about subsequent dartes. The processing of each datagram is independent of each other. This also shows that the IP datagram may not be received in the sequence of transmission. If a source of trust sends two consecutive datagches (first A, then B), each datagon is independently routing, which may choose a different route, so B may arrive before A Arrivals. In this chapter, we will briefly introduce the various fields in the IP head, discuss the IP routing and related content of the subnet. We also introduce two useful commands: ifconfig and NetStat. Regarding the details of some fields in the IP head, we will stay in later use of these fields to discuss again. RFC 791 [Postel 1981a] is an official status file for IP.
3.2 The format of the IP header IP datagram is shown in Figure 3.1. Ordinary IP headers are 20 bytes unless the option field is included.
Figure 3.1 IP datagram format and various fields in the first part
Let's analyze the head in Figure 3.1. The highest bit is on the left, remembers 0 bit, the lowest bit is on the right, and it is recorded as 31 bit. The 4 bytes of 32 bit values are transmitted in the following: The first is 0-7 bit, followed by 8-15 bit, then 16-23 bit, the last 24-31 bit. This transmission order is called a BIG Endian byte order. Since all binary integers in the TCP / IP head requires this order when transmitting in the network, it is also called a network byte order. To store binary integers in other forms, such as the Little Endian format, you must convert the head into a network byte order before transferring data. The current protocol version number is 4, so IP is sometimes referred to as IPv4.3.10 will discuss a new version of IP protocol. The first length refers to the number of 32 bit words, including any preliminary options. Since it is a 4-bit field, the head is up to 60 bytes. In Chapter 8, we will see this restriction that certain options such as routing options are not used in today. Ordinary IP Datasters (without any option) The value of this field is 5. The Service Type (TOS) field includes a 3-bit priority field (now Ignore), 4 bit of TOS subfield, and 1 bit unused bit, but must set up 0.4 bit of TOS representative: Minimum time delay , Maximum throughput, maximum reliability, minimum cost. 4 Bit can only be placed in 1 bit. If all 4 bits are 0, then it means a general service. RFC 1340 [Reynolds and Postel 1992] describes how all standard applications set these service types. RFC 1349 [Almquist 1992] is amended to the RFC and describes the characteristics of TOS in more detail. Figure 3.2 lists TOS values for different application recommendations. In the last column, we give a hexadecimal value because this is the tcpdump command output after we will see later. Figure 3.2 Service Type Field Recommended Value
Two interactions of Telnet and Rlogin requires minimal transmission delays because people mainly use them to transmit small amounts of interaction data. On the other hand, FTP file transmission requires maximum throughput. The highest reliability is specified to network management (SNMP) and routing protocols. User Network News (NNTP) is the only application that requires minimum cost. Most of the TCP / IP implementations do not support TOS features, but the new system after 4.3BSD RENO is set. In addition, new routing protocols such as OSPF and IS-IS are routing based on the values of these fields.
(The following is the original book P.351 translation) In Section 2.10, we mentioned that SLIP generally provides service-based queuing methods, allowing the interactive communication data to be processed prior to processing large block data. Since most implementations do not use the TOS field, this queuing mechanism is judged and processed by the SLIP. The driver first view the protocol field (determine if it is a TCP segment), then check the port number of the TCP source and the resource number. To determine if it is an interactive service. The annotation of a driver thinks that this "disgusting process method" is required because most implementations do not allow the application to set the TOS field. The total length field refers to the length of the entire IP datagram, in bytes. With the header length field and the total length field, we can know the starting position and length of the data content in the IP datagram. Due to the length of 16 bits, the IP dataginary is up to 65535 bytes. (Recalling Figure 2.5, super channel MTU is 65535. It means that it is not a real MTU - it uses the longest IP datagram.) When the datagram is fragmented, the value of this field also changes This will be further described in Section 11.5. Although an IP datagram for 65535 bytes can be transferred, most of the link layers can be sharpen them. Moreover, the host also requires a datagram that cannot receive more than 576 bytes. Since TCP divides user data into several pieces, this limit does not affect TCP. We will encounter a large number of applications (RIP, TFTP, BootP, DNS, and SNMP), which limits the user's data report length of 512 bytes, and less than 576 bytes. However, in fact, most implementations (especially those that support network file systems, NFS implementation) allow for more than 8192 bytes of IP datagrams. The total length field is the necessary content in the IP head, as some data links (such as Ethernet) need to populate some data to achieve the minimum length. Although the minimum frame length of the Ethernet is 46 bytes (Fig. 2.1), IP data may be shorter. If there is no total field, then the IP layer does not know how much is the content of IP datagram in 46 bytes. Identification field uniquely identifies each datastist sent by the host. Usually, each time a message is sent, it will be plus 1. We will discuss it in detail when we introduce fragmentation and reorganization in Section 11.5. Similarly, we will analyze the logo fields and slice offset fields when discussing fragmentation. (The following is the original book P.361) RFC 791 [Postel 1981A] Think that the identification field should be selected by the upper layer of the IP to send the datagram. It is assumed that there are two consecutive IP datagrams, one of which is generated by TCP, and the other is generated by UDP, then they may have the same identification field. Although this can also work as usual (by the reorganization algorithm), most of the IP layer is added to the system from Berkeley, each time the IP datagram is sent, and the value of the core variable is added 1, regardless of the handing IP. Which layer is from which the data comes from. The initial value of the kernel variable is set according to the time of the system boot.
The Time-to-Live "TTL sets the maximum number of routers that the datagram can pass. It specifies the time of life of the datagram. The initial value of the TTL is set by the source host (usually 32 or 64). Once a router processes its router, its value minus 1. When the value of this field is 0, the datagram is discarded and transmits an ICMP packet notification source host. Chapter 8 We discuss the Traceroute program will come back to discuss this field. We have discussed the protocol field in Chapter 1 and showing how it is used by IP to divide the datagram in Figure 1.8. Depending on which protocol can be identified to IP. The first inspection and field is based on the inspection and code calculated by the IP head. It does not calculate the data behind the head. ICMP, IGMP, UDP, and TCP contain simultaneously cover the head and data inspection and code simultaneously in their respective headings. In order to calculate the IP inspection of a datagram, first set the inspection and field to 0. Then, the binary counter code of each 16 BIT in the head is summed (the entire head is consisting of a string of 16 bit), and the results exist in the inspection and field. After receiving an IP datagram, the binary counter code of each 16 bit in the head is also summed. Since the club contains the inspection of the hammer in the calculation process, the header does not have any errors during the transmission process, and the results of the recipe should be all 1. If the result is not all 1 (ie, the inspection and error), then IP will discard the received datagram. However, do not generate an error message, and the lost datagram is discovered and retransmitted. Both ICMP, IGMP, UDP, and TCP use the same inspection and algorithm, although TCP and UDP are in addition to its own head and data, different fields are also included in the IP header. There is a implementation technology for how to calculate the Internet inspection and implementation in RFC 1071 [BRAMAN AND Patridge 1988]. Since the router often only modifies the TTL field (minus 1), it can increase its inspection when the router forwards a message, and does not need to be recalculated on the entire header of IP. RFC 1141 [MALLORY AND KULLBERG 1990] gives this a very effective way. (The following is a translation of the original book P.371) However, the standard BSD implementation is not to adopt this increase in the forwarding of the data report.
Each IP datag report contains the source IP address and the destination IP address. We said in a section 1.4, they are all values for 32 bits. The last field is optional, which is a growing optional information in the datagram. Currently, these options are defined as follows: · Safety and processing restrictions (for military fields, see RFC 1108 [Kent 1991]) · Recording path (let each router record its IP address, see Section 7.3) · Timestamp (Let each router record its IP address and time, see Section 7.4) · Loose source station selection (specify a series of IP addresses to the Data), see 8.5) · Strict source station Look (similar to the loose source selection, but it is required to pass through the specified address, can not pass through other addresses). These options are rarely used, not all hosts and routers support these options. Options fields have always been used as boundaries with 32 bits, and the fill bytes of 0 are inserted when necessary. This ensures that the IP header is always an integer multiple of 32 bit (this is required by the header length field).
3.3 IP routing selection is conceptually, IP routing is simple, especially for hosts. If the destination host is connected directly to the source host (such as point-to-point link) or on a shared network (Ethernet or token ring network), the IP datagram is sent directly to the destination host. Otherwise, the host has reported the data to a default router, and is forwarded by the router. Most hosts use this simple mechanism. In this section and Chapter 9, we will discuss more general, that is, the IP layer can be configured as a router function, or the function of the host. Most of today's multi-user systems, including almost all UNIX systems, can be configured as a router. We can specify a simple routing algorithm that can be used by the host and router. The fundamentally differentiated is that the host never forwards the datagram from an interface to another, and the router is forwarded to the datagram. The host containing router functions should never forward datagrams unless it is set. In a section 9.4, we will further discuss the relevant issues of configuration. In a general system, IP can receive a datagram (i.e., a localized datagram), or transmit, or transmitted from a network interface, or a data report to be forwarded from a network interface. The IP layer has a routing table in the inner layer. When you receive a datagram, it is necessary to search for the table. When the data is from a network interface, IP first checks if the destination IP address is one of the IP addresses of the unit or IP broadcast address. If this is true, the datagram is sent to the protocol module specified by the IP header protocol field. If the purpose of the datagram is not these addresses, (1) If the IP layer is set to the router, the datagram is forwarded (that is, the data reported below) is as follows, otherwise (2) Data report was discarded. Each of the routing tables contains the following information: • Destination IP address. It can be a complete host address, or a network address, which is specified by the flag field in the table (described below). The host address has a non-0 host number (Figure 1.5) to specify a particular host, and the host number in the network address is 0 to specify all hosts in the network (such as Ethernet, token ring network). · The next stop (or next hop) the IP address of the next-hop router, or has a direct connection network IP address. The next router refers to a router on the network directly, and it can forward the datagram. The next stop router is not the final purpose, but it can forward our datagram to the ultimate goal. · Sign. One of the signs indicated that the IP address is the network address or the host address, and the other flag indicates whether the next router is a real next stop router, or a direct connected interface. (We will introduce these symbols in section 9.2.) · Specify a network interface for the transfer of datagrams.
IP routing is performed on hop-by-hop. As can be seen from this routing table, IP does not know the full path to any purpose (of course, except for the purpose directly connected to the host). All IP routing options only provide the IP address of the next router for datagram. It assumes that the next router is closer to the host than the host sent, and the next router is directly connected to the host. IP routing mainly completes the following features: 1. Search routing tables, find out which enumerations that can be fully matched with the destination IP address (the network number and host number must be matched). If found, send the packet to the next stop router or a direct connection to the next station (depending on the value of the flag field). 2. Search routing tables and find out which meets with the destination network number. If found, send the packet to the next stop router or a direct connection to the next station (depending on the value of the flag field). All hosts on the destination network can be disposed of this expression. For example, all hosts on an Ethernet are treated by this expression. This matching method of this search network must consider a possible subnet mask. We will discuss this in the next section. 3. Search routing tables, look for representations that are labeled "default". If found, send the message to the next station router specified by the message. If these steps above are not successful, then the datagram cannot be transmitted. If the dataginary report from this unit is from this unit, then a "host unreachable" or "network is unreachable" will be returned to the generated datagram. The full host address matches before the network number matches. Only when they fail, choose the default route. The default router, and the ICMP indirect packet sent by the next stop (if we select the wrong default route for the datagram), it is a powerful feature in the IP routing mechanism. We discuss them in Chapter 9. Specify a router for a network without having to specify a router for each host, which is another basic feature of the IP routing mechanism. This can greatly reduce the scale of the routing table, such as the router on the Internet, there is only a few thousand ages, not more than 1 million representations. Example first considers a simple example: Our host BSDI has an IP datagram to send to the host Sun. Both sides are on the same Ethernet (see Figure for inside the cover). The transfer process of the datagram is shown in Figure 3.3. When IP receives this data report from a certain upper layer, it searches for routing tables, discovered that the purpose IP address (140.252.13.133) is on a direct connected network (Ethernet 140.252.13.0). Thus, find the matching network address in the table. (In the next section, we will see that due to the existence of the subnet mask of the Ethernet, the actual network address is 140.252.13.32, but this does not affect the route selection discussed here.) Data report is sent to Ether The network driver is then sent to the Sun host as an Ethernet data frame (Fig. 2.1). The destination address in the IP datagram is Sun's IP address (140.252.13.33), and the destination address in the link layer header is the Ethernet interface address of the Sun host of 48 bit. This 48 Bit's Ethernet address is obtained with the ARP protocol, and we will describe this in the next chapter.
Figure 3.3 Datashers Transfer Process from Host BSDI to Sun
Now let's look at another example: Host BSDI has an IP datagram to pass on the FTP.UU.NET host, and its IP address is 192.48.96.9. The first three routers passed are shown in Figure 3.4. First, the host BSDI search the routing table, but does not find the representation of the host address or network address, so it can only be passed to the next station router with the default expression, that is, the host Sun. When the datagram is transmitted from BSDI to the Sun host, the destination IP address is the final sink address (192.48.96.9), but the link layer address is an Ethernet interface address of the Sun host. This is different from Figure 3.3, where the destination IP address and destination link layer address in the datagram are referred to as the same host (Sun). When Sun receives the data report, it discovers the destination IP address of the datagram is not an address of the unit, and the Sun has been set to have the function of the router, so it forwards the datagram. After searching the routing table, the default expression is selected. According to the default representation of Sun, it forwards the datagram to the next stop router NetB, the address of the router is 140.252.1.183. The datagram is transmitted through the point-to-point SLIP link, which has the minimum package format shown in Figure 2.2. Here, we did not give the first part of the Ethernet link layer data frame because there is no such head in the SLIP link. When Netb receives the data report, it performs the same steps as the Sun host: The destination address of the datagram is not a native address, and Netb is also set to have a function of the router, so it also forwards the datagram. It is also the default route representation, and the data is sent to the next router Gateway (140.252.1.4). The host NetB located on Ethernet 140.252.1 obtains 48 Bit Ethernet addresses corresponding to 140.252.1.4. This Ethernet address is the destination address on the link layer data frame. Router Gateway also performs the same steps as the previous two routers. Its default router IP address specified by the default routing expression is 140.252.104.2. (We will confirm in Figure 8.4, when using the Traceroute program, it is the next router used by Gateway.) For this example we need to point out some key points: 1. All hosts and routers in this example use the default route . In fact, most hosts and some routers can handle any purposes with the default route unless it is on local LAN. Figure 3.4 Initial path from BSDI to FTP.UU.NET (192.48.96.9)
2. The destination IP address in the datagram does not change any changes. (In Section 8.5, we will see that the destination IP address can only be modified only when using the source routing option, but this situation rarely appears.) All routing decisions are based on this destination IP address. 3. Each link layer may have a different data frame header, and the destination address of the link layer (if any) always refers to the link layer address of the next station. In our example, two Ethernet encapsulate the first link layer of the next Ethernet address, but the SLIP link is not doing this. Ethernet address is generally obtained by ARP. In Chapter 9, we will discuss the IP routing problem after describing ICMP. We will see some examples of routing tables, and how to use them to make routing decisions.
3.4 Subnet Addressing All Hosts Requirements Support Subnet Address (RFC 950 [Mogul and Postel 1985]). It is not consisting of the IP address as a simple network number and a host number, but the host number is divided into one subnet number and a host number. The reason is because the A class and class B address are allocated with too much space for the host number, and the number of hosts 224-2 and 216-2 can be accommodated. In fact, people don't arrange so many hosts in a network. (The format of various IP addresses is shown in Figure 1.5.) Due to the host number of all 0 or all 1, we subtract the total number 2. After the IP network number is obtained in the Internet, the local system administrator is assigned, and he (or her) decides whether to build a subnet, and allocate how much bit to subnet and host number. For example, there is a Class B network address (140.252), in the remaining 16 bit, 8 bit is used for subnet numbers, 8 Bit is used for host number, and the format is shown in Figure 3.5. This allows 254 subnets, and each subnet can have 254 hosts. Figure 3.5 A subnet address of class B address
Many administrators adopt a natural division method, that is, the first 8 bit of the 16 bit left in the B class address as the subnet address, and then 8 bit as the host number. This can be easier to determine the subnet number by using the IP address represented by a duty decimal method. However, there is no requirement A-class or Class B address to divide the boundaries in bytes. Most subnet examples are Class B addresses. In fact, the subnet can also be used for C class addresses, but it is less than the number of specifics. A subnet example of a class A address is very little because the A class address itself is very small. (However, most A class addresses are divided into subnet.) The subnet hides the internal network organization (a campus or company interior) for external routers. In our web example, all IP addresses have a B network number 140.252. But there are more than 30 subnets, more than 400 hosts are distributed in these subnets. The Internet is provided by a router, as shown in Figure 3.6. In this figure, we numbered most routers to RN, n is a subnet number. We gave a router that connects to these subnets, as well as nine systems in the seal two figures. In the figure, the Ethernet is represented by a thick line, and the point-to-point link is represented by a dotted line. We didn't draw all the hosts in different subnets. For example, on subnet 140.252.3, more than 50 hosts, and more than 100 hosts in subnet 140.252.1. Compared to 30 Class C addresses, the advantage of using a Class B address containing 30 subnets is that it can narrow the size of the Internet routing table. Class B address 140.252 The fact that is divided into several subnets is transparent to Internet routers other than all subnets. In order to reach the host of the IP address start section 140.252, the external router only needs to know the path to IP address 140.252.104.1. That is to say, only a routing expression for the network 140.252, and 30 routing expressions are required if 30 Class C addresses are used. Therefore, the subnet divides the scale of the routing table. (In section 10.8, we will introduce a new technology, which can reduce the size of the routing table using Class C addresses.)
Figure 3.6 Most subnet arrangements in NOAO.EDU (140.252)
The subnet is opaque to the router inside the subnet. As shown in Figure 3.6, a datagram from the Internet arrived at Gateway, and its destination address is 140.252.57.1. The router Gateway needs to know that the subnet number is 57, then send it to KPNO. Similarly, KPNO must report the data to the R55, and finally the R55 is sent to the R57.3.5 Subnet Mask Any part of any host in boot is to specify the host IP address. Most systems are read when the IP address is available in a disk file. In Chapter 5 we will discuss how a diskless system gets an IP address when booting. In addition to the IP address, the host also needs to know how many bits are used for subnet numbers and how much bits are used for host numbers. This is also determined by the subnet mask during the boot process. This mask is a value of 32 bits, where the value is 1 bit left to the network number and subnet number, and the bit of 0 is left to the host number. Figure 3.7 is two different subnet masks formats for Class B addresses. The first example is the subnet division method used by the NOAO.EDU network, as shown in Figure 3.5, the subnet number and host number are 8 Bit wide. The second example is a class B address divided into 10 bit of subnet number and 6 bit of 6 bit.
Figure 3.7 Two different Class B address subnet mask examples
Although the IP address is generally expressed in a decimal decimal method, the subnet mask is often expressed by hexadecimal, especially when the boundary is not one byte, because the subnet mask is a bit mask. After a given IP address and subnet mask, the host can determine the purpose of the IP datagram that: (1) host on this subnet; (2) Host in other subnets in this network; (3) Host on other networks; . If you know the IP address of this unit, you know if it is a class C class, Class B or Class C class (from the IP address of the IP address), you know the dividend between the network number and the subnet number. According to the subnet mask, it knows the dividend between the subnet number and the host number.
Example assumes that our host address is 140.252.1.1 (a Class B address), and the subnet mask is 255.255.255.0 (where 8 bit is the subnet number, 8 bit is the host number). If the destination IP address is 140.252.4.5 Then we know that the B network number is the same (140.252), but the subnet number is different (1 and 4). The comparison between the two IP addresses is shown in Figure 3.8. If the destination IP address is 140.252.1.22, then the B network number is still the same (140.252), and the sub-network number is also the same (1), but the host number is different. If the destination IP address is 192.43.235.6 (a Class C address), then the network number is different, so further comparison is not available again.
Figure 3.8 Comparison between the two Class B addresses using the subnet mask
After a given two IP addresses and subnet masks, the IP routing selection function has been compared.
3.6 The IP address of special circumstances has been described by subnet divide, and we now introduce 7 special IP addresses, as shown in Figure 3.9. In this figure, 0 means that all bit is all 0, and -1 indicates that all bit is all 1, NETID, SUBNETID, and HOSTID indicate not a corresponding field of all 0 or all 1, respectively. The sub-network number is empty indicates that the address does not perform subnet division.
(The following is a translation of Figure 3.9) IP address can be used to describe the source number of the network number sub-network number host number? Destination?
0
0ok It is impossible to host the host (see the following limit) 0
Hostidok is not possible to specific hosts on the network (see the following limit) 127
Any value Okok loopback address (2.7 section) -1-1 It is impossible to be OK restricted broadcast (never being forwarded) NetID
-1 Improper OK Target to Netid Broadcasts to NetidSubnetID-1 It is impossible to target Netid, the Netid-1-1, which is not possible in the subsidiary, the SubnetID broadcast Netid-1-1. IP address
We divide this form into three parts. The table's head is a special source address, and the intermediate item is a special loopback address, and the last four are broadcast addresses. Both of the table, the network number is 0, can only be used as the source address in the initialization process, such as when the host uses the BOOTP protocol to determine the native IP address. In Section 12.2, we will further analyze the four types of broadcast addresses.
3.7 Example of a subnet This example is the subnet used in this article, and how to use two different subnet masks. The specific arrangement is shown in Figure 3.10.
Figure 3.10 Host and network arrangements in the subnet
If the picture is compared with the graph in the seal, you will find that we will omit the connection details between the router Sun to the Ethernet of the Ethernet from the router Sun, in fact, the connection between them is the uniform SLIP. This detail does not affect the subnet division problem discussed in our section. We will look back in this detail when we discuss the ARP agent in Section 4.6. The problem is that we have two separate networks in the subnet 13: an Ethernet and a point-to-point link (SLIP link for hardware connection). (Point-to-point links will always bring problems because it is generally needed to need IP addresses at both ends.) In the future, there will be more hosts and networks, but in order to prevent the host across different networks to use different subnet numbers. Our solution is to extend the subnet number from 8 bit to 11 bit, and minimize the host number from 8 bit to 5 bit. This is called to change the long subsidy, because most subnets in the 140.252 network use the 8 BIT subnet mask, and our subnet uses the 11-bit subnet mask.
(Below is the original book P.461) RFC 1009 [Braden and Postel 1987] Allows a network containing a subnet using multiple subnet masks. New router requirements RFC [Almquist 1993] requires support for this feature. However, the problem is not that all routing protocols are also exchanged in the subnet mask when switching the target. In Chapter 10, we will see that RIP does not support the elder net, RIP 2 and OSPF support to become a long subsidy. There is no such problem in our example because the RIP protocol is not required in my subnet.
The IP address structure in the author's subnet is shown in Figure 3.11, the first 8 bit in the 11-bit sub-network number is always 13. In the remaining 3 bits, we use binary 001 to represent Ethernet, 010 represents point-to-point SLIP link. This change is not to bring problems with other hosts and routers in the 140.252 network - as long as the purpose is to pass all the datagles of the subnet 140.252.13 to the router Sun (IP address is 140.252.1.29), as shown 3.11 shows, and if SUN knows the host in the subnet 13 has 11 BIT subnet numbers, then everything is fine.
Figure 3.11
140.252.13 Subnet mask of all interfaces in the subnet is 255.255.255.224, or 0xffffe0. This indicates the rightmost 5 bit left to the host number, and the 27 bit left on the left is left to the network number and subnet number. The allocation of the IP address and subnet mask of all interfaces in Figure 3.10 is shown in Figure 3.12.
Figure 3.2 Author subnet IP address
The first column is "host", but Sun and BSDI also have a function of the router because they are multi-port, which can forward packet data from one interface to another interface. The last line in this table is a broadcast address 140.252.13.63 in Figure 3.10: it is based on the Ethernet subnet (140.252.13.32) and the low 5 position 1 (16 8 4 2 1 = 31) in Figure 3.11. (We will see in Chapter 12, this address is called subnet-Directed Broadcast Address.) 3.8 ifconfig commands so far, we have discussed link layers and IP layers You can now introduce the commands of TCP / IP to configure and query the network interface. Ifconfig (8) commands are typically run when booted to configure each interface on the host. Since the coamental interface may be turned on and hang up frequently (such as SLIP link), ifconfig must be (in some way) when the line is turned on and hang up. How this process completes the SLIP software that depends on. Below is the relevant parameters of the author's subnet interface. Please compare them to the values of Figure 3.12.
(See the original book P.48 1)
The loopback interface (Section 2.7) is considered a network interface. It is a Class A address without subnet dividing. It should be noted that the Ethernet does not use the tail package (2.3), and the broadcast can be broadcast, and the SLIP link is a point-to-point link. The SLIP interface logo LINK0 is a configuration option that allows data to compress SLIP (CSLIP, see Section 2.5). Other options have link1 (if you receive a compressed message from the other end, CSLIP) and LINK2 are allowed (all outstanding ICMP packets are discarded). We will discuss the destination address of the SLIP link in Section 4.6.
(Below is the original book P.482 translation) The annotation in the installation guide explains the last option: "Generally, it should not be set, but because some improper Ping operations, you may cause the throughput to fall to 0."
BSDI is another router. Since the -a parameter is the function of the SunOS operating system, we must execute ifconfig multiple times, and specify interface name parameters:
(See the original book P.48 3)
Here, we see a new option for Ethernet interface (WE0): Simplex. This 4.4BSD flag indicates that the interface cannot receive the data transmitted by this unit. All Ethernet in BSD / 386 is set like this. Once this is set, if the interface sends a frame data to the broadcast address, then copy a copy of the data to the loopback address. (In the 6.3 Section, we will explain this.) In the host SLIP, the setting of the SLIP interface is substantially consistent with the BSDI above, and only the IP address of both ends interchanges:
Slip% / sbin / ifconfig SL0SL0: Flags = 1011inet 140.252.13.65 -> 140.252.13.66 Netmask fffffe0
The last interface is an Ethernet interface on the host SVR4. It is similar to the previous Ethernet interface, just the svr4 version of ifconfig does not print the Running flag:
SVR4% / usr / sbin / ifconfig emd0emd0: flags = 23inet 140.252.13.34 Netmask fffffe0 Broadcast 140.252.13.63Ifconfig Commands typically support other protocols other than TCP / IP, and there are many parameters. About these details You can view the system manual.
3.9 NetStat Command NetStat (1) Command also provides interface information on the system. The -i parameter will print an interface information, and the -n parameter prints an IP address instead of the host name.
(See the original book P.49 1)
This command prints the MTU, input packet number, input error, output packet number, output error, conflict, and current output queue length. We will check the routing table with the netstat command in Chapter 9, then discuss the command. In addition, in Chapter 13 we will use its improved version to view the event broadcast group.
3.10 IP's future IP has three main problems. This is the result that the Internet has caused rapid growth in the past few years. (See Exercise 1.2.) 1. More than half of the B class addresses have been assigned. Based on current estimates, if the Class B address continues to be allocated at current speed, they will be overtaking in 1995. 2. 32 Bit IP addresses are generally not enough from long-term Internet growth perspectives. 3. The current routing structure does not have a hierarchical structure, which is a flat-edge (FLAT) structure, and each network requires a routing expression. As the number of networks increases, a website with multiple networks must allocate multiple C class addresses, not a B address, so the size of the routing table will grow. Unbeatable domain routing selection CIDR (ClassSs Interdomain Routing) proposes a suggestion that can solve the third issue, expand the current version of IP (IP version 4) to accommodate the development of the next century. In this regard, we will introduce in further detail in Section 10.8. For the new version of IP, the next generation IP, often referred to as IPNG, mainly four recommendations. The IEEE NetWork (Vol.7, No.3) issued in May 1993 reviewed the first three recommendations, and there was an article on CIDR. RFC 1454 [DIXON 1993] compared to the top three recommendations. 1. SIP, simple internet protocol. It proposes a minimal modification suggestion for the current IP, using a 64-bit address and a different first format. (The first 4 bits of the head still include the version number of the protocol, its value is no longer 4.) 2. PIP. This proposal also uses a larger, variable length, hierarchical address, and the first format is different. 3. Tuba, represents "TCP and UDP with Bigger Address", which is based on OSI's CLNP (ConnectionLess Network Protocol, no connection network protocol), a OSI protocol similar to IP. It provides a much larger address space: variable length, up to 20 bytes. Since CLNP is an existing protocol, SIP and PIPs are only suggested, so the documentation about CLNP has appeared. RFC 1347 [Callon 1992] provides details of Tuba. Chapter 7 of Literature [Perlman 1992] compares IPv4 and CLNP. Many routers have supported CLNP, but few hosts are also supported. 4. TP / IX, is described by RFC 1475 [Ullmann 1993]. Although SIP uses a 64 BIT address site, it also changed the format of TCP and UDP: two protocols are 32 bit port numbers, 64 Bit serial number, 64 bit confirmation number, and TCP 32 bit window . The top three recommendations basically use the same version of TCP and UDP as the transport layer protocol. Since four recommendations can only have an alternative to IPv4, and you may have made a choice when you read this book, so we don't have excessive comments to them. Although CIDR is about to be implemented to solve the current short-term problem, the implementation of IPv4 successor needs to go through for many years.
3.11 Summary This chapter starts to describe the format of the IP header, and briefly discusses all fields in the head. We also introduced the IP route selection and pointed out that the routing of the host can be very simple: if the destination host is on the network directly connected, then the datagram is directly transmitted to the destination host, otherwise it is passed to the default router. When performing routing decisions, both hosts and routers use routing tables. There are three types of routes in the table: specific host type, specific network type, default route type. The expression in the routing table has a certain priority. When selecting routes, the host route is preferred over the network route, and finally the default route is selected when there is no other optional routing. IP routing is implemented by hip-by-hop. Data reports are always unchanged during transmission of each station, but the package and destination link layer address can change in each station. Most hosts and many routers use the default next stop router for non-local network datagrams. Class A and Class B addresses are generally subject to subnet division. The bit number of the subnet number can be specified over the child mask. We have given this example detailed description, namely the author's subnet, and introduce the concept of growing a long net. The division of the subnet narrows the size of the Internet routing table, because many networks can often be able to access individual representations. The information about the interface and network can be obtained through the ifconfig and netstat commands, including the IP address of the interface, the mask of the subnet, and the MTU, etc. At the end of this chapter, we discussed the potential improvement recommendations of the Internet protocol family - the next generation IP was discussed. Exercise 3.1 The loopback address must be 127.0.0.1? 3.2 Pointing a router with two network interfaces in Figure 3.6. 3.3 Subnet No. 16 Bit Class A address is different from the subnet mask of the subnet number of the subnet number 8 bit? 3.4 Read the RFC 1219 [Tsuchiya 1991], learn about the recommendation techniques of allocation subnet and host numbers. 3.5 Subnet mask 255.255.0.255 Is it valid for the A class address? 3.6 Why do you think the MTU of the loopback interface printed in the 3.9 section is to be set to 1536? 3.7 TCP / IP protocol is based on a datagram network technology, an IP layer, and other protocols based on the connection-oriented network technology. . Read the literature [CLARK 1988] to find three advantages provided by the Data News Network layer. 3-1