Data Structures unit I just look to learn the contents
ssuser80a5aa
5 views
26 slides
Sep 03, 2024
Slide 1 of 26
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
About This Presentation
qqq
Size: 1.2 MB
Language: en
Added: Sep 03, 2024
Slides: 26 pages
Slide Content
IT22501 – Data Communication and Networking Unit I I – Data Link Layer
UNIT II DATALINK LAYER 6 Introduction-nodes and link-Two types of links-Two sublayers -Data link control: Framing-Error Control-Two DLC protocols – Link-Layer Addressing – DLC Services – Data-Link Layer Protocols – HDLC.
Definition of Network Units: Packet, Fragment, Frame, Datagram, and Segment The data in network - bytes. The data bytes have their specific format in each layer of OSI networking model or depending on the used protocol or connections. They can be of - packet, fragment, frame, datagram, and segment.
Packets – is the basic unit of communication between a source and destination in a network. They are the data units within the network layer of OSI model. Each packet contain a • header with source, destination IP addresses • a field for protocol specification • the data • a trailer – with error correction, flags etc. It helps in managing bandwidth, routes, and other devices that they share and receive packets independently. It makes it easier to retransmit lost pieces of data
Fragments In network there is a pre-defined maximum size of the data to be transmitted called the Maximum Transmitted Unit (MTU). But the packets can be larger than the maximum size. So, each packet which is larger than the MTU is divided into smaller pieces of data called fragments. The network layer is responsible for fragmentation If the packet had a flag Don’t fragment (DF) = 1, then the packet is discarded. Else depending upon the fragment size, it O create the header O encapsulate the fragment with header O send them to next layer The receiver reassembles the IP fragments into the packets and forwards them to higher layer.
Fragment In network there is a pre-defined maximum size of the data to be transmitted called the Maximum Transmitted Unit (MTU). But the packets can be larger than the maximum size. So, each packet which is larger than the MTU is divided into smaller pieces of data called fragments. The network layer is responsible for fragmentation If the packet had a flag Don’t fragment (DF) = 1, then the packet is discarded. Else depending upon the fragment size, it O create the header O encapsulate the fragment with header O send them to next layer The receiver reassembles the IP fragments into the packets and forwards them to higher layer.
Introduction to nodes and links
Nodes and Links Communication at data-link layer is node-to-node where application, transport, and network layer is end-to-end
Functions of data link layer Controls the medium and its capacity Transmitting frames from one node to another node Transfer datagrams across links Framing – bits to frames Physical addressing – adds header to frames – source and destination address Flow control – what is flow control? Error control – retransmitting lost frames, prevent duplicate frames MAC – which device has control over the link at any instance
Two types of links o a point-to-point is a dedicated link between two links. e.g. home phones o a broadcast link is shared between several pair of devices. e.g. mobile phones
Two Sublayers The service provided by the data-link layer can be divided into two sublayer services – i . data-link control (DLC ) – deals with both point-to-point and broadcast links ii. media access control (MAC) – deals only with the issues specific to broadcast links.
DLC – Data link Control Is the communication procedure – node-to-node or broadcast Framing Error control
Framing Physical layer bits transmission and their synchronization In data-link layer Pack bots into frames i.e. framing Adds senders address and receivers address – source and destination address Why full message not in single frame?---------- Types of framing Fixed length framing-----? Variable length framing-------? Character-oriented or byte-oriented Bit-oriented
Character-Oriented Framing A frame Header source, destination and control information trailer – error deduction redundant bit - 8 bits byte-stuffing a special character – escape sequence (ESC) – indicates the end of frame – also called as a flag - On receiving the escape character is removed
Problem: If same bytes (ESC) are as text – make confusions It may be removed – collapses the data Solution: Add another escape sequence within the text What happen if ESC (flag)ESC(text) ESC ESC ESC indicates ESC belongs to text
A communication with only three nodes
Byte Oriented Framing Delimiter flag – 8-bit number – 01111110 – added to start and end of frame Problem - text has a similar flag bits as data Solution As 6 consecutive 1’s add 0 to it as extra bit If data = (flaglike pattern) 01111110 it is changed to 011111010 (stuffed)
ERROR CONTROL - includes error detection and correction -error is caused due to interference Types of ERRORS: single-bit error – one bit is changed Bust error – 2 or more bits are changed
Redundancy – detecting or correcting errors – adding extra bits – called redundant bits Error detection – is there an error or not? Error Correction – finding the exact corrupted bits and their location Coding – for redundancy Sender adds 1 or few bits to make a relationship b/w actual and redundant bits The relationship is again checked in receiver side via Block coding Convolution coding
Block Coding Messages divided into blocks (k-bits) – the dataword Add r – redundant bits Now length of codeword is n = k + r With k and n there are 2^k and 2^n possibilities and n > k As the process is 1-to-1 each data word is related to same codeword 2n-2k code words are neglected Easy to check
Error Detection When to change the original codeword? 1. The receiver has (or can find) a list of valid codewords. 2. The original codeword has changed to an invalid one.
Problems: Let us assume that k = 2 and n = 3. The Table shows the list of datawords and codewords. k = 2 and n = 3 Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider the following cases: 1. The receiver receives uncorrupted codeword 011 valid codeword dataword 01 is extracted from it. 2. If the corrupted codeword 111(left-most bit is corrupted) is received it is not valid and is discarded. 3. If the corrupted codeword 000 (right 2 bits are corrupted) incorrect data still valid codeword dataword 00 received as an undetectable error word. Datawords Codewords Datawords Codewords 00 000 10 101 01 011 11 110
Hamming distance – no. of differences between the corresponding bits of words x and y This defines the no. of corrupted bits during transaction How to find the hamming distanc ? X ⊕ Y >=0 and count the number of 1s in result Problem – find the hamming distance between the two words 000 and 011. d(000, 011) = 000 ⊕ 011 = 011 i.e., 2 Problem – find the hamming distance between the two words 10101 and 11110. d(10101, 11110) = 10101 ⊕ 11110 = 01011
Hamming distance = s +1 s errors are there in the received bit If s errors occur during transmission, the Hamming distance between the sent codeword and received codeword is s. If our system is to detect up to s errors, the minimum distance between the valid codes must be (s + 1) so that the received codeword does not match a valid codeword. i.e., if the minimum distance between all valid codewords is (s + 1), the received codeword cannot be erroneously mistaken for another codeword. The error will be detected. Although a code with dmin = s + 1 may be able to detect more than s errors in some special cases, only s or fewer errors are guaranteed to be detected.