Skip to main content

Posts

Showing posts from 2011

Interview Questions

Problems on search/ sort --------------------------- Q. Design an algorithm to find the duplicates in an array. Given an array of random integers, write an algorithm in C that removes duplicated numbers and return the unique numbers in the original array. E.g Input: {4, 8, 4, 1, 1, 2, 9} Output: {4, 8, 1, 2, 9, ?, ?} void rmdup(int *array, int length){ int *current , *end = array + length - 1; for ( current = array + 1; array < end; array++, current = array + 1 ){   while ( current < end ){     if ( *current == *array ){         *current = *end--;     }     else{         current++;     }  }// while ends ... } // for ends ... } // func ends ===================== Q. Given an array of length N containing integers between 1 to Nm determine if it contains any duplicates. How can we efficiently find out if any of those numbers are duplicates ? To know only The easiest approach is to make a hash table to keep track of the numbers we've seen so far. Somet

SGSN/GGSN (GPRS)

================= The 3GPP architecture for data enhances the 2.5-generation General Packet Radio Service model, an intermediate step for transporting data over GSM networks. Two new nodes are defined in GPRS: the serving-GPRS support node (SGSN) and the gateway-GPRS support node (GGSN). The SGSN is at the same level as the mobile switching center, in that it interfaces to the "data" world in the same way that the mobile switching center interfaces to the circuit-switched PSTN (public switched telephone network). The GGSN, meanwhile, communicates with the SGSN to transport the data packets to and from external IP networks, such as the Internet. For data traffic, the radio-access network (RAN) node communicates with the SGSN, which transfers the IP datagrams from the mobile station or node inside GPRS Tunneling Protocol (GTP) packets. GTP runs over UDP/IP and is used for communication between the SGSN and the GGSN, as well as between the RAN and the SGSN. The SGSNs and GGSNs

SCTP - A new transport protocol

SCTP is a new transport protocol, also used for LTE Signalling S1-MME interface between eNB and MME (core network) and MME -HSS (Diameter / SCTP). 1 SCTP Protocol SCTP Packet is located after the MAC/ IP header. The basic SCTP Header consist of Source / Destination Ports (16 bits each), Verification Tag (32 bits) and check sum (32 bits) Verification Tag is used by the receiver to validate the senders authenticity, this get published by each endpoint to remote end duing the 4 way handshake done initially for setting up SCTP association. 1.1 4-Way handshake Msgs 1.1.1 INIT - Contains Initiate Tag, receiver window, in/out bound streams, initial TSN 1.1.2 INIT-ACK - Contains all params same as INIT msg also contains the State Cookie 1.1.3 COOKIE-ECHO - Contains Cookie same as received in INIT-ACK 1.1.4 COOKIE-ACK - Contains nothing, used to acknowledge receipt of COOKIE-ECHO Completion of above 4 SCTP msgs bring the SCTP association to an established stat