TCP/IP (2) link layer, Chapter 2 Notes

Source: Internet
Author: User


1. The link layer is also called the data link layer or network interface layer. It usually includes the device driver in the operating system and the network interface card corresponding to the computer. They work together with the physical interface details of cables (or other transmission media.
The link layer has three main purposes: (1) sending and receiving I p datagram for the I P module; (2) Sending A R P request for the R P module and receiving A R P response; (3) Send the r a p request to r a p and receive the r a p response. T c p/I p supports a variety of link layer protocols, depending on the hardware used by the network, such as Ethernet, licensing ring network, f d I (Optical Fiber Distributed Data Interface) and R S-2 3 2 serial lines.
The following describes the two serial interface link layer protocols (s l p and P), and the loopback (l o p B a c k) drivers that are included in most implementations.
Ii. Ethernet and IEEE802 Encapsulation
 
3. The full name of the SLIP Serial Line ips l I P is Serial Line IP. It is a simple form of encapsulation of I P datagram on a serial line, which is described in RFC 1055 [Romkey 1988. S l I p is applicable to the r s-2 3 3 2 serial port and high-speed modem access I n t e r n e t that almost all computers in the home.

The following rules describe the frame format defined by the s l I P protocol:
1) IP data is reported to end 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 I p 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 s l I P, however, its value is different from the e s c character of a s c I code (0x1 B.
3) if a character in the I p message is an e s c character of s l I p, two bytes 0 x d B and 0 x d must be transmitted consecutively to replace it.
 
Disadvantages of SLIP: 1. Each segment must know the IP address of the stack. There is no way to notify the IP address of the local end to the non-type field 3SLIP in the data frame of the other end 2 (similar to the CRC Field in Ethernet). Despite these shortcomings, SLIP is still a widely used protocol.
Iv. 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 use T C P ), therefore, there are many small t c p groups on the s l p line for exchange. To transmit 1 byte of data, we need 2 0 bytes of I P header and 2 0 bytes of T C P header, with a total of more than 4 0 bytes (1 9. section 2 describes the details of these tabloids transmitted when a simple command is typed in the R l o g I n session ).
Since we acknowledge these performance defects, we propose a new protocol called c s l I p (that is, compressing s l I P, it is described in RFC 1144 [jacson 1990a] in detail. C s l I P can generally compress 4 0 bytes to 3 or 5 bytes. It can maintain up to six t c p connections at each end of c s l I P, 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 products support c s l I P. The author's subnet (see the cover page) contains two
SLIP links, all of which are CSLIP links.
V. Point-to-Point PPP protocol
In general, P has the following advantages over s l I p: (1) PPP supports running multiple protocols on a single serial line, not just I P protocol; (2) each frame has a cyclic redundancy test. (3) both parties can perform dynamic negotiation on the I p address (using the I P Network Control Protocol). (4) similar to c s l I p, the header of t c p and I P packets is compressed;
(5) The Link Control Protocol can be used to set multiple data link options. The price paid for these advantages is that three bytes are added at the beginning of each frame. When a link is established, several frames of negotiation data are sent, and more complex implementations are required. Although P has more advantages than s l I p, the current s l I P users are still more than P users. With
More and more manufacturers began to gradually support PPP, so PPP should eventually replace SLIP.
6. loop interface
 
We usually use 127.0.0.1 to try our own server. This loopback interface is used. The following three aspects of the loop interface are worth noting:
1. Any data transmitted to the loopback address (generally 127.0.0.1) is input as I P. 2. Copy the datagram sent to the broadcast address or multicast address and send it to the loopback interface, and then to the Ethernet. This is because the definition of broadcast and Multicast Transmission includes the host itself. 3. Any data sent to the Host IP address is sent to the loopback interface.
7. Maximum Transmission Unit MTU if there is a datagram on the I P layer to be transmitted, and the data length is larger than the M T U on the link layer, in this case, the I p layer needs to partition (f r a g m e n t a t I o n) and divide the datagram into several slices, in this way, the size of each piece is smaller than that of the m t u in the Windows registry.
 
MTU calculates the transmission delay of SLIP and CSLIP links.
Point-to-Point Protocol (PPP)

It is the communication protocol between two computers used for serial interfaces. It is a protocol for communication between computers and servers through telephone lines. Network service providers can provide you with point-to-point connections, so that the provider's server can respond to your requests, receive and send your requests to the network, and then send the responses to the network. PPP is a member of the TCP/IP protocol family. The PPP protocol can be used for full duplex protocols for different media, including twisted pair wires, optical fiber cables, and satellite transmission. It uses HDLC for package loading. The PPP protocol can both process synchronous communication and asynchronous communication. It allows multiple users to share a line and control errors not implemented by the SLIP protocol.

TCP/IP (Transmission Control Protocol/Internet Protocol) Transmission Control Protocol/Internet Protocol

The TCP/IP protocol originated from the US Defense Advanced Research Plan. The protocol that provides reliable data transmission is called the transmission control protocol TCP. For example, the cargo packing list ensures that data is not lost during transmission. The protocol that provides the connectionless datagram service is called the Network Protocol IP address, it is like the address and name of the recipient to ensure that the data arrives at the specified location. TCP/IP is a widely used protocol on the Internet. The main services provided by the Internet using TCP/IP are: email, file transfer, remote logon, network file system, video conferencing system, and World Wide Web. It is the foundation of Interent. It provides the routing function within the WAN and allows different hosts on the Internet to be interconnected.

In concept, it can be mapped to four layers: the network interface layer, which is responsible for transmitting frames on the line and receiving frames from the line; the Internet layer, which includes the IP protocol, the IP protocol generates Internet datagram and carries out necessary routing algorithms. The IP protocol can be divided into four parts: ARP, ICMP, IGMP, and IP. the uplink layer is the transport layer, this layer is responsible for managing sessions between computers. This layer includes two protocols, TCP and UDP. Different Application requirements can communicate using different protocols. The last layer is the application layer, we are familiar with FTP, DNS, and TELNET. Familiarity with TCP/IP is the only way to get familiar with the Internet.
User Data Protocol (UDP)

It is a protocol used to provide Packet Exchange for computer communication in the interconnection network environment. By default, this Protocol considers the network protocol (IP) as its underlying protocol. UDP is another method of TCP. Like TCP, UDP uses the IP protocol to obtain data units (called datagram). Unlike TCP, UDP does not provide packets (datagram) group and assemble services. In addition, it does not provide sorting of packages, which means that the program must determine whether the information is completely accurate to the destination. If network programs want to speed up processing, it is better to use UPD than TCP. UDP provides two services not provided by the IP layer. It provides port numbers to differentiate requests of different users and provides parity. In OSI Mode, UDP and TCP are on the fourth layer and transport layer.
It can be said that PPP is a connection method, while TCP and UDP are data transmission methods.
One of the reasons for the success of TCP/IP is that it can run on almost any data link count.
 

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.