Module 4 - Link Layer
Module 4 - Link Layer
Learning Objective:
After studying this module, students will be able to:
1. Understand the concept of Physical Layer, Packet Switching, Circuit Switching
2. Explain Multiplexing: TDM FDM.
3. Explain Multiple Access: Random Access, Controlled Access, Channelization
4. Know about LAN: Token Ring, FDDI, Ethernet- Fast Ethernet.
5. Understand the concept of Data Link Layer: Protocols, Error Detection and
Correction, Flow Control protocols, Error control protocols
Structure
4.1 Error Detection and Correction
4.2 Medium Access Control – ALOHA, CSMA/CD, CSMA/CA
4.3 Local Area Networks – Addresses and Address Resolution, Switches and Routers,
VLANs, Label Switching
4.4 Summary
4.5 References
4.1 Error Detection and Correction
Bit-level error detection and correction (detecting and correcting bit corruptions in data link
layer frames transmitted from one node to another physically connected neighbour) is
provided by the data link layer. It turns out that these are two services that are often used.
Chapter 3 explained that the transport layer also often provides error detection and correction
services. This section reviews some of the simplest techniques that can be used to detect and
possibly correct such bit errors. A thorough treatment of the theory and implementation of
this subject is itself the subject of many textbooks (e.g. [Schwartz 1980]), and the treatment
here is necessarily brief. The goal here is to intuitively understand the possibilities offered by
error detection and correction techniques, how some simple techniques work, and how they
are used in practice at the data link layer. to confirm.
Figure 5.2-1 shows our survey setup. At the sending node, the data D, which is to be
"protected" against bit errors, is enhanced with an error detection and correction bit EDC.
Data that is usually protected includes not only the datagrams passed by the network layer for
transmission over the link, but also link-level addressing information, sequence numbers, and
other fields in the headers of data link frames. included. Both D and EDC are sent to the
receiving node in link-level frames. A sequence of bits D' and EDC' is received at the
receiving node. Note that D' and EDC' may differ from the original D and EDC due to bit
flips during transmission.
The recipient does not know that the information received contains bit errors. As a result, the
receiver may deliver a corrupted datagram to the network layer, or may be unaware that the
contents of another field in the frame's header have been corrupted.
Therefore, error detection schemes should be chosen to reduce the probability of such
occurrences. In general, more sophisticated error detection and correction techniques (that is,
techniques that are less likely to tolerate undetected bit errors) incur more overhead. More
computation is required to compute and transmit more error detection and correction bits.
Let's examine three techniques for detecting errors in transmitted data. Parity checks (to
illustrate the basic idea behind error detection and correction), checksum schemes (more
commonly used at the transport layer), and cyclic redundancy checks (typically used for data
used in the link layer).
Parity Checking
The simplest form of error detection is to use a single parity bit. Let D in Figure 5 be the
information to be sent
But what if there is an even number of bit errors? You should be confident that this will cause
an undetected error. If the probability of bit errors is small, and one can assume that each bit
is independently erroneous, the probability of multiple bit errors in a packet is very small. In
this case, one parity bit is sufficient.
However, measurements have shown that errors often occur in "bursts" rather than
independently of each other. Clearly there is a need for a more robust error detection scheme
(and, fortunately, it's in use!). But before looking at error detection schemes in use, let's
consider a simple generalization of 1-bit parity to understand error correction techniques.
The most significant (leftmost) bit of G must be 1. Figure 4 shows the key idea behind the
CRC code. Given a data item D, the sender selects r additional bits R and the resulting d+r bit
pattern (interpreted as a binary number) is exact in G using modulo-2 arithmetic. Add them to
D so that it is divisible.
Therefore, the process of error checking with CRC is straightforward. The receiver divides
the received bit d+r by G. If the remainder is non-zero, the receiver knows that an error has
occurred. Otherwise the data is accepted as correct.
All CRC calculations are performed in modulo 2 arithmetic, with no extra carry or borrow in
subtraction. This means that addition and subtraction are identical and both correspond to
bitwise exclusive OR (XOR) of the operands. For example yes
International standards have been defined for 8-, 12-, 16- and 32-bit generators, G. An 8-bit
CRC is used to protect the 5-byte header in ATM cells. The CRC-32 32-bit standard, which
has been adopted in a number of link-level IEEE protocols, uses a generator of
GCRC-32 = 100000100110000010001110110110111
Each of the CRC standards can detect burst errors of less than r+1 bits and any odd number
of bit errors. Furthermore, under appropriate assumptions, a burst of length greater
than r+1 bits is detected with probability 1 - 0.5r. The theory behind CRC codes and even
more powerful codes is beyond the scope of this text.
Working of ARP
When a new computer joins a local area network (LAN), it is given a unique IP address for
identification and communication purposes.
A data packet arrives at the gateway and is intended for a specific host computer. A gateway,
the hardware on a network that allows data to flow from one network to another, asks the
ARP program to find a MAC address that matches an IP address. The ARP cache maintains a
list of each IP address and its associated MAC address.
The ARP cache is dynamic, but users on the network can also configure static ARP tables
containing IP and MAC addresses.
An ARP cache is maintained by all operating systems on IPv4 Ethernet networks. Each time
a device requests a MAC address to send data to another device connected to the LAN, the
device checks her ARP cache to see if an IP to MAC address connection has already been
established. Make sure, If it exists, no new request is needed. However, if translation has not
yet occurred, a request for a network address is sent and ARP is performed.
The size of the ARP cache is limited by design, addresses typically remain in the cache for
only a few minutes. It is emptied periodically to free up disk space. This design is also for
privacy and security to prevent IP address theft and spoofing by cyber attackers. MAC
addresses are fixed, but IP addresses are constantly updated.
Clean-up process removes unused addresses. This also applies to data related to
communication failures with computers that are not connected to the network or powered on.
-ARP is the process of associating a dynamic IP address with a physical machine's MAC
address.
Router Switch
Transmission At Initial Level Broadcast and First broadcast; then unicast &
Type Unicast & Multicast multicast as needed.
Table Store IP address in the Routing table Switches use content accessible
and maintain the address on its own. memory CAM tables which are
typically accessed by ASIC
(Application Specific integrated
chips).
Broadcast In Router, every port has its own Switch has one broadcast domain
Domain Broadcast domain. [unless VLAN implemented]
Used for Connecting two or more networks Connecting two or more nodes in
the same network (L2) or different
network (L3)
Manufacturers Cisco, Netgear, Linksys, Asus, TP- Cisco and D-link Juniper
Link, D-Link
Routing Take faster routing decisions Take more time for complicated
Decision routing decisions
NAT (Network Routers can perform NAT Switches cannot perform NAT
Address
Translation)
4.4 Summary
⮚ The task of the data link layer is to convert the raw bit stream offered by the physical
layer into a stream of frames for use by the network layer.
⮚ Various framing methods are used, including character count, byte stuffing, and bit
stuffing. Data link protocols can provide error control to retransmit damaged or lost
frames.
⮚ To prevent a fast sender from overrunning a slow receiver, the data link protocol can
also provide flow control.
4.5 References
1. Tannenbaum, “Computer Network”, Pearson Education
2. Godbole, “Data Communications and Networking”, Tata Mc Graw-Hill
3. Forouzan,” Communications and Networking”, Tata Mc Graw-Hill