Saturday, 28 September 2013

Windows Boot process

Windows NT startup process starts when the computer finds a Windows boot loader, a portion of Windows operating system responsible for finding Microsoft Windows and starting it up. On IA-32 or x64 systems, the boot loader is called Windows Boot Manager (BOOTMGR).

 Prior to Windows Vista however, the boot loader was NTLDR. Microsoft has also released operating systems for Intel Itanium processors which use IA-64 architecture. The boot loader of these editions of Windows is IA64ldr.efi (later referred as simply IA64ldr). It is an Extensible Firmware Interface (EFI) program

 

 

 

  • BIOS: performs Power On Self Test (POST)
  • BIOS: BIOS Bootstrapping loads MBR from the boot device specified/selected by the BIOS

  • MBR: contains a small amount of code that reads the partition table, the first partition marked as active is determined to be the system volume
  • MBR: loads the boot sector from the system volume







  • BOOT SECTOR: reads the root directory of the system volume at loads NTLDR
  
 A boot sector or boot block is a region of a hard disk, floppy disk, optical disc, or other data storage device that contains machine code to be loaded into random-access memory (RAM) by a computer system's built-in firmware. The purpose of a boot sector is to allow the boot process of a computer to load a program (usually, but not necessarily, an operating system) stored on the same storage device.
 




  • NTLDR: reads BOOT.INI from the system volume to determine the boot drive (presenting a menu if more than 1 entry is defined)
  • NTLDR: loads and executes NTDETECT.COM from the system volume to perform BIOS hardware detection
  • NTLDR: loads NTOSKRNL.EXE, HAL.DLL, BOOTVID.DLL (and KDCOM.DLL for XP upwards) from the boot (Windows) volume
  • NTLDR: loads \WINDOWS\SYSTEM32\CONFIG\SYSTEM which becomes the system hive HKEY_LOCAL_MACHINE\System
  • NTLDR: loads drivers flagged as "boot" defined in the system hive, then passes control to NTOSKRNL.EXE
  • NTOSKRNL.EXE: brings up the loading splash screen and initializes the kernel subsystem
  • NTOSKRNL.EXE: starts the boot-start drivers and then loads & starts the system-start drivers
  • NTOSKRNL.EXE: creates the Session Manager process (SMSS.EXE)
  • SMSS.EXE: runs any programs specified in BootExecute (e.g. AUTOCHK, the native API version of CHKDSK)
  • SMSS.EXE: processes any delayed move/rename operations from hotfixes/service packs replacing in-use system files
  • SMSS.EXE: initializes the paging file(s) and the remaining registry hives

 

** before this step completes, bugchecks will not result in a memory dump as we need a working page file on the boot (Windows) volume **

  • SMSS.EXE: starts the kernel-mode portion of the Win32 subsystem (WIN32K.SYS)
  • SMSS.EXE: starts the user-mode portion of the Win32 subsystem (CSRSS.EXE)
  • SMSS.EXE: starts WINLOGON.EXE
  • WINLOGON.EXE: starts the Local Security Authority (LSASS.EXE)
  • WINLOGON.EXE: loads the Graphical User Identification and Authentication DLL (MSGINA.DLL by default)
  • WINLOGON.EXE: displays the logon window
  • WINLOGON.EXE: starts the services controller (SERVICES.EXE)

** at this point users can logon **

 

  • SERVICES.EXE: starts all services markes as automatic

 

NOTES:

 
The SYSTEM volume is the partition from which the boot process starts, containing the MBR, boot sector, NTLDR, NTDETECT.COM & BOOT.INI

The BOOT volume is the partition which contains the Windows folder - this can be a logical partition

 

Example 1:
2 hard disks, 0 and 1
Disk 0, partition 0 is the SYSTEM volume
Windows is installed to "D:" which is disk 1, partition 0 [even if disk 0 has an extended & logical partitions] - this is the BOOT volume
- if either disk fails or is removed, Windows cannot boot


Example 2:
1 hard disk, 2 partitions
Disk 0, partition 0 is the SYSTEM volume
Disk 0, partition 1 is the BOOT volume [D:]
- add another disk to the system and create a partition on it, this becomes D: and Windows will not boot [disk 0, partition 1 now becomes E:]

 

Disk partitioning

Disk partitioning is the act of dividing a hard disk drive (HDD) into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks, so that different filesystems can be used on each partition.

 

 

 

 

Primary partition

 A primary partition contains one file system. In DOS and all versions of Microsoft Windows systems, what Microsoft calls the system partition was required to be the first partition. All Windows operating systems from Windows 95 onwards can be located on ( almost ) any partition, but the boot files (io.sys, bootmgr, ntldr, etc.) must be on a primary partition.

 

Extended partition

An HDD may contain only one extended partition; the extended partition can be subdivided into multiple logical partitions. In DOS/Windows systems, each logical partition may then be assigned an additional drive letter.

 

Benefits of multiple partitions

Creating more than one partition has the following advantages:

  • Separation of the operating system (OS) and program files from user files. This allows image backups (or clones) to be made of only the operating system and installed software.
  • Having a separate area for operating system virtual memory swapping/paging.
  • Keeping frequently used programs and data near each other.
  • Having cache and log files separate from other files. These can change size dynamically and rapidly, potentially making a file system full.
  • Use of multi-boot setups, which allow users to have more than one operating system on a single computer. For example, one could install Linux, BSD, Mac OS X, Microsoft Windows or other operating systems on different partitions of the same HDD and have a choice of booting into any compatible operating system at power-up.
  • Protecting or isolating files, to make it easier to recover a corrupted file system or operating system installation. If one partition is corrupted, other file systems may not be affected.

 

 

 

 

Windows 7

 

 

Sunday, 22 September 2013

Networking And Communications - Network Data Exchange Methods

Kind of Computer Networks Groups

A workgroup is a type of peer-to-peer network. It is essentially the name for a Windows based peer-to-peer computer network. Computers in this kind of network can allow each other access to their files, printers, or Internet connection.  A peer-to-peer network can’t have a domain because it doesn’t have a dedicated server computer to act as a domain controller. Instead, computers in a peer-to-peer network are grouped in workgroups, which are simply groups of computers that can share resources with each other. Each computer in a workgroup keeps track of its own user accounts and security settings, so no single computer is in charge of the workgroup.
 
 
 
 
A domain, on the other hand, is a client/server network in which the security and resource management is centralized. This means that a singular administration has control over the domain and allows which users have access to which files. In a Windows network, a domain is a group of server computers that share a common user account database. A user at a client computer can log in to a domain to access shared resources for any server in the domain. Each domain must have at least one server computer designated as the domain controller, which is ultimately in charge of the domain.  Most domain networks share this work among at least two domain controllers, so that if one of the controllers stops working, the network can still function.

 

Active Directory

Active Directory (AD) is a directory service implemented by Microsoft for Windows domain networks. It is included in most Windows Server operating systems.

An AD domain controller authenticates and authorizes all users and computers in a Windows domain type network—assigning and enforcing security policies for all computers and installing or updating software. For example, when a user logs into a computer that is part of a Windows domain, Active Directory checks the submitted password and determines whether the user is a system administrator or normal user.[1]

Active Directory makes use of Lightweight Directory Access Protocol (LDAP) versions 2 and 3, Microsoft's version of Kerberos, and DNS









Client Server Communication












Inter-process communication



In computing, inter-process communication (IPC) is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared memory, and remote procedure calls (RPC). The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated.



There are several reasons for providing an environment that allows process cooperation:

IPC may also be referred to as inter-thread communication and inter-application communication.







Implementations



There are several APIs which may be used for IPC. A number of platform independent APIs include the following:

The following are platform or programming language specific APIs:




Examples of IPC Implementation

Remote procedure call


In computer science, a remote procedure call (RPC) is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on a shared network) without the programmer explicitly coding the details for this remote interaction. That is, the programmer writes essentially the same code whether the subroutine is local to the executing program, or remote. When the software in question uses object-oriented principles, RPC is called remote invocation or remote method invocation.

An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. While the server is processing the call, the client is blocked (it waits until the server has finished processing before resuming execution), unless the client sends an asynchronous request to the server, such as an XHTTP call. There are many variations and subtleties in various implementations, resulting in a variety of different (incompatible) RPC protocols.
An important difference between remote procedure calls and local calls is that remote calls can fail because of unpredictable network problems.


Sequence of events during a RPC


  1. The client calls the client stub. The call is a local procedure call, with parameters pushed on to the stack in the normal way.
  2. The client stub packs the parameters into a message and makes a system call to send the message. Packing the parameters is called marshalling.
  3. The client's local operating system sends the message from the client machine to the server machine.
  4. The local operating system on the server machine passes the incoming packets to the server stub.
  5. The server stub unpacks the parameters from the message . Unpacking the parameters is called unmarshalling.
  6. Finally, the server stub calls the server procedure. The reply traces the same steps in the reverse direction.


Other RPC analogues

RPC analogues found elsewhere:

  • Java's Java Remote Method Invocation (Java RMI) API provides similar functionality to standard Unix RPC methods.
  • Modula-3's network objects, which were the basis for Java's RMI[5]
  • XML-RPC is an RPC protocol that uses XML to encode its calls and HTTP as a transport mechanism.
  • JSON-RPC is an RPC protocol that uses JSON-encoded messages
  • JSON-WSP is an RPC protocol that uses JSON-encoded messages
  • SOAP is a successor of XML-RPC and also uses XML to encode its HTTP-based calls.
  • RPyC implements RPC mechanisms in Python, with support for asynchronous calls.
  • Spyne defines primitives for doing RPC in Python. It also contains implementations of some of the most popular protocols and transports.[6]
  • Pyro object-oriented form of RPC for Python.
  • ZeroC's Internet Communications Engine (Ice) distributed computing platform.
  • Etch framework for building network services.
  • Facebook's Thrift protocol and framework.
  • BERT-RPC is an RPC protocol in use by Github [7][8]
  • CORBA provides remote procedure invocation through an intermediate layer called the object request broker.
  • Distributed Ruby (DRb) allows Ruby programs to communicate with each other on the same machine or over a network. DRb uses remote method invocation (RMI) to pass commands and data between processes.
  • Action Message Format (AMF) allows Adobe Flex applications to communicate with back-ends or other applications that support AMF.
  • Libevent provides a framework for creating RPC servers and clients.[9]
  • Windows Communication Foundation is an application programming interface in the .NET framework for building connected, service-oriented applications.
  • Microsoft .NET Remoting offers RPC facilities for distributed systems implemented on the Windows platform. It has been superseded by WCF.
  • The deprecated Microsoft DCOM uses MSRPC which is based on DCE/RPC
  • The Open Software Foundation DCE/RPC Distributed Computing Environment (also implemented by Microsoft).
  • Google Protocol Buffers (protobufs) package includes an interface definition language used for its RPC protocols.[10]
  • Google Web Toolkit uses an asynchronous RPC to communicate the server service.[11]
  • Apache Avro provides RPC where client and server exchange schemas in the connection handshake and code generation is not required.
  • Spike-Engine provides cross platform RPC facilities for .NET framework, web and mobile architectures with auto-generated stubs.
  • Twitter Finagle is a network stack for the JVM that you can use to build asynchronous Remote Procedure Call (RPC) clients and servers in Java, Scala, or any JVM-hosted language.




Sockets and Socket-based Communication











.NET Remoting


NET Remoting is a Microsoft application programming interface (API) for interprocess communication released in 2002 with the 1.0 version of .NET Framework. It is one in a series of Microsoft technologies that began in 1990 with the first version of Object Linking and Embedding (OLE) for 16-bit Windows. Intermediate steps in the development of these technologies were Component Object Model (COM) released in 1993 and updated in 1995 as COM-95, Distributed Component Object Model (DCOM), released in 1997 (and renamed Active X), and COM+ with its Microsoft Transaction Server (MTS), released in 2000.[1] It is now superseded by Windows Communication Foundation (WCF), which is part of the .NET Framework 3.0.
 
Like its family members and similar technologies such as Common Object Request Broker Architecture (CORBA) and Java's remote method invocation (RMI), .NET Remoting is complex, yet its essence is straightforward. With the assistance of operating system and network agents, a client process sends a message to a server process and receives a reply.[2][3]

.NET Remoting allows an application to make an object (termed remotable object) available across remoting boundaries, which includes different appdomains, processes or even different computers connected by a network.[4] The .NET Remoting runtime hosts the listener for requests to the object in the appdomain of the server application. At the client end, any requests to the remotable object are proxied by the .NET Remoting runtime over Channel objects, that encapsulate the actual transport mode, including TCP streams, HTTP streams and named pipes. As a result, by instantiating proper Channel objects, a .NET Remoting application can be made to support different communication protocols without recompiling the application. The runtime itself manages the act of serialization and marshalling of objects across the client and server appdomains.[4]








Web service


A web service is a method of communication between two electronic devices over the World Wide Web. A web service is a software function provided at a network address over the web or the cloud; it is a service that is "always on" as in the concept of utility computing.



The W3C defines a "Web service" as:

[...] a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.[1]
The W3C also states:
We can identify two major classes of Web services:
  • REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of "stateless" operations; and
  • arbitrary Web services, in which the service may expose an arbitrary set of operations.[2]







A web API is a development in web services where emphasis has been moving to simpler representational state transfer (REST) based communications.[3] RESTful APIs do not require XML-based web service protocols (SOAP and WSDL) to support their light-weight interfaces.





Software Design And Architecture - Introduction to UML - Unified Modeling Language

Introduction to UML - Unified Modeling Language


The Unified Modeling Language (UML) is a visual language for capturing software designs and patterns. Dig a little deeper, though, and you’ll find that UML can be applied to quite a few different areas and can capture and communicate everything from company organization to business processes to distributed enterprise software. It is intended to be a common way of capturing and expressing relationships, behaviors, and high-level ideas in a notation that’s easy to learn and efficient to write. UML is visual; just about everything in it has a graphical representation.

History, Need and Tools
























































































































You can apply UML in any number of ways, but common uses include:

• Designing software
• Communicating software or business processes
• Capturing details about a system for requirements or analysis
• Documenting an existing system, process, or organization


 

UML has been applied to countless domains, including:

• Banking and investment sectors
• Health care
• Defense
• Distributed computing
• Embedded systems
• Retail sales and supply






UML Basics





















































Note:  Sometimes Implementation is called as "Realization"



Association

Associations are stronger than dependencies and typically indicate that one class retains a relationship to another class over an extended period of time. The lifelines of two objects linked by associations are probably not tied together (meaning one can be destroyed without necessarily destroying the other). Associations are typically read as “…has a…”. For example, if you have a class named Window that has a reference to the current mouse cursor, you would say “Window has a Cursor”. Note that there is a fine line between “…has a…” and “…owns a…” (see “Aggregation” later in this section). In this case, Window doesn’t own the Cursor; Cursor is shared between all applications in the system. However, Window has a reference to it so that the Window can hide it, change its shape, etc.  You show an association using a solid line between the classes participating in the relationship.




Navigability


Associations have explicit notation to express navigability. If you can navigate from one class to another, you show an arrow in the direction of the class you can navigate to. If you can navigate in both directions, it is common practice to not show any arrows at all, but as the UML specification points out, if you suppress all arrows you can’t distinguish nonnavigable associations from two-way associations. However, it is extremely rare to use a nonnavigable association in the real world, so this is unlikely to be a problem.






Multiplicity


Because associations typically represent lasting relationships, they are often used to indicate attributes of a class. As mentioned in the “Attributes by Relationship” section, you can express how many instances of a particular class are involved in a relationship. If you don’t specify a value, a multiplicity of 1 is assumed. To show a different value, simply place the multiplicity specification near the owned class.





Aggregation



Aggregation is a stronger version of association. Unlike association, aggregation typically implies ownership and may imply a relationship between lifelines. Aggregations are usually read as “…owns a…”. For example, if you had a classed named Window that stored its position and size in a Rectangle class, you would say the “Window owns a Rectangle.” The rectangle may be shared with other classes, but the Window has an intimate relationship with the Rectangle.







Composition


Composition represents a very strong relationship between classes, to the point of containment. Composition is used to capture a whole-part relationship. The “part” piece of the relationship can be involved in only one composition relationship at any given time. The lifetime of instances involved in composition relationships is almost always linked; if the larger, owning instance is destroyed, it almost always destroys the part piece. UML does allow the part to be associated with a different owner before destruction, thus preserving its existence, but this is typically an exception rather than the rule. A composition relationship is usually read as “…is part of…”, which means you need to read the composition from the part to the whole. For example, if you say that a window in your system must have a titlebar, you can represent this with a class named Titlebar that “…is part of…” a class named Window.











Generalization


A generalization relationship conveys that the target of the relationship is a general, or less specific, version of the source class or interface. Generalization relationships are often used to pull out commonality between difference classifiers. For example, if you had a class named Cat and a class named Dog, you can create a generalization of both of those classes called Animal. A full discussion of how and when to use generalization (especially versus interface realization) is the subject for an object-oriented analysis and design book and isn’t covered here. Generalizations are usually read as “…is a…”, starting from the more specific class and reading toward the general class. Going back to the Cat and Dog example, you would say “a Cat…is a…Animal” (grammar aside).








Realization or Implementation


An interface is a classifier that has declarations of properties and methods but no implementations. You can use interfaces to group common elements between classifiers and provide a contract a classifier that provides an implementation of an interface must obey. For example, you can create an interface named Sortable that has one operation named comesBefore(...). Any class that realizes the Sortable interface must provide an implementation of comesBefore(...).

















Dependency


The weakest relationship between classes is a dependency relationship. Dependency between classes means that one class uses, or has knowledge of, another class. It is typically a transient relationship, meaning a dependent class briefly interacts with the target class but typically doesn’t retain a relationship with it for any real length of time. Dependencies are typically read as “…uses a…”. For example, if you have a class named Window that sends out a class named WindowClosingEvent when it is about to be closed, you would say “Window uses a WindowClosingEvent.”




























Modeling

It should go without saying that the focus of UML is modeling. However, what that means, exactly, can be an open-ended question. Modeling is a means to capture ideas, relationships, decisions, and requirements in a well-defined notation that can be applied to many different domains. Modeling not only means different things to different people, but also it can use different pieces of UML depending on what you are trying to convey.
 
In general a UML model is made up of one or more diagrams. A diagram graphically represents things, and the relationships between these things. These things can be representations of real-world objects, pure software constructs, or a description of the behavior of some other object. It is common for an individual thing to show up on multiple diagrams; each diagram represents a particular interest, or view, of the thing being modeled.




Diagrams

UML 2.0 divides diagrams into two categories: structural diagrams and behavioral diagrams. Structural diagrams are used to capture the physical organization of the things in your system—i.e., how one object relates to another. 























There are several structural diagrams in UML 2.0:


Class diagrams


Class diagrams use classes and interfaces to capture details about the entities that make up your system and the static relationships between them. Class diagrams are one of the most commonly used UML diagrams, and they vary in detail from fully fleshed-out and able to generate source code to quick sketches on whiteboards and napkins. 































































































Component diagrams


Component diagrams show the organization and dependencies involved in the implementation of a system. They can group smaller elements, such as classes, into larger, deployable pieces. How much detail you use in component diagrams varies depending on what you are trying to show. Some people simply show the final, deployable version of a system, and others show what functionality is provided by a particular component and how it realizes its functionality internally.




































Composite structure diagrams

Composite structure diagrams are new to UML 2.0. As systems become more complex, the relationships between elements grow in complexity as well. Conceptually, composite structure diagrams link class diagrams and component diagrams; they don’t emphasize the design detail that class diagrams do or the implementation detail that composite structures do. Instead, composite structures show how elements in the system combine to realize complex patterns.


 

Deployment diagrams

Deployment diagrams show how your system is actually executed and assigned to various pieces of hardware. You typically use deployment diagrams to show how components are configured at runtime. 





























 

Package diagrams

Package diagrams are really special types of class diagrams. They use the same notation but their focus is on how classes and interfaces are grouped together. 





























 

Object diagrams

Object diagrams use the same syntax as class diagrams and show how actual instances of classes are related at a specific instance of time. You use object diagrams to show snapshots of the relationships in your system at runtime.



















Behavioral diagrams focus on the behavior of elements in a system. For example, you can use behavioral diagrams to capture requirements, operations, and internal state changes for elements. The behavioral diagrams are:



















Use case diagrams
 

Use case diagrams capture functional requirements for a system. They provide an implementation-independent view of what a system is supposed to do and allow the modeler to focus on user needs rather than realization details.



















































Activity diagrams

Activity diagrams capture the flow from one behavior or activity, to the next. They are similar in concept to a classic flowchart, but are much more expressive. 








































 
Communication diagrams
 
Communication diagrams are a type of interaction diagram that focuses on the elements involved in a particular behavior and what messages they pass back and forth. Communication diagrams emphasize the objects involved more than the order and nature of the messages exchanged. 

 
Interaction overview diagrams

Interaction overview diagrams are simplified versions of activity diagrams.  Instead of emphasizing the activity at each step, interaction overview diagrams emphasize which element or elements are involved in performing that activity. The UML specification describes interaction diagrams as
emphasizing who has the focus of control throughout the execution of a system.


Sequence diagrams

Sequence diagrams are a type of interaction diagram that emphasize the type and order of messages passed between elements during execution. Sequence diagrams are the most common type of interaction diagram and are very intuitive to new users of UML. 


































 















































State machine diagrams

State machine diagrams capture the internal state transitions of an element.  The element could be as small as a single class or as large as the entire system. State machine diagrams are commonly used to model embedded systems and protocol specifications or implementations. 





































Timing diagrams
 

Timing diagrams are a type of interaction diagram that emphasize detailed timing specifications for messages. They are often used to model real-time systems such as satellite communication or hardware handshaking. They have specific notation to indicate how long a system has to process or respond to messages, and how external interruptions are factored into execution.

 

























Views

While not strictly part of UML itself, the concept of views of a system helps the modeler choose diagrams that help convey the correct information depending on his goals. Specifically, models are often divided into what is called the 4+1 views of a system. The 4+1 notation represents four distinct views of a system and one overview of how everything fits together. 

The four views are:

Design view

The design view captures the classes, interfaces, and patterns that describe the representation of the problem domain and how the software will be built to address it. The design view almost always uses class diagrams, object diagrams, activity diagrams, composite structure diagrams, and sequence
diagrams to convey the design of a system. The design view typically doesn’t address how the system will be implemented or executed.

 
Deployment view

The deployment view captures how a system is configured, installed, and executed. It often consists of component diagrams, deployment diagrams, and interaction diagrams. The deployment view captures how the physical layout of the hardware communicates to execute the system, and can be used to show failover, redundancy, and network topology.


Implementation view

The implementation view emphasizes the components, files, and resources used by a system. Typically the implementation view focuses on the configuration management of a system; what components depend on what, what source files implement what classes, etc. Implementation views almost always use one or more component diagrams and may include interaction diagrams,
statechart diagrams, and composite structure diagrams.

 
Process view

The process view of a system is intended to capture concurrency, performance, and scalability information. Process views often use some form of interaction diagrams and activity diagrams to show how a system actually behaves at runtime.

 
The four distinct views of a system are brought together with the final view:

Use case view
 
The use case view captures the functionality required by the end users. The concept of end users is deliberately broad in the use case view; they include the primary stakeholders, the system administrator, the testers, and potentially the developers themselves. The use case view is often broken down into collaborations that link a use case with one or more of the four basic views.
The use case view includes use case diagrams and typically uses several interaction diagrams to show use case details.