Computer networks module 2 data link layer

Manjunath852579 58 views 63 slides Sep 21, 2024
Slide 1
Slide 1 of 63
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63

About This Presentation

Computer networks- module 2 data link layer


Slide Content

Data-Link Layer : Introduction: Nodes and Links, Services, Two Categories’ of link, Sublayers, Link Layer addressing: Types of addresses, ARP. Data Link Control (DLC) services: Framing, Flow and Error Control, Data Link Layer Protocols: Simple Protocol, Stop and Wait protocol, Piggybacking. (9.1, 9.2(9.2.1, 9.2.2), 11.1, 11.2 of Text) Media Access Control: Random Access: ALOHA, CSMA, CSMA/CD, CSMA/CA. (12.1 of Text). Wired and Wireless LANs: Ethernet Protocol, Standard Ethernet. Introduction to wireless LAN: Architectural Comparison, Characteristics, Access Control. (13.1, 13.2(13.2.1 to 13.2.5), 15.1 of Text)

Course Learning Objectives: This course will enable students to: • Understand the layering architecture of OSI reference model and TCP/IP protocol suite. • Understand the protocols associated with each layer. • Learn the different networking architectures and their representations. • Learn the functions and services associated with each layer.

Course Outcomes: At the end of the course, the students will be able to: • Understand the concepts of networking thoroughly • Identify the protocols and services of different layers. • Distinguish the basic network configurations and standards associated with each network. • Analyze a simple network and measurement of its parameters.

Data-Link Layer

Nodes and Links

Encapsulation and Decapsulation

Services

Two Categories of Link Point-to-point link Broadcast link. Two Sublayer :

DATA LINK CONTROL Data Link Control is the service provided by the Data Link Layer to provide reliable data transfer over the physical medium

Line Discipline Line Discipline is a functionality of the Data link layer that provides the coordination among the link systems. It determines which device can send, and when it can send the data. Line Discipline can be achieved in two ways: ENQ/ACK Poll/select END/ACK ENQ/ACK stands for Enquiry/Acknowledgement is used when there is no wrong receiver available on the link and having a dedicated path between the two devices so that the device capable of receiving the transmission is the intended one. ENQ/ACK coordinates which device will start the transmission and whether the recipient is ready or not.

Poll/Select The Poll/Select method of line discipline works with those topologies where one device is designated as a primary station, and other devices are secondary stations.

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. It requires a buffer, a block of memory for storing the information until they are processed. 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. Advantage of Stop-and-wait The Stop-and-wait method is simple as each frame is checked and acknowledged before the next frame is sent. Disadvantage of Stop-and-wait Stop-and-wait technique is inefficient to use as each frame must travel across all the way to the receiver, and an acknowledgement travels all the way before the next frame is sent. Each frame sent and received uses the entire time needed to traverse the link.

Error Control

Stop-and-wait ARQ Stop-and-wait ARQ is a technique used to retransmit the data in case of damaged or lost frames. This technique works on the principle that the sender will not transmit the next frame until it receives the acknowledgement of the last transmitted frame. Sliding Window ARQ Sliding Window ARQ is a technique used for continuous transmission error control.

Two protocols used in sliding window ARQ Go-Back-n ARQ:  In Go-Back-N ARQ protocol, if one frame is lost or damaged, then it retransmits all the frames after which it does not receive the positive ACK .

Selective-Reject ARQ

The medium access control (MAC) sublayer

Functions of MAC Layer It provides an abstraction of the physical layer to the LLC and upper layers of the OSI network. It is responsible for encapsulating frames so that they are suitable for transmission via the physical medium. It resolves the addressing of source station as well as the destination station, or groups of destination stations. It performs multiple access resolutions when more than one data frame is to be transmitted. It determines the channel access methods for transmission. It also performs collision resolution and initiating retransmission in case of collisions. It generates the frame check sequences and thus contributes to protection against transmission errors.

MAC Addresses MAC address or media access control address is a unique identifier allotted to a network interface controller (NIC) of a device. It is used as a network address for data transmission within a network segment like Ethernet, Wi-Fi, and Bluetooth. MAC address is assigned to a network adapter at the time of manufacturing. It is hardwired or hard-coded in the network interface card (NIC). A MAC address comprises of six groups of two hexadecimal digits, separated by hyphens, colons, or no separators. An example of a MAC address is 00:0A:89:5B:F0:11.

Link Layer Addressing

UNICAST ADDRESSING Each host or each interface of a router is assigned a unicast address. Unicasting means one-to-one communication. A frame with a unicast address destination is destined only for one entity in the link.

MULTICAST ADDRESSING Some link-layer protocols define multicast addresses. Multicasting means one-to-many communication. However, the jurisdiction is local (inside the link). Multicast frames have a value of 1 in the least-significant bit of the first octet of the destination address. This helps a network switch to distinguish between unicast and multicast addresses. One example of an Ethernet multicast address would be  01:00:0C:CC:CC:CC ,

Broadcast Address Some link-layer protocols define a broadcast address. Broadcasting means one-to-all communication. A frame with a destination broadcast address is sent to all entities in the link. The broadcast address has the value of  FFFF.FFFF.FFFF  (all binary ones). The switch will flood broadcast frames out all ports except the port that it was received on.

Address Resolution Protocol (ARP) Address Resolution Protocol (ARP) is a protocol or procedure that connects an ever-changing Internet Protocol (IP) address to a fixed physical machine address, also known as a media access control (MAC) address, in a local-area network (LAN)

Address Resolution Protocol (ARP) The source host knows the IP address of the default router. Each router except the last one in the path gets the IP address of the next router by using its forwarding table. The last router knows the IP address of the destination host. The ARP protocol is one of the auxiliary protocols defined in the network layer ARP accepts an IP address from the IP protocol, maps the address to the corresponding link-layer address, and passes it to the data-link layer.

ARP OPERATION

Caching 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. a. 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. b. 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. After system B responds with its own data-link address, system A can store the link-layer address in its cache memory. The rest of the nine frames are only unicast.

ARP Spoofing and ARP Cache Poisoning ARP Spoofing is a type of falseness of a device in order to link the attacker’s MAC Address with the IP Address of the computer or server by broadcasting false ARP messages by the hacker. Upon successful establishment of the link, it is used for transferring data to the hacker’s computer. It is simply called Spoofing. ARP can cause a greater impact on enterprises. ARP Spoofing attacks can facilitate other attacks like: Denial of Service Attack Session Hijacking

DLC SERVICES Framing Framing in the data-link layer separates a message from one source to a destination by adding a sender address and a destination address. The destination address defines where the packet is to go; the sender address helps the recipient acknowledge the receipt

Frame Size Frames can be of fixed or variable size. In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself can be used as a delimiter. An example of this type of framing is the ATM WAN, which uses frames of fixed size called cells 1. Fixed size –  The frame is of fixed size and there is no need to provide boundaries to the frame, the length of the frame itself acts as a delimiter.   Drawback:  It suffers from internal fragmentation if the data size is less than the frame size Solution:  Padding 2. Variable size –  In this, there is a need to define the end of the frame as well as the beginning of the next frame to distinguish. This can be done in two ways:    A. Length field –  We can introduce a length field in the frame to indicate the length of the frame. Used in  Ethernet(802.3) . The problem with this is that sometimes the length field might get corrupted. B. End Delimiter (ED) –  We can introduce an ED(pattern) to indicate the end of the frame. Used in  Token Ring . The problem with this is that ED can occur in the data.

Character-Oriented Framing In character-oriented (or byte-oriented) framing, data to be carried are 8-bit characters from a coding system such as ASCII . The header, which normally carries the source and destination addresses and other control information, and the trailer, which carries error detection redundant bits, are also multiples of 8 bits. To separate one frame from the next, an 8-bit (1-byte) flag is added at the beginning and the end of a frame.

Byte stuffing and unstuffing

DATA-LINK LAYER PROTOCOLS

SIMPLE PROTOCOL

Stop-and-Wait Protocol

Random-access In random-access or contention methods, no station is superior to another station and none is assigned control over another. At each instance, a station that has data to send uses a procedure defined by the protocol to make a decision on whether or not to send. This decision depends on the state of the medium (idle or busy). In other words, each station can transmit when it desires on the condition that it follows the predefined procedure, including testing the state of the medium. ALOHA, CSMA, CSMA/CD, CSMA/CA

ALOHA ALOHA, the earliest random access method, was developed at the University of Hawaii in early 1970. It was designed for a radio (wireless) LAN, but it can be used on any shared medium. It is obvious that there are potential collisions in this arrangement. The medium is shared between the stations. When a station sends data, another station may attempt to do so at the same time. The data from the two stations collide and become garbled.

Two frames survive: one frame from station 1 one frame from station 2 We need to mention that even if one bit of a frame coexists on the channel with one bit from another frame, there is a collision and both will be destroyed. It is obvious that we need to resend the frames that have been destroyed during transmission.

Procedure for pure ALOHA protocol

Slotted ALOHA Because a station is allowed to send only at the beginning of the synchronized time slot, if a station misses this moment, it must wait until the beginning of the next time slot. This means that the station which started at the beginning of this slot has already finished sending its frame. Of course, there is still the possibility of collision if two stations try to send at the beginning of the same time slot. However, the vulnerable time is now reduced to one-half, equal to Tfr.

CSMA To minimize the chance of collision and, therefore, increase the performance, the CSMA method was developed. The chance of collision can be reduced if a station senses the medium before trying to use it. Carrier sense multiple access (CSMA) requires that each station first listen to the medium (or check the state of the medium) before sending. In other words, CSMA is based on the principle “sense before transmit” or “listen before talk.”

Space/time model of a collision in CSMA

Vulnerable Time The vulnerable time for CSMA is the propagation time Tp. This is the time needed for a signal to propagate from one end of the medium to the other. When a station sends a frame and any other station tries to send a frame during this time, a collision will result. But if the first bit of the frame reaches the end of the medium, every station will already have heard the bit and will refrain from sending.

Persistence Method

Flow diagram for three persistence methods

CSMA/CD- Carrier sense multiple access with collision detection (CSMA/CD) Collision of the first bits in CSMA/CD

Collision and abortion in CSMA/CD & Flowchart

CSMA/CA- Carrier sense multiple access with collision avoidance

ETHERNET PROTOCOL STANDARD ETHERNET Connectionless and Unreliable Service Frame Format Frame Length

Ethernet Frame – Variable Length Frame

Frame Length Ethernet has imposed restrictions on both the minimum and maximum lengths of a frame. The minimum length restriction is required for the correct operation of CSMA/CD An Ethernet frame needs to have a minimum length of 512 bits or 64 bytes. Part of this length is the header and the trailer. If we count 18 bytes of header and trailer (6 bytes of source address, 6 bytes of destination address, 2 bytes of length or type, and 4 bytes of CRC), then the minimum length of data from the upper layer is 64 − 18 = 46 bytes. If the upper-layer packet is less than 46 bytes, padding is added to make up the difference.

Efficiency of std.Ethernet The ratio of the time used by a station to send data to the time the medium is occupied by this station. The practical efficiency of standard Ethernet has been measured to be in which the parameter “a” is the number of frames that can fit on the medium. It can be calculated as a = (propagation delay)/(transmission delay) The transmission delay is the time it takes a frame of average size to be sent out Propagation delay is the time it takes to reach the end of the medium. As the value of parameter a decreases, the efficiency increases. This means that if the length of the media is shorter or the frame size longer, the efficiency increases.

Implementation of std. ethernet

Encoding in a Standard Ethernet implementation 10Base5 implementation

10Base2 implementation & 10Base-T: Twisted-Pair Ethernet

WIRELESS LAN

Characteristics

ACCESS CONTROL Hidden station problem
Tags