CSE 461 Midterm Review A quick tour of what we have learned so far - - PowerPoint PPT Presentation

cse 461 midterm review
SMART_READER_LITE
LIVE PREVIEW

CSE 461 Midterm Review A quick tour of what we have learned so far - - PowerPoint PPT Presentation

CSE 461 Midterm Review A quick tour of what we have learned so far Midterm Topic Coverage Midterm is on Everything we covered in lecture slides, textbook, and Feb. 10, Mon assignments before Section 3.1 (Backward Learning and Spanning Tree


slide-1
SLIDE 1

CSE 461 Midterm Review

A quick tour of what we have learned so far

slide-2
SLIDE 2

Midterm Topic Coverage

Everything we covered in lecture slides, textbook, and assignments before Section 3.1 (Backward Learning and Spanning Tree Algorithm will not be included)

  • Layers and Protocols
  • Physical Layer
  • Link Layer (part)

Midterm is on

  • Feb. 10, Mon
slide-3
SLIDE 3

Layers & Protocols

slide-4
SLIDE 4

Layers => Protocols

OSI Model (Open Systems Interconnection):

  • Application
  • HTTP (S) | FTP | SMTP | DNS | Telnet | BGP
  • Presentation
  • Session
  • Transport
  • TCP | UDP
  • Network
  • IPv4, IPv6
  • Data Link
  • ARP

, MAC, PPP

  • Physical

Note: Presentation and Session layers are usually counted into Transport layer; Ethernet is a mix of link and physical layer.

slide-5
SLIDE 5

Physical Layer

slide-6
SLIDE 6

Latency

Transmission Delay:

  • Time to put the bits onto the wire
  • Tt = M (bits) / Rate (bits/sec)

Propagation Delay

  • Time for the bits to propagate from one end to the other
  • Tp = Length (m) / Speed of Signal
slide-7
SLIDE 7

Bandwidth x Delay

Meaning: The amount of data that can be held in the wire.

Example:

Suppose data are being transferred from West Coast to East Coast. The bandwidth is 50 Mbps, and the propagation delay is 70 ms. What is the bandwidth delay product? Bandwidth x Delay = 50 Mbps x 70 ms = 50 x 10^6 bps x 70 x 10^(-3) s = 3500 x 10^3 / 8 bytes = 427 KB

slide-8
SLIDE 8

Coding:

  • How to represent bits using analog
  • E.g., Non-Return to Zero, 4B/5B

Modulation:

  • How to convert data into radio wave
  • Different methods:
  • Amplitude Shift
  • Frequency Shift
  • Phase Shift

Coding vs. Modulation

slide-9
SLIDE 9

Limits on Transmission Rate

Variables: B: bandwidth S: signal strength N: noise strength Nyquist Limit:

  • Maximum bit rate:
  • R = 2B log2 V bits/sec

Shannon Capacity:

  • Signal-to-Noise Ratio:
  • SNRdb = 10 log10 (S/N)
  • Shannon Capacity:
  • Max information carrying rate of a channel
  • C = B log2 (1 + S/(BN)) bits/sec
  • Takeaway: Increasing bandwidth is more effective for increasing C.
slide-10
SLIDE 10

Link Layer

slide-11
SLIDE 11

Framing

Ways to determine the start and end of a frame?

  • Byte Count
  • Byte Stuffing
  • Bit Stuffing
slide-12
SLIDE 12

Discussion

How does each of framing method work? Any advantage and disadvantage? Time: 2 min

slide-13
SLIDE 13

Byte Counting

Content:

  • The first byte of each frame records the number of bytes in the frame.

Advantage:

  • Incur very little overhead

Disadvantage:

  • Easy to lose track of the frame and hard to re-synchronize
slide-14
SLIDE 14

Byte Stuffing

Idea:

  • Use special FLAG bytes to mark the start and end of a frame

Advantage:

  • Easy to track frames

Disadvantage (Trade-off):

  • Adds more complication => more overhead
  • Has to escape the FLAG with ESCAPE
  • Has to escape the ESCAPE with ESCAPE
slide-15
SLIDE 15

Byte Stuffing Example

[A, B, ESC, FLAG, ESC, C] => [A, B, ESC, ESC, ESC, FLAG, ESC, ESC, C]

slide-16
SLIDE 16

Bit Stuffing

Idea:

  • Use 6 consecutive 1s as a special flag. For each 5 consecutive 1s in the original message, insert a 0

behind.

Advantage:

  • Easy to track frames and less complication

Disadvantage:

  • Has to deal with bits instead of bytes, and bits not aligned => slower
slide-17
SLIDE 17

Bit Stuffing Example

Say the original message is:

01100 11111 11111 11111 00100

Using bit stuffing, the encoded message should be:

01100 111110 111110 111110 00100

slide-18
SLIDE 18

Error Detection vs. Error Correction

Error Detection:

  • Add extra check bits to message bits to detect error
  • Hamming Distance = d+1

=> Up to d errors will always be detected

Error Correction:

  • Add extra check bits to message bits to correct error
  • Hamming Distance = 2d+1

=> Up to d errors will always be corrected

Hamming Distance:

  • Minimum distance between two valid codewords.
slide-19
SLIDE 19

Discussion

When should we use detection over correction? When should we use correction over detection? Time: 2 min

slide-20
SLIDE 20

When to use Error Detection/Correction?

Situations to use Error Detection:

  • Errors are expected to be rare
  • If errors do occur, the amount of error bits is large

Situations to use Error Correction:

  • Errors are expected to be frequent
  • There won’t be too many erroneous bits at each time
  • Re-transmission is too expensive
slide-21
SLIDE 21

Common Ways to do Error Detection/Correction

Error Detection

  • Internet Checksum
  • CRC (Cyclic Redundancy Check)

Error Correction:

  • Hamming Code
slide-22
SLIDE 22

Hamming Code Example

We know that for a 11-bit long message with k = 4 check bits, we have the following check bit to message bits coverage:

1 => 1, 3, 5, 7, 9,11,13,15 2 => 2, 3, 6, 7,10,11,14,15 4 => 4, 5, 6, 7,12,13,14,15 8 => 8, 9,10,11,12,13,14,15

Can you see any pattern in the coverage? (2 min)

slide-23
SLIDE 23

Hamming Code Check Bit Coverage

The corresponding bit of the check bit is always 1! Take check bit 4 for example. 4 = 0b0100.

4 = 0b0100 5 = 0b0101 6 = 0b0110 7 = 0b0111 12 = 0b1100 13 = 0b1101 14 = 0b1110 15 = 0b1111

slide-24
SLIDE 24

Correct the Message! (2 min)

Message M (11 bits) is encoded into M’ (15 bits) by adding 4 bits of hamming

  • code. We know that M’ is as follows:

0 0 0 0 1 0 1 0 1 0 0 1 0 0 0 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Given that 1 bit is flipped in M’, which bit is that?

1 => 1, 3, 5, 7, 9,11,13,15 2 => 2, 3, 6, 7,10,11,14,15 4 => 4, 5, 6, 7,12,13,14,15 8 => 8, 9,10,11,12,13,14,15

slide-25
SLIDE 25

Correct the Message! (2 min)

Calculate the syndrome:

0 0 0 0 1 0 1 0 1 0 0 1 0 0 0 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 p1=(0+0+1+1+1+0+0+0) mod 2=1 p2=(0+0+0+1+0+0+0+0) mod 2=1 p4=(0+1+0+1+1+0+0+0) mod 2=1 p8=(0+1+0+0+1+0+0+0) mod 2=0 => syndrome=p8p4p2p1=0111

slide-26
SLIDE 26

The syndrome is 0111 and we know the mapping:

1 => 1, 3, 5, 7, 9,11,13,15 2 => 2, 3, 6, 7,10,11,14,15 4 => 4, 5, 6, 7,12,13,14,15 8 => 8, 9,10,11,12,13,14,15

=> The error bit is in the coverage of checkbit 1, 2, and 4, but not in 8! => The error bit is bit 7

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

Correct the Message! (2 min)

slide-27
SLIDE 27

ARQ (Automatic Repeat reQuest)

Rules:

  • Sender
  • Automatically resends after timeout until ACK is received
  • Receiver
  • Automatically acknowledge a correct frame by sending back an ACK message
slide-28
SLIDE 28

What could go wrong?

  • Packets get dropped midway
  • Duplicate packets
  • Packets arrive late and cause timeout

What should we do? Stop-and-Wait

slide-29
SLIDE 29

Stop-and-Wait

Idea:

  • Include a sequence number to distinguish different frames
  • Send one packet at a time

Problems:

  • Wasting bandwidth, so inefficient!
  • What should we do next? Sliding Window
slide-30
SLIDE 30

Meaning:

  • Share a specific resource

Common ways to share a link among multiple users?

  • Time Division Multiplexing (TDM)
  • Frequency Division Multiplexing (FDM)

Problem?

Still inefficient. Network traffic is bursty and users’ need fluctuate by time.

What do we do next? Multiple Access protocols

Multiplexing

slide-31
SLIDE 31

ALOHA protocol

Idea:

  • Node sends when it has traffic
  • In case of a collision, wait for a random period of time and resend

Performance:

  • Pretty good performance when the traffic load is low
  • Extremely severe packet loss under high traffic load
slide-32
SLIDE 32

CSMA (Carrier Sense Multiple Access)

Idea:

  • Listen before send
  • NOTE: While LISTEN is easy for wires, it is not the case for wireless

Problem?

  • Collision is still possible because of network delay!
slide-33
SLIDE 33

CSMA/CD (with Collision Detection)

Idea:

  • Detect network jam and abort the rest of the frame time
  • => Reduce the cost of collisions
slide-34
SLIDE 34

CSMA “Persistence”

Idea:

  • When another node is sending, wait for it to finish and then send

Problem:

  • Multiple waiting nodes may send at the same time when the previous

sending node finishes, thus causing collisions

Improvement?

  • Each waiting node has a probability of 1/N to send next where N is the

number of waiting nodes.

slide-35
SLIDE 35

BEB (Binary Exponential Backoff)

Idea:

  • For each collision, double the range of the waiting period
  • For instance:
  • 1st collision => wait from 0 to 1 frame times
  • 2nd collision => wait from 0 to 2 frame times
  • 3rd collision => wait for 0 to 4 frame times

Performance:

  • Very efficient in practice
slide-36
SLIDE 36

Wireless Complications

Common problems:

  • Hidden Terminal Problem
  • Exposed Terminal Problem
slide-37
SLIDE 37

Discussion (2 min)

What exactly are hidden terminal problem and exposed terminal problem? How would we solve these problems?

slide-38
SLIDE 38

Hidden Terminals

Situation:

Both node A and node C want to send to node B. A and B, B and C are within each other’s range, respectively. However, A and C cannot hear each other. That means, A and C are the hidden terminal for each other. Collision would occur in this case. A B C

slide-39
SLIDE 39

Exposed Terminals

Situation:

Node B wants to send to node A, and node C wants to send to node D. Node B and C are within each other’s range and would wait for the other node to send first. As the result, both nodes are waiting even though they are trying to send to different nodes. A B C D

slide-40
SLIDE 40

One Possible Solution -- MACA

Idea:

  • Before a sender sends the packet, it first sends an RTS (Request-To-Send)

packet to the receiver, asking for its permission

  • If the receiver is ready to receive the packet, then it sends a CTS

(Clear-To-Send) packet to the sender, telling it to send

  • The sender sends the packet to the receiver
  • Other nodes hearing the CTS would know that which sender is sending to

the receiver and thus would wait for it to finish

slide-41
SLIDE 41

Switch

Advantages:

  • Convenient to run wires
  • More reliable; Wire cut is easy to find!
  • More scalable; Keep the same bandwidth for each port instead of nodes sharing bandwidth
slide-42
SLIDE 42

Good Luck on the Midterm ;)