+ All Categories
Home > Documents > Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send...

Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send...

Date post: 11-Aug-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
81
Chapter 2 Direct Link Networks
Transcript
Page 1: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Chapter 2 Direct Link Networks

Page 2: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Hardware in Nodes

• DMA

• Programmed I/O

Page 3: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Typical bandwidth requirements

10Kbps

100Kbps

1Gbps

10Gbps

POTS

voiceVideo

conf

VHS

Qual

(MP4)‏

NTSC

B’cast

(MP4)‏

HDTV

B’cast

(MP4)‏

1Mbps

10Mbps

100Mbps

Raw

NTSC

Raw

HDTV

Page 4: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Common Wired Media Types and Speed

Electrical

(“Copper”)‏Optical

“Fiber”

Twisted

Pair

(“TWP”)‏

10-100 Mbps

100 m

Co-ax

Cable

10-100 Mbps

200-500 m

Multi

Mode

100 Mbps

2 km

Single

Mode

2.4 Gbps and up

40 km

Higher Bandwidth, Better Noise Immunity

Lower cost, Easier installation

Page 5: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Co-axial Cable

Plastic outer sheath

Braided metal sheath (ground)‏

Insulator

Copper signal conductor

Page 6: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Category 5 Twisted Pair

(“Cat5‏ TWP”)‏

Derived from telephone wire

Much cheaper, easier to work with than co-ax

Less noise immunity than coax

The dominant networking medium

Page 7: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Fiber optic cableThe idea: Pulsed laser light carried by glass fiber.

• Compared to copper:• Higher bandwidth

• Immunity to electrical noise

• More expensive. Harder to run and maintain

• Good for Long-Haul backbone applications

Page 8: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

The network architecture

cpu

mem nic

modem

Office / Home

substation LocalISP

rou

ter

LAN

“Last‏Mile

Link”

(One or a

few channels)‏

Regional ISP

Backbone

Providers

NetworkAccessPoints

“Long‏Haul

Links”

(1000’s‏of

Channels)

100’s‏of

channels

Page 9: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Common wired last-mile link

technologies

Analog

Voice modems 56Kbps

Digital

xDSL 128Kbps – 100Mbps

ISDN 128Kbps

Cable modems 1-40Mbps

Page 10: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Wireless Links

Frequency bands licensed to organizations

License-exempt

Transmission power

Spread spectrum

Frequency hopping

Direct sequence

IrDA

Page 11: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Encoding

Modulation

Two different voltages

Two different power levels

Page 12: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Data Encoding (1)

Basic encoding -- Non-Return to Zero (NRZ)

Clock

Data 0 0 0 1 0 1 1 0

NRZ

Problems

Baseline wander

Clock recovery

Page 13: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Data encoding (2)

Page 14: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Data Encoding (3) Manchester Code

0’s‏are‏L-H

transitions

1’s‏are‏H-L

transitions

A self-clocking‏code‏provides‏a‏synthetic‏“clock”‏as‏part‏of‏the‏datastream.‏‏The‏

receiver can use this to synch.

In‏the‏case‏of‏the‏Manchester‏code,‏NRZ‏is‏XORed‏with‏the‏sender’s‏clock‏to‏

provide a clock edge in every bit period.

Page 15: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Data Encoding (4) 4B/5B

Address inefficiency of the Manchester

encoding

Insert extra bits into the bit stream to break

long 0s and 1s

pp83

Page 16: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Framing

Byte-oriented

Bit-oriented

Clock-based

Page 17: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

IBM Binary Synchronous Communication

(BISYNC)

Page 18: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

DDCMP

Page 19: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

A bit-oriented protocolISO High-level Data Link Control (HDLC)

Page 20: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Clock-based framing protocols –

SONET (1)

Page 21: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Clock-based framing protocols –

SONET (2)

• Clock synchronization

• XOR data with a well-known bit pattern

STSN Multiplex/Concatenated

Page 22: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Error Detection

How do we detect that a frame/packet we have

received contains an error? (Error Detection)

And if we do, what do we do about it? (Error

Correction)

Page 23: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Error Detection

Usually done by sending redundant bits

We’d‏like‏to‏minimize‏the‏number‏of‏bits‏we‏add

We think about detection methods in terms of:

Numbers/types of errors detected

Efficiency (1-fraction of bits that are added for error control)

Page 24: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simple parity

Page 25: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

2D Parity

Page 26: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Checksum

• Checksum is calculated by adding

the data bytes

• Simple, fast for large data blocks

(files, etc.)

• Detects all single errors, many

others

• High efficiency (example: 1KB

file, 16-bit checksum 99.8%

efficiency)

Data byte

Data byte

Data byte

Data byte

Data byte

Checksum

+

Page 27: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Internet Checksum Algorithm

Page 28: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Cyclic Redundancy Check (CRC) (1)

Page 29: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

CRC (2)

• Very high efficiency

• Detects single, double, all odd errors

• Adding “r” CRC bits allows detection of burst errors of

r-1 bits

• Complex-looking arithmetic, but easily implemented in

hardware (pp97)

• Used in many networking applications

• 6 versions are widely used (pp101)

Page 30: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Reliable delivery

We want the protocol to implement

“reliable”‏frame‏delivery‏(as‏opposed‏to‏

“best‏effort”‏delivery)

By‏“reliable”,‏we‏mean‏that‏frames‏are:

All delivered

In order

Without bit errors

Page 31: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Fundamental Mechanisms

Acknowledgments

Timeouts

Retransmit

Page 32: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Flow Control Algorithms

Flow control is essential for ensuring that data

is successfully delivered (one part of reliable

data delivery)

Flow control is the set of rules that ensure

that‏receivers‏aren’t‏overwhelmed‏with‏data‏

(their receive buffers do not overflow)

LLC‏protocol‏algorithms‏are‏often‏called‏“flow‏

control‏algorithms”

Page 33: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

The simplest possible algorithm

(Simplex)

Sender:

As data is passed from the layer above, pack it

into frames and send it.

Receiver:

When a frame is received, unpack it and pass the

data to the layer above.

Page 34: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex Algorithm Operation

ABCD

A

A

BCD

CD

B

AB

D

C D

ABD

In Simplex, the sender doesn’t know

whether or not the receiver has actually

received a frame. This leads to out-of-

order data.

Try: Acknowledging each framee e e e

Page 35: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex + Acknowledgements

The idea:

When the receiver receives a frame, it sends

an‏acknowledgement‏(“ACK”)‏frame‏back‏so‏

that the sender knows the frame was received.

The sender will wait until the previous frame is

ACKed before sending the next one.

Page 36: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex + Acknowledgements:Operation

ABCD

A

A

BCD

CD

B

AB

Cack ackThis version deadlocks because the sender will

wait forever for an ACK after a lost frame.

Try: Adding timeouts

e e e

Page 37: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex + ACKs + timeouts

The Idea:

When the sender sends a frame, it starts a

timer. If the timer times out before the ACK is

received, the sender will re-send the last frame.

Page 38: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex + ACKs + timeouts:Operation (1)

A

B

C

D

A

A

B

C

D

C

D

B

A

B

Cack ack

Timeout interval

C ack

A

B

C

Resend

e e e e

Page 39: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Simplex + ACKs + timeouts:Operation (2)

A

B

C

D

A

A

A

A

A

ack ack

Timeout interval

This algorithm gets confused when an ACK is lost. When the

sender doesn’t get an ACK for the last frame sent, it times out

and resends that frame. The receiver does not recognize that it

has gotten two copies of the same frame.

Try: An indicator to show when a frame is repeated

Resend

e e

Page 40: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Stop-and-wait Automatic Repeat

Request (stop-and-wait ARQ)

The Idea:

The receiver needs to be able to determine

when it has received the same frame twice in a

row.‏‏We’ll‏add‏a‏flag‏to‏the‏frame‏that‏

alternates‏between‏”1“‏and‏‏.”0“‏This‏way,‏if‏the‏

receiver gets two frames in a row that have the

same flag, it will know that this is two copies of

the same frame and can ignore one of them.

Page 41: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Stop-and-Wait ARQ:Operation (1)

A

B

C

D

A

A

B

C

D

C

D

B

A

B

Cack ack

Timeout interval

C

D

C ack

A

B

C

0 1 0

Last Flag=0 Last Flag=1

0

Last Flag=0

e e e e0 1 0 0

Page 42: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Stop-and-Wait ARQ:Operation (2)

EFGH

E

E

FGH

E

E

ack ack

Timeout interval

0 0

Last Flag=0 Last Flag=0

F

EF

ack1

Last Flag=1

EFGH

0 0 1e e e

Page 43: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Four Cases

Page 44: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Success!!

We now have a protocol, Stop-and-wait ARQ, that will reliably transfer a frame across the link.

Now, what about efficiency? (Example pp104)

Page 45: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

The Go-Back-N Algorithm

The efficiency problem with S-a-W ARQ is due to the link being idle

while we wait for an ACK.

The Idea:

While we are waiting for the ACK for a frame, send out the next frames

up to a total of “N”. This will fill the idle time on the link.

If we receive no ACK for a frame, we will re-send that frame and the N-1

after it. We must number the frames so that the receiver will know which

frame it is getting and so that it can specify which frame it is ACKing.

Page 46: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Go-Back-NOperation (1)

ABCD

A

N=3

AB

ABC

ABCD

EF

BCDEF

CDEF

DEF

ABCDE

ABCDEF

Window defined

by last_sent and

last_acked

Page 47: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Go-Back-NOperation (2)

A

B

C

D

A

N=3

E

F

B

C

D

E

FTimeout

Wrong sn.

Ignore

Wrong sn.

IgnoreA

B

C

D

E

F

A

B

C

Page 48: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Better Efficiency, but still a problem

To maximize efficiency, we want to set N large enough so that the link is filled

while we’re waiting for the ACK (RTT+)

As the length of the link grows, RTT increases and we increase N to maintain

high efficiency.

But the higher N grows, the more frames we have to re-send after an error.

For an error-prone link, this can cancel any efficiency gains.

Example:

100Mbps link with RTT = 10 msec, Frames1000 bits long.

Each frame takes 1000 bits / 100 Mbps = 10 usec to send.

For max efficiency, set N >= 10msec / 10usec = 1000.

Assume we send 106 frames. x% have errors the first time they are sent.

If x=0 it takes 10 sec to send successfully.

If x=0.1%, 103 frames will be in error,

so 103 x 1000 = 106 frames will be re-sent for a total of 2 x 106 frames.

so it will take 20 seconds to send successfully.

Page 49: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

The Sliding Window Algorithm

The Idea:

When an error is detected, only the frame in error is re-sent.

(Note that this means the receiver must be able to receive frames out-of-

order and order them correctly -- a simple FIFO queue doesn’t work).

Detail:

– Implicit ACKs: If the receiver ACKs receiving frame F, that means F and

all preceding frames are ACKed

– The receiver can control data flow by withholding ACKs. This is usually

implemented as a “receive window size” that can be different from the

“send window size”

Page 50: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Sliding Window AlgorithmOperation (1)

A

B

C

D

A

Send Window Size=3

A

B

A

B

C

A

B

C

D

E

F

B

C

D

E

F

D

E

F

A

B

C

D

E

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

1

2

3

4

5

6

Receiver can

choose not to

ACK for flow

control purposes

1

2

3

4

5

6

Page 51: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Sliding Window AlgorithmOperation (2)

A

B

C

D

A

Window size=3

E

F

B

C

D

E

FTimeout

C

D

E

F

1

2

3

4

5

6

A

C

1

2

3

4

5

6

A

C

D

1

2

3

4

5

6

A

B

C

D

1

2

3

4

5

6

Page 52: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Success!!‏‏(…Really!)

The Sliding Window Algorithm provides reliable data

transfer with excellent efficiency

We’ll see it again in TCP

Page 53: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Something to notice about

Sequence Numbers Assume frame sequence numbers are encoded with n bits

Then they will roll over every 2n frames

We‏can’t‏afford‏to‏ever‏have‏two‏frames‏“in‏flight”‏with‏the‏same‏

sequence number

The implications are far-reaching:

Send window size can never be greater than 2n-1

Send and receive buffers must hold at least 2n-1 frames

As network speeds increase, we can can have more and more

frames in flight -- the 2n-1 limit becomes more important

Page 54: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

AppPresSessTransNetDLPhy

Media Access Control (MAC) Sublayer

Performs Data Link functions that depend

on the type of medium used

Performs Data Link functions that are

independent of the type of medium used

Logical Link Control (LLC) Sublayer

The data link layer is usually thought of (and often

implemented) as two distinct sublayers performing

different functions

The MAC Sublayer

Page 55: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Computer

NIC

Computer

NIC

Computer

NIC

Shared LANs

Network

Interface

Card

Shared Medium

A key thing to realize:

Every node on the LAN sees

every frame of data

Page 56: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Ethernet The most common LAN technology

IEEE Standard 802.3

Simple electronics, simple protocols

Versions with Bandwidths from 10Mbps to 10Gbps

Nomenclature:

100 Base T

Bandwidth in Mbps

(10, 100, 1000, 10000, 100000)

Type of Medium

“2” = Thinnet Coax

“5” = Thicknet Coax

“T” = Twisted pair

“F” = Optical fiber

Page 57: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Computer

Tap

Computer

Computer

Ethernet wiring

Coax

Computer Computer Computer Computer

Hub

Twisted

pair

Page 58: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

How does Ethernet work?

The basic ideas:

– carrier sense (CS): Every station can tell if the line is idle

– multiple access (MA): All stations have equal access to the line

– collision detection (CD): Stations monitor the line while they send.

They can tell if there is a “collision” with another station’s frame.

(This is called “listen while talk”)

= “CSMA/CD”

Page 59: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

PreambleDestination

AddressSource

AddressType/SIze

Data

8 6 6 2 0 to 1500 4bytes:

6-byte MAC addresses

(e.g., 04:A2:61:B4:CD:00)

Destination addresses with

high-order bit = 1 are multicast

addresses. All 1’s is a

broadcast.

Every MAC address is unique

world-wide

101010….

used as a

synch signal

CRC-32

error

detection

Pad

0 to 46

An Ethernet frame can

carry up to 1500 bytes of

data.

The frame, exclusive of

Preamble, must be at least

64 bytes long.

So there must be at least

46 bytes in the Data field.

If there are fewer, pad

bytes are added.

#

bytes

in

Data

field

Ethernet frame format

CRC

Page 60: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Example Ethernet frames

DestinationAddress

SourceAddress

100 Data

6 6 2 100 4

CRC

100 bytes of data

DestinationAddress

SourceAddress

10 Data

6 6 2 10 4

10 bytes of data

Pad

36

CRC

Data field padded to 46 bytes

Page 61: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Ethernet MAC Algorithms

SEND

While there are frames to send

Listen for a period of time (“Inter-Frame Gap”).

If line is idle, then

Listen while sending the frame.

If there is a collision while sending then

send a “Jamming signal” and stop

wait an amount of time determined by the “exponential backoff” algorithm

End

End

End

RECEIVE

When the start of a frame is sensed

Check the destination address. Copy the frame into the receive buffer if:

1. It is addressed to my MAC address, or

2. It is a broadcast frame, or

3. It is a multicast frame addressed to my multicast group, or

4. I am in “promiscuous” mode

Page 62: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Sending a frame

Sender senses the line and find it idle

t=0 Begins sending to a node at the

far end of the LAN

t=d

Call the end-to-end latency of

the ethernet “d”

t=2d

The amount of time needed to

send a frame can’t be less than

2d (we’ll see why later)

Page 63: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Collisions

Two nodes sense the line and find it idle.

Assume they are at the opposite

ends of the Ethernet.

t=0Both begin sending

t=d/2

The frames “collide”

The result of the collided frames is an

interference pattern that is gibberish.

The gibberish propagates throughout the

Ethernet.

t=d

The sending nodes, doing “listen while

talk” see that the data on the line doesn’t

match what they are sending. This tells

them a collision has occurred.

Page 64: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

A Bt=0

t=d- t=2d

t=d

t=d+

The “longest” collision

Two nodes, A and B, at opposite ends of the Ethernet. A sends, then B sends just

as A’s frame reaches B

In order for A to know about the collision of a frame sent at t=0, A has to still be sending at

t=2d.

This means that frames must be long enough to take at least 2d to send.

Page 65: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Ethernet parameters

The parameters of a particular type of Ethernet are specified in the particular IEEE

standard. These are usually set as a result of engineering trades and safety margins

(and they usually don’t match the theoretical values).

Parameters:

- Min length of a frame

- Min time required to send the min frame (“slot time”)

- Max length of the Ethernet (coax) or of connections to the hub (TWP)

- Max number of computers, repeaters, etc

10Mbps 512 bits 51.2 uS

Min frame length Slot time

100Mbps 512 bits 5.12 uS

1Gbps 4096 bits 4.096 uS

Page 66: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

1

2

3

n

Number

of

collisions

in a row

0 or 1

0, 1, 2, or 3

0,1,2,3,4,5,6 or 7

0…2n-1

Number of Slot times

colliding senders will

wait before re-trying

0.5

0.25

0.125

2-n

Probability of

another collision

on the next round

The Exponential Backoff algorithm

Problem:

After a collision, how long do the senders wait before trying again? We need a way to stagger or

randomize their wait intervals, but we want to minimize the wait times.

Exponential Backoff Algorithm forces senders to wait a # of slot times that is randomly picked from a

list. The list grows as the number of successive collisions grows. After n collisions, there are 2n

numbers in the list.

Note: n is limited so that NIC failures can be detected (type: n<=16).

Page 67: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Token Ring (IEEE 802.5)

A

C

BD

Frames are passed from node to node around the

ring.

There is a special “token” frame that circulates on the

ring.

To send, a node waits for the token, removes it from

the ring, sends its frame, then replaces the token.

Page 68: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

A

C

BD

To: C

A

C

BD

To: C

A

C

BD

To: C

A

C

BD To: C

A

C

BD

To: C

A

C

BD

To: C

Token Ring operation

Dearly

release

Page 69: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

SD AC ED

1 1 1

Token

SD AC* ED

1 1 1

Bit flipped to indicate

that this is a data frame,

not the token

Dest Addr Src Addr Data Checksum ED FS

6 6 no limit 4 1 1

Token Ring operation

Note similarity to Ethernet frame, especially MAC

address fields

Page 70: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Some Token Ring Parameters

4 and 16 Mbps

250 stations per ring max

Token Holding Time (max time a node can

hold the token -- prevents hogging):

default=10msec

Page 71: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

A problem with token rings

When there is a break anywhere in the

ring, all communication everywhere is lost

Page 72: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Fiber Distributed Data Interface (FDDI)

Dual counter-rotating rings

provide some ability to tolerate

a broken ring

FDDI Parameters

• 100 Mbps

• 500 stations max

• up to 2 Km between stations

Page 73: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Wireless

• Wireless technologies, pp134

• Topology

• Mobility – 3 levels

Page 74: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Some Characteristics

Page 75: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Bluetooth

• 2.45GHz

• Piconet

• Request and response

• Parked, low-power state

Page 76: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

The idea: a wireless version of the Ethernet

Standards Developed by IEEE

AKA‏“WiFi”

Compatible‏with‏other802‏’s‏at‏L3

802.11 Background

Page 77: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Basic 11a 11b 11g 11n

Released 1997 1999 1999 2003 2008

Freq. band 2.4Ghz 5Ghz 2.4GHz 2.4GHz 2.4, 5GHz

Max data

rate2 Mbps 54 Mbps 11 Mbps 19 Mbps 600 Mbps

Max Range(approx)

100m 100m 150m 150m 250m

802.11 standards

Page 78: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Some major differences from Ethernet

Most radios are half-duplex,‏so‏can’t‏Listen‏

While Talk, so no CD

So‏we‏can’t‏use‏CSMA/CD

Hidden node problem prevents CS

A‏station‏can’t‏be‏assured‏of‏hearing‏other‏

stations that are in range of a destination

Exposed node problem

Page 79: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Note: Collision Avoidance, not Detection

The protocol:

–‏(RTS)‏”Send‏to‏Request“‏broadcasts‏send‏to‏wishing‏Station‏.1

identifies desired receiver and length of message*

–‏(CTS)‏”Send‏to‏Clear“‏broadcasts‏Receiver‏.2 identifies sender and

length

3. Sender knows it can proceed with transmit. Any other station that

hears the CTS knows it must stay silent.

4. Sender proceeds with transmit.

‏signal‏a‏is‏This‏‏.”ACK“‏broadcasts‏receiver‏,transmission‏of‏end‏At‏.5

to other stations that they can try an RTS.

* If there is a collision between two RTS’s, the receiver will hear garbage and

will not CTS. Senders will time out and retry according to Exponential

Backoff Algorithm.

Multiple Access Collision Avoidance for Wireless (MACAW)

Page 80: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

Probe

Probe Response

Association Request

Association Response

Base-Station-Oriented

Page 81: Chapter 2 Direct Link Networks - UAHfzhu/570/Chap2Part1.pdfIf x=0 it takes 10 sec to send successfully. If x=0.1%, 10 3 frames will be in error, so 10 3 x 1000 = 10 6 frames will be

WiMax (802.16)

Last mile technology 1-6 miles

Line-of-sight and nonline-of sight

10-66 GHz

Mobility

Connection oriented

Up to 75Mbps


Recommended