Monday, October 13, 2014

Networking - I

Let me share few networking related queries that can be used for our discussion ...

1. What is the use of Ethernet ?
Ethernet is a link layer protocol in TCP/IP stack and the most widely used LAN technology that provides a framework for data transmission to other devices on the same network segment.

2. How is the destination MAC address obtained ?
Destination MAC address is fetched via  ARP

3. Why is TCP called as connection oriented protocol ?
As the communication session is established by means of 3 way handshake ahead of transferring data, it is termed as connection oriented protocol. Here the client initiates the creation of logical pipes through which the messages shall be sent or received. These pipes shall be deleted at the end of connection.

4. Why is UDP called as connection less protocol ?
As the communication session is not established ahead of transferring data, it is termed as connection less protocol.

5. Why is TCP termed as Heavy weight protocol ?
TCP is heavy weight because it performs handshake for connection establishment, ordering of packets, handling reliability & congestion control. That is, TCP does lots of processing to provide reliable service and hence termed as heavy weight protocol.

6. What applications use TCP ?

7. What applications use UDP ?
Tunneling/VPN, TFTP, SNMP, Media streaming, Games, local broadcast , RTP

8. Why are realtime applications using UDP even though it is unreliable ?
It is used in realtime applications where it is ok even if data is lost

9. Explain any error detection mechanism in TCP ?
Error detection is viable through sequence numbers. Duplicate packets are discarded based on SN at receiver. The lost packets are re-transmitted based on ACKs.

10. What is flow control in TCP ?
In order for the receiver and transmitter to be sync on the rate of data transmission, TCP uses sliding window protocol, where the receiver intimates the sender about the amount of data that it is willing to buffer for the connection via the receive window field. The sender can accordingly send data only up to the extent.

11. What is the use of MSS in TCP ?
It is used to represent the largest amount of data that the receiver shall receive in a single segment.   

12. What is sliding window algorithm ?
TCP uses sliding window protocol, where the receiver intimates the sender about the amount of data that it is willing to buffer for the connection via the receive window field. The sender can accordingly send data only up to the extent.
13. Bandwidth utilization is good in TCP or UDP ?

14. Why is connect system call invoked by client ?
Connect system call helps in connecting the socket to the address of the server thereby enabling the establishment of connection.

15. Why is bind system call optional for either UDP or TCP client ?
connect system call is optional for UDP client as UDP is a connectionless protocol.

16. What is socket ?
 Socket represents an endpoint of a connection.

17. What is a raw socket and when will we use it ?
Raw socket receives or sends raw datagram without including any link layer headers. That is, it allows direct sending and receiving of internet protocol packets without any protocol specific transport layer formatting.

18. Once the segments arrive on the receiver, who does the re-assembly in the case of TCP protocol ?
IP layer handles the re-assembly.

19. Is fragmentation applicable for UDP. If yes, who does the fragmentation ?

20. Is fragmentation applicable for TCP. If yes, who does the fragmentation ?
Yes. The IP layer does the fragmentation.

21. What is the need for fragmentation in TCP ?
Fragmentation is done according the MTU of the device so that the data can be transmitted.

22. What determines the size for fragmentation in TCP ?
MTU determines the size for fragmentation.

23. What is the use of SYN field ?
The presence of SYN field conveys that sequence number is the initial sequence number(ISN). Only the first packet sent from either end shall have this SYN flag set .

24. What is the use of SN field ?
SN field carries the sequence number.
If SYN flag is set, it carries the initial sequence number (ISN).
If SYN flag is clear, then it is the accumulated sequence number of the first data byte of this segment for the current session.

25. What is the use of SACK field ?
SACK enables selective ACK which allows the client to inform on the range of packets received in order and the unreceived packets by which the server shall re-transmit only the packets that were not received by the client.

26. What is the use of Window field ?
Represents the size of the receive window.

27. When will the PSH flag bet set in TCP ?
This tells the receiver to push the data out immediately to the receiving application, rather than waiting for additional data to enter the buffer.

28. Is accept a blocking or non-blocking system call and what is the use of it ?
Accept is a blocking call.  It shall block until the connection request from client.

29. What is a concurrent server architecture ?
There will be one listening socket and multiple connected socket points at the server at any time.

30. What API is used for converting ipv4 address to NBO and vice versa ?
htons(), htonl(), ntohl(), ntohs()
31. What is the need for IP protocol, if ethernet can send data using the destination MAC address ?
IP header carries the source ip and destination IP that is required for addressing and routing.

32. What is the use of router, switch, bridge ? List differences between router, switch & bridge.
Router acts as a default gateway on the network segment if the packet has to go to another network. Router maintains table based on IP address & port. Router uses IP layer. Router overwrites the src MAC address with its own MAC address while sending it out.

Switch is a bridge configured to work like a hub in star topology. The received frames are processed & forwarded to the appropriate port using the forwarding table that is based on MAC address & port. Switch uses the data link layer. Switch does not overwrite the src MAC address.

Bridge is a layer 2 device which forwards to all other ports. It does not overwrite the src MAC address.
33. What is the use of TTL field ?
TTL determines the maximum number of hops that a packet can take while traveling in the network. While traversing through the network, the routers are expected to decrement the TTL value by 1 before forwarding the packet.

34. Who sets the congestion notification flag ?
The router in the network shall set the ECN flag incase of congestion in network.

35. Is it possible to have connection between multiple socket end points ?
A socket is one endpoint of a communication link between two programs running on the network. Endpoint is a combination of a port number and IP address. Every TCP connection shall be uniquely identified by two endpoints.
36. What are the limitations of ethernet ?
There is distance limitation on the maximum distance between devices on ethernet network. Transmission failure can happen as distance increases due to line noise or reduced signal strength or other degradation. Also, ethernet network face congestion problems as they increase in size.    

37. Is it true that data sent over ethernet is automatically broadcasted to every device in the network ?

38. What is the difference between CSMA and CSMA/CD ? Why CSMA is not enough ?
CSMA - Broadcast and sense the collision
CSMA/CD - Operates by detecting the occurrence of a collision. Once collision is detected, CSMA CD immediately terminates the transmission so that the transmitter does not have to waste lot of time in continuing.
39. What is a Jam signal ? What is back-off period ?
Whenever a collision is detected, the detecting station broadcasts a collision or jam signal to alert other stations that a collision has occurred. Accordingly, every station will wait for a random amount of time.

40. What is the need for MII ?
Originally defined as a standard interface to connect fast ethernet MAC block to PHY chip. This has later been extended as GMII, RGMII, SGMII, XGMII etc..

41. What is the ethernet supported by CAT5 . What is the ethernet supported by CAT5e cable ?
CAT5 supports both traditional and fast ethernet. CAT5e supports Gigabit ethernet.

42. How can you overcome the limitations of ethernet cable ?
Hub can help in overcoming the limitations of ethernet cable.

43. What are the types of ethernet frame formats ? Are they compatible with each other ?
Ethernet II, IEEE 802.3, IEEE 802.2 LLC, IEEE 802.2 SNAP. The different frame types have different format and MTU values, but can coexist on the same physical medium.   

44. What is the role of LLC and MAC layer in ethernet ?
LLC interacts with the upper network layer. It is responsible for handling layer 3 protocols (mux/de-mux) and link services like reliability(error management mechanisms such as ARQ) and flow control. MAC layer interacts with the lower PHY layer. It is responsible for framing and media access control for broadcast media.

45. What is carrier sensing ?
This is a media access control protocol where the transmitter determines whether another transmission is in progress before initiating transmission.

46. What is CSMA-CA ?
Carrier sensing is done but nodes attempt to avoid collisions by transmitting only when the channel is sensed to be idle.
47. What is the use of preamble and FCS in Ethernet frame ?
The preamble of ethernet packet allows devices to synchronize the receiver clocks. FCS is a error detecting code added to a frame that helps in discarding the damaged frame in a communication protocol if the FCS number calculated by the destination node mismatches with the FCS number sent by the source node.

48. What are the types of CSMA access modes ?
The types of CSMA access nodes are Persistent, Non-persistent, P-persistent and O-persistent.

49. What is port mirroring ? where is port mirroring used ?
Port mirroring sends a copy of network packets seen on one port to a network monitoring connection on another switch port. It is used in network switch.

50. What is a iterative server ?
Iterative server processes one client request at a time in a sequential manner.

No comments:

Post a Comment