chapter 15: networks chapter 15 networks page 162 data communication networks are set up in two...

42
Chapter 15: Networks Chapter 15 Networks Page 1 Data communication networks are set up in two basic configurations. While this approach guarantees a direct connection between any pair of devices, the amount of cabling and I/O hardware required at each device makes it impractical in most situations. The alternative is to establish a broadcast network in which network lines are shared. Simple configurations associated with the broadcast approach include the ring and bus topologies, at left and right, respectively. The mesh configuration uses direct, point-to-point connections between each pair of communicating devices.

Upload: kendall-hellier

Post on 29-Mar-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15: Networks

Chapter 15Networks

Page 1

Data communication networks are set up in two basic configurations.

While this approach guarantees a direct connection between any pair of devices, the amount of cabling and I/O hardware required at each device makes it impractical in most situations.The alternative is to establish a broadcast network in which network lines are shared.

Simple configurations associated with the broadcast approach include the ring and bus topologies, at left and right, respectively.

The mesh configuration uses direct, point-to-point connections between each pair of communicating devices.

Page 2: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Local Area Networks

Chapter 15Networks

Page 2

LANs are privately owned networks containing perhaps dozens of devices.

Example: Ethernet

Computer

Bus Cable

ComputerComputerComputerComputer Computer

Ethernet uses a bus configuration and a protocol for accessing the bus called CSMA/CD.

• CS - Carrier Sense: Each machine constantly listens to the traffic that’s passing by on the bus.

• MA - Multiple Access: Every machine has equal access to the communication medium (i.e., the bus).• CD - Collision Detection: Each machine is capable of detecting whether its transmitted message “collided” with that of another machine, thus corrupting the message and forcing a retransmission.

Page 3: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Ethernet Carrier Sense: Incoming Traffic

Chapter 15Networks

Page 3

As messages pass by, each machine examines the first few bits of the message, the “address” of the message, and determines whether or not the message is intended for itself.

Computer

Bus Cable

ComputerComputerComputerComputer Computer

message

When the destination machine sees its address in the

message’s prefix, it copies the passing message as the

original proceeds down the bus.

message

message

Page 4: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Ethernet Carrier Sense: Outgoing Traffic

Chapter 15Networks

Page 4

When a machine wants to transmit a message, it waits a system-dependent amount of time, using its carrier sense to see if any traffic appears on the bus. If not, it transmits its message and “hopes” that no collision occurs.

Computer

Bus Cable

ComputerComputerComputerComputer Computer

When the transmitting machine detects no passing

traffic for a certain time interval, it places its message

on the bus.

message

Page 5: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Ethernet Carrier Sense: Colliding Traffic

Chapter 15Networks

Page 5

Computer

Bus Cable

ComputerComputerComputerComputer Computer

After a machine transmits a message, it continues to use its carrier sense to see if there’s any difference between its transmitted message and the message on the bus. If so, it interprets the problem as a collision.

When each transmitting machine detects that its

message has been corrupted, it waits a random

interval of time, and then retransmits.

Page 6: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

A LAN Alternative: Token Ring

Chapter 15Networks

Page 6

Computer

ComputerComputer

Computer Computer

Computer

Ring

Computer

ComputerComputer

Computer

Computer ComputerComputer

Collisions tend to exacerbate traffic problems on congested Ethernet LANs, so an alternative to the CSMA/CD approach is desirable.

Token Ring uses a ring topology, with a specially formatted “token” message perpetually traversing the ring.

TOKEN

message

TOKEN

message

message

When a machine wishes to transmit, it merely waits for the token to arrive, removes it, and transmits its message.When its message returns to the transmitting machine, it’s removed from the ring, and the machine places the token back on the ring.

Page 7: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Wide Area Networks

Chapter 15Networks

Page 7

WANs are large collections of smaller networks, with special interconnection devices known as “routers” to make adjacent sub-networks compatible.

Router

Router

Router

Router

RouterRouter

Page 8: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Switching

Chapter 15Networks

Page 8

Data communications is characterized by two switching technologies.

Technology #1: Circuit SwitchingOnce the circuit is

established, it is maintained until one of the endstations terminates the connection.

Page 9: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Problems with Circuit Switching

Chapter 15Networks

Page 9

Circuit switching has one great advantage: once established, the circuit is dedicated, i.e., a communication line is completely open until formally terminated.

• Many networked applications don’t require a dedicated circuit, so reserving a communication line until an endstation formally terminates it can represent a serious waste of resources.

However, this approach has a number of serious problems:

• The route originally selected for the circuit may be optimal to begin with, but may prove to be suboptimal as the communication continues.• An entire, end-to-end path must be found and reserved before any communication is allowed between the two endstations; this is definitely not conducive to many modern applications (e.g., Web surfing, videoconferencing).• Transmission errors are propagated all the way to the destination, requiring retransmission across the entire network.

Page 10: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

An Alternative to Circuit Switching

Chapter 15NetworksPage 10

Technology #2: Packet SwitchingThe source’s message is broken into manageable “packets”

that are transmitted to the destination individually, not necessarily along the same path.

Page 11: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

The Pros and Cons of Packet Switching

Chapter 15NetworksPage 11

Packet switching remedies circuit switching’s principal problems:• Lines aren’t dedicated, so

their utilization is higher.• Messages are “packetized”,

so line-sharing is reasonably fair.

• Routing may be dynamic, i.e., an alternate route may be chosen when traffic patterns change.

• The entire route does not have to be chosen prior to sending any data.

• Errors aren’t propagated end-to-end.

However, packet switching does have its own set of problems:• Switches must be programmed to make sophisticated

routing decisions.• Switches must manage memory for queued packets that

await forwarding.• Packets must be prefixed with control headers, increasing

overhead.• Endstations must deal with missing packets and out-of-

order packets.• Without a dedicated circuit, transmission times become

unpredictable.

Page 12: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 12

Frequency-Division MultiplexingThe spectrum of frequencies transmittable via the physical medium is divided into several channels (e.g., cable TV).

Time-Division MultiplexingEach transmitter is allocated a periodic time interval in which to transmit.

MultiplexingTo more efficiently utilize a physical medium, multiple higher-level connections might “share” the medium simultaneously.

Page 13: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 13

Code Division Multiplexing

Frequency Division

Multiplexing Everyone

gets to talk at the same

time, but only across their

narrow channels.

(Commonly used with

copper cables)

Time Division Multiplexing

Everyone gets to talk using

the entire bandwidth, but

they have to take turns

talking.(Commonly

user with fiber optics)

Code Division MultiplexingEveryone gets to talk simultaneously, using the entire bandwidth! They do this by coding their transmissions in a unique fashion (as if every pair were speaking a different language, and

each other language merely sounds like background noise).

(Commonly used with wireless communications)

Page 14: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 14

Modems

Cables between the workstation and the

modem and between the modem and the telephone jack

Digital data must be modulated into analog signals if it’s going to be transmitted across an analog medium.

After transmission, it must be demodulated back into its original digital form.

Dial-in pool of 96 modems:

Six terminal servers, each connecting 16 modems to a LAN

Page 15: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Network Protocol Layers

Chapter 15NetworksPage 15

Physical Medium

In an effort to simplify networks, they are often organized as layered hierarchies of protocols, with hardware-intensive protocols on the bottom and user applications at the top.

Layer 5

Layer 4

Layer 3

Layer 2

Layer 1

SourceHost

Layer 5

Layer 4

Layer 3

Layer 2

Layer 1

DestinationHost

Layer 4

Layer 3

Layer 2

Layer 1

IntermediateRouter

Layer 4

Layer 3

Layer 2

Layer 1

IntermediateRouter

Layer 2

Layer 1

Low-LevelBridge

Page 16: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Communicating Via Layered Protocols

Chapter 15NetworksPage 16

Consecutive network nodes only communicate directly at the lowest (hardware) layer; to communicate at higher layers, networking software inserts certain relevant data as headers and trailers to the message coming from the source. Layer 5

Layer 4

Layer 3

Layer 2

Layer 1

Layer 4

Layer 3

Layer 2

Layer 1

message

msgBhdr4hdr3

msgAhdr4hdr3

msgBhdr4hdr3 trl2hdr2hdr1 msgAhdr4hdr3 trl2hdr2hdr1

msgBhdr4hdr3

msgAhdr4hdr3

trl2

trl2

hdr2

hdr2

msgAhdr4hdr3

msgBhdr4hdr3

trl2

trl2

hdr2

hdr2

messagehdr4

msgAhdr4hdr3

msgBhdr4hdr3

messagehdr4

Page 17: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Layered Protocol Models

Chapter 15NetworksPage 17

Several models have been developed to implement protocol hierarchies for networks.Reference Model #1: Open Systems Interconnection (OSI)• End-user protocols, e.g., e-mail, file

transfer, Web browsing, network management, videoconferencing.

Application• Format data according to negotiations

between source and destination; encrypt and decrypt messages.

Presentation• Establish, maintain, and discontinue

dialogues between a source and a destination; synchronize data transfer.

Session• Detect and handle end-to-end

transmission errors; alter transmission rate when too much congestion is encountered.

Transport• Route messages from their source to

their destination; reroute traffic when heavy congestion is encountered.

Network• Detect and handle transmission errors

between consecutive network devices; control access to the shared medium.

Data Link• Transmit bits across physical medium;

determine frequencies to use when transmitting; specify role of connector pins.

Physical

Page 18: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 18

Reference Model #2: Transmission Control Protocol/Internet Protocol (TCP/IP)

•Analogous to OSI’s Application LayerApplication

•Analogous to OSI’s Transport LayerTCP

•Analogous to OSI’s Network LayerIP

•Analogous to OSI’s Physical and Data Link LayersLower Levels

Page 19: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 19

Version HdrLen Service Type

Flags Fragment Offset

Total Length

Identification

Protocol Header ChecksumTime To Live

Source IP Address

Destination IP Address

Options & Padding (if any)

The IP Header

Version: The version of IP used to create the packet, used by nodes to process it correctly.HdrLen: The length of the header in 32-bit words (because the Options field has no fixed size).Service Type: Six bits to represent the relative priority and delay sensitivity of the packet.

Flags: Don’t-Fragment flag and More-Fragments flag.

Time To Live: Length of time (in seconds) the packet may stay in the Internet.

Identification: All fragments of the same packet have the same ID number.

Version HdrLen Service Type

Flags Fragment Offset

Total Length

Identification

Total Length: The length of the entire packet in bytes (16-bit field means a 65,535-byte max).

Fragment Offset: Offset from start of packet (in bytes) of current fragment.

Protocol Header ChecksumTime To Live

Source IP Address

Destination IP Address

Options & Padding (if any)

Header Checksum: Error-checking sum of all of the 16-bit values in the header.

Destination IP Address: 32-bit IP address of the packet’s final destination.

Protocol: Global ID # of the protocol used to create the packet (e.g., TCP).

Source IP Address: 32-bit IP address of the packet’s original source.

Options & Padding: Options include: No-operation-just-align; Military-security-application; Loose-source-routing; Record-route; Strict-source-routing; Record-internet-timestamps.

Page 20: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 20

File Transfer Protocol (FTP)

Operating System

controlprocess

Client System

controlprocess

Server System

TCP/IP Internet

Operating System

One active TCP connection before and

after data transfer, just for control.

Operating System

datatransfer

controlprocess

Client System

controlprocess

datatransfer

Server System

TCP/IP Internet

Operating System

Two active TCP connections during

data transfer, one for control and one for

data.

Page 21: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 15NetworksPage 21

Firewalls

packetpacket packetpacket

My SecureNetwork

Outgoing packets for bad address/port combinations

are rejected (e.g., no insider can “http” an

external site).

Incoming or outgoing packets are rejected on the basis of size or payload info.

To ensure the security of a private network, “firewall” programs have been developed.

A common approach is to filter incoming and outgoing packets based upon header information, and to use an application gateway to inhibit application-specific traffic.

Incoming packets for bad address/port combinations

are rejected (e.g., no outsider can “finger” an

internal site).

Page 22: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16: The World Wide Web

Chapter 16The World Wide WebPage 22

Click on this piece of hypertext, and

you’re taken to...Type in a keyword and click the “Go!”

pushbutton, and you’re taken to...Click on this

pushbutton, and you’re taken to...

The World Wide Web applies point-and-click hypermedia application software to facilitate accessing documents on the Internet via TCP-based protocols.

And with additional downloaded software, elaborate Web sites that include more than text and simple images can be accessed.

Page 23: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 23

HyperText Transport Protocol

(HTTP)

<html><head><title>Welcome to IEEExpl</title></head> <body><table width="550" border="0" cellspacing="0" cellpadding="0" align="center"> <tr><td valign="top"> <p><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b> <font face="Verdana, Arial, Helvetica, sans-serif" size="3"><b> <font size="5" color="#3333CC"><img src="/images/subidinfmast_01.gif" width="550" height="39“ vspace="3" hspace="0" border="0" alt="IEEE xpl Subscription Access Information“ usemap="#Map"></font></b></font> <map name="Map"> <area shape="rect" coords="6,5,182,31" href="http://ieeexpl.ieee.org"> </map> </b></font></p> <br><table width=510 border=1 cellspacing=0 cellpadding=5 bordercolor=#CCCCCC align=center><tr><td> <font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#3333CC> <b>Your institution subscribes to:</b></font></td></tr><tr><td bgcolor=#E8E8E8><strong> <font size=2 face=Verdana>&nbsp;&nbsp;&nbsp;</font><font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#3333CC>&#149;<b></b></font><font size=2 face=Verdana> Search Xplore Database</font></strong></td></tr></table><br><table width=510 border=1 cellspacing=0 cellpadding=5 bordercolor=#CCCCCC align=center><tr><td> <font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#3333CC><b>Your institution subscribes to:</b> </font></td> </tr> <tr> <td bgcolor=#E8E8E8><strong><font size=2 face=Verdana>&nbsp;&nbsp;&nbsp; </font><font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#3333CC>&#149;<b> </b> </font><font size=2 face=Verdana>IEEE All Society Periodicals Package (ASPP) </font></strong></td> </tr> <tr> <td bgcolor=#FFFFFF> <blockquote> <blockquote> <p><font face=Verdana size=2><b><font color=#3333CC>Your online subscription includes access to the abstracts and full-text of IEEE journals, transactions, and magazines published since 1998:</font></b></font></p> <p><font size=2 face=Verdana>&nbsp;&nbsp;&nbsp;<font face=Verdana, Arial, Helvetica, sans-serif size=2 color=#3333CC><b>&#149;</b> </font> <a href=/xpl/ieeejrns.jsp?hr=1>IEEE journals, transactions, and magazines</a> </p> </blockquote> </blockquote> </td> </tr> </table><br><table width="500" border="0" cellspacing="0" cellpadding="0" align="center"><tr> <td> <p><font face="Verdana" size="2">In addtion to the above, you may purchase individual IEEE journal/magazine articles and conference papers that are not included in your institution's online subscription. If you want a copy of an article or paper, first check with your librarian for a copy available locally.</font></p> <p><font face="Verdana" size="2"><font color="#000000">Any questions? <a href="/xpl/techform.jsp">Contact IEEE Customer Service</a>.</font></font></p></td></tr></table><br><table width="500" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td valign="top"> <div align="right"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"><br><A href='javascript:window.close();'> <img src="/images/backbutton.gif" width="165" height="34" vspace="0" hspace="0" border="0" alt="Close this Window"></A> </font></div></td></tr></table></td></tr></table></body></html>

HTTP is the software defining the format of requests relayed from a Web browser to a Web server, as well as the replies relayed from the server to the browser.HTML (HyperText Markup Language) is the standard used to write Web pages; it doesn’t require specific formatting instructions, so two browsers may display a page differently.

Page 24: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 24

Extensible Markup Language (XML)Unlike HTML, XML allows users to include content-specific information in their files, facilitating its being formatted to suit various display devices.A job vacancy at the

department of Tourism is added to the job database.

XML technology stores the data separately

from the presentation, allowing for a variety

of platforms.

The vacancy is displayed on the job

center kiosk...

...can be accessed by mobile devices...

...and is displayed on the Department of

Tourism website.

Page 25: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 25

Uniform Resource Locators (URLs)A URL specifies three pieces of information: 1. Type of file transfer 2. Name of computer 3. Name of file

For example:

http://www.cs.siue.edu/undergrad/BS/files/prerequisites.pdf

1. http:// - type of file transfer 2. cs.siue.edu - name of the computer 3. /undergrad/BS/files/prerequisites.pdf - location of the file on the computer

Different types of file transfer: http:// - hypertext transfer

protocol ftp:// - file transfer protocol telnet:// - opens a telnet

session gopher:// - transfer file from a

gopher server mailto: - open a mail

session

Page 26: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 26

Network Interface

HTTPClient

FTPClient

BrowserController

Client software runningon the workstation

JavaInterpreter

HTMLInterpreter

Dis

pla

y D

river

Issuing requests for external files

Web Browsing

Input frommouse &keyboard

Communicationswith remoteWeb server

Output touser’sdisplay

InterpretingdownloadedWeb pagesand files

Page 27: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 27

Internet Search EnginesSearch engines use “spider” programs to “crawl” through the Web, building a list of words.

Some follow every link on every home page.

Some ignore links that lead to graphics, sound, or animation files, or to newsgroups.

Some concentrate primarily on the most popular Web pages.

Page 28: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 16The World Wide WebPage 28

Comparing Search Engines

91

60

2816 13 6

Searches Per Day (in millions)

GoogleYahooMSNAOLAskOther

Security IssuesRed = distribute adware, send

a high volume of spam, or make unauthorized changes

to a user's computer Yellow = send a high volume

of "non-spammy" email, display many popup ads, or

prompt a user to change browser settings

Share of Searches

Series1

0 1 2 3 4 5 6

1.9

3.6

2.3

1.4

1.8

1.5

1.8

1.9

1.5

1.7

Percentage of Search Results

Page 29: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17: Limitations of Computing

Chapter 17Limitations

of Computing

Page 29

What problems cannot be solved on a computer?

What problems cannot be solved on a computer in a “reasonable” amount of

time?These aren’t just philosophical questions; their answers will determine how practical it is to

pursue computer-based solutions to real-world problems like hurricane prediction, disease

control, and economic forecasting.

Page 30: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 30

ComputabilityTo examine the limits of what it is possible to do with a computer, Alan Turing (1912-1954) developed a simplified mathematical model, called a Turing machine.A Turing machine consists of three

parts:1) A tape of cells from which symbols can be read and into which symbols can be written,

2) A read/write head that moves back and forth across the tape, reading the symbol inside the current cell and/or writing a new symbol into the current cell, and3) A control unit that keeps track of what “state” the machine is in, and uses that state and the current symbol under the read/write head to:a) Determine which symbol to place in the

current cell,b) Determine whether to move the read/write head one cell to the left or right, andc) Determine the next state of the machine.

Tape

Read/Write Head

Control

Unit

Page 31: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 31

State Transition DiagramA state transition diagram may be used to define a Turing machine.Each // transition signifies reading on the tape, replacing it with , and then moving the read/write head in the direction.

The state transition diagram above defines a Turing machine that increments a binary number on the tape by one.

START

ADD

CARRY

NO CARRY

OVERFLOW

HALT

RETURN

*/*/L 1/0/L1/0/L

0/1/L0/1/L

0/0/L,1/1/L

*/1/L

*/*/R*/*/R

*/*/R

*/*/-0/0/R,1/1/R

* 1 0 1 *State:START

* 1 0 1 *State:ADD

* 1 0 0 *State:CARRY

* 1 1 0 *

State:NO

CARRY

* 1 1 0 *

State:NO

CARRY

* 1 1 0 *State:

RETURN

* 1 1 0 *State:RETURN

* 1 1 0 *State:RETURN

* 1 1 0 *State:RETURN

* 1 1 0 *State:HALT

Page 32: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 32

The Church-Turing ThesisComputer scientists commonly accept the Church-Turing Thesis, which states that the set of functions that can be calculated on a computer is exactly the same as the set of functions for which a Turing machine can be devised.There are problems that have been proven to be non-computable (i.e., no Turing machine can be devised to calculate their solutions).

The Halting Problem

Given a program with a set of input values,

does the program halt on that input, or does it get stuck in

an infinite loop?

One classical example:

Page 33: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 33

ComplexityThe time complexity of an algorithm is a measure of how many steps are executed when the associated program is run.void printA(){ cout << 0 << endl; cout << 0 << endl; cout << 0 << endl; cout << 0 << endl;}

void printB(){ int i; for (i = 1; i <= 100; i++) cout << 0 << endl;}

void printC(int n){ int i; for (i = 1; i <= n; i++) cout << 0 << endl;}

void printD(int n){ int i,j; for (i = 1; i <= n; i++) for (j = 1; j <= n; j++) cout << 0 << endl;}

Number of Output Statements Executed: 4

Time Complexity: O(1)

Number of Output Statements Executed: 100

Time Complexity: O(1)

Number of Output Statements Executed: n

Time Complexity: O(n)

Number of Output Statements Executed: n2

Time Complexity: O(n2)

The “big-O” notation provides information

regarding the program’s “order of complexity”.O(1) indicates that the

execution time doesn’t relate to the size of the number n.

O(n) indicates that the execution time increases linearly as n increases.O(n2) indicates that the

execution time increases quadratically as n increases.

Page 34: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 34

Logarithmic/Polynomial/ExponentialAn algorithm is said to have logarithmic time complexity if the number of steps in its execution is bounded by some logarithmic function:

k log2(n)

Essentially, this means that doubling the size of the problem (n) would only increase the execution time by a constant amount (k).An algorithm is said to have polynomial time complexity if the number of steps in its execution is bounded by some polynomial function:

aknk+ak-1nk-1+…+a2n2+a1n+a0An algorithm is said to have exponential time complexity if the number of steps in its execution is bounded by some exponential function:

k(2n)Essentially, this means that increasing the size of the problem (n) by one would double the execution time.log2(n) n n2 n3 2n

2 5 25 125 31

3 10 100 1000 1024

4 20 400 8000 1048576

Page 35: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 35

Big-OAn algorithm’s time complexity is dominated by its most significant term.

For example, an algorithm that executes in time n2+10n is considered to be O(n2) because, as n increases, the n2 term ultimately dominates the n term.

Additional examples:

5n + n2 + 0.125n3 is O(n3)

log2(n) + n2 + 2n is O(2n)

100n + max(n2, 1000 - n3) is O(n2)

n3 - ⅞(n3 - 80n2 - 800n) is O(n3)

1000000 + 0.000001log2(n) is O(log2(n))

Page 36: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 36

P and NP ProblemsA problem is said to be a P problem if it can be solved with a deterministic, polynomial-time algorithm. (Deterministic algorithms have each step clearly specified.)A problem is said to be an NP problem if it can be solved with a nondeterministic, polynomial-time algorithm.In essence, at a critical point in the NP problem’s algorithm, a decision must be made, and it is assumed that some magical “choice” function (also called an oracle) always chooses correctly.For example, take the Satisfiability Problem:Given a set of n boolean variables b1, b2, … bn, and a boolean function f (b1, b2, …, bn), are there any values that can be assigned to the variables so the function value will evaluate to TRUE?To try every combination of boolean values would take exponential time, but the nondeterministic solution at right has polynomial time complexity.

for (i = 1; i <= n; i++) bi = choice(true, false);if (f(b1, b2,…, bn) == true) satisfiable = true;else satisfiable = false;

Page 37: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Chapter 17Limitations

of Computing

Page 37

The Knapsack ProblemThe Knapsack Problem involves taking n valuable jewels J1, J2,…,Jn, with respective weights w1, w2,…, wn, and prices p1, p2,…, pn, and placing some of them in a knapsack that is capable of supporting a combined weight of M.

The problem is to pack the maximum worth of gems without exceeding the capacity of the knapsack.

(It’s not as easy as it sounds; three lightweight $1000 gems might be preferable to one heavy $2500 gem, and one 20-pound gem worth a lot of money might be preferable to twelve 1-pound gems that are practically worthless.)

A Nondeterministic Polynomial Solution:

TotalWorth = 0;TotalWeight = 0;for (i = 1; i <= n; i++){ bi = choice(true, false); if (b1 == true) { TotalWorth+= pi; TotalWeight += wi; }}if (TotalWeight <= M) cout << “Woo-hoo!” << endl;else cout << “Doh!” << endl;

Page 38: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Supplement: Computer Ethics

SupplementComputer

EthicsPage 38

How dependable is computer technology?

In 1994, Intel’s new Pentium processor was determined to have a flaw…

4195835–(4195835*3145727)/3145727 = 256

The Problem: Five values were left out of a table of 1,066 on the chip. Those five values were looked up when certain divisions were performed and, since they weren’t there, the values were interpreted as zeros.

The Response: Initially denying that there was any error at all, Intel ultimately offered to replace customers’ chips with corrected versions. The Reaction: Intel’s competitors condemned Intel, but all of the press Intel received, while negative, turned it into a household name.

Page 39: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Unsolicited Commercial E-Mail

SupplementComputer

EthicsPage 39

BlacklistsOne very effective technique for blocking spam is to maintain a blacklist of spam sources, and to refuse all e-mail from those sources.

The problem: Aggressive blacklist policies might list sources that send legitimate e-mail as well as spam.

Various techniques have been developed for dealing with the “spam” that plagues people’s e-mail accounts.

WhitelistsInstead of trying to block spam while allowing everything else, whitelist software blocks everything except messages from already known, accepted senders, thus changing e-mail from an open system to a closed one.

Whitelists typically allow e-mail from everyone in a user's existing address book. Other, unknown senders receive an automated reply, asking them to take further action, such as explain who they are. Or senders may be asked to identify a partially obscured image of a word. A person can make out the word, but automated spammer software can't. 

Page 40: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Identity Theft

SupplementComputer

EthicsPage 40

Rank

Victim State

Victims per

100,000 Populati

on

Number of

Victims

1 Arizona 147.8 9,113

2 Nevada 120.0 2,994

3 California 113.5 41,396

4 Texas 110.6 26,006

5 Florida 98.3 17,780

6 Colorado 92.5 4,395

7 Georgia 86.3 8,084

8 New York 85.2 16,452

9 Washington 83.4 5,336

10 New Mexico 82.9 1,621

11 Maryland 82.9 4,656

12 Illinois 78.6 10.080

13 Oregon 76.1 2,815

14 New Jersey 73.3 6,394

15 Virginia 67.2 5,137

16 Michigan 67.2 6,784

17 Delaware 66.7 569

18 Connecticut 65.8 2,305

19 Pennsylvania 64.9 8,080

20 North Carolina 64.9 5,748

21 Missouri 64.2 3,753

22 Massachusetts 63.7 4,102

23 Oklahoma 63.0 2,254

24 Indiana 62.2 3,928

25 Utah 61.8 1,577

Rank

Victim State

Victims per

100,000 Populati

on

Number of

Victims

26 Tennessee 61.3 3,700

27 Alabama 60.3 2.774

28 Ohio 59.9 6,878

29 Kansas 58.8 1,626

30 Rhode Island 57.6 615

31 Alaska 57.3 384

32 South Carolina 55.7 2,408

33 Minnesota 55.6 2,872

34 Arkansas 54.7 1,537

35 Louisiana 52.6 2,256

36 Mississippi 51.3 1,494

37 Nebraska 49.1 868

38 Idaho 49.0 718

39 Hawaii 47.8 615

40 New Hampshire 46.1 606

41 Montana 45.9 434

42 Wisconsin 45.6 2,536

43 Wyoming 42.3 218

44 Kentucky 42.0 1,766

45 Maine 39.7 525

46 West Virginia 39.3 715

47 Iowa 34.9 1,041

48 South Dakota 30.2 236

49 North Dakota 29.7 189

50 Vermont 28.5 178

Technological advances in recent years have facilitated the ability of criminals to obtain personal information about people and to unlawfully gain access to their financial accounts.

* 2006 FTC Statistics

Page 41: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

Electronic Monitoring

SupplementComputer

EthicsPage 41

To combat employee “cyberslacking”, employers are increasing making use of monitoring software that records how employees are using their office communication capabilities.

Legally, the courts have consistently defended the right of employers to monitor telephone conversations, voice-mail messages, e-mail, and Web browsing of employees using employer-provided equipment.

Page 42: Chapter 15: Networks Chapter 15 Networks Page 162 Data communication networks are set up in two basic configurations. While this approach guarantees a

E-Waste

SupplementComputer

EthicsPage 42

E-waste represents 2% of America's trash in landfills, but it equals 70% of overall toxic waste. The extreme amount of lead in electronics alone causes damage in the central and peripheral nervous systems, the blood and the kidneys.

Electronic items that are considered to be hazardous include, but are not limited to:

•Televisions and computer monitors that contain cathode ray tubes •LCD desktop monitors •Laptop computers with LCD displays •LCD televisions •Plasma televisions •Portable DVD players with LCD screens.