CN numerical problems

 IP addresses and Fragmentation

https://cexpertvision.com/2021/03/19/numerical-practice-datagram-fragments/


Data link layer

1Q. A link has a transmission speed of 106 bits/sec. It uses data packets of size 1000 bytes each. Assume that the acknowledgement has negligible transmission delay, and that its propagation delay is the same as the data propagation delay. Also assume that the processing delays at the nodes are negligible. The efficiency of the stop-and-wait protocol in this setup is exactly 25%. The value of the one-way propagation delay (in milliseconds) is ___ Ans 12


2Q. Consider the sliding window algorithm where sender window size is 9 and receiver window size is 7 and no out of order arrivals. What is the smallest value for maximum sequence number?


3Q. Suppose two hosts are connected by a point-to-point link and they are configured to use stop and waitStop-and-Waitprotocol for reliable data transfer. Identify in which one of the following scenarios, the utilization of the link is the lowest.

  1. Longer link length and lower transmission rate
  2. Longer link length and higher transmission rate
  3. Shorter link length and lower transmission rate
  4. Shorter link length and higher transmission rate

4Q. In a stop and wait ARQ, Bandwidth Delay product is 20,000 bits. Given the frame size is 1000 bits. What is the percentage of utilization of link if we have a protocol that can send 15 frames without waiting for acknowledgement? 75%


5Q. A sender uses the stop and wait ARQ protocol for reliable transmission of frames. Frames are of size 100 bytes and the transmission rate at the sender is 20 Kbps. Size of an acknowledgement is 10 bytes and the transmission rate at the receiver is 8 Kbps. The one way propagation delay is 10 msec.

Assuming no frame is lost, the sender throughput is ________ bytes/sec.

6Q. In the GO back N ARQ sender is sending the 20 packets to the destination with a window size of 4. Every sixth packet is lost and after a packet loss sender is sending one dummy packet outside the window for ensuring everything is correct [ dummy packet is an outside packet not the part of the window]. How many number of transmissions will be there?


Transport layer questions: 

1Q. Assume a TCP implementation over a 10Gbps link with one way dealy of 80ms if TCP receiver window size is 2MB and TCP send 1KB packet then how many RTT does it take until slow start phase open the congesion windows of 2MB. Assume no congestion and no loss of packet.

a) 11 RTT b) 10 RTT c) 12 RTT d) 13 RTT     solution


2Q. In TCP, MSS is 8B. If during the 6th RTT the network is congested and timeout occurs, by using the congestion algorithm, then the threshold value is _________(in Bytes). (assume initial congestion window size for the first transmission is 1 MSS)   solution

3Q.  Which layer connects the network support layers and user support layers ?  solution

  1. transport layer
  2. network layer
  3. data link layer
  4. session layer

4Q. Suppose two TCP connections are present over some bottleneck link of rate R bps. Both connections have a huge file to send (in the same direction over the bottleneck link). The transmissions of the files start at the same time. What transmission rate would TCP like to give to each of the connections? sol


5Q. Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segment has sequence number 90; the second has sequence number 110.

  1. How much data is in the first segment?
  1. Suppose that the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number? sol

Multithreading Java Interview Questions

 1. What is the start() and run() method of Thread class?

When the start() method is called, a new thread is created and this newly created thread executes the task that is kept in the run() method. One can call the start() method only once.  

When the run() method is called, no new thread is created as in the case of the start() method. This method is executed by the current thread. One can call the run() method multiple times. 

2. What is Thread in java?

3. What are the 2 ways of implementing Thread in java?

4. What is the difference between class lock and Object lock?

Class lock: each and every class has a unique lock usually referred to as a class level lock. These locks are achieved using the keyword ‘static synchronized’ and can be used to make static data thread-safe. It is generally used when one wants to prevent multiple threads from entering a synchronized block.

Object lock: each and every object has a unique lock usually referred to as an object-level lock. These locks are achieved using the keyword ‘synchronized’ and can be used to protect non-static data. It is generally used when one wants to synchronize a non-static method or block so that only the thread will be able to execute the code block on a given instance of the class.  

5. What is Daemon Thread?
daemon threads are basically referred to as a service provider that provides services and support to user threads. There are basically two methods available in thread class for daemon thread: setDaemon() and isDaemon(). 

These threads are referred to as low priority threads, therefore are especially required for supporting background tasks like garbage collection, releasing memory of unused objects, etc. 

6. What are wait() and Sleep() methods?

it is a non-static method that causes the current thread to wait and go to sleep until some other threads call the notify () or notifyAll() method for the object’s monitor (lock). It simply releases the lock and is mostly used for inter-thread communication. It is defined in the object class, and should only be called from a synchronized context.

7. What is difference between notify() and notifyall()?

8. What is Runnable and Callable interface?

9. What are benefits of using Multithreading?

10. What is Thread pool?

11. What is the purpose of Join Method?

12. Explain deadlock?

13. How do Threads Communicate with each other?

14. How to stop thread in java?

15. Explain the different priorities of Threads?

16. What is the primary drawback of Syncronized Methods?

17. What are the different states of a Thread?

18. Is 2 threads can have same name? if yes, How can you identify the same threads?

19. What is the priority of main thread?

20. What is the default priority of a thread?

21. What is Synchronization?

22. Is it possible to make constructors  synchronized? No, 

23. Can we use Synchronized Keyword with variables? no

24. Explain Volatile Variables in java? main memory

25. What is Inter-Thread Communication?

26. What is Context switching?

27. When should we use interrupt a Thread?

28. What is Race-Condition?


Popular Post

MindMaps

Featured post

Question 1: Reverse Words in a String III

  def reverseWords(s: str) -> str: words = s.split() return ' '.join(word[::-1] for word in words)