Thursday, July 28, 2011

SONET Network Elements

  1. SONET protocol sits in the Physical Layer of TCP\IP, OSI model
  2. Hardware devices that implement the SONET Protocol are called as SONET NE’s
  3. for each SONET layer (path, line, section, and photonic) we have different network elements
  4. optical interface layer follow a hierarchy with Path layer on the top followed by line layer, section layer and photonic layer  
  5. the group of NE’s for each layer is commonly referred as PTE(path terminating equipment), LTE(line terminating equipment) and STE(section terminating equipment)
  6. each layer will add its own overhead bits to convey information (OH), called as POH, LOH, SOH
  7. Path layer deals with transport of service between between PTE NE, the main function is to map the signals form a format required by the line layer, and its function include reading, interpreting and modifying the POH for performance and APS (Automatic protection switching)
  8. Path Terminating Equipment
    1. Terminal Multiplexer (TM)
    2. aggregate DS1 (digital,PDH), DS3, E1s(Europe,digital,PDH), E3s, STS-Ns (Electrical,SONET), STM-Ns(SDH), into OC-N(Optical) Signals
      1. DS1, Digital Signal 1, 1.544 Mbps, called as T1 in USA, a PDH signal, contains 24 DS0(64Kbps)
      2. DS3, 44.736 Mbps, 672 DS0,
      3. E1, Digital Signal, in Europe, 2.048 Mbps, contains 32 DS0(64Kbps)
      4. STS1, Synchronous Transport Signal, Electrical Level equivalent to optical level OC1, 51.840 Mbps
      5. OC1, 51.840 Mbps with Payload 50.112 Mbps and Overhead of 1.728 Mbps
      6. STM1, Synchronous Transport Module, SDH equivalent of SONET STS3/OC3, 155.520 Mbps, 150.336 Mbps Payload, and 5.184 Mbps Overhead
    3. DS1 signals are mapped into VT1.5s (Virtual Tributaries), and DS3 (44.736) signals into STS1 (51.840) SPE (Synchronous Payload Envelop)
      1. VT1.5, Virtual Tributaries, 1.728 Mbps, called as VC11 (Virtual Container) in SDH
      2. SPE, Synchronous Payload Envelop of SONET
    4. EO (electrical to optical) and OE conversion takes place, during multiplexing and de-multiplexing respectively
    5. TM is an ADM operating in terminal mode
  9. Line Layer, deals with the transport of the path layer payload and it own LOH across the physical medium, main function is to provide synchronization and to perform multiplexing for the path layer, and protection switching, synchronization, line maintenance and error monitoring.
  10. Line Terminating Equipment
    1. Add Drop Multiplexer (ADM)
      1. combines (multiplex) several low bandwidth data streams and combine them into a single beam of light (optical signal)
      2. the add drop part is related to adding one or more lower bandwidth signals into an existing higher bandwidth data stream, and also extracting (dropping) low bandwidth and redirecting them
      3. a single stage Mux/Demux can multiplex various inputs into an OC-N, and then lower signals are added/dropped as required, thus providing interface between different network signals and SONET signals.
      4. SONET also enables dropping and duplicating of the signal, thus preserving the signal to be used by other nodes  (drop and continue), this drop and continue is used by , cable TV , and it also provides ring survivability, by duplicating the signal and passing it along a alternate route
    2. ROADM (Reconfigurable Optical Add Drop Multiplexer)
      1. Type of ADM with the options of remote reconfiguration of traffic, from a WDM (wavelength division multiplexing) system at the wavelength layer, achieved through Wavelength Selective Switching.
      2. the optical wavelengths added/dropped from a transport fiber need not be converted from Optical to Electrical to Optical (O-E-O)
      3. the bandwidth configuration can be done as and when required, without affecting the existing traffic, and allowing remote configuration
  11. Section Layer, deals with the transport of STS-N frame across physical medium, and functions are framing, scrambling, error monitoring and section maintenance
  12. Section Terminating Equipment
    1. this can be any two adjacent SONET network elements,
    2. Regenerator, or Repeater
      1. regenerate (amplify) attenuated signals
      2. needed because of the distance between multiplexers
      3. it clocks itself off the received signal, and replaces the SOH byte, LOH and POH are not changed

 

References

http://www.tek.com/Measurement/App_Notes/SONET/elements.pdf

http://www.techheap.com/communication/sonet/sonet_101.pdf

http://en.wikipedia.org/wiki/Reconfigurable_optical_add-drop_multiplexer

http://www.iphelp.ru/doc/3/Cisco.Press,.Optical.Network.Design.and.Implementation.(2004).DDU/1587051052/ch05lev1sec3.html#ch05fig04

http://www.techfest.com/networking/wan/dks1/dks1.htm

Tuesday, July 26, 2011

String reversal in C

  1: #include <stdio.h>
  2: #include <stdlib.h>
  3: 
  4: int mystrrev(char * str,int size);
  5: 
  6: int main()
  7: {
  8:  char name1[7]="Mithun";
  9:  char name2[6]="Mithu";
 10:  mystrrev(&name1,6);
 11:  mystrrev(&name2,5);
 12: 
 13:  printf("%s \n",name1);
 14:  printf("%s \n",name2);
 15: 
 16: }
 17: 
 18: int mystrrev(char * str,int size)
 19: {
 20:  int pivot = size/2;
 21:  char* s = str;
 22:  char* e = str+size-1;
 23:  printf("%d, %c \n", *s,*e);
 24: 
 25:  while(*str)
 26:  {
 27:   printf("%c , %d \n",*str,*str);
 28:   str++;
 29:  }
 30: 
 31:  while(pivot--)
 32:  {
 33:   *s = (*s)+(*e);
 34:   *e = (*s)-(*e);
 35:   *s = (*s)-(*e);
 36: 
 37:   s++;
 38:   e--;
 39:  }
 40: }
 

Wednesday, December 8, 2010

SIP SUBSCRIBE and NOTIFY Requests

SUBSCRIBE and NOTIFY (rfc 3265) 

  1. ability to receive asynchronous notification of events, on subscription
  2. general concept is that the entities in the network can SUBSCRIBE (which needs to be refreshed periodically) to resource or call state, and be notified when the state changes
  3. SUBSCRIBE requests create a dialog
  4. terms and definitions
    1. Event Package, set of state info to be reported by a notifier to a SUBSCRIBEr
    2. Event Template Package, special kind of event package which defines a set of event packages with a set od states which may be applied to all possible event packages
    3. Notification, act of sending a NOTIFY message to the SUBSCRIBER, informaing the state of resource
    4. Notifier, UA which generates the NOTIFY request, and typically accepts SUBSCRIBE request to create subscriptions
    5. State Agent, notifier which publishes the state on behalf of a resource, they may need to gather such info from multiple sources
    6. SUBSCRIBER, UA which receives a NOTIFY request, typically generate SUBSCRIBE request
    7. subscription is a set of application state associated with a dialog, containing a pointer to the associate dialog, the even package name, and an identifiction token
    8. Subscription Migration, act of moving a subscription from one notifier to another
  5. "Expires" Header
    1. SUBSCRIBE requests should contain an "Expires" header, indicating the duration of subscription 
    2. if no "Expires" header is present then the implied default defined in the even package is used
    3. 200 class response to a SUBSCRIBE request must contain an "Expires" header, the period can be shorter(but not longer) than specified in the request
    4. SUBSCRIBE with an "Expires" of 0 means
      1. the request is for unSUBSCRIBE from an event
      2. can also cause a fetch of state
      3. successful unsubscription will also trigger a final NOTIFY message

SIP Dialog

  1. peer to peer SIP relationship between two user agents
  2. facilitate sequencing messages between UA and proper routing of requests between them
  3. provides a context in which to interpret SIP messages
  4. dialogs can be created by
    1. INVITE method (rfc 3261)
    2. SUBSCRIBE and NOTIFY method (rfc 3265)
  5. a dialog is identified with a Dialog-ID
    1. the dialog-ID at each UA involved in the dialog is not the same, the local tag at one UA are identical to the remote tag at the peer UA
    2. dialog-ID is also associated with all the responses and with any request that contain a tag in To filed
    3. the rules for computing the dialog-ID of a message depends on whether SIP element is a UAS or UAC. 
    4. for a UAC the dialog-ID is composed of 
      1. call-ID
      2. remote tag (tag in the To field)
      3. local tag (tag in the From field), as this is added by the UAC on sending the request
    5. for a UAS the dialog-ID is composed of
      1. call-ID
      2. remote tag (tag in the From field)
      3. local tag (tag in the To field), added by UAS in the response

Tuesday, November 9, 2010

Embedded System Development ( linking process )


  1. cross-platform development methodology, includes 
    1. host system
    2. target embedded system
    3. connectivity solutions between host and target (Joint Test Action Group/Background Debug Module)
  2. development tools in the host environment are
    1. cross compiler
    2. linker
    3. source level debugger
  3. tools in the target embedded system
    1. dynamic loader
    2. link loader
    3. debug agent
  4. journey from code to executable
    1. developer writes in C/C++ and assembly
    2. make-file is created, to automate the process of building/rebuilding on modification
    3. compiler and assembler produce object file containing both machine binary code and data in the target system
    4. linker take these object files, and produces either a executable or an object file, used to additional linking with other object fiies
    5. the linker command file (linker script) instructs linker on how to combine the object files and where to place the binary code and data in the target embedded system
    6. the main
  5. symbol table  
    1. created by compiler and contains the symbol name to address mapping
    2. contains the global symbols defined in the file being compiled and the external symbols referenced in the file that the linker needs to resolve
  6. symbol resolution, part of linking process
    1. find where (in other object files) the external symbols are defined
    2. the statically linked library (in which the external symbols are defined) are copied to the final image
  7. symbol relocation, mapping a symbol reference to its defination
    1. done using a fix-up table or relocation table
    2. for fixing up references to addresses in other segments, as when multiple object files are linked together some addressed must be relocated
    3. because of the assumption of the assembler that each object file begins at address 0.
  8. for an executable image, all external symbols must be resolved such that each symbol has an absolute memory address (exception to this rule is DLL)
  9. a relocatable object file is concatenation of multiple object files and is partially resolved, so that it can be linked with other object files at run-time
References:
http://www.cs.princeton.edu/courses/archive/spr03/cs217/lectures/Linker.pdf



Tuesday, October 5, 2010

SIP Messages

  1. request from a client and response from a server are SIP messages
  2. SIP requests are distinguished by having a request line which contains a method name, a Request URI and protocol version
    1. RFC 3261 defines six methods (SIP extensions contains others)
      1. REGISTER for registering contact information
      2. INVITE, ACK and CANCEL for setting up session
      3. BYE for terminating sessions
      4. OPTIONS for querying server capabilities
    2. Request URI is a SIP or SIPS URI, it indicates the user or service to which this request is being addressed, SIP elements may support other URI types like tel URI
    3. SIP version is "SIP/2.0" 

  3. SIP Responses have a status line as their start line, which consist of protocol version, numeric status code and its associated text

    1. Status code is a three digit integer result code, indicating the outcome of an attempt to understand and satisfy a request.
    2. the first digit of the status code defines the class of the response, there can be six values for the first digit, ie six response categories
      1. 1XX: Provisional , the request is received and is in process
      2. 2XX: Success , the request was successfully received, understood, and accepted
      3. 3XX: Redirection , the request needs to be redirected, one reason for that is, the recipient has changed its location
      4. 4XX: Client Error , bad syntax in the request, thus cant be fulfilled at this server
      5. 5XX: Server Error , server failed to fulfill the request (a valid one)
      6. 6XX: Global failure , the request cant be fulfilled at any server
    3. reason phrase is to give a short textual description of the status code, for the human user


Structure of SIP Protocol Stack

  1. fairly independent processing stages
  2. element "containing" a layer means elements compliance with the rules defined by that layer
  3. lowest layer is "syntax and encoding" layer
    1. encoding is specified using BCNF (Backus-Naur form grammar)
  4. second layer is "transport layer"
    1. defines how a client sends requests and receives responses
    2. defines how a server receives requests and sends responses
    3. all SIP elements contain a transport layer

  5. third layer is "transaction layer"
    1. transaction is a 
      1. request send by client transaction (using transport layer) to a server transaction
      2. along with all the responses to that request send by the server transaction back to the client
    2. handles application layer retransmissions
    3. matching of responses to request
    4. handles application layer timeouts
    5. statefull proxies, and User Agents have a transaction layer
    6. stateless proxies don't have a transaction layer
    7. Transaction layer has two components, which are represented by a finite state machine constructed to process a particular requests
      1. Client Component (client transaction)
      2. Server Component (server transaction)
  6. the fourth layer is "transaction user"
    1. each of the SIP entities except a stateless proxy is a transaction user
      1. when a TU wishes to send a request it creates a client transaction instance and passes it the request, along with destination IP address, port, and transport to which to send the request
      2. a TU that creates a client transaction can also cancel it, using a CANCEL request, which constitute its own transaction, but references the transaction to be canceled
      3. on canceling the server stops further processing, revert to the state that existed before the transaction was initiated, and generate a specific error response to that transaction
  7. the SIP elements, UA clients and servers, stateless and stateful proxies, and registrar, contains a core that distinguish them from each other. Cores except for the state less proxies are TU.