don montgomery, cse department, southern methodist university – ecs 4344ch2, slide 1 an example...

88
Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 1 an example routing illustration using tracert or traceroute xtraceroute is a graphical version of tracert

Upload: job-lang

Post on 28-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 1

an example routing illustration

– using tracert or traceroute– xtraceroute is a graphical version of tracert

Page 2: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 2

layer 1: the physical layer

• node: router or host

• host: general purpose computer

• router: general purpose or custom hardware

• physical layer connection through network adaptor

• network adaptor: NIC (network interface card)

Page 3: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 3

topic 1: transmission media

• guided (see next slide)

• unguided– laser, radio satellites

Page 4: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 4

guided physical media• magnetic media (e.g. tapes & disks)

• twisted pair (e.g. UTP Cat 3, UTP Cat 5)– UTP = Unshielded Twisted Pair; Cat = Category

– (Cat 5 has more twists per cm than Cat 3)

• coaxial cable (e.g. cable TV)– thick

– thin

• optical fiber (e.g. submarine and backbone links)– single mode

– multi mode

• wireless (RF, microwave, infrared)

Page 5: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 5

coaxial cable (“coax”)

Page 6: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 6

principles of fiber optics

(a) light rays from inside a silica fiber impinging on the air/silica boundary at different angles

(b) light trapped by total internal reflection

Page 7: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 7

fiber optic cables

(a) side view of a single fiber

(b) end view of a sheath with three fibers

Page 8: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 8

two types of fiber optic cables

1. single-mode fiber (SMF): core ~8--12mic

2. multi-mode fiber (MMF): core ~50mic

Page 9: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 9

intermission

Page 10: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 10

wired media capacities

cable typical b/w distances

category 5 twisted pair 10 - 100 Mbps 100 mthin-net coax 10 - 100 Mbps 200 mthick-net coax 10 - 100 Mbps 500 mmultimode fiber 100 Mbps 2 kmsingle-mode fiber 100 - 10000 Mbps 40 km

Page 11: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 11

common carrier bandwidths

service bandwidth

DS1 1.544 MbpsDS3 44.736 MbpsSTS-1 51.840 MbpsSTS-3 155.250 MbpsSTS-12 622.080 MbpsSTS-48 2.488320 GbpsSTS-192 9.953280 Gbps

Page 12: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 12

signal characteristics & data rates

nature of signal in medium (air/glass/Cu):-

electromagnetic (EM) waves

speed of EM wave depends on medium

example:

speed of light in vacuum: 3 x 108 meters/sec

speed of electrical signals in copper: 2/3 x speed of light in vacuum

Page 13: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 13

frequency – wavelength relationship

= c' / f

where,

= wavelength of signal

c' = speed of light (EM wave) in given medium

f = frequency of signal

Page 14: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 14

the 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 15: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 15

data transmission

q1: what are common problems in signal propagation?

ans: 1. signal attenuation

- and, different frequencies are attenuated differently!

2. delay distortion

- Fourier components travel at different speeds!

3. noise

- thermal noise

- impulse noise

- crosstalk

Page 16: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 16

data transmission

q2: how do you transmit information (bits)?

ans: by modulation

- superimpose electrical signal (corresponding to bits) onto a carrier wave; then, transmit in the medium

- modulation can be of several types (see next slide)

Page 17: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 17

information theory

“the sampling theorem” Harry Nyquist, Claude Shannon, et alia

“exact reconstruction of a continuous-time baseband signal from its samples is possible if the signal is bandlimited and the sampling frequency is greater than twice the signal bandwidth

maximum data rate of a finite bandwidth noiseless channel

Page 18: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 18

data transmission: signaling

DC signaling (i.e., baseband signaling): bits encoded & transmitted as square waves (see next

slide) suitable for short links, low speeds

AC signaling (by modulation of a carrier wave) bits first encoded as square waves (see next slide);

then, use these waves to modulate carrier;

finally, transmit modulated carrier suitable for long-haul links, higher speeds

Page 19: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 19

modems: electrical representation of data bits

(a) a binary signal

(b) amplitude modulation

(c) frequency modulation

(d) phase modulation

Page 20: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 20

assertion:

we could use a 2 signal-level system to represent data

i.e., logic 0 = +5v and logic 1 = 0v

any foreseeable problems? yes1. is 0v = logic 0, or is it an idle transmitter?

2. DC bias on line

therefore, we need better encoding strategies

data transmission: bit encoding

Page 21: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 21

data transmission: bit encoding

four types of encoding schemes:

NRZ (Non-Return to Zero) NRZI (Non-Return to Zero Inverted) Manchester 4B/5B (used in conjunction with NRZI)

Page 22: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 22

bit encoding (cont'd.): fig 2.10 (textbook)

Bits

NRZ

Clock

Manchester

NRZI

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

required clock rates?

Page 23: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 23

problems with NRZ?

1. “baseline wander”

- shift in average (source or perceived) signal strength

2. clock recovery problem

- sender-to-receiver synchronization is lost (see next slide)

instead, why not send clock signal over separate wire?

bit encoding

Page 24: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 24

the clock sync problem(when clock cannot be recovered)

Page 25: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 25

how to extract bits from received signal

separate clock cable too expensiveso, how to recover clock from data signal?

clock recovery depends on lots of transitions

“string of ones” sync problem (NRZI)

“string of zeros” sync problem (Manchester)

Page 26: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 26

bit encoding using 4B/5B: table 2.4 (textbook)

4-Bit Data Symbol 5-Bit Code0000 111100001 010010010 101000011 101010100 010100101 010110110 011100111 011111000 100101001 100111010 101101011 101111100 110101101 110111110 111001111 11101

how to encode in 4B/5B ...

1. first encode data into 5-bit code using table shown to right. (5-bit code ensures that no more than 1 leading zero & no more than 2 trailing zeros)

2. then, encode 5-Bit code using NRZI

Page 27: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 27

does 4B/5B solve clock-sync problem? - long string of zeros? - long string of ones?

what is baud rate? is it the same as bit rate? baud rate of NRZI? baud rate for Manchester encoding? baud rate for 4B/5B?

efficiency of encoding for above schemes? which encoding scheme is most efficient? which one is least efficient?

points to ponder ...

Page 28: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 28

addendum to topic 1: some additional material on the

physical layer

the material in the following slides is not in your textbook, but has been included here

for your study

Page 29: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 29

radio transmission

(a) radio waves in the VLF, LF, and MF bands follow curvature of earth

(b) in the HF band, they bounce off the ionosphere

Page 30: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 30

communication satellites

I. geostationary satellites

II. medium-earth orbit satellites

III. low-earth orbit satellites

IV. satellites versus fiber

Page 31: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 31

communication satellites

communication satellites and some of their properties

Page 32: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 32

communication satellite basics

• launched by rockets

• satellites must maintain orbit stationarity

• satellites follow Kepler's laws of planetary motion

• ability to correct orbital drift

• old age of satellite: orbital decay and death

Page 33: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 33

low-earth orbit satellites -- Iridium

(a) the Iridium satellites form six necklaces around the earth

(b) 1628 moving cells cover the earth

Page 34: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 34

Globalstar

(a) relaying in space (b) relaying on the ground

Page 35: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 35

“unguided” laser transmission

convection currents can interfere with laser communication systems

Page 36: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 36

intermission

Page 37: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 37

public switched telephone system structure of the telephone system

“POTS”

the politics of telephones “PSTN”, “telco”, “telecom”, “Baby Bells” governments own, operate, and/or regulate

the local loop: modems, ADSL and wireless “last mile”, “first mile”

trunks and multiplexing switching

Page 38: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 38

structure of the telephone system

(a) fully-interconnected network“complete graph”, “clique”, “mesh” (context sensitive)

(b) centralized switch(c) two-level hierarchy

squares: “mesh” (context sensitive)

Page 39: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 39

major components of the PSTN

local loops analog twisted pairs going to houses and businesses

trunks digital fiber optics connecting the switching offices

switching offices where calls are moved from one trunk to another

Page 40: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 40

the local loop: modems, ADSL, and wireless

Page 41: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 41

wireless local loops

Architecture of an LMDS system.

Page 42: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 42

DSL: Digital Subscriber Line local loop

Bandwidth versus distance over category 3 UTP for DSL.

Page 43: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 43

the politics of telephones

LATAs, LECs, and IXCs

Circles are LEC switching offices.

Each hexagon belongs to the IXC whose number is on it.

Page 44: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 44

FDM: Frequency Division Multiplexing

(a) original bandwidths(b) bandwidths raised in frequency(b) multiplexed channel

Page 45: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 45

WDM: Wavelength Division Multiplexing

Wavelength division multiplexing.

DWDM, CWDM, ...

Page 46: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 46

TDM: Time Division Multiplexing

T1 framing

Page 47: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 47

sampling for transmission over TDM

Delta modulation.

delta modulation

Page 48: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 48

TDM of multiple data (voice) streams

Multiplexing T1 streams into higher carriers.

U.S. system: Synchronous Optical NETwork (SONET)

Page 49: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 49

TDM framing

Two back-to-back SONET frames.

two SONET frames in sequence

Page 50: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 50

standard TDM line rates

SONET and SDH multiplex rates.

Page 51: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 51

circuit switching vs. packet switching

Page 52: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 52

circuit, message, and packet switching

Page 53: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 53

circuit vs. packet switching

previous figures taken from Computer Networks, 4/e, A.S. Tanenbaum

Page 54: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 54

functions:1. packet framing, bit-stuffing, character stuffing, etc.

2. error detection, error correction

- generate and process acknowledgements

- “checksumming” of packets

3. fragmentation (and reassembly) of packets;

sequence numbering, etc.

4. flow control

5. channel access control (on broadcast/shared media)

the data link layer

Page 55: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 55

relationship between packets and frames

Page 56: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 56

why do we frame packets?

because:

1. data packets must be separated from one another

- inserting time gaps between packets does not work

because: network may squeeze out time gaps

2. error checking for individual frames is easy/convenient

1. framing

Page 57: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 57

the four main ways to frame packets ...

1. using character counts

2. using framing characters, with character stuffing

3. using start and end flags, with bit stuffing

4. clock-based framing (on SONET)

framing methods

Page 58: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 58

idea:

field in data link header specifies frame size in characters

framing method 1: using character counts

130 .. .. .. .. <checksum>

character count

a frame of 130 characters

• any foreseeable problems?

Page 59: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 59

problems in using character counts

(a) without errors (b) with one bad error

Page 60: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 60

idea: special characters (sentinels (delimiters)) tell receiver when frames begin or end:

framing method 2:using framing characters, with character stuffing

STX <Header> A C B E F <Trailer> ETX

STX = start of transmission, ETX = end of transmission

example frame with payload 'ACBEF' provided by network layer:

• any foreseeable problems?

Page 61: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 61

what if 'STX' or 'ETX' occur accidentally in data?

solution: use stuffing character DLE!

DLE = Data Link Escape (term “escaped character” ring a bell?)

example:

suppose sender's network layer sends following data to its DL layer:

A C B ETX M STX B G

then, sender's DL layer transmits the following over the physical layer:

STX <Hdr> A C B DLE ETX M DLE STX B G <Trlr> ETX

and, receiver's DL layer destuffs & sends following data to its network layer:

STX <Hdr> A C B DLE ETX M DLE STX B G <Trlr> ETX

-what if DLE occurs in payload?

glitch in character stuffing

Page 62: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 62

what if 'DLE' itself occurs accidentally in data?

solution: then stuff DLE, as shown before!

example:suppose sender's network layer sends following data to its DL layer:

A C DLE M STX Gthen, sender's DL layer transmits the following over the physical layer:

STX <Hdr> A C DLE DLE M DLE STX G <Trlr> ETX

and, receiver's DL layer destuffs & sends following to its network layer:

STX <Hdr> A C DLE DLE M DLE STX G <Trlr> ETX

Page 63: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 63

any disadvantages of character-based framing?

• DLE, STX, ETX are all ASCII characters

• some hardware explicitly supports ASCII, some does not

Page 64: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 64

idea: special bit patterns (“sentinels”, “flags”, “delimiters”) tell receiver when frames begin or end:

framing method 3:using framing bits (flags), with bit stuffing

01111110 101110..100010111<Trailer> 01111110<Header>

01111110 = flag indicating Start of Frame01111110 = flag indicating End of Frame

example:

resulting DL frame

but, what if framing flags occur accidentally in data?

Page 65: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 65

solution: prevent this as follows ... after every five consecutive 1s, automatically stuff a 0!

example:source network layer sends following to DL layer ...

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

then, source DLL sends following over PHY layer ...

01111110 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 01111110

... sink DLL destuffs & sends following to its network layer:

01111110 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 01111110

Page 66: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 66

what if error(s) occur(s) in transmission?

consider an earlier example:

01111110 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 01111110

case 1: error is in any position except framing flags

case 2: error is in framing flag itself

can receiver recover from error(s)?

what about from character stuffing errors in DLE, ETX, STX characters?

Page 67: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 67

idea: in a SONET frame, the first 2 bytes contain a flag; frames are periodic; but, no bit stuffing! why? ...

framing method 4:clock-based framing (SONET)

Overhead Payload

90 columns

9 rows

STS-1 frame

Page 68: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 68

Page 69: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 69

errors in transmission

wave-guided digital transmission

copper

fiber

analog transmission

wireless

single-bit errors

burst errors

Page 70: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 70

error control

error detection

error correction (FEC)

ACKs, NACKs

timers, timeouts

sequence numbers

Page 71: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 71

• basic idea: add redundant information1. naïve method

• k redundant bits per n-bit message, for k << n• the k bits: “error detecting code”

2. parity3. 2-dimensional parity4. checksumming5. cyclic redundancy check (CRC)

error detection

Page 72: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 72

error detection: 2-D parity

1011110 1

1101001 0

0101001 1

1011111 0

0110100 1

0001110 1

1111011 0

Paritybits

Paritybyte

Data

“odd parity” or “even parity”?

Page 73: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 73

2-D parity

does this catch all errors? ..

how about:

1-bit errors?

2-bit errors?

3-bit errors?

4-bit errors?

Page 74: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 74

error detection: checksumming

source:1. add up all the data words to find checksum2. transmit checksum along with original data

sink:1. extract checksum from frame2. compute its own checksum on received data3. computed checksum == extracted checksum?4. if comparison fails, then reject frame

Page 75: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 75

checksumming

advantage: easy, fast, efficientdisadvantage: weak protection (link layer not)

implementation:

• add using 1's complement arithmeticwhy? ... because

1. easy to implement in hardware2. fast in software3. implementation is big-endian/little-endian neutral

Page 76: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 76

checksumming

one's complement arithmetic

additive inverse == bitwise complement

not(x), x', x-bar

zero: 00...00; -zero: 11...11

one’s complement of x = x’

0 + x = x’; -0 + x = x’

to subtract by x, add x’

Page 77: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 77

checksumming

use 4-bit numbers in 1's complement for ...

(pay particular attention to carry and overflow rules)

3 + 4

5 + (-2)

5 + (-6)

(-5) + 6

(-3) + (-4)

(-5) + (-6)

Page 78: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 78

checksumming

IP packet header checksum:

1's-complement of

16b 1's complement sum of

all 16b words in header

check at receiver:

1's complement sum over all 16b words

including checksum word

if result == -0 (FF), then header is valid

Page 79: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 79

error detection: CRC

how to use CRC?

Data

Data CRC bits

Compute CRC

Add other headers, framing bits; then transmit

Page 80: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 80

CRC

idea:

1. think of an (n+1) bit message as an 'n' degree polynomial; call this M(x)

e.g., 10011010 = x7+x4+x3+x1

2. select suitable 'divisor' polynomial (aka generator polynomial) of degree k ( k < n)

e.g., G(x) = x3+x2+1

(here, note that k = 3)

Page 81: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 81

CRC

idea (cont'd.):

3. calculate CRC bits using modulo-2 arithmetic; append these bits at the end of data bits; call all of this T(x):

Data CRC bits

T(x)

goal: make T(x) exactly divisible by G(x) before transmision; receiver then computes T(x) / G(x)

if T(x) is not exactly divisible by G(x), then received frame is bad

Page 82: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 82

CRC

• how to make T(x) exactly divisible by G(x)?• here's how: N / D = (Q, R)

• therefore, (N-R) / D = (Q, 0)

1. calculate xk * M(x):

Data 0 ... 0

P(x)

M(x)k zeros

Page 83: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 83

CRC

(how to make T(x) exactly divisible by G(x)? (contd.))

2. compute P(x) / G(x) using modulo-2 division

3. subtract remainder R(x) from P(x)

then, we have:

T(x) = P(x) – R(x) ... see figure below

thus, T(x) is perfectly divisible by G(x)

Data CRC

T(x)

M(x)k bits

Page 84: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 84

CRC

rules of polynomial arithmetic modulo 2:

• if deg(B(x)) > deg(C(x)), then B(x) is divisible by C(x)

• if deg(B(x)) = deg(C(x)), then B(x) is divisible by C(x) once

• B(x)/C(x) = B(x) – C(x)

• B(x) – C(x) = B(x) XOR C(x)

Page 85: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 85

CRC

example from text (page 99):

given:

G(x) = x3+x2+1

M(x) = x7+x4+x3+x1

what is the value of P(x)?

(i.e., what bits are actually transmitted by the sender?)

Page 86: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 86

CRC

Page 87: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 87

CRC• how could an error escape the CRC method?• let E(x) be the errors “added” to T(x)• so, T(x) + E(x) is the incorrectly transmitted

frame

• one-bit error?• two-bit error?• error with odd number of bits?• burst error?

1500B (12000b) Ethernet frame: 32b CRC

Page 88: Don Montgomery, CSE Department, Southern Methodist University – ECS 4344Ch2, slide 1 an example routing illustration –using tracert or traceroute –xtraceroute

Don Montgomery, CSE Department, Southern Methodist University – ECS 4344 Ch2, slide 88

[needs work] Error Detection and Correction

Hamming distance (h) Error detection d H >= d+1 Hamming code

Burst error detection using hamming code Product codes