ch2

265
1 COM 360

Upload: amareshpatil

Post on 31-Oct-2014

5 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ch2

1

COM 360

Page 2: ch2

2

Chapter 2

Direct Link Networks

Page 3: ch2

3

Network Technologies

1. Point-to-Point Links

2. Carrier Sense Multiple Access ( CSMA) – (for example the Ethernet)

3. Token Rings – (for example IEEE 802.5 and FDDI Fiber Distributed Data Interface)

4. Wireless – (for which 802.11 is the emerging standard)

Page 4: ch2

4

ProblemsConnecting computers is a first step.

There are additional problems to solve before they can exchange packets:

• Encoding bits into the transmission medium

• Framing the bits so they can be understood

• Error detection

• Reliable delivery, in spite of occasional errors

• Media access control

Page 5: ch2

5

Hardware Building Blocks

• Networks are constructed from nodes and links• Nodes are general purpose computers such

as workstations, multiprocessors or PCs as well as special purpose switches, routers.– Memory – finite – must be managed– Network Adapter (NIC) and its device driver

• Links implemented on physical media, such as twisted pair, coaxial cable, optical fiber

Page 6: ch2

6

Nodes

I/O bus

(To network)

CPU

Memory

NetworkadaptorCache

Example workstation architecture

Page 7: ch2

7

•The work station’s adaptor component connects the rest of the work stations to link.

•More then just a physical connection , it is an active intermediary between node and link with its own internal processor.

•Its role is to transmit data from the work station on to the link and receiver data from the link, storing it for the workstation.

Page 8: ch2

8

Network Adaptor

A network adaptor can be thought of as having two main components.

•A BUS Interface•A Link Interface

Page 9: ch2

9

Network Adaptor

•A BUS InterfaceA bus interface that understands how to communicate with host.

•A Link InterfaceA link Interface that understands how to use link.

Page 10: ch2

10

Network Adaptor

•The adaptor exports a Control Status Register(CSR) that is readable and writeable from CPU.

•The CSR is typically located at some address in the memory, thereby making it possible for CPU to read /write just like any other memory location.

Page 11: ch2

11

Network Adaptor

•S/W on the host – A Device driver – writes to the CSR to instruct it to transmit and/or receive data and reads from the CSR to learn the current status from the CRS.•Notifications• Reception of a FRAME.• The adaptor interrupts the host.

Page 12: ch2

12

Block Diagram of a Network Adaptor

Adaptor

Network linkBus

interfaceLink

interface

Page 13: ch2

13

Interrupts• The host only pays attention to the network

device when the adaptor interrupts the host, (for example, when a frame has been transmitted or one arrives).

• A procedure is invoked by the operating system, and an interrupt handler is invoked to take the appropriate action.

• While servicing this interrupt, the OS disables other interrupts.

Page 14: ch2

Network Adaptor

• There are TWO basic mechanisms

1.Direct Memory Access(DMA)

2.Programming I/O (PIO)

14

Page 15: ch2

15

Direct Memory Access vs. Programmed I/O

• There are two ways to transfer the bytes from the frame between the adaptor and host memory:

• Direct Memory Access (DMA)- the NIC directly reads/writes to the host’s memory without CPU involvement, using a pair of buffer descriptor lists.

• Programmed I/O (PIO)- network adaptor (NIC) copies message into its own buffer, until CPU can copy it into the host memory.

Page 16: ch2

16

Programmed I/O

Host

Adaptor Memory

CPU

Memory

Memory

Page 17: ch2

17

Links• Physical media are used to propagate

signals as electromagnetic waves, traveling at the speed of light.

• Properties of EM waves:– Frequency- or oscillations, measured in hertz– Wavelength – distance between adjacent

maxima and minima, measured in meters

Page 18: ch2

18

Electromagnetic Waves

• Wavelength = speed / frequency• Voice grade phone lines carry waves ranging

from 300 Hz to 3300 Hz• Voice-grade example: 300Hz in copper wire• Wavelength = Speed in Copper/ Frequency

= 2/3 x 3 x 108 /300 = 667 x 103 meters

Page 19: ch2

19

Electromagnetic Spectrum

Radio Infrared UVMicrowave

f(Hz)

FM

Coax

Satellite

TV

AM Terrestrial microwave

Fiber optics

X ray

100

104 105 106 107 108 109 1010 1011 1012 1013 1014 1015 1016

102 106 108 1010 1012 1014 1016 1018 1020 1022 1024104

Gamma ray

Page 20: ch2

20

Links

• A link is a physical medium carrying signals in the form of electromagnetic waves.

• Binary data is encoded in the signal.– Lower layer is concerned with modulation,

varying the frequency, amplitude or phase of the signal

– Upper layer is concerned with encoding the data

Page 21: ch2

21

Link Attributes

• Another link attribute is how many bit streams can be encoded on it, at a given time.

• One bit stream- connected nodes share access

• Point-to-point – often two bit streams at once– Full duplex - two directions – simultaneously – Half duplex – one direction at a time – Simplex – one direction

Page 22: ch2

22

Cables

• Type of cable depends on technology

• Coaxial – ( thick and thin) – within buildings

• Category 5 ( CAT 5) – twisted pair, thicker gauge than telephone wire

• Fiber –plastic or most often glass, more expensive, but used to connect buildings, and transmits light instead of electrical waves.

Page 23: ch2

7.23

Figure 7.3 Twisted-pair cable

Page 24: ch2

7.24

Figure 7.4 UTP and STP cables

Page 25: ch2

7.25

Table 7.1 Categories of unshielded twisted-pair cables

Page 26: ch2

7.26

Figure 7.5 UTP connector

Page 27: ch2

7.27

Figure 7.7 Coaxial cable

Page 28: ch2

7.28

Table 7.2 Categories of coaxial cables

Page 29: ch2

7.29

Figure 7.8 BNC connectors

Page 30: ch2

7.30

Figure 7.10 Bending of light ray

Page 31: ch2

7.31

Figure 7.11 Optical fiber

Page 32: ch2

7.32

Figure 7.12 Propagation modes

Page 33: ch2

7.33

Figure 7.13 Modes

Page 34: ch2

7.34

Figure 7.14 Fiber construction

Page 35: ch2

7.35

Figure 7.15 Fiber-optic cable connectors

Page 36: ch2

36

Local Link CablesCable Typical

BandwidthDistances

Cat 5 twisted pair

10-100 Mbps 100 m

Thin-net coax 10-100 Mbps 200 m

Thick-net coax 10-100 Mbps 500 m

Multimode fiber

100 Mbps 2 km

Single-mode fiber

100- 240 Mbps 40 km

Page 37: ch2

37

Leased Lines

• To connect nodes on opposite sides of the country, or at great distances, you must lease a dedicated line from the telephone company.

• DS1, DS3, T1, and T3 are relatively old technologies, defined for copper

• STS-N links are for optical fiber (Synchronous Transport Signal), also called OC-N for Optical Carrier

• Originally designed for voice, today can carry data, voice and video

Page 38: ch2

38

Common Bandwidths

Services Bandwidth

DS1 or T1 1.544 Mbps

DS3 or T3 44.736 Mbps

STS-1 51.840 Mbps

STS-3 155.250 Mbps

STS-12 622.080 Mbps

STS-48 2488320 Gbps

STS-192 155.250 Mbps

Page 39: ch2

39

Last-Mile links• Leased lines range in price from $1000/month to “don’t

ask”• Last mile links span the last mile from the network

service provider to the home or office.• Conventional modem- POTS (plain old telephone

service)• ISDN – (Integrated Services Digital Network) – uses

CODEC ( coder/decoder) to encode analog to digital signal

• xDSL (Digital Subscriber Line)• Cable modem- uses cable television (CATV)

infrastructure, available to 95% of US households

Page 40: ch2

40

Common Available ServicesServices Bandwidth

POTS 28.8 - 56 Kbps

ISDN 64 – 128 Kbps

xDSL 16 Kbps – 52.2 Mbps

CATV 20 –40 Mbps

Page 41: ch2

TELEPHONE NETWORKTELEPHONE NETWORK

41

Telephone networks use circuit switching. Telephone networks use circuit switching. The telephone network had its beginnings The telephone network had its beginnings in the late 1800s. The entire network, in the late 1800s. The entire network, which is referred to as the which is referred to as the plain old plain old telephone systemtelephone system ( (POTSPOTS), was originally ), was originally an analog system using analog signals to an analog system using analog signals to transmit voice.transmit voice.

Page 42: ch2

9.42

Figure 9.1 A telephone system

Endoffices

Local loop

Trunk

Tandemoffices Regional offices

Trunk

• • •

Page 43: ch2

9.43

DIGITAL SUBSCRIBER LINEDIGITAL SUBSCRIBER LINE

After traditional modems reached their After traditional modems reached their peak data rate, telephone companies peak data rate, telephone companies developed another technology, DSL, to developed another technology, DSL, to provide higher-speed access to the provide higher-speed access to the Internet. Internet. Digital subscriber lineDigital subscriber line ( (DSLDSL) ) technology is one of the most promising technology is one of the most promising for supporting high-speed digital for supporting high-speed digital communication over the existing local communication over the existing local loops. loops.

Page 44: ch2

44

xDSL

• Collection of technologies, able to transmit data at high speeds over standard twisted pair lines

• ASDL ( Asymmetric Digital Subscriber Line)- different speeds in different directions (upstream and downstream) – called local loop

• VDSL- (Very high rate Digital Subscriber Line)- runs over shorter distances – “fiber to neighborhood”

Page 45: ch2

9.45

ADSL is an asymmetric communication technology designed for residential users; it is not suitable for businesses.

Note

The existing local loops can handle bandwidths up to 1.1 MHz.

Page 46: ch2

9.46

•ADSL is an adaptive technology. •The system uses a data rate based on the condition of the local loop line.• Bit rate is the number of bits per second.• Baud rate is the number of signalelements per second.

Note

Page 47: ch2

9.47

Figure 9.11 Bandwidth division in ADSL

Page 48: ch2

9.48

Figure 9.12 ADSL modem

Page 49: ch2

9.49

Figure 9.13 DSLAM

Page 50: ch2

50

ADSL

1.554─ 8.448 Mbps

16─ 640 Kbps

Local loop

Centraloffice

Subscriberpremises

downstream

upstream

ADSL connects the subscriber to the central office via the local loop.

Page 51: ch2

51

VDSL•Very High-bit-rate Digital Subscriber Line similar to ADSL uses coaxial, fiber- optic, or twisted-pair cable for short distance.•It provides a range of bit rate 25 to 55 Mbps for up stream communication at a distance of 3000 to 10,000 ft.•The down stream rate is normally 3.2mbps

Page 52: ch2

52

VDSL

STS-N

over fiber

VDSL at 12.96─ 55.2 Mbps

over 1000─ 4500 feet of copperCentraloffice

Subscriberpremises

Neighborhood opticalnetwork unit

VDSL connects the subscriber to the optical network that reaches the neighborhood.

Page 53: ch2

9.53

ISDNISDN

•Integrated Services Digital Network(ISDN)Integrated Services Digital Network(ISDN)•An ISDN connection two 64-kbps channels, An ISDN connection two 64-kbps channels, one that can be used to transmit data and one that can be used to transmit data and another that can be used for digitized voice.another that can be used for digitized voice.•A device that encodes analog voice into a A device that encodes analog voice into a digital ISDN link is called CODEC, for digital ISDN link is called CODEC, for coder/decoder.coder/decoder.•When the voice channel is not in use, it can When the voice channel is not in use, it can be combined with the data channel to be combined with the data channel to support up to 128 Kbps of data bandwidth.support up to 128 Kbps of data bandwidth.

Page 54: ch2

9.54

CABLE TVCABLE TV

Cable companies are now competing with Cable companies are now competing with telephone companies for the residential telephone companies for the residential customer who wants high-speed data customer who wants high-speed data transfer. transfer.

Page 55: ch2

55

CATV• A subset of CATV channels are made available for

transmitting digital data• A single CATV channel has a bandwidth of 6 MHz• Like ADSL, CATV is asymmetric with

downstream rates much greater than upstream– 40 Mbps downstream ( 100 Mbps max)– 20 Mbps upstream ( roughly half as much)

• Unlike DSL, bandwidth is shared among all subscribers in a neighborhood.

Page 56: ch2

9.56

Figure 9.16 Division of coaxial cable band by CATV

Page 57: ch2

9.57

The theoretical downstream data rateis 30 Mbps.

Note

Page 58: ch2

9.58

The theoretical upstream data rate is 12 Mbps.

Note

Page 59: ch2

9.59

Figure 9.17 Cable modem (CM)

Page 60: ch2

9.60

Figure 9.18 Cable modem transmission system (CMTS)

Page 61: ch2

61

Shannon’s Theorem• Shannon’s theorem gives an upper bound to the

capacity of a link, in terms of bits per second.

C = B log2 (1+S/N)

where C is channel capacity, B is Bandwidth, S is signal power, N is noise and S/N is the signal to noise ratio expressed in decibels, related as:

dB= 10 x log10 (S/N)

Page 62: ch2

62

Shannon’s TheoremExample

• dB ratio pf 30 dB• S/N = 1000• Bandwidth = 3000Hz

C = B x log2 ( 1+S/N)C = 3000 x log2 (1001)C = 30 Kbps = roughly the limit of a 28.8

modemHow are 56 Kbps modems possible? See p. 76

Page 63: ch2

3.63

Consider an extremely noisy channel in which the value of the signal-to-noise ratio is almost zero. In other words, the noise is so strong that the signal is faint. For this channel the capacity C is calculated as

Example

Page 64: ch2

64

This means that the capacity of this channel is zero regardless of the bandwidth. In other words, we cannot receive any data through this channel.

Page 65: ch2

3.65

We can calculate the theoretical highest bit rate of a regular telephone line. A telephone line normally has a bandwidth of 3000. The signal-to-noise ratio is usually 3162. For this channel the capacity is calculated as

Example

Page 66: ch2

66

This means that the highest bit rate for a telephone line is 34.860 kbps. If we want to send data faster than this, we can either increase the bandwidth of the line or improve the signal-to-noise ratio.

Page 67: ch2

3.67

Consider an extremely noisy channel in which the value of the signal-to-noise ratio is almost zero. In other words, the noise is so strong that the signal is faint. For this channel the capacity C is calculated as

Example

Page 68: ch2

68

This means that the capacity of this channel is zero regardless of the bandwidth. In other words, we cannot receive any data through this channel.

Page 69: ch2

3.69

The signal-to-noise ratio is often given in decibels. Assume that SNRdB = 36 and the channel bandwidth is 2 MHz. The theoretical channel capacity can be calculated as

Example

Page 70: ch2

70

Page 71: ch2

71

We have a channel with a 1-MHz bandwidth. The SNR for this channel is 63. What is the theoretical channel capacity?

SolutionFirst, we use the Shannon formula to find the upper limit.

Page 72: ch2

3.72

Example 3.41

Page 73: ch2

73

Wireless Links

• AMPS- Advance Mobile Phone System- standard for cellular phones

• PCS- Personal communication Services – digital cellular services in US and Canada

• GSM- Global System for Mobile Communication in the rest of the world.

• They use a system of towers to transmit signals and are moving toward ringing the globe with satellites.

Page 74: ch2

74

Local Wireless Links• Radio and infrared portions of the spectrum can

be used over short distances.• Technology- limited to in-building environments• Radio bands at 5.2 GHz and 17 GHz are

allocated to HIPPERLAN in Europe and 2.4 GHz for use with the IEEE 802.11 standard, which supports data rates up to 54 Mbps.

• Bluetooth – radio, operates in the 2.45 GHz band– Used for all devices, printers, PDAs, phones– Networks of these devices are called piconets

Page 75: ch2

75

Bit Rates and Baud Rates

• Rate at which the signal changes is called the baud rate.

• When one bit is transmitted on a signal, the bit rate and baud rate may be equal.

• Often multiple bits are encoded onto a signal, where for example with 4 bits per signal, the baud rate may be 4 times the bit rate

Page 76: ch2

4.76

Figure 4.2 Signal element versus data element

Page 77: ch2

4.77

A signal is carrying data in which one data element is encoded as one signal element ( r = 1). If the bit rate is 100 kbps, what is the average value of the baud rate if c is between 0 and 1?Solution

We assume that the average value of c is 1/2 . The baud rate is then

Example

Page 78: ch2

78

Encoding• First step in turning nodes and links into usable

building blocks is to understand how to connect them so that bits can be transmitted.

• Next encode binary data that the source want to send into signals that the links can carry and then decode the data back into the corresponding data at the receiving end.

• The high and low signals correspond to 2 different voltages on a copper based system or 2 different power levels on an optical link.

Page 79: ch2

4.79

Line coding and decoding

Page 80: ch2

80

NRZ Encoding• NRZ – non-return to zero, maps the data value 1 to the

high signal and 0 to the low signal• A sequence of several consecutive 1’s means that the

signal stays high for a prolonged period of time.• Two fundamental problems;

– Baseline wander –makes it difficult to detect a significant change in the signal

– Clock recovery needs frequent changes from high to low to be enabled

• Sender and receiver clock must be precisely synchronized.

Page 81: ch2

81

NRZ Encoding

Bits

NRZ

0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0

Page 82: ch2

82

NRZI Encoding

• NRZI – non-return to zero inverted, addresses the previous problem, by having the sender make a transition from the current signal to encode a 1 and stay at current signal to encode a 0. ( Solves the problem of consecutive 1’s, but not 0’s)

Page 83: ch2

83

Manchester Encoding• Merges the clock with the signal by transmitting the

exclusive–OR of the NRZ encoded data.• Results in 0 being encoded as a low-to-high transition

and 1 encoded as a high-to-low transition. Because both 0s and 1 result in a transition, the clock can be recovered at the receiver.

• Problem: doubles the rate at which transitions are made on the link, which gives receiver half the time to detect them.

Page 84: ch2

84

Encoding Strategies

Bits

NRZ

Clock

Manchester

NRZI

0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0

Page 85: ch2

85

4B/5B Encoding

• Attempts to address the inefficiency of Manchester encoding.

• It inserts extra bits into the bit stream to break up long sequences of 0s and 1s:

– Every 4 bits of data are encoded in a 5 bit code

(See table 4B/5B encoding on p. 79)

Page 86: ch2

86

4B/5B Encoding

• The 5-bit codes are selected in such a why that each one has no more than one leading 0 and no more than two trailing 0s.

• No pair 5-bit codes results in more three consecutive 0s being transmitted.

• the resulting 5-bit codes are then transmitted using the NRZI encoding

Page 87: ch2

87

4B/5B Encoding

• 5bits are enough to encode 32 different codes ad we are using only 16 of these data.

• Of these code 11111 is used when line is Idle.

• Code 00000 is used when the line is dead.

• 00100 is interpreted to mean halt.

• Of the remaining 13 codes 7 of them are not valid because they violate the “one leading 0’ , “two trailing 0s”

Page 88: ch2

4.88

4B/5B mapping codes

Page 89: ch2

89

Packets and Frames

  Packet is ``generic'' term that refers to a small block of data.

  Each hardware technology uses a different packet format.

  Frame or hardware frame denotes a packet of a specific format used on a specific hardware technology.

Page 90: ch2

11.90

FRAMINGFRAMING

The data link layer needs to pack bits into The data link layer needs to pack bits into framesframes, so that each frame is , so that each frame is distinguishable from another. Our postal distinguishable from another. Our postal system practices a type of framing. The system practices a type of framing. The simple act of inserting a letter into an simple act of inserting a letter into an envelope separates one piece of envelope separates one piece of information from another; the envelope information from another; the envelope serves as the delimiter. serves as the delimiter.

Page 91: ch2

91

Framing• Blocks of data (frames), not bit streams, are

exchanged between nodes.

• The network adapter (NIC) enables the nodes to exchange frames.

• Recognizing what set of bits constitutes a frame, and where the frame begins and ends, is the challenge faced by the network adapter.

Page 92: ch2

92

Frame Format   Need to define a standard format for data

to indicate the beginning and end of the frame

   Header and trailer used to ``frame'' the data (SOH and EOT)

  Can choose two unused data values for framing for example, if data is limited to printable ASCII characters, you can use

  ``start of header'' (soh)  ``end of text'' (eot)

Page 93: ch2

93

Frame Format

• Framing in Practice

  Incurs extra overhead - soh and eot take time to transmit, but carry no data

  Accommodates transmission problems:

  Missing eot indicates sending computer crashed

  Missing soh indicates receiving computer missed beginning of message

  Bad frame is discarded

Page 94: ch2

94

Frame Format

Page 95: ch2

95

Framing

• Suppose A wishes to transmit a frame to B

• It tells adapter to transmit a frame from the node’s memory

• A sequence of bits is sent over the link

• The adapter on B then collects the sequence of bits arriving on the link and deposits them in B’s memory.

Page 96: ch2

96

Framing

Frames

Bits

Node A Node BAdaptor Adaptor

Bits flow between adaptors, frames between hosts

Page 97: ch2

97

Framing

• There are several approaches to the framing problem:

• Byte-Oriented Protocol (PPP)– Sentinel Approach (frame start and end)– Byte counting

• Bit –Oriented Approach (HDLC)

• Clock-based framing (SONET)

Page 98: ch2

11.98

A frame in a character-oriented protocol

Page 99: ch2

99

Byte-Oriented protocols• One of the oldest approaches to framing is to view each

frame as a collection of bytes (characters) rather than bits.

• BISYNC (Binary Synchronous Communication) protocol is a byte-oriented approach developed by IBM in 1960’s

• DDCMP ( Digital Data Communication Message Protocol) was used in Digital Equipment’s DECNET.

• These are examples of the sentinel approach and the byte counting approach.

Page 100: ch2

100

Sentinel Approach• A packet is a sequence of labeled fields.• Above each field is a number indicating the number of

bits in the field.• Packets are transmitted beginning with the leftmost

field. The beginning of the frame is the SYN (synchronization) character.

• Data is contained between sentinel characters – STX (start of text) and ETX (end of text).

• The header begins with a SOH (start of header) field.• It ends with a CRC (cyclic redundancy check) field.

Page 101: ch2

101

BISYNC Frame Format

Header Body

8 8 8 8 168

CRC

Page 102: ch2

102

Framing problem• ETX character may appear in the data.

• BISYNC overcomes this by using byte-stuffing or character-stuffing by preceding the ETX character with an escape character or DLE (data link escape– (similar to \n or \t in programming)

• CRC (cyclic redundancy check) is used to detect transmission errors.

Page 103: ch2

103

Point-To-Point Connection

 The first computer communication systems were connected by communication channels that connected exactly two computers.

 Called a mesh or point-to-point network

 Had three useful properties:– 1. Each connection was independent and different hardware could be

used. (bandwidth, modems, etc. did not have to be the same)• Allow for greater flexibility.

– 2.  The connected computers have exclusive access and could decide how to send data across the connection. The can determine the frame format and size, error detection mechanism, etc.

– 3.  Since only two computers share the channel it is private and secure.

Page 104: ch2

104

Disadvantages of Point-To-Point

• 1.  Number of wires grows as the number of computers increases

• 2.  The total number of connections exceeds the number of computers being connected.

• The number of connections needed is proportional to the square of the number of computers, since the new computer must have a connection to each of the existing computers. So to add the Nth computer requires N-1 new connections.

Page 105: ch2

105

Disadvantages of Point-To-Point• For N computers: • Connections = (N2 - N)

  2

Computers Connections

2 1

3 3

4 6

5 10

Page 106: ch2

106

Point-to-Point Protocol

• Point-to-Point Protocol (PPP) is run over dialup modem links and is similar to BISYNC.

• Flag denotes the start-of-text character, address and control fields contain default values.

• The protocol is the high level protocol, such as IP or IPX.

• Payload size is usually 1500 bytes.• Checksum field is either 2 or 4 bytes long.

Page 107: ch2

107

PPP Frame Format

ProtocolControlAddressFlag Payload

88 816168

FlagChecksum

Page 108: ch2

108

PPP Framing• PPP framing is unusual in that several of the field

sizes are negotiable rather than fixed.• The negotiation is conducted by the LCP (Link

Control Protocol) Protocol.• PPP and LCP work in tandem:

– LCP sends control messages encapsulated in PPP frames denoted by an LCP identifier

– Changes PP’s frame format based on the information contained in the control messages.

– LCP also establishes a link between the peers when both sides detect the carrier signal.

Page 109: ch2

109

Byte-Counting Approach

• The alternative to detecting the end of a file with a sentinel value is to include the number of items in the file at its beginning.

• This is true in framing- the number of bytes in a frame can be included in the header.

• DDCMP protocol uses this approach and the COUNT field specifies the number of bytes in the frame’s body.

Page 110: ch2

110

DDCMP Frame Format

Header Body

8 8 4214 168

CRCCount

Tree types of messages:•DATA Message ( 81 )•Control messages ( 05)•Maintenance ( 90)

Page 111: ch2

111

Framing Errors

• A transmission error could corrupt the COUNT field and the end of the frame would be incorrectly detected.

• A similar problem exists with the ETX field being corrupt.

• This is called a framing error.• The receiver waits for the next SYN character to

collect data for the next frame. • A framing error may cause back-to-back frames to

be incorrectly received.

Page 112: ch2

112

Bit-Oriented Protocols

• Bit-oriented protocols are not concerned with byte boundaries. It views the frame as a collection of bits.

• Synchronous Data Link Control ( SDLC), developed by IBM is a bit-oriented protocol, later standardized as the High Level Data Link Control (HDLC).

• Uses bit sequence 01111110 to denote beginning and end of a frame.

• It is also transmitted when the link is idle.

Page 113: ch2

11.113

A frame in a bit-oriented protocol

Page 114: ch2

114

High-level Data Link Control (HDLC)High-level Data Link Control (HDLC) is a is a bit-orientedbit-oriented protocol for communication protocol for communication over point-to-point and multipoint links. It over point-to-point and multipoint links. It implements the ARQ mechanisms we implements the ARQ mechanisms we discussed in this chapter.discussed in this chapter.

Page 115: ch2

115

HDLC Frame Format

Header Body

8 16 16 8

CRCBeginningsequence

Endingsequence

Page 116: ch2

116

Data Stuffing• Networks usually insert extra bits or bytes

to change data for transmission and this is called Data Stuffing

 Bit stuffing and byte stuffing are two techniques for inserting extra data to encode reserved bytes

 Byte stuffing translates each reserved byte into two unreserved bytes

Page 117: ch2

11.117

Byte stuffing is the process of adding 1 extra byte whenever there is a flag or

escape character in the text.

Note

Page 118: ch2

118

Byte Stuffing

  Can use esc as prefix, followed by x for soh, y for eot and z for esc:

Page 119: ch2

119

Byte Stuffing  Sender translates each reserved byte into

the appropriate encoding pair of bytes  Receiver interprets pairs of bytes and

stores encoded byte in buffer• Data still framed by soh and eot

Page 120: ch2

120

Byte Stuffing

Page 121: ch2

121

Bit Stuffing

• Anytime 5 consecutive 1’s are transmitted, the sender inserts a 0 before sending the next bit. On the receiving side.

• When the receiver detects 5 consecutive 1’s, it assumes the next 0 was “stuffed” and removes it.

• If the next bit is a 1, either this is the end of frame marker or an error has occurred.

• Size of the frame is dependent on the data being sent in the frame payload.

Page 122: ch2

11.122

Bit stuffing is the process of adding one extra 0 whenever five consecutive 1s

follow a 0 in the data, so that the receiver does not mistake

the pattern 0111110 for a flag.

Note

Page 123: ch2

11.123

Bit stuffing and unstuffing

Page 124: ch2

124

Clock-Based Framing

• Third approach to framing is the Synchronous Optical Network (SONET) standard, called clock-based framing.

• SONET was proposed by Bell Communications Research (Bellcore) for digital transmission over an optical fiber.

• Addresses the framing and encoding problems as well as multiplexing low speed links onto a high speed link.

• More complex protocol

Page 125: ch2

125

SONET Framing

• SONET Frame has special information that indicates where the frame starts and ends.

• No bit stuffing is used• How does receiver know where the frame starts and

ends? • Frame consists of 9 rows of 90 bytes each.

– First 3 bytes of each row are overhead. – First two bytes of frame contain special bit pattern – Use of overhead bytes is complex

Page 126: ch2

126

SONET STS-1 Frame

Overhead Payload

90 columns

9 rows

First two bytes of the frame contain a special bit pattern that indicates the start of the frame

Page 127: ch2

127

Find the data rate of an STS-1 signal.

STS-1, like other STS signals, sends 8000 frames per second. Each STS-1 frame is made of 9 by (1 × 90) bytes. Each byte is made of 8 bits. The data rate is

Page 128: ch2

128

Find the data rate of an STS-3 signal.

SolutionSTS-3, like other STS signals, sends 8000 frames per second. Each STS-3 frame is made of 9 by (3 × 90) bytes. Each byte is made of 8 bits. The data rate is

Page 129: ch2

129

NoteNote

In SONET, the data rate of an STS-nsignal is n times the data rate

of an STS-1 signal.

Page 130: ch2

130

What is the duration of an STS-1 frame? STS-3 frame? STS-n frame?

SolutionIn SONET, 8000 frames are sent per second. This means that the duration of an STS-1, STS-3, or STS-n frame is the same and equal to 1/8000 s, or 125 μs.

Page 131: ch2

131

Note

In SONET, the duration of any frame is 125 μs.

Page 132: ch2

17.132

STS-1 frame overheads

Page 133: ch2

133

STS-1 Multiplexing

STS-1 STS-1 STS-1

STS-3cHdr

Three STS-1 frames are multiplexed onto one STS-3 frame.

Page 134: ch2

134

Error Detection

• Bit errors occur in frames due to electrical interference or thermal noise.

• Detecting errors is one part of the problem; correcting errors is the other.

• What happens when an error is detected?• Two basic approaches:

– Notify the sender that message is corrupt so the sender can retransmit it; ( most often used in every day applications)

– Use an error-correcting code to reconstruct the correct message

Page 135: ch2

135

Transmission Errors

 External electromagnetic signals can cause incorrect delivery of data  Data can be received incorrectly   Data can be lost  Unwanted data can be generated

  Any of these problems are called transmission errors

Page 136: ch2

10.136

In a single-bit error, only 1 bit in the data unit has changed.

Note

Page 137: ch2

10.137

Single-bit error

Page 138: ch2

10.138

A burst error means that 2 or more bits in the data unit have changed.

Note

Page 139: ch2

10.139

Burst error of length 8

Page 140: ch2

10.140

To detect or correct errors, we need to send extra (redundant) bits with data.

Note

Page 141: ch2

141

Error Detection

• Detecting Transmission Errors: basic idea is to add redundant information to a frame that can determine if errors have been introduced.

• Two-dimensional parity – based on a simple parity bit added to balance the number of 1’s

• Checksums – code created based on addition

• Cyclic Redundancy Check (CRC) – based on a complex mathematical algorithm and used in nearly all link level protocols.

Page 142: ch2

142

Parity

  Parity refers to the number of bits set to 1 in the data item

  Even parity - an even number of bits are 1

  Odd parity - an odd number of bits are 1

  A parity bit is an extra bit transmitted with a data item,chose to give the resulting bits even or odd parity

  Even parity - data: 10010001, parity bit 1• Odd parity - data: 10010111, parity bit 0

Page 143: ch2

143

Parity and Error Detection

  If noise or other interference introduces an error, one of the bits in the data will be changed from a 1 to a 0 or from a 0 to a 1

  Parity of resulting bits will be wrong

  Original data and parity: 10010001+1 (even parity)

  Incorrect data: 10110001+1 (odd number of 1’s)

  Transmitter and receiver agree on which parity to use

  Receiver detects error in data with incorrect parity

Page 144: ch2

144

Limitations of Parity Checking

  Parity can only detect errors that change an odd number of bits

  Original data and parity: 10010001+1 (even parity)

  Incorrect data: 10110011+1 (even parity!)

  Parity usually used to catch one-bit errors

Page 145: ch2

145

Two-Dimensional Parity

• Two-dimensional parity involves adding on extra bit to balance the number of 1’s in each byte (making the total either even or odd).

• Two-dimensional parity does a similar calculation for each bit position across all the bytes in the frame, resulting in adding an extra parity byte for the frame as well as an additional parity bit for each byte.

• Two-dimensional parity catches all the one, two and 3 bit errors and most 4 bit errors.

Page 146: ch2

146

Two-Dimensional Parity

1011110 1

1101001 0

0101001 1

1011111 0

0110100 1

0001110 1

1111011 0

Paritybits

Paritybyte

Data

Page 147: ch2

147

Probability and Error Detection  All error detection methods are approximate

and aim at a low probability of accepting corrupted data.

• Parity can detect a single bit error, but not all possible errors, especially where two bits ( or an even number of bits) are changed.

  Many alternative schemes exist:   Detect multi-bit errors   Correct errors through redundant information• Checksum and CRC are two widely used

techniques

Page 148: ch2

148

Internet Checksum Algorithm

• Simple idea: add up all the words that are to be transmitted and then transmit the sum, called the checksum, with the data.

• The receiver performs the same calculation and compares it to the checksum received. If they do not match, an error has occurred.

• Does not detect all errors…• Algorithm is easy to implement ( See p. 94)

Page 149: ch2

149

Checksum  Sum of data in message treated as array of

integers

  Can be 8-,16- or 32-bit integers

  Typically use 1s-complement arithmetic

  Example -16-bit checksum with 1's complement arithmetic

Page 150: ch2

10.150

Sender site:1. The message is divided into 16-bit words.2. The value of the checksum word is set to 0.3. All words including the checksum are added using one’s complement addition.4. The sum is complemented and becomes the checksum.5. The checksum is sent with the data.

Note

Page 151: ch2

10.151

Receiver site:1. The message (including checksum) is divided into 16-bit words.2. All words are added using one’s complement addition.3. The sum is complemented and becomes the new checksum.4. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.

Note

Page 152: ch2

10.152

Example

Page 153: ch2

153

Page 154: ch2

154

Advantages of Checksum

   Fastest implementations of 16-bit checksum use 32-bit arithmetic and add carries in at end

   Easy to do - uses only addition   Small size of checksum means cost of transmitting it is small.• Ease of computation to create and verify

checksum.

Page 155: ch2

155

Checksum Limitations

 Does not detect all common errors (like reversed bits)

Page 156: ch2

156

Cyclic Redundancy Check (CRC)

• CRC uses powerful mathematics ( finite fields) to give strong protection against common bit errors in messages that are thousands of bytes long.

Page 157: ch2

157

Detecting Errors with Cyclic

Redundancy Checks  Consider data in message as coefficients of

a polynomial

 Divide that coefficient set by a known

polynomial

 Transmit remainder as CRC

 Good error detection properties

 Easy to implement in hardware

Page 158: ch2

158

CRC Hardware  The hardware used to computer a CRC is a shift

register, which act like a tunnel through which bits move in a single file from right to left.

  The shift register holds a fixed number of bits so when a new bit moves in, another bit moves out.

  The output gives the value of the leftmost bit.  When a bit changes, the output changes.  The shift register has two operations: initialize and

shift.  Initialize sets all bits to zero   Shift moves all bits one position to the left.

Page 159: ch2

159

CRC Hardware

• X-Or and Shift Registers

Page 160: ch2

160

CRC Hardware• CRC Hardware consists of 3 shift registers

connected with X-Or units.• Output from the leftmost unit goes to 3 places

simultaneously - the • 3 X-Or units.• To compute the CRC values in all registers are

initialized and the bits are shifted one at a time.• One bit of the message is applied to the input unit

and all three registers perform a shift. This repeats for each bit of the message.

Page 161: ch2

161

CRC Calculation using Shift Registers

x0 x1XOR gate x2

Message

Page 162: ch2

162

CRC Computation

• After an entire message has been input, the shift registers contain the 16 bit CRC for the message.

Page 163: ch2

163

CRC Computation

• A CRC can compute more errors that a simple checksum because:

  An input bit is shifted through 3 registers;   The hardware uses feedback so that the

effect from a single bit cycles through the shift registers more than once.

• Mathematically a CRC uses a polynomial to divide the message:

• P(X) = x 16 + X 12 + X 5 + 1

Page 164: ch2

164

Example CRC

• A message is treated as a long binary polynomial, P. • Before transmitting, the data link layer divides P, by a fixed polynomial function G(x), resulting in a whole quotient Q and a remainder R/G. The remainder is appended to the message and transmitted. • It is checked by the receiver to see if R agrees with

the locally generated  value for R. (See Tanenbaum p.208-210 for analysis)  

 

Page 165: ch2

165

Example CRC

• Frame: P: 1101011011• Generating function G(x): 10011• Message after appending 4 zero bits:

11010110110000• Divide P by G to get remainder R:• 1100001010 with R = 1110  • 10011 | 11010110110000   • Transmitted frame with remainder R appended:

11010110111110

Page 166: ch2

166

Accuracy of CRC

• CRC actually adds 8, 16, 24, or 32 bits to the message.

• This method detects up to 99.969% of errors with CRC-8 and nearly 99.9% with CRC-16 or CRC-24.  

Page 167: ch2

167

Another CRC Example

Generator 11011111100110011010000 Message1101

10011101

10001101

10111101

11001101

10001101101 Remainder

See text. Pp. 94-95

Page 168: ch2

168

Error Correction or Error Detection?

• When error is detected, frame is discarded and resent, using bandwidth and causing latency, waiting for its arrival.

• Error correction requires additional bit to be sent with every frame.

• Correction is useful when – 1) errors are probable or – 2) the cost of retransmission is too high

Page 169: ch2

169

Reliable Transportation

• A data link level protocol that wants to deliver frames reliably must recover from discarded ( lost) frames.

• Acknowledgements - (ack) is a small control frame that a protocol sends back to report that it has received the frame. If the sender does not receive a frame in a reasonable amount of time, it retransmits.

• Timeouts -waiting a reasonable mount of time is called a timeout

Page 170: ch2

170

Automatic Repeat Request

• Using acknowledgements and timeout to implement reliable delivery is called automatic repeat request (ARQ).

• The simplest ARQ scheme is the Stop and Wait algorithm.

Page 171: ch2

171

Stop and Wait

• After transmitting one frame the sender waits for an ACK before transmitting the next frame.

• If it does not arrive in a reasonable time, the sender retransmits the original frame.

Page 172: ch2

172

Stop and Wait AlgorithmSender Receiver

Frame

ACK

Sender Receiver

Frame

ACK

Frame

ACK

Sender Receiver

Frame

ACK

Frame

ACK

Sender Receiver

Frame

Frame

ACK

(a) (c)

(b) (d)

a) Arrives

b) Frame lost

c)ACK lost

d) Timeout too soon

Page 173: ch2

173

Duplicate Frames

• If a frame is late arriving another frame might be retransmitted, resulting in duplicate frames.

• To correct this, a header usually contains a sequence number (0,1), which is used for alternate frames.

• When sender retransmits frame 0, the receiver can see that it is a second copy of frame 0, not frame 1.

Page 174: ch2

174

Timeline for Stop and WaitSender Receiver

Frame 0

ACK 0

Frame 1

ACK 1

Frame 0

ACK 0

Page 175: ch2

175

Sliding Window Protocol

 Allows sender to transmit multiple packets before receiving an acknowledgment

 Number of packets that can be sent is defined by the protocol and called the window

 As acknowledgments arrive from the receiver, the window is moved along the data packets; hence ``sliding window''

 Sliding window protocol can increase throughput dramatically

Page 176: ch2

176

Sliding Window Protocol• Sliding window algorithm allows the transmission of

a frame at about the same time as the ACK arrives.• Sender assigns a sequence number (SeqNum) to

each frame and maintains 3 variables:– Send window size (SWS) - # of unacknowledged frames

that sender can transmit

– Last acknowledgement received (LAR)

– Last frame sent (LFS)

– LFS - LAR <= SWS

Page 177: ch2

177

Sliding Window

Page 178: ch2

178

Timeline for Sliding WindowSender Receiver

Page 179: ch2

179

Sliding Window• When ACK arrives, the sender moves LAR to the right,

allowing the sender to transmit another frame.• Sender buffers up to SWS (send window size) frames (in

case they need to be retransmitted).• It also associates a timer with each frame it transmits, so

it can retransmit if an ACK is not received in time.• LAR – Last Acknowledgement Received• LFS – Last Frame Sent• See pp. 105-115 for details and for interactive demo see• http://www2.rad.com/networks/2004/sliding_window/demo.html

Page 180: ch2

180

Sliding Window on Sender

< SWS

LAR LFS

■ ■ ■ ■ ■ ■ ─

Page 181: ch2

181

Sliding window

• The receiver maintains 3 variables:– The receive window size ( RWS) – the upper

bound on the number of out of order frames that the receiver can accept.

– The sequence number of the largest acceptable frame (LAF)

Page 182: ch2

182

Sliding Window on Receiver

RWS

LFR LAF

■ ■ ■ ■ ■ ■

< ─

Page 183: ch2

183

Sliding Window Algorithm

• When frame with sequence number SeqNum arrives, the receiver does the following:

• If SeqNum <= LFR or SeqNum >LAF then frame is outside the window and is discarded.

• If LFR < SeqNum <= LAF, then it is accepted.• SeqNumToAck is largest not yet acknowledged• Receiver acknowledges receipt of SeqNumToAck and

sets LFR = SeqNumToAck• LAF=LFR +RWS

Page 184: ch2

184

Comparison of Sliding Window and Stop & Wait

Page 185: ch2

185

Frame Order and Flow Control

• Sliding Window can be used for:– To reliably deliver frames on an unreliable link;– To preserve the order in which the frames are

transmitted, using the sequence numbers;– To support flow control- a feedback mechanism

by which the receiver is able to throttle the sender to keep it from overrunning the sender.

Page 186: ch2

186

Concurrent Logical Channels

• ARPANET Data Link protocol, or concurrent logical channels, is an alternative to sliding window protocol and can keep pipe full while using the simple stop and wait protocol.

• It multiplexes several logical channels onto a single point-to-point link and runs the stop and wait protocol on each.

Page 187: ch2

187

Ethernet (802.3)• The Ethernet is the most successful local area

networking technology.• 1973- Developed at Xerox Park by Bob Metcalfe

and David Boggs, it is a general form of the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) technology.

• Based on Aloha, early packet network developed at the University of Hawaii to support communication across the islands.

Page 188: ch2

Bob Metcalfe

188

•Developed the Ethernet with David Boggs• 1979 Founded 3COM Corporation, which makes wirelesss access points• Founded Infoworld•Authored numerous books and articles•Recipient of many awards including the National Medal of Technology (2005) and induction into the National Inventors Hall of Fame for his contributions to the “welfare of mankind”.•Spoke at the CCSCE Conference at SJC, October, 2007 “ETHERNET IS THE ANSWER; WHAT IS THE QUESTION?”

Page 189: ch2

189

Ethernet (802.3)

• Digital Equipment Corporation (DEC), Intel and Xerox joined to form the 10 Mbps Ethernet standard in 1978.

• This standard formed the basis of the IEEE standard 802.3

• It has recently been extended to include a 100 Mbps version, called Fast Ethernet and a 1000 Mbps version called Gigabit Ethernet.

Page 190: ch2

190

Ethernet (802.3)

• The Ethernet is a multiple-access network meaning that a set of nodes send and receive frames over a shared link.

• The “carrier sense” means that the nodes can distinguish between a busy and idle link.

• “Collision detect” means that a node listens as it transmits and can detect when a transmitting frame has interfered (collided) with a frame transmitted by another node.

• When a collision occurs, both nodes back off, wait a random amount of time and then attempt to send again.

Page 191: ch2

191

Physical Properties

• An Ethernet is typically implemented on coaxial cables of up to 500 meters.

• (On older versions, called thick-net or 10Base5, a transceiver connected hosts to the cable and then to the network adapter or NIC card.)

• Newer versions, 10Base2, connect directly through the NIC, where all the logic is contained.

• 10BaseT, for twisted pair, uses Cat 5 cable and is limited to 100meter.

• “Base” refers to the baseband system.

Page 192: ch2

192

Ethernet Transceiver and Adapter

Transceiver

Ethernet cable

Adaptor

Host

Page 193: ch2

193

Thick Ethernet Wiring  Uses thick coax cable   AUI cable (or transceiver or drop cable connects from NIC to transceiver   AUI cable carries digital signal from NIC to transceiver   Transceiver generates analog signal on coax • Wires in AUI cable carry digital signals, power and other control signals

Page 194: ch2

194

Ethernet Wiring       Uses thin coax that is cheaper and easier to install than thick Ethernet coax     Transceiver electronics built into NIC; NIC connects directly to network medium • Coax cable uses BNC connector

Page 195: ch2

195

Ethernet Wiring   Coax runs directly to back of each connected computer

• T connector attaches directly to NIC

  Useful when many computers are located close to each other

  May be unreliable - any disconnection disrupts entire net

Page 196: ch2

196

Twisted Pair Ethernet•  Variously called 10Base-T, twisted pair or TP

Ethernet •  Replaces AUI cable with twisted pair cable

• Replaces thick coax with hub

Page 197: ch2

197

Physical Properties• Multiple Ethernet segments are joined by repeaters,

which forward a digital signal.• No more than 4 repeaters may be connected to any pair

of hosts, limiting an Ethernet to a maximum of 2500 meters.

• An Ethernet can support a maximum of 1024 hosts.• Any signal placed on the Ethernet is broadcast to all

hosts.• Terminators are attached to the end of each segment to

absorb the signal.• The Ethernet uses Manchester encoding.

Page 198: ch2

198

Ethernet repeaters

Repeater

Host

■ ■ ■

■ ■ ■

■ ■ ■

■ ■ ■

Page 199: ch2

199

Ethernet Hubs

Hub Hub

The common 10BaseT configuration is to have several point-to-point segments connected to a hub or switch. This is also true for 100Mbps Ethernet, but not for Gigabit Ethernet.

Page 200: ch2

200

HUBS

Page 201: ch2

201

Access Protocol• On an Ethernet, all hosts are competing for

access to the same shared link.

• The media access control (MAC) algorithm controls access to the link.

• It is implemented in hardware on the network adapter.

Page 202: ch2

202

Network Adapter Cards (NIC)

  CPU can't process data at network speeds   Computer systems use special purpose

hardware for network connection   Typically a separate card in the backplane   Network adapter card or network interface card

(NIC)   Connector at back of computer then accepts

cable to physical network

Page 203: ch2

203

Network Interface Hardware

Page 204: ch2

204

NIC Cards

The sockets for the NIC cards are usually located near the back of the cabinet and a network cable attaches to the end of the NIC.

Page 205: ch2

205

NIC Cards and Wiring

NICS can provide all three connection technologies

Page 206: ch2

206

Ethernet Frame Format

Destaddr

64 48 32

CRCPreamble Srcaddr Type Body

1648

•Taken from the Digital-Intel-Xerox Ethernet Standard

•Each Ethernet frame is defined by the following format where the preamble allows the receiver to synchronize with the signal.

•Both source and destination hosts are identified by addresses

•Packet type identifies the protocol

•Each packet can contain up to 1500 bytes of data (46bytes minimum)

•32-bit CRC for error detection

Page 207: ch2

207

Addresses

• Each host on an Ethernet has a unique Ethernet address.

• Technically the address belongs to the adaptor, not to the host and is usually burned into the NIC card ROM.

• Each NIC card has a unique prefix and makes sure it assigns unique addresses

• Addresses can be assigned statically, dynamically or can be configurable and assigned by the network administrator

Page 208: ch2

208

Assigning AddressesStatic: Hardware manufacturer assigns permanent

address to each interface - doesn't change

Manufacturer must ensure every interface has a unique address

Configurable: Address can be set by end user, either through switches or jumpers, or electronically ( EPROM) or through software  

System administrators must coordinate to avoid conflict

Dynamic: Interface automatically assigns hardware address each time it is powered up (tries random number)

Automatic scheme must be reliable to prevent conflicts

Page 209: ch2

209

Addressing Scheme Comparison

 Static:

 Ease of use and permanence

 Less flexibility

 

Configurable: 

Small permanent addresses hardware easily replaced

Requires initial configuration

 

Dynamic: 

Smaller addresses and Vendors do not have to coordinate to assign

them

Lack of permanence and potential conflict

Addressing Scheme Advantages Disadvantages

Page 210: ch2

210

Address Types• Each frame on an Ethernet is received by every

connected adaptor.• Each adaptor recognizes the frames addressed to it and

passes those frames to it host. These are unicast addresses.

• A broadcast address, consisting of all 1’s, is recognized by all NIC cards.

• A multicast address, with first bit set to 1, is recognized by a subset of NIC cards.

• Running in promiscuous mode, means that a NIC card will pass all messages to its host.

Page 211: ch2

211

Ethernet Address Summary

• An Ethernet adaptor receives all frames and accepts:– Frames addressed to its own address– Frames addresses to the broadcast address– Frames addressed to a multicast address, if it is

part of that subset– All frames if it is in promiscuous mode

Page 212: ch2

212

Transmitter Algorithm• Receiver side is simple.• Sender side implements Ethernet protocol.• When NIC has frame to send and the line is busy, it waits

for the line to become idle.• Because there is no centralized control, two (or more)

adaptors may send at once, causing a collision. When a collision is detected, a jamming sequence is sent to stop transmission.

• The adaptors wait a random amount of time before trying again.

• Each time there is a collision, the delay interval doubles – called exponential backoff.

Page 213: ch2

213

Worst Case Scenario

(a)

(b)

(c)

A B

A B

A B

A B

(d)

Page 214: ch2

214

Success of the Ethernet

• Extremely easy to administer, no switches to fail, no routing or configuration tables

• Easy to add additional hosts

• It is inexpensive, since cables are relatively cheap.

• Most new LAN switching technology is based on the Ethernet

Page 215: ch2

215

Token Rings (802.5, FDDI, RPR)

• Token Rings are the other significant class of shared media networks.

• IBM Token Ring, was the original – followed by the IEEE 802.5 standard, which was nearly identical, and finally the newer FDDI (Fiber Distributed Data Interface) Standard, which is declining in use.

• Resilient Packet Ring or RPR (802.17) is nearly standardized.

Page 216: ch2

216

Token Ring• Token ring Network consists of a set of nodes connected

in a ring.• Data flows in a particular direction around the ring so

that each node receives a packet from its upstream neighbor and forwards it to its downstream neighbor.

• Similar to Ethernet in that it involves an algorithm which controls when a node can transmit, and all nodes see all frames.

• Sending a message differs from that of the Ethernet.

Page 217: ch2

217

Token Ring Network

Page 218: ch2

218

Implementing a Token Ring

Page 219: ch2

219

Tokens• Access to the network is controlled by a token.• A ‘token” is a special sequence of bits, which

circulates around the ring.• Each node receives the token, and when it has

the token, that node may send a packet and then forward the token to the next node in a round-robin fashion.

• This is fair, since each node gets a turn to send.

Page 220: ch2

220

Physical Properties

• Any link or node failure makes the whole network useless.

• When relay is open, the station is included in the ring; if the relay closes, the ring bypasses the node.

• Several relays are packed into a single multi-station access unit ( MSAU) – required by IBM token ring.

• Data rate is 4 or 16 Mbps and uses Manchester differential encoding

• Twisted pair is required for IBM and not specified for 802.5

Page 221: ch2

221

Relay on Token Ring

Host

From previoushost

To nexthost

Relay

(a)

Host

Host Host

From previoushost

To nexthost

Relay

(b)

a) Relay open – host active b) Relay closed-host bypassed

Page 222: ch2

222

Multimedia Access Unit

Host

Host

Host

Host

From previousMSAU

To nextMSAU

MSAU

Used only in electrical rings to compensate for node failure.

Page 223: ch2

223

Token Ring Media Access Control

• Network adapter contains a receiver, transmitter, and one or more bits of data storage.

• When no node is sending, the token circulates.• A sending station, “seizes” the token and sends data.

Token holding time (THT) is the time the node can hold the token. Default THT = 10ms.

• 802.5 also supports a strict priority scheme• Sending node can reinsert token immediately following

its frame (early) or after the frame circles the ring and is removed (delayed) release.

Page 224: ch2

224

Token Release

Token

Fram

eToken Frame

(a) (b)

a) early b) delayed

Page 225: ch2

225

Token Ring Maintenance• Token rings have a station designated as the monitor.• Procedures are defined to elect a monitor when the ring is

first connected or when the monitor fails.• Monitor must make sure there is always a toke in the ring

and that there is sufficient delay.• It also checks for corrupted or orphaned frames.• It also checks for “dead” stations.

Page 226: ch2

226

Token Ring Frame Format

Body ChecksumSrcaddr

Variable48

Destaddr

48 32

Enddelimiter

8

Framestatus

8

Framecontrol

8

Accesscontrol

8

Startdelimiter

8

•Uses differential encoding codes in start and end delimiters.

•Access control byte includes the frame priority

•Frame control byte identifies the higher-level protocol

•Like Ethernet, addresses are 48 bytes long

•Includes a 32- bit CRC and A and C bits for reliable delivery

Page 227: ch2

227

FDDI

• Fiber Distributed Data Interface (FDDI) is similar to 802.5 and IBM token ring.

• Significant differences are that it runs on fiber, not copper and makes use of some newer innovations

• It is usually a dual ring – where each ring transmits in the opposite direction.

• The second ring is only used if the primary ring fails and there is a “loop back” toform a complete ring.

• Instead of a monitor all nodes participate equally in maintaining the ring.

Page 228: ch2

228

Dual Fiber Ring

(a) (b)

a) Normal operation b) Failure of primary ring

Page 229: ch2

229

Physical Properties• FDDI network consists of a dual ring- two rings that

transmit data in opposite directions. The second ring is only used if the primary ring fails.

• Nodes attach to the ring with a single cable called single attachment stations (SAS). A concentrator attaches several SASs to the ring.

• FDDI is a 100 Mbps network and is limited to 500 hosts.• FDDI uses 4B/5B encoding• Token holding algorithms are more complex than 802.5

Page 230: ch2

230

FDDI Frame Format

Control

8 8 8 24

CRCStart offrame

End offrame

Destaddr Body

4848

Srcaddr Status

32

•Similar to 802.5 with these exceptions:

•Uses 4B/5B encoding instead of Manchester

•Has a bit in the header to distinguish synchronous from asynchronous traffic

•Lacks the access control bits present in 802.5

Page 231: ch2

231

Resilient Packet Ring (RPR)• Relatively recent technology – IEEE (802.17)• Resiliency- the ability to recover quickly from a

link or node failure was its key design goal.• Other goals were bandwidth efficiency and

Quality of Service (QoS) support.• Like FDDI it uses 2 rings, but unlike FDDI ,

both are used for normal service.• Uses buffer insertion instead of a token.• Used in MAN’s but “metro Ethernet” is

coming…

Page 232: ch2

232

Wireless

• Wireless is the rapidly evolving technology for connecting communication devices:– Bluetooth – Wi-Fi -802.11 – Wi-MAX – 802.16 – and 3G cellular wireless

• They differ in how much bandwidth they can provide, how far apart nodes can be and which part of the electromagnetic spectrum they use.

Page 233: ch2

233

Wireless TechnologiesBlueTooth Wi-Fi WiMAX 3G Cell

Link Length

10m 100m 10 km

Bandwidth 2.1 Mbps

Shared

54 Mbps

Shared

70 Mbps

Shared

384+Kbps

Per connection

Use/link To notebook

Notebook to base

Building to tower

Phone to tower

Anology USB Ethernet Coaxial DSL

Page 234: ch2

234

Wireless

• The most widely used wireless links are asymmetric – the two endpoints are different kinds of nodes

• One endpoint acts as a base station and has no mobility and is wired to the Internet or other network.

• The client not is often mobile and relies on its link to the base station to communicate with other nodes.

Page 235: ch2

235

Page 236: ch2

236

Wireless

• Notice that wireless naturally supports point to multipoint communications becaues radiio waves sent out by one device can be simultaneously received by many devices

• However communication between client nodes is routed through the base node

Page 237: ch2

237

Example Wireless Network

A B C D

Page 238: ch2

238

Levels of Mobility

• No mobility- when a receiver must be in a fixed location to receive a directional transmission from a base station (true of the initial WiMAX)

• Mobility within the range of a base as in the case of Bluetooth

• Mobility between bases as is the case with cell phones and Wi-Fi

Page 239: ch2

239

Mesh or Ad hoc Network

• A wireless mesh is an alternative topology• Nodes are peers ( there is no base station)• Messages are forwarded through a chian of

peers as long as each peer is within range of the preceeding node.

• This allows a wireless portion of a network to extend beyond the limited range of a single radio.

Page 240: ch2

240

Page 241: ch2

241

Bluetooth• Bluetooth provides very short range communication

between mobile phones, PDAs, notebook computers and other peripheral devices.

• It is a convenient alternative to connecting with a wire.• It has a range of only 10 m and operates at 2.45 GHz • Because devices usually blong to an individual or

group it is often called a PAN ( personal area network)

• Network connects up to 7 devices to a master and is called a piconet.

Page 242: ch2

242

Bluetooth piconet

Page 243: ch2

243

Wireless ( 802.11)

• Like Ethernet and Token Ring, 802.11 is designed for use in a limited geographical area (homes, office buildings, campuses).

• Primary challenge is to mediated shared access through space.

• 802.11 supports additional features (time-bound services, power management and security)

Page 244: ch2

244

Physical Properties

• 802.11 was designed to run over three different media- two based on spread spectra and one based on diffused infrared.

• The radio based versions run at 11 and 54 Mbps.• A chipping sequence spreads the signal over a wide

frequency using a random sequence and makes the signal look like noise to any receiver that does not know the sequence.

• Infrared signals are diffused so the sender and receiver do not need to be aimed at each other, but must be within buildings.

Page 245: ch2

245

4-Bit Chipping Sequence

Random sequence: 0100101101011001

Data stream: 1010

XOR of the two: 1011101110101001

0

0

0

1

1

1

Page 246: ch2

246

Collision Avoidance

• The protocol is more complex than Ethernet, since all nodes are not always within reach.

• Consider 4 nodes A,B,C,D that are able to send to a node to its immediate left or right,so B can reach A and C but not D.

• If A and C both send to B they collide, but are unaware of each other and are called hidden nodes.

Page 247: ch2

247

Hidden node problem

A & C can collide at B

Page 248: ch2

248

Collision Avoidance

• Another related problem is the exposed node problem.

• Suppose B is sending to A and C is aware of this. It is a mistake for C to think it cannot transmit.

• It is not a problem for C to transmit to D because it will not interfere with A’s ability to receive from C

Page 249: ch2

249

Exposed node problem

B can transmit to A and C can transmit to D

Page 250: ch2

250

Collision Avoidance• 802.11 addresses these two problems with a Multiple

Access Collision Avoidance algorithm. (MACA)• Sender and receiver exchange control frames before

transmitting data• Sender sends a request to transmit (RTS) frame.• Receiver relies with a clear to send (CTS) frame.• Receiver also sends an ACK after successfully receiving

the frame. All nodes must wait for this before trying to transmit.

• CTS frames can collide and both must wait before transmitting, similar to Ethernet backoff.

Page 251: ch2

251

Distribution System• Since an advantage of a wireless system is that

nodes are free to move around, reachable nodes may change over time.

• Some nodes may roam and some, called Access Points (AP) are connected to the network infrastructure by a distribution system.

• Distribution system runs at layer 2 of the ISO architecture and does not depend on higher layers.

Page 252: ch2

252

Access Points connected to a Distribution Network

BH

A

F

G

D

AP-2

AP-3AP-1

C E

Distribution system

Each node associates itself with one access point.

Page 253: ch2

253

Communication Example

• For node A to communicate with node E

• A first sends a frame to its access point AP-1, which forwards the frame across the distribution system to AP-3, which finally transmits the frame to E

Page 254: ch2

254

Selecting an APTechnique called scanning:1. The node sends a Probe frame2. All APs within reach reply with a Probe Response

Frame3. The nodes selects one of the access points and sends

that AP an Association Request Frame.4. The AP replies with an Association Response Frame

A node uses this when it joins the network and when it becomes unhappy with current AP ( weak signal, etc.)

Page 255: ch2

255

Active and Passive Scanning

• After a node has probed the network, it associates itself with an Access Point. This is called active scanning.

• APs also periodically send a Beacon Frame that advertise the capabilities of the Access Point, including transmission rates. A node can change to this point by sending an Association Request Frame to the access Access Point . This is called passive scanning.

Page 256: ch2

256

Node Mobility

BH

A

F

G

D

AP-2

AP-3AP-1

EC

C

Distribution system

Page 257: ch2

257

802.11 Frame Format

Addr4 PayloadSeqCtrlAddr3Addr2Addr1 CRC

0Ð18,4964816 32484848

Duration

16

Control

16

48 bit Source and Destination addresses ( addr1, addr2)

Two additional address fields depends on the ToDS, From DS settings

Control fields: Type, ToDS, FromDS

Type fields indicates whether the frame is RTS, CTS or data

CRC for error detection

Page 258: ch2

258

802.11 Frame Format

Page 259: ch2

259

WiMAX (802.16)

• WiMAX stands for Worldwide Interoperability for Microwave Access

• It is a metropolitan area network(MAN) with a range of 1-30 miles.

• It odes not yet inclued mobility, but that will be added as 802.16e

• Its clients are multiplexers for a building and to adapt to different frequencies it uses different physical layer protocols.

Page 260: ch2

260

Cell Phone Technologies• Frequency bands vary around the world:

– Europe 900 and 1800 MHz bands– North America 850 and 1900 MHz bands

• Cost is high to users because of licensed spectrum

• Incompatible cell phone standards

• Phones designed to carry voice now carry video, and audio which require high bandwidth

Page 261: ch2

261

Cell Phone Technologies

• Relies on use of base stations that are part of a wired network

• Geographic area served by the base station’s antenna is called a cell

• Cells overlap and a base station can serve more than one cell using multiple antennae.

Page 262: ch2

262

Handoff

• As a phone begins to leave a cell, it moves into an area of overlap with other cells

• The current base station senses the weakening signal and give control to whichever base station is receiving the stronger signal from it.

• If a phone is receiving a call, the call must be transferred over to the new base station in what is called a handoff.

Page 263: ch2

263

Cell Phone Generations

• 1G – analog• 2G – digital -most of the current technology, some

are referred to as 2.5 G – not quite third generation, but more advanced. These are GSM- Global System for Mobile Communications

• 3G – Based on CDMA (code division Multiple Access

• Satphones- class of phones that are not cellular, but are satellite phones

Page 264: ch2

264

Summary• Five key problems so that links can exchange information:• Encoding problem for physical links carrying signals;• The framing problem determines how to package bits into

frames;• The error detection problem using CRC, parity, and

checksums• Problem of recovering lost frames discarded because of

errors• Problem of mediating access on shared media (Ethernet,

token ring and wireless)

Page 265: ch2

265

Further Reading

• Metcalfe, Robert. and Boggs, David, “Ethernet: Distributed Packet Switching For Local Computer Networks”, Communications of the ACM, 19(7):395-403, July, 1976

• http://standards.ieee.org/ for status of IEEE standards

• See p. 145 for more complete list…