finals review - university of california,...

Post on 13-Jul-2020

6 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Finals Review

EECS 122

University of California

Berkeley

2

Encoding & Framing

� Physical Layer encoding (e.g., NRZ, NRZI,

Manchester, 4B/5B)

� Link Layer frames

� Byte oriented (e.g., BISYNC, DDCMP)

� Bit oriented (e.g., HDLC)

� Clock based (e.g., SONET)

� Error control: CRC, Checksum, …

3

Review: Layers & Protocols

End Node

HTTP, FTP, …

IP

UDP - TCP

PhysicalInterface

PhysicalInterface

Synchronous unreliable bit pipe

Data LinkControl

Data LinkControl

Asynchronous “reliable” bit pipe

Physical Link

Network Network

Asynchronous routed path

FH Data

PhysicalInterface

Synchronous unreliable bit pipe

Data LinkControl

Asynchronous “reliable” bit pipe

Physical Link

Network

Asynchronous routed path

FH Data

Transport Transport

PH Data PH Data

TH Data

End Node Router

Application Application

Data

4

P/R

Timing: Queuing� Link:

P bits

R bpsT seconds

Time

T

Q

Q/R

Q/R = queuing delay(load-dependent)

5

S D

1 2

Little’s ResultN

T

S = area

S = T(1) + … + T(N)= integral of X(t)

T(N)

T(N - 1)

X(t)

T(1) + … + T(N)

N

N

T

1X(t)dt =

T

S= .

T

� Average occupancy = (average delay)x(average arrival rate)

6

Basic Queuing System

7

Random Multiple Access� How to share a channel?

� Multiple Access ≠ Multiplexing

� ALOHA: First random multiple access system

� Efficient for many users, each with low utilization

� Try; If collide, wait random time then repeat

� Analysis: Slotted Aloha efficiency ≈ 1/e = 36%

Slotp, indpdt.N nodes P(success) = Np(1 – p)N-1 ≈ 1/e if p = 1/N

8

Ethernet Efficiency

� Typical Sequence of Events:

StartTransmitting

Collision

Wait RandomTime

Successful Transmission

Average = L/R secondsL = average packet length

Average = 5TT = max.prop.time

between 2 nodes

Efficiency = L/R

L/R + 5T= 1/(1 + 5a)

a = T/(L/R) = RT/L

9

Random Multiple Access

Ethernet: First version – CSMA/CD

� Wait until channel is idle; try; if collide, stop, wait, repeat

� Idea: CD should improve efficiency if fast enough

� If CD, wait random multiple of 512 bit times

(exponential back off)

� Analysis: Worst-case Efficiency ≈ 1/(1 + 5a), a = PROP/TRANS

A

B

10

Switching

� Ethernet: Later versions – Switched� Larger aggregate throughput

� VLANs: partition in disjoint logical LANs� Link Aggregation

� Each port is in its own collision domain� as opposed to a hub where all ports are in the same collision

domain

� Fast, GE, 10GE� Improved modulation schemes

11

Ethernet

� Service?

� Operations: Addresses, MAC, Hub, Switch,

Learning, Spanning Tree

� MAC: Why not Aloha?

� Why Switch?

� Why Loops?

12

802.11

� a - 5GHz, up to 54Mbps

� b - 2.5GHz, up to 11Mbps

� g - 2.5GHz, up to 54Mbps

� MAC: CSMA/CA with or without RTS/CTS� Distributed (DCF):

� CSMA/CA using different Interframe Gaps

� maintain network allocation vector

� Centralized (PCF): access point polls nodes

13

802.11 MAC� If medium is idle for DIFS interval after a correctly received frame and

backoff time has expired, transmission can begin immediately

� If previous frame contained errors, medium must be free for EIFS

� Unicast data must be acknowledged as part of an atomic exchange

� Backoff counter is decremented by one if a time slot is determined to be idle

� If a station receives a new frame to transmit when it’s not in backoff and if medium is busy, access is deferred until medium is idle for DIFS (or EIFS) and then a random backoff is performed

� After a successful transmission (i.e., after receiving an ack), the station waits for a DIFS interval and then performs a random backoff

� If ack is not received before the timeout, retransmission is attempted following exponential backoff

14

802.11 Virtual Carrier Sensing

� Virtual Carrier Sensing using Network Allocation Vector (NAV)

15

802.11

� What are hidden/exposed terminal problems?

� Why not CSMA/CD?

� Objectives of new MAC?

� Why RTS/CTS?

� How does NAV work?

� Why different IFS?

� Why more than 2 addresses?

� Why different PHYs?

� Why multiple channels?

� Efficiency calculation

16

Switch Fabric

� Head of Line (HOL) Blocking

� Output Queueing and Speedup

� Virtual Output Buffers and iSLIP

17

TCP & UDP: Multiplexing

IP

Transport

A B C

[A | B | p1 | p2 | …]

p1 p2 p1 p2 p3 p1 p2

portsApplication

HTTP DNSRA

UDP: Not reliableTCP: Ordered, reliable, well-paced

18

UDP� Service:

� Send datagram from (IPa, Port 1) to (IPb, Port 2)

� Service is unreliable, but error detection possible

� Header:

Source port Destination port

0 16 31

UDP length UDP checksum

Payload (variable)

•UDP length is UDP packet length (including UDP header and payload, but not IP header)•Optional UDP checksum is over UDP packet

� Why have UDP checksum in addition to IP checksum?� Why not have just the UDP checksum?� Why is the UDP checksum optional?

19

SYN k

SYN n; ACK k+1

DATA k+1; ACK n+1

ACK k+n’+1

data exchange

FIN

FIN ACK

½ close

FIN

FIN ACK½ close

TCP Connection Phases

3-way handshake

20

TCP State Diagram

A

B

SYN

SYN + ACK

Data + ACK

ACK …FIN

FIN.ack FIN FIN.ack

Listen

SYN received

Established

Close Wait

Last Ack

Closed

ClosedSYN sent

EstablishedFIN Wait-1

FIN Wait-2

Time Wait(2MSL Wait)

Closed(1)

(1): A waits in case B retransmits FIN and A must ack again

TOC – Transport – TCP – State Diagram 1

21

TCP Header

� Sequence number, acknowledgement, and advertised window –used by sliding-window based flow control

� Flags (6 bits):� SYN, FIN – establishing/terminating a TCP connection

� ACK – set when Acknowledgement field is valid� URG – urgent data; Urgent Pointer says where urgent data ends

� PUSH – don’t wait to fill segment

� RESET – abort connection

Source port Destination port

Options (variable)

Sequence numberAcknowledgement

Advertised windowChecksum Urgent pointer

FlagsHdrLen

0 4 10 16 31

Payload (variable)

22

TCP Delay Estimation� Use exponential averaging:

A(n) = bA(n- 1) + (1 – b)T(n)D(n) = bD(n-1) + (1 – b)|T(n) – A(n)|Timeout(n) = A(n) +4D(n)

Notes: 1. Measure T(n) only for original transmissions2. Double Timeout after timeout …

Justification: timeout indicates likely congestion;Further retransmissions would make things worse

3. Reset Timeout = A + 4D for new packet and when receive ACK

23

TCP Congestion Control Phases

� Slow Start

� While (W ≤ Slow Start Threshold)

� W = W + 1 for each new ack

� Recovery Mechanism: Timeout

� Congestion Avoidance

� While (W > Slow Start Threshold)

� W = W + 1/W for each new ack

� Recovery Mechanism: Fast Transmit/Recovery and Timeout

We next examine the details of the above phases

24

TCP Refinements: Fast Retransmit & Recovery

� Window adjustment is tricky:

Want W � W/2

W = W first 2 DA (Dup Ack)At 3rd DA:

ssthresh = W/2W = ssthresh + 3

W = W + 1 at each DA after 3rd DA

W = W first 2 DA (Dup Ack)At 3rd DA:

ssthresh = W/2W = ssthresh + 3

W = W + 1 at each DA after 3rd DA

W/2 – 1 outstandingpackets:

n+W+1, …, n+3W/2–1

W/2 – 1 outstandingpackets:

n+W+1, …, n+3W/2–1

W = ssthreshW = ssthresh

n + 1

W/2 + 3

W

4

3rd DA

n + 1

n + W

W – 4 acks

�(W/2 + 3) + (W – 4)

= W + W/2 – 1

W – 4 acks

�(W/2 + 3) + (W – 4)

= W + W/2 – 1

n + W + 1

25

TCP Refinements: Summary

� Actual window = min {RAW, W}

W

1

64KB

X0.5

TO

3DA

X0.5

3DA TO

X0.5 X0.5

SS CA SS CA

33

26

TCP Congestion Control: Summary

� Slow Start: Discover available bandwidth� Congestion Avoidance: AIMD � Tries to be fair� Refinements:

� Fast Retransmit: 3rd DA

� Fast Recovery: Reset W to W/2 (instead of W = 1)[More precisely: ssthresh = W/2, W = ssthresh + 3,

W = W + 1 per DA after 3rd DA,W = ssthresh when get new ACK]

� TO: set ssthresh = W/2, W = 1, SS until W = ssthresh,

then CA

� Timers:� Timeout = Average + 4 Deviations

� If time out � Timeout x 2 (up to a maximum)

Reset after new ACK

� Flow Control:� Actual window = min {RAW, W}

27

Additional TCP Congestion Control Topics

� ECN

� Noisy Links

� Virtual Queues

� RED

� How Big are Router Buffers?

� Unfairness

� TCP Vegas

top related