Monday, January 24, 2011

OSI REFERENCE MODEL


The OSI, or Open System Interconnection, model defines a networking framework for implementing protocols in seven layers. Control is passed from one layer to the next, starting at the application layer in one station, and proceeding to the bottom layer, over the channel to the next station and back up the hierarchy.

Application (Layer 7)

This layer supports application and end-user processes. Communication partners are identified, quality of service is identified, user authentication and privacy are considered, and any constraints on data syntax are identified. Everything at this layer is application-specific. This layer provides application services for file transfers, e-mail, and other network software services. Telnet and FTP are applications that exist entirely in the application level. Tiered application architectures are part of this layer.

Presentation (Layer 6)

This layer provides independence from differences in data representation (e.g.,encryption) by translating from application to network format, and vice versa. The presentation layer works to transform data into the form that the application layer can accept. This layer formats and encrypts data to be sent across a network, providing freedom from compatibility problems. It is sometimes called the syntax layer.

Session (Layer 5)

This layer establishes, manages and terminates connections between applications. The session layer sets up, coordinates, and terminates conversations, exchanges, and dialogues between the applications at each end. It deals with session and connection coordination.

Transport (Layer 4)

This layer provides transparent transfer of data between end systems, or hosts, and is responsible for end-to-end error recovery and flow control. It ensures complete data transfer.

Network (Layer 3)

This layer provides switching and routing technologies, creating logical paths, known as virtual circuits, for transmitting data from node to node. Routing and forwarding are functions of this layer, as well as addressing, inter networking, error handling, congestion control and packet sequencing.

Data Link (Layer 2)

At this layer, data packets are encoded and decoded into bits. It furnishestransmission protocol knowledge and management and handles errors in the physical layer, flow control and frame synchronization. The data link layer is divided into two sub layers: The Media Access Control (MAC) layer and the Logical Link Control (LLC) layer. The MAC sub layer controls how a computer on the network gains access to the data and permission to transmit it. The LLC layer controls frame synchronization, flow control and error checking.

Physical (Layer 1)

This layer conveys the bit stream - electrical impulse, light or radio signal -- through the network at the electrical and mechanical level. It provides the hardware means of sending and receiving data on a carrier, including defining cables, cards and physical aspects. Fast Ethernet, RS232, and ATM are protocols with physical layer components.

NETWORK TOPOLOGIES


Physical Topology means the physical design of a network including the devices, location and cable installation.
Logical Topology refers to the fact that how data actually transfers in a network as opposed to its design.
Topology can be considered as a virtual shape or structure of a network. This shape actually does not correspond to the actual physical design of the devices on the computer network. The computers on the home network can be arranged in a circle shape but it does not necessarily mean that it presents a ring topology.


Computer network topologies can be categorized in the following categories.
• bus
• star
• ring
• mesh
• Tree.
Hybrid networks are the complex networks, which can be built of two or more above mentioned topologies.


Bus Topology
Bus topology uses a common backbone to connect all the network devices in a network in a linear shape. A single cable functions as the shared communication medium for all the devices attached with this cable with an interface connector. The device, which wants to communicate send the broadcast message to all the devices attached with the shared cable but only the intended recipient actually accepts and process that message.


Ring Topology
In ring Network, every computer or devices has two adjacent neighbors for communication. In a ring network, all the communication messages travel in the same directory whether clockwise or anti clockwise. Any damage of the cable of any cable or device can result in the breakdown of the whole network. Ring topology now has become almost obsolete.
FDDI, SONET or Token Ring Technology can be used to implement Ring Technology. Ring topologies can be found in office, school or small buildings.


Star Topology
In the computer networking world the most commonly used topology in LAN is the star topology. Star topologies can be implemented in home, offices or even in a building. All the computers in the star topologies are connected to central devices like hub, switch or router. The functionality of all these devices is different. I have covered the detail of each networking devices in the separate portion of my website. Computers in a network are usually connected with the hub, switch or router with the Unshielded Twisted Pair (UTP) or Shielded Twisted Pair Cables.
As compared to the bus topology, a star network requires more devices & cables to complete anetwork. The failure of each node or cable in a star network, won’t take down the entire network
as compared to the Bus topology.
However if the central connecting devices such as hub, switch or router fails due to any reason,then ultimately all the network can come down or collapse.


Tree Topology
Tree topologies are comprised of the multiple star topologies on a bus. Tree topologies integrate multiple star topologies together onto a bus. Only the hub devices can connect directly with the tree bus and each Hub functions as a root of a tree of the network devices. This bus/star/hybrid combination supports future expandability of the computer networks, much better than a bus or star.


Mesh Topology
Mesh topology work on the concept of routes. In Mesh topology, message sent to the destination can take any possible shortest, easiest route to reach its destination. In the previous topologies star and bus, messages are usually broadcasted to every computer, especially in bus topology. Similarly in the Ring topology message can travel in only one direction i.e clockwise or anticlockwise. Internet employs the Mesh topology and the message finds its route for its destination. Router works in find the routes for the messages and in reaching them to their destinations.The topology in which every devices connects to every other device is called a full Mesh topology unlike in the partial mesh in which every device is indirectly connected to the other devices.


ROUTERS AND FIREWALLS


Routers

A router is an internetworking device that forwards packets between networks by processing information found in the datagram or packet (Internet protocol information from Layer 3 of the OSI Model). In many situations, this information is processed in conjunction with the routing table (also known as forwarding table). Routers use routing tables to determine what interface to forward packets (this can include the "null" also known as the "black hole" interface because data can go into it, however, no further processing is done for said data).


Firewalls

Firewalls are the most important aspect of a network with respect to security. A firewalled system does not need every interaction or data transfer monitored by a human, as automated processes can be set up to assist in rejecting access requests from unsafe sources, and allowing actions from recognized ones. The vital role firewalls play in network security grows in parallel with the constant increase in 'cyber' attacks for the purpose of stealing/corrupting data, planting viruses, etc.

WAN

WANs are used to connect the computers in the one part of the world with the other part of the world. So the users and computers from the different parts of the world can communicate with each other. Many WANs are generally built for one organization. Other types of WAN networking are the Internet service providers that connect the LANS or individual computers to the Internet. WAN networks are built using the leased lines and a router is connected to the one end of the WAN and a hub is connected to the other end.
There are three basic types of computer networking LAN (local area network), MAN (metropolitan area network) and WAN (Wide area network). A wide area network is a geographically dispersed large network. A wide area network can be privately owned or rented. A WAN covers a large geographical area such as a city, province or a country.
A widea area network may consist of a multiple LANs or MANs. The world’s most popular wide arae network in the world is is the internet. WANs are the corporate network that utilizes leased lines.
Wide area networks generally utilize much expensive equipment. The main communication technologies that are included in the WAN are SONET, Frame Relay and ATM. The computers that are connected to the WANs are generally connected through the public networks and they can also be connected through the satellites.



With this hub a number of computers and other hubs and switches are connected. Among the other methods of building the WANs are the circuit switching or packet switching methods. The general protocols and the communication technologies that are involved in the overall wide area networking/communication are TCP/IP, SONET, MPLS, ATM and X.25, which closely works with frame relay. Typical a WAN consists of a number of interconnected switching nodes.
Networking Methods
Networking is a complex part of the computing and it covers the broader range of the IT industry. All the communication in the world including satellite communication, mobile communication, internet, telephones and WANs is due to the networking. There are two main types of the networking.
Local Area Network (LAN)
A local area network is relatively covers small space and provides services to a small amount of people. A local area can be divided into two major types, peer to peer and the client server. Depending on the number of the users a network is configured. Among the few examples of the peer to peer networks are small office network and home networks. On the other hand, in the client/server networking model all the client computers depends on the server for resources like (modem, printer, scanner, cd-rom) and they are connected with the server. The servers in the client/server networking model works in different capacities like single service server and multiple service servers.
Wide Area Network (WAN)
A wide area network is a network where are large number of the resources are deployed in a very wide geographically area. The best example of the WAN is the internet itself which is a largest network in the world.
In order for communication to take place between the computers the mediums must be used. These mediums can be cables, Routers, Repeaters, Ethernet, Protocols and switches etc. These different mediums make the data communication possible in different scenarios.
Types of WANs
There are two basic types of Widea Area Networking.
A computer network is set of computers and devices that are connected with each other. Examples of the networks are the Internet, local area network, Wide area network and satellite networks.
Centralized WANS:
A WAN that consists of a server or a group of servers in a central location to which client computers connect, the server provides the most of the functionalities of a network. Many banks, large stores, large schools and universities use centralized WAN. A centralized wide area network may have a number of the servers in the centralized location.
Distributed WAN:
A widea area network that consists of the client and server computers that are distributed throughout the WAN, the functionalities of the network are distributed throughout the WAN. The internet is an example of the wide area network.
The impact of Wide Area Networking on business
In this age of information, data communication (sending and receiving data) over a long distance is a necessity. There have been number of technologies developed that enable networks and their users to communicate with each other, and exchange data easily even if they are at the different end of the world. Geographical area is no more a matter in today’s communication age. Because of this the communication through WAN has been become vital. Wide area networks make it feasible for the companies to have a single network, which will connect their several offices and departments. Companies, banks, large organizations often have their offices spread over a large distance. Without wide area networking the people of a multinational organization can face difficulties to communicate with each. WANs are important in connecting institutes they are very far from each other.

WIRELESS COMMUNICATION

Wireless networking is very useful in the public places, libraries, hotels, schools, airports, railway stations where one might find wireless access to the internet. A drawback in the wireless internet is that quality of service (QOS) is not guaranteed if there is any interference then the connection may be dropped.

Wireless Network Types

Wireless Local Area Networks (WLANS)

WLANS allow users in local area, such as in a university or a library to form a network and gain wireless access to the internet. A temporary network can be formed by a small number of users without the need of access point; given that they do not need to access the resources.

Wireless Personal Area Networks (WPANS)

There are two current technologies for wireless personal network Bluetooth and Infra Red. These technologies will allow the connectivity of personal devices within an area of 30 feet. Infra Red requires a direct line and the range is less as compared to Bluetooth technology.

Wireless Metropolitan Area Networks (WMANS)

WMANS allow the connectivity of multiple networks in a metropolitan area such as building in a city. The network connectivity is the alternative of copper or fiber cabling.

Wireless Wide Area Networks (WWANS)

WWANS or Wireless Area Networks can be maintained over large areas such as in different cities or between different countries, via multiple satellite systems or antenna sites. The types of system are called 2G systems.
The following table shows the range those different types of wireless network covers.
Network Meter
Personal Area Network 0-10
Local Area Network 0-100
Wide Are Network 0-10000
Security in Wireless Networking
The following different types of security methods are available in the wireless networking.

Wired Equivalent Privacy (WEP)

Wired Equivalent Privacy is intended to stop the interference of radio frequency that is signaled by unauthorized users and this security measure is most suitable for the small networks. There is not key management protocol and each key is entered manually into the clients that’s why this is very time consuming administrative task. The WEP security method is based on the RC4 encryption algorithm. In the WEP all the client computers and Access points are configured with the same encryption and decryption keys.

Service Set Identifier (SSID)

Service Set Identifier (SSID) acts a simple password by allowing WLAN network to be split up into different networks and each having a unique identifier. These identifiers are configured in the multiple access points. To access any of any networks, a computer is configured in such a way that each is having a corresponding SSID identifier for that network. If the SSID match between the two computers or networks then access is granted to each other.

Media Access Control filtering (MAC Access Control)

A list of the MAC addresses of the client computers can be inputted into an Access point and only those computers are granted to give the access to the network. When a computer makes a request, its MAC address is compared to the list of the MAC addresses to the Access point and based on this access permission granted to deny.
This is a good security method but it is mainly involved in the small wireless networks because there is more manual work is involved of entering the MAC address into the Access point.

Bluetooth

Bluetooth is a simple type of the wireless networking that operates in the digital devices, like mobiles phones, personal computers, PDA, Laptops, digital camera, MP3 players and other Bluetooth enabled devices to form a small network. In the Bluetooth technology eight devices can be connected to each other at the same time. Bluetooth can also be found in the headsets, hands-free kits, wireless keyboards and mouse. Bluetooth technology was invented by Ericsson in 1994 and after four years in 1998 some major mobile phone companies such as Nokia, Ericsson, Intel and Toshiba formed a group to promote this technology.

Bluetooth technology falls in the category of personal area networking because it operates in the range of 30 to 300 feet. Bluetooth uses the radio waves technology, which is not very expensive and has low power consumption. Many different companies are intended to add the Bluetooth chip in their digital devices. Bluetooth technology is getting very popularity because of its low cost and portability.

The Future of Wireless Networking

WLANS wireless networking type is very popular in home networking and more than 20 percent homes with broadband internet are using WLANS and this number is increasing. In a general estimate worldwide hotspots have now reached more than 30,000 and will grow about 210,000 in the next few years. Most large hotels already offer Wi-Fi and the business travelers are willing to pay wireless access. 802.11 is the next Wi-Fi speed standard is set to offer bandwidth around 108Mbps and is still under development. With the speed of 70 Mbps and a range up to 30 miles, the 80216 standard, known as WiMAX is sure to get boost.

Some Tips & Tricks

• When purchasing a wireless NIC card try to get one that is having external antenna. When you are out and using Wi-Fi enabled laptop, disable Microsoft file and sharing, which enables other computers in a network to access data and resources on your computer. In this way, your computer or laptop will be saved from hackers.
• If you are concerned about the interference from the other wireless access point set the AP and wireless computers to use a non-overlapping channel.
• Change the configuration interface password of the access point before you enable it.
• Only buy an access point that is having upgradeable capabilities. By this way you can take the advantage of security enhancements.
• Keep the access point up to date.

TCP IP

A common communication language is used by the computers and the communication devices is known as protocols. The most commonly used and popular protocol on the internet and in the home and other networks is called TCP/IP. TCP/IP is not a single protocol but it is a suite of several protocols.A computer network can be a wired or wireless and TCP/IP protocol can work both in types of a network.Data flow or communication can be divided into seven logical layers called OSI layers model that was developed by Intel and Xerox Corporation and was standardized by ISO.

1. Application layer
2. Presentation layer
3. Session layer
4. Transport layer
5. Network layer
6. Data Link layer
a. Media access control sub-layer
b. Logical link control sub-layer
7. Physical layer
A network can be divided into different scales and ranges and it depends on the requirement of the organization and the geographical location. Computer Network can be divided into Local Area Network, Personal Area Network, Campus Area Network, Wireless Local Area Network, Metropolitan Area Network and Wide Area Network.

COMPUTER NETWORKS

A computer network can be divided into a small segments called Local Area Network (LAN), networking between computers in a building of a office, medium sized networks (MAN), communication between two offices in a city and wide area networks (WAN) networking between the computers, one is locally placed and the other can be thousands of miles away in another city or another country in the world.

WAN connectivity is achieved by a device known as “Router”. The internet is the world’s largest WAN, where millions of computers from all over the globe and connected with each other.

Networking is the practice of linking two or more computers or devices with each other. The connectivity can be wired or wireless. A computer network can be categorized in different ways, depends on the geographical area as mentioned above.

A network topology defines the structure, design or layout of a network. There are different topologies like bus, ring, star, mesh, hybrid etc. The star topology is most commonly used topology. In the star topology, all the computers in the network are connected with a centralized device such as hub or switch. Thus forms a star like structure. If the hubs/switch fails to work for any reason then all the connectivity and communication between the computers will be halted.

FIRST COME FIRST SERVE PROGRAM

#include
#include
void main( )
{
char pname[10][20];
float b_time[10],wt_time[10],avg_time[10],s,t_time[10],k, t=0;
int i,n;
clrscr( );
printf("enter the total no. of processes: ");
scanf("%d",&n);
for(i=0;i {
printf("\nenter process name:");
scanf("%s",pname[i]);
printf("enter burst time ");
scanf("%f",&b_time[i]);
}
for(i=0;i {
if(i==0)
{
wt_time[i]=0;avg_time[i]=0;
}
else
{
wt_time[i]=wt_time[i-1]+b_time[i-1];
}
t_time[i]=wt_time[i]+b_time[i];
t+=t_time[i];
}
k=t/n;
for(i=1;i {
avg_time[i]=avg_time[i-1]+wt_time[i];
}
s=avg_time[n-1]/n;
printf("\n pr.no\t pr.name\t b_time\t wt_time\tt_time\n");
for(i=0;i {
printf("%d\t\t%s\t%f\t%f\t%f\n",i+1,pname[i],b_time[i],wt_time[i],t_time[i]);
}
printf("average waiting time:%f\naverage turn around time: %f\n",s,k);
getch( );
}

SHORTEST JOB FIRST SCHEDULING PROGRAM

PROGRAM SOURCE CODE
# include<stdio.h>
main()
{
int k=0,ptime[25],n,s=0,I,sum=0;
char name[25][25];
int t,p,time[10],pao[10];
float avg;
printf (“enter the no. of process: \t”);
scanf (“%d”,&n);
for(i=0;i<n;i++)
{
printf(“enter the name for processes: \t”);
printf(“%d \t”,i+1);
scanf(“%s”,name[i]);
}
printf(“\n \n”);

for(i=0;i<n;i++)
{
printf(“enter the process time: \t”);
printf(“%s \t”,name[i]);
scanf(“%d”,&ptime[i]);
}
printf(“\n \n”);
printf(“\n process – name \t process – time \n”);
for(i=0;i<n;i++)
{
printf(“\t %s \t \t %d \n”,name[i],ptime[i]);
}
printf(“\n \n SJF SCHEDULING \n \n”);
for(i=0;i<n;i++)
{
pas[i]=i;
time[i]=ptime[i];
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(time[i]>time[j])
{
p=time[i];
time[i]=time[j];
time[j]=p;
t=pas[i];
pas[i]=pas[j];
pas[j]=t;
}
}
}


for(i=0;i<n;i++)
{
printf(“process %s from %d to %d \n”,name[pas[i],k,(k+time[i]);
k+=time[i];
}
for(i=0;i<(n-1);i++)
{
s+=time[i];
sum+=s;
}
avg=(float)sum/n;
printf(“\n\n average waiting time: \t”);
printf(“%2fmsec”,avg);
sum=avg=s=0;
for(i=0;i<n;i++)
{
s+=ptime[i];
sum+=s;
}
avg=(float)sum/n;
printf(“\n turn around time is \t”);
printf(“%2fmsec”,avg);
}

Sutherland–Hodgman algorithm


The algorithm begins with an input list of all vertices in the subject polygon. Next, one side of the clip polygon is extended infinitely in both directions, and the path of the subject polygon is traversed. Vertices from the input list are inserted into an output list if they lie on the visible side of the extended clip polygon line, and new vertices are added to the output list where the subject polygon path crosses the extended clip polygon line.
This process is repeated iteratively for each clip polygon side, using the output list from one stage as the input list for the next. Once all sides of the clip polygon have been processed, the final generated list of vertices defines a new single polygon that is entirely visible. Note that if the subject polygon was concave at vertices outside the clipping polygon, the new polygon may have coincident (i.e. overlapping) edges – this is acceptable for rendering, but not for other applications such as computing shadows.


PSEUDO CODE:-
List outputList = subjectPolygon;
  for (Edge clipEdge in clipPolygon) do
     List inputList = outputList;
     outputList.clear();
     Point S = inputList.last;
     for (Point E in inputList) do
        if (E inside clipEdge) then
           if (S not inside clipEdge) then
              outputList.add(ComputeIntersection(S,E,clipEdge));
           end if
           outputList.add(E);
        else if (S inside clipEdge) then
           outputList.add(ComputeIntersection(S,E,clipEdge));
        end if
        S = E;
     done
  done