Data Link Layer - Linux

The data link layer isolates the network layer above from the electrical transmission details in the layer below. One of the responsibilities of the data link layer is to provide an error-free transmission channel known as Connection Oriented (CO) service. Generally, CO service at the data link layer is not required because TCP/IP assumes that the lower layers do not have any type of error recovery. If a user requires reliable transmission, she should use SOCK_STREAM type sockets, which transmit and receive data using the TCP protocol. In the TCP/IP suite, TCP provides reliable service at the transport layer However, in IP-based networks, there are some cases where CO or reliable delivery service is used at the data link layer. When we use the CO service at the data link layer, the network interface driver does not consist of hardware support. Instead, the driver interfaces IP to another complete protocol stack. The best example is Point-to-Point Protocol (PPP). PPP presents a common example of a reliable link because it contains several layers of control protocols that must negotiate a reliable connection before it is ready to carry IP packets. In examples such as PPP where IP runs over a reliable link, often the purpose of the link is to forward IP across a public carrier-based network of some sort. Examples of public carrier networks are X.25 or ATM.

In some TCP/IP stack implementations, there is a filtering layer where incoming packets or frames can be intercepted before being passed up to IP. This filtering occurs at Layer 2 in terms of the OSI model. An example of filtering would be Linux netfilter. For more details about netfilter, refer to,"Linux Networking Interfaces and Device Drivers." Actually, the simplest form of filtering occurs automatically at the PHY. The link layer sets up the PHY to receive only packets with its own MAC address in the destination field along with multicast packets and broadcast packets. Another function of the link layer is to establish the type of framing to be used when the IP packet is transmitted. For example, if the incoming packet is from an Ethernet interface, it can have two types of framing. One is often called Ethernet type II framing; the other, used for Ethernet, is 802.3 type framing. The length field in the 802.3 packet is at the same displacement as the type field in the Ethernet type II frame. See Figure for an illustration of Ethernet Type II framing, and Figurefor an illustration of 802.3 type framing. The 802.3 type framing also has a type field that contains the protocol number carried by the frame. Table shows the protocol numbers commonly used for IPv4 networking.

Ethernet framing.

Ethernet framing

802.3 framing

802.3 framing

Protocol Types for Type Field in Ethernet MAC Header

Protocol Types for Type Field in Ethernet MAC Header

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Linux Topics