review:

17
• Review:

Upload: turner

Post on 05-Jan-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Review:. Chapter 3: The Data Link Layer achieve reliable, efficient communication between two physically connected machines. Example problems to be addressed: Errors in the physical layer Two machines may have different speeds Design issues: services interface to the network layer - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Review:

• Review:

Page 2: Review:

• Chapter 3: The Data Link Layer– achieve reliable, efficient communication

between two physically connected machines.– Example problems to be addressed:

• Errors in the physical layer

• Two machines may have different speeds

– Design issues:• services interface to the network layer

• how to group bits into frames (framing)

• how to deal with errors (error control).

• how to deal with speed mismatch (flow control).

Page 3: Review:

• Service interface:• unreliable connectionless service

• reliable connectionless service

• reliable connection-oriented service

– Advantages of each service type:– Unreliable connectionless:

» Efficient when error rate is very low,

» Ideal for real time traffic

– acknowledged connectionless:

» Error rate is high, less retries are needed

– acknowledged connection-oriented

» guarantee order, upper level software is simpler

Page 4: Review:

• Framing (break the bit stream into frames)– Why framing?

• Raw bit stream cannot provide any error detection capability.

– Bits may change (lightning strikes).

– Bits may get lost (clock drift).

• Cut the raw bit stream into frames -> can then compute the checksum for the frame. Misunderstanding of the two parties will result in an unmatched checksum.

– How to do framing?– Character count

– Starting and ending characters with character stuffing

– starting and ending flags with bit stuffing

– physical level code violation.

Page 5: Review:

• Character count.Frame: Count + frame data

E.g

5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6

Problem: what if a count is altered during transmission?

Page 6: Review:

• Byte oriented framing.– Each frame is a sequence of bytes. Use special

characters to signal the start and end of a frame.– E.g STX: start of text, ETX: end of text.

Frames: STX frame_data ETX STX frame_data ETX.

PROBLEM: WHAT IF frame_data = ETX

Solution:

Byte stuff the character ETX

Introduce another escape character: DLE: data link escape.

Characters that need to be stuffed?

Example: frame data = STX DLE ETX

frame = ???

– Advantage: can recover frames.– Limitation: ties to a particular character set.

Page 7: Review:

• Bit oriented framing.– A frame is a sequence of bits, using special bit

patterns to signal the start and end of a frame.– E.g: special pattern 01111110

Frames: 01111110 frame_data 01111110.

PROBLEM: WHAT IF frame_data = 01111110

Solution:

Bit stuffing: make sure that such bit pattern will not occur in the frame data --> after 5 1’s add a 0 automatically.

Example: 011111100111110100111110

The sender always adds a 0 after five1’s, the receiver always deletes the 0 after five 1’s.

Example: frame_data=011111011111111111111110

Page 8: Review:

• Physical layer coding violation.– Use special symbol (that never occur in the

data) for the frame boundary.– E.g: Manchester code

1: low to high, 0: high to low.

Frame boundary symbol: high-high or low-low.

Page 9: Review:

• Error control– How to make sure that each frame is eventually

delivered to the destination (reliable service)?– Reliability through acknowledgement

• Sender knows that the frame is delivered when it gets the acknowledgement.

– Sender sends, resends when NACK.

– Receiver sends ACK when the checksum is correct, NACK when incorrect.

• Problem? What if the whole packet gets lost?– Solution: timeout.

• Problem?– Need to do more.

Page 10: Review:

• Flow control– To avoid swamping the slow receiver.– Use a feedback mechanism to make sure that

the sender knows the status of the receiver.• “send me N frames and no more until I tell you to

continue”

Page 11: Review:

Data link layer protocols: P0 - Nothing

• Sender– get a packet from the

network layer

– Add frame header, send the frame to the physical layer.

• Receiver– get a frame from the

physical layer

– strip the header

– pass the packet to the network layer.

Page 12: Review:

P1: Stop and wait (flow control)Assumption: no lost packets

• Sender– get a packet from the

network layer

– Add frame header, send the frame to the physical layer.

– Wait for ACK

• Receiver– get a frame from the

physical layer

– strip the header

– pass the packet to the network layer.

– Send ACK.

Page 13: Review:

P2: stop and wait + timeout + sequence number (flow control + error control )

• Sender– get a packet from the

network layer

– Add frame header (seq), send the frame to the physical layer.

– Wait for ACK till timeout

– If timeout, resend the packet, back to waiting

• Receiver– get a frame from the

physical layer

– strip the header

– if (seq = expected)• pass to the network

layer.

• Send ACK

– Else• send ACK

Page 14: Review:

Stop and Wait in action

Page 15: Review:

Stop and Wait in action

Page 16: Review:

Stop-and-wait operationfirst packet bit transmitted, t = 0

sender receiver

RTT

last packet bit transmitted, t = L / R

first packet bit arriveslast packet bit arrives, send ACK

ACK arrives, send next packet, t = RTT + L / R

U sender =

L / R

RTT + L / R

Page 17: Review:

Performance of Stop-and-Wait• rdt3.0 works, but performance stinks

• example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet:

Ttransmit

= 8kb/pkt10**9 b/sec

= 8 microsec

– U sender: utilization – fraction of time sender busy sending

– 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link– network protocol limits use of physical resources!

U sender

= .008

30.008 = 0.00027

microseconds

L / R

RTT + L / R =

L (packet length in bits)R (transmission rate, bps)

=