Menu

Thursday, August 1, 2013

Answer Keys for June 2013 - Computer Science

After researching different resources, I am able to compile Answer keys for June 2013 paper of Computer Science. First, I am posting keys for Paper III as this paper is tougher to clear than othet two papers. I am sure 90% of the answers I have given are correct.
1. A
2. D
3. C
4. B
5. B
6. B
7. C
8. D
9. A or B
10. D
11. C
12. --
13. D
14. D
15. --
16. A
17. A
18. B
19. C
20. D
21. D
22. B
23. C
24. A
25. --
26. A
27. B
28. C
29. D
30. A
31. B
32. A
33. C
34. D
35. D
36. --
37. --
38. B
39. C
40. B
41. C
42. D
43. --
44. B
45. A
46. C
47. B
48. A
49. B
50. A
51. C
52. A
53. A
54. D
55. A
56. --
57. A
58. B
59. --
60. D
61. B
62. A
63. B
64. C
65. B
66. D
67. --
68. D
69. C
70. C
71. B
72. C
73. C
74. --
75. --

Useful Q & A on Networking - Part 1

Q 1. What happens at every layer of the OSI model when we type "www.google.com" in the browser? 

Ans. The following sequence of steps takes place every time we type the name of a website in a browser->
1) Your PC will need to resolve "www.google.com" to an IP address. It will therefore need to send a 
query to your DNS server ( usually your ISP's DNS).

2) The PC constructs a DNS query packet with a destination IP address equal to your DNS server 
and a destination MAC address of your router (gateway).

3) The DNS query process begins to resolve the IP address of the given URL.

4) Once your PC (web browser application) receives the IP address of the destination web server, it will construct a HTTP GET request and send it to Google's web server. (As per OSI model at application layer [layer 7] application software which is client web browser now know the IP address of google.com). After that it pass that information down to presentation layer.

5) Presentation layer[ layer 6] converts that HTTP request into a standard format which is HTTP format so that the other layers can understand.and pass that information down to session layer.

6) Session layer[ layer 5] at client side creates session for www.google.com which is HTTP session so that it can be separated from other sessions.and pass that information down to transport Layer.

7) Transport Layer[ layer 4]  at client side chooses TCP for every HTTP session which is reliable connection which creates virtual connection by using three way hand-shake before sending actual data [HTTP Request]. This layer also prepares segments by adding source and destination port number. Source port is chosen by upper layer which is random number range from 1024 to 65535  and destination port number is here 80, which is well known port number used for HTTP services.

Layer 4 assign source port number to distinguish the web browser application from every other program running on computer and it also used to identify which application should receive return traffic. The destination port number is used to make sure that messages coming from web browser gets and sent to web server program running on the server and is not grabbed by other program. After preparing segment, layer 4 at client side pass that information down to network layer.

8) Network Layer [ layer 3] at client side  prepares packet by adding source and destination IP address. It also check whether destination IP address is on local network or it is on remote network. If it is on local network it checks ARP cache to find mac address of local device. If cache is empty it sends ARP message to resolve IP address into MAC address. Here the device is on remote network so client PC sends ARP to find MAC address of default gate way [192.168.1.1]. Every devices on that network segment gets that ARP request because as it layer 2 broadcast message destined for all devices on that broadcast domain but only the default gateway, which is 192.168.1.1, replies with its MAC address. Then network layer passes this information down to data link layer.

9) Data link layer[ layer 2]  prepares frame by adding source and destination MAC address of default gate way[192.168.1.1]. It also rund CRC which simply checks the data and frame header bits and add that result in to frame check sequence (FCS) field. Then, passes this information down to Physical layer.

10) Physical layer[ layer 1]: converts all this information in 1's and 0's and sends it to destination device using Ethernet cable.

11) Google's Web server will reply and start sending your application the necessary data using TCP session.

12) The application will start to draw and present the website on your screen.

At the server side, i.e. Google:

1) At Physical layer, server receives the bits. Layer 2 of server builds frames and runs CRC and checks answer with FCS field. If answer didn't match then the frame is discarded. If it matches then the destination MAC address is checked. Here, destination MAC address is right, so it checks Ethernet type field to find the protocol used at network layer (which is IP). It retrieves the packet from the frame and gives to IP at network layer.

2) Network layer checks destination IP address and in our case it matches so it checks protocol type field to find the protocol used at Layer 4 (which is TCP). Now network layer of server sends all information up to TCP at layer 4.

3) At transport layer, destination port number is checked which is well know port number 80, which is destined to web server application running on that particular server i.e. in our case www.google.com. So it passes all those information up to google web server. Google web server sends acknowledgement message to client to ensure that it has received its request. Finally, it sends the web page in the form of packet by packet over the network to client. This information gives google web page to our client web browser.