TCP/IP Volume One link layer

Source: Internet
Author: User
Tags rfc

2.1 Link Layer Purpose  

1" sends and receives IP datagrams for IP modules  

2) Send ARP request and receive ARP reply for ARP module

3) Send Rarp request and receive RARP response for Rarp

2.2 Ethernet and IEEE 802 packages  

802.3 for the entire CSMA/CD network, 802.4 for the token bus network, 802.5 for the Token Ring network. 802 logical Link Control (LLC) common to the network. 802.2 and 802.3 define a different frame format than Ethernet  

The encapsulation of the Ethernet IP datagram is defined in RFC 894, and the IP datagram of the IEEE 802 network is encapsulated in RFC 1042.  

The commonly used encapsulation format is the format defined in RFC 894, which is the Ethernet frame. The Ethernet frame Type field is followed by data. The 802-frame-length field is followed by 3-Byte LLC and 5-byte 802.2 snap,1 as shown.



Figure 1 IEEE802.2, 802.3 (RFC 1042) and Ethernet package Format (RFC894)

Note: length refers to the length of the data, not including the CRC check code. DSAP Destination Service access point, SSAP Source service access Point

802.3 standard defined frames and Ethernet frames have a minimum length requirement. 802.3 specifies that the data portion is at least 38 bytes and that the Ethernet frame has a minimum of 46 bytes

2.3 Tail PackageRFC893 use, at present basically does not apply2.4 SLIP: Serial Line IPA simple form of encapsulation of IP datagrams on a serial line, suitable for RS-232 serial ports and high-speed modems to access the Internet. frame format: 1) The IP datagram begins with end (0XC0) to prevent line noise before the datagram arrives as a datagram content. At the same time, the datagram ends with end; 2) If the IP datagram contains end, then two bytes of Oxdb and 0XDC are transferred consecutively to replace the character. 0xdb is called Slip's ESC character 3) If the IP datagram contains the ESC character, the character is replaced by a continuous two bytes of 0xdb and 0xDD. InrushFigure 2 Slip messageslip defects: 1) Each end needs to know the other side's IP address, but there is no way to notify the IP address of the other end (If you don't know the address,How to communicate? ) 2) There is no Type field in the data frame, and if one line is used for slip it cannot use other protocols at the same time; 3) There is no check field in slip, and once transmitted packets are affected by line noise, errors can only be found through the upper layer protocol. because of the speed of the serial line of the foot, and communication is usually interactive, so there are many small TCP packets on the slip line, but its IP header and TCP header byte more, resulting in the CSLIP (compressed slip) protocol compression.
2.5 PPP Point-to-Point protocolThe PPP protocol modifies the flaw of slip. The PPP protocol mainly consists of three parts: 1) The method of encapsulating IP datagram on the serial link. PPP is supported for data 8-bit and no parityAsynchronous Mode (? ), and support forsync link for bits?. 2) Establish, configure, and test the Link Control Protocol (LCP protocol) of the data link. Allow communication parties to negotiate to determine different options 3) network Control Protocol system for different network layer protocolsPPP Data frame format: 1) Each frame is marked with the character 0x7e start and end 2) address, the value is always 0xFF (represents all hosts on a link? ) 3) protocol control Byte, 0x03 4) for the special character 0x7e, in the asynchronous link, as an escape character, in the PPP data frame, the sixth bit of the tightly attached character to take its complement. A, if the message has a character 0x7e, the continuous transmission of two characters 0x7d and 0x5e B, if the escape character, the continuous transfer of two characters 0x7d and 0x5d, the escape character of the escaped C, by default, the character value is less than 0x20, you need to escape, such as encountered character 0x01, Transfer 0x7d and 0x21 two characters

Figure 3 PPP Data frame format

PPP protocols are often used in serial links, compared with the advantages of slip: 1) PPP supports multiple protocols 2) each frame has a cyclic redundancy check 3) the communication between the two parties can conduct IP address dynamic negotiation 4) similar to Cslip, the TCP and IP packet header compression

2.6 Loopback Interface

The IP address 127.0.0.1 is assigned to the loopback interface, and the interface is named localhost. An IP datagram that passes a loopback interface cannot appear on any network


Figure 4 Process of IP datagram processing by loopback interface

1) Any data passed to the loopback address (typically 127.0.0.1) as an IP input

2) A copy of the datagram to the broadcast address or multicast address is transmitted to the loopback interface and then sent to the Ethernet because the definition of broadcast and multicast transport contains the host itself

3) any data transmitted to the host IP address is sent to the loopback interface


2.7 Maximum transmission Unit MTU

Ethernet 1500 bytes; 802.3 1492 bytes

If the datagram length of the IP layer is greater than the MTU of the link layer, the IP layer needs to fragment the message, each piece is smaller than the MTU

2.8 Path MTU

Two communication hosts in the path the minimum MTU, called the Path MTU.

The link layer for each network may have different MTU.

The path MTU between the two hosts is not necessarily constant, depending on the route selected at the time, because the selection path is not necessarily symmetric, so the path MTU is not necessarily consistent in two directions


TCP/IP Volume One link layer

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.