Showing posts with label Computer Networks. Show all posts
Showing posts with label Computer Networks. Show all posts

Sunday, April 15, 2018

GATE-Computer Networks-Flow Control

1 comment:

Previous GATE questions with solutions on Computer Networks (Flow Control) - CS/IT

GATE -2015
1. Since it is a network that uses switch, every packet goes through two links, one from source to switch and other from switch to destination.
Since there are 10000 bits and packet size is 5000, two packets are sent. Transmission time for each packet is 5000 / 107 seconds
Two hosts are connected via a packet switch with 107 bits per second links. Each link has a propagation delay of 20 microseconds. The switch begins forwarding a packet 35 microseconds after it receives the same. If 10000 bits of data are to be transmitted between the two hosts using a packet size of 5000 bits, the time elapsed between the transmission of the first bit of data and the reception of the last bit of the data in microseconds is _________.
(a) 1075      (b) 1575        (c) 2220         (d) 2200

Ans: option (b)
Explanation:
It is given that there are 10,000 bits and since the packet size id 5000 it means we have 2 packets to send. 
Transmission time for one packet = 5000 / 107 seconds = 500μs
Transmission time is the time taken to transmit a packet from host to the outgoing link.

It is also given that the propagation delay of links is 20μs.  Propagation delay is the time taken by a bit to reach from sender to receiver (in this case from sender to switch it is 20μs and from switch to receiver it 20μs)

Time for the first packet (P1) to reach switch =Transmission time + Propagation delay
=500μs + 20μs = 520μs
Once P1 reaches the switch, the switch will take 35μs to process the packet and then it takes 500μs to transmit it to the link and then the packet will take 20μs to reach the receiver.
Therefore Time taken by P1 to reach from switch to receiver = 35μs + 500μs+ 20μs = 555μs
Therefore time taken by P1 to reach from sender to receiver = 520μs+555μs = 1075μs

But we need to note that after 520μs the switch starts receiving second packet (P2).
i.e. At 520μs+500μs = 1020μs P2 is completely received by switch.
Now Time taken by P2 to reach from switch to receiver = 35μs + 500μs+ 20μs = 555μs
It means that at  1575μs (1020μs+555μs) P2 reaches the destination.


Gate-2015
2. Suppose that the stop-and-wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds propagation delay. Assume that the transmission time for the acknowledgement and the processing time at nodes are negligible. Then the minimum frame size in bytes to achieve a link utilization of at least 50% is_________________.
(a) 160      (b) 320      (c) 640      (d) 220      

Ans: option (b)
Explanation:
Since the link utilization should be atleast 50% it means that efficiency, η 50%
Since it is mentioned that it is a stop&wait protocol, the efficiency of the link can be calculated as below:
η =  1 /( 1 + 2a)
a = Tp/Tt (where Tp = Propagation delay & Tt = Transmission Time)
Lets see the length of the packet to achieve a link utilization of 50%
50/100 = 1 /( 1 + 2a)
1/2 = 1 /( 1 + 2a)
a = 1/2
Tp/Tt = 1/2
20/Tt=1/2
Tt = 40ms
Tt = transmission time = L/B (where L = length of packet and B = bandwidth)
L/B = 40
L =40 * B = 40 ms * 64 Kbps = 40*10-3 *64*103 = 2560 bits
Since we need to determine the frame size in bytes L = 2560/8 = 320 bytes.
Therefore, the minimum frame size in bytes to achieve a link utilization of at least 50% is 320bytes


Monday, December 31, 2012

Purpose of Port Number

No comments:
Explanation has been moved to our Question Answer Site. Please Click Here to proceed...

GATE-Computer Networks-TCP/IP

17 comments:
Previous GATE questions with solutions on Computer Networks (TCP/IP) - CS/IT

GATE-2013
1. The transport layer protocols used for real time multimedia, file transfer, DNS and email, respectively are
(a) TCP, UDP, UDP and TCP
(b) UDP, TCP, TCP and UDP
(c) UDP, TCP, UDP and TCP
(d) TCP, UDP, TCP and UDP

Ans: option(c)
Explanation:
Real Time Multimedia: Data packets should be delivered faster. Also it can be unreliable. Therefore UDP.
File Transfer: For example downloading a file. It should be secure and reliable. Therefore TCP.
DNS: uses both UDP and TCP for its transport. But to acheive efficiency DNS uses UDP. To start a TCP connection a minimum of three packets are required (SYN out, SYN+ACK back, ACK out). UDP uses a simple transmission model with a minimum of protocol mechanism. UDP has no handshaking dialogues.
Email: uses SMTP protocol which uses TCP protocol.

Slow Start Algorithm in TCP

1 comment:

Slow-start is one of the algorithms that TCP uses to control congestion inside the network. It is also known as the exponential growth phase.

The slow start algorithm can simplified as this: for every acknowledgment received, increase the Congestion  Window by one MSS. For example, if one MSS is 400bytes and our initial Congestion Window is twice that (i.e. 800bytes), we can initially send up to two full segments immediately after the connection is established, but then we have to wait for our segments to be acknowledged by the recipient. For each of the two acknowledgments we then receive, we can increase our Congestion Window by one MSS (400 bytes). So, after we receive two acknowledgments back, our Congestion Window becomes 1600 bytes (800 + 400+ 400). Now we can send up to four full segments before we have to wait for another acknowledgment. and so on. Therefore the Congestion Window increases its size by the number of segments acknowledged.
This exponential increase in the size of the Congestion Window happens until either an acknowledgment is not received for some segment or a predetermined threshold value is reached. 

If a loss event occurs, TCP assumes that it is due to network congestion and takes steps to reduce the offered load on the network. It will halve the slow start threshold, reduce congestion window to 1 MSS, and reset to slow-start state.

Once the threshold has been reached, TCP enters the linear growth phase. At this point, the window is increased by 1 segment for each RTT. This happens until a loss event occurs.

Wednesday, December 26, 2012

GATE questions on Computer Networks - Sliding Window Protocol

27 comments:
Previous GATE questions with solutions on Computer Networks (Sliding Window Protocol) - CS/IT

GATE-2005
1.The maximum window size for data transmission using the selective reject protocol with n-bit frame sequence numbers is
a) 2n            b) 2n-1                    c) 2n-1                   d)2n-2

Ans: Option b
Explanation:
Selective Reject (or Selective Repeat) protocol is one of the automatic repeat-request (ARQ) techniques used for communications. 
In SR protocol the window size of the receiver and sender must be (N+1)/2, where N is the maximum sequence number.
If N is the maximum available sequence numbers then, the window size of both sender and receiver must be N/2.
If n is the number of bits in the frame sequence field then, the window size of both sender and receiver must be  2n-1.

Tuesday, December 25, 2012

Purpose of OSI Model

No comments:

When networking concept was introduced, computers could typically communicate only with computers from the same manufacturer. The OSI (Open Systems Interconnection) model was created by the International Organization for Standardization (ISO) to solve this problem. The OSI model was meant to help vendors create interoperable network devices... (Read More)

Explanation has been moved to our Question Answer Site. Please Click Here to proceed...

Saturday, December 22, 2012

TTL (Time to Live) Field in IP Header

No comments:

The purpose of the TTL field is to catch packets that have been going around in routing loops and discard them, rather than let them consume resources indefinitely. Hence this field is used to avoid infinite looping of packets.

What does the value of TTL field in the IP header indicate? Is it number of seconds, or is it number of hops?

Originally, TTL was set to a specific number of seconds that the packet would be allowed to live, and routers along the path would decrement this field until it reached 0. However, since it was rare for a packet to sit for as long as 1 second in a router, and routers did not all have access to a common clock, most routers just decremented the TTL by 1 as they forwarded the packet. Thus, it became more of a hop count than a timer, which is still a perfectly good way to catch packets that are stuck in routing loops. 

The default value currently used is 64.

Internet Protocol (IP)

No comments:

The Internet Protocol is the key tool used today to build scalable, heterogeneous internetworks. It was originally known as the Kahn-Cerf protocol after its inventors. 


The IP service model can be thought of as having two parts: 
1) An addressing scheme, which provides a way to identify all hosts in the internetwork.
2) A datagram (connectionless) modelofdatadelivery.

This service model is sometimes called best effort because, although IP makes every effort to deliver datagrams, it makes no guarantees. If something goes wrong and the packet gets lost, corrupted, misdelivered, or in any way fails to reach its intended destination, the network does nothing—it made its best effort, and that is all it has to do. It does not make any attempt to recover from the failure. This is sometimes called an unreliable service. Best-effort delivery does not just mean that packets can get lost. Sometimes they can get delivered out of order, and sometimes the same packet can get delivered more than once. The higher-level protocols or applications that run above IP need to be aware of all these possible failure modes.



Reference:
Computer Networks: Peterson and Davie

Internet Control Message Protocol (ICMP)

2 comments:

IP is always configured with a companion protocol, known as the Internet Control Message Protocol  (ICMP), that defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. For example, ICMP defines error messages indicating that the destination host is unreachable (perhaps due to a link failure), that the reassembly process failed, that the TTL had reached 0, that the IP header checksum failed, and so on.


ICMP also defines a handful of control messages that a router can send back to a source host. One of the most useful control messages, called an ICMP-Redirect, tells the source host that there is a better route to the destination.


ICMP is the basis for widely used debugging tools, Ping. Ping uses ICMP echo messages to determine if a node is reachable and alive.

Reference:
Computer Networks: Peterson & Davie



Difference between Virus and Worm

No comments:

Viruses and worms are characterized by the ability to make and spread copies of themselves. 

The difference between them is that a worm is a complete program that replicates itself, while a virus is a bit of code that is inserted (and inserts copies of itself) into another piece of software or a file, so that it is executed as part of the execution of that piece of software or as a result of opening the file.

Viruses requires the spreading of an infected host file, while worms are programs that replicate themselves from system to system without the use of a host file. 

Worms spread more rapidly than viruses. Worms consumes too much system memory or network bandwidth. 

Examples of Virus: Michelangelo, I LOVE YOU, Melissa etc.

Examples of Worms: Blaster Worm - this worm allows malicious users to control your computer remotely.

Firewalls

No comments:

Worms and viruses spread by exploiting bugs present in operating systems and application programs, so to keep out such potentially harmful traffic we use Firewalls.

Firewall acts as a SECURITY GUARD, or SECURITY WALL between an internal network of a company and the outside Internet.



A firewall blocks traffic unless that traffic is specifically allowed to pass through. For example, it might filter
out all incoming messages except those addresses to a particular set of IP addresses or to particular TCP port numbers. Firewall is useful if you do not want external users to access a particular host or service within your organization. A firewall may also impose restrictions  on outgoing traffic to prevent certain attacks and to limit losses if an adversary succeeds in getting access inside the firewall. 


Firewalls may be used to create multiple zones of trust, such as a hierarchy of increasingly trusted zones. A common arrangement involves three zones of trust: the internal network, the DMZ (“demilitarized zone”); and
the rest of the Internet. The DMZ is used to hold services such as DNS and email servers that need to be accessible to the outside. Both the internal network and the outside world can access the DMZ, but hosts in the DMZ cannot access the internal network; therefore, an adversary who succeeds in compromising a host in the exposed DMZ still cannot access the internal network.


Firewalls filter based on IP, TCP, and UDP information, among other things. Firewalls make use of level 4 port numbers, in addition to level 3 host addresses, for making decisions on forwarding and filtering. For this
reason network layer firewalls are sometimes called level 4 switches.

Reference:
Computer Networks: Peterson and Davie