Spring 2008 Mark Fontenot [email protected] CSE 1341 Principles of Computer Science I Note Set 8.
TO 1-17-06 p. 1 Spring 2006 EE 5304/EETS 7304 Internet Protocols 1-24-2006 Tom Oh Dept of Electrical...
-
Upload
christian-solomon-harrington -
Category
Documents
-
view
215 -
download
1
Transcript of TO 1-17-06 p. 1 Spring 2006 EE 5304/EETS 7304 Internet Protocols 1-24-2006 Tom Oh Dept of Electrical...
TO 1-17-06 p. 1
Spring 2006
EE 5304/EETS 7304 Internet Protocols
1-24-2006
Tom OhDept of Electrical Engineering
TO 1-17-06 p. 2
Administrative Issues
Course Website: www.engr.smu.edu/eets/7304
Obtain lectures, video clip, syllabus, homework and homework solutions
Please fill out the Student Information Sheet and email it to me as soon as possible.
If you have any question regarding DVD delivery and other adminstrative issues, please contact Gary McClesky ([email protected], 214-768-3108).
TA: Mr. Poonawala will be my TA for this semester.
TO 1-17-06 p. 3
Grade
Because of huge enrollment in this class, I will not include final report as a part of your semester grade.
So final grade will consists of three test grades only.
Grade distribution:
Test 1: 30% Test 2: 30% Test 3: 40% Homework will not be part of your grade.
All tests will be close notes and books.
TO 1-17-06 p. 4
Grade (cont)
Test Dates
Test 1 : Feb. 28 (Materials from week 1, 2, 3, 4, 5) Test 2 : Apr. 4 (Materials from week 6, 7, 8, 10 and 11)
• Week 9 is Spring Break Test 3: Final week (May 5- 11) (Materials from week 12,
13, 14, 15 and 16)
TO 1-17-06 p. 5
DVD and Distance Learning Students
DVD and DLS students will have additional week to finish the test. For example, DVD students must take Test 1 by Mar. 7.
For DVD and DLS students: If you don’t have proctor at your site, please ask Gary McClesky about test proctor in your area.
TO 1-17-06 p. 6
Outline
Types of networks
History
Standards
Terminology
OSI protocol reference model
Text Book (Comer): Ch. 16 Protocols and Layering: pg. 251-pg. 269
Protocol layering principles
Text Book (Comer): Ch. 16 Protocols and Layering: pg. 251-pg. 269
TO 1-17-06 p. 7
Outline (cont)
TCP/IP protocol architecture
Text Book (Comer): Ch. 17 Internetworking: Concepts, Architecture, and
Protocols: pg. 273-283)
B-ISDN protocol reference model
TO 1-17-06 p. 8
OSI Protocol Reference Model (cont)
7 layers:
7. Application layer
User program that generates or uses data What the user sees
6. Presentation layer
Changes syntax (data format) of information, as necessary
5. Session layer
Establishes and synchronizes sessions (dialogues) between applications
TO 1-17-06 p. 9
OSI Protocol Reference Model (cont)
4. Transport layer
Reliable end-to-end transfer of information between users Establishes and manages connections between users Segments and reassembles information to/from subnet End-to-end error recovery and flow control
TO 1-17-06 p. 10
OSI Protocol Reference Model (cont)
3. Network layer
Establishes and manages connections through network Carries packets from source to destination by routing
between nodes Congestion control
TO 1-17-06 p. 11
OSI Protocol Reference Model (cont)
2. Data link layer
Reliable error-free transmission on link, with flow control and synchronization
Organizes bits into frames, adds acknowledgements and retransmissions
MAC sublayer: controls access to shared medium (ie, in LANs)
1. Physical layer
Point-to-point transmission of unstructured bitstream Depends on physical medium
TO 1-17-06 p. 12
OSI Layering Principles
Layers are independent and strictly vertical
Each layer provides services to next higher layer and use services from next lower layer
“Protocol entities" are active in each layer
“Peer entities" in same layer communicate with each other
To send, data is passed down the layers, each layer adds protocol information (eg, header)
TO 1-17-06 p. 13
OSI Layering Principles (cont)
To receive, data is passed up the layers, each layer removes protocol information
Protocol defines how the information is used between peer entities in same layer
TO 1-17-06 p. 14
Physical
Sending application
Application
Presentation
Session
Transport
Network
Data link
Physical
Receiving application
Application
Presentation
Session
Transport
Network
Data link
DataAH
DataPH
DataSH
DataTH
DataNH
DataDH DT
Bits
Host A Host B
Protocol data unit exchanged
TO 1-17-06 p. 15
Difficulties with OSI Model
Not best or only way to divide layers
Session and presentation layers are often minor, network layer is complex
Not followed exactly in practice, more useful as reference
Error control and flow control are repeated in different layers
Not obvious which layer is responsible for encryption, network management, internetworking
OSI model is strictly vertical: all networks conform to single standard protocol in each layer
TO 1-17-06 p. 16
TCP/IP Protocol Architecture
1974 DoD standardized protocol suite for connecting other networks to ARPAnet
Internetworking is very important design consideration
TELNETApplication layer HTTP FTP SMTP SNMP
Transport layer TCP UDP
Internet layer IP ICMP
Network access layer Ethernet Radio ... etc (any network protocol)
TO 1-17-06 p. 17
TCP/IP Protocol Architecture (cont)
4 layers:
4. Application layer
Telnet, ftp, SMTP, SNMP, HTTP Corresponds to OSI layers 6-7, some 5
3. Transport (host-host) layer
Allows end-to-end communication Connection establishment, error control, flow control Transmission control protocol (TCP), user datagram
protocol (UDP) Corresponds to OSI layers 4, some 5
TO 1-17-06 p. 18
TCP/IP Protocol Architecture (cont)
2. Internet layer
Route data between different networks Includes addressing, segmentation/reassembly, error
control Implemented in gateways and routers Internet protocol (IP)
• IP packet is basic data unit in Internet Roughly corresponds to OSI layer 3
TO 1-17-06 p. 19
TCP/IP Protocol Architecture (cont)
1. Network access (host-to-network) layer
Lets host pass data to network with flow control, error control, priority, security
Corresponds to OSI layers 1-2, some 3 Can be any protocol (eg, Ethernet, ATM, X.25) to carry IP
packets
TO 1-17-06 p. 20
OSI vs TCP/IP Models
OSI model can be generally applied to most protocol suites, TCP/IP model is specific to Internet
Hierarchy versus layering
OSI does not allow different protocols in same layer OSI allows interactions only between adjacent layers
TO 1-17-06 p. 21
OSI vs TCP/IP Models (cont)
TCP/IP recognizes importance of internetworking different networks
Internetworking was inserted into OSI model as sublayer in layer 3
TCP/IP recognizes importance of connectionless service
OSI model recognizes only connection-oriented transport layer
TO 1-17-06 p. 22
B-ISDN Protocol Reference Model
3 planes:
User plane: protocols for user data
Control plane: protocols for control (signaling) data
Management plane: protocols for management data (e.g., OAM)
Higher layers Higher layers
ATM adaptation layerCS
SAR
ATM layer
Physical layer
Management plane
Control plane User plane
TO 1-17-06 p. 23
B-ISDN Protocol Reference Model (cont)
4 layers in user plane:
4. Services
Originally Class A, B, C, D (obsolete) Now CBR, real-time and nonreal-time VBR, ABR, UBR
3. ATM adaptation layer (AAL)
Originally AAL 1, 2, 3, 4 corresponding to services classes A, B, C, D
Now AAL1, AAL2, AAL3/4, AAL5 Translate user data into ATM cells
TO 1-17-06 p. 24
B-ISDN Protocol Reference Model (cont)
2 sublayers:• Convergence sublayer (CS): service-specific
• Segmentation and reassembly (SAR): divides user messages into 48-byte cell payloads and recombines at receiver
2. ATM layer
Connection-oriented transfer of ATM cells (53-byte packets) across network
Establish, maintain, and terminate virtual connections Routing and congestion control
TO 1-17-06 p. 25
B-ISDN Protocol Reference Model (cont)
1. physical (transmission) layer
Physical signal and framing, e.g., SONET Assumed to be digital, highly reliable, low bit errors
TO 1-17-06 p. 26
Wrap Up
Protocol layering is a central design principle in all modern networks, although approaches may differ in some aspects
Examples: OSI reference model, TCP/IP protocol suite
While TCP/IP is prevalent in practice, OSI reference model provides a common conceptual understanding and terminology
TO 1-17-06 p. 27
Spring 2006
EE 5304/EETS 7304 Internet Protocols
Tom OhDept of Electrical Engineering
Data Link Layer, ErrorDetection, ARQ
TO 1-17-06 p. 28
Outline
Data link layer
Error detection
Stop-and-wait ARQ
Go-back-N ARQ
Selective repeat ARQ
TO 1-17-06 p. 29
Data Link Layer (OSI Layer 2)
Physical
Data link
Network
- Unguaranteed, unstructured bitstream transmission on physical channel- Electrical/optical/radio
- Hides details of physical layer from network- Adds reliability, synchronization, flow control
- Routing, congestion control
Layer 1
Layer 2
Layer 3
TO 1-17-06 p. 30
Data Link Layer (cont)
Adds synchronization (framing), reliability (error control), and flow control
Depends on quality of physical layer Eg, wireless links are unreliable needing strong error
control, optical fiber links are very reliable needing little error control
Framing
Break bitstream into identifiable frames Frame = block of data + control info. (frame header/trailer)
TO 1-17-06 p. 31
Framing
Break bitstream into identifiable frames = block of data + control info. (frame header/trailer)
Commonly use special byte pattern (eg, 01111110) to mark beginning and end of frame
Same byte can mark end of one frame and start of next
Node NodeB
Frame
E B
Frame
E
TO 1-17-06 p. 32
Framing (cont)
What if this byte pattern appears in data?
Bit stuffing: insert 0 bit after every 5 consecutive 1's Receiver recognizes this pattern and deletes the stuffed 0
bit
Pattern of 6 consecutive 1's can only mean frame beginning/end
More than 6 consecutive 1's is illegal conditionoriginal:
transmitted after stuffing :
received after destuffing :
0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 000
stuffed bits
0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
TO 1-17-06 p. 33
Error Control
To detect random bit errors and possibly correct them
Bit errors can cause lost frame (unrecognizable frame) or errored frame (certain bits are wrong)
Commonly handled by ARQ (automatic repeat request) schemes involving error detection + acknowledgements + retransmissions per frame
Stop-and-wait ARQ Go-back-N ARQ Selective-reject (selective repeat) ARQ
TO 1-17-06 p. 34
Error Control (cont)
Error control = error detection or error correction
Typically only detection -- more efficient to retransmit (ARQ- automatic repeat request) than correct (FEC- forward error correction) if bit error rate is low
ARQ involves overhead cost per packet + costs for ACKs + costs for retransmissions, but retransmissions will be rare if bit error rate is low
FEC requires more code bits per frame → more overhead cost for every packet even if no errors
Error correction must be used when retransmissions cannot be requested, e.g., simplex links, deep space, audio CDs
TO 1-17-06 p. 35
Error Control (cont)
In ARQ schemes, acknowledgements can be positive or negative
Positive acknowledgement: ACK only frames received error-free
No ACK means need to retransmit Sender will retransmit frame after time-out
• Could be slow to respond to lost frame Lost ACKS → unnecessary retransmissions
TO 1-17-06 p. 36
Error Control (cont)
Negative acknowledgement (NACK): NACK only errored frames
NACK means need to retransmit Saves bandwidth if errors are rare What if NACK is lost?
• Possible complications
Or both positive + negative acks
Sender will retransmit for NACK or lost ACK/NACK
TO 1-17-06 p. 37
Error Detection
For data of m bits, add an error check of r bits
Error check includes some redundancy of data enough to detect errors but not which error
n-bit codeword = m data bits
+ r error check bits
Data
Calculate checksum
Transmit data + checksum
Recalculate checksum from received data
Compare to received checksum
Error No error
=°
Sender
Receiver
m data bits r check bits
2m
“legal” codewords
TO 1-17-06 p. 38
Hamming Distance
Hamming distance = minimum number of bit errors to change legal codeword into another legal codeword
To detect d errors, need distance (d+1) code
Takes d+1 or more bit errors to receive legal codeword that was another codeword originally
To correct d errors, need distance (2d+1) code
With d or fewer errors, can always look for closest legal codeword
TO 1-17-06 p. 39
Hamming Distance (cont)
Eg, codewords: 0000000000, 0000011111, 1111100000, 1111111111
Distance = 5 → detect up to 4 bit errors
C1 C2
C3 C4
distance = 5
Codewords5
4
5Up to 4 bit errors are detectable as illegal
codewords
TO 1-17-06 p. 40
Hamming Distance (cont)
Codewords: 0000000000, 0000011111, 1111100000, 1111111111
Distance = 5 → correct up to 2 bit errors
C1 C2
C3 C4
distance = 5
Up to 2 bit errors are correctable to nearest legal codeword
Codewords5
2
5
2
TO 1-17-06 p. 41
Single (even) Parity Bit
Parity=0 if number of 1 bits in data is even, parity=1 if number is odd (ie, parity bit = binary addition of data bits modulo 2)
Valid codewords should always have even number of 1’s
Distance = 2 code → can detect single bit errors (or odd number of bit errors), no error correction
For long frames or bursty errors, even or odd number of bit errors are equally likely → about equally likely to detect errors as not
TO 1-17-06 p. 42
3 bits parity bit
0000 00010011 00100101 01000110 01111001 10001010 10111100 11011111 1110
legal illegalExample:
Single bit error will change valid word into an invalid word (detectable);double bit error will change valid wordinto another valid word (undetectable)
→ 23 legal codewordsout of
24 possible codewords
transmission
Received codewords:
TO 1-17-06 p. 43
Bit-Interleaved Parity (BIP-N)
1st error check bit = parity bit over 1st bits of all N-bit sequences
2nd error check bit = parity bit over 2nd bits of all N-bit sequences, etc.
Better for detecting bursts, eg, an error burst of length up to N is easily detected
1 1 1 1 1 1 0 0
: : : : : : :
BIP-8: add parity bits for each column
: : : : : : :
:
:
1 1 0 0 1 0 0 1
1 0 0 0 1 0 0 0
last data byte
first data byte
:
:
TO 1-17-06 p. 44
Horizontal/Vertical Parity Checks
Arrange data in M x N array, calculate parity bits for M rows and N columns
Lower right corner can be parity check over column or row parity bits
horizontal checks
0 0 1 0 0 1 1 0
1 1 1 1 1 1 0 0
0 0 1 1 0 1 1
vertical checks
1 0 1 0 1 1 0
0
1
1 1 0 0 1 0 0 1
1 0 0 0 1 0 0 0
1
0
0
1
0
0
0 0 1 0 0 1 1 0
1 1 1 1 1 1 0 0
0 0 0 1 0 0 1
4 bit errors may not be detected
1 0 1 0 1 1 0
0
1
1 1 1 0 1 1 0 1
1 0 0 0 1 0 0 0
1
0
0
1
0
0
TO 1-17-06 p. 45
Horizontal/Vertical Parity Checks (cont)
Distance = 4 code
Can detect odd number of bit errors in any row or column Can detect up to 3 bit errors and correct any single bit
error But any rectangular pattern of 4 bit errors is undetectable
TO 1-17-06 p. 46
IP Example
Internet protocol (IP) checksum
Checksum field is included in IP packet header for error detection
View packet as sequence of 16-bit words, add up all words using ones complement arithmetic
Errors are detected if checksum in header does not match with calculated checksum
• Relatively weak error detection but simple implementation• eg, misordering of 16-bit words is not detectable
TO 1-17-06 p. 47
k-bit string is viewed as coefficients of (k-1)-degree polynomial, eg, 1011 represents 3rd-degree 1x3 + 0x2 + 1x + 1
All arithmetic is modulo 2, ie, XOR (binary addition/subtraction without carries/borrows)
Modulo 2 long division is like binary except subtraction is modulo 2
Sender and receiver agree on r-degree generator polynomial G(x)
Both highest order bit and last bit are 1
Cyclic Redundancy Check (CRC) or Polynomial Codes
TO 1-17-06 p. 48
CRC (cont)
Compute r-bit checksum and append to m-bit data string such that resulting n-bit codeword is exactly divisible by G(x)
(1) append r zeros to end of m-bit data string M(x) to get (m+r) bits representing xrM(x)
(2) divide (modulo 2) xrM(x) by G(x) (3) r-bit remainder is checksum
Resulting n-bit codeword C(x) is exactly divisible by G(x) with no remainder
TO 1-17-06 p. 49
Example: M(x)=10011010, G(x)=1101
1. Append temp. 000 to M(x) x3M(x) = 10011010000
100110100001101110110011101
10001101
10111101
11001101
10001101
101
3. Append remainder to M(x) C(x) = 10011010101
111110012. Divide by G(x)
TO 1-17-06 p. 50
CRC (cont)
Receiver divides codeword by G(x), assumes no error only if remainder is 0
Consider error pattern as polynomial E(x)
Received frame = transmitted codeword C(x) + E(x) C(x)/G(x) has no remainder -> any remainder is due to
E(x)/G(x) Errors undetectable only if E(x) is exactly divisible by G(x)
TO 1-17-06 p. 51
CRC (cont)
Best choices of G(x) are not evenly divisible by common error polynomials E(x), and
if G(x) has 2 or more terms, then all single-bit errors can be detected
if G(x) has a factor with at least 3 terms, then all double-bit errors can be detected
if x+1 is a factor of G(x), then any odd number of errors can be detected
r-bit checksum will detect all burst errors of length up to r
TO 1-17-06 p. 52
CRC (cont)
Commonly used G(x):
CRC-12: x12 + x11 + x3 + x2 + x + 1 CRC-16: x16 + x 15 + x2 + 1 CRC-CCITT: x16 + x 12 + x5 + 1 CRC-32: x32 + x 26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7
+ x5 + x4 + x2 + x + 1
TO 1-17-06 p. 53
ARQ Schemes
Automatic repeat request (ARQ) is possible when a feedback channel can be used for acknowledgements
Receiver detects errors but does not attempt to correct
Overhead (retransmissions) is incurred only when necessary, unlike constant overhead in FEC (redundant bits)
More efficient than FEC for low BER
TO 1-17-06 p. 54
Stop-and-Wait ARQ
Source sends a frame and waits for ACK or NACK
Receiver returns ACK for correct frame, NACK for errored frame, nothing for destroyed frame
Source retransmits after NACK or time-out
Sends next frame only after valid ACK
TO 1-17-06 p. 55
Stop-and-Wait ARQ (cont)
Frame 1 lost
Frame 0 successful
frame 0
Timeout
Timeout
ACK 1
frame 1
frame 1
ACK 0
frame 0
ACK 1
frame 0
ACK 1
Retransmit
Frame 1 successful
ACK 1 lost
Retransmit
Frame 0 successful
Sender Receiver
time
TO 1-17-06 p. 56
Stop-and-Wait ARQ (cont)
If ACK is lost, source will retransmit
Receiver will get copy of previous frame Frames must be numbered to avoid ambiguities
Frame X receivedTimeout
frame X
ACK X
frame X
ACK X
ACK X lost
Retransmit
Frame X successful
Sender Receiver
Duplicate received
TO 1-17-06 p. 57
Stop-and-Wait ARQ (cont)
If ACK is late, sender will retransmit
Sender may get duplicate ACKs after retransmission Duplicate ACKs must not cause confusion ACKs must be numbered (convention is to give number of
next expected frame)
Frame X receivedTimeout
frame X
ACK X
frame X
ACK X
ACK X is slow
Retransmit
Duplicate ACKs
Sender Receiver
Duplicate received
TO 1-17-06 p. 58
Stop-and-Wait ARQ (cont)
One bit sequence number is sufficient
Only ambiguity is between consecutive frames
Simple but inefficient
tframe = time to transmit frame tprop = propagation time If no errors, it takes tframe + 2 tprop time per frame
(ignoring time for ACKs)
TO 1-17-06 p. 59
Stop-and-Wait ARQ (cont)
Utilization U = 1/(1 + 2a) where a = tprop/tframe (normalized propagation time)
tframe = 1
ACK
Sender Receiver
Frame
tprop = a
tprop = a
time
TO 1-17-06 p. 60
Go-Back-N ARQ
Efficiency can be improved by allowing multiple frames in transit before ACK
Sliding window = up to N unacknowledged frames allowed to be in transit at any one time
Sender must wait for ACK before advancing window to next frame
Example: if last ACKed frame is j, sender can send up to frame j+N before stopping and waiting for ACK of frame j+1
TO 1-17-06 p. 61
Go-Back-N ARQ (cont)
ACKs may be accumulative, ie, ACK(j) will acknowledge all frames up to j
ACKs may be “piggybacked” - carried in the header of a data frame in reverse direction
If frame j is NACKed, sender will go back and resend frame j
For simplicity, all subsequent frames are repeated Destination can discard errored frame j and all subsequent
frames until frame j is received correctly
TO 1-17-06 p. 62
Go-Back-N ARQ (cont)
timeout
error
0 1 2 3 4 5 6 7 3 4 5 6 7 8 9 10
0 1 2 E D D D D 3 4 5 6 7 8 9 10
frames discardedby receiver
A
ackfram
e
B
time
TO 1-17-06 p. 63
Go-Back-N ARQ (cont)
n-bit sequence numbers can support window sizes up to 2n-1
Why not window sizes up to 2n?
Example: assume 3-bit sequence numbers and window size of 8
TO 1-17-06 p. 64
Go-Back-N (cont)
timeout
0 1 2 3 4 5 6 7 0
0 1 2 3 4 5 6 7 0
Window size = 8:
Ack(0) refers to entire window of frames or is it duplicate of previous Ack(0)?
No problem if window size is limited to 7 instead
A
ack(
0)frame
B
ack(
0)time
TO 1-17-06 p. 65
Go-Back-N (cont)
timeout
0 1 2 3 4 5 6 7
0 1 2 3 4 5 6 7
Window size = 7:
No ambiguity because Ack(0) cannot re-occur
A
ack(
0)frame
B
ack(
7)time
TO 1-17-06 p. 66
Go-Back-N (cont)
Assume no errors and normalize:
Frame transmission time = 1 Propagation time = a
Case 1: N > 2a + 1
1 2a
N
First Ack returns before the end of window → sender can keep transmitting→ utilization U = 1
TO 1-17-06 p. 67
Go-Back-N (cont)
Assume no errors and normalize:
Frame transmission time = 1 Propagation time = a
Case 2: N < 2a + 1
1 2a
N
First Ack returns after the end of window → sender must stop and wait→ utilization U = N/(1+2a)
TO 1-17-06 p. 68
Selective Repeat ARQ
Go-back-N may be inefficient because several frames are retransmitted for every errored frame, even if some were received properly
Efficiency may be improved if sender retransmits only specific errored frames
If frame j is lost, receiver will continue to receive and buffer frames j+1, j+2,...
When frame j is received without errors, frames must be reordered in proper sequence
TO 1-17-06 p. 69
Selective Repeat (cont)
timeout
error
0 1 2 3 4 5 6 7 3 8 9 10 11 12 13 14
0 1 2 E 4 5 6 7 3 8 9 10 11 12 13 14
frames must be buffered and
reordered after frame 3 received
correctly
A
ackfram
e
B
time
TO 1-17-06 p. 70
Selective Repeat (cont)
Capable of higher efficiency than go-back-N
If no errors, efficiency is same as go-back-N If errors, each error causes one frame retransmission (go-
back-N would retransmit multiple frames)
Not as widely adopted as go-back-N because more difficult implementation
Receiver must buffer frames received after an errored frame and re-order them after that frame is retransmitted
TO 1-17-06 p. 71
Wrap Up
Data link layer adds synchronization, reliability, and flow control above physical layer if needed
Error control for reliability
Usually error detection and retransmissions Stop-and-wait ARQ, go-back-N ARQ, selective repeat
ARQ