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 Algorithm will not be included) - Layers and Protocols - Physical Layer - Link Layer (part)
Layers & Protocols
Layers => Protocols OSI Model (Open Systems Interconnection): - Application Note: - HTTP (S) | FTP | SMTP | DNS | Telnet | BGP - Presentation Presentation and Session layers are usually counted into Transport layer; - Session - Transport Ethernet is a mix of link and physical layer. - TCP | UDP - Network - IPv4, IPv6 - Data Link - ARP , MAC, PPP - Physical
Physical Layer
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
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
Coding vs. Modulation 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
Limits on Transmission Rate Variables: B: bandwidth S: signal strength N: noise strength Nyquist Limit: - Maximum bit rate: - R = 2B log 2 V bits/sec Shannon Capacity: - Signal-to-Noise Ratio: - SNR db = 10 log 10 (S/N) - Shannon Capacity: - Max information carrying rate of a channel - C = B log 2 (1 + S/(BN)) bits/sec - Takeaway: Increasing bandwidth is more effective for increasing C.
Link Layer
Framing Ways to determine the start and end of a frame? - Byte Count - Byte Stuffing - Bit Stuffing
Discussion How does each of framing method work? Any advantage and disadvantage? Time: 2 min
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
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
Byte Stuffing Example [A, B, ESC, FLAG, ESC, C] => [A, B, ESC, ESC, ESC, FLAG, ESC, ESC, C]
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
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
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.
Discussion When should we use detection over correction? When should we use correction over detection? Time: 2 min
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
Common Ways to do Error Detection/Correction Error Detection - Internet Checksum - CRC (Cyclic Redundancy Check) Error Correction: - Hamming Code
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)
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
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
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
Correct the Message! (2 min) 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
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
What could go wrong? - Packets get dropped midway - Duplicate packets - Packets arrive late and cause timeout What should we do? Stop-and-Wait
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 -
Multiplexing 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
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
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!
CSMA/CD (with Collision Detection) Idea: - Detect network jam and abort the rest of the frame time - => Reduce the cost of collisions
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.
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
Wireless Complications Common problems: - Hidden Terminal Problem - Exposed Terminal Problem
Discussion (2 min) What exactly are hidden terminal problem and exposed terminal problem? How would we solve these problems?
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
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
Recommend
More recommend