Wednesday, February 11, 2009

WAN Technology Overview



WANs and the OSI Model

As described in relation to the OSI reference model, WAN operations focus primarily on Layer 1 and Layer 2. WAN access standards typically describe both physical layer delivery methods and data link layer requirements, including physical addressing, flow control, and encapsulation. WAN access standards are defined and managed by a number of recognized authorities, including the International Organization for Standardization (ISO), the Telecommunication Industry Association (TIA), and the Electronic Industries Alliance (EIA).

The physical layer (OSI Layer 1) protocols describe how to provide electrical, mechanical, operational, and functional connections to the services of a communications service provider.

The data link layer (OSI Layer 2) protocols define how data is encapsulated for transmission toward a remote location and the mechanisms for transferring the resulting frames. A variety of different technologies are used, such as Frame Relay and ATM. Some of these protocols use the same basic framing mechanism, High-Level Data Link Control (HDLC), an ISO standard, or one of its subsets or variants.

Wednesday, February 4, 2009

The Evolving Network Model


The Hierarchical Design Model

The hierarchical network model is a useful high-level tool for designing a reliable network infrastructure. It provides a modular view of a network, making it easier to design and build a scalable network.

The Hierarchical Network Model

As you may recall from CCNA Exploration: LAN Switching and Wireless, the hierarchical network model divides a network into three layers:

Access layer-Grants user access to network devices. In a network campus, the access layer generally incorporates switched LAN devices with ports that provide connectivity to workstations and servers. In the WAN environment, it may provide teleworkers or remote sites access to the corporate network across WAN technology.
Distribution layer-Aggregates the wiring closets, using switches to segment workgroups and isolate network problems in a campus environment. Similarly, the distribution layer aggregates WAN connections at the edge of the campus and provides policy-based connectivity.
Core layer (also referred to as the backbone) - A high-speed backbone that is designed to switch packets as fast as possible. Because the core is critical for connectivity, it must provide a high level of availability and adapt to changes very quickly. It also provides scalability and fast convergence.


The figure represents the Hierarchical Network Model in campus environments. The Hierarchical Network Model provides a modular framework that allows flexibility in network design, and facilitates ease of implementation and troubleshooting in the infrastructure. However, it is important to understand that the network infrastructure is only the foundation to a comprehensive architecture.

Networking technologies have advanced considerably in recent years, resulting in networks that are increasingly intelligent. The current network elements are more aware of traffic characteristics and can be configured to deliver specialized services based on such things as the types of data they carry, the priority of the data, and even the security needs. Although most of these various infrastructure services are outside the scope of this course, it is important to understand that they influence network design. In the next topic, we will explore the Cisco Enterprise Architecture, which expands upon the hierarchical model by making use of network intelligence to address the network infrastructure.

What is a WAN?


What is a WAN?

A WAN is a data communications network that operates beyond the geographic scope of a LAN.

WANs are different from LANs in several ways. While a LAN connects computers, peripherals, and other devices in a single building or other small geographic area, a WAN allows the transmission of data across greater geographic distances. In addition, an enterprise must subscribe to a WAN service provider to use WAN carrier network services. LANs are typically owned by the company or organization that uses them.

WANs use facilities provided by a service provider, or carrier, such as a telephone or cable company, to connect the locations of an organization to each other, to locations of other organizations, to external services, and to remote users. WANs generally carry a variety of traffic types, such as voice, data, and video.

Here are the three major characteristics of WANs:

WANs generally connect devices that are separated by a broader geographical area than can be served by a LAN.
WANs use the services of carriers, such as telephone companies, cable companies, satellite systems, and network providers.
WANs use serial connections of various types to provide access to bandwidth over large geographic areas.


Why Are WANs Necessary?

LAN technologies provide both speed and cost-efficiency for the transmission of data in organizations over relatively small geographic areas. However, there are other business needs that require communication among remote sites, including the following:

People in the regional or branch offices of an organization need to be able to communicate and share data with the central site.
Organizations often want to share information with other organizations across large distances. For example, software manufacturers routinely communicate product and promotion information to distributors that sell their products to end users.
Employees who travel on company business frequently need to access information that resides on their corporate networks.


In addition, home computer users need to send and receive data across increasingly larger distances. Here are some examples:

It is now common in many households for consumers to communicate with banks, stores, and a variety of providers of goods and services via computers.
Students do research for classes by accessing library indexes and publications located in other parts of their country and in other parts of the world.


Since it is obviously not feasible to connect computers across a country or around the world in the same way that computers are connected in a LAN with cables, different technologies have evolved to support this need. Increasingly, the Internet is being used as an inexpensive alternative to using an enterprise WAN for some applications. New technologies are available to businesses to provide security and privacy for their Internet communications and transactions. WANs used by themselves, or in concert with the Internet, allow organizations and individuals to meet their wide-area communication needs.

Sunday, February 1, 2009

Benefits and Limitation of E-Commerce

The Benefits of EC
Few innovations in human history encompass as many potential benefits as EC does. The global nature of the technology, low cost, opportunity to reach hundreds of millions of people, interactive nature, variety of possibilities, and resourcefulness and rapid growth of the supporting infrastructures result in many potential benefits are just starting to materialize, but they will increase significantly as EC expands. It is not surprising that some maintain that the EC revolution is just “as profound as the change that came with the industrial revolution”.
Benefits to Organizations:
The benefits to organizations are as follows:
1. EC expands the marketplace to national and international markets. With minimal capital outlay, a company can easily and quickly locate more customers, the best suppliers, and the most suitable business partners worldwide.
2. EC decreases the cost of creating, processing, distributing, storing, and retrieving paper-based information.
3. Ability for creating highly specialized businesses.
4. EC allows reduced inventories and overhead by facilitating “pull” –type supply chain management. In a pull-type system the process starts from customer orders and uses just in time manufacturing.
5. The pull-type processing enables expensive customization of products and services which provides competitive advantage to its implementers.
6. EC reduces the time between the outlay of capital and the receipt of products and services.
7. EC initiates business processes reengineering projects.
8. EC lowers telecommunications cost –the Internet is much cheaper than VANs.
9. Other benefits include improved image, improved customer service, new found business partners, simplified processes, compressed cycle and delivery time, increased productivity, eliminating paper, expediting access to information, reduced transportation costs, and increased flexibility.

Benefits to Consumers
The benefits of EC to consumers are as follows:
1. EC enables customers to shop or do other transactions 24 hours a day, all year round, from almost any location.
2. EC provides customers with more choice; they can select from many vendors and from more products.
3. EC frequently provides customers with less expensive products and services by allowing them to shop in many places and conduct quick comparisons.
4. In some case, especially with digitized products, EC allows quick delivery.
5. Customer can receive relevant and detailed information in seconds, rather than days or weeks.
6. EC makes it possible to participate in virtual auctions.
7. EC allows customers to interact with other customers in electronic communities and exchange ideas as well as compare experiences.
8. EC facilitates competition, which results in substantial discounts.

Benefits to Society
The benefits of EC to society are as follows:
1. EC enables more individuals to work at home and to do less traveling for shopping, resulting in less traffic on the roads and lower air pollution.
2. EC allows some merchandise to be sold at lower prices, so less affluent people can buy more and increase their standard of living.
3. EC enables people in third world countries and rural areas to enjoy products and services that otherwise are not available to them. This includes opportunities to learn professions and earn college degrees.
4. EC facilitates delivery of public services, such as health care, education, and distribution of government social services at a reduced cost and/or improved quality. Health-care services, for example, can reach patients in rural areas.

The limitations of EC
The limitations of EC can be grouped into technical and nontechnical categories.
Technical Limitations of EC
The technical limitations of EC are as follows:
1. There is a lack of system security, reliability, standards, and some communication protocols.
2. There is insufficient telecommunication bandwidth.
3. There is software development tools are still evolving and changing rapidly.
4. It is difficult to integrate the internet and EC software with some existing applications and databases.
5. Vendors may need special Web servers and other infrastructures.
6. Some EC software might not fit with some hardware, or may be incompatible with some operating systems or other components.
These limitations will lessen or be overcome; appropriate planning can minimize their impact.
Nontechnical Limitations
There are many nontechnical limitations that slow spread of EC; the following are the major ones:
1. Cost and Justification
2. Security and Privacy
3. Lack of trust and user resistance
4. Other limiting factors

#include palash.h

/* include Palash.h*/

#define BSIZE 128 /* buffer size */
#define NONE -1
#define EOS '\0'


#define NUM 256
#define DIV 257
#define MOD 258
#define ID 259
#define DONE 260


#define IF 261
#define THEN 262
#define ELSE 263
#define WHILE 264
#define REPEAT 265
#define UNTIL 266

#define BEGIN 267
#define END 268
#define INT 269
#define CHAR 270
#define WS 271
#define NID 272
#define DO 273

#define STRMAX 999 /* size of lexemes array */
#define SYMMAX 100 /* size of symtable */
#define MAX 10000

Compiler Using C

/* Palash.cseku@gmail.com */
#include /* load i/o routines */
#include
#include
#include /* load character test routines */
#include Palash.h

FILE *fp,*fout;
char lexemes[STRMAX];
char Terror[20][50];
char line[20],err[50],str[30];
int lastchar = -1; /* last used position in lexemes */

int lastentry = 0; /* last used position in symtable*/
int inc=0,flag=0,gb,gt;
int lookahead,q=2,chkParen=0,chkBegin=0,Int=0;

char lexbuf[BSIZE];
int lineno = 1,check=0;
int tokenval = NONE;

void match(int);
void expr();
void term();
void factor();
void stmt();
void error(char[]);
void emit(int,int);
struct entry /* form of symbol table entry */
{
 char *lexptr;
 int token;

};
struct entry symtable[SYMMAX];
char *allToken[1000];

//struct entry keywords[]={0,0};

struct entry keywords[]={"div",DIV,
  "mod",MOD,
  "if",IF,
  "then",THEN,
  "else",ELSE,
  "do",DO,
  "while",WHILE,
  "repeat",REPEAT,
  "until",UNTIL,
  "begin",BEGIN,
  "end",END,
  "int",INT,
  "char",CHAR,
  0,0
  };

void init()
{
 struct entry *p;
 for(p=keywords; p->token; p++)
  insert(p->lexptr,p->token);
}



void expr()
{
 lookahead = lexan();
 while(lookahead != DONE)
 switch(lookahead)
 {
  case ';' : if(chkParen>0)error(" ) required");
  else if(chkParen<0)error(" chkparen="0;" q="="0)" lookahead="="INT||lookahead="="CHAR||lookahead="="NUM||lookahead="="ID)">'&&lookahead!='='&&lookahead!=NUM&& lookahead!=ID)
  error(" <>' :
  match('>');
  if(lookahead!='='&&lookahead!=NUM&& lookahead!=ID)
  error(" > error");
  break;

  case NUM : match(NUM);
  if(lookahead=='(' )
  error(" NUM error");
  break;
  case ID : match(ID);
  if(lookahead=='('&& lookahead!=INT&& lookahead!=CHAR)
  error("ID error ");
  break;
  case IF : match(IF);match('(');expr();match(')');
  if(lookahead!=THEN)error("Required then");
  break;
  case THEN : match(THEN);
  if(lookahead!=IF&&lookahead!=ID&&lookahead!=ELSE)
  error("if or else or identifier required");
  break;
  case ELSE : match(ELSE);
  if(lookahead!=IF&&lookahead!=ID)
  error("If or id required");
  break;
  case DO : match(DO);
  break;
  case WHILE : match(WHILE);
  break;
  case REPEAT : match(REPEAT);
  break;
  case UNTIL : match(UNTIL);
  break;
  case BEGIN : chkBegin++;
  match(BEGIN);
  break;
  case END : chkBegin--;
  match(END);
  break;
  case INT : Int=1;
  if(q==0)
  {
  insert(str,ID);
  check=0;q=1;
  }
  else error("Duplicate declaration");
  match(INT);
  match(';');
  Int=0;
  break;
  case CHAR : if(q==0)

  {
  insert(str,ID);
  check=0;q=1;
  }
  else error("Duplicate declaration");
  match(CHAR);
  match(';');

  break;
  default :
  error("Unexpected");
  getch();exit(0);
 }

}

int lexan() /* lexixcal analyzer */
{
 int t;
 while(1)
 {
  t = getc(fp);
  if(t == ' '|| t == '\t') ; /* strip out white space */

  else if(t == '\n')
  {
  lineno = lineno + 1;

  }

  else if( isdigit(t))
  {
  ungetc(t,fp);
  scanf("%d",&tokenval);
  return NUM;
  }

  else if( isalpha(t)) /* t is a letter */
  {

  int p,b=0;

  while(isalnum(t)) /* t is a alphanumeric */
  {
  lexbuf[b]=t;
  t=getc(fp);
  b= b + 1;
  if(b >= BSIZE) error("compiler error");
  }

  lexbuf[b] = EOS;

  if(t != EOF)
  ungetc(t,fp);

  p = lookup(lexbuf);

  if(p == 0)
  {
  q=p;
  strcpy(str,lexbuf);
  return ID;
  }
  else check=1;

  tokenval = p;
  return symtable[p].token;
  }

  else if(t ==EOF) return DONE;

  else
  {
  tokenval = NONE;
  return t;
  }

 }
}


void main()
{
 clrscr();
 init();
 fp=fopen("in.cpp","r");
 fout=fopen("out.cpp","w");
 expr();
 if(chkBegin>0){error(" end required");getch();}
 else if(chkBegin<0){error(" int="="1)" lookahead =" lexan();" p =" lastentry;">0 ;p = p-1)
  if(strcmp(symtable[p].lexptr,s) == 0)
  return p;
 return 0;
}


int insert(char s[], int tok)
{
 int len;
 len = strlen(s);
 if(lastentry + 1 >=SYMMAX) error("symbol table full");
 if(lastchar + len +1 >= STRMAX) error("lexemes array full");
 lastentry = lastentry + 1;
 symtable[lastentry].token = tok;
 symtable[lastentry].lexptr = &lexemes[lastchar + 1];
 lastchar = lastchar + len +1;
 strcpy(symtable[lastentry].lexptr,s);
 return lastentry;
}

void error(char *m)
{
 //fprintf(stderr,"line %d: %s\n",lineno,m);
 fprintf(fout,"line %d: %s\n",lineno,m);
}

Thursday, January 22, 2009

Chinese Remainder Theorem

Chinese Remainder Theorem 

The Chinese Remainder Theorem is mainly based on the algorithm of linear congruencies. Congruence is nothing more than a statement about divisibility [19]. The Chinese Remainder Theorem is mainly based on the system of linear congruencies a = b (mod n) which can be reduced to a set of a = b (mod ni), where n1, n2, Ö ni are prime factors of n.

Theorem
Let n1, n2, . . . ,nk denote k positive integers which are relatively prime, and let a1,a2, . . . , ak denote any k integers. Then the congruencies x = ai (mod ni), i = 1, 2. . . k have common solutions. Any two solutions are congruent modulo n1, n2. . . nk. 
  Y = X (mod P) where P = n1* n2*Ö.* nk.  
  X = (a1*N1*x1) + . . . .+ (ak*Nk*xk) (mod P) 
  i.e. X = ∑ ai*Ni*xi (Mod P)  
Where Nk = P / nk in which xk satisfies Ni*xi = 1 (mod ni). 
The remainder of the solved congruencies X is transmitted. At the receiving end, using X, ai are found using ai = X (mod ni) and then multiplying by16, the original pixel values are reconstructed.