Showing posts with label Protocol. Show all posts
Showing posts with label Protocol. Show all posts

Saturday, April 23, 2016

STP

Hello everyone... Got some time to arrive on few interesting points that can be discussed regarding STP.

1. What is STP protocol ?
It is a protocol that helps in preventing loops in layer 2 and broadcast storms when we have a redundant link. It operates by blocking the redundant paths and normally provides only only one way of communication channel.

2. Is STP layer 3 or layer 2 protocol ?
It is a layer 2 protocol

3. What are the problems due to redundant layer 2 topology ?
i) Broadcast storms
ii) Multiple frame copies
iii) Unstable MAC table

4. What problems does a broadcast storm cause ?
It shall slow down the network and also reduce or block the throughput of the network

5. What is BPDU ?
The BPDU is used by switch for spanning tree algorithm to shutdown the redundant links. The STP protocol operates by exchanging small packets called as BPDU(Bridge Protocol Data Unit) which is exchanged every 2 seconds . BPDU is composed of root Id, root path cost, bridge Id, maximum age and hello timer. The root path cost is based on BW link speed. Bridge Id is based on bridge priority & bridge mac address, max age to intimate the change in root, hello timer (2 seconds). The BPDU uses multicast destination mac address(01:80:c2:00:00:00) as destination mac address.

6. What are the main steps in STP ?
Election of root bridge. Identification of root ports. Identification of designated ports. Moving a port to blocked state in case of existence of loop or activation of port that is in blocked state if the loop is removed.

7. Will there be multiple blocked ports in case of STP ?
If there exists multiple loops , then multiple ports shall be placed in blocking state.

8. How does a switch in a network is selected as root bridge ?
The root bridge is the switch with the lowest bridge identifier (Bridge ID) where the bridge identifier is based on Bridge priority & Mac address.

9. How to determine the root port ?
Once the root bridge is selected, all the switches in network will determine the shortest path to the root bridge based on root path cost. The link or interface(shorted path) that leads to the root bridge is determined as the root port. So, a root bridge cannot have a root port. Whereas, each switch shall have only one root port that always forwards traffic to the root bridge.

10. What are the types of BPDU ?
i) Configuration BPDU
ii) Topology Change Notification BPDU
iii) Topology Change Notification Acknowledgement BPDU

11. How to determine designated port ?
All ports on root bridge are termed as designated port. Normally , once the root port selection is done, the other side of the port of the link is made as the designated port. The designated port shall be in forwarding state.

12. How to determine blocked port ?
Once the link with shortest path cost is termed root port, the other link that leads to the root bridge is blocked . Blocked port(Non-designated port) shall receive information from designated port, but shall not forward the information through it. If one end of every link is designated port , the other end may be termed as either blocked port or root port.

13. How to decide root port in case of ties ?
The tie breaking is achieved based on the root path costs. In case the root path costs are same, then the bridge with the lowest switch id (bridge id based on switch priority & MAC address) is selected.

14. How to decide designated port in case of ties ?
If bridge Ids are equal, then the one with the lowest MAC address is termed as designated port.

15. What are the stages or time taken taken while change in topology ?
20 seconds(max_age) to determine change in topology. 15 seconds in listening stage where it tries to determine the root bridge, designated and blocking ports. 15 seconds in listening stage where it shall learn the mac address from user frames. Following this, it shall be in forwarding state.

16. How is root bridge elected ?
Initially all switch claim themselves as root bridge and start sending BPDUs that are used for exchange of STP information between switches. However, comparison between received BPDU information and that of locally stored information is done. The bridge with lowest bridge ID is selected as root bridge which is achieved by first comparing the priority and later by comparing the MAC addresses. Once the root bridge is selected, it shall trigger topology change and send the configuration messages with its own bridge identifier as root identifier.

17. What are the states in STP ?
Blocking, Listening, Learning, Forwarding and Disabled

18. What happens in Listening state ?
This is the state during which frame forwarding and MAC address learning are disabled. This state is obtained after moving out of blocking state whereby it receives and accepts BPDUs or sends BPDUs. The switch processes the BPDUs and awaits for new information that can cause change of state.

19. What happens in forwarding state ?
In forwarding state, the port shall send or receive data , BPDUs. But also, keeps monitoring the BPDUs for making of possible change in state.

20. What happens in learning state ?
This is the state during which the frame forwarding continues to be disabled. However, it starts MAC learning where the port starts adding entries in MAC address table by looking at the source address of incoming frames.

21. What is configuration BPDU ?
The root bridge sends configuration BPDU at every hello time with information required for calculating spanning tree topology.

22. What is topology change  BPDU ?
Bridges that detect topology change shall send this BPDU towards the root bridge which inturn shall forward to other switches to inform that a topology change has occurred in current topology.  The switches that receive the topology change BPDU (TC flag set), shall reduce the age out timer to age out filtering database entries rapidly.

Tuesday, April 12, 2016

IPv6


Lets discuss regarding IPv6. Feel free to post your queries or answers..

1. What is IPv6 ?
    It is the protocol with capabilities to replace/upgrade IPv4.

2. Difference between IPv6 and IPv4 addresses ?
    a. IPv4 uses decimal number as numbering format for ip address
        IPv6 uses hexadecimal number as numbering format for ip address
    b. IPv4 is 32-bit numeric address
        IPv6 is 128-bit address in hexadecimal
    c. IPv4 uses class-based addressing
        IPv6 uses classless addressing

3. What is the need for IPv6 ?
     a. Limitation in address space offered by IPv4
     b. Absence of security features on its own in IPv4
     c. Limitation in data prioritization / QoS offered by IPv4

4.How will you port an application from IPv4 to IPv6 ?
   The system calls should be updated with appropriate arguments as per IPv6.

5. How will you represent an IPv6 address ?
    It shall be represented as 8 groups of 4 hexadecimal digits separated by colons.

6. How could the IPv4 address exhaustion could be handled ?
    There are various approaches like Subnetting/CIDR, NAT/PAT, Use of Private networks & DHCP

7. What changes are made in header for IPv6 ?
    All unnecessary information and options that are present in IPv4 are moved to the end of IPv6 header

8. What is the size of IPv6 header ?
     IPv6 header has a fixed header size of 40 bytes, whereas the IPv4 header has a variable length due to options field.

9. Which fields are same in IPv4 and IPv6 ?
    Version field, Type of Service (IPv4) is similar as Traffic Class(IPv6), Total
    length(IPv4) is somewhat similar as Payload length(IPv6), TTL (IPv4) is same as Hop
    Limit(IPv6), Protocol(IPv4) is somewhat similar as Next Header(IPv6)

10.What is the additional field in IPv6 that is absent in IPv4 ?
     Flow label for sequencing of packets

11. Which fields have been eliminated/deleted in IPv6 from that of IPv4 ?
      Header checksum, Header length & Fragmentation fields are eliminated. The Options field is moved into payload

12. What are the new features with IPv6 ?
      a. Stateless auto configuration
             i) No need for DHCP
            ii) New host can assign its own host address
      b. New IP security protocols
             i) Authentication of source
           iii) Encryption of payload
      c. Jumbo payload option that can carry packet upto 4GB

13. What ways IPv6 devices can be deployed ?
      a. By Tunneling IPv6 over IPv4
      b. Using Dual stack router that supports both IPv4 and IPv6
      c. Using a NAT device for translation between IPv4 and IPv6

Monday, November 24, 2014

GTP

Hey everyone, here is the list of possible GTP protocol questions that can be discussed.

1. What is GTP ?
2. Why is GTP used ?
3. What is the equivalent of GTP protocol that can be used in roaming architecture in LTE ?
4. Is GTP over TCP or UDP ? Which is the preferred transport protocol for GTP ?
5. What are the variants of GTP ?
6. Which is the latest version of GTP-C and GTP-U ?
7. What is the use of GTP-C, GTP-U and GTP' ?
8. Which version introduced replaced TID with TEID ?
9. What is a TEID made of ?
10. What is the content of user payload of GTP ?
11. How is a tunnel identified in GTP-U ?
12. What is the use of GTP-U tunnel ?
13. How do the entities know the destination TEID for communication ?
14. What is a T-PDU ?
15. What is a G-PDU ?
16. What do you call the inner IP packet as ?
17. What will happen if the resultant outer IP packet is larger than the MTU of the first link towards the destination of GTPv1-U endpoint ?
18. Will the hopcount / TTL be changed by the tunnel endpoint ? Will any other entity perform it in LTE ?
19. What is the relation between fragmentation and bandwidth ?
20. Which interfaces are GTP based in LTE ?
21. What is the other protocol that can be used instead of GTP in LTE ?
22. What is the main responsibility of GTP-C ?
23. How many GTP-U tunnels can be established for a single user ?
24. How are GTP-U tunnels mapped in LTE ?
25. What is a tunnel endpoint made of ?
26. How many TEID-C can be there for a PDN connection ?
26. Is TEID unidirectional or bi-directional ?27. Does GTPv2 provide fallback to GTPv1 and GTPv0 ?
28. Why is GTPv0 not promoted ?
29. Which message shares TEID of MME to SGW and vice versa?
30. Which message shares TEID of SGW to PGW and vice versa?

Wednesday, October 15, 2014

SCTP

Here are few possible discussion questions related to SCTP protocol

1. What are the advantages of SCTP over TCP ?
2. What is multi-srtreaming in SCTP ?
3. What is multi-homing in SCTP ?
4. How is SCTP more secure than TCP ?
5. What is the use of V-Tag in SCTP ?
6. Is there any difference between the SACK of TCP and SACK of SCTP ?
7. Can SCTP allow transfer of un-ordered packets ?
8. How do you send large packets over SCTP ?
9. Who takes care of fragmentation at the sender side of SCTP and Who takes care of re-assembly at the receiver side of SCTP ?
10. What is an association ? How is it created ? To what functionality of TCP is it equivalent to ?
11. Where is SCTP used widely as of now ?
12. Can a packet packet carry only the control chunk ? Name few singleton chunks ?
13. How many data chunks can be part of a packet ?
14. What is the relation between TSN, SN and SI ?
15. What are the two random values that are generated during the setup of association ?
16. When are the ip addresses of endpoints exchanged ?
17. What is an endpoint ?
18. Is a stream in SCTP uni-directional or bi-directional ?
19. Can an association have more streams in one direction than in other direction ? That is, can inbound streams be greater than outbound streams ?
20. Can the stream number start randomly ?
21. When are the valid stream number range set ?
22. What will the receiver do if the messages are out of order in a stream ?
23. What will the receiver do if fragmented message is received ?
24. Which field plays a key role in detection of lost data chunks ?
25. When a SCTP packet arrives at the receiver, is it possible to process the data chunks before control chunks ?
26. What is the use of U B E bits (Chunk flags) ?
27. Is it possible for a single chunk to have both B and E bit set  ? What does it refer to ?
28. How is the receiver window size conveyed to the sender ?
29. What is the use of cookie and cookie-echo ? What are the contents of cookie ? How is stale cookie identified ?
30. What is SYN flood ? How is it avoided in SCTP ?
31. What is the equivalent of TCP FIN in SCTP ? Is shutdown procedure of 2-way or 3-way or 4-way handshake in SCTP ?
32. What is Head-of-line blocking and how unnecessary Head-of-line blocking are avoided in SCTP ?
33. Can a INIT-ACK chunk have the other NIC interface address rather than that of the main address ?
34. How to determine the number of duplicate TSN report ?
35. What does the field 'Number of Fragments' refer to in SACK ?
36. How is SCTP a mix of UDP and TCP features ?
37. What is the boundary alignment for chunks ?
38. Will the length field include the padding bytes also ? Will the CRC cover the entire SCTP packet (that is, will it cover the SCTP common header + chunks) ?
39. Can a control chunk or data chunk go along with INIT or INIT-ACK chunk ? Can a control chunk or data chunk go along with COOKIE or COOKIE-ECHO chunks ?
40. What are the types of sockets w.r.t SCTP ?
41. What is the relation between initiation tag and verification tag ?
42. Can an SCTP endpoint have more than 1 IP addresses and more than 1 port numbers ?
43. How many associations can be had between any two endpoints ?
44. Do un-ordered messages within a stream have SSN ?
45. What is the encoding format of chunks ?
46. Which chunk conveys the inbound and outbound streams ?
47. How to identify unrecognized chunks ?
48. What is the equivalent of TCP RST in SCTP ?
49. What are the fields/contents of SCTP common header ?
50. What is the use of Heartbeat chunk ?

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 ?
SSH, HTTP, FTP, Telnet, SMTP, IMAP/POP, NFS

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 ?
TCP

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 ?
No.

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 ?
Yes.

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.

Tuesday, June 8, 2010

I2C and SPI

Hey dudes, the following interesting questions related to I2C and SPI protocol can be used for  discussion.

1. Can devices be added and removed while the system is running (Hot swapping) in I2C ?
2. What is the standard bus speed in I2C ?
3. How many devices can be connected in a standard I2C communication ?
4. What are the 2 roles of nodes in I2C communication ?
5. What are the modes of operation in I2C communication ?
6. What is bus arbitration ?
7. Advantages and limitations of I2C communication ?
8. How many wires are required for I2C communication ? What are the signals involved in I2C ?
9. What is START bit and STOP bit ?
10. How will the master indicate that it is either address / data ? How will it intimate to the slave that it is going to either read / write ?
11. Is it possible to have multiple masters in I2C ?
12. In write transaction, the Master monitors the last ACK and issues STOP condition - True/False ?
13. In read transaction, the master doesnot acknowledge the final byte it receives and issues STOP condition - True/False ?
14. What is SPI communication ?
15. How many wires are required for SPI communication ?
16. What are the 4 logic signals specified by SPI bus ?
17. Does SPI slave acknowledge the receipt of data ?
18. SPI has higher throughput than I2C - True / False ?
19. Is it better to use I2C or SPI for data communication between a microprocessor and DSP ?
20. Is it better to use I2C or SPI for data communication from ADC ?
21. Duplex communication is possible by simultaneously using MOSI and MISO during each SPI clock cycle - True / False ?
22. Is it possible to connect SPI slaves in daisy chain ?
23. What is the role of shift register in Master and Slave devices in SPI ?
24. How will the master convey that it is stopping the transmission of data ?
25. What is bit banging ?

Hope , the above are the main possible embedded interview questions related to I2C/SPI protocol ! All the best :-)