2. Data Link Layer

Source: Internet
Author: User

Features of the data link layer:

Provide services to the network layer, good service interface, ensure the effective and reliable data transmission, adjust the traffic, ensure that the slow receiver is not overwhelmed by the fast sender.


The protocol of the data link layer is still many, there are our most commonly used Ethernet (that is, we usually use the network card) protocol, there are less common token ring, and FDDI, of course, there are now quite popular in the domestic PPP protocol (ADSL broadband), as well as a loopback protocol.

Contact the ifconfig-a command in Linux, this command will usually get the following results

[[email protected]~]# ifconfig-a
Eth0 Link encap:ethernet HWaddr 00:0c:29:2a:e4:4a
inet addr:192.168.74.138 bcast:192.168.74.255 mask:255.255.255.0
Inet6 ADDR:FE80::20C:29FF:FE2A:E44A/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:11491 errors:0 dropped:0 overruns:0 frame:0
TX packets:9690 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6556189 (6.2 MiB) TX bytes:1369156 (1.3 MiB)
interrupt:67 Base address:0x2024

Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Inet6 addr::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:16436 metric:1
RX packets:1308 errors:0 dropped:0 overruns:0 frame:0
TX packets:1308 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1979157 (1.8 MiB) TX bytes:1979157 (1.8 MiB)

Sit0 Link Encap:ipv6-in-ipv4
Noarp mtu:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0  (0.0 b) TX bytes:0 (0.0 b)

where eth0 is the Ethernet interface, and lo is the loopback interface. This also indicates that the host supports at least the loopback protocol and the Ethernet protocol at the network link layer.

Ethernet (ether-net) is defined as a standard published by Digital Equipment Corp., Intel Corp., and Xerox in 1982, which uses a standard known as csma/ The access method of the CD. The standard set of 802.3 (which is also defined in 802.2) provided by IEEE802 also provides a CSMA/CD standard. These two standards are slightly different, and the TCP/IP protocol handles this situation as follows:

    • IP Datagram Encapsulation for Ethernet is defined in RFC894, while the IP datagram of the IEEE802 network is encapsulated in RFC1042.
    • A host must be able to send and receive RFC894-defined datagrams.
    • A host can receive mixed datagrams in the encapsulated format of RFC894 and RFC1042.
    • A host may be able to send RFC1042 datagrams. If the host can send two types of grouped data at the same time, the packets sent must be set up, and the default condition must be RFC 894 grouping.

Visible, RFC1042 in TCP/IP inside a supporting role in the status. Please refer to the teaching materials for these two different data-reporting formats.

PPP (Point-to-Point protocol) is a replacement from slip. They all offer a low-speed access solution. Each data link layer protocol has an MTU (maximum transmission Unit) definition, under which the IP datagram is too large to be fragmented (fragmentation) so that each slice is less than the MTU, noting that the MTU of PPP is not a physical definition, It refers to a logical definition (which is considered by the individual to be programmed). You can use Netstat to print out the MTU results, such as typing netstat-in

Kernel Interface Table

Iface MTU Met rx-ok rx-err rx-drp rx-ovr tx-ok tx-err tx-drp TX-OVR FLG

Eth0 0 11491 0 0 0 9690 0 0 0 Bmru

Lo 16436 0 1308 0 0 0 1308 0 0 0 LRU

It is possible to observe that the MTU of Eth0 is 1500. The MTU of the LO (loopback interface) is 16436.

Finally, say the loopback interface (loopback). Usually we use 127.0.0.1来 try your own machine server so that it doesn't work. This is the loopback interface to go. For loopback interfaces, there are three points worth noting:

    • Any data passed to the loopback address (typically 127.0.0.1) is entered as I p.
    • A copy of the datagram transmitted to the broadcast address or multicast address is sent to the loopback interface and then to the Ethernet. This is because the definition of broadcast delivery and multicast delivery contains the host itself.
    • Any data passed to the host IP address is sent to the loopback interface.


RX packets:2819 errors:0 dropped:0 overruns:0 frame:0
TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:241609 (235.9 KiB) TX bytes:9596 (9.3 KiB)

Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Inet6 addr::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:16436 metric:1
RX packets:2713 errors:0 dropped:0 overruns:0 frame:0
TX packets:2713 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3516032 (3.3 MiB) TX bytes:3516032 (3.3 MiB)




From for notes (Wiz)

2. Data 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.