Welcome to graduate2professional.blogspot.com

Sunday, April 22, 2012

Ad-Hoc Vs Infrastructure topology

Wireless networks typically work in one of two configurations: Ad-Hoc or Infrastructure.

Ad-Hoc are the networks which are basically created for the group of workstations which communicate directly witch each other to exchange information without the need for a wireless access point.
Connections using a peer-to-peer mode called ad hoc mode, also referred to as Independent Basic Service Set (IBSS) configuration.

Here are some benefits of an Ad-Hoc network are:-
a) The possibilities with Ad-Hoc network are quite endless.
b) Ad-Hoc networks are simple to set up.
c) Ad-Hoc networks are inexpensive.
d) Ad-Hoc networks are fast.

Disadvantages of an Ad-Hoc network are as follows:-
a) No central administration, and weak encryption.
b) It needs more technology to support their reliability.
c) As the network increases its speed slows down considerably.

In Infrastructure mode, network includes an Wireless access point(WAP) when the wireless clients connect to an access point, which in turn bridges to a network.
Infrastructure network can pass information through a central information hub which can be both, hardware or software device on a computer.

The WAP centrally controls access and authentication to the wireless network and provides access to rest of your network. More than one WAP can exist on a wireless network to service large numbers of wireless clients.


An infrastructure network enables you to:-
a)  Can connect to a wired network.
b) Extends your wireless network’s range.
c) Utilize roaming ability.

Disadvantages for Infrastructure network are:-
a). In this you do not have to control over the path your data takes.
b).Use of more wireless access points.
c). This increases the cost of implementing a wireless network solution.

Client–Server Vs Peer to Peer Net work architecture:


There are essentially two types of network architectures—
1.       Client-Server and
2.       Peer-to-peer.
In the client-server scheme, a central server handles all security and file transactions;
In peer-to-peer networks, each machine shares its own resources and handles its own security.
Client-server is the more expensive of the two to implement because such networks require a central file server. Although you can use many types of computers as your file server, you'll get the best results if you use a dedicated, high-end machine.
The other disadvantage to client-server networks is the cost of the server software. For example, you can expect to pay about $700 for a copy of NT Server. The core software package authorizes you to connect five PCs to your server, and then it requires you to pay a client license fee of around $70 for each additional PC that you connect to your network.
In fact, client-server networks are so expensive to set up that you may be wondering why anyone would ever choose this option. The answer is that this network structure offers a wide range of powerful administrative tools, which are particularly useful in an environment where security is an issue.
In a client-server environment, the dedicated file server controls the level of access that client PCs have to shared resources. This means that you can control network security from a central location through a utility such as Windows NT Server's User Manager or NetWare's NWADMIN.
Peer-to-peer networks aren't nearly as expensive to create, since you don't need a dedicated machine, server software, or special client licenses. In fact, all the software you need comes with Windows 95. This affordability often makes peer-to-peer networks ideal for small businesses or home users.
However, the main disadvantage of using this type of network is that you sacrifice security by placing network control in the hands of end users. Therefore, this network strategy is obviously inappropriate for high-security environments.

Sunday, April 8, 2012

Ethernet Basics


Ethernet :
In the OSI model, Ethernet technology operates at the physical and data link layers - Layers One and Two respectively. Ethernet supports all popular network and higher-level protocols, principally IP.
Traditional Ethernet supports data transfers at the rate of 10 Megabits per second (Mbps). Over time, as the performance needs of LANs have increased, the industry created additional Ethernet specifications for Fast Ethernet and Gigabit Ethernet.

Fast Ethernet extends traditional Ethernet performance up to 100 Mbps and Gigabit Ethernet up to 1000 Mbps speeds. Although products aren't yet abvailable to the average consumer, 10 Gigabit Ethernet (10000 Mbps) also remains an active area of research.

To connect Ethernet cables to a computer, a person normally uses a network adapter, also known as a network interface card (NIC). Ethernet adapters interfaces directly with a computer's system bus. The cables, in turn, utilize connectors that in many cases look like the RJ-45 connector used with modern telephones.

Ethernet Topologies and Protocols:
Traditional Ethernet employs a bus topology, meaning that all devices or hosts on the network use the same shared communication line. Each device possesses an Ethernet address, also known as MAC address. Sending devices use Ethernet addresses to specify the intended recipient of messages.

Data sent over the Ethernet exists in the forms of frames. An Ethernet frame contains a header, a data section, and a footer having a combined length of no more than 1518 bytes. The Ethernet header contains the addresses of both the intended recipient and the sender.

Data sent over the Ethernet is automatically broadcast to all devices on the network. By comparing their Ethernet address against the address in the frame header, each Ethernet device tests each frame to determine if it was intended for them and reads or discards the frame as appropriate. Network adapters incorporate this function into their hardware.

Devices wanting to transmit on the Ethernet first perform a preliminary check to determine whether the medium is available or whether a transmission is currently in progress. If the Ethernet is available, the sending device transmits onto the wire. It's possible, however, that two devices will perform this test at approximately the same time and both transmit simultaneously.
In traditional Ethernet, this protocol for broadcasting, listening, and detecting collisions is known as CSMA/CD (Carrier Sense Multiple Access / Collision Detection). Some newer forms of Ethernet do not use CSMA/CD. Instead, they use the so-called full duplex Ethernet protocol, which supports point-to-point simulatenous sends and receives with no listening required.

Ethernet Devices:
As mentioned earlier, Ethernet cables are limited in their reach, and these distances (as short as 100 meters) are insufficient to cover medium-sized and large network installations.
A repeater in Ethernet networking is a device that allows multiple cables to be joined and greater distances to be spanned.
A bridge device can join an Ethernet to another network of a different type, such as a wireless network.
One popular type of repeater device is an Ethernet hub. Other devices sometimes confused with hubs are switches and routers.

Sunday, April 1, 2012

What is MAC Address?

MAC, Media Access Control, address is a globally unique identifier assigned to network devices, and therefore it is often referred to as hardware or physical address. MAC addresses are 6-byte (48-bits) in length, and are written in MM:MM:MM:SS:SS:SS format. The first 3-bytes are ID number of the manufacturer, which is assigned by an Internet standards body. The second 3-bytes are serial number assigned by the manufacturer.

MAC layer represents layer 2 of the TCP/IP (adopted from OSI Reference Model), where IP represents layer 3. MAC address can be thought of as supporting hardware implementation whereas IP address supports software implementation. MAC addresses are permanently burned into hardware by hardware manufacturer, but IP addresses are assigned to the network devices by a network adminstrator. DHCP relies on MAC address to assign IP addresses to network devices.

What is DHCP?

Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway.
DHCP allows hosts to obtain necessary TCP/IP configuration information from a DHCP server.When a computer uses a static IP address, it means that the computer is manually configured to use a specific IP address. One problem with static assignment, which can result from user error or inattention to detail, occurs when two computers are configured with the same IP address. This creates a conflict that results in loss of service. Using DHCP to dynamically assign IP addresses minimizes these conflicts.

DHCP assigns an IP address when a system is started, for example:

   1. A user turns on a computer with a DHCP client.

   2. The client computer sends a broadcast request (called a DISCOVER or DHCPDISCOVER), looking for a DHCP server to answer.

   3. The router directs the DISCOVER packet to the correct DHCP server.

   4. The server receives the DISCOVER packet. Based on availability and usage policies set on the server, the server determines an appropriate address (if any) to give to the client. The server then temporarily reserves that address for the client and sends back to the client an OFFER (or DHCPOFFER) packet, with that address information. The server also configures the client's DNS servers, WINS servers, NTP servers, and sometimes other services as well.

   5. The client sends a REQUEST (or DHCPREQUEST) packet, letting the server know that it intends to use the address.

   6. The server sends an ACK (or DHCPACK) packet, confirming that the client has a been given a lease on the address for a server-specified period of time.

Why use DHCP?

Every device on a TCP/IP-based network must have a unique unicast IP address to access the network and its resources. Without DHCP, IP addresses must be configured manually for new computers or computers that are moved from one subnet to another, and manually reclaimed for computers that are removed from the network.

DHCP enables this entire process to be automated and managed centrally. The DHCP server maintains a pool of IP addresses and leases an address to any DHCP-enabled client when it starts up on the network. Because the IP addresses are dynamic (leased) rather than static (permanently assigned), addresses no longer in use are automatically returned to the pool for reallocation.

Benefits of DHCP:

DHCP Server service provides the following benefits:

    * Reliable IP address configuration. DHCP minimizes configuration errors caused by manual IP address configuration, such as typographical errors, or address conflicts caused by the assignment of an IP address to more than one computer at the same time.

    * Reduced network administration. DHCP includes the following features to reduce network administration:

          o Centralized and automated TCP/IP configuration.

          o The ability to define TCP/IP configurations from a central location.

          o The ability to assign a full range of additional TCP/IP configuration values by means of DHCP options.

          o The efficient handling of IP address changes for clients that must be updated frequently, such as those for portable computers that move to     different locations on a wireless network.

          o The forwarding of initial DHCP messages by using a DHCP relay agent, thus eliminating the need to have a DHCP server on every subnet.

What is RTTI in C++ ?

Runtime Type Information (RTTI) is the concept of determining the type of any variable during execution (runtime.) The RTTI mechanism contains:
  • The operator dynamic_cast
  • The operator typeid
  • The struct type_info
RTTI can only be used with polymorphic types. This means that with each class you make, you must have at least one virtual function
The dynamic_cast can only be used with pointers and references to objects. It makes sure that the result of the type conversion is valid and complete object of the requested class.
// dynamic_cast
#include 
#include 
using namespace std;
class Base_Class { virtual void dummy() {} };

class Derived_Class: public Base_Class { int a; };

int main () {
 try {
 Base_Class * ptr_a = new Derived_Class;
 Base_Class * ptr_b = new Base_Class;
 Derived_Class * ptr_c;
    ptr_c = dynamic_cast< Derived_Class* >(ptr_a);
    if (ptr_c ==0) cout << "Null pointer on first type-cast" << endl;

    ptr_c = dynamic_cast< Derived_Class* >(ptr_b);
    if (ptr_c ==0) cout << "Null pointer on second type-cast" << endl;

  } 
 catch (exception& my_ex) {cout << "Exception: " << my_ex.what();
}
 return 0;
}
There are two dynamic_casts from pointer objects of type Base_Class* (namely ptr_a and ptr_b) to a pointer object of type Derived_Class*.
If everything goes well then the first one should be successful and the second one will fail. The pointers ptr_a and ptr_b are both of the type Base_Class. The pointer ptr_a points to an object of the type Derived_Class. The pointer ptr_b points to an object of the type Base_Class. So when the dynamic type cast is performed then ptr_a is pointing to a full object of class Derived_Class, but the pointer ptr_b points to an object of class Base_Class. This object is an incomplete object of class Derived_Class; thus this cast will fail!
bad_cast exception is being thrown in case of conversion fail.
Typeid return an structure of type_info . You can get the detail and type of the object at run time.
int * a;
int b;
a=0; b=0;
if (typeid(a) != typeid(b))
  {
 cout << "a and b are of different types:\n";
 cout << "a is: " << typeid(a).name() << '\n';
 cout << "b is: " << typeid(b).name() << '\n';
  }