TCP/IP-02-Link Layer

Source: Internet
Author: User

TCP/IP-02-link layer Chapter 2 link layer 2nd introduction in the TCP/IP protocol family, the link layer has three main purposes: 1) sending and receiving IP datagram for the IP module; 2) sends ARP requests to the ARP module and receives ARP responses. 3) sends RARP requests to RARP and receives RARP responses. TCP/IP supports a variety of link layer protocols, depending on the hardware used by the network, such as Ethernet, ring-based network, and f d I (Optical Fiber Distributed Data Interface) and R S-2 3 2 serial lines. We will discuss in detail the Ethernet link layer protocol, the two serial interface link layer protocols (SLIP and PPP), and the loopback (l o p B a c k) Drivers included in most implementations. Ethernet and SLIP are links used in most examples in this book. MTU (maximum transmission unit) is introduced, which will be encountered multiple times in later chapters of this book. 2.2 Ethernet and IEEE 802 encapsulation Ethernet generally refer to Digital Equipment Corp .) intel Corporation (I n t e l C o r p .) A standard jointly announced with Company X e r o x in. It is the main LAN technology used by TCP/IP today. It adopts A media access method called c s m a/c d, which means that the carrier with conflict detection listens for multiple access channels. The speed is 10 Mb/s and the address is 48 bits. Several years later, the IEEE (Association of electronic and electrical engineers) 802 committee published A slightly different standard set, of which 802.3 are for the entire c s m a/c d network and 802.4 are for the Token Bus Network, 802.5 for the licensing ring network. The common features of the three are defined by the 802.2 standard, that is, the Logical Link Control (l c) shared by the 802 network ). Unfortunately, 802.2 and 802.3 define a different frame format than Ethernet. [Stallings 1987] provides a detailed description of all IEEE 802 standards. 802.3 standard-defined frames and Ethernet frames both have minimum length requirements. 802.3 the data part must be at least 3 8 bytes, while Ethernet must be at least 4 6 bytes. To ensure this, the padding (p a d) bytes must be inserted in the insufficient space. This minimum length will occur when you start to observe the group on the line. We will provide the Encapsulation Format of Ethernet as needed, because this is the most common Encapsulation Format. 2.3 tail encapsulation RFC 893 [Leffler and Karels 1984] describes another Encapsulation Format for Ethernet, called tail encapsulation. This is an early test format when the B S D system was running on the DEC VA X machine. It improves performance by adjusting the order of fields in the IP datagram. In an Ethernet data frame, the starting part is a variable-length field (IP header and TCP Header ). Move them to the end (before c r c) so that when data is copied to the kernel, the data part of the data frame can be mapped to a hardware page, saving the memory-to-memory replication process. The length of TCP datagram is an integer multiple of 5 1 2 bytes, which can be processed by using the page table in the kernel. The two hosts use the ARP extension protocol to encapsulate data frames at the end. These data frames must define different Ethernet frame types. Now, tail Encapsulation has been opposed, so we will not give it any examples. 2.4 SLIP: The full name of the Serial Line IPSLIP is Serial Line IP. It is a simple form of encapsulation of IP datagram on a serial line, which is described in RFC 1055 [Romkey 1988. SLIP is applicable to the r s-2 3 3 2 serial port and high-speed MODEM connected to the Internet that almost every computer in the home has. The following rules describe the frame format defined by the SLIP Protocol: 1) IP data ends with a special character called e n d (0 x c 0. In addition, to prevent line noise before the arrival of the datagram from being considered as the content of the datagram, most implementations also transmit an e n d character at the beginning of the datagram (if line noise exists, then the character "e n d" will end the incorrect message. In this way, the current message can be correctly transmitted, and the content of the previous error message is discarded when it is handed over to the upper layer ). 2) if a character in the IP Message is e n d, it is necessary to transmit two bytes 0 x d B and 0 x d c consecutively to replace it. The special character 0 x d B is called the e s c character of SLIP, but its value is different from the e s c character of a s c I code (0x1 B. 3) If an es C character of SLIP is in the IP Message, it is necessary to transmit two bytes 0 x d B and 0 x d consecutively to replace it. SLIP is still a widely used protocol. SLIP history is traced back to 4.2 8 4 years. Rick Adams first implemented it in the B S D system. Its description is a non-standard protocol, but as the speed and reliability of the modem increase, SLIP is becoming increasingly popular. Currently, many of its products are publicly available, and many manufacturers support this protocol. 2.5 compressed SLIP because the speed of the serial line is usually low (19200 B/s or lower ), in addition, communication is often interactive (such as Te l n e t and R l o g I n, both of which use TCP ), therefore, many small TCP groups are exchanged on the SLIP line. In order to transmit 1 byte of data, it requires 2 0 bytes of IP header and 2 0 bytes of TCP Header, with a total of more than 4 0 bytes. Since these performance defects are acknowledged, a new protocol called c slip (compression SLIP) is proposed, which is described in RFC 1144 [jacbson 1990a. C slip can generally compress 4 0 bytes to 3 or 5 bytes. It can maintain up to six TCP connections at each end of the c slip, and it knows that some fields in the header of each connection will not change. Most of the changed fields are only small numbers and changes. These compressed headers greatly shorten the interaction response time. Currently, most SLIP products support c slip. 2.6 PPP: The Point-to-Point Protocol (PPP) modifies all defects in the SLIP protocol. PPP includes the following three parts: 1) method of encapsulating IP datagram on the serial link. PPP supports both an 8-bit asynchronous mode with no parity check and a bit-oriented synchronization link. 2) Establish, configure, and test the data Link Control Protocol (l c p: Link Control Protocol ). It allows both parties to negotiate to determine different options. 3) Network Control Protocol (n c p: Network Control Protocol) systems for different Network layer protocols. The network layers defined by RFC include IP, o s I, D E C n e t, and A p l e Ta l k. For example, the ip ncp allows both parties to determine whether to compress the packet header, similar to c slip. RFC 1548 [Simpson 1993] describes the packet encapsulation method and link control protocol. RFC 1332 [McGregor1 9 9 2] describes the network control protocol for IP addresses. The format of the PPP data frame looks like the h d l c (High-Level Data Link Control) Standard of I S O. Although PPP has more advantages than SLIP, there are still more SLIP users than PPP users. As more and more products are available, manufacturers are gradually supporting PPP. Therefore, PPP should replace SLIP. 2.7 Loopback interfaces most products support Loopback interfaces to allow communication between client programs and server programs running on the same host through TCP/IP. Class A network number 1 2 7 is reserved for the loopback interface. According to the Convention, most systems allocate the IP address 127.0.0.1 to this interface and name it l o c a l h o s t. An IP datagram sent to the loopback interface cannot appear on any network. When the transport layer detects that the destination address is a loopback address, some logical operations on the transport layer and all network layers can be omitted. Most products still complete all the processes at the transport layer and network layer, but return the IP datagram to themselves when it leaves the network layer. The maximum transmission unit MTU Ethernet and 2.8 have a limit on the length of the data frame. The maximum values are 1 5 0 0 and 1 4 9 2 bytes, respectively. This feature of the link layer is called MTU, the maximum transmission unit. Most networks of different types have an upper limit. If there is a datagram on the IP layer to be transmitted and the data length is greater than the MTU on the link layer, the IP layer needs to split the datagram into several slices so that each piece is smaller than the MTU. 2.9 path MTU when two hosts on the same network communicate with each other, the MTU of the network is very important. However, if the communication between two hosts is over multiple networks, the link layer of each network may have different MTU. What is important is not the MTU value of the network where the two hosts are located, but the minimum MTU in the path of the two communication hosts. It is called the path MTU. The path MTU between two hosts is not necessarily a constant. It depends on the route selected at that time. The routing is not necessarily symmetric (the routes from A to B may be different from those from B to A). Therefore, the MTU path is not necessarily consistent in both directions. RFC 1191 [Mogul and Deering 1990] describes the path MTU discovery mechanism, that is, the method for determining the path MTU at any time. The t r a c e r o u t e program also uses this method to determine the path MTU to reach the target node. Sections 11.8 and 2 4.2 describe how u d p and TCP operate when the product supports the MTU discovery method. 2.10 Serial Line throughput calculation if the line rate is 9600 B/s, and a byte has 8 bits, add a starting bit and a stop bit, the line speed is 960 B/s (Bytes/second ). It takes 1066 ms to transmit a group of 1 0 2 4 bytes at this rate. If you use the SLIP link to run an interactive application and another application such as f t p to send or receive 1 0 2 4 bytes of data, in general, you have to wait half the time (533 MS) to send the grouped data of the interactive application. Studies on humans show that the interaction response time exceeds 1 0 0 ~ 200 ms is considered to be a bad problem [Jacob bson 1990a]. This is the round-trip time after an interactive message is sent until the response message is received (usually a echo character is displayed. 2.11 Summary This chapter discusses the underlying protocol and link layer protocol in the Internet protocol family. We compared the encapsulation formats of Ethernet and 802.2/802.3, and SLIP and PPP. Because SLIP and PPP are often used for low-speed links, both of them provide methods to compress public fields that do not change frequently. This improves interaction. Most implementations provide a loop interface. You can access this interface through a special loopback address, generally 127.0.0.1. You can also send an IP datagram to any IP address of the host. When the Loop Data is returned to the upper-layer protocol stack, it has passed the complete processing process at the transmission layer and IP layer. We describe an important feature of many links. MTU is related to the concept of path MTU. The transmission latency of SLIP and c slip links is calculated based on the typical serial line MTU. This chapter only covers some of the data link public technologies used by TCP/IP today. One of the reasons for the success of TCP/IP is that it can run on almost any data link technology.

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.