Monday, December 31, 2012

GATE-Computer Networks-TCP/IP

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.
Standard applications using UDP include:
  • Trivial File Transfer Protocol (TFTP)
  • Domain Name System (DNS) name server
  • Remote Procedure Call (RPC), used by the Network File System (NFS)
  • Simple Network Management Protocol (SNMP)
  • Lightweight Directory Access Protocol (LDAP)
TCP is utilized extensively by 
  • World Wide Web (WWW)
  • E-mail
  • File Transfer Protocol
  • Secure Shell
  • Peer-to-Peer file sharing

GATE-2003
2. The subnet mask for a particular network is 255.255.31.0. Which of the following pairs of IP addresses could belong to this network.
(a) 172.57.88.62 & 172.56.87.23
(b) 10.35.28.2 & 10.35.29.4
(c) 191.203.31.87 & 192.234.31.88
(d) 128.8.129.43 & 128.8.161.55

Ans: option (d)
Explanation: 
Here is the question is: Which of the following pair of IP addresses belongs to the given network. Applying a subnet mask to an IP address separates network address from host address.

So you have to find the network-id from the IP address using the given subnet mask. Below shows the example of how to find a network-id from given Subnet mask and IP address

The network bits are represented by the 1's in the subnet mask, and the host bits are represented by 0's. Performing a bitwise logical AND operation on the IP address with the subnet mask produces the network address. For example, applying the Class C subnet mask to our IP address 216.3.128.12 produces the following network address:

IP:   1101 1000 . 0000 0011 . 1000 0000 . 0000 1100(216.003.128.012)
Mask: 1111 1111 . 1111 1111 . 1111 1111 . 0000 0000(255.255.255.000)
      --------------------------------------------------------------
      1101 1000 . 0000 0011 . 1000 0000 . 0000 0000(216.003.128.000)

Therefore the network-id is: 216.003.128.000

Hence doing the above for all the options, you will find that option (d) belongs to the same network.

GATE-2004
3. The routing table of a router is shown below
DESTINATION
SUBNETMASK
ETHERNET
128.75.43.0
255.255.255.0
Eth0
128.75.43.0   
255.255.255.128
Eth1
192.12.17.5   
255.255.255.255
Eth3
Default

Eth2
On which interface will router forward packets addressed to destinations 128.75.43.16 and 192.12.17.10 respectively?
a)Eth1 and Eth2      b)Eth0 and Eth2
c)Eth0 and Eth3      d)Eth1 and Eth3

Ans: option(a)
Explanation:
Perform AND operation between incoming IP address and Subnet-mask and then compare the result with the destination. Note that if there is a match between multiple Destinations, then select the destination with longest length subnet mask. For example, 
128.75.43.16, matches with 128.75.43.0 and 128.75.43.0. But the packet's addressed to  128.75.43.16 will be forwarded to Eth1.
If a result is not matching with any of the given destinations then the packet is forwarded to the default interface (here Eth2). Therefore the packet's addressed to 192.12.17.10 will be forwarded to Eth2.


GATE-2010
4. One of the header fields in an IP datagram is the Time to Live (TTL) field. Which of the following statements best explains the need for this field?(a) It can be used to priortize packets
(b) It can be used to reduce delays
(c) It can be used to optimize throughput
(d) It can be used to prevent packet looping

Ans: (d)

GATE-2010
5. Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same netmask N. Which of the values of N given below should not be used if A and B should belong to the same network?
(a) 255.255.255.0
(b) 255.255.255.128
(c) 255.255.255.192
(d) 255.255.255.224

Ans: option (d)
Explanation:
Apply subnet mask to the IP address, i.e. perform AND operation between IP address and subnet mask. If the result is equal for both IP address A & B then we can use that subnet mask else not. Applying subnet mask to all options we find that option (d) cannot be used.

GATE-2012
6. Consider an instance of TCP’s Additive Increase Multiplicative Decrease(AIMD) algorithm where the window size at the start of the slow start phase is 2 MSS and the threshold at the start of the first transmission is 8 MSS. Assume that a time out occurs during the fifth transmission. Find the congestion window size at the end of the tenth transmission.
(a) 8 MSS   (b) 14 MSS    (c) 7 MSS    (d) 12 MSS

Ans: option (c)
Explanation:
Read Slow Start Algorithm: http://www.btechonline.org/2012/12/slow-start-algorithm-in-tcp.html
Read AIMD Algorithm: http://en.wikipedia.org/wiki/Additive_increase/multiplicative_decrease

Note: Got through the above two links before you get into the solution.
Its given that initial Threshold is: 8MSS
Transmission
Window Size
Reason
First
2
Slow Start Phase
Second 
4
Third
8
Fourth 
9
Threshold reaches;  According to AIMD increase by 1MSS
Fifth
10
Timeout occurs. New Threshold = 10/2 = 5MSS
Sixth
2
Reset to Slow Start State
Seventh
4
Slow Start Phase
Eight
5
Threshold reaches.
Ninth
6
According to AIMD increase by 1MSS
Tenth
7

Hence the answer is: 7MSS (since it transmitted 7 segments during 10th transmission)

GATE-2008
7. In the slow start phase of the TCP congestion control algorithm, the size of the congestion window
(a) does not increase
(b) increases linearly
(c) increases quadratically
(d) increases exponentially

Ans: option (d)
Explanation:
Read Slow Start Algorithm: http://www.btechonline.org/2012/12/slow-start-algorithm-in-tcp.html

GATE-2008
8. If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per subnet?
(a) 1022   (b) 1023   (c) 2046   (d) 2047

Ans: option (c)
Explanation:
Convert the subnet mask into binary format.
255.255.248.0 = 11111111.11111111.11111000.00000000
Note:
Number of 1's in the subnet mask indicates the Network-ID and the Subnet-ID part
Number of 0's in the subnet mask indicates the Host-ID part
Maximum number of Hosts per subnet = 211 = 2048
where 11 = Number of 0's in the Subnet Mask.
Out of 2048 values, 2 addresses are reserved, hence we remove them (2048-2 = 2046). 
Note: In the host part of the address:- all bits as 1 is reserved as broadcast address and all bits as 0 is used as network address of subnet.

Hence option (c) is the answer.

GATE-2008
9. Which of the following system calls results in the sending of SYN packets?
(a) socket    (b) bind    (c) listen    (d) connect

Ans: option (d)
Explanation:
A typical TCP client and server application issues a sequence of TCP system calls to attain certain functions. 
The socket system call creates a new socket and assigns the protocol and resources to the created socket descriptor.
The bind system call associates a local network transport address with a socket. For a client process, it is not mandatory to issue a bind call. The kernel takes care of doing an implicit binding when the client process issues the connect system call. It is often necessary for a server process to issue an explicit bind request before it can accept connections or start communication with clients.
The listen call indicates to the protocol that the server process is ready to accept any new incoming connections on the socket. There is a limit on the number of connections that can be queued up, after which any further connection requests are ignored.
The connect system call is normally called by the client process to connect to the server process.


To know more on TCP system call sequences: http://www.ibm.com/developerworks/aix/library/au-tcpsystemcalls/index.html

GATE-2008
10. What is the maximum size of data that the application layer can pass on to the TCP layer below?
(a) Any size
(b) 216 bytes-size of TCP header
(c) 216 bytes
(d) 1500 bytes

Ans: option (a)
Explanation:
Application layer can forward any size of data to the transport layer. Transport layer in turn divides the data into several data packets.

GATE-2012
11. The protocol data unit(PDU) for the application layer in the Internet stack is
(a) Segment    (b) Datagram    (c) Message    (d) Frame

Ans: (c)
Note:
PDU for Application Layer - Message
PDU for Internet Layer - Datagram
PDU for Transport Layer - Segment
PDU for Link Layer - Frame

GATE-2012
12. Which of the following transport layer protocols is used to support electronic mail?
(a) SMTP   (b) IP    (c) TCP    (d) UDP

Ans: (c)
Explanation:
Application Layer protocol for sending email is SMTP (Simple Mail Transfer Protocol). SMTP is a connection oriented protocol, therefore it uses TCP at Transport Layer.
Note:
IP - It is a network layer protocol.
UDP - is a connection-less transport layer protocol.

GATE-2012
13. In the IPv4 addressing format, the number of networks allowed under Class C addresses is
(a) 214 (b) 27      (c) 221      (d) 224
Ans: option (c)
Note:
Class
Leading
bits
Number
of networks
Number of Hosts
Start address
End address
Class A
    0
    27-2=126
16,777,214=224-2
0.0.0.0
126.255.255.255
Class B
    10
    214=16,384
    65,534=216-2
128.0.0.0
191.255.255.255
Class C
    110
    2,097,152=221
    254=28-2
192.0.0.0
223.255.255.255
Class D (multicast)
    1110
    not defined
    not defined
224.0.0.0
239.255.255.255
Class E (reserved)
    1111
    not defined
    not defined
240.0.0.0
255.255.255.255
* Having all 0's or all 1's either in the network-id or in the host-id is not allowed, because they are meant for special purposes and are reserved.

GATE-2005
14. An organization has a class B network and wishes to form subnets for 64 departments. The subnet mask would be:
(a) 255.255.0.0
(b) 255.255.64.0
(c) 255.255.128.0
(d) 255.255.252.0

Ans: option (d)
Explanation:
Number of 1's in the subnet mask indicates the Network-ID and the Subnet-ID part
Number of 0's in the subnet mask indicates the Host-ID part

Since Class B network, network-ID consists of 16 bits, and host-id consists of 16 bits. Since we need 64 subnetworks, we have to borrow 6 bits for subnet-ID. Therefore, subnet mask will be 255.255.252.0


GATE - 2013
15. Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the network layer and the data link layer during a transmission from S to D.




(a) Network layer – 4 times and Data link layer-4 times
(b) Network layer – 4 times and Data link layer-3 times
(c) Network layer – 4 times and Data link layer-6 times
(d) Network layer – 2 times and Data link layer-6 times

Ans: option (c)
Explanation:










The above figure will give you the clear explanation of the answer. Note that, a router is considered a Layer 3 device because its primary forwarding decision is based on the information in the Layer 3 IP packet, specifically the destination IP address.

18 comments:

  1. Thank u so much For this sir.... I was looking for this :)

    ReplyDelete
  2. Thank U vry much.......:)

    ReplyDelete
  3. Thanx alot sir....

    ReplyDelete
  4. thanks..it's really very helpfull

    ReplyDelete
  5. thanks a lot the explanation u gave is very help full .

    ReplyDelete
  6. Thanks a lot :)

    ReplyDelete
  7. thank you bhau

    ReplyDelete
  8. greatttttttt thanks a lottttttt

    ReplyDelete
  9. anyone can provide the best site for UGC NEt preparation also

    ReplyDelete
  10. @kanvi
    http://www.computersciencetest.com/2013/04/national-eligibility-test-june-2013.html

    ReplyDelete
  11. http://www.pyexams.com/ for ugc net and gate preparation

    ReplyDelete