CS 457 Lecture 4 Link Layer & Reliable Delivery Part 1 Fall - - PowerPoint PPT Presentation

cs 457 lecture 4 link layer reliable delivery part 1
SMART_READER_LITE
LIVE PREVIEW

CS 457 Lecture 4 Link Layer & Reliable Delivery Part 1 Fall - - PowerPoint PPT Presentation

CS 457 Lecture 4 Link Layer & Reliable Delivery Part 1 Fall 2011 Message, Segment, Packet, & Frame host host HTTP message HTTP HTTP TCP segment TCP TCP router router IP packet IP packet


slide-1
SLIDE 1

CS 457 – Lecture 4 Link Layer & Reliable Delivery Part 1

Fall 2011

slide-2
SLIDE 2

Message, Segment, Packet, & Frame

  • HTTP
  • TCP
  • IP
  • Ethernet
  • interface
  • HTTP
  • TCP
  • IP
  • Ethernet
  • interface
  • IP
  • IP
  • Ethernet
  • interface
  • Ethernet
  • interface
  • SONET
  • interface
  • SONET
  • interface
  • host
  • host
  • router
  • router
  • HTTP message
  • TCP segment
  • IP packet
  • IP packet
  • IP packet
  • Ethernet frame
  • Ethernet frame
  • SONET frame

WE ARE HERE IN THE LAYERS

slide-3
SLIDE 3

Point to Point Data Links

  • One sender, One receiver, One link:

– no Media Access Control – no need for explicit MAC addressing – e.g., dialup link, ISDN line

  • Popular Point-to-Point DLC protocols:

– PPP (point-to-point protocol) – HDLC: High level data link control

slide-4
SLIDE 4

Encoding Bits On The Wire

  • Simple idea of “high” for 1 and low for 0

– Say 1 usec per bit. Sender sends 4 bits with 4 usec “high” – Receiver sees 4.6 usec of “high”…. Was that 4 or 5 bits?

  • Allows clocks in sending and receiving nodes to

synchronize to each other

– no need for a centralized, global clock among nodes!

  • Physical-layer stuff for Electrical Engineers!
slide-5
SLIDE 5

Variety of Encoding Approaches

slide-6
SLIDE 6

Data Frame

  • Link Layer Protocols Define Data Frames

– Header information, error checking, – Data to transmit (Body)

slide-7
SLIDE 7

Ethernet Frame Structure

  • Sending adapter encapsulates packet in

frame

  • Preamble: synchronization

– Seven bytes with pattern 10101010, followed by

  • ne byte with pattern 10101011

– Used to synchronize receiver, sender clock rates

slide-8
SLIDE 8

Ethernet Frame Structure (Cont.)

  • Addresses: source and destination MAC addresses

– Adaptor passes frame to network-level protocol

  • If destination address matches the adaptor
  • Or the destination address is the broadcast address

– Otherwise, adapter discards frame

  • Type: indicates the higher layer protocol

– Usually IP – But also Novell IPX, AppleTalk, …

  • CRC: cyclic redundancy check

– Checked at receiver – If error is detected, the frame is simply dropped

slide-9
SLIDE 9

Error Detection

  • EDC= Error Detection and Correction bits (redundancy)
  • D = Data protected by error checking, may include header fields
  • Error detection not 100% reliable!
  • protocol may miss some errors, but rarely
  • larger EDC field yields better detection and correction
slide-10
SLIDE 10

Parity Checking

  • Single Bit Parity:
  • Detect single bit errors
  • Two Dimensional Bit Parity:
  • Detect and correct single bit errors
slide-11
SLIDE 11

Internet Checksum

Sender:

  • treat segment contents as

sequence of 16-bit integers

  • checksum: addition (1’s

complement sum) of segment contents

  • sender puts checksum

value into UDP checksum field Receiver:

  • compute checksum of received

segment

  • check if computed checksum

equals checksum field value: – NO - error detected – YES - no error detected. But maybe errors nonetheless? More later ….

  • Goal: detect “errors” (e.g., flipped bits) in transmitted

segment

slide-12
SLIDE 12

Checksumming: Cyclic Redundancy Check

  • view data bits D as a polynomial
  • choose r+1 polynomial C
  • goal: choose r CRC bits, R, such that

– <D,R> exactly divisible by C (modulo 2) – receiver knows C, divides <D,R> by C. If non-zero remainder: error detected! – can detect all burst errors less than r+1 bits

  • widely used in practice (ATM, HDCL)
slide-13
SLIDE 13

CRC Example

Want: D.2r XOR R = nG equivalently: D.2r = nG XOR R equivalently: if we divide D.2r by G, want remainder R R = remainder[ ] D.2r G

slide-14
SLIDE 14

Reliable Transfer

Fundamental Networking Topic

Most important topic thus far in this course

  • Frames may be lost or corrupted

– Encoding failures where clocks get out of sync – Error detection reports packet is corrupted – And a vast number of other reasons….

  • Can we build link so it appears reliable?

– Build link so errors never occur??

  • not feasible

– Add error correction to frames?

  • Requires lots of additional overhead bytes for each frame
  • Doesn’t help if entire frame lost (e.g. clock sync error)
slide-15
SLIDE 15

Stop and Wait (first attempt… has an error)

  • Sender writes frame onto wire

and sets a timeout to wait for an ACK

– Sender now “stops” and “waits” for the ACK

  • Upon receiving a packet,

receiver sends an ACK

  • Sender Will Either

1) receive an ACK and can send next frame 2) times out and receives the “lost” frame

slide-16
SLIDE 16

Reasons for Retransmission

  • Packet
  • Timeout
  • Packet
  • ACK
  • Timeout
  • Packet
  • Timeout
  • Packet
  • ACK
  • Timeout
  • Packet
  • ACK
  • Timeout
  • Packet
  • ACK
  • Timeout
  • ACK lost
  • DUPLICATE

PACKET

  • Packet lost
  • Early timeout
  • DUPLICATE

PACKETS

slide-17
SLIDE 17

Stop and Wait (second attempt)

  • Sender writes frame onto wire with Seq #0

and sets a timeout to wait for an ACK

– Sender now “stops” and “waits” for the ACK

  • Upon receiving a packet with Seq #0

receiver sends an ACK for Seq #0

  • Sender Will Either

1) receive an ACK with Seq #0 and send next frame with Seq #1 2) times out and resends the frame with Seq #0

slide-18
SLIDE 18

Stop and Wait in Action

slide-19
SLIDE 19

Stop and Wait In Action (2)

slide-20
SLIDE 20

What’s Next

  • Read Chapter 1, 2.1 - 2.5
  • Next Lecture Topics from Chapter 2.5

– Reliable Transmission

  • Critical Topic In Networking
  • Homework

– Due Thursday

  • Project 1

– Due 9/16 by 11:45