We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23
MODULE 2
Introduction to Data-Link Layer
Introduction ■ Data link layer is responsible for node to node delivery of data and its responsible for error free transmission of data packets. ■ Data link layer contains two types of transmission: point to point and multipoint. ■ The Internet is a combination of networks glued together by connecting devices (routers or switches). If a packet is to travel from a host to another host, it needs to pass through these networks. ■ Next Diagram shows a same scenario we have discussed before but here communication occurs at data link layer. ■ The data-link layer at Alice’s computer communicates with the data-link layer at router R2. The data-link layer at router R2 communicates with the data-link layer at router R4,and so on. ■ Finally, the data-link layer at router R7 communicates with the data-link layer at Bob’s computer. Only one data-link layer is involved at the source or the destination but two data-link layers are involved at each router. Nodes and Links ■ Communication at the data-link layer is node-to-node. A data unit from one point in the Internet needs to pass through many networks (LANs and WANs) to reach another point. Theses LANs and WANs are connected by routers. ■ The first node is the source host; the last node is the destination host. The other four nodes are four routers. Services ■ The data-link layer is located between the physical and the network layers. The datalink layer provides services to the network layer; it receives services from the physical layer. ■ When a packet is travelling in the Internet, the data-link layer of a node (host or router) is responsible for delivering a datagram to the next node in the path. For this purpose, the data- link layer of the sending node needs to encapsulate the datagram received from the network in a frame, and the data-link layer of the receiving node needs to decapsulate the datagram from the frame. ■ The data-link layer of the destination host needs to decapsulate, but each intermediate node needs to both encapsulate and decapsulate. ■ Assume a person needs to travel from her home to her friend’s home in another city. The traveler can use three transportation tools. She can take a taxi to go to the train station in her own city, then travel on the train from her own city to the city where her friend lives, and finally reach her friend’s home using another taxi. Here we have a source node, a destination node, and two intermediate nodes. The traveler needs to get into the taxi at the source node, get out of the taxi and get into the train at the first intermediate node (train station in the city where she lives), get out of the train and get into another taxi at the second intermediate node (train station in the city where her friend lives), and finally get out of the taxi when she arrives at her destination Two Categories of Links ■ we can have a point-to-point link or a broadcast link. In a point-to- point link, the link is dedicated to the two devices; in a broadcast link, the link is shared between several pairs of devices. For example, when two friends use the traditional home phones to chat, they are using a point-to-point link; ■ When many people speak over conference call then multipoint links. Flow Control • It is a set of procedures that tells the sender how much data it can transmit before the data overwhelms the receiver. • The receiving device has limited speed and limited memory to store the data. Therefore, the receiving device must be able to inform the sending device to stop the transmission temporarily before the limits are reached • Two methods have been developed to control the flow of data:Stop-and-wait & Sliding window Stop-and-wait
• In the Stop-and-wait method, the sender waits for an
acknowledgement after every frame it sends. • When acknowledgement is received, then only next frame is sent. The process of alternately sending and waiting of a frame continues until the sender transmits the EOT (End of transmission) frame. Sliding Window
• The Sliding Window is a method of flow control in which a sender can
transmit the several frames before getting an acknowledgement. • In Sliding Window Control, multiple frames can be sent one after the another due to which capacity of the communication channel can be utilized efficiently. • A single ACK acknowledge multiple frames. • The window has a specific size in which they are numbered as modulo-n means that they are numbered from 0 to n-1. ■ For example, if n = 8, the frames are numbered from 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........ Two Sublayers ■ Through dividing data link layer into two sub parts we can understand the services and functionalities of it in a better way. ■ Data Link control is a service which is used to make sure that frames is travelling from source to destination without any error and it also regulates the flow of data which we call as flow control. ■ Medium access control is used to make sure that how data is transferred between two devices through a network cable. LINK-LAYER ADDRESSING ■ In link layer addressing is called as link address, physical address and also mac address and its together called MAC address means the address specified at data link layer. ■ Lets understand this concept with an example. ■ Here in this diagram communication is happening between alice and bob and as you can see there are two host or nodes and it contains 3 communication Links. ■ We can observe two notations here L and N where L represents link address and N represents network address. ■ For alice L1N1 is the address which is associated with router R1 and for R1 there are 3 links connected. ■ N2L2 and N4R4 is the link address and IP address of Router R1. ■ When the data moves from one point to another point in the link the data encapsulation will take place. ■ Here in the diagram you can see N1 N8 and N1 is the address of the source node that is alices computer and N8 is the address of destination node which is bobs node so source and destination node is fixed. ■ If you see link address will change like for example if you are travelling from one place to another place your place will not be same. ■ Here in the first part source and destination is reversed L2 is the Source and L1 is the destination. ■ In Link 2 L5 is the destination and L4 is the source. ■ In link 3 L8 is the destination and L7 is the source. Three Types of addresses ■ There are 3 types of addresses: unicast, broadcast and multicast. ■ Unicast Address: If there is only one receiver which means when we are sending a data packet to only one machine then its called unicast address. ■ Suppose to find a address as unicast or multicast you need to check for the least significant bit and if its 0 then its unicast address and if its 1 then its multicast address and in broadcast address all bits will be 1. ■ In broadcast network all the members of the network will receive the packet copy and the router which is used will not send the packet outside the network. Address Resolution Protocol (ARP) ■ Address resolution protocol is mainly used to convert IP address to Mac address which also means that converting logical address to physical address. ■ In Figure the system on the left (A) has a packet that needs to be delivered to another system (B) with IP address N2. ■ System A needs to pass the packet to its data-link layer for the actual delivery, but it does not know the physical address of the recipient. ■ It uses the services of ARP by asking the ARP protocol to send a broadcast ARP request packet to ask for the physical address of a system with an IP address of N2 ■ This packet is received by every system on the physical network, but only system B will answer it, as shown in Figure. ■ Now system A can send all the packets it has for this destination using the physical address it received Caching A question that is often asked is this: If system A can broadcast a frame to find the link layer address of system B, why can’t system A send the datagram for system B using a broadcast frame? In other words, instead of sending one broadcast frame (ARP request), one unicast frame (ARP response), and another unicast frame (for sending the datagram), system A can encapsulate the datagram and send it to the network. System B receives it and keep it; other systems discard it. The Answer ■ Let us assume that there are 20 systems connected to the network (link): system A, system B, and 18 other systems. We also assume that system A has 10 datagrams to send to system B in one second. ■ Without using ARP, system A needs to send 10 broadcast frames. Each of the 18 other systems need to receive the frames, decapsulate the frames, remove the datagram and pass it to their network-layer to find out the datagrams do not belong to them. This means processing and discarding 180 broadcast frames. ■ Using ARP, system A needs to send only one broadcast frame. Each of the 18 other systems need to receive the frames, decapsulate the frames, remove the ARP message and pass the message to their ARP protocol to find that the frame must be discarded. This means processing and discarding only 18 (instead of 180) broadcast frames. An Example of Communication ■ To show how communication is done at the data-link layer and how link-layer addresses are found, let us go through a simple example. ■ Assume Alice needs to send a datagram to Bob, who is three nodes away in the Internet ■ In other words, Alice’s host is given the data to be sent, the IP address of Bob, and the IP address of Alice. End of Chapter 1 Module 2 Chapter 2 Module 2 Error Detection and Correction