Title: Computer Networks 0605933 Revision Lecture
1Computer Networks(06-05933)Revision Lecture
- Rob Minson, rm. 134
- R.Minson_at_cs.bham.ac.uk
2The Exam
- Length 1 ½ hours
- Structure
- 4 Questions on the paper
- You must answer 3 of them
- All of the questions contain problems from a
range of the topics and layers we covered. DO NOT
just revise 3 of the 4 layers. - Pass Marks
- Standard Module 40
- Extended Module 50 (including your essay)
3Revision Lectures
- Lecture 1 (Monday 27th)
- Physical Layer
- Data-Link Layer
- Lecture 2 (Tuesday 28th)
- Network Layer
- Transport Layer
- Lecture 3 (Thursday 30th)
- QA and exercise recap
4The Physical Layer
5Layering
- Layers allow abstraction and an open model
crucial for Inter-Networking - Layers communicate across hosts via protocols
- Layers communicate with each other via services
- Passing a message through layers involves
encapsulation - OSI and TCP/IP are both models
- TCP/IP is the accepted global standard
6Digital Communications
- Physical properties of media can be used to
represent 1s and 0s - V/-V voltage constants in electrical wire
- Synchronous encoding is needed to ensure sender
knows boundary between bit periods - Each encoding scheme has pros and cons
- Manchester
- Originally used in Ethernet but now considered
wasteful - Non-Return to Zero with RLL coding
- Widely used in Ethernet and others (PCI-e, SATA,
etc)
7Analog Signals and Modulation
- Analog signals carry data by modulating a carrier
wave (frequency, amplitude, phase) - Digital data is encoded by a particular
modulation signature (can be several bits per
period) - Most modern schemes modulate with Amplitude and
Phase and multiplex with Frequency - Maximum frequency (range) limits rate of
communication (same is true in digital comms)
8Theoretical Limits
- Information theorists place absolute limits on
communication rate in any medium - Data Rate is fundamental form of equation
- max bps sample rate bits per sample
- Nyquists data rate shows us the maximum based on
frequency bandwidth - max bps 2f log2V
- Shannons data rate adds the effect of noisy
media on the achievable symbol rate - max bps bandwidth log2(S/N 1)
9The Data-Link Layer(The Logical Link Control
Sub-Layer)
10Error Control
- The physical layer is error-prone
- Noise, attenuation, distortion
- Data Link Layer must deal with this
- Split outgoing binary stream in to frames
- Each frame contains m data bits and r check bits
- Error Detection can detect a corrupted frame
- Parity bit, CRC
- Error Correction can correct the flipped bits
- Hamming codes
11Error Detection with Parity Bits
- A Parity Bit makes the number of 1s in a word
even, e.g. if m 3 and r 1
12Error Correction with Hamming Codes
- Hamming codes correct single bit errors in a
given data word - Embed r parity bits at positions 20, 21, 22,
- Each parity bit checks a unique subset of the
other bit positions (and itself) - If a single bit error occurs a unique combination
of the parity bits will be incorrect - This unique combination is used to locate and
correct the flipped bit
13Error Detection with CRC
- CRC Algorithm the sending end
- Agree a generator divisor G of length r
- Append r zeroes to the M data bits producing xrM
- Calculate xrM G R
- Calculate xrM R T
- Equivalent to just appending R to M
1 0 1
1 1 1 0 0 0
1 1 1 0 0 0 1 0 1 0 1 1
1 1 1 0 0 0 0 1 1 1 1 1 0 1 1
14Error Detection with CRC
- CRC Algorithm the receiving end
- Divide the received bits by G
- If the remainder 0, remove first r bits and
continue - If the remainder is ? 0 an error has occurred
1 1 1 0 1 1 / 0 1 1 0 0 0 0
M 1 1 1
15Bursty Error Control
- Block Sending
- If a burst error of length n wipes out a frame
this will be felt as a single bit error in n
consecutive frames (each easy to detect/correct)
16Flow Control
- Serves two functional purposes
- Prevent buffer overruns
- Recover from lost frames
- Stop and Wait
- prone to deadlock
- Automatic Repeat Request
- uses timeouts, no deadlock but inefficient
- Sliding Window
- pipelines multiple frames
- two flavours Go-Back-N and Selective-Repeat
17The Data-Link Layer(The Medium-Access Control
Sub-Layer)
18MAC Layer Summary
- ALOHA protocols
- Randomisation of re-send time (slotted/pure)
- CSMA protocols (with persistence level)
- Collision Detection (Ethernet)
- Collision Avoidance (WLAN)
- Both use Exponential Back-off
- MAC collision domains
- Can be separated by Bridges
- Can be eradicated by Switches
19ALOHA Collision Detection
- Central station bounces ACK back to sender
- ACKs sent on separate frequency so never collide
- If ACK not received then sender assumes collision
20Slotted vs. Pure ALOHA
- Both use randomisation after collision
- Slotted reduces probability of collision
- If frame is ready in middle of period
- In Pure ALOHA I will begin sending and destroy
any currently sending frames - In Slotted ALOHA I will wait and only destroy
other waiting frames
21Carrier Sense Protocols (CSMA)
- Medium can be sensed for traffic
- 1-persistent
- channel free send immediately
- channel busy send once it is free
- non-persistent
- channel free send immediately
- channel busy send after random amount of time
- (slotted) p-persistent CSMA
- channel free transmit with prob p
- channel busy repeat algorithm next slot
22CSMA/CD in Ethernet
- Propagation delay means collision are not
detected immediately. - Can be thought of as a frame bouncing off
another frame and back to the sender
23CSMA Adaptive Backoff
- CSMA with Exponential Backoff
- Random range 0,2c-1 (where c collisions)
- Slotted time (in Ethernet 1 slot length RTT)
- t0s A and B collide
- A and B choose randomly from 21 slots 0,1
- A chooses 1, B chooses 1
- t2s A and B collide
- A and B choose randomly from 22 slots 0,3
- A chooses 2, B chooses 0
- t3s B transmits successfully
- t5s A transmits successfully
24CSMA/CA in WiFi
25The Network Layer
26Link-State vs. Distance-Vector
- Link-State
- Global Coordination
- Fast Convergence
- Guaranteed Cycle Free
- High Message overhead
- Distance-Vector
- Localised Gossiping
- Slow Convergence
- Cycles (Count-to-Infinity)
- Can be solved with split-horizon/hold-down but at
a cost - Low overhead
27Distance-Vector Routing
28Distance-Vector Routing
- Count-to-Infinity Problem
- Nodes advertise others routes back to them
- When a node/link fails, nodes incorrectly
advertise routes back to the failed node/link
29Link-State Routing
30Link-State Routing
- Link-State Advertisements contain local info
- combined they construct the entire graph
- LSAs are buffered and periodically forwarded
- Seq and Age numbers allow flooding to be
constrained and for old data to be removed from
the network
31Interior/Exterior Gateway Protocols
- Internet organised in to Autonomous Systems
(ASes) - The routing graph of an AS is maintained by its
routers with an IGP - Distance Vector RIP and EIGRP
- Link-State IS-IS and OSPF
- The graph between ASes is maintained by gateway
routers with an EGP - Distance Vector BGP
32Routing via IP
- IP Class System (Classful Addressing)
- Originally AS addresses were from 3 classes
- Classes have different number of bits for network
portion - Class indicated by most-significant bits
33Routing via IP
- Classless-Inter-Domain Routing (CIDR)
- By choosing a mask length explicitly, AS size can
be matched precisely to projected need - Network Address includes the net mask
- IPAddress/mask
- (e.g. 152.64.0.0/14 first 14 bits are network)
- Before CIDR
- 23.0.0.0 unambiguously indicated a class A
network - After CIDR
- Same network must advertise itself as 23.0.0.0/8
34NAT (Network Address Translation)
- NAT using packet manipulation
35IP Acquisition and Resolution
- Translating between MAC and IP addresses
- ARP what is the MAC for this IP?
- RARP, BOOTP what is the IP for this MAC?
- Acquiring IP addresses
- Hierarchy of organisations manage the whole
address space - At single-host level, lease a single address
via a DHCP server somewhere on your network
36The Transport Layer
37TCP vs. UDP
- What is UDP useful for?
- Fire-and-Forget data
- informational (time server updates, keep alives)
- wide-area search (service discovery, P2P search)
- Realtime data
- Any application where we dont care about data
from the past, only current data - voice over IP
- streaming video/audio
- multiplayer games
38Fundamentals of TCP
- Basically a Sliding Window protocol
- Data sent in segments in IP packets
- Very large (32-bit) sequence number
- represents byte offset of segment
39TCP Error/Flow Control
- Sliding window (byte-oriented)
- ACK for byte n means I have received every byte
from 0 to n-1 correctly - Selective Repeat
- Means sender receiver have shared window
- Receiver buffers out-of-order byte segments
- Requests retransmission via NACK
- (NACK ACK for any segment other than latest
received) - 3 x NACK prompts a resend
- RTO timeout value used as a failsafe
40TCP and RTO-Estimation
- RTT segment ? receiver ACK ? sender
- What happens if
- RTO lt RTT?
- RTO gtgt RTT?
- In TCP/IP the RTT is very hard to predict
- Over time (traffic patterns, routing element
problems) - Between networks (bandwidth, diameter,
population) - TCPs various strategies for piggybacking and
delaying ACKs dont help either - TCP must therefore have a runtime-estimated RTO
- Sampling (RTT SRTT)
- Smoothing (aSRTT (1-a)RTT a smoothing level)
41TCP and Dynamic Flow Control
- Application Layer drives window changes
- TCP Buffer
- used to store and re-order segments
- usually fairly small
- determines max window size
- Application Buffer
- used to store fully-ordered segments
- usually fairly large
- can be sampled by TCP process to determine best
current window size
42TCP and Congestion Control
- Multiple TCP flows share same routing elements
(cant predict flows)
- Congestion Control
- Add a second window (congestion window)
- Permitted segments must lie in both windows
43TCP and Congestion Control
- Reacting to congestion
- Determine congestion state based on ACKs
- ACKs are being received before RTO is reached
- there is low/no congestion
- ACKs are not being received or are arriving late
- router overload or router buffer overflow is
ocurring - Slow Start Phase
- Send 1 segment, wait...
- receive 1 ACK, increase cwnd to 2
- Congestion Avoidance Phase
- Send 8 segments, wait...
- receive 8 ACKs, increase cwnd by 8/8 MSS
44TCP and Congestion Control
- Additive Increase/Multiplicative Decrease (AIMD)