Thursday, February 12, 2009

Virtual Circuits


Virtual Circuits

The connection through a Frame Relay network between two DTEs is called a virtual circuit (VC). The circuits are virtual because there is no direct electrical connection from end to end. The connection is logical, and data moves from end to end, without a direct electrical circuit. With VCs, Frame Relay shares the bandwidth among multiple users and any single site can communicate with any other single site without using multiple dedicated physical lines.

There are two ways to establish VCs:

SVCs, switched virtual circuits, are established dynamically by sending signaling messages to the network (CALL SETUP, DATA TRANSFER, IDLE, CALL TERMINATION).
PVCs, permanent virtual circuits, are preconfigured by the carrier, and after they are set up, only operate in DATA TRANSFER and IDLE modes. Note that some publications refer to PVCs as private VCs.



In the figure, there is a VC between the sending and receiving nodes. The VC follows the path A, B, C, and D. Frame Relay creates a VC by storing input-port to output-port mapping in the memory of each switch and thus links one switch to another until a continuous path from one end of the circuit to the other is identified. A VC can pass through any number of intermediate devices (switches) located within the Frame Relay network.

The question you may ask at this point is, "How are the various nodes and switches identified?"


VCs provide a bidirectional communication path from one device to another. VCs are identified by DLCIs. DLCI values typically are assigned by the Frame Relay service provider (for example, the telephone company). Frame Relay DLCIs have local significance, which means that the values themselves are not unique in the Frame Relay WAN. A DLCI identifies a VC to the equipment at an endpoint. A DLCI has no significance beyond the single link. Two devices connected by a VC may use a different DLCI value to refer to the same connection.

Locally significant DLCIs have become the primary method of addressing, because the same address can be used in several different locations while still referring to different connections. Local addressing prevents a customer from running out of DLCIs as the network grows.

This is the same network as presented in the previous figure, but this time, as the frame moves across the network, Frame Relay labels each VC with a DLCI. The DLCI is stored in the address field of every frame transmitted to tell the network how the frame should be routed. The Frame Relay service provider assigns DLCI numbers. Usually, DLCIs 0 to 15 and 1008 to 1023 are reserved for special purposes. Therefore, service providers typically assign DLCIs in the range of 16 to 1007.

In this example, the frame uses DLCI 102. It leaves the router (R1) using Port 0 and VC 102. At switch A, the frame exits Port 1 using VC 432. This process of VC-port mapping continues through the WAN until the frame reaches its destination at DLCI 201, as shown in the figure. The DLCI is stored in the address field of every frame transmitted.

PPP


What is PPP?

Recall that HDLC is the default serial encapsulation method when you connect two Cisco routers. With an added protocol type field, the Cisco version of HDLC is proprietary. Thus, Cisco HDLC can only work with other Cisco devices. However, when you need to connect to a non-Cisco router, you should use PPP encapsulation.

PPP encapsulation has been carefully designed to retain compatibility with most commonly used supporting hardware. PPP encapsulates data frames for transmission over Layer 2 physical links. PPP establishes a direct connection using serial cables, phone lines, trunk lines, cellular telephones, specialized radio links, or fiber-optic links. There are many advantages to using PPP, including the fact that it is not proprietary. Moreover, it includes many features not available in HDLC:

The link quality management feature monitors the quality of the link. If too many errors are detected, PPP takes the link down.
PPP supports PAP and CHAP authentication. This feature is explained and practiced in a later section.


PPP contains three main components:

HDLC protocol for encapsulating datagrams over point-to-point links.
Extensible Link Control Protocol (LCP) to establish, configure, and test the data link connection.
Family of Network Control Protocols (NCPs) for establishing and configuring different network layer protocols. PPP allows the simultaneous use of multiple network layer protocols. Some of the more common NCPs are Internet Protocol Control Protocol, Appletalk Control Protocol, Novell IPX Control Protocol, Cisco Systems Control Protocol, SNA Control Protocol, and Compression Control Protocol.

TDM


Time Division Multiplexing
Bell Laboratories invented time-division multiplexing (TDM) to maximize the amount of voice traffic carried over a medium. Before multiplexing, each telephone call required its own physical link. This was an expensive and unscalable solution. TDM divides the bandwidth of a single link into separate channels or time slots. TDM transmits two or more channels over the same link by allocating a different time interval (time slot) for the transmission of each channel. In effect, the channels take turns using the link.

TDM is a physical layer concept. It has no regard for the nature of the information that is being multiplexed onto the output channel. TDM is independent of the Layer 2 protocol that has been used by the input channels.

TDM can be explained by an analogy to highway traffic. To transport traffic from four roads to another city, you can send all the traffic on one lane if the feeding roads are equally serviced and the traffic is synchronized. So, if each of the four roads puts a car onto the main highway every four seconds, the highway gets a car at the rate of one each second. As long as the speed of all the cars is synchronized, there is no collision. At the destination, the reverse happens and the cars are taken off the highway and fed to the local roads by the same synchronous mechanism.

This is the principle used in synchronous TDM when sending data over a link. TDM increases the capacity of the transmission link by slicing time into smaller intervals so that the link carries the bits from multiple input sources, effectively increasing the number of bits transmitted per second. With TDM, the transmitter and the receiver both know exactly which signal is being sent.

In our example, a multiplexer (MUX) at the transmitter accepts three separate signals. The MUX breaks each signal into segments. The MUX puts each segment into a single channel by inserting each segment into a timeslot.

A MUX at the receiving end reassembles the TDM stream into the three separate data streams based only on the timing of the arrival of each bit. A technique called bit interleaving keeps track of the number and sequence of the bits from each specific transmission so that they can be quickly and efficiently reassembled into their original form upon receipt. Byte interleaving performs the same functions, but because there are eight bits in each byte, the process needs a bigger or longer time slot.

Wednesday, February 11, 2009

WAN Physical Layer Concepts


WAN Devices

WANs use numerous types of devices that are specific to WAN environments, including:

Modem-Modulates an analog carrier signal to encode digital information, and also demodulates the carrier signal to decode the transmitted information. A voiceband modem converts the digital signals produced by a computer into voice frequencies that can be transmitted over the analog lines of the public telephone network. On the other side of the connection, another modem converts the sounds back into a digital signal for input to a computer or network connection. Faster modems, such as cable modems and DSL modems, transmit using higher broadband frequencies.
CSU/DSU-Digital lines, such as T1 or T3 carrier lines, require a channel service unit (CSU) and a data service unit (DSU). The two are often combined into a single piece of equipment, called the CSU/DSU. The CSU provides termination for the digital signal and ensures connection integrity through error correction and line monitoring. The DSU converts the T-carrier line frames into frames that the LAN can interpret and vice versa.
Access server-Concentrates dial-in and dial-out user communications. An access server may have a mixture of analog and digital interfaces and support hundreds of simultaneous users.
WAN switch-A multiport internetworking device used in carrier networks. These devices typically switch traffic such as Frame Relay, ATM, or X.25, and operate at the data link layer of the OSI reference model. Public switched telephone network (PSTN) switches may also be used within the cloud for circuit-switched connections like Integrated Services Digital Network (ISDN) or analog dialup.
Router-Provides internetworking and WAN access interface ports that are used to connect to the service provider network. These interfaces may be serial connections or other WAN interfaces. With some types of WAN interfaces, an external device such as a DSU/CSU or modem (analog, cable, or DSL) is required to connect the router to the local point of presence (POP) of the service provider.
Core router-A router that resides within the middle or backbone of the WAN rather than at its periphery. To fulfill this role, a router must be able to support multiple telecommunications interfaces of the highest speed in use in the WAN core, and it must be able to forward IP packets at full speed on all of those interfaces. The router must also support the routing protocols being used in the core.

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);
}