Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

CHAPTER 3: DATA LINK LAYER Framing:

JOBS:  The DLL is responsible for taking the packets of information that it
receives from the network layer and putting them into frames for
 Provides a well-defined interface to the network layer.
transmission.
 Deal with transmission errors.
 Each frame holds the payload plus a header and a trailer
 Regulate the flow of data (so that slow receivers are not
(overhead).
overloaded)
 It is the frames that are transmitted over the physical layer.

 The data link layer sits between the network layer and the physical
layer.
 Provides an interface for the network layer to send information from
one machine to another.
 To network layer, it looks as though the path to the new machine
happens at the DLL, when it is really happening at the physical level.

 Framing translates the physical layer’s raw bit stream into


discrete units called frames.
Four methods:
 Character count
 Flag bytes with byte stuffing
 Starting and ending flags with bit stuffing
 Physical layer coding violations

fig: data flow


1. Character count:
 We use a field in the header to specify the number of characters
in the frame.
 This method can cause problems if the count is garbled in transit.
 The receiver will be able to tell the frame (due to a bad
checksum).
 The receiver will not know where to pick up and the sender will
not know how much to resend.
 This method is rarely used anymore.

Example:

2. Flag bytes with byte stuffing:


 Frames begin and end with special bytes.
 Often used are the same start/end flag.
 If the receiver gets “lost”, it just looks for a pair of flag bytes to
denote the end of one frame and the start of the next.
 Byte stuffing is the process of adding extra byte whenever there
is a flag or escape character in the text.
3. Starting and ending flags with bit stuffing: 4. Physical layer coding violation:
 Use reserved bit patterns to indicate the start and end of a frame.
 For instance, use the 4-bit sequence of 0111 to delimit  When data is a series of 0, it appears as open circuit and when
consecutive frames. A frame consists of everything between two data is a series of 1, it appears as a short circuit.
delimiters.  To avoid this, it is put in transit.
0111 frame 0111 When 0------ -5 to +5
 Problem: What happens if the reserved delimiter happens to When 1------ +5 to -5
appear in the frame itself? If we don’t remove it from the data,
the receiver will think that the incoming frame is actually two
smaller frames.
 Solution: Use bit stuffing. Within the frame, after every Error Control:
occurrence of two consecutive 1’s, insert 0. Example: append a 0
 We use bit and byte stuffing as a method for detecting and
after each pair of 1’s in the data. This prevents 3 consecutive 1’s
determining errors in the data that we send.
from ever appearing in the frame. Likewise, the receiver converts
 We also have to deal with making sure that the frames make it to
two consecutive 1’s followed by a 0 into two 1’s, but recognizes
their destination.
the 0111 sequence as the end of the frame.
 The receiver sends back a control frame acknowledging the
received frame and the condition of the frame.
Example:
 A timeout can occur if the acknowledgement doesn’t arrive,
resulting in the frame being resent.
 Resending the frame can also cause problems – probabilities of
same frame to be received twice or more.
 We can also sequentially number the frames to prevent this
problem.
1. The original data.
2. The data as they appear on the line. Flow control:
3. The data as they are stored in receiver’s memory after
 We must deal with the issue where the sender is sending data at
destuffing.
a higher rate than the receiver can receive the data.
 Flow Problem: Overflow problem of data due to fast transmitter  Data: contains data.
and slow receiver.  Checksum
 There are two approaches to this problem:
1. Feedback based flow control: 01111110 Address Control Data Checksum 01111110
Feedback is used to tell sender how the receiver is doing (8) bit (8) (>=0) (16)
Fig: HDLC frame format
or to send the other frame.
4. Point-to-Point Protocol:
2. Rate based flow control:  For point to point connections within the internet.
The transfer rate is fixed by the sender. This approach is  To connect LANs to backbones.
not often used in the DLL. There will be the pre-  Often used to connect home users to the internet.
communication between transmitter and the receiver.
Transmitter sends data to the receiver at the rate at A typical Dial-up Connection:
which receiver can receive without overflow.

Examples of Data Link Protocols:


1. SDLC (Synchronous Data Link Control protocol):
 Developed by IBM.
 Submitted to ANSI and ISO for acceptance as US and
International standards.

2. ADCCP (Advanced Data Communication Control Procedure)


 Modification of SDLC by ANSI.

3. HDLC (High level Data Link Control)


 Modification of SDLC by ISO.
 Address: used to identify the terminal on lines with multiple  Firstly, the home PC will be connected by modem and
terminals. telephone line.
 Control: used for sequence numbers, acknowledgements and  The physical layer connection will be completed once the ISP
other stuffs. router replies through its pool modem.
 In order to make connection in higher layer, home PC sends a OSI
series of LCP (Link Control Protocol) packets in the payload
Application
field of PPP.
 To connect in the Network layer, a series of NCP (Network Presentation
Control Protocol) packets are sent by ISP router to the home
PC. Session

 This will dynamically assign IP address to home PC. Hence, LOGICAL LINK sublayer
Transport
home PC will be the member of ISP LAN.
 Now, it will be able to receive/send IP packets. Thus, internet Network
can be browsed with the help of dial-up connection.
Framing Error
 While breaking the connection, firstly, NCP breaks Network control Flow
Data Link
Layer connection by releasing IP address. Then, LCP breaks control
the link and modem breaks the physical layer connection.
And telephone line will be free. Physical
MEDIA ACCESS sub-layer

0111111 Address Control Protoco Payloa Checksu 0111111


0 (11111111 (00000011 l (1 o2 d m (2 or 4 0 Transmission/reception of frames
) ) bytes) bytes)
Fig: PPP Fame Format
The channel allocation problem:
MEDIUM ACCESS SUB-LAYER: How to allocate a single broadcast channel among competing users?
 Static
Logical link sub-layer works for framing and error control while media
 Dynamic
access sub-layer works for channel assignment.
Static channel allocation:
The media access sub-layer deals with broadcast networks and their  FDM/TDM (Frequency/Time Division Multiplexing)
protocols.  FDM: Radio/TV broadcasts
 TDM: POTS (Plain Old Telephone System)
 GSM (Global System for Mobile communications)
uses both.
 Wasteful of bandwidth
Dynamic channel allocation:

 Pure/Slotted ALOHA
 Carrie Sense Multiple Access (CSMA) Protocols
 Collision free protocols

Dynamic channel allocation technologies:


1. Pure ALOHA
2. Slotted ALOHA
3. CSMA
4. CSMA/CD (old ethernet)
5. Switching (fast ethernet)
6. Token passing (Token Ring)  Original ALOHA protocol; simple but elegant.
 Each station sends a frame whenever it has a frame to send. However
ALOHA Protocols: since there is only one channel to share, there is the possibility of
 Anyone may transmit whenever they want. (continuous time model) collision between frames from different stations.
 Each radio detects collisions by listening to its own signal. A collision  In pure ALOHA, frames are transmitted almost completely arbitrary
is detected when a sender doesn’t receive the signal that it just sent. period of time.
 After a collision, wait a random amount of time and transmit the
same frame again. This technique is known as backoff.
Slotted ALOHA:

 Synchronous system: time is divided into slots and frames can only be
transmitted at the start of the slot.
Pure ALOHA:  Requires synchronization of clocks.
 Vulnerable period halved: maximum efficiency is doubled.
 Time slot is used so as to manage the collisions.
 Suppose there is only one channel and two computers C1 and C2 are
willing to send data through it. If C1 is transmitting data, it sends
signal to all the other computers notifying that C1 is about to send This problem can be solved if the computers do not wait for a fixed
data. After the time slot has completed, only then C2 can transmit time; rather they should wait for the random number N times. The
data through that channel. possibility of computers that wait for same random number is very
low. This is called N-persistent.

Carrier Sense, Multiple Access (CSMA): P-persistent:


 Works on the principal of probability.
 We can improve the performance of our simple network greatly if we  The probability of an event working is p.
introduce carrier sensing (CS). With carrier sensing, each host listens  The probability of not working is q=1-p.
to the data being transmitted over the cable.
 A host will only transmit its own frames when it cannot hear any data
being transmitted by other hosts. CSMA with Collision Detection (CSMA/CD):
 When a frame finishes, an interframe gap of about 9.6 µsec is allowed
In case, where collision occurs, the transmitter has to wait for a long time
to pass before another host starts transmitting its frame. to verify whether the transmitted data is received or not. To solve this,
 Improves performance when higher medium utilization collision detection is used in place of collision. The detector will inform
 When a node has data to transmit, the node first listens to the cable the transmitter that collision has occurred so that it doesn’t have to wait
(using a transceiver) to see if a carrier (signal) is being transmitted by for a long time.
another node.
 Simple but doesn’t specify any collision detection and handling. So The 802.3 standard describes the operation of the MAC sub-layer in a bus
collisions may and will occur and clearly then, this is not a very good LAN that uses CSMA/CD. The standard also describes the format of the
protocol for large, load intensive networks. frames and the type of encoding used for transmitting frames. The
minimum length of frames can be varied from network to network. This is
Consider computers C1, C2, and C3 are willing to send data through a important because, depending on the size of the network, the frames
channel. At first, C1 transmits data. In the due course of transmission, must be of suitable minimum length. The standard also makes some
C2 and C3 check the status of the channel at the same time. Both find suggestions about the type of cabling that should be used for CSMA/CD
the channel to be busy, so they wait for time T. After time T, both C2 bus LANs. The CSMA/CD Bus LAN is also widely called as Ethernet.
and C3 check the channel and find it free, so they start to initiate the
CSMA/CD can be in one of three states: contention, transmission, or idle.
process of data transmission which can lead to collision.
people from general motor company and others developed 802.4 also
considering worst-case behavior of a ring.

802.4 is physical bus and logical ring topology, with each station knowing
the address of the station to its logical left and right. When logical ring is
initialized, highest number station may send first frame and passes
permission to its immediate neighbor by sending a special control frame
called a token. The token propagates around the logical ring, with only
Preamble SOF (1 Dest.addr. Source addr. Length (2 Data (0- Pad CRC (4 the token holder being permitted to transmit frame. Since only one
(7 bytes) byte) (6 bytes) (6 bytes) bytes) 1500by (0-46 bytes) station at a time holds the token, collisions do not occur.
tes) bytes
)
Fig: frame format of IEEE 802.3

 7 bytes preamble, each containing patterns of 101010 which


produces 10 MHz square wave to synchronize the clock.
 2 or 6 bytes of address of 10 Mbps LAN.
 Length field specifies the length of frame.
 Valid frame must be at least 64 bytes length in 802.3 standard and
make it distinguished from garbage.
Speeds of 1, 5 and 10 Mbps are possible in 802.4. The MAC protocol has
provisions for adding stations to and deleting stations from the ring. For
802.4 token Bus: the physical layer, token bus uses the broadband coaxial cable used for
the cable television. Three different analog modulation schemes are
Although 802.3 is most widely used in offices, but little bad luck station permitted: phase continuous frequency shift keying, phase coherent
might have to wait arbitrary long time to send frame. There are also no frequency shift keying and multilevel duo-binary amplitude modulated
priorities in 802.3, making them unsuited for real time systems in which phase shift keying. So physical layer of 802.4 is totally incompatible with
important frames should not held up waiting for unimportant frames. So 802.3 and more complicated too.
Preamble SD (1 FC (1 Dest. Source Data Checksum ED (1 In token ring special bit pattern, called the token, circulates around the
(1 byte) byte) byte) Addr. addr. (0- (4 bytes) byte) ring whenever all stations are idle. When a station wants to transmit a
(2-6 (2-6 8182 frame, it is required to seize the token and remove it from the ring before
byte) byte) byte)
transmitting. This action is done by inverting a single bit in the 3 byte
token, which instantly changes it into the first 3 bytes of normal data.
Frame control (FC): distinguish data frames and control frames Because there is only one token, only one station can transmit at a given
instant, thus solving the channel access problem the same way token bus
Preamble: to sync with receiver’s clock solves it.

SD/ED: to mark frame boundaries A station may hold the token for the token holding time, which is 10 ms
unless an installation sets a different value. After all frames transmitted
Checksum: used in error detection
or the transmission of another frame would exceed the token holding
802.5 Token Ring: time, the station regenerates the token.

Ring technology is a collection of point-to-point links that happen to a


form of circle, not a broadcast medium, which supports to run twisted 802.5 token ring frame format:
pair, coax and fiber optics cables. Each bit arriving at an interface of the
ring is copied into a 1-bit buffer and then copied out onto the ring again. SD AC FC DA SA Data Checksum ED FS
While in the buffer, the bit can be inspected and possibly modified before
being written out. This copying step introduces 1-bit delay at each Bytes 1 1 1 2 or 6 2 or 6 No limit 4 1 1
interface. Where,

-SD and ED indicates beginning and ending of the frame

-AC (Access control) contains the token bit, and also monitor bit, priority
bits, and reservation bits

-FC (Frame control) byte distinguishes data frames from various possible
control frames as 802.4
Fig. Token Ring
-Data may be as long as necessary, provided that the frame can still be  FDDI deals with network reliable issues as mission-critical
transmitted within the token holding time. applications were implemented on high speed networks. It is
frequently used as a backbone technology, and to connect high
-FS (frame status) contains the A and C bits. When the sending station speed computer on LAN
drain the frame from the ring, it examines the A and C bits. Three  Based on two counter–rotating fiber rings, only one used at a
combinations are possible: time and next is for backup. So if there is any problem in one ring,
next ring works automatically
A=0 and C=0; destination not present or not powered up.  It allows 16 to 48 bits address and maximum frame size is 4500
bytes
A=1 and C=0; destination present but frame not accepted  It prefers multimode fiber optic cable rather than single mode as
multimode reduces cost for high data transmission
A=1 and C=1; destination present and frame copied  It prefers LEDs instead of Laser for light source not only for
cheaper but also to remove accidental chances at user end
connector (if user open connector and sees cable by naked eye,
eye may damage on laser light)
At physical layer, 802.5 call for STP (Shielded Twisted Pair) running at 1 or  It operates at low error (1 bit error for 2.5 x 1010 )
4 Mbps, although IBM later introduced a 16 Mbps version. Signals are  It uses 4B/5B encoding in place of Manchester encoding in Token
encoded with differential Manchester encoding, also permitting high-high Ring
and low-low in certain control bits, as normally differential Manchester  It capture token before transmitting and does not wait for
acknowledgement to regenerate token as ring might be very long
encoding uses high-low or low-high for each bit.
and may occurs much delay to wait for ACK.
One major problem in ring network is that if the cable breaks somewhere,  In normal operation, the token and frames travel only on the
primary ring in a single direction. The second ring transmits idle
the ring dies. One solution to this problem is wire center with bypass
signals in the opposite direction
relay.  If a cable or device becomes disabled, the primary ring raps back
around onto the secondary ring
 Stations may be directly connected to FDDI dual ring or attached
to FDDI concentrator. There are three types of nodes:
FDDI (Fiber Distributed Data Interface):
-DAS (Dual attachment station)
 Similar to Token ring in the sense that it share some features such
as topology(ring) and media access technique(token-passing) -SAS (Single attachment station)
 High performance Fiber Optic token ring running at 100 mbps
-DAC(Dual attachment concentrator)
over distance 200 KM and permits up to 1000 stations
 FDDI deploys following timers:
-Token holding time: upper limit on how long a station
can hold token Where, B=Byte, SD=start of delimiter, FC= frame control, DA=source
address
-Token Rotation time: how long it takes the token to
traverse the ring or the interval between two successive SA=source address, ED= end of delimiter, FS= Frame status
arrivals of the token

 There are four specifications in FDDI. SAS


 Media Access control- deals with how medium is accessed,
SAS
frame format, token handling, addressing, fair and equal
access of the ring through the use of the timed token,
guarantee bandwidth for special traffic etc. SAS
 Physical layer protocol-deals with data encoding/decoding
procedures, establish clock synchronization, data recovery
from incoming signal etc.
DAC
 Physical layer medium- defines characteristics of transmission
medium, fiber optic link type: single mode, multimode;
power levels, bit error rates, optical components: connectors,
switches, LEDs, Pin etc.
 Station Management- defines FDDI station configuration, ring
configuration, ring control features, station insertion and DAS DAS
removal, initialization etc. Fig: FDDI Dual Ring

Frame format:
SONET (Synchronous Optical NETwork):

It is a standard synchronous optical TDM system, developed to fulfill the


Preamble SD FC DA SA Data Checksum ED FS need to connect to multiple long distance-carriers of local telephone
companies. It is controlled by a master clock with an accuracy of about 1
part in 109. Virtually all the long-distance telephone traffic in the United
8B 1B 1 B 2 or 6 B 2or 6B 4500 B 4B 1B 1B States and much of it elsewhere uses trunks running SONET. As SONET
chips becomes cheaper, SONET interface boards for computer may  The two basic designs are:
become more widespread, so it may become easier for companies to plug  Single-switch VLANs
their computers directly into the telephone network over specially  Multi-switch VLANs
conditioned leased lines.
Single switch VLANs:
A SONET system consists of switches, multiplexers, and repeaters, all
 Computers are assigned to VLANs using special software, but
connected by fiber. A path from a source to destination with one
physically connected together using a large physical switch.
intermediate multiplexer and one intermediate repeater is shown in fig
 Computers can be assigned to VLANs in four ways:
below. In SONET terminology, a fiber going directly from any device to
 Port based VLANs assigns computers according to the
any device with nothing between is called a section. A run between two
VLAN switch port to which they are attached.
multiplexers (possibly one or more repeater in middle) is called a line.
 MAC based VLANs assign computers according to each
Connection between the source and the destination (possibly with one or
computer’s data link layer address.
more multiplexers and repeaters is called path.
 IP based VLANs assign computers using their IP address.
The basic SONET frame is block of 810 bytes put out every 125 µsec. Since  Application based VLANs assign computers depending on
SONET is synchronous, frames are emitted whether or not there are any the application that the computer typically uses. This has
useful data to send. Having 8000 frames/sec exactly matches the the advantage of allowing precise allocation of network
sampling rate of the PCM channels used in all digital telephony systems. capacity.

The basic SONET channel (STS-1; synchronous transport signal-1) has the IEEE 802.11 – Wireless Ethernet:
capacity of 51.84 Mbps (8x810) bits in 125 µsec. All SONET trunks are a
 Two configurations:
multiple of STS-1. STS-48 or OC-48 (consisting of 48 STS-1 or OC-1) has
 Ad-hoc: no central control, no connection to the outside
the capacity of 2.488Gbps, high bandwidth range.
world.
VLAN (Virtual LAN):  Infrastructure: uses fixed network access point to connect to
the outside world.
 VLANs are a new type of LAN/BN architecture using intelligent, high-  It doesn’t implement collision detection because it can’t detect
speed switches. collisions at the receiver end (hidden terminal problem).
 VLANs assign computers to LAN segments by using software.  To avoid collisions, the frames contains field indicating the length of
 Standardized as IEEE802.1q and IEEE 802.1p. transmission. Other stations defer transmission.
 802.11 lives in physical layer and data link layer in the OSI.
 IEEE 802.11b (WiFi) is a wireless LAN technology that is growing
rapidly in popularity. It is convenient, inexpensive and easy to use.
Uses: airports, hotels, bookstores, parks, etc.
Estimates: 70% of WLANs are insecure.

FC Duration Addr. Addr. Addr. Seq. Addr. Data Checksum


2B 2B 1 (6B) 2 (6B) 3 (6B) (2B) 4 (6B) (0- (4B)
2312B)
Fig: the 802.11 frame structure

You might also like