computer networks: introduction ivan marsic rutgers university chapter 1 – introduction

159
Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Upload: kory-haynes

Post on 25-Dec-2015

228 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Computer Networks:Introduction

Ivan Marsic

Rutgers University

Chapter 1 – Introduction

Page 2: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Introduction to Data

Networking

Goals Communication Media Protocols Reliable Transmission

Page 3: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

User Goals and Tunable Knobs

NetworkEngineer

Network topology

Communication protocols

Network architecture

ComponentsPhysical medium

Tunable network parameters:

Customer

Visible network properties:

Correctness Fault tolerance Timeliness CostDelivery

Page 4: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topology vs. RobustnessPaul Baran, 1964

Centralized DistributedDecentralized

Node

Link

(a) (b) (c)

Page 5: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Internet Map: Major ISPs

Page 6: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Fully Interconnected Network

New York City, 1888

Page 7: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Early Telephone Switching Offices

Page 8: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

1924: First Mobile Telephone

The first version of a mobile radio telephone being used in 1924.

Page 9: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Exploiting Locality

Saul Steinberg,“A View of the Worldfrom Ninth Avenue,”

cover ofThe New YorkerMarch 29, 1976

Page 10: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Distortion of Signals

Voltage at transmitting end

Idealized voltage at receiving end

Line noise

Voltage at receiving end

threshold "0"/"1"

Page 11: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Packet Error Rate Approximation

BERnn eBERPER 1)1(1

PER = packet error rateBER = bit error raten = packet length [in bits]

Page 12: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Packet Transmission (1)

Example: Sender sends a 6-bit packet “101101” to the receiver

Tim

e

Sender Receiver

Communication linkPhysical setup:

Timeline diagram:

transmission

delay

propag

ationdela

y10110

1

101101

Start of transmission

End of reception

Electromagnetic wave propagation

Electromagnetic wave propagation

First drop of the fluidenters the pipe

Fluid packet in transit

Last drop of the fluidexits the pipe

Fluid flow analogy:

Page 13: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Transmission Link Capacity

01 1 1 0 0 1

01 11001Time

Link 1:1 Mbps

Link 2:10 Mbps

100ns

1s

Effect of link speed: Link 2 can transmit 10 times more bits per unit of time or, Link 2 can transmit the same message in a 10 times shorter period

Page 14: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Wireless Communication

Point source Interfering sources

Interferencepattern

Page 15: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Radio Signal Propagation

Ray tracing simulation in a closed office environment.

Signal intensity map for a room with a doorway and a metal desk

doordoor

deskdesk

Page 16: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Transmission / Interference Range

TransmissionTransmissionrangerange

InterferenceInterferencerangerange

InterferingInterferingsourcesource

Receiver

Transmittedsignal power

Received signal power from an interfering source

B

C

D

E

InterferingInterferingsourcesource

Threshold

InterferingInterferingsourcesource

Threshold

0 0 Distance from receiverDistance from sender

A

Sender

Page 17: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Protocols

Person BPerson A

Physical transport obeys transportation and traffic rules

Letter

(Message)

Letter inenvelope(Packet)

Postal-vehicle service-transportation routes obey carrier-

route maps and delivery timetables

Customer interaction obeys mail acceptance and delivery procedures (Postal Service’s

Mail Manual)

User-to-user interactions obey social norms

Layer i

Layer i 1

send() handle()

Page 18: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Statistical Multiplexing

City A

City CCity B (a)

City D

City C

City A

City B

(b)

City D

Page 19: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

3-Layer Protocol StackProtocol at layer i depends only on the protocols at i1 (not at i1!)

Layered architecture Layer function

• IEEE 802.11 WiFi• IEEE 802.3 Ethernet• PPP (modems, T1)

• Internet Protocol (IP)

Examples

• Transmission ControlProtocol (TCP)

• Real-time TransportProtocol (RTP)

Application specific connections

Source-to-destination routing

Packet exchange

2: Network

1: Link

3: End-to-End

Service interface between L2 & L3

Service interface between L1 & L2

Layered architecture Layer function

• IEEE 802.11 WiFi• IEEE 802.3 Ethernet• PPP (modems, T1)

• Internet Protocol (IP)

Examples

• Transmission ControlProtocol (TCP)

• Real-time TransportProtocol (RTP)

Application specific connections

Source-to-destination routing

Packet exchange

2: Network

1: Link

3: End-to-End

Service interface between L2 & L3

Service interface between L1 & L2

Page 20: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Layer 1 / 3-Layer Protocol Stack

Link Layer:Protocol modules at layer 1 (bottom layer) exchange packets over the link

Page 21: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Layer 2 / 3-Layer Protocol Stack

Network Layer:Protocol modules at layer 2 (middle layer) route packets from sourceto destination (possibly over many links)

Page 22: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Layer 3 / 3-Layer Protocol Stack

End-to-End Layer:Protocol modules at layer 3 (top layer) create illusion of different link types(tailored to application-specific needs)

Applications: Network games Internet telephony Email

Page 23: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Protocol Layers at Hosts/Switches

1:

2:

3:

1:

2:

:1

:2

:3

Physical communication Physical communication

End host A End host B

Intermediatenode (router)

Physical setup:Physical setup:

Protocol stack:Protocol stack:

Communication link

Communication link

Link

Network

Link

Network

Link

Network

End-to-End

Application

Link

Network

End-to-End

Application

Link

Network

End-to-End

Application

Link

Network

End-to-End

Application

Page 24: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Bit Stuffing for Transparency

Linklayer

Linklayer

handle( )

send( )01111110 1010010111101011 01111110 1010010111101011

01111110 1010010111101011 01111110 1010010111101011

receiveBits() sendBits()

0111111001111110 10111110101111101110101111101011 0111111001111110 1010010110100101

Packet start pattern(preamble)

Header Payload

actual datathat looks like

preamble

escape

“stuffed” data

“stuffing” removed

SENDERSENDERRECEIVERRECEIVER

Page 25: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ISO OSI Protocol Stack

• Wireless link (WiFi)• Wired link (Ethernet)

• Radio spectrum• Infrared• Fiber• Copper

• Source-to-destination (IP)• Routing• Address resolution

• Reliable (TCP)• Real-time (RTP)

Visit http://en.wikipedia.org/wiki/OSI_model for more details on the OSI Reference Architecture

• Data translation (MIME)• Encryption (SSL)• Compression

• Application services (SIP, FTP, HTTP, Telnet, …)

• Dialog control• Synchronization

7: Application

6: Presentation

5: Session

4: Transport

3: Network

2: Data Link

1: Physical

MAC

Page 26: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Packet Nesting Across Layers

Application data

Layer-3header

Layer-3 payloadLayer-3header

Layer-3 payload

010010110110001011100100101100000101101

Application dataLayer-2header

Layer-2 payload

Layer-1header

Application dataLayer-1 payload

Application data

Layer-3header

Layer-3 payloadLayer-3header

Layer-3 payload

010010110110001011100100101100000101101

Application dataLayer-2header

Layer-2 payload

Layer-1header

Application dataLayer-1 payload

Physicalcommunication

Sender’sprotocol stack

Receiver’sprotocol stack

Page 27: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

How Headers Guide Packets

Layer 2: Network

Layer 1: Link

Router

Layer 2: Network

Layer 1: Link

Router

Receiver Endpoint

Layer 2: Network

Layer 1: Link

Layer 3: End-to-End

Application

Sender Endpoint

Layer 2: Network

Layer 1: Link

Layer 3: End-to-End

Application

Linklayer hdr

Networklayer hdr

End-endlayer hdr

Application dataLink

layer hdrNetworklayer hdr

End-endlayer hdr

Application data

At sender, each layer protocol creates its own header type.Headers are nested; application data is nested deepest

At router, each layer examines onlyits own header:1. Router’s Link layer protocol checks

that this packet is for this node2. Router’s Network layer protocol decides

the outgoing link based on destin. addr.

1

2

Linklayer hdr

Networklayer hdr

End-endlayer hdr

Application dataLink

layer hdrNetworklayer hdr

End-endlayer hdr

Application data

At receiver, each layer examinesonly its own header type:1. Receiver’s Link protocol checks Link-layer

header that this packet is for this node2. Network protocol demultiplexes for

End-to-end protocol based onthe Network-layer header

3. Receiver’s End-to-end protocoldemultiplexes for receiver application

4

At router, each layer protocolcreates its own header type.3

Packet:

Page 28: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Error Detection and Correction

1817 1916 2015141312 21 22 23 241817 1916 2015141312 21 22 23 24

3130 3229 3328272625 34 35 3624 3130 3229 3328272625 34 35 3624

5554 5653 5752515049 58 59 6048 5554 5653 5752515049 58 59 6048 5554 5653 5752515049 58 59 6048

6

5

74

8

9

2

3

10

11

1

0 6

5

74

8

9

2

3

10

11

1

0

30

29

31

2832

3326

27

34

35

25

30

29

31

2832

3326

27

34

35

25

1817

1916

20

21

14

15

22

23

24

13

12

1817

1916

20

21

14

15

22

23

24

13

12

54

53

55

5256

57 50

51

58

59

60

49

54

53

55

5256

57 50

51

58

59

60

49

42 4143

40

4445

3839

46

47

37

36

48 42 4143

40

4445

3839

46

47

37

36

48

Page 29: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Interleaving

“theme illicts scenic graphics since poorest Ally.”

“All science is either physics or stamp collecting.”

“theme illicts scenic graphics since poorest Ally.”

“All science is either physics or stamp collecting.”Forwardinterleaving:

A l l s c i e n c e i s

e csl tt lt e imh i c s

e e nc gc io l l tei t h r o r s t a m pp h y s i c s e nc gc io l l tei t h r o r s t a m pp h y s i c s

ie n c g c i oh e r tor s la p s A li cn ep ys

detail

“theme illicts scenic strictly since poorest Ally.”

“All sctence is eitcer ihysicy ot strmp lollectins.”

Inverseinterleaving:

Page 30: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Packet Transmission (2)T

ime

Tim

e

Sender Receiver

Datatransmissiondelay propagation

delay

Data

ACK

processingdelay

processingdelay

Page 31: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Transmission and Propagation Delays

)secondper bits(

)bits(

bandwidth

lengthpacket

R

Ltx

)m/s(

)m(

velocity

distance

v

dt p

Transmission delay:

Propagation delay:

Page 32: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Fluid Flow Analogy

Queued buckets

Layer 1receiver

Layer 2sender

Layer 2receiver

Layer 1sender

Page 33: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

What Contributes to RTT

Transport layer

Network layer

Link+Phys layer

Sender

Send data

Receive ACK

Send packet

Receive packet

Transport layer

Network layer

Link+Phys layer

Receiver

Send ACK

Receive data

Send packet

Receive packet

Propagation delay (sender receiver)

Propagation delay (receiver sender)

Processing and transmission delayswithin link/physical layers

Processing delay within network layers

Processing delay within transport layersTransport layer

Network layer

Link+Phys layer

Sender

Send data

Receive ACK

Send packet

Receive packet

Transport layer

Network layer

Link+Phys layer

Receiver

Send ACK

Receive data

Send packet

Receive packet

Propagation delay (sender receiver)

Propagation delay (receiver sender)

Processing and transmission delayswithin link/physical layers

Processing delay within network layers

Processing delay within transport layers

Page 34: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Reliable Transmission via

Retransmission

Stop-and-Wait

Go-Back-N

Selective Repeat

Page 35: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Automatic Repeat reQuest (ARQ)

• Stop-and-wait ARQ– Transmit a frame and wait for acknowledgement (ACK)– If positive ACK from receiver, send next frame– If ACK does not arrive after a certain period of time (Timeout), retransmits the frame– Simple, low efficiency

• Go-back-N ARQ– Transmit frames continuously, no waiting– The receiver only ACKs the highest-numbered frames received in sequence– ACK comes back after a round-trip delay– If timeout, the sender retransmits the frames that are not ACKed and N–1 succeeding frames that

were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)– Need buffer at sender, does not have to buffer the frames at the receiver, – Moderate efficiency and complexity. Less efficient when the round-trip delay is large and data

transmission rate is high• Selective-repeat ARQ

– Transmit continuously, no waiting– The receiver ACKs all successfully received frames – The sender only retransmits (repeats) the unACKed frames when their timers expire– Most efficient, but most complex, buffer needed at both sender & receiver, needs per-frame timer

Page 36: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Stop-and-Wait with ErrorsT

ime

Sender Receiver1s

t atte

mpt

transmissiontime

timeouttime

2nd

atte

mpt

k-th

atte

mpt

k+1

st a

ttem

pt

transmissiontime

RTTReceivederror-free

(error)

(error)

(error)

ACK

Packet i

Packet i (retransmission)

Packet i (retransmission)

Packet i (retransmission)

Send dataSet timer

Timer expiresResend dataSet new timer

Timer expiresResend dataSet new timer

Receive ACKReset timer

Page 37: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Stop & Wait Sender Utilization

px

xWSsender tt

tU

2&

ACKDATAsucc 11 ee ppp

failfailsuccsucc

total&

}{

}{

tptp

t

TE

NEtUE xxWS

sender

Stop & Wait sender utilization, under error-free transmission:

Probability of successful transmission, with error rate pe:

Expected sender utilization for Stop & Wait, under errors:

Page 38: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Sliding Window – Keeping the Pipe Full

Goal: Sender should be busy sending packets (as long as it has packets ready to send)

• Sender utilization as a metric of protocol performance

• “Keeping the pipe full”

Page 39: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Sliding Window ARQSender

0 1 2 3 4 5 6 7 8

0 1 2 3 4 5 6 7 8 9

Senderwindow N = 4

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

Already ACK’d

Sent, not yet ACK’d

Allowed to send

NOT allowed to send

Key:Already ACK’d

Sent, not yet ACK’d

Allowed to send

NOT allowed to send

Key:

Receiver

PktPkt--11

PktPkt--22

PktPkt--33

PktPkt--00

AckAck--11

AckAck--22

AckAck--33

AckAck--00

PktPkt--55

PktPkt--66

PktPkt--77

PktPkt--44

AckAck--55

AckAck--66

AckAck--77

AckAck--44

PktPkt--99

PktPkt--88

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10 11

Received in-order & ACK’d

Expected, not yet received

Acceptable to receive

NOT acceptable

Key:Received in-order & ACK’d

Expected, not yet received

Acceptable to receive

NOT acceptable

Key:

Receiverwindow W = 4

Page 40: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Go-back-N ARQ

Sender ReceiverWindow N = 3

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10 11

1 2 3 4 5 6 7 8 9 10 11

2 3 4 5 6 7 8 9 10 11

Timeout for Pkt-1

1 2 3 4 5 6 7 8 9 10 11

discard Pkt-2

discard Pkt-3

1 2 3 4 5 6 7 8 9 10 11

4 5 6 7 8 9 10 11

4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

2 3 4 5 6 7 8 9 10

3 4 5 6 7 8 9 10

4 5 6 7 8 9 10

Next expectedseq.num.

(loss)Ack-0

Pkt-0

Pkt-1

Pkt-2

Ack-0

Ack-1

Ack-2

Ack-3

Pkt-3

Pkt-1

Pkt-2

Pkt-3

Ack-0

(loss)

Pkt-5

Pkt-6Ack-4

Pkt-4

(retra

nsmiss

ions)

Page 41: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Selective Repeat ARQ

0 1 2 3 4 5 6 7 8 9 10 11

Sender ReceiverSender window N = 3

0 1 2 3 4 5 6 7 8 9 10 11

0 1 2 3 4 5 6 7 8 9 10 11

1 2 3 4 5 6 7 8 9 10 11

4 5 6 7 8 9 10 11

Timeout for Pkt-1

1 2 3 4 5 6 7 8 9 10 11

buffer Pkt-2

buffer Pkt-3

4 5 6 7 8 9 10 11

4 5 6 7 8 9 10 11

window W = 3

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

0 1 2 3 4 5 6 7 8 9 10

(loss)Ack-0

Pkt-0

Pkt-1

Pkt-2

Ack-2

Ack-1

Pkt-3

Pkt-1

Ack-3

Ack-4

Ack-5

Pkt-4

Pkt-5

Pkt-6

(retransmission)

Page 42: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Acknowledgements: GBN vs. SR

(a) Go-back-N (b) Selective Repeat

Sender Receiver

1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

3 4 5 6 7

1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

2 3 4 5 6 7

3 4 5 6 7

4 5 6 7

3 4 5 6 7

Sender Receiver

1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

0 1 2 3 4 5 6 70 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

Timeout for Pkt-10 1 2 3 4 5 6 7

0 1 2 3 4 5 6 7

discardduplicate Pkt-1

1 2 3 4 5 6 7

1 2 3 4 5 6 7

Ack-0

Ack-1

Ack-2

Pkt-0

Pkt-1

Pkt-2

(loss)

Pkt-1

Ack-3

Pkt-3

Ack-1

Ack-0

Ack-1

Ack-2

Pkt-0

Pkt-1

Pkt-2

(loss)

Pkt-4

Pkt-6

Ack-3

Pkt-3

Pkt-5

Page 43: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Broadcast and Wireless Links

ALOHA Hidden and Exposed Stations Carrier Sensing Multiple Access CSMA/CD, CSMA/CD

Page 44: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Transmission Cone

TR

AN

SM

ISS

ION

TR

AN

SM

ISS

ION

Sender

Receiver

Tim

e

Omnidirectionaltransmission

in 3D

(a)

RE

CE

PT

ION

RE

CE

PT

ION

Time

Receiver Sender

DistanceSimplified

representationin 2D

(b)

TR

AN

SM

ISS

ION

TR

AN

SM

ISS

ION

RE

CE

PT

ION

RE

CE

PT

ION

PROPAGATIONPROPAGATION

Distance from sender

Page 45: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Transmission Cone, Collision& Vulnerable Period

Collision occurs if two (or more) transmission cones overlap.

A

C

B

R

A

C

B

R

Time

Receiver

ABC

Receiver

ABC

Time

Receiver

ABC

(c) (d) (e)

Distance

B’stransmission

collision

collision

A’stransmission

B’stransmission

A’stransmission

A’stransmission

C’stransmission

C’stransmission

Time

Distance from the ReceiverReceiver

A B C(b)

(a)

Page 46: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Parameter

Lv

Rd

t

t

x

p

maxmax

Ratio of propagation delay vs. packet transmission time:

Page 47: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Parameter

Ratio of propagation delay vs. packet transmission time

Tim

eT

ime

(a)

Sender Receiver

Packet transmission

propagationdelay = 333 nstransmission

delay = 8.192 ms

propagation constant 0.00004

Local area network, diameter = 100m

Sender Receiver

Packet transmission

propagationdelay =119.3 ms

transmissiondelay = 8.192 ms

(b)

propagation constant 14.6

Geosynchronous satellite

Page 48: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ALOHA and Slotted ALOHASender’s State Diagram

START

HERE:

New packet

ready

Page 49: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ALOHA Packet TransmissionT

ime

Tim

e

Sender B

transmissiondelay

Sender A Receiver

Data

ACK

propagationdelay from A

Data

receiver’s vulnerableperiod(for receiving data from A)

vulnerable period for pure ALOHA = 2 packet-time

propagationdelay from B

Page 50: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

When transmission cones of ALOHA stations overlap?

A collides with an earlier transmission from B

Sender BSender A Receiver

A transmission from B will collide with A ifB started no earlier than tx – 1x relative to Atstart(B) = tstart(A) – tx + 1x

A collides with a later transmission from B

Sender BSender A Receiver

A transmission from B will collide with A ifB started no later than tx – 1x relative to Atstart(B) = tstart(A) + tx – 1x

tstart(A)

tstart(B)

tstart(B)

tstart(A)

tstart(A) – tx + 1x = tstart(B) = tstart(A) + tx – 1x

Page 51: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ALOHA Scenario

SystemReceiverReceiver

/m

/m/m

/m

System Output = S

Transmission Attempts = G

User m

User1

User2 System Input = m =

mSystem Input = m = m

“Fresh” station

“Backlogged” station

Key:

“Fresh” station

“Backlogged” station

Key:

Page 52: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Backlogged Stations

• “Fresh” stations transmit new packets

• “Backlogged” stations re-transmit collided packets

ReceiverReceiver

Fresh Station

Backlogged Station

/m

/m

“Fresh” station

“Backlogged” station

“Fresh” station

“Backlogged” station

Page 53: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Analysis of Slotted ALOHA (1)

ASSUMPTIONS FOR ANALYSIS:• All packets require 1 slot for x-mit• Poisson arrivals, arrival rate • Collision or perfect reception (no errors)• Immediate feedback (0, 1, e)• Retransmission of collisions (backlogged

stations)• No buffering or infinite set of stations

(m = )i 1 i i 1 i 2

Time Slots

Page 54: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ALOHA Model

ChannelG

SGP0

G(1 P0)

Freshpackets

Collided packets(to be retransmitted)

Successfullytransmitted packets

Combined, fresh andretransmitted packets

Page 55: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Analysis of Slotted ALOHA (2)

• 0 < < 1, since at most 1 packet / slot

• Equilibrium: departure rate = arrival rate

• Backlogged stations transmit randomly

• Retransmissions + new transmissions:Poisson process with parameter G >

,...1,0,!

)()()( n

nentAtAP

n

Page 56: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Analysis of Slotted ALOHA (2)

• Throughput = arrival rate probability of no collision

• Slotted ALOHA throughput:

• Pure ALOHA throughput:

GeGtAtAPGPGS 0)()1(0

GeGtAtAPGPGS 20 0)()(

Page 57: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Efficiency of ALOHA’s

S-ALOHA: In equilibrium, arrival rate = departure rate: = GeG

Max departure rate (throughput) = 1/e 0.368 @ G = 1

0 0.5 1.0 1.5 2.0 3.0

0.1

0.2

0.3

0.4 Slotted ALOHA: S = Ge–G

Pure ALOHA: S = Ge–2G

G (transmission attempts per packet time)

Arrival rate

Equilibrium

S(t

hro

ughp

ut p

er

pack

et t

ime)

0 0.5 1.0 1.5 2.0 3.0

0.1

0.2

0.3

0.4 Slotted ALOHA: S = Ge–G

Pure ALOHA: S = Ge–2G

G (transmission attempts per packet time)

Arrival rate

Equilibrium

S(t

hro

ughp

ut p

er

pack

et t

ime)

Page 58: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Unslotted (Pure) ALOHA

• Assume: all packets same size, but no fixed slots

• The packet suffers no collision if no other packet is sent within 2 packets long: S=GP0=Ge2G

• Max throughput 1/2e 0.184 @ G = 0.5• Less efficient than S-ALOHA, but simpler,

no global time synchronization

i

Page 59: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Hidden Stations

BA C

BA C

BA C

BA C

Range of C’stransmissions

Range of A’stransmissions

A is transmitting to B.

C wants to transmit and listens before talk but cannot hear A because A is too far away

(A’s radio signal is too weak for C to hear, so A and C are “hidden stations” to each other).

C concludes that the medium is idle and transmits, thus interfering with B’s reception.

Page 60: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Exposed Stations

AB

CD

AB

CD

AB

CD

AB

CD

B is transmitting to A.

C wants to transmit to D, it listens before talk and hears B so it refrains from transmitting although its transmission would not interfere with A’s reception.

Therefore, C is an “exposed station” to B.Note that for C to be allowed to transmit, C must know that A is not located in its transmission range and that D is not in B’s transmission range. Hidden station problem is much simpler to solve!

Page 61: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Exponential Backoff

Key idea:increasing number of choices reduces the probability of repeated collisions

Dicesix choices

{1, 2, 3, 4, 5, 6}

Cointwo choices

{0, 1}

Roulette38 choices (American){0, 00, 1, 2, 3, …, 36}

Page 62: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Wired Broadcast Media & CSMA

File Server

NodesAPrinter

(a)

(b)

Wired broadcast medium

Page 63: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CSMA / CD Sender’s State Diag’m

Page 64: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Analysis of CSMA/CD

1succ 1)tdon' others , transmitsone(

1

mqqm

mp

LRepRL

RL

wt

t

succx

x

/21

1

/2/

/CSMA/CD

Probability of a successful transmission:

Channel efficiency for CSMA/CD:

Page 65: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CSMA/CD Collision Detection

STA 1 STA 2

Both stations are listeningt1

t2

t3

t4

t5

STA1 begins transmission

STA2 begins transmission

STA2 detects collision and

transmits jam signal

STA1 detects collision before

ending transmission

Time

Page 66: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CSMA/CD Backoff Example

Collision (aborttransmission)

Jam signal

Key:

Backoff slot

Collision (aborttransmission)

Jam signal

Key:

Backoff slot

STA 1

STA 2

STA 3

Previousframe

STA2, 1st frame

0

1 0

0

0

1 0

2 1 0

1

3

0

3

CWSTA1 = 2

CW STA2= 0

CWSTA1 = 8

CWSTA3 = 2 CWSTA3 = 4

STA22nd frame

2

2

1 0

1 0

CWSTA1 = 4

CWSTA3 = 8

CWSTA2 = 0CW STA2= 2

CW STA2= 4 CWSTA2 = 2

STA 1

STA 2

STA 3

Previousframe

STA2, 1st frame

0

1 0

0

0

1 0

2 1 0

1

3

0

3

CWSTA1 = 2

CW STA2= 0

CWSTA1 = 8

CWSTA3 = 2 CWSTA3 = 4

STA22nd frame

2

2

1 0

1 0

CWSTA1 = 4

CWSTA3 = 8

CWSTA2 = 0CW STA2= 2

CW STA2= 4 CWSTA2 = 2

TimeTime

STA3, 1st frame

6

2 1

5

0

4 3

CWSTA1 = 16

CWSTA3 = 16

2 1 0

STA1, 1st frame

CWSTA3 = 0

STA2, 2nd frame

Page 67: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CSMA / CA Sender’s State Diag’m

Page 68: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Efficiency of CSMA protocols

SlottedALOHA

Pure ALOHA

1-persistent CSMA

NonpersistentCSMA

NonpersistentCSMA/CD

S(t

hrou

ghp

ut p

er p

acke

t tim

e)

G (transmission attempts per packet time)0.1

0.2

0.4

0.6

0.8

1.0

1 10 100 1000

= 0.01

g = (2)

g (transmission attempts per slot time)

1 2

Arrival rate

Equilibrium

Departure rate

1 ge g

1 e g

Th

rou

ghpu

t pe

r sl

ot

time

(a)

(b)

Page 69: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Delay vs. Arrival Rate

Arrival rate per station

Average packet delay

ALOHACSMA/CA

TDMA

Maximum channeltransmission rate

CSMA/CD

Page 70: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Internetworking

Routing & Forwarding Internet Protocol (IPv4); Datagram Fragmentation

Link State Routing; Distance Vector Routing Addressing; CIDR

Page 71: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Packet Switching / Routing

Packet switching device

Networkports

Page 72: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example Internetwork

R1

R2

E F

A

B

C

DNetwork 2:Wi-Fi

Network 3:Ethernet

Network 5: EthernetNetwork 4:

Point-to-point

Network 1: Point- to-point

(a) (b)

R1

R2

A

B

C

D

E F

Interfaces onNetwork 3

Interfaces onNetwork 5

Interfaces onNetwork 2

Interfaces onNetwork 1

Interfaces onNetwork 4

Page 73: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Protocol Stack atEnd-points vs. Routers

Layer 2:

Network

Layer 1:

Link

Layer 3:

End-to-End

IP (Internet Protocol)IP (Internet Protocol)Layer 2:

Network

Layer 1:

Link

Layer 3:

End-to-End

Routing Protocol(OSPF, RIP, BGP, …)

Routing Protocol(OSPF, RIP, BGP, …)

End-point protocol stack: Router protocol stack:

Page 74: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Routing Problem

“Forwarding table”

“Packets”

“Interface 1”“Interface 2”

“Interface 3”

“Interface 4”

PacketsRouter

Forwarding table

(a)

(b) Destination

ece.rutgers.edu

cs.rutgers.edu

Output Interface

Interface 3

Interface 2

Destination

ece.rutgers.edu

cs.rutgers.edu

Output Interface

Interface 3

Interface 2

Page 75: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network-layer Protocol:Internet Protocol (IP)

send()

IP protocol

Link layer protocol

“User protocol”

handle()

IP protocol

Link layer protocol

“User protocol”

Sender Receiver

Page 76: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

IPv4 Header

8-bit differentiatedservices (DS)

16-bit datagram length(in bytes)

16-bit datagram identification

options (if any)

data

0 15 16 31

8-bit time to live(TTL)

16-bit header checksum

13-bit fragment offset

4-bitversionnumber

20bytes

4-bitheaderlength

32-bit destination IP address

32-bit source IP address

8-bit user protocol

unused

DF

MF

7 8

flags

Page 77: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Dotted Decimal Notation for IPv4

128 . 6 . 29 . 131

32-bit IPv4 address (binary representation):

dotted decimal notation:

host name (for human use):

10000000 00000110 00011101 10000011

ece . rutgers . edu

associated by a lookup table

(application-layer address)

(network-layer address)

Page 78: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Domain Name System (DNS)

UserWeb server

www.comp.orgDNS client

visit websitewww.comp.org

Web browser passes the name “www.comp.org” to DNS client

DNS client sends query with “www.comp.org” to DNS server

DNS server responds with IP address of “www.comp.org”

DNS client passes the IP address to Web browser

Web browser initiates connection to the Web server using its IP address

DNS server

Internet

Page 79: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

IP Datagram Fragmentation (1)

(a)

Wi-Fi

Eth

erne

t

point-to-point

Host A

Host D

Router B

Router C

MTU = 1200 bytes

MTU = 512 bytes

MTU = 1024 bytes

Page 80: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

IP Datagram Fragmentation (2)

Application

TCP layer

IPlayer

JPEG image1.5 Kbytes

JPEGheader

Image pixels

1,536 bytes

TCPheader

TCP payload( 1,160 bytes )

1,180 bytes

TCPheader

TCP payload( 376 bytes )

396 bytes

TCPheader

TCP payload( 1,160 bytes )

1,200 bytes

IPheader

IP payload( 1,180 bytes )

1,200 bytes

IPheader

IPheader

IP payload( 488 bytes )

508 bytes

IPheader

IP payload( 488 bytes )

508 bytes

IPheader

IP pyld204 B

224 bytes

Host A

Router B

MF-flag = 1Offset = 0ID = 73592

MF-flag = 0Offset = 0ID = 73592

MF-flag = 0Offset = 0ID = 73593

IPheader

MF-flag = 1Offset = 61ID = 73592

MF-flag = 0Offset = 122ID = 73592

Headers of the fragment datagrams

IPlayer

416 bytes

NO FRAGMENTATIONFRAGMENTATION OCCURS HERE

Page 81: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Datagram Reassembly at Host D

Page 82: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network Routing: Link State

TentatTentatnodesnodes

iveiveTentatTentatnodesnodes

iveive

11

11

11

11

4444

25

4

7

NodeB

NodeC

NodeD

Sourcenode A

NodeE

11

11

Set of confirmednodes N (A)

25

7B

C

D

A

E

UnconfirmedUnconfirmednodes nodes NN N N (A)(A)

25

7B

C

D

A

E

Step 0

Step 1 Step 2

NodeF66

F66

F66

TentativeTentativenodesnodes

TentativeTentativenodesnodes

0 00

N (A)1N (A)1 N (A)2N (A)2

Page 83: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network Example for Routing Protocols

7

1

1

10

C

A

B

D1

7

1

1

10

C

A

B

D1

Original networkScenario 1:

Cost c(C,D) 1Scenario 2:

Link BD outageScenario 3:

Link BC outage

71

10

C

A

B

D1

71

10

C

A

B

D1

7

1

1

10

C

A

B

D

7

1

1

10

C

A

B

D

7

1

1

10

C

A

B

D1

1

7

1

1

10

C

A

B

D1

1

(a) (b) (c) (d)

Page 84: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example of Link State Routing

Step Confirmed set N Tentative set Comments

0 (A, 0, ) Initially, A is the only member of Confirmed(A), so examine A’s LSA.

1 (A, 0, ) (B, 10, B),(C, 1, C)

A’s LSA says that B and C are reachable at costs 10 and 1, respectively. Since these are currently the lowest known costs, put on Tentative(A) list.

2 (A, 0, ), (C, 1, C) (B, 10, B)Move lowest-cost member (C) of Tentative(A) into Confirmed set. Next, examine LSA of newly confirmed member C.

3 (A, 0, ), (C, 1, C) (B, 2, C),(D, 8, C)

Cost to reach B through C is 11=2, so replace (B, 10, B). C’s LSA also says that D is reachable at cost 71=8.

4 (A, 0, ), (C, 1, C), (B, 2, C) (D, 8, C) Move lowest-cost member (B) of Tentative(A)

into Confirmed, then look at B’s LSA.

5 (A, 0, ), (C, 1, C), (B, 2, C) (D, 3, C) Because D is reachable via B at cost 111=3,

replace the Tentative(A) entry for D.

6 (A, 0, ), (C, 1, C), (B, 2, C), (D, 3, C) Move lowest-cost member (D) of Tentative(A)

into Confirmed. END.

Page 85: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example – Link State (1)

1

10

C

A

B

D

B C

10 1

Neighbor

Cost

Seq.#= 1

NodeID= A

B C

10 1

Neighbor

Cost

Seq.#= 1

NodeID= A

A’s LSAbroadcast from node A

A’s LSAre-broadcast from B

A’s LSAre-broadcast from C

Page 86: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example – Link State (2)

7

1

1

10

C

A

B

D1

A C D

10 1 1

Neighbor

Cost

Seq.#= 1

NodeID= B

A C D

10 1 1

Neighbor

Cost

Seq.#= 1

NodeID= B

A B D

1 1 7

Neighbor

Cost

Seq.#= 1

NodeID= C

A B D

1 1 7

Neighbor

Cost

Seq.#= 1

NodeID= C

B C

1 7

Neighbor

Cost

Seq.#= 1

NodeID= D

B C

1 7

Neighbor

Cost

Seq.#= 1

NodeID= D

B C

10 1

Neighbor

Cost

Seq.#= 1

NodeID= A

B C

10 1

Neighbor

Cost

Seq.#= 1

NodeID= A

LSA from node A

LSA from node B (sent to A, C, D)

LSA from node C

LSA from node D (sent to B, C)

(sent to B, C)

Page 87: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network Routing: Distance Vector

25

4

7

Neighbor1

Neighbor2

Destination

Neighbor3

Source

8

29

19shortest paths (distances) from each neighbor

to the destination node

shortest path (src dest) = Min { 7 19, 4 29, 25 8 }= 7 19 = 26

Page 88: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Distance Vector Calculation

)(),(min)(

YDVXcYD VXV

X

Page 89: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example - Distance Vector

7

1

1

10

C

A

B

D1

7

1

1

10

C

A

B

D1

A B C A B C D

A

B

C

0 10 1

Fro

m

Distance to

A

B

CFro

m

Distance to

0 2 1

10 0 1

1 1 0

8

1

7

10 0 1 1

Received Distance Vectors

From B

Routing table at node A: Initial Routing table at node A: After 1st exchange

A B C D

1 1 0 7From C

A B C D

1 1 0 7From C

A B C D

Page 90: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example - Distance Vector

211,010min)(),(),(),(min)( BDCAcBDBAcBD CBA

101,110min)(),(),(),(min)( CDCAcCDBAcCD CBA

871,110min)(),(),(),(min)( DDCAcDDBAcDD CBA

321,310min)(),(),(),(min)( DDCBcDDABcDD CAB

Page 91: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

C

Rou

ting

tab

lea

t no

de C

A

B

C

D

Fro

m

Distance to

A B C D

1 1 0 7

A

B

C

D

Fro

m

Distance to

A B C D

0 10 1

10 0 1 1

1 1 0 2

1 7 0

A

B

C

D

Fro

m

Distance to

A B C D

0 2 1 8

2 0 1 1

1 1 0 2

8 1 2 0

A

B

C

D

Fro

m

Distance to

A B C D

0 2 1 3

2 0 1 1

1 1 0 2

3 1 2 0

A

B

C

Fro

m

Distance to

A B C

0 10 1

A

B

Initial routing tables: After 1st exchange: After 2nd exchange: After 3rd exchange:

Rou

ting

tab

lea

t no

de A

Rou

ting

tab

lea

t no

de B

A

B

C

D

Fro

m

Distance to

A B C D

10 0 1 1

A

B

C

D

Fro

m

Distance to

A B C D

0 10 1

2 0 1 1

1 1 0 7

1 7 0

A

B

C

D

Fro

m

Distance to

A B C D

0 2 1 8

2 0 1 1

1 1 0 2

8 1 2 0

A

B

C

D

Fro

m

Distance to

A B C D

0 2 1 3

2 0 1 1

1 1 0 2

3 1 2 0

A

B

C

Fro

m

Distance to

A B C D

0 2 1 8

10 0 1 1

1 1 0 7

A

B

C

Fro

m

Distance to

A B C D

0 2 1 3

2 0 1 1

1 1 0 2

A

B

C

Fro

m

Distance to

A B C D

0 2 1 3

2 0 1 1

1 1 0 2

B

C

D

Fro

m

Distance to

B C D

1 7 0

D

Rou

ting

tab

lea

t no

de D

B

C

D

Fro

m

Distance to

A B C D

10 0 1 1

1 1 0 7

8 1 2 0

B

C

D

Fro

m

Distance to

A B C D

2 0 1 1

1 1 0 2

3 1 2 0

B

C

DF

rom

Distance to

A B C D

2 0 1 1

1 1 0 2

3 1 2 0

Page 92: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example – DV Routing Loops

7

1

1

10

C

A

B

D1

7

1

1

10

C

A

B

D1

Original networkScenario 2:

Link BD outage

71

10

C

A

B

D1

71

10

C

A

B

D1

A B C D

A

B

CFro

m

Distance to

1

0

1

2

Routing table at node B before BD outage

D

1 30 2

2 0

1 1

3 1 2 0

A B C D

A

B

CFro

m

Distance to

1

0

3

2

Routing table at node B after BD outage

D

1 30 2

2 0

1 1

3 1 2 0

1. B detects BD outage2. B sets c(B, D) = 3. B recomputes its

distance vector4. B obtains 3 as the

shortest distanceto D, via C

Page 93: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:IP Addressing and CIDR

Hierarchical Structure of IP Addresses CIDR (Classless Interdomain Routing)

Page 94: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example: Road Map

Page 95: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Forwarding Table Scalability

BLOOMFIELD 91 mi.

ELIZABETH 80 mi.

UNION CITY 93 mi.

PATERSON 99 mi.

NEW YORK 96 mi.

KEARNY 89 mi.

NEWARK 85 mi.

CARTERET 75 mi.

LINDEN 80 mi.

EAST ORANGE 88 mi.

New York

Philadelphia

Princeton

Newark

Bayonne

Fort LeeBloomfield

Paterson

East Orange

Irvington

Elizabeth

Linden

Carteret

UnionCity

Allentown

New Brunswick

Trenton NEW YORK 96 mi.NEW YORK 96 mi.

compared to

Page 96: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

OLD IPv4 Address Structure

Network part

Reserved for future use

Network part Host partClass

0 31

0 Host part

0 317 8

Class A

0 311 15 16

0 311 23 24

0 311

2

2 3

IPv4old addressstructure

1 Host partNetwork partClass B 0

1 Host partNetwork partClass C 1 0

01 Multicast group partClass D 1 1

(a)

(b)

0 311 2 3

11Class E 1 1

8 bits 24 bits

n bits (32 n) bits

Page 97: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Address Class Sizes

16,777,216

128 (first bit fixed to "0" for "Class A")

Number of networks of a given class

Class A

Class B

Class C

65,536

256

Number of IP addresses (hosts) in a network of a given class

Class A

Class B

Class C

16,384 (first two bits fixed to “10" for "Class B")

2,097,152 (first three bits fixed to “110" for "Class C")

Page 98: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Special IPv4 Addresses

This host

A host on this network

Broadcast on this network

Broadcast on a distant network

Loopback within this network(most commonly used: 127.0.0.1)

31

31

31

31

0

00000000 00000000 00000000 00000000

0

11111111 11111111 11111111 11111111

31

Anything

0 7 8

01111111

0

Network id 1111.............1111(length depends on IP address class)

0

000....000 Host identifier

(length depends on IP address class)

Page 99: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CIDR Example (1)

(a)A

B

Subnet-3

Subnet-4

R1

C

D

Subnet-2

Subnet-1

12

3

R2

E FSubnet-5

1

2 3

to other networks4 204.6.94.130

Page 100: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CIDR Example (2)

(b) (c)

R1

R2

A

B

C

D

E F

Organization’s address subspace:w.x.y.z/27

Subnet-3:w.x.y.z8/31

Subnet-4:w.x.y.z12/31

Subnet-2:w.x.y.z4/30

Subnet-1:w.x.y.z/30

Subnet-5:w.x.y.z16/30

Subnet-3:204.6.96.168/30

Subnet-2:204.6.96.164/30

Subnet-4:204.6.96.172/30

Subnet-1:

204.6.96.160/30

Subnet-5:204.6.96.176/30

204.6.94.161

204.6.94.169 204.

6.94

.165

204.6.94.168

204.6.94.170

204.6.94.172

204.6.94.164

204.6.94.173

204.6.94.166

204.6.94.160

204.6.94.176204.6.94.177

204.6.94.178

Page 101: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CIDR Example (3)

Subnet Network prefix Binary representation Interface addresses

1 204.6.94.160/30 11001100 00000110 01011110 101000--

R2-1: 204.6.94.160R1-2: 204.6.94.161

(unused)b-cast: 204.6.94.163

2 204.6.94.164/30 11001100 00000110 01011110 101001--

C: 204.6.94.164R1-3: 204.6.94.165D: 204.6.94.166b-cast: 204.6.94.167

3 204.6.94.168/30 11001100 00000110 01011110 101010--

A: 204.6.94.168R1-1: 204.6.94.169B-1: 204.6.94.170b-cast: 204.6.94.171

4 204.6.94.172/30 11001100 00000110 01011110 101011--

R2-2: 204.6.94.172B-2: 204.6.94.173

(unused)b-cast: 204.6.94.175

5 204.6.94.176/30 11001100 00000110 01011110 101100--

R2-3: 204.6.94.176E: 204.6.94.177F: 204.6.94.178b-cast: 204.6.94.179

Page 102: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

CIDR-based Forwarding Tables

Router R1 Remote router

1

3

2

1

23

4

Router R2

1

Destination net prefix Out port

204.6.96.164/30 3

204.6.96.168/30 1

2

Destination net prefix Out port

204.6.96.160/27 1

204.6.96.172/30 2

204.6.96.176/30 3

0.0.0.0/0 4

Destination net prefix Out port

204.6.96.160/27 1

Forwarding table: Forwarding table: Forwarding table:

0.0.0.0/0

default route 0.0.0.0/0

Page 103: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Autonomous Systems

Commercial Internet

Peering and Transit Relationships

Path Vector Routing

Page 104: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Autonomous Systems (ASs)

ISP ISP

ISP

’s customers

’s customers

’s customers

Noodle.comMacrospot.com

ISP

ISP

ISP

ISP ISP ISP

Tier-1Tier-1

Tier-2

Tier-2Tier-2

Tier-3

Tier-3 Tier-3Tier-3

ISP ISP

ISP

’s customers

’s customers

’s customers

Noodle.comMacrospot.com

ISP

ISP

ISP

ISP ISP ISP

Tier-1Tier-1

Tier-2

Tier-2Tier-2

Tier-3

Tier-3 Tier-3Tier-3

Page 105: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ISP Business Relationships(b) Peering

peering

ISP ISP

’s customer

$ $

’s customer

(a) Paid Transit

$

’s customer

ISP

Figure (a) shows the pay-for-transit relationship.In principle, a customer pays for incoming and outgoing traffic, and expects to be able to reach all other customers or content providers on the global Internet.Permissible amounts of traffic in both directions are regulated by the service level agreement (SLA) between the provider and the customer.

ISP has the same relationship with ISPs and as they have to their customers.In other words, and are ’s paying customers.

In (b), ISP (not shown) could peer with another same-tier ISP (not shown) and their peering relationship would work on the same principle as for ISPs and .

Page 106: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

ISP Business Relationship Example

ISP ISP

ISP

’s customers

’s customers

’s customers

Noodle.comMacrospot.com

ISP

ISP

ISP

ISP ISP ISP

Tier-1Tier-1

Tier-2

Tier-2Tier-2

Tier-3

Tier-3 Tier-3Tier-3

$

$

$

$

$

$

$

$$

$$

$

$

$

$TransitPeering

Key:

ISP ISP

ISP

’s customers

’s customers

’s customers

Noodle.comMacrospot.com

ISP

ISP

ISP

ISP ISP ISP

Tier-1Tier-1

Tier-2

Tier-2Tier-2

Tier-3

Tier-3 Tier-3Tier-3

$

$

$

$

$

$

$

$$

$$

$

$

$

$TransitPeering

Key:$

TransitPeering

Key:

Page 107: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Providing Selective Transit (1)

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

$

AS

’scustomers

$ $

AS

$ $

AS AS

$

AS

AS

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

(a)

(b) (c)

(d) (e)

Page 108: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Providing Selective Transit (1)

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

$

AS

’scustomers

$ $

AS

$ $

AS AS

$

AS

AS

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

(a)

(b) (c)

(d) (e)

Page 109: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

$

AS

’scustomers

$ $

AS

$ $

AS AS

$

AS

AS

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

$ $

AS AS

$

AS

AS AS

$$

’scustomers

’scustomers

$

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

’scustomers

(a)

(b) (c)

(d) (e)

Providing Selective Transit (2)

equivalent

AS and its customers are customers of AS;and AS and its customers are customers of AS

customers of AScustomers of AS

Page 110: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Routing in Global Internet (1)

’s customers’s customers ’s customers

AS

AS

AS AS

AS

AS

AS AS AS

RR

LLKK

NNPPOO

QQ

HH

JJ

II

MM

AA

FF

BB

GG

DD

CC

EE

{AS{AS}}{AS{AS}}

{AS

{AS, A

S, A

S}}

{AS

{AS, A

S, A

S}}

{AS{AS, AS

, AS, AS, AS}}

{AS{AS, AS

, AS, AS, AS}}

{{CustCust}}{{CustCust}}

{AS{AS, AS, AS}}{AS{AS, AS, AS}}

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

Noodle.comMacrospot.com

SS

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

{{CustCust}}{{CustCust}}

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

router in AS sends an update message advertising the destination prefix 128.34.10.0/24

Page 111: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Routing in Global Internet (2)

’s customers’s customers ’s customers

AS

AS

AS AS

AS

AS

AS AS AS

RR

LLKK

NNPPOO

QQ

HH

JJ

II

MM

AA

FF

BB

GG

DD

CC

EE

{AS{AS}}{AS{AS}}

{AS

{AS, A

S, A

S}}

{AS

{AS, A

S, A

S}}

{AS{AS, AS

, AS, AS, AS}}

{AS{AS, AS

, AS, AS, AS}}

{{CustCust}}{{CustCust}}

{AS{AS, AS, AS}}{AS{AS, AS, AS}}

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

Noodle.comMacrospot.com

SS

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

{{CustCust}}{{CustCust}}

{AS

{AS

, AS

, AS

}}

{AS

{AS

, AS

, AS

}}

AS advertises only its customers to its peers, so AS never learns that AS has links to AS and AS

Page 112: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example - Path Vector

10 | 0 | 1 |

| | |

| | |

Fro

m

Path to

10 | 0 | 1 | 1 |

Received Path Vectors (1st exchange)

From

Routing table at AS : Initial

7

1

1

10

1

1 | 1 | 0 | 7 | From

F

rom

Path to

2 | , 1 |

10 | 0 | 1 |

1 | 0 | 1 |

0 | 8 | ,

1 |

7 |

Routing table at node : After 1st exchange:

Page 113: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example - Path Vector

211,010min)(),(),(),(min)( DcDcD

101,110min)(),(),(),(min)( DcDcD

871,110min)(),(),(),(min)( DcDcD

Page 114: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Integrating IGP & EGP Tables

Learn from IGP protocol that

destination x external to own AS is reachable via multiple speakers.

Use info from IGP routing tables to

determine distance to each of the speakers.

Hot-potato routing: Choose the speaker at the minimum distance

from this router.

Determine the output port O that leads to the chosen speaker. Enter

(x,O) in forwarding table

Page 115: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Example - Path Vector

10 | 0 | 1 |

| | |

| | |

Fro

m

Path to

10 | 0 | 1 | 1 |

Received Path Vectors (1st exchange)

From

Routing table at AS : Initial

7

1

1

10

1

1 | 1 | 0 | 7 | From

F

rom

Path to

2 | , 1 |

10 | 0 | 1 |

1 | 0 | 1 |

0 | 8 | ,

1 |

7 |

Routing table at node : After 1st exchange:

Page 116: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Link-Layer Technologies

Point-to-Point Protocol (PPP)

IEEE 802.3 a.k.a. Ethernet

Page 117: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Link Layer Services

• Data-link layer: transfer datagram from one node to adjacent node over a communication link– Framing: encapsulate datagram into a frame, adding header, trailer.

• Identify what set of bits constitute a frame, that is, determining the beginning and the end of a frame

– Channel access if shared medium• MAC addresses used in frame headers to identify source & destination• different from IP addresses!

– Reliable delivery between adjacent nodes• Error detection • Error recovery: forward error correction code, retransmission (ARQ)

– Flow control: pacing between adjacent sending and receiving nodes– Half-duplex and full-duplex

• with half duplex, either transmit or receive on a link,but not both nodes at same time

Layer 2:

Network

Layer 1:

Link

Layer 3:

End-to-End

IEEE 802.(Ethernet, Wi-Fi, …)

IEEE 802.(Ethernet, Wi-Fi, …)

Page 118: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Link Layer SublayeringNetwork layer / User

Linklayer

Logical link control(LLC) sublayer

Medium access control(MAC) sublayer

Physical(PHY) sublayer

(a)

Network layer / User

Linklayer

Logical link control(LLC) sublayer

Medium access control(MAC) sublayer

Physical(PHY) sublayer

(a)

Medium access control(MAC) sublayer

Physical(PHY) sublayer

Network layer / User

Linklayer

(b)

Medium access control(MAC) sublayer

Physical(PHY) sublayer

Network layer / User

Linklayer

(b)

LLC controlSSAP address

bytes: 1 1 1 or 2 variable

DSAP address Data

I/G DSAP value C/R SSAP value

bits: 1 7 1 7

LLC address fieldsDSAP = Destination service access pointSSAP = Source service access point

I/G = Individual/GroupC/R = Command/Response

LLC Packet Data Unit:

Page 119: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Point-to-Point Protocol (PPP)Visit http://en.wikipedia.org/wiki/HDLC for more details on High-Level Data Link Control (HDLC)

Modem

PPPover dialup telephone line

Customer’s home

Modems Router

Internet provider’s premises

PPP overfiber optic link

Router

PC

Page 120: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

PPP Functions

• Framing: encapsulation of network-layer datagram in data-link frame – Identify what set of bits constitute a frame, i.e., determine the start & end of a frame

• Carry data of any network layer protocol (not just IP) at same time– ability to demultiplex upwards

• Bit transparency: must carry any bit pattern in the data field• Error detection (no correction)• Connection liveness: detect, signal link failure to network layer• Network-layer address negotiation: endpoints can learn/configure each

other’s network addresses• Other characteristics of PPP:

– no error correction/recovery– no flow control– out-of-order delivery acceptable– no need to support multipoint links (e.g., polling)

Page 121: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Point-to-point (PPP) Frame Format

LCP or NCP Control Packets:

bytes: 1 1 1 1 or 2 variable 2 or 4 1

Flag Address Control Protocol Flag

01111110 11111111 00000011 01111110

Data payload Checksum

Flag Address Control ProtocolProtocol PayloadPayload Checksum Flag

Code ID LengthInformation for

the control operation

bytes: 1 1 2 variable

Value for LCP: C02116

Value for NCP: C02316

Page 122: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Point-to-point (PPP):State Diagram

Carrierdetected /

Establishing Link Connection

Start

Dead

Options agreed on /

Failed /

Done /Drop carrier

NCP configured /

Authenticated /

Failed // Drop carrier

/ ExchangeTERMINATE packets

Send & receiveframes

Connecting to Network-Layer

Protocol

Terminating

Establishing

Authenticating

Open

Page 123: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:IEEE 802.3 a.k.a.

Ethernet

Ethernet Medium Access Control (MAC) Protocol

Ethernet Evolution

Switched Ethernet

Page 124: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.3 Link-Layer Frame Format

bytes: 8 6 6 2 0 to 1500 0 to 46 4

PreambleDestination

addressSourceaddress

Type Data Pad Checksum

MAC header

(a)

Linklayer

Network layer

LLC

MAC

PHY

Linklayer

Network layer

LLC

MAC

PHY

(b)

Linklayer

MAC

PHY

Network layer

Linklayer

MAC

PHY

Network layer

bytes: 7 1 6 6 2 0 to 1500 0 to 46 4

PreambleDestination

addressSourceaddress

Length

Data Pad ChecksumS O F

SOF = Start of Frame

MAC header

DSAP address

SSAP address

Control DataLLC packet:

Page 125: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Ethernet Version Notation

Data rate(e.g., 10 Mbps, 10 Gbps)

Baseband/Broadband transmission

Wiring type (e.g., coaxial, twisted pair or fiber optic)

MAC address Network port Time last frame received

00-01-03-1D-CC-F7 1 10:39

01-23-45-67-89-AB 1 10:52

A3-B0-21-A1-60-35 2 10:17

Page 126: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Thin-Cable Ethernet

BNC T-connectorwith terminator

BNCT-connector

Computer

Computer

Computer

BNC T-connectorwith terminator

BNCT-connector

Computer

Computer

Computer

BNCT-connector

Thin Ethernetcable

BNC connector

BNCT-connector

Thin Ethernetcable

BNC connector

Page 127: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Switched/Bridged Ethernet

Computer

Ethernet hub / bridge / switch

Computer Computer

Twisted paircable Network

port

Page 128: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Legacy Ethernet vs. Eth. HubFile Server

NodesAPrinter

Ethernet Hub

APrinter

(b)

(a)

Thin-Cable Ethernet

Ethernet Hub

Page 129: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Hub vs. Switch

Ethernet Hub

APrinter

Ethernet Switch

APrinter

B C

(c)

(b)

Ethernet Switch

Ethernet Hub

OSI Layer-2 switching

OSI Layer-1 switching

Page 130: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Ethernet MAC & Link Duplexity

10 Mbps PHYIEEE Std 802.3-1985

802.3a, 802.3i, …

100 Mbps PHYIEEE Std 802.3u

1000 Mbps PHYIEEE Std 802.3z

10 Gbps PHYIEEE Std 802.3ae

10Base2*, 10Base5*, 10Base-F, 10Base-FB, 10Base-FL, 10Base-FP, 10Base-T

100Base-T, 100Base-T2, 100Base-T4*, 100Base-TX, 100Base-X, 100Base-BX10, 100Base-FX, 100Base-LX10

1000Base-T, 1000Base-X, 1000Base-BX10

10GBase-E, 10GBase-L, 10GBase-R, 10GBase-S, 10GBase-T, 10GBase-W, 10GBase-X

(*) Not capable of operating in full duplex mode

IEEE 802.3 MAC(CSMA/CD)

Page 131: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Ethernet Switch

Backplane

Ethernet switch

To a hostcomputer

Network ports

Line cards

Page 132: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Learning Switches

SwitchA

B

C

D

Port 2

Port 1

Network 1

Network 2

A3-B0-21-A1-60-35

MAC address:00-01-03-1D-CC-F7

01-23-45-67-89-AB

49-BD-2F-54-1A-0F

[ See the switching table in the next slide … ]

Page 133: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Switching Tablefor the Previous Example

MAC address Network port Time last frame received

00-01-03-1D-CC-F7 1 10:39

01-23-45-67-89-AB 1 10:52

A3-B0-21-A1-60-35 2 10:17

Page 134: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Loops in Switched LANs (1)

Switch 1A

B

C

Port 2

Port 1

D

Network 1

Network 2

Switch 2

Port 2

Port 1

Page 135: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Loops in Switched LANs (2)

C

Switch 1

Port 2

Port 1

Network 1

Network 2

P1

P2

Switch 2

C

S-1

P2

P1

Netw-1

Netw-2

P1

P2

S-2

C

S-1

P2

P1

Netw-1

Netw-2

P1

P2

S-2

C

S-1

P2

P1

Netw-1

Netw-2

P1

P2

S-2

C P2C P2 C P2C P2 C P2C P2 C P1C P1

C P1C P1 C P1C P1

C P2C P2

C P1C P1

(a) (b)

(c) (d)

Packet

Page 136: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.1D Configuration BPDU parameters and format

ProtocolID

Protocolversion ID

BPDU type

FlagsRootID

Root path cost

SwitchID

PortID

Message age

Max age

Hello time

Forward delay

2 bytes 1 byte 1 byte 1 byte 8 bytes 8 bytes4 bytes 2 bytes 2 bytes 2 bytes 2 bytes 2 bytes

BPDU format:

Page 137: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:IEEE 802.11 a.k.a. Wi-Fi

802.11 Architecture

802.11 Medium Access Control

RTS/CTS Protocol for Hidden Stations

Page 138: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Components of 802.11 LANs

Ad hoc network does not have distribution system nor access point

Distribution system

Station

Wireless medium

Access point

Page 139: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

IBSS and Infrastructure BSS

Independent BSS(or, IBSS) Infrastructure BSS

Accesspoint

Distribution system (e.g., Ethernet LAN)

Page 140: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Extended Service Set (ESS)

Distribution system (e.g., Ethernet LAN)

t = 1 t = 2

BSS1 BSS2 BSS3

AP3AP2AP1

Page 141: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Link Layer ProtocolArchitecture

IEEE 802.11 MAC

1 Mbps PHY(DBPSK)

2 Mbps PHY(DQPSK)

5.5 Mbps PHY(DBPSK/CCK)

11 Mbps PHY(DQPSK/CCK)

1 Mbps PHY(DBPSK)

2 Mbps PHY(DQPSK)

5.5 Mbps PHY(DBPSK/CCK)

11 Mbps PHY(DQPSK/CCK)

802.11b Physical sublayer

Page 142: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Link or MAC-LayerFrame Format

bytes: 2 2 6 6 6 2 6 2 0 to 2304 4

DS = Distribution systemMF = More fragmentsRT = RetryPM = Power management

MD = More dataW = Wired equivalent privacy (WEP) bitO = Order

FC D/I Address-1 Address-2 Address-3 Address-4SC DataQC FCS

FC = Frame controlD/I = Duration/Connection IDSC = Sequence controlQC = QoS controlFCS = Frame check sequence

bits: 2 2 4 1 1 1 1 1 1 1 1

Protocol version

Type TypeTo DS

From DS

MF RT PM MD W OProtocol version

Type TypeTo DS

From DS

MF RT PM MD W O

MAC header MSDU

(a)

MSDU = MAC Service Data Unit

Physical-layer preamble144 bits

Physical-layer header48 bits

MAC-layer frame (payload)(variable)

Synchronization128 bits

SFD16 bits

Signal8 bits

Service8 bits

Length16 bits

CRC16 bits

Physical protocol data unit (PPDU)802.11 physical-layer frame:

Physical-layer preamble144 bits

Physical-layer header48 bits

MAC-layer frame (payload)(variable)

Synchronization128 bits

SFD16 bits

Signal8 bits

Service8 bits

Length16 bits

CRC16 bits

Physical protocol data unit (PPDU)802.11 physical-layer frame:

(b)

SFD = start frame delimiter

shown above in part (a)

Page 143: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 PHY Frame(Long PPDU format)

PPDU = PLCP protocol data unitPLCP = physical (PHY) layer convergence procedureSFD = start frame delimiter

Physical-layer headerPhysical-layer preamble (long format)

Payload(variable)

Synchronization (128bits)

SFD (16 bits)

Signal (8 bits)

Service (8 bits)

Length (16 bits)

HEC (16 bits)

Page 144: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Address Fields

[Address-1] RA = Immediate recipient of the current frame (C)

[Address-2] TA = Transmitter which transmitted the current frame (B)

[Address-3] SA = Original source (A)

[Address-4] DA = Original destination (D)

D

B

A C

SA DA

TA

RA

Page 145: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Protocol Architecture

802.11 MAC

802.11bDSSS

802.11aOFDM

802.11DSSS

802.11FHSS

Page 146: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Interframe Spaces (1)

Busy Frame transmission.....

Contention period

Backoff slots

DIFS

PIFS

SIFS

Time

Defer access Select slot using binary exponential backoff

Collision Avoidance

CSMA / CA

Page 147: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Interframe Spaces (2)

BusyBusy Frame transmissionFrame transmission..........

Contention period

Backoff slots

DIFS

PIFS

SIFS

Time

Defer access Select slot using binary exponential backoff

Busy Busy Busy Busy BackoffBackoffBackoffBackoffEIFS

Frame transmissionFrame transmissionFrame transmissionFrame transmission

detected a corrupted frame

EIFS definition: A station ready to transmit enters EIFS after detecting a corrupted frame

Page 148: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

IEEE 802.11b System Parameters

Parameter Value for 1 Mbps channel bit rateSlot time 20 secSIFS 10 secDIFS 50 sec (DIFS = SIFS + 2 × Slot time)EIFS SIFS + PHY-preamble + PHY-header + ACK + DIFS = 364 sec

CWmin 32 (minimum contention window size)CWmax 1024 (maximum contention window size)PHY-preamble 144 bits (144 sec)PHY-header 48 bits (48 sec)MAC data header 28 bytes = 224 bits

ACK 14 bytes + PHY-preamble + PHY-header = 304 bits (304 sec)

RTS 20 bytes + PHY-preamble + PHY-header = 352 bits (352 sec)

CTS 14 bytes + PHY-preamble + PHY-header = 304 bits (304 sec)

MTU* Adjustable, up to 2304 bytes for frame body before encryption

Page 149: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Basic Transmission Mode

DIFS

Receiver

Sender 4 3 2 1 0

BackoffBusy

Busy

TimeData

SIF

S

ACK

DIFS

Another station 9 8 7 6 5

Backoff Suspend countdown and defer access

BusyDIFS

6 5 4 3

Resumecountdownafter deferral

Receive data

DIFS

Receiver

Sender 4 3 2 1 0

BackoffBusy

Busy

TimeData

SIF

S

ACK

DIFS

Another station 9 8 7 6 5

Backoff Suspend countdown and defer access

BusyDIFS

6 5 4 3

Resumecountdownafter deferral

Receive data

Page 150: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Protocol State Diagram – Sender

ACK error-free /

Busy /

Idle /

Busy /

Idle /

Busy /

backoff == 0 /

Timeout /

backoff 0 /

attempts max-attempts /

Ne

w p

ack

et

/

attempts max-attempts /

Idle /

ACK in error /

Sense Send End

Wait for end of Wait for end of transmissiontransmission

Wait for DIFS

Abort

Wait for Wait for DIFSDIFS

Sense

Wait for EIFS

1

1

1

SenseSenseSetSet

backoffbackoff

Countdownbackoff backoff 1

(a)Increase CW & Attempt count

Page 151: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

802.11 Protocol State Diagram – Receiver

(b)

ReceiveSend ACK

EndWait for SIFS

Wait for EIFS

Packet in error /

Packet error-free /

Page 152: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Examples of Timing Diagrams for IEEE 802.111. A single station has two frames ready for

transmission on an idle channel.

2. A single station has one frame ready for transmission on a busy channel. The acknowledgement for the frame is corrupted during the first transmission.

3. A single station has one frame ready for transmission on a busy channel. The data frame is corrupted during the first transmission.

Page 153: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Frame-1

DIFS

SIFSACK

Frame-2DIFS

BackoffBackoffBackoffBackoff

SIFSACK

Time

Packet arrival,channel idle

(no backoff)

BackoffBackoffBackoffBackoff BackoffBackoffBackoffBackoffBusy Frame-1DIFS

SIFSACK

Frame-1EIFS

SIFSACK

(retransmission)

BackoffBackoffBackoffBackoffBackoffBackoffBackoffBackoffBusy Frame-1DIFS

Frame-1ACK Timeout

SIFSACK

(retransmission)

802.11 Timing Diagrams

(a) Timing of successful frame transmissions under the DCF:

(b) Frame retransmission due to ACK failure:

(c) Frame retransmission due to an erroneous data frame reception:

Page 154: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

RTS/CTS for Hidden Stations

(a)

AB

C

AB

C

AB

C

RTS(N-bytes)

CTS(N-bytes)

N-bytes frame

Defer(N-bytes)

(b)

(c)

C listens but cannot hear A’s transmission both A and C hear B’s transmission

“I should be quiet for N-byte

duration of transmission”

A transmits Request-to-Send N bytes to B B responds with Clear-to-Send N bytes

A transmits N-bytes long data frame to B

Page 155: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

RTS/CTS Transmission Mode

RTS TimeDIFS

Receiver

Sender 4 3 2 1 0

Backoff

DIFS

Covered Station

Busy

Busy

Busy

8 7 6

Backoff

5 4

DIFS

Hidden Station

BusyBackoff

SIF

SCTS

Access to medium deferred for NAV(CTS)

NAV (RTS)

NAV (CTS)

DataSIF

S

Access to medium deferred for NAV(RTS)

SIF

S

ACK

NAV (Data)

RTS TimeDIFS

Receiver

Sender 4 3 2 1 0

Backoff

DIFS

Covered Station

BusyBusy

BusyBusy

BusyBusy

8 7 6

Backoff

5 4

DIFS

Hidden Station

BusyBusyBackoff

SIF

SCTS

Access to medium deferred for NAV(CTS)

NAV (RTS)

NAV (CTS)

DataSIF

S

Access to medium deferred for NAV(RTS)

SIF

S

ACK

NAV (Data)

Page 156: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Topic:Quality of Service (QoS)

Introduction & Prospects

Network Neutrality Debate

Page 157: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network Conceptual Model

NetworkNetwork

packetssignals

Capture: Transport: Playout:

packets reordered, lost,or variably delayed

Page 158: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Players and Parameters

NETWORK: Available capacity/bandwidth Variable traffic load (usage) Hardware & software failures

RECEIVER: Delay/timeliness constraints Information loss tolerance

SOURCE: Source information rate Statistical characteristics

(1) Reserved-resources path: Guaranteed delay bound Guaranteed loss rate

(2) Priority treatment at router: Reduced waiting in queue

(expedited forwarding) Reduced packet loss if

memory space overbooked

Page 159: Computer Networks: Introduction Ivan Marsic Rutgers University Chapter 1 – Introduction

Network Conceptual Model (2)

We don’t know when sources will start/end their sessions; also for some types of data (video), datarate is variable

NetworkNetwork