21 Jan 2013

Networking fundamentals tutorial - Data Link Layer

8 comments
In this post I will describe the role and functionality of the Data Link layer of the OSI model:
Data Link Layer

When a packet is sent from the Network layer for further processing, it first arrives at the Data Link layer then it is sent to the Physical Layer. This layer is responsible for managing transmission of packets and access to the physical media (optical fiber, cooper wires, microwaves etc.) When talking about Data Link layer, you'll have to get familiar with some terms:
The Data Link layer PDU is called a frame
The medium is represented by the physical environment in which a packet is transmitted
A Node is a device connected to a network. It can be either a router,a switch,a host, etc. 
Data link layer is responsible for frame delivery on network segment. A network segment is represented by a physical connection between two devices. A frame can travel through different physical media from source to destination, it can go through a wireless connection on one network segment or trough a optical fiber channel on another segment. On every hop, a network device such as a router accepts a frame, decapsulates the packet, reads the information and than sends the packet encapsulated in a different frame for a different network segment. Data Link layer protocols describe how access to the medium can be made (encapsulation into a frame) and how a packet can be transmitted. 
A frame consists of three parts:
header - the first part of the frame, it contains information such as the Frame Start indicator, Addressing, Type and Control information.
data - this is the actual packet sent by the Network Layer
trailer - the end of a frame, contains the Error Detection and Frame Stop indicator
The Data Link layer is the demarcation point between the hardware and software components, is the place where data implemented in software is interpreted by the hardware devices and sent onto the medium. On a computer, the functionality of the data link layer is implemented into the Network Interface Card (NIC).
As written on Wikipedia (http://en.wikipedia.org/wiki/Data_link_layer), the Data Link layer has two subdivisions: the LLC (Logical Link Control) and the MAC (Media Access Control).
The protocols at the Layer2 of the OSI model, specify how can the medium be accessed. Imagine what would happen if there were no rules and every device could sent frames onto the medium at any moment. Collisions can occur when multiple devices transmit at the same time, that's why some media access methods were invented:
Controlled access - when using this method, each device takes turn in using the medium. When one device transmits data, no other node can transmit in the same time. Devices must wait for their turn in order to transmit information, so no collisions can occur. An example of controlled access (also called deterministic) is token ring. This method adds overhead because each node can transmit one after the other.
Contention-based - nodes can try to send information at any time. Before a node wants to transmit data, it has to detect if the medium is carrying data or not. To do this it uses the CSMA (Carrier Sense Multiple Access) method. When using this method, a node first listens to detect a carrier signal. If a signal is detected then it means that another node is already transmitting, if the signal is not detected than the node can send data. This method eliminates the overhead excess but collisions can occur. Collisions occur when multiple nodes try to transmit at the same time. There are two types of CSMA:
CSMA/CD or Collision Detection and CSMA/CA or Collision Avoidance.
I've told you earlier that Data Link layer is responsible for end-to-end delivery between a source and a destination. In this context we have to talk about two things, the logical topology and the physical topology. A logical topology is a virtual circuit between source and destination, it does not consider devices between this two points. The physical topology is made from the actual connections and devices trough which information is sent from source to destination. Usually, those two are not the same. Read more about physical and logical topology on Wikipedia: http://en.wikipedia.org/wiki/Logical_topologyhttp://en.wikipedia.org/wiki/Network_topology:
Physical vs logical connection

A well known topology is the point-to-point topology, it can be either physical point-to-point or logical point-to-point topology. In this kind of network, data is transmitted between two devices. The connection can be either full duplex or half duplex. In a full duplex connection both devices can send and receive data at the same time. In a half duplex connection devices can either send or receive data.
Data Link layer is also responsible for error detection. This is made by using a FCS or Frame Check Sequence field. The source calculates a Cyclic Redundancy Check (CRC http://en.wikipedia.org/wiki/Cyclic_redundancy_check) and then it sends the frame onto the medium. When the frame arrives at destination, another CRC is made by the receiving host. It then compares these two hashes and if they are the same than it means that the whole frame has been transmitted.
There are many Data Link Layer Protocols but among the well known are:
Ethernet
Frame Relay
Point-to-Point protocol (PPP)
OK, folks that's it for this post. I hope you will enjoy it, have a nice day.
author

About me

After finishing a Computer Science University I've started working as an IT support technician for an Outsourcing company. Since then, I've changed my profile a couple of times and now I work as a System Administrator at one of the biggest companies in the gaming industry. I'm constantly learning new things in this domain so I thought of creating this website for sharing my experiences. Until now, I've taken the Cisco Certificate Network Associate exam and several Microsoft certifications. Now, I am in the process of learning Unix and enhance my programming skills.

8 comments :

  1. Well I am so excited that I have found your post because I have been searching for some information on this for almost three hours! You've helped me a lot indeed and by reading this article I have found many new and useful information about this subject!
    we buy houses

    ReplyDelete
  2. I was looking a brief information about OSI model which I found here. Thanks for the post.

    ReplyDelete
  3. Very good explained, just what I was looking for since I am working on one project on my college that involves LAN networks, although a little bit hard to read since the between new paragraphs does not exist.

    ReplyDelete
  4. Thank you very much guys.I am glad that you've liked it

    ReplyDelete
  5. Your work has always been a great source of inspiration for me. I refer you blog to many of my friends as well,Thanks for sharing knowledge...

    ReplyDelete
  6. Recently i have started a new IT company and some times i have faced networking problems and your this article is very informative and valuable for me specially wikipedia link which you put into your article. Nice efforts thanks

    ReplyDelete
  7. Networking is not such an easy task as we thought but it is easier than programming.|Cheap Dissertation Online|

    ReplyDelete
  8. Networking is very necessary nowadays. Almost all companies have its own networking. Specially IT companies. If networking is strong then there is no problem will be faced. i have also Winnipeg Web Design company and have very strong networking and your article is very helpful for us. Thanks

    ReplyDelete

Blogroll