B.N.M. Institute of Technology: Department of Electronics & Communication Engineering Question Bank With Solutions
B.N.M. Institute of Technology: Department of Electronics & Communication Engineering Question Bank With Solutions
Institute of Technology
Approved by AICTE, Affiliated to VTU, Accredited as Grade A Institution by NAAC.
All UG branches – CSE, ECE, EEE, ISE & Mech.E Accredited by NBA for academic years 2018-19 to 2020-21 & valid upto 30.06.2021
Post box no. 7087, 27th cross, 12th Main, Banashankari 2nd Stage, Bengaluru- 560070, INDIA
Ph: 91-80- 26711780/81/82 Email: [email protected], www. bnmit.org
Department of Electronics & Communication Engineering
Question Bank with Solutions
Course Name: Computer Communication Networks Semester: VI A & B
Course Code: 15EC64 Staff in charge: Dr. JRM/SBL
Module 2
1. Why random-access or contention methods are called so?
Solution: It is called so because of two features:
1. There is no scheduled time for a station to transmit. Transmission is random among the
stations. That is why these methods are called random access.
2. No rules specify which station should send next. Stations compete with one another to
access the medium. That is why these methods are also called contention methods.
In a random-access method, each station has the right to the medium without being controlled by
any other station. However, if more than one station tries to send, there is an access conflict
called as collision and the frames will be either destroyed or modified. To avoid access conflict
or to resolve it when it happens, each station should follow a procedure which gives information
on when the station can access the medium, what the station can do if the medium is busy, how
to determine the success or failure of the transmission and what can the station do if there is an
access conflict.
2. A pure ALOHA network transmits 200-bit frames on a shared channel of 200 kbps.
What is the requirement to make this frame collision-free?
Solution:
Average frame transmission time Tfr = 200 bits/200 kbps =1 ms.
The vulnerable time = 2 × Tfr = 2 × 1 ms = 2 ms.
It means no station should send later than 1 ms before this station starts transmission and no
station should start sending during the period (1 ms) that this station is sending.
1
In this method, after the station finds the line idle, it sends its frame immediately (with
probability 1). This method has the highest chance of collision because two or more stations may
find the line idle and send their frames immediately. Ethernet uses this method.
b. Nonpersistent method
In this method, a station that has a frame to send senses the line. If the line is idle, it sends
immediately. If the line is not idle, it waits a random amount of time and then senses the line
again. This approach reduces the chance of collision because it is unlikely that two or more
stations will wait the same amount of time and retry to send simultaneously. However, this
method reduces the efficiency of the network because the medium remains idle when there may
be stations with frames to send.
c. p-Persistent method
The p-persistent method is used if the channel has time slots with slot duration equal to or greater
than the maximum propagation time. The p-persistent approach combines the advantages of the
other two strategies. It reduces the chance of collision and improves efficiency.
2
Flowchart
In this method, after the station finds the line idle it follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 − p, the station waits for the beginning of the next time slot and
checks the line again.
a. If the line is idle, it goes to step 1.
b. If the line is busy, it acts as though a collision has occurred and uses the backoff
procedure.
As 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. There is
still the possibility of collision if two stations try to send at the beginning of the same time slot.
5. A pure ALOHA and a slotted ALOHA network transmits 200-bit frames on a shared
channel of 200 kbps. What is the throughput if the system (all stations together) produces
a. 1000 frames per second?
b. 500 frames per second?
c. 250 frames per second?
Solution:
Pure ALOHA:
The frame transmission time Tfr = 200 bits/200 kbps =1 ms.
a. If the system creates 1000 frames per second, or 1 frame per millisecond, then G = 1.
4
In this case S = G × e−2G = 0.135 (13.5 percent).
This means that the throughput is 1000 × 0.135 = 135 frames. Only 135 frames out of
1000 will probably survive.
b. If the system creates 500 frames per second, or 1/2 frames per millisecond, then G = 1/2.
In this case S = G × e−2G = 0.184 (18.4 percent).
This means that the throughput is 500 × 0.184 = 92 and those only 92 frames out of 500
will probably survive.
c. If the system creates 250 frames per second, or 1/4 frames per millisecond, then G = 1/4.
In this case S = G × e−2G = 0.152 (15.2 percent).
This means that the throughput is 250 × 0.152 = 38. Only 38 frames out of 250 will
probably survive.
Slotted ALOHA:
The frame transmission time Tfr = 200 bits/200 kbps =1 ms.
a. If the system creates 1000 frames per second, or 1 frame per millisecond, then G = 1.
In this case S = G × e−G = 0.368 (36.8 percent).
This means that the throughput is 1000 × 0. 368 = 368 frames. Only 368 frames out of
1000 will probably survive.
b. If the system creates 500 frames per second, or 1/2 frames per millisecond, then G = 1/2.
In this case S = G × e−G = 0.303(30.3 percent).
This means that the throughput is 500 × 0.303= 151 and those only 151 frames out of 500
will probably survive.
c. If the system creates 250 frames per second, or 1/4 frames per millisecond, then G = 1/4.
In this case S = G × e−G = 0.195 (19.5 percent).
This means that the throughput is 250 × 0. 195 = 49. Only 49 frames out of 250 will
probably survive.
5
Procedure
The working of CSMA/CD is similar to ALOHA protocol. But there are three differences.
1. The addition of the persistence process. Stations need to sense the channel before they
start sending the frame by using one of the persistence processes (nonpersistent, 1-
persistent, or p-persistent). The corresponding box can be replaced by one of the
persistence processes.
2. The frame transmission. In ALOHA, stations first transmit the entire frame and then wait
for an acknowledgment. In CSMA/CD, transmission and collision detection are
continuous processes. The stations do not send the entire frame and then look for a
collision. The station transmits and receives continuously and simultaneously (using two
different ports or a bidirectional port). A loop is used to show that transmission is a
continuous process. Ii is constantly monitored in order to detect one of two conditions:
either transmission is finished or a collision is detected. Either event stops transmission.
When we come out of the loop, if a collision has not been detected, it means that
transmission is complete; the entire frame is transmitted. Otherwise, a collision has
occurred.
3. The sending of a short jamming signal to make sure that all other stations become aware
of the collision.
8. Explain how collisions are avoided through the three strategies of CSMA/CA.
Solution:
The three strategies are
1. Interframe space
2. Contention window
3. Acknowledgments
6
1. Interframe Space (IFS):
First, collisions are avoided by deferring transmission even if the channel is found idle. When an
idle channel is found, the station does not send immediately. It waits for a period of time called
the interframe space or IFS. Even though the channel may appear idle when it is sensed, a
distant station may have already started transmitting. The distant station’s signal has not yet
reached this station. The IFS time allows the front of the transmitted signal by the distant station
to reach this station. After waiting an IFS time, if the channel is still idle, the station can send,
but it still needs to wait a time equal to the contention window. The IFS variable can also be used
to prioritize stations or frame types. For example, a station that is assigned shorter IFS has a
higher priority
2. Contention Window:
7
The contention window is an amount of time divided into slots. A station that is ready to send
chooses a random number of slots as its wait time. The number of slots in the window changes
according to the binary exponential backoff strategy. This means that it is set to one slot the first
time and then doubles each time the station cannot detect an idle channel after the IFS time. This
is very similar to the p-persistent method except that a random outcome defines the number of
slots taken by the waiting station.
One interesting point about the contention window is that the station needs to sense the channel
after each time slot. However, if the station finds the channel busy, it does not restart the process;
it just stops the timer and restarts it when the channel is sensed as idle. This gives priority to the
station with the longest waiting time.
3. Acknowledgment:
With all these precautions, there still may be a collision resulting in destroyed data. In addition,
the data may be corrupted during the transmission. The positive acknowledgment and the time-
out timer can help guarantee that the receiver has received the frame.
8
Select
The select function is used whenever the primary device has something to send. The primary
controls the link. If the primary is neither sending nor receiving data, it knows the link is
available. If it has something to send, the primary device sends it. What it does not know,
however, is whether the target device is prepared to receive. So the primary must alert the
secondary to the upcoming transmission and wait for an acknowledgment of the secondary’s
ready status. Before sending data, the primary creates and transmits a select (SEL) frame, one
field of which includes the address of the intended secondary.
Poll
The poll function is used by the primary device to solicit transmissions from the secondary
devices. When the primary is ready to receive data, it must ask (poll) each device in turn if it has
anything to send. When the first secondary is approached, it responds either with a NAK frame if
it has nothing to send or with data (in the form of a data frame) if it does. If the response is
negative (a NAK frame), then the primary polls the next secondary in the same manner until it
finds one with data to send. When the response is positive (a data frame), the primary reads the
frame and returns an acknowledgment (ACK frame), verifying its receipt.
In this method, a special packet called a token circulates through the ring. The possession of the
token gives the station the right to access the channel and send its data. When a station has some
data to send, it waits until it receives the token from its predecessor. It then holds the token and
sends its data. When the station has no more data to send, it releases the token, passing it to the
9
next logical station in the ring. The station cannot send data until it receives the token again in
the next round. In this process, when a station receives the token and has no data to send, it just
passes the data to the next station.
Token management is needed for this access method. Stations must be limited in the time they
can have possession of the token. The token must be monitored to ensure it has not been lost or
destroyed. For example, if a station that is holding the token fails, the token will disappear from
the network. Another function of token management is to assign priorities to the stations and to
the types of data being transmitted. And finally, token management is needed to make low-
priority stations release the token to high-priority stations.
In a token-passing network, stations do not have to be physically connected in a ring; the ring
can be a logical one.
In the bus ring topology, also called a token bus, the stations are
connected to a single cable called a bus. They, however, make a
logical ring, because each station knows the address of its
successor (and also predecessor for token management
purposes). When a station has finished sending its data, it
releases the token and inserts the address of its successor in the
token. Only the station with the address matching the destination
address of the token gets the token to access the shared media.
The Token Bus LAN, standardized by IEEE, uses this topology.
10
In a star ring topology, the physical topology is a star. There is
a hub, however, that acts as the connector. The wiring inside
the hub makes the ring; the stations are connected to this ring
through the two wire connections. This topology makes the
network less prone to failure because if a link goes down, it
will be bypassed by the hub and the rest of the stations can
operate. Also adding and removing stations from the ring is
easier. This topology is still used in the Token Ring LAN
designed by IBM.
11
method for Ethernet LANs and defines the token-passing method for Token Ring and Token Bus
LANs. As we mentioned in the previous section, part of the framing function is also handled by
the MAC layer.
12
Efficiency = 1/ (1+6.4 ×a)
in which the parameter “a” is the number of frames that can fit on the medium.
The standard Ethernet uses a baseband signal (digital signaling) at 10Mbps, which means that the
bits are changed to a digital signal and directly sent on the line.
At the sender, data are converted to a digital signal using the Manchester scheme; at the receiver,
the received signal is interpreted as Manchester and decoded into data. Manchester encoding is
self-synchronous, providing a transition at each bit interval.
Four ways of the Standard Ethernet implementations: 10Base5, 10Base2, 10Base-T and 10Base-
F
Changes have been occurred to the 10-Mbps Standard Ethernet. These changes actually
opened the road to the evolution of the Ethernet to become compatible with other high-data-
rate LANs.
1. Bridged Ethernet
2. Switched Ethernet
3. Full-Duplex Ethernet
Encoding
Manchester encoding needs a 200-Mbaud bandwidth for a data rate of 100 Mbps, which
makes it unsuitable for a medium such as twisted-pair cable.
13
For this reason, the Fast Ethernet uses alternative encoding/decoding scheme. Three
different encoding schemes were chosen as one scheme would not perform equally well
for all three implementations.
MAC Sublayer
MAC sublayer is modified in Gigabit Ethernet.
Gigabit Ethernet has two distinctive approaches for medium access:
half-duplex
fullduplex.
Almost all implementations of Gigabit Ethernet follow the full-duplex approach, so we
mostly ignore the half-duplex mode.
Topology
Gigabit Ethernet is designed to connect two or more stations.
If there are only two stations, they can be connected point-to-point. Three or more stations need
to be connected in a star topology with a hub or a switch at the center. Another possible
configuration is to connect several star topologies or let one star topology be part of another.
Implementation
Gigabit Ethernet can be categorized as either a two-wire or a four-wire implementation.
The two-wire implementations use fiber-optic cable (1000Base-SX, short-wave, or
1000Base-LX, long-wave), or STP (1000Base-CX).
The four-wire version uses category 5 twisted-pair cable (1000Base-T).
In other words, we have four implementations. 1000Base-T was designed in response to
those users who had already installed this wiring for other purposes such as Fast Ethernet
or telephone services
Encoding
Gigabit Ethernet cannot use the Manchester encoding scheme because it involves a very
high bandwidth (2 GBaud). The two-wire implementations use an NRZ scheme, but NRZ
does not self-synchronize properly.
In the four-wire implementation it is not possible to have 2 wires for input and 2 for
output, because each wire would need to carry 500 Mbps, which exceeds the capacity for
category 5 UTP
4.10 Gigabit Ethernet (10 Gbps)
It is used in metropolitan areas.
14
It extends the technology, the data rate, and the coverage distance so that the Ethernet can
be used as LAN and MAN (metropolitan area network).
The IEEE committee created 10 Gigabit Ethernet and called it Standard 802.3ae.
Implementation
10 Gigabit Ethernet operates only in full-duplex mode, which means there is no need for
contention;
CSMA/CD is not used in 10 Gigabit Ethernet.
Four implementations are the most common: 10GBase-SR, 10GBase-LR, 10GBase-EW, and
10GBase-X4.
Preamble: This field contains 7 bytes (56 bits) of alternating 0s and 1s that alert the
receiving system to the coming frame and enable it to synchronize its clock if it’s out of
synchronization. The pattern provides only an alert and a timing pulse. The 56-bit pattern
allows the stations to miss some bits at the beginning of the frame. The preamble is
actually added at the physical layer and is not (formally) part of the frame.
Start frame delimiter (SFD): This field (1 byte: 10101011) signals the beginning of the
frame. The SFD warns the station or stations that this is the last chance for
synchronization. The last 2 bits are (11)2 and alert the receiver that the next field is the
destination address. This field is actually a flag that defines the beginning of the frame.
We need to remember that an Ethernet frame is a variable-length frame. It needs a flag to
define the beginning of the frame. The SFD field is also added at the physical layer.
15
Destination address (DA): This field is six bytes (48 bits) and contains the link layer
address of the destination station or stations to receive the packet. We will discuss
addressing shortly. When the receiver sees its own link-layer address, or a multicast
address for a group that the receiver is a member of, or a broadcast address, it
decapsulates the data from the frame and passes the data to the upper layer protocol
defined by the value of the type field.
Source address (SA): This field is also six bytes and contains the link-layer address of
the sender of the packet. We will discuss addressing shortly.
Type: This field defines the upper-layer protocol whose packet is encapsulated in the
frame. This protocol can be IP, ARP, OSPF, and so on. In other words, it serves the same
purpose as the protocol field in a datagram and the port number in a segment or user
datagram. It is used for multiplexing and demultiplexing.
Data: This field carries data encapsulated from the upper-layer protocols. It is a
minimum of 46 and a maximum of 1500 bytes. We discuss the reason for these minimum
and maximum values shortly. If the data coming from the upper layer is more than 1500
bytes, it should be fragmented and encapsulated in more than one frame. If it is less than
46 bytes, it needs to be padded with extra 0s. A padded data frame is delivered to the
upper-layer protocol as it is (without removing the padding), which means that it is the
responsibility of the upper layer to remove or, in the case of the sender, to add the
padding. The upper-layer protocol needs to know the length of its data. For example, a
datagram has a field that defines the length of the data.
CRC: The last field contains error detection information, in this case a CRC-32. The
CRC is calculated over the addresses, types, and data field. If the receiver calculates the
CRC and finds that it is not zero (corruption in transmission), it discards the frame.
16. Explain the standard Ethernet physical layer implementation of (i)10base 2 (ii)10base5
Solution:
10Base2: Thin Ethernet Implementation
17
In the four-wire implementation it is not possible to have 2 wires for input and 2 for output,
because each wire would need to carry 500 Mbps, which exceeds the capacity for category 5
UTP. As a solution, 4D-PAM5 encoding is used to reduce the bandwidth. Thus, all four wires are
involved in both input and output; each wire carries 250 Mbps, which is in the range for category
5 UTP cable.
18. In the Standard Ethernet with the transmission rate of 10 Mbps, we assume that the
length of the medium is 2500 m and the size of the frame is 512 bits. The propagation speed
of a signal in a cable is normally 2 × 108 m/s.
Solution:
Propagation delay = 2500/(2×108) = 12.5 µs
Transmission delay = 512/(107) = 51.2 µs
a = (propagation delay)/(transmission delay)
= 12.5/51.2
= 0.24
Efficiency = 1/ (1+6.4 ×a)
= 1/ (1+6.4 × 0.24)
= 39.4% ~39%
18
19. Explain with the diagram 10Base-T: Twisted-Pair Ethernet Implementation
Solution:
Although there are several types of optical fiber 10-Mbps Ethernet, the most common is
called 10Base-F.
10Base-F uses a star topology to connect stations to a hub.
The stations are connected to the hub using two fiber-optic cables.
19
It was designed particularly to allow incompatible devices to connect to one another. For
example, a device with a maximum data rate of 10 Mbps can communicate with a device with a
100 Mbps data rate (but which can work at a lower rate).
Goals of autonegotiation:
1. To allow incompatible devices to connect to one another. For example, a device with
a maximum capacity of 10 Mbps can communicate with a device with a 100 Mbps
capacity (but which can work at a lower rate).
2. To allow one device to have multiple capabilities.
3. To allow a station to check a hub’s capabilities.
22. Explain two distinctive approaches for medium access in Gigabit Ethernet.
Solution:
MAC sublayer is modified in Gigabit Ethernet.
Gigabit Ethernet has two distinctive approaches for medium access:
half-duplex
fullduplex.
Almost all implementations of Gigabit Ethernet follow the full-duplex approach, so we
mostly ignore the half-duplex mode.
Full-Duplex Mode
In full-duplex mode, there is a central switch connected to all computers or other
switches.
In this mode, for each input port, each switch has buffers in which data are stored until
they are transmitted.
The switch uses the destination address of the frame and sends a frame out of the port
connected to that particular destination, there is no collision.
This means that CSMA/CD is not used.
Lack of collision implies that the maximum length of the cable is determined by the
signal attenuation in the cable, not by the collision detection process.
Half-Duplex Mode
In this case, a switch can be replaced by a hub, which acts as the common cable in which
a collision might occur.
The half-duplex approach uses CSMA/CD.
However, the maximum length of the network in this approach is totally dependent on the
minimum frame size.
Three methods have been defined: traditional, carrier extension, and frame bursting.
In the traditional approach, we keep the minimum length of the frame as in
traditional Ethernet (512 bits). However, because the length of a bit is 1/100 shorter in
Gigabit Ethernet than in 10-Mbps Ethernet, the slot time for Gigabit Ethernet is 512 bits × 1/
1000 μs, which is equal to 0.512 μs. The reduced slot time means that collision is detected
100 times earlier. This means that the maximum length of the network is 25 m. This length
may be suitable if all the stations are in one room, but it may not even be long enough to
connect the computers in one single office.
20
The carrier extension approach defines the minimum length of a frame as 512 bytes
(4096 bits). This means that the minimum length is 8 times longer. This method forces a
station to add extension bits (padding) to any frame that is less than 4096 bits. In this way,
the maximum length of the network can be increased 8 times to a length of 200 m. This
allows a length of 100 m from the hub to the station. Carrier extension is very inefficient if
we have a series of short frames to send; each frame carries redundant data.
To improve efficiency, frame bursting was proposed. Instead of adding an extension
to each frame, multiple frames are sent. However, to make these multiple frames look like
one frame, padding is added between the frames (the same as that used for the carrier
extension method) so that the channel is not idle. In other words, the method deceives other
stations into thinking that a very large frame has been transmitted.
21