Saturday, December 31, 2011

How To Make Comment in SQL

In SQL (Structured Query Language) we can write comment by using double dash (--) before the text

--this is the comment


Sunday, December 25, 2011

ADSL EQUIPMENT AND THEIR DETAILS

ADSL Equipment




Two groups of equipment
  •  Central Office - DSL Access Multiplexer (DSLAM), Repeaters
  • Customer Premise - DSL Modems, Gateways, Network Interface Card (NIC), splitters and filter

DSLAM

  • DSLAM is usually found in a Central Office
  • xDSL line cards are installed in a DSLAM to terminate incoming xDSL signals
  • The DSLAM then combines multiple xDSL access lines into one high speed line
  • The muxed traffic is converted into ATM cells which gets sent over an ATM backbone


 Generic DSL Line Card for DSLAM Applications


 DSL Modem/Gateway

  • A xDSL modem is the device found at the customer’s premise which is used to transmit & receive xDSL signals
  •  Could be an external “box” or a network interface card placed inside a computer
  •  An xDSL Gateway combines the functionality of a modem and router 

 DSL Modem Residential Gateway

Friday, December 9, 2011

WHAT IS CSMA/CD & TOKEN PASSING


CSMA/CD

CSMA /CD Carrier sense multiple access/collision detection (CSMA /CD) is one of the most popular access methods in use today. With CSMA /CD, every host has equal access to the wire and can place data on the wire when the wire is free from traffic. If a host wishes to place data on the wire, it will “sense” the wire and determine whether there is a signal already on the wire. If there is, the host will wait to transmit the data; if the wire is free, the host will send the data, as shown in Figure .

The problem with the process just described is that, if there are two systems on the wire that “sense” the wire at the same time to see if the wire is free, they will both send data out at the same time if the wire is free. When the two pieces of data are sent out on the wire at the same time, they will collide with one another, and the data will be destroyed. If the data is destroyed in transit, the data will need to be retransmitted. Consequently, after a collision, each host will wait a variable length of time before retransmitting the data (they don’t want the data to collide again) thereby preventing a collision the second time. When a system determines that the data has collided and then retransmits the data, it is known as collision detection. 

To summarize, CSMA /CD provides that before a host sends data on the network it will “sense” (CS) the wire to ensure that the wire is free of traffic. Multiple systems have equal access to the wire (MA), and if there is a collision, a host will detect that collision (CD) and retransmit the data


CSMA/CA



Carrier sense multiple access/collision avoidance (CSMA /CA) is not as popular as CSMA /CD and for good reason. With CSMA /CA, before a host sends data on the wire it will “sense” the wire as well to see if the wire is free of signals. If the wire is free, it will try to “avoid” a collision by sending a piece of “dummy” data on the wire first to see whether it collides with any other data. If it does not collide, the host in effect assumes “If my dummy data did not collide, then the real data will not collide,” and it submits the real data on the wire. 

Token Passing



With both CSMA /CD and CSMA /CA, the possibility of collisions is always there, and the more hosts that are placed on the wire, the greater the chances of collisions, because you have more systems “waiting”’ for the wire to become free so that they can send their data.
Token passing takes a totally different approach to deciding on how a system can place data on the wire. With token passing, there is an empty packet running around on the wire — the “token.” In order to place data on the wire, you need to wait for the token; once you have the token and it is free of data, you can place your data on the wire. Since there is only one token and a host needs to have the token to “talk,” it is impossible to have collisions in a token-passing environment. 

For example, if Workstation 1 wants to send data on the wire, the workstation would wait for the token, which is circling the network millions of times per second. Once the token has reached Workstation 1, the workstation would take the token off the network, fill it with data, mark the token as being used so that no other systems try to fill the token with data, and then place the token back on the wire heading for the destination host.
.

Saturday, December 3, 2011

NETWORK ARCHITECTURE xBASEx EXAMPLES


Network architecture is something that came about one day when someone sat down and said “We are going to design a network architecture; let’s use CAT 3 cabling, a star topology, and CSMA /CD as an access method. Let’s call this architecture 10BaseT” In this example, 10BaseT was the name assigned to the architecture because 10 Mbps is the transfer rate of the network, Baseband communication is the technique used to transmit the signal, and the T means our cable type —in this case twisted pair. We know different types of twisted-pair cabling, but CAT 3 is the one that runs at 10 Mbps, so it is the cable used in 10BaseT.
The first types of network architecture to look at are the different Ethernet architectures. When designing networks, one of the first decisions we usually make is “Do we want to use Ethernet or the competing network architecture called Token Ring? we want to use Ethernet. What flavor of Ethernet?” In this discussion you will understand what the different flavors of Ethernet are. Ethernet is defined as the IEEE 802.3 standard.

10Base2
The 10Base2 Ethernet architecture is a network that runs at 10 Mbps and uses baseband transmissions. 10Base2 typically is implemented as a bus topology, but it could be a mix of a bus and a star topology. The cable type that we use is determined by the character at the end of the name of the architecture —in this case a 2. The 2 implies 200 meters. Now, what type of cable is limited to approximately 200m?  Thinnet is limited to approximately 200m (185m to be exact). The only characteristic we have not mentioned is the access method that is used.
All Ethernet environments use CSMA /CD as a way to put data on the wire.
The following list summarizes features of 10Base2:
Ø Baseband communication
Ø 10 Mbps transfer rate
Ø Maximum distance of 185 meters per network segment
Ø 30 hosts per segment
Ø 0.5 meters minimum distance between hosts

10Base5
The 10Base5 Ethernet architecture runs at 10 Mbps and uses baseband transmission as well. It was also implemented as a bus topology. The cable it uses is limited to approximately 500 meters, which is thicknet, and it uses CSMA /CD as the access method. The thicker copper core in the wire allows the signal to travel further than is possible with thinnet.
The following list summarizes features of 10Base5:
Ø Baseband communication
Ø 10 Mbps transfer rate
Ø Maximum distance of 500 meters per network segment
Ø 100 hosts per segment
Ø 2.5 meter minimum distance between hosts

10BaseT
The 10BaseT Ethernet architecture runs at 10 Mbps and uses baseband transmission. It uses a star topology with a hub or switch at the center, allowing all systems to connect to one another. The cable it uses is CAT 3 UTP, which is the UTP cable type that runs at 10 Mbps. Keep in mind that most cable types are backward compatible, so you could have CAT 5 UTP cabling in a 10BaseT environment. But because the network cards and hubs are running at 10 Mbps, that is the maximum transfer speed you will get, even though the cable supports more.
Like all Ethernet environments, 10BaseT uses CSMA /CD as the access method.
10BaseFL
The 10BaseFL Ethernet architecture allows for a 10-Mbps Ethernet environment that runs on fiber-optic cabling. The purpose of the fiber-optic cabling is to use it as a backbone to allow the network to reach greater distances.

 
Fast Ethernet (100BaseTX and 100BaseFX)


These two standards are part of the 100BaseX family, which is known as fast Ethernet. The different fast Ethernet flavors run at 100 Mbps, use a star topology, use CSMA / CD as an access method, and differ in the type of cabling used. 100BaseTX uses two pairs (four wires) in the CAT 5 cabling, whereas 100BaseFX uses two strands of fiber instead of twisted-pair cabling.


Gigabit Ethernet

Gigabit Ethernet is becoming the de facto of network architectures today. With Gigabit Ethernet we can reach transfer rates of 1000 Mbps (1 Gbps), using traditional media such as coaxial, twisted-pair, and fiber-optic cabling. There are two standards for Gigabit: IEEE 802.3z and IEEE 802.3ab.


IEEE 802.3z


The IEEE 802.3z standard defines Gigabit Ethernet that runs over fiber-optic cabling or coaxial cabling. There are three types of Gigabit Ethernet that fall under this standard:


  1000Base-SX is the Gigabit Ethernet architecture that runs at 1000 Mbps   over multimode fiber (MMF) optic cabling. This architecture is designed for   short distances of up to 550 meters.


  1000Base-LX is the Gigabit Ethernet architecture that runs at 1000 Mbps   over single-mode fiber (SMF) optic cabling. This architecture supports   distances   up to 3 kilometers. 
  
  1000Base-CX is the Gigabit Ethernet architecture that runs at 1000   Mbps over coaxial cable and supports distances of up to 25 meters.


IEEE 802.3ab


The IEEE 802.3ab standard, known as 1000BaseTX, defines Gigabit Ethernet that runs over twisted-pair cabling and uses characteristics of 100BaseTX networking, including the use of RJ-45 connectors and the access method of CSMA /CD. Like 100BaseTX, 1000BaseTX uses CAT 5, CAT 5e, and even CAT 6 unshielded twisted-pair, the difference being that 100BaseTX runs over two pairs (four wires) while 1000BaseTX runs over four pairs (all eight wires).


10-Gigabit Ethernet:


There are standards for 10-Gigabit Ethernet (10,000 Mbps) that have been developed that use fiber-optic cabling:


  10GbaseSR runs at 10 Gbps and uses “short-range” multimode fiber-optic   cable, which has a maximum distance of 100 meters.


  10GBaseLR runs at 10 Gbps and uses “long-range” single-mode ?ber-optic   cable, which has a maximum distance of 10 kilometers.


  10GbaseER runs at 10 Gbps and uses “extra-long-range” single-mode ?ber-  optic cable which has a maximum distance of 40 kilometers.



Wednesday, November 30, 2011

BINARY SEARCH CODING IN C,C++

#include<iostream>
using namespace std;
main()
{
int Arr[10]={1,2,3,4,5,6,7,8,9,10};
int i=0,j=9,mod,input;
cout<<"Type number to search ";
cin>>input;
while(i<j)
    {
       mod=(i+j)/2;
       if(input>Arr[mod])
       i=mod+1;
else
       j=mod;
    }
if(input==Arr[i])
     cout<<"\nNumber "<<input<<" is located at index "<<i<<"\n";
else
     cout<<"\nNumber "<<input<<" is not present in the list\n\n";
system("\npause");
}

Saturday, November 26, 2011

WHAT IS A TOKEN RING NETWORK


Token Ring:

A big competitor to Ethernet in the past was Token Ring, which runs at 4 Mbps or 16 Mbps. Token Ring is a network architecture that uses a star ring topology (a hybrid, looking physically like a star but logically wired as a ring) and can use many forms of cables. 

IBM Token Ring has its own proprietary cable types, while more modern implementations of Token Ring can use CAT 3 or CAT 5 UTP cabling. Token Ring uses the token-passing access method. 

Looking at Token Ring networks today, you may wonder where the “ring” topology is, because the network appears to have a star topology. The reason why it appears that this network architecture is using a star topology is that all hosts are connected to a central device that looks similar to a hub, but with Token Ring, this device is called a multistation access unit (MAU or MSAU). . The ring is the internal communication path within the wiring. 

Token Ring uses token passing; it is impossible to have collisions in a token-passing environment, because the MAUs do not have collisions lights like an Ethernet hub does (remember that Ethernet uses CSMA /CD and there is potential for collisions).

Monday, November 21, 2011

WHAT IS CIRCUIT AND PACKET SWITCHING NETWORKS


Circuit and Packet Switching:

We can divide data connections through a telecommunications network into different categories based on the principle of how the communications circuit is built between the communicating devices. Data communications through the telecommunications network may use three basic different types of circuits:
Leased or dedicated: The cost of a leased line is fixed per month and depends on the capacity and length of the connection.
Circuit switched or dial-up: The cost of switched service depends on the time the service is used, the data rate, and the distance.

Packet switched: The cost is often fixed and depends on the interface data rate. In some packet-switched networks cost may depend on the amount of transferred data. Agreements with the service provider may specify other parameters that influence the cost, such as the maximum data rate or average data rate.

For corporate data networks, the leased-line solution is often attractive when the LANs of offices in a region need to be interconnected. The network operator provides a permanent circuit and the monthly cost is fixed and depends only on the agreed-on data rate. Over long distances, however, leased lines become expensive and switched service is often preferred. In such a service, several corporate networks share transmission capacity and the cost of the backbone of the telecommunications network operator. Within the switched category there are two subcategories, circuit and packet-switched networks as shown in Figure  both of which are used for data transmission.

Circuit Switching 

Circuit-switched networks provide fixed bandwidth and very short and fixed delay. It is the primary technology for voice telephone, video telephone and video conferencing. The disadvantage is that it is inflexible for data communications where the demand for transmission data rate is far from constant but varies extensively over short time scales. Some older generation data networks used the circuit switching principle. In the beginning a circuit-switched connection is dialed up by the data source. The routing is based on the destination subscriber number given when the circuit is established. The connection is released after the communication is over. During a conversation, the data capacity of the connection is fixed and it is reserved only for this conversation regardless of whether the data capacity is used or not. At the end of the call, the circuit is released. ISDN as well as the telephone network use the circuit-switching principle.

Packet Switching:

Packet-switched networks are specially designed for data communication. The source data are split into packets containing route or destination identifications. The packets are routed toward the destination by packet-switching nodes on the path through the network. The major drawback of the packet-switched technology is that it usually cannot provide a service for applications that require constant and low delay. There are two basic types of packet-switched networks.
virtual circuits and datagram transmission. In the case of virtual circuits, the virtual connection is established at the beginning of each conversation or it is permanently set up and every packet belonging to a certain connection is transmitted via the same established route. The main difference between circuit-switched physical circuits and virtual circuits is that many users share the capacity of the transmission lines and channels between network nodes if virtual instead of physical circuits are used. At a certain moment active users may use all the available capacity if other users are not transmitting anything. The complete address information is not needed in the packets when the connection is established. Only a short connection identifier is included in each packet to define the virtual circuit to which the packet belongs.

Another method for packet-switched data communications is connectionless datagram transmission in which routing devices perform routing procedures, and each packet contains a full destination address. We discuss this layer 3 (network layer) routing principle next. 



Wednesday, November 16, 2011

IP ADDRESS DEFINED IN DETAIL COMPLETE TUTORIAL


IP address defined
Every device connected to a TCP/IP network requires at least one IP address and must be unique within that network. An IP address is commonly represented in dotted decimal notation. Here are some examples of IP addresses shown in dotted decimal form.
207.21.32.12
10.1.2.34
120.224.21.253
As in these examples, all IP addresses are 32 bits long and are comprised of four 8-bit segments known as octets. Representing IP addresses in dotted decimal notation makes them a lot easier to read than in the machine friendly binary format. As you will see in the next section, however, the capability to convert IP addresses to-and-from binary format is required for configuring your TCP/IP network and for the exam. The following is an example of an IP address shown in dotted decimal and its equivalent binary notation.
Dotted Decimal Binary
207.21.32.12   11001111 00010101 00100000 00001100

Network ID and Host ID

Although an IP address is a single value, it is divided into two pieces of information: the network ID and the host ID of the networked device.
The network ID identifies the systems that are located on the same physical network. All systems on the same physical network must have the same network ID, and the network ID must be unique to the local segment. In this case, local is defined as being on one side of a router.
The host ID identifies a workstation, server, router, or other TCP/IP device within a network. The host address for each device must be unique to the network ID. A computer connected to a TCP/IP network uses the network ID and host ID to determine which
packets it should receive or ignore and to determine which devices are to have the opportunity of receiving its transmissions.
Throughout the world, TCP/IP networks vary greatly in size and scope. In order to accommodate the wide range of network design needs, IP addresses have been divided into classes.

IP Address Classes Defined

The IP address is 32 bits in length and is used to identify both the host address and the address of the network in which the host resides. An address class is defined to allocate the minimum number of bits that are to be used as the network ID. The remaining bits can be used to further subdivide the network using subnet masks and to define the host ID.

Reasons for Using Specific Address Classes

If you are new to TCP/IP, you may be asking yourself “Why are there different classes of IP addresses, and how can I use them?” First of all, the Internet community has defined the different types of IP addresses in order to accommodate the needs of networks of different sizes. A network with less than 255 devices (workstations, routers, printers, and so) can be assigned a Class C network address. However, a large organization with up to 65,534
devices will need at least a Class B address.
Second, as long as you are not connecting your internal network directly to the public Internet, you can use any valid Class A, B, or C address you want. However, any device that is connected directly to the Internet, must be assigned a network ID from the Internet
community. The organization responsible for administering the assignment of the network ID portions of IP addresses for network devices directly connected to the Internet is the Internet Network Information Center (InterNIC).

Class A addresses are assigned to networks with extremely large numbers of hosts (networked devices). The MSB is set to 0, and is combined with the remaining seven bits of the first octet to complete the network ID. This leaves the last 3 octets, or 24 bits to be assigned to subnet masking and to hosts. As we saw in table 3.3, this allows for 126 (27-2) networks with up to 16,777,214 (221-2) hosts per network. An example of a Class A address is 10.1.2.34 where 10.0.0.0 is the network and 0.1.2.34 is the host.

Class B addresses are assigned to networks with no more than 65,534 (216-2) hosts (networked devices). The MSBs are set to 10, and are combined with the remaining 14 bits of the first two octets to complete the network ID. This leaves the last 2 octets, or 16 bits to be assigned to subnet masking and to hosts and allows for 16,384 (214) networks. Each of these networks can have as many as 65+ thousand hosts. An example of a Class B address is 120.224.21.253 here the network is
120.224.0.0 and the host is 21.253.

Class C addresses are assigned to small networks with a more limited number of hosts. The MSBs are set to 110, and are combined with the remaining 21 bits of the first three octets
to complete the network ID. This leaves the last octet available to be assigned to subnet masking and to hosts, allowing for 2,097,152 (221) networks with up to 254 (28-2) hosts per
network. An example of a Class B address is 207.21.32.12 which is a network of 207.21.32.0 with a host ID of 0.0.0.12.

Class D addresses are reserved for multicast groups. Multicast addresses are assigned to groups of hosts that are cooperating, or are related in some manner. Each host in a multicast group has to be configured to accept multicast packets. The MSBs of a class D address are set to 1110. The remaining bits are uniquely assigned to each group of hosts. Microsoft NT supports class D addresses for applications such as Microsoft Net-Show.

Class E addresses are an experimental class of IP addresses reserved for use in the future. The MSBs for class E address

Tuesday, October 25, 2011

FILING IN C./C++ SYNTAX OFSTREAM IFSTREAM EXAMPLE

Assuming that a text file named FIRST.TXT contains some text written into it, write a function named copyupper ( ), that reads the file FIRST.TXT and creates a new file named SECOND.TXT contains all words from the file FIRST.TXT in uppercase.

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void copyuppercase();
main()
{
     
      copyuppercase();
      system("pause");     
}

void copyuppercase()
{
           ifstream myFile("first.txt");
           char a[40],ans;
           int count=0;
          
           while(!myFile.eof())
           {
                               myFile>>a;                   
                               count=strlen(a);
                               for(int i=0; i<count; i++)
                               {
                                   
                                    if(a[i]>=65 && a[i]<=90)
                                    ans=a[i]+32;
                                    else if (a[i]>=97 && a[i]<=122)
                                    ans=a[i]-32;
                                   
                                    ofstream myfile;
                                    myfile.open("second.txt", ios::app);
                                    myfile<<ans;
                                    myfile.close();
                               }
          
           }
          
}

Monday, October 24, 2011

FILINF IN C/C++ SYNTAX EXAMPLE FSTREAM, OFSTREAM

Write a function to count the number of blank present in a text file named "OUT.TXT

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
main()
{
      int count=0,countsp=0;
      ifstream myFile("Out.txt");
      char a[40];
      while(!myFile.eof())
                    {
                               myFile >> a;
                               
                               //count=strlen(a);
                               cout<<a<<" ";
                               countsp++;
                              
                    }
countsp--;
cout<<endl;
cout<<"\nThere are total of "<<countsp<<" Spaces in this file\n\n";
system("pause");     
}

Saturday, October 22, 2011

FILING IN C/C++ SYNTAX

Write a user-defined function in C++ to read the content from a text file OUT.TXT, count and display the number of alphabets present in it.

#include<iostream>
#include<fstream>
#include<string>
using namespace std;
void countDisplay();
main()
{
countDisplay();     
}
      void countDisplay()
      {
      int count=0,ans=0;
      ifstream myFile("Out.txt");
      char a[40];
      while(!myFile.eof())
                    {
                               myFile >> a;
                               count=strlen(a);
                               ans=ans+count;
                               cout << a<<endl;
                    }
cout<<"\nThere are total of "<<ans<<" Characters in this file\n\n";
system("pause");
}

Tuesday, October 11, 2011

WRITE A C++ PROGRAM TO WRITE NUMBERS FROM 1 TO 100 IN A FILE

This program is using filing concept, and will make a file called notes.txt and generate numbers from 1 to 100 using for loop.

#include<iostream>
#include<fstream>
using namespace std;
main()
{
      ofstream myFile;
      myFile.open("Notes.txt", ios::app);
      for(int i=1; i<=100; i++)
      {
              myFile<<i<<" ";
      }
      myFile.close();
system("pause");
}

Friday, September 23, 2011

FIND NOKIA SECURITY CODE S60 V3 & 4 100% WORKING

Hello today I am going to teach you how to recover find security code for Nokia S60 v3 & 5

For this you will need
1. PC Suit
2. NSS (Download from here)
3. Data Cable

1. Download and install NSS from the link provided above.

During installation, it might ask you to select services, just select Virtual USB DEVICE

2..After installation, run NSS from desktop

3. Click on Scan for new device


4. Click on Phone Info


5. Now connect your Mobile using Data Cable and select PC Suit, As soon as you select PC Suit you have to press the Scan button, if you delay in pressing this button than you will receive an error






If everything goes fine than you should see something like this


6. Now from left side select your phone, it should have Imei written in information

7. Click on Permanent Memory (Located on Right bottom side)

8. Click on read

It will start reading the permanent memory file and will save a log file name your_imei.pm


x:\Program Files\NSS\Backup\pm\your_IMEI.pm
(path can vary depending where you installed NSS)

9. Now open this file using notepad


10. Now locate a line with the combination of alternate 3 and 000000 at the end in this file


As you can see on line 5

11. Remove all alternate 3, and 0's from end

and you will get 12345

12345 is my mobile security code. Thats all

If you still have any query about the whole procedure please comment.

Monday, September 12, 2011

HOW TO USE UPDATE STATEMENT SYNTAX IN SQL SERVER

The Update statement is use to update any column in a table

The syntax of update statement is

Update table_name
Set column_name ='value'
Where column_name='value'

Lets say we have a following table (table_1)


We want to change Asad raza's city from Lahore to Karachi, so for his the syntax would be

update table_1
set city='Karachi'
where firstname='asad'

so the output will be


We can also update multiple column at a same time

lets say we want to change city from Karachi to Islamabad for Muhammad Taqi & Muhammad Taqi

so for this the syntax would be

update table_1
set city='Islamabad'
where firstname='muhammad' or lastname='Taqi'

We can also use AND & OR Operator like in the above example we used OR operator

Note : If you use update statement without where clause than it will update all the record.

If you still have any confusion about update statement than please leave a comment.