Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last Updated: Mar 27, 2024
Difficulty: Easy

Data link layer and Switching

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Speaker
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM

Introduction

The OSI Layered Model's Data Link Layer is the second layer. This layer is one of the most difficult to understand, with several functionalities and risks. The data connection layer hides the underlying hardware features and represents itself to the upper layer as a communication medium.

The data link layer connects two hosts that are in some way directly connected. This direct link could be a point-to-point or a broadcast connection. On a broadcast network, systems are said to be on the same connection. When dealing with several hosts on a single collision domain, the data connection layer's job becomes more complicated.

Questions

1. Determine the maximum cable length (in kilometers) for transferring data at a rate of 500 Mbps in an Ethernet LAN with 10,000-bit frames. Assume a signal speed of 2,00,000 km/s in the wire.

  1. 1
  2. 2
  3. 2.5
  4. 3

Solution: b. 2

Data should be sent at a rate of 500 megabits per second (Mbps).

Transmission Time >= 2*Propagation Time

=> 10000/(500*1000000) <= 2*length/200000

=> length = 2km (max)

so, answer will be: (B) 2km

 

2. The generating polynomial used for CRC checking is G(x). What condition must G(x) meet in order for it to detect an odd number of bits in error?

  1. There are more than two terms in G(x).
  2. For any k less than the frame length, G(x) does not divide 1+xk.
  3. 1+x is a G factor (x)
  4. The number of terms in G(x) is odd.

Solution: c. 1+x is a factor of G(x)

If G(x) contains (x+1) as a factor, an odd number of bit errors can be discovered. For proof, look at this.

 

3. 1000-bit frames are exchanged between two sites across a 106-bps duplex link. It will take 25 milliseconds for the signal to propagate. Frames must be sent to this site to multiply and pack them in transit (within the link). What is the minimal amount of bits "I" required to express the sequence numbers clearly? Assume that no time delay between the transmission of two frames is needed.

  1. i = 2
  2. i = 3
  3. i = 4
  4. i = 5

Solution: d. 5

For one frame, the transmission delay is 1000/(106) = 1 ms—time to propagate = 25 milliseconds. Before the first frame reaches the destination, the sender can only transfer a maximum of 25 frames. The amount of bits required to represent 25 different frames is 5 bits.

 

4. Take a look at the information from the preceding question. Assume you're using the sliding window protocol with a sender window size of 2i, where is the number of bits found in the previous question, and acknowledgments are always piggybacked. What is the minimum time the sender must wait after sending 2i frames before initiating transmission of the next frame? (Ignore the frame processing time and choose the closest option.)

  1. 16ms
  2. 18ms
  3. 20ms
  4. 22ms

Solution: c. 20ms

Sliding window size = 2^5 = 32 A frame's transmission time is 1 millisecond. 32ms = total time taken for 32 frames 2tx + 2tp = 2+50 = 52ms total time The minimum time the sender must wait before transmitting the next frame after delivering 32 frames is 52 – 32 = 20.

 

5. When Manchester encoding is used on Ethernet, the bit rate is:

  1. Half the baud rate.
  2. Twice the baud rate.
  3. Same as the baud rate.
  4. None of the above.

Solution: a. Half the baud rate.

The bitrate in Manchester encoding is half that of the baud rate.

 

6. In a slotted LAN, there are n stations. Each station tries to transmit in each time slot with a probability of p. What is the likelihood that only one station transmits in a particular time slot?

  1. (1-p)^(n-1)
  2. np(1-p)^(n-1)
  3. p(1-p)^(n-1)
  4. 1-(1-p)^(n-1)

Solution: b. np(1-p)^(n-1)

P(X) = Chances of station X transmitting = P P (-X) = Chances of Station X not transmitting = 1-P It's a must: Only one station transmits probability = y.

 

7. The transmission speed in a token ring network is 107 bits per second, while the propagation speed is 200 meters per microsecond. In this network, a 1-bit delay is equal to

  1. 500 meters of cable.
  2.  200 meters of cable.
  3.  20 meters of cable.
  4.  50 meters of cable.

Solution: c. 20 meters of cable.

Tp = 200 m/μs

In 1-sec distance covered 200×106 meter

1 bit delay = (1 ÷ BW) × v = (1 ÷ 107 )× 200×106 = 20 meters cable

 

8. To secure the message 11001001 from errors, it will be transmitted using the CRC polynomial x3 + 1. The following is the message that should be sent:

  1. 11001001000
  2. 11001001011
  3. 11001010
  4. 110010010011

Solution: b. 11001001011

message: 11001001

CRC polynomial: x^3 +1 = 1.x^3 + 0.x^2 + 0.x^1 + 1.x^0

1001 is a CRC (cyclic redundancy check) generator.

Add 3 0's at the end of the message because the polynomial is of order 3.

 

9. Consider a 2 km token ring network with ten stations, one of which is a monitoring station. The signal propagation speed is 2 108 m/s, and the token transmission time is not taken into account. The monitoring station's minimum time to wait before assuming the token is lost is if each station is allowed to hold the token for 2 seconds:-

  1. 28 to 30
  2. 20 to 22
  3. 0 to 2
  4. 31 to 33

Solution: a. 28 to 30

2 kilometers in length

Token Holding Time = 2 micro sec Propagation Speed v = 2*108 m/s

Waiting for time = length/speed + (number of stations - 1)*(token holding time) to length/speed + (number of stations)*(token holding time) = 28 to 30 minutes.

 

10. Consider a selective repeat sliding window protocol with a one-way delay of 50 msec and a frame size of 1 KB that transfers data over a 1.5 Mbps channel. The minimal number of bits required to indicate the sequence number field in order to achieve a link utilization of 60% is:-

  1. 3
  2. 4
  3. 5
  4. 6

Solution: c. 5

Transmission latency = Frame Size/Bandwidth = (1*8*1024)/(1.5 * 10^6)=5.33 milliseconds

50ms propagation delay

a = Propagation delay/Transmission delay = Efficiency = Window Size/(1+2a) =.6

So, in Min sequence number = log2, window size = 11.856(approx) and min sequence number = 2*window size = 23.712 bits are required (23.712)

Ceil(4.56) = 5 is the answer.

 

11. An 8-bit-stuffing-based framing system uses an 8-bit delimiter pattern of 01111110. The input bit-string is 01111100101 if the output bit-string after stuffing is 01111100101

  1. 0111110100
  2. 0111110101
  3. 0111111101
  4. 0111111111

Solution: b. 0111110101

Bit Stuffing is used to create framing.

The 8-bit delimiter pattern is 01111110. 

The output bit-string after stuffing is 01111100101.

The above-highlighted bit is a stuffed bit.  

So the input bit-string must be 0111110101.

 

12. Station A sends communications to Station B using a SLIDING WINDOW PROTOCOL and 32-byte packets. On the path between A and B, the bottleneck bandwidth is 128 kbps, while the round trip time between A and B is 80 milliseconds. What is the most appropriate window size for A to use?

  1. 20
  2. 40
  3. 160
  4. 320

Solution: b. 40

80ms propagation delay round trip

32*8 bit frame size

128kbps bandwidth

Time to transmit = 32*8/(128) ms = 2 ms

Let n be the size of the window.

UtiliZation = n/(1+2a) where an is the propagation time / transmission time = n/(1+80/2)

n = 41, which is near to choice, for maximum use (B)

 

13. Assume a 10 Mbps Ethernet with a 48-bit jamming signal has a round trip propagation latency of 46.4 milliseconds. The smallest possible frame size is

  1. 94
  2. 416
  3. 464
  4. 512

Solution: d. 512

 We're given a 48-bit jamming signal.

46.4 ps propagation delay round trip

Now deduct the transmission time of 48 bits to get the real round propagation time, which is 51.2 seconds.

Now, the frame length must be such that it takes longer than 51.2 seconds to transmit, so the minimum frame length is 51.2 * 10–6 10–6 = 512 bits.

 

14. How many 8-bit characters can be communicated per second utilizing the asynchronous transmission mode with one start bit, eight data bits, two stop bits, and one parity bit over a 9600 baud serial communication link?

  1. 600
  2. 800
  3. 876
  4. 1200

Solution: b. 800

A physical Layer in the OSI Stack is required as a background. In serial communications, data is sent or received one bit at a time. The baud rate determines how quickly data is transmitted across a serial line. It's commonly measured in bits per second (bps) (bps). Each block of data (typically a byte) is transmitted in a packet or frame of bits. By inserting synchronization and parity bits into our data, frames are generated.

 

15. There are just two stations on an Ethernet: A and B. Each of them has a steady stream of frames to send out. The initial backoff race is won by A after both A and B attempt to transfer a frame and collide. Both A and B try to communicate, and they clash at the end of A's successful transmission. A's chances of winning the second backoff race are

  1. 0.5
  2. 0.625
  3. 0.75
  4. 1.0

Solution: b. 0.625

The station or node with the shortest backoff time sends the frames first. First try: k=0 or k=1 (0= k = 2n-1; where n=nth attempt). A must-have selected k=0, and B must have chosen k=1 because A won the first race (A wins here with a probability of 0.25). A will choose k=0 or k=1 for its second frame because it won the first round, whereas B will choose k=0,1,2, or three because it failed to submit its first frame in the first round. Let kA= value of k chosen by A and kB= value of k chosen by B on the second attempt. To indicate the possible values, we'll use the notation (kA, kB). For the second try, the sample space is now (kA,kB) = (0,0),(0,1),(0,2),(0,3),(1,0),(1,1),(1,2), or (1,3), i.e. 8 possible outcomes. kA must be less than kB for A to win (kA kB). As a result, our event space is (kA, kB) = (0,1), (0,2), (0,3), (1,2), (1,3), i.e. 5 outcomes. As a result, the probability of A winning the second backoff race is 5/8 = 0.625.

 

16. A 2 km broadcast LAN with 107 bps bandwidth and CSMA/CD is used. The signal travels at a speed of 2 108 m/s along the wire. What is the smallest packet size that this network allows?

  1. 50 bytes
  2. 100 bytes
  3. 200 bytes
  4. None of these

Solution: d. None of these

While transmitting a frame in CSMA/CD, the transmitting node listens for collisions. It assumes that the transmission was successful once it has completed transmitting the final bit without hearing a collision. The time it takes a Node to detect that its frame has collided within this worst-case collision situation is double the propagation delay. As a result, the packet's minimum size is required to ensure that a collision has not happened.

 

17. Which of the following claims concerning CSMA/CD is TRUE?

  1. The CSMA/CD protocol is used in IEEE 802.11 wireless LAN
  2. The CSMA/CD protocol is not used in Ethernet.
  3. CSMA/CD is not ideal for a network with a long propagation delay, such as a satellite network.
  4. In a CSMA/CD network, there is no contention.

Solution: c. CSMA/CD is not suitable for a high propagation delay network like a satellite network

According to CSMA/CD, the sender must transmit at least until the first bit reaches the receiver, so that the receiver can identify any collisions. This period grows too long for networks with a significant prorogation delay, and the minimum packet size required becomes too large to be practical.

 

18. Every byte of data in serial data transfer is padded with a '0' at the start and one or two 'Is' at the conclusion because

  1. The receiver is to be synchronized for byte reception.
  2. The receiver recovers lost '0' and '1's from these padded bits.
  3. Padded bits are useful in parity computation.
  4. None of these

Solution: a. The receiver is to be synchronized for byte reception.

The sender and receiver in serial communication must be synced with one another.

A start bit of '0' is added to the beginning of the data, and a stop bit of '1' is added to the end. The start signal informs the receiver that data has arrived, while the stop signal prepares the receiver for the arrival of more data.

As a result, the receiver in serial transmission must be synced for byte reception.

If you identify any errors in the above post, please leave a comment below.

 

19. Take the following LANs into consideration: S1, S2, S3, and S4. A node can only broadcast at the start of a slot because time is divided into fixed-length slots. It is claimed that a collision has occurred when more than one node transmits in the same slot. The chances of S1, S2, S3, and S4 creating a frame in a time slot are 0.1, 0.2, 0.3, and 0.4, respectively. Sending a frame in the first slot without these four stations interacting has a probability of:-

  1. 0.462
  2. 0.711
  3. 0.5
  4. 0.652

Solution: a. 0.462

P(T) = 0.1 0.8 0.7 0.6 + 0.9 0.2 0.7 0.6 + 0.9 0.8 0.3 0.6 + 0.9 0.8 0.7 0.6 + 0.9 0.8 0.7 0.6

T = 0.4404 P(T) = 0.4404 P(T) = 0.4404 P(

The likelihood of any of these four stations sending a frame in the first slot without colliding is 0.4404.

 

20. Consider a 100 Mbps (108 bits per second) CSMA/CD network with no repeaters that delivers data across a 1 km (kilometer) wire. What is the signal speed (km/sec) through the cable if the minimum frame size required for this network is 1250 bytes?

  1. 8000
  2. 10000
  3. 16000
  4. 20000

Solution: d. 20000

Data should be transmitted at the rate of 100 Mbps.

Transmission Time >= 2*Propagation Time

=> 1250*8 / (100 * 106) <= 2*length/signal_speed

=> signal_speed  <= (2 * 103 * 100 * 106) / (1250 * 8)

                 <= 2 * 10 * (103) km/sec 

                 <= 20000

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

FAQs

1. What are Virtual LANs?

A VLAN functions similarly to a traditional LAN, except that connected devices are not required to be physically connected to the same segment. VLANs are most likely to be employed in a college network environment. Cisco, Bay Networks, and 3Com are among the numerous firms that are likely to include VLAN support in their products.
 

2. What are the data link layer's responsibilities?

  • Framing
     
  • Physical addressing
     
  • Flow control
     
  • Error control
     
  • Access control
     

3. Explain VPN?

A virtual private network (VPN) is a service that provides safe and dependable connectivity over a public network infrastructure such as the Internet. The same security and management principles apply to VPNs as they do to private networks. They are the most cost-effective way to link remote users to a business customer's network via a virtual point-to-point connection.
 

4. ​​Do you know what Is a MAC Address?

MAC (Media Access Control) addresses are globally unique addresses that are embedded in devices during production. The MAC address of a network adapter is a unique value issued to it. MAC addresses are also known as hardware addresses or physical addresses. They are used to identify a local area network adaptor (LAN). MAC addresses are 12-digit hexadecimal numbers (48 bits in length).

Key takeaways

In this article, we have gone through critical previous years' GATE exam questions. The data link layer, sometimes known as layer 2, is the second of seven layers in the OSI Computer Networking paradigm. This is the protocol layer that transports data between network nodes in a wide area network (WAN) or inside a local area network (LAN) segment. The data connection layer provides the functional and procedural means for transferring data across network entities, as well as the ability to detect and potentially fix faults in the physical layer.

Recommended Readings:

Are you planning to ace the interviews of reputed product-based companies like Amazon, Google, Microsoft, and more? 

Attempt our Online Mock Test Series on Coding Ninjas Studio now!

Ninja, have a great time learning.

Topics covered
1.
Introduction
2.
Questions
3.
FAQs
4.
Key takeaways