II B.
Sc Honor CSC (Semester IV) Data Communication and Computer Network
UNIT - II
THE DATA LINK LAYER:
1. Design issues
2. Error detection and correction
3. Elementary data link protocols
4. Sliding window protocols
5. Example data link protocols - HDLC, the data link layer on the internet.
THE MEDIUM ACCESS SUBLAYER:
6. Channel allocations problem
7. Multiple access protocols
8. Ethernet
9. Wireless LAN
10. Broadband Wireless
11. Bluetooth
12. Data Link Layer switching
Department of Computer Science, TJPS College, Guntur. 1
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
1. Explain the Data Link Layer Design issues.
The data link layer uses the services of the physical layer to send and receive bits over
communication channels. It has a number of functions, including:
1. Providing a well-defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating the flow of data so that slow receivers are not swamped by fast senders.
To accomplish these goals, the data link layer takes the packets it gets from the
network layer and encapsulates them into frames for transmission. Each frame contains a frame
header, a payload field for holding the packet, and a frame trailer.
1. Services Provided to the Network Layer: The function of the data link layer is to provide
services to the network layer. The principal service is transferring data from the network layer on
the source machine to the network layer on the destination machine. The job of the data link
layer is to transmit the bits to the destination machine so they can be handed over to the network
layer.
Three reasonable possibilities that are commonly provided are
Department of Computer Science, TJPS College, Guntur. 2
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
A). Unacknowledged connectionless service: It consists of having the source machine send
independent frames to the destination machine without having the destination machine
acknowledge them.
B). Acknowledged connectionless service: When this service is offered, there are still no
logical connections used, but each frame sent is individually acknowledged.
C). Acknowledged connection-oriented service: It has three distinct phases.
1. Connection is established by having both sides initialize variables and counters needed to keep
track of which frames have been received and which ones have not.
2. One or more frames are actually transmitted.
3. The connection is released, freeing up the variables, buffers, and other resources used to
maintain the connection.
2. Framing: To provide service to the network layer, the data link layer must use the service
provided to it by the physical layer. What the physical layer does is accept a raw bit stream and
attempt to deliver it to the destination. Breaking up the bit stream into frames is more difficult
than it at first appears. In this section we will look at four methods:
A). Character count: A field in the header to specify the number of characters in the frame.
When the data link layer at the destination sees the character count, it knows how many
characters follow and hence where the end of the frame is. This technique is shown in, for four
frames of sizes 5, 5, 8, and 8 characters, respectively.
The trouble with this algorithm is that the count can be garbled by a transmission error. For
example, if the character count of 5 in the second frame becomes a 7, the destination will get out
of synchronization and will be unable to locate the start of the next frame. Since the destination
does not know how many characters to skip over to get to the start of the retransmission. For this
reason, the character count method is rarely used anymore.
Department of Computer Science, TJPS College, Guntur. 3
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
B). Flag bytes with byte stuffing: The second framing method gets around the problem of
resynchronization after an error by having each frame start and end with special bytes. Often the
same byte, called a flag byte, is used as both the starting and ending delimiter. This byte is
shown as FLAG. Two consecutive flag bytes indicate the end of one frame and the start of the
next. Thus, if the receiver ever loses synchronization it can just search for two flag bytes to find
the end of the current frame and the start of the next frame.
C). Starting and ending flags, with bit stuffing: The new technique allows data frames to
contain an arbitrary number of bits and allows character codes with an arbitrary number of bits
per character. It works like this. Each frame begins and ends with a special bit pattern, 01111110.
Whenever the sender's data link layer encounters five consecutive 1s in the data, it automatically
stuffs a 0 bit into the outgoing bit stream.
Bit stuffing. (a) The original data. (b) The data as they appear on the line. (c) The data as
they are stored in the receiver's memory after destuffing.
Department of Computer Science, TJPS College, Guntur. 4
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
D). Physical layer coding violations: The last method of framing is only applicable to networks
in which the encoding on the physical medium contains some redundancy. Many data link
protocols use a combination of a character count with one of the other methods for extra safety.
Only if the appropriate delimiter is present at that position and the checksum is correct is the
frame accepted as valid. Otherwise, the input stream is scanned for the next delimiter.
3. Error Control: If the sender receives a positive acknowledgement about a frame, it knows the
frame has arrived safely. On the other hand, a negative acknowledgement means that something
has gone wrong, and the frame must be transmitted again. The whole issue of managing the
timers and sequence numbers so as to ensure that each frame is ultimately passed to the network
layer at the destination exactly once, no more and no less, is an important part of the data link
layer's duties.
4. Flow Control: This situation can easily occur when the sender is running on a fast computer
and the receiver is running on a slow machine. Two approaches are commonly used.
A).Feedback-based flow control, the receiver sends back information to the sender giving it
permission to send more data or at least telling the sender how the receiver is doing.
B).Rate-based flow control, the protocol has a built-in mechanism that limits the rate at which
senders may transmit data, without using feedback from the receiver.
-----------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
2. Explain the Error detection and correction.
1. Error-Correcting Codes: Network designers have developed two basic strategies for dealing
with errors. One way is to include enough redundant information along with each block of data
sent, to enable the receiver to deduce what the transmitted data must have been. The other way is
to include only enough redundancy to allow the receiver to deduce that an error occurred, but not
which error, and have it request a retransmission. The use of error-correcting codes is often
referred to as forward error correction.
Normally, a frame consists of m data (i.e., message) bits and r redundant, or check, bits.
Let the total length be n (i.e., n = m + r). Given any two code words, say, 10001001 and
10110001, it is possible to determine how many corresponding bits differ. In this case, 3 bits
differ. To determine how many bits differ, just exclusive OR the two code words and count the
number of 1 bits in the result, for example:
The number of bit positions in which two code words differ is called the Hamming distance.
Department of Computer Science, TJPS College, Guntur. 5
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
2. Error-Detecting Codes: Error-correcting codes are widely used on wireless links, which are
notoriously noisy and error prone when compared to copper wire or optical fibers. The error rate
is much lower, so error detection and retransmission is usually more efficient. Polynomial
arithmetic is done modulo 2, according to the rules of algebraic field theory. There are no carries
for addition or borrows for subtraction. Both addition and subtraction are identical to exclusive
OR. For example:
The algorithm for computing the checksum is as follows:
1. Let r be the degree of G(x). Append r zero bits to the low-order end of the frame so it now
contains m + r bits and corresponds to the polynomial xrM(x).
2. Divide the bit string corresponding to G(x) into the bit string corresponding to x rM(x), using
modulo 2 division.
3. Subtract the remainder (which is always r or fewer bits) from the bit string corresponding to
xrM(x) using modulo 2 subtraction. The result is the check summed frame to be transmitted. Call
its polynomial T(x).
Illustrates the calculation for a frame 1101011011 using the generator G(x) = x4 + x + 1.
-----------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
Department of Computer Science, TJPS College, Guntur. 6
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
3. Explain the Elementary data link protocols.
1. An Unrestricted Simplex Protocol: Data are transmitted in one direction only. Both the
transmitting and receiving network layers are always ready. Processing time can be ignored.
Infinite buffer space is available. And best of all, the communication channel between the data
link layers never damages or loses frames.
The protocol consists of two distinct procedures, a sender and a receiver. The sender runs in the
data link layer of the source machine, and the receiver runs in the data link layer of the
destination machine. No sequence numbers or acknowledgements are used here, so MAX_SEQ
is not needed. The only event type possible is frame_arrival.
2. A Simplex Stop-and-Wait Protocol: Protocols in which the sender sends one frame and then
waits for an acknowledgement before proceeding are called stop-and-wait. An example of a
simplex stop-and- wait protocol.
Department of Computer Science, TJPS College, Guntur. 7
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Although data traffic in this example is simplex, going only from the sender to the receiver,
frames do travel in both directions. Consequently, the communication channel between the two
data link layers needs to be capable of bidirectional information transfer.
3. A Simplex Protocol for a Noisy Channel: At first glance it might seem that a variation of
protocol 2 would work: adding a timer. The sender could send a frame, but the receiver would
only send an acknowledgement frame if the data were correctly received. If a damaged frame
arrived at the receiver, it would be discarded.
Consider the following scenario:
1. The network layer on A gives packet 1 to its data link layer. The packet is correctly received at
B and passed to the network layer on B. B sends an acknowledgement frame back to A.
2. The acknowledgement frame gets lost completely. It just never arrives at all. Life would be a
great deal simpler if the channel mangled and lost only data frames and not control frames, but
sad to say, the channel is not very discriminating.
3. The data link layer on A eventually times out. Not having received an acknowledgement, it
assumes that its data frame was lost or damaged and sends the frame containing packet 1 again.
Department of Computer Science, TJPS College, Guntur. 8
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
4. The duplicate frame also arrives at the data link layer on B perfectly and is unwittingly passed
to the network layer there. If A is sending a file to B, part of the file will be duplicated (i.e., the
copy of the file made by B will be incorrect and the error will not have been detected). In other
words, the protocol will fail.
-----------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
4. Explain the Sliding window protocols.
1. A One-Bit Sliding Window Protocol: A sliding window protocol with a maximum window
size of 1. Such a protocol uses stop-and-wait since the sender transmits a frame and waits for its
acknowledgement before sending the next one. It starts out by defining some variables.
Next_frame_to_send tells which frame the sender is trying to send. Similarly, frame_expected
tells which frame the receiver is expecting. In both cases, 0 and 1 are the only possibilities.
Department of Computer Science, TJPS College, Guntur. 9
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
2. A Protocol Using Go Back N: The transmission time required for a frame to arrive at the
receiver plus the transmission time for the acknowledgement to come back is negligible.
Sometimes this assumption is clearly false. In these situations the long round-trip time can have
important implications for the efficiency of the bandwidth utilization.
As an example, consider a 50-kbps satellite channel with a 500-msec round-trip
propagation delay. Let us imagine trying to use protocol 4 to send 1000-bit frames via the
satellite. At t = 0 the sender starts sending the first frame. At t = 20 msec the frame has been
completely sent. Not until t =270 msec has the frame fully arrived at the receiver, and not until
t = 520 msec has the acknowledgement arrived back at the sender, under the best of
circumstance. This means that the sender was blocked during 500/520 or 96 percent of the time.
In other words, only 4 percent of the available bandwidth was used.
This technique is known as pipelining. If the channel capacity is b bits/sec, the frame size
l bits, and the roundtrip propagation time R sec, the time required to transmit a single frame is l/b
sec. After the last bit of a data frame has been sent, there is a delay of R/2 before that bit arrives
at the receiver and another delay of at least R/2 for the acknowledgement to come back, for a
total delay of R.
Pipelining and error recovery. Effect of an error when (a) receiver's window size is 1 and
(b) receiver's window size is large.
Two basic approaches are available for dealing with errors in the presence of pipelining.
Department of Computer Science, TJPS College, Guntur. 10
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
1) One way, called go back n, is for the receiver simply to discard all subsequent frames, sending
no acknowledgements for the discarded frames. This strategy corresponds to a receive window
of size 1.
2) The data link layer refuses to accept any frame except the next one it must give to the network
layer. If the sender's window fills up before the timer runs out, the pipeline will begin to empty.
Eventually, the sender will time out and retransmit all unacknowledged frames in order, starting
with the damaged or lost one. This approach can waste a lot of bandwidth if the error rate is high.
3. A Protocol Using Selective Repeat: In this protocol, both sender and receiver maintain a
window of acceptable sequence numbers. The sender's window size starts out at 0 and grows to
some predefined maximum, MAX_SEQ. The receiver's window, in contrast, is always fixed in
size and equal to MAX_SEQ.
(a) Initial situation with a window of size seven. (b) After seven frames have been sent and
received but not acknowledged. (c) Initial situation with a window size of four. (d) After
four frames have been sent and received but not acknowledged.
-----------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
5. Explain the Example data link protocols.
I ). HDLC (High-Level Data Link Control): The data link protocol first used in the IBM
mainframe world: SDLC (Synchronous Data Link Control) protocol. After developing SDLC,
IBM submitted it to ANSI and ISO for acceptance as U.S. and international standards,
respectively. ANSI modified it to become ADCCP (Advanced Data Communication Control
Procedure), and ISO modified it to become HDLC (High-level Data Link Control). All the bit-
oriented protocols use the frame structure.
Frame format for bit-oriented protocols
Address: It is primarily of importance on lines with multiple terminals, where it is used to
identify one of the terminals.
Control: It is used for sequence numbers, acknowledgements, and other purposes.
Department of Computer Science, TJPS College, Guntur. 11
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Data: It may contain any information.
Checksum: It is a cyclic redundancy code using the technique.
Frame: It is delimited with another flag sequence (01111110). On idle point-to-point lines, flag
sequences are transmitted continuously. The minimum frame contains three fields and totals 32
bits, excluding the flags on either end.
Control field of (a) an information frame, (b) a supervisory frame, (c) an unnumbered
frame.
There are three kinds of frames:
1. Information frame: The Seq field is the frame sequence number. The Next field is a
piggybacked acknowledgement. The P/F bit stands for Poll/Final. It is used when a computer (or
concentrator) is polling a group of terminals. When used as P, the computer is inviting the
terminal to send data. All the frames sent by the terminal, except the final one, have the P/F bit
set to P. The final one is set to F.
2. Supervisory frame: It is immediately rather than waiting for reverse traffic onto which to
piggyback the window information. The various kinds of Supervisory frames are distinguished
by the Type field.
a) Type 0: It is an acknowledgement frame used to indicate the next frame expected. This frame
is used when there is no reverse traffic to use for piggybacking.
b) Type 1: It is a negative acknowledgement frame. It is used to indicate that a transmission
error has been detected. The Next field indicates the first frame in sequence not received
correctly. The sender is required to retransmit all outstanding frames starting at Next.
c) Type 2: It is RECEIVE NOT READY. It acknowledges all frames up to but not including
Next, just as RECEIVE READY does, but it tells the sender to stop sending.
d) Type 3: It is the SELECTIVE REJECT. It calls for retransmission of only the frame specified.
3. Unnumbered frame: It is sometimes used for control purposes but can also carry data when
unreliable connectionless service is called for.
Department of Computer Science, TJPS College, Guntur. 12
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
II ). The Data Link Layer in the Internet: The Internet consists of individual machines (hosts
and routers) and the communication infrastructure that connects them. Within a single building,
LANs are widely used for interconnection, but most of the wide area infrastructure is built up
from point-to-point leased lines.
The point-to-point communication is primarily used in two situations.
First, thousands of organizations have one or more LANs, each with some number of
hosts along with a router. Often, the routers are interconnected by a backbone LAN.
The second situation in which point-to-point lines play a major role in the Internet is the
millions of individuals who have home connections to the Internet using modems and
dial-up telephone lines.
A home personal computer acting as an Internet host.
PPP (The Point-to-Point Protocol): PPP provides three features:
1. A framing method that unambiguously delineates the end of one frame and the start of the next
one. The frame format also handles error detection.
2. A link control protocol for bringing lines up, testing them, negotiating options, and bringing
them down again gracefully when they are no longer needed. This protocol is called LCP (Link
Control Protocol). It supports synchronous and asynchronous circuits and byte-oriented and bit-
oriented encodings.
3. A way to negotiate network-layer options in a way that is independent of the network layer
protocol to be used. The method chosen is to have a different NCP (Network Control Protocol)
for each network layer supported.
The LCP protocol also allows lines to be taken down when they are no longer needed. Eleven
types of LCP frames are defined in RFC 1661.
Department of Computer Science, TJPS College, Guntur. 13
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
The LCP frame types.
-----------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
6. Explain Channel allocations problem.
1. Static Channel Allocation in LANs and MANs:
The traditional way of allocating a single channel, such as a telephone trunk, among multiple
competing users is Frequency Division Multiplexing (FDM). If there are N users, the
bandwidth is divided into N equal-sized portions, each user being assigned one portion.
Since each user has a private frequency band, there is no interference between users. When
there is only a small and constant number of users, each of which has a heavy load of traffic ,
FDM is a simple and efficient allocation mechanism.
From queueing theory it can be shown that for Poisson arrival and service times.
The mean time delay, T, for a channel of capacity C bps, with an arrival rate of λ frames/sec,
each frame having a length drawn from an exponential probability density function with mean
1/μ bits/frame.
Now let us divide the single channel into N independent subchannels, each with capacity C/N
bps. The mean input rate on each of the subchannels will now be λ/N. Recomputing T we get
2. Dynamic Channel Allocation in LANs and MANs:
This area is five key assumptions:
Station Model: The model consists of N independent stations, each with a program or user that
generates frames for transmission. Stations are sometimes called terminals.
Single Channel Assumption: A single channel is available for all communication. All stations
can transmit on it and all can receive from it.
Department of Computer Science, TJPS College, Guntur. 14
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Collision Assumption: If two frames are transmitted simultaneously, they overlap in time
and the resulting signal is garbled. This event is called a collision. All stations can detect
collisions. A collided frame must be transmitted again later. There are no errors other than
those generated by collisions.
4a. Continuous Time: Frame transmission can begin at any instant. There is no master clock
dividing time into discrete intervals.
4b. Slotted Time: Time is divided into discrete intervals (slots). Frame transmissions always
begin at the start of a slot. A slot may contain 0, 1, or more frames, corresponding to an idle slot,
a successful transmission, or a collision, respectively.
5a. Carrier Sense: Stations can tell if the channel is in use before trying to use it. If the
channel is sensed as busy, no station will attempt to use it until it goes idle.
5b. No Carrier Sense: Stations cannot sense the channel before trying to use it. They just go
ahead and transmit. Only later can they determine whether the transmission was successful.
---------------------------------XXXXXXXXXXXXXXXXXXXX------------------------------------
7. Explain the Multiple access protocols.
1. ALOHA: It is used ground-based radio broadcasting, the basic idea is applicable to any
system in which uncoordinated users are competing for the use of a single shared channel. There
are two versions of ALOHA here: pure and slotted.
Pure ALOHA:
How it works: In Pure ALOHA, devices send data when they have it to transmit, and if a
collision occurs, they simply wait for a random amount of time before retransmitting.
Collision Detection: There is no mechanism to detect collisions in real-time. After
sending a message, the device waits for an acknowledgment. If it doesn't receive the
acknowledgment within a specific time window, it assumes a collision occurred and
retries.
Efficiency: The protocol is simple but inefficient, especially under heavy traffic, because
collisions can occur frequently, and devices keep retransmitting in a random order.
Slotted ALOHA:
How it works: Slotted ALOHA improves on Pure ALOHA by dividing the time into
discrete time slots. Devices can only begin transmitting at the start of a time slot. If a
collision occurs, devices wait for a random amount of time before retransmitting in the
next available slot.
Collision Detection: Similar to Pure ALOHA, there is no real-time collision detection.
Instead, devices wait for a timeout period to check for acknowledgments.
Department of Computer Science, TJPS College, Guntur. 15
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Efficiency: Slotted ALOHA improves efficiency by reducing the chances of overlap
between transmissions. The maximum throughput is still relatively low, but better than
Pure ALOHA.
2. Carrier Sense Multiple Access Protocols: Protocols in which stations listen for a carrier and
act accordingly are called carrier sense protocols.
Persistent and Nonpersistent CSMA:
The first carrier sense protocol is called 1-persistent CSMA. When a station has data to send, it
first listens to the channel to see if anyone else is transmitting at that moment. If the channel is
busy, the station waits until it becomes idle. When the station detects an idle channel, it transmits
a frame. If a collision occurs, the station waits a random amount of time and starts all over again.
The protocol is called 1-persistent because the station transmits with a probability of 1 when it
finds the channel idle.
A second carrier sense protocol is nonpersistent CSMA. In this protocol, a conscious attempt is
made to be less greedy than in the previous one. Before sending, a station senses the channel. If
no one else is sending, the station begins doing so itself.
CSMA with Collision Detection: if two stations sense the channel to be idle and begin
transmitting simultaneously, they will both detect the collision almost immediately. Rather than
finish transmitting their frames, which are irretrievably garbled anyway, they should abruptly
stop transmitting as soon as the collision is detected. Quickly terminating damaged frames saves
time and bandwidth. This protocol, known as CSMA/CD is widely used on LANs in the MAC
sublayer.
3. Collision-Free Protocols: Although collisions do not occur with CSMA/CD once a station
has unambigously seized the channel, they can still occur during the contention period. These
collisions adversely affect the efficiency of transmission.
A Bit-Map Protocol: Each contention period consists of exactly N slots. If station 0 has a frame
to send, it transmits a 1 bit during the zeroth slot. No other station is allowed to transmit during
this slot. Regardless of what station 0 does, station 1 gets the opportunity to transmit a 1 during
slot 1, but only if it has a frame queued. In general, station j may announce that it has a frame to
send by inserting a 1 bit into slot j. After all N slots have passed by, each station has complete
knowledge of which stations wish to transmit.
Department of Computer Science, TJPS College, Guntur. 16
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Protocols like this in which the desire to transmit is broadcast before the actual transmission are
called reservation protocols.
Binary Countdown: A station wanting to use the channel now broadcasts its address as a binary
bit string, starting with the high-order bit. All addresses are assumed to be the same length. The
bits in each address position from different stations are BOOLEAN ORed together. We will call
this protocol binary countdown.
To avoid conflicts, an arbitration rule must be applied: as soon as a station sees that a highorder
bit position that is 0 in its address has been overwritten with a 1, it gives up. For
example, if stations 0010, 0100, 1001, and 1010 are all trying to get the channel, in the first bit
time the stations transmit 0, 0, 1, and 1, respectively. These are ORed together to form a 1.
Stations 0010 and 0100 see the 1 and know that a higher-numbered station is competing for the
channel, so they give up for the current round. Stations 1001 and 1010 continue.
The binary countdown protocol. A dash indicates silence.
4. Limited-Contention Protocols: We have now considered two basic strategies for channel
acquisition in a cable network: contention, as in CSMA, and collision-free methods. It does with
respect to the two important performance measures, delay at low load and channel efficiency at
high load. Under conditions of light load, contention is preferable due to its low delay. As the
load increases, contention becomes increasingly less attractive, because the overhead associated
with channel arbitration becomes greater. Just the reverse is true for the collision-free protocols.
At low load, they have high delay, but as the load increases, the channel efficiency improves
rather than gets worse as it does for contention protocols.
The Adaptive Tree Walk Protocol: In the first contention slot following a successful frame
transmission, slot 0, all stations are permitted to try to acquire the channel. If one of them does
so, fine. If there is a collision, then during slot 1 only those stations falling under node 2 in the
tree may compete. If one of them acquires the channel, the slot following the frame is reserved
Department of Computer Science, TJPS College, Guntur. 17
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
for those stations under node 3. If, on the other hand, two or more stations under node 2 want to
transmit, there will be a collision during slot 1, in which case it is node 4's turn during slot 2.
The tree for eight stations.
5. Wavelength Division Multiple Access Protocols:
Wavelength division multiple access.
The protocol supports three traffic classes : (1) constant data rate connection-oriented traffic,
such as uncompressed video, (2) variable data rate connection-oriented traffic, such as file
transfer, and (3) datagram traffic, such as UDP packets. For the two connection-oriented
protocols, the idea is that for A to communicate with B, it must first insert a CONNECTION
REQUEST frame in a free slot on B's control channel. If B accepts, communication can take
place on A's data channel.
Each station has two transmitters and two receivers, as follows:
1. A fixed-wavelength receiver for listening to its own control channel.
2. A tunable transmitter for sending on other stations' control channels.
Department of Computer Science, TJPS College, Guntur. 18
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
3. A fixed-wavelength transmitter for outputting data frames.
4. A tunable receiver for selecting a data transmitter to listen to.
6. Wireless LAN Protocols: The number of mobile computing and communication devices
grows, so does the demand to connect them to the outside world. To achieve true mobility,
notebook computers need to use radio signals for communication. Its bandwidth is 11 to 54
Mbps.
The radio range is such that A and B are within each other's range and can potentially
interfere with one another. C can also potentially interfere with both B and D, but not with A.
A wireless LAN. (a) A transmitting. (b) B transmitting.
The problem of a station not being able to detect a potential competitor for the medium because
the competitor is too far away is called the hidden station problem.
when in fact such a transmission would cause bad reception only in the zone between B and C,
where neither of the intended receivers is located. This is called the exposed station problem.
MACA and MACAW: An early protocol designed for wireless LANs is MACA (Multiple
Access with Collision Avoidance). The basic idea behind it is for the sender to stimulate the
receiver into outputting a short frame, so stations nearby can detect this transmission and avoid
transmitting for the duration of the upcoming (large) data frame.
The MACA protocol. (a) A sending an RTS to B. (b) B responding with a CTS to A.
Let us now consider how A sends a frame to B. A starts by sending an RTS (Request To Send)
frame to B. This short frame (30 bytes) contains the length of the data frame that will eventually
Department of Computer Science, TJPS College, Guntur. 19
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
follow. Then B replies with a CTS (Clear to Send) frame. The CTS frame contains the data
length (copied from the RTS frame). Upon receipt of the CTS frame, A begins transmission.
MACA to improve its performance and renamed their new protocol MACAW (MACA for
Wireless). They added a mechanism for stations to exchange information about congestion and a
way to make the backoff algorithm react less violently to temporary problems, to improve
system performance.
-----------------------------------XXXXXXXXXXXXXXXXXXXXX----------------------------------
8. Explain Ethernet.
1. Ethernet Cabling: Since the name ''Ethernet'' refers to the cable. Four types of cabling are
commonly used.
The most common kinds of Ethernet cabling.
2. Manchester Encoding: Ethernet uses straight binary encoding with 0 volts for a 0 bit and 5
volts for a 1 bit because it leads to ambiguities. The start, end, or middle of each bit without
reference to an external clock. Two such approaches are called Manchester encoding and
differential Manchester encoding. A binary 1 bit is sent by having the voltage set high during
the first interval and low in the second one.
3. The Ethernet MAC Sublayer Protocol: The original DIX (DEC, Intel, Xerox) frame
structure.
Frame formats. (a) DIX Ethernet. (b) IEEE 802.3.
The frame contains two addresses, one for the destination and one for the source. The
standard allows 2-byte and 6-byte addresses, but the parameters defined for the 10-Mbps
baseband standard use only the 6-byte addresses. Sending to a group of stations is called
multicast. Another interesting feature of the addressing is the use of bit 46 to distinguish local
from global addresses. Next comes the Type field, which tells the receiver what to do with the
frame. The final Ethernet field is the Checksum. It is effectively a 32-bit hash code of the data. If
Department of Computer Science, TJPS College, Guntur. 20
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
some data bits are erroneously received, the checksum will almost certainly be wrong and the
error will be detected.
4. The Binary Exponential Backoff Algorithm: It was chosen to dynamically adapt to the
number of stations trying to send. If the randomization interval for all collisions was 1023, the
chance of two stations colliding for a second time would be negligible, but the average wait after
a collision would be hundreds of slot times, introducing significant delay.
5. Ethernet Performance: The performance of Ethernet under conditions of heavy and
constant load, that is, k stations always ready to transmit. If each station transmits during a
contention slot with probability p, the probability A that some station acquires the channel in that
slot is
Equation-4
6. Switched Ethernet: There is an additional way to deal with increased load: switched
Ethernet. The heart of this system is a switch containing a high-speed backplane and room for
typically 4 to 32 plug-in line cards, each containing one to eight connectors. Most often, each
connector has a 10Base-T twisted pair connection to a single host computer.
A simple example of switched Ethernet.
7. Fast Ethernet: To pump up the speed, various industry groups proposed two new ring-based
optical LANs. One was called FDDI (Fiber Distributed Data Interface) and the other was
called Fibre Channel. The 802.3 committee decided to go with a souped-up Ethernet for three
primary reasons:
1. The need to be backward compatible with existing Ethernet LANs.
2. The fear that a new protocol might have unforeseen problems.
3. The desire to get the job done before the technology changed.
Department of Computer Science, TJPS College, Guntur. 21
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Technically, 802.3u is not a new standard, but an addendum to the existing 802.3 standard. Since
practically everyone calls it fast Ethernet, rather than 802.3u.
The original fast Ethernet cabling.
8. Gigabit Ethernet: The fast Ethernet standard when the 802 committee began working on a
yet faster Ethernet (1995). It was quickly dubbed gigabit Ethernet. All configurations of gigabit
Ethernet are point-to-point rather than multidrop as in the original
10 Mbps standard, now honored as classic Ethernet.
Gigabit Ethernet cabling.
9. IEEE 802.2: Logical Link Control: It hides the differences between the various kinds of 802
networks by providing a single format and interface to the network layer.
10. Retrospective on Ethernet: Ethernet is simple and flexible. Ethernet is easy to maintain.
There is no software to install and there are no configuration tables to manage. IP is a
connectionless protocol.
--------------------------------XXXXXXXXXXXXXXXXXXXXX----------------------------------
9. Explain Wireless LAN.
1. The 802.11 Protocol Stack: The 1997 802.11 standard specifies three transmission
techniques allowed in the physical layer. The infrared method uses much the same technology as
television remote controls do. The other two use short-range radio, using techniques called FHSS
and DSSS. In 1999, two new techniques were introduced to achieve higher bandwidth. These are
called OFDM and HR-DSSS. They operate at up to 54 Mbps and 11 Mbps, respectively.
Department of Computer Science, TJPS College, Guntur. 22
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Part of the 802.11 protocol stack.
2. The 802.11 Physical Layer: Each of the five permitted transmission techniques makes it
possible to send a MAC frame from one station to another. The infrared option uses diffused
transmission at 0.85 or 0.95 microns. Two speeds are permitted: 1 Mbps and 2 Mbps. FHSS
(Frequency Hopping Spread Spectrum) uses 79 channels, each 1-MHz wide, starting at the
low end of the 2.4-GHz ISM band. The third modulation method, DSSS (Direct Sequence
Spread Spectrum), is also restricted to 1 or 2 Mbps. The first of the high-speed wireless LANs,
802.11a, uses OFDM (Orthogonal Frequency Division Multiplexing) to deliver up to 54
Mbps in the wider 5-GHz ISM band. HR-DSSS (High Rate Direct Sequence Spread
Spectrum), another spread spectrum technique, which uses 11 million chips/sec to achieve 11
Mbps in the 2.4-GHz band. It is called 802.11b.
3. The 802.11 MAC Sublayer Protocol: It is quite different from that of Ethernet due to the
inherent complexity of the wireless environment compared to that of a wired system. To deal
with this problem, 802.11 supports two modes of operation. The first, called DCF (Distributed
Coordination Function), does not use any kind of central control. The other, called PCF (Point
Coordination Function), uses the base station to control all activity in its cell.
4. The 802.11 Frame Structure: The 802.11 standard defines three different classes of frames
on the wire: data, control, and management.
The 802.11 data frame.
Department of Computer Science, TJPS College, Guntur. 23
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
First comes the Frame Control field. It itself has 11 subfields. The second field of the data frame,
the Duration field, tells how long the frame and its acknowledgement will occupy the channel.
The frame header contains four addresses, all in standard IEEE 802 format. The Sequence field
allows fragments to be numbered. Of the 16 bits available, 12 identify the frame and 4 identify
the fragment. The Data field contains the payload, up to 2312 bytes, followed by the usual
Checksum.
5. Services: The five distribution services are provided by the base stations and deal with station
mobility as they enter and leave cells, attaching themselves to and detaching themselves from
base stations. They are as follows.
1. Association: This service is used by mobile stations to connect themselves to base stations.
2. Disassociation: Either the station or the base station may disassociate, thus breaking the
relationship.
3. Reassociation: A station may change its preferred base station using this service.
4. Distribution: This service determines how to route frames sent to the base station.
5. Integration: If a frame needs to be sent through a non-802.11 network with a different
addressing scheme or frame format, this service handles the translation from the 802.11 format to
the format required by the destination network.
The remaining four services are intracell. They are used after association has taken place and are
as follows.
1. Authentication: Wireless communication can easily be sent or received by unauthorized
stations, a station must authenticate itself before it is permitted to send data.
2. Deauthentication: Authenticated station wants to leave the network, it is deauthenticated.
3. Privacy: For information sent over a wireless LAN to be kept confidential, it must be
encrypted.
4. Data delivery: Finally, data transmission is what it is all about, so 802.11 naturally provides a
way to transmit and receive data.
----------------------------XXXXXXXXXXXXXXXXXXXXXX----------------------------------
10. Explain Broadband Wireless.
1. Comparison of 802.11 with 802.16: To start with, 802.16 provides service to buildings, and
buildings are not mobile. Much of 802.11 deals with mobility. 802.16 can use full-duplex
communication, something 802.11 avoids to keep the cost of the radios low. While 802.11
provides some support for real-time traffic , it was not really designed for telephony and heavy-
duty multimedia usage. In contrast, 802.16 is expected to support these applications completely
because it is intended for residential as well as business use.
Department of Computer Science, TJPS College, Guntur. 24
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
802.11 was designed to be mobile Ethernet, whereas 802.16 was designed to be wireless, but
stationary, cable television.
2. The 802.16 Protocol Stack: It is similar to that of the other 802 networks, but with more
sublayers.
The 802.16 protocol stack.
The data link layer consists of three sublayers. The bottom one deals with privacy and security,
which is far more crucial for public outdoor networks than for private indoor networks. It
manages encryption, decryption, and key management.
The service-specific convergence sublayer takes the place of the logical link sublayer in the
other 802 protocols. Its function is to interface to the network layer. A complication here is that
802.16 was designed to integrate seamlessly with both datagram protocols and ATM.
Next comes the MAC sublayer common part. This is where the main protocols, such as
channel management, are located. The model is that the base station controls the system. It can
schedule the downstream channels very efficiently and plays a major role in managing the
upstream channels as well.
3. The 802.16 Physical Layer: It is in the 10-to-66 GHz range. They travel in straight lines,
unlike sound but similar to light. The base station can have multiple antennas, each pointing at a
different sector of the surrounding terrain.
The 802.16 transmission environment.
Department of Computer Science, TJPS College, Guntur. 25
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
For close-in subscribers, QAM-64 is used, with 6 bits/baud. For medium-distance subscribers,
QAM-16 is used, with 4 bits/baud. For distant subscribers, QPSK is used, with 2 bits/baud.
4. The 802.16 MAC Sublayer Protocol: Four classes of service are defined as follows:
1. Constant bit rate service: Constant bit rate service is intended for transmitting uncompressed
voice such as on a T1 channel.
2. Real-time variable bit rate service: It is for compressed multimedia and other soft real-time
applications in which the amount of bandwidth needed each instant may vary.
3. Non-real-time variable bit rate service: It is for heavy transmissions that are not real time,
such as large file transfers.
4. Best-efforts service: No polling is done and the subscriber must contend for bandwidth with
other best-efforts subscribers.
5. The 802.16 Frame Structure: All MAC frames begin with a generic header. The header is
followed by an optional payload and an optional checksum (CRC).
(a) A generic frame. (b) A bandwidth request frame.
A quick rundown of the header fields of Fig.(a) is as follows. The EC bit tells whether the
payload is encrypted. The Type field identifies the frame type, mostly telling whether packing
and fragmentation are present. The CI field indicates the presence or absence of the final
checksum. The EK field tells which of the encryption keys is being used (if any). The Length
field gives the complete length of the frame, including the header. The Connection identifier tells
which connection this frame belongs to. Finally, the HeaderCRC field is a checksum over the
header only, using the polynomial x8 + x2 + x + 1.
A second header type, for frames that request bandwidth, is shown in Fig.(b).It starts with a 1 bit
instead of a 0 bit and is similar to the generic header.
-------------------------------XXXXXXXXXXXXXXXXXXXXXX-------------------------------
11. Explain Bluetooth.
1. Bluetooth Architecture: The basic unit of a Bluetooth system is a piconet, which consists of
a master node and up to seven active slave nodes within a distance of 10 meters. Multiple
piconets can exist in the same (large) room and can even be connected via a bridge node. An
interconnected collection of piconets is called a scatternet.
Department of Computer Science, TJPS College, Guntur. 26
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
Two piconets can be connected to form a scatternet.
2. Bluetooth Applications: The Bluetooth V1.1 specification names 13 specific applications to
be supported and provides different protocol stacks for each one. The 13 applications, which are
called profiles.
The Bluetooth profiles.
3. The Bluetooth Protocol Stack: The Bluetooth standard has many protocols grouped loosely
into layers. The layer structure does not follow the OSI model, the TCP/IP model, the 802 model,
or any other known model. The basic Bluetooth protocol architecture as modified by the 802
committee.
Department of Computer Science, TJPS College, Guntur. 27
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
The 802.15 version of the Bluetooth protocol architecture.
4. The Bluetooth Radio Layer: The radio layer moves the bits from master to slave, or vice
versa. It is a low-power system with a range of 10 meters operating in the 2.4-GHz ISM band.
The band is divided into 79 channels of 1 MHz each.
5. The Bluetooth Baseband Layer: The baseband layer is the closest thing Bluetooth has to a
MAC sublayer. It turns the raw bit stream into frames and defines some key formats. In the
simplest form, the master in each piconet defines a series of 625 μsec time slots. Each frame is
transmitted over a logical channel, called a link, between the master and a slave. Two kinds of
links exist. The first is the ACL (Asynchronous Connection-Less) link, which is used for
packet-switched data available at irregular intervals. The other is the SCO (Synchronous
Connection Oriented) link, for real-time data, such as telephone connections.
6. The Bluetooth L2CAP Layer: The L2CAP layer has three major functions. First, it accepts
packets of up to 64 KB from the upper layers and breaks them into frames for transmission. At
the far end, the frames are reassembled into packets again. Second, it handles the multiplexing
and demultiplexing of multiple packet sources. Third, L2CAP handles the quality of service
requirements, both when links are established and during normal operation.
7. The Bluetooth Frame Structure: It begins with an access code that usually identifies the
master so that slaves within radio range of two masters can tell which traffic is for them. Next
comes a 54-bit header containing typical MAC sublayer fields. Then comes the data field, of up
to 2744 bits. For a single time slot, the format is the same except that the data field is 240 bits.
A typical Bluetooth data frame.
----------------------------XXXXXXXXXXXXXXXXXXXXX----------------------------------
Department of Computer Science, TJPS College, Guntur. 28
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
12. Explain Data Link Layer switching.
LANs can be connected by devices called bridges, which operate in the data link layer. Bridges
examine the data layer link addresses to do routing.
First, many university and corporate departments have their own LANs, primarily to
connect their own personal computers, workstations, and servers.
Second, the organization may be geographically spread over several buildings separated
by considerable distances.
Third, it may be necessary to split what is logically a single LAN into separate LANs to
accommodate the load.
Fourth, in some situations, a single LAN would be adequate in terms of the load, but the
physical distance between the most distant machines is too great.
Fifth, there is the matter of reliability.
Sixth, and last, bridges can contribute to the organization's security.
1. Bridges from 802.x to 802.y: Host A on a wireless (802.11) LAN has a packet to send to a
fixed host, B, on an (802.3) Ethernet to which the wireless LAN is connected. Then it passes into
the MAC sublayer and an 802.11 header is prepended to it. When it hits the bridge connecting
the 802.11 network to the 802.3 network, it starts in the physical layer and works its way
upward.
Operation of a LAN bridge from 802.11 to 802.3.
Problems:
1. Each of the LANs uses a different frame format.
2. Interconnected LANs do not necessarily run at the same data rate.
3. potentially the most serious of all, is that different 802 LANs have different maximum
frame lengths.
One solution to the security problem is to do encryption in a higher layer. A final point is quality
of service.
Department of Computer Science, TJPS College, Guntur. 29
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
The IEEE 802 frame formats. The drawing is not to scale
2. Local Internetworking: The routing procedure for an incoming frame depends on the LAN it
arrives on (the source LAN) and the LAN its destination is on (the destination LAN), as follows:
1. If destination and source LANs are the same, discard the frame.
2. If the destination and source LANs are different, forward the frame.
3. If the destination LAN is unknown, use flooding.
3. Spanning Tree Bridges: To increase reliability, some sites use two or more bridges in
parallel between pairs of LANs.
Two parallel transparent bridges
The nine LANs interconnected by ten bridges. This configuration can be abstracted into a graph
with the LANs as the nodes. An arc connects any two LANs that are connected by a bridge. The
graph can be reduced to a spanning tree by dropping the arcs shown as dotted lines. There is
exactly one path from every LAN to every other LAN.
(a) Interconnected LANs. (b) A spanning tree covering the LANs. The dotted lines are not
part of the spanning tree.
Department of Computer Science, TJPS College, Guntur. 30
Prepared by KADIRI NAGESWARA RAO. MCA
II [Link] Honor CSC (Semester IV) Data Communication and Computer Network
4. Remote Bridges: A common use of bridges is to connect two (or more) distant LANs. For
example, a company might have plants in several cities, each with its own LAN. Ideally, all the
LANs should be interconnected, so the complete system acts like one large LAN. This goal can
be achieved by putting a bridge on each LAN and connecting the bridges pairwise with point-to-
point lines.
Remote bridges can be used to interconnect distant LANs.
5. Repeaters, Hubs, Bridges, Switches, Routers, and Gateways: Different devices use
different pieces of information to decide how to switch. The user generates some data to be sent
to a remote machine. Those data are passed to the transport layer, which then adds a header, for
example, a TCP header, and passes the resulting unit down to the network layer. The network
layer adds its own header to form a network layer packet, for example, an IP packet.
(a) Which device is in which layer. (b) Frames, packets, and headers.
6. Virtual LANs: In response to user requests for more flexibility, network vendors began
working on a way to rewire buildings entirely in software. The resulting concept is called a
VLAN (Virtual LAN). Three methods are in use, as follows:
1. Every port is assigned a VLAN color: This method only works if all machines on a port
belong to the same VLAN.
2. Every MAC address is assigned a VLAN color: The bridge or switch has a table listing the
48-bit MAC address of each machine connected to it along with the VLAN that machine is on.
3. Every layer 3 protocol or IP address is assigned a VLAN color: The bridge or switch to
examine the payload field of the frame.
----------------------------------XXXXXXXXXXXXXXXXXXXXXXX---------------------------
Department of Computer Science, TJPS College, Guntur. 31
Prepared by KADIRI NAGESWARA RAO. MCA