• Tidak ada hasil yang ditemukan

Direct Link Networks Reliable Transmission

N/A
N/A
Protected

Academic year: 2018

Membagikan "Direct Link Networks Reliable Transmission"

Copied!
50
0
0

Teks penuh

(1)

Computer Network

(2)

Outline

• Direct link networks (Ch. 2)

– Encoding

– Framing

– Error detection

– Reliable delivery

(3)

Hardware Building Blocks

• Nodes

– Hosts: General-purpose computers

– Switches: Typically special-purpose H/W – Routers

• Links

– Cooper with electronic signaling – Glass fibre with optical signaling

(4)
(5)

Link

• Cooper Based Media

(6)

Link

• Optical Media

– Multimode Fibre 100 Mbps

2Km

(7)

Link

• Comparison Of Octical Media

– Single mode

• Lower attenuation (longer distances) • Lower dispersion (higher data rates)

– Multi mode

(8)

Link

• Advantages of optical communication

– higher bandwidths

– superior attenuation properties

– immune from electromagnetic interference

– no crosstalk between fibers

(9)

Link

• Wireless transmission

– 2.4 GHz radio 11 Mbps 7Km

– Infrared (IR) link 1 Mbps 9 m

(10)
(11)
(12)

Encoding (line coding)

‰

problems with signal transmission

– attenuation: signal power absorbed by medium – dispersion: a discrete signal spreads in space – noise: random background “signals”

(13)

Encoding Taxonomy

• Digital data, digital signal

– codes which represent bits – our focus

– many strategies!

• Analog data, digital signal

– sampling to represent voltages

• Digital data, analog signal

– modulation to represent bits

• Analog data, analog signal

(14)

Non-Return to Zero (NRZ)

• 0 Æ

low signal; 1 Æ

high signal

(15)

NRZ-Inverted (NRZI)

• 1 Æ

make transition; 0 Æ

stay at the current

level

• Addresses clock synchronization problem

for long strings of 1’s

(16)
(17)

Manchester Encoding

• Each bit contains a transition

– 0

Æ

high-to-low transition

– 1

Æ

low-to-high transition

• Enables effective clock recovery at receiver

(18)

Manchester Encoding contd.

• Disadvantage: needs a clock that is twice as

fast as the transmission rate

1 1 0 1 0 1 0 0 1

(19)

4B/5B Encoding

• Tries to address inefficiencies in Manchester

• Idea is to insert extra bits in bit stream to break up

long strings of 0’s or 1’s

• Every 4 bits of data are encoded in 5 bit code (see

text for details)

– at most one leading 0 – at most two trailing 0’s

• therefore never more than three consecutive 0’s

• Uses NRZI to put bits on wire

(20)

Framing

• Blocks of data (not just sequences of bits)

are exchanged across links --- frames

(21)

Character-Based Framing

• Special characters (tags) are used to indicate idle

fill (ASCII SYN), start of text (STX) and end of

text (ETX)

• Used by PPP (point-to-point protocol)

(22)

Character-Based Framing contd.

(23)

Bit-Oriented Framing

• Each frame begins with a start and end bit

sequence (flag)

– 01111110 = 0160 is the usual flag

• Example: HDLC (high-level data link protocol)

(24)

Bit Stuffing

• Sender: inserts a 0 after five consecutive 1s

• Receiver: when it sees five 1s makes

decision based on next two bits

– if next bit 0 (this is a stuffed bit), remove it

– if next bit 1, look at next bit

• if 0 this is end of frame (receiver has seen 01111110)

(25)
(26)

Framing with Length Fields

• Detecting the end of the frame done by sending

length information (e.g. number of bytes in the

frame) in the header

• Used by DECNET’s DDCMP

(27)

Digital transmission over

analog

• modulation to represent bits

– amplitude (AM)

– frequency (FM)

– phase/phase shift

(28)
(29)
(30)
(31)

Error Detection

• Bit errors can be introduced in packets

• This problem has been studied for a long time

– Error detection (and correction) codes

– Cyclic redundancy check (CRC) is a common error detection method

• Basic idea of any scheme is to add redundant data

– A primary goal is to send minimal amount of redundant data

(32)

Error Detection

• We use error-detecting codes to help detect errors

• Example code: Consider the function that

duplicates each bit in the message

– E.g. the message 1011001 would be mapped to the code

(33)

Parity

Parity added to make @ 1s even/odd

0 1 1 1 0 1 0 1 1

If parity is wrong ERROR

If parity is right NO ERROR

(34)

Two-Dimensional Parity

(35)

Two-Dimensional Parity

Arrows indicate failed check bits

(36)

Internet Checksum

• Used by IP, TCP, UDP, ...

• Method

– Break message as a sequence of 16-bit integers

– Add these integers using 16-bit one’s complement arithmetic

– Take the one’s complement of the result – Resulting 16-bit number is the checksum

• It’s simple to implement

(37)

Reliable Transmission

• Big Q: How do we send a packet reliably when it

can be lost and/or corrupted in the network?

• Mechanisms

– Acknowledgements – Timeouts

• Simplest reliable protocol: Stop and Wait

– send a packet

(38)
(39)
(40)

Reliable Transmission

• How does the receiver recognize a duplicate

transmission (e.g. in the case of a lost ACK)?

– Solution: Put sequence number in packet

• Performance

– No pipeline effect – Example

• For a l.5 Mbps link with 45 ms RTT

(41)

How do we keep the pipe full?

• Send multiple packets without waiting for

the first to be ACKed

• Upper bound on un-ACKed packets, called

window

Sender Receiver

T

(42)

Sliding Windows: Sender

• State

– Packets sent and ACKed (LAR = last ACK received) – Packets sent but not ACKed (buffer for SWS packets) – Packets not yet sent (LFS = last packet sent)

• Keep LFS - LAR SWS

≤SWS

LAR LFS

(43)

Sliding Windows: Receiver

• State

– Packets received and ACKed (NFE = next frame expected, LFR = last packet received)

– Packets received out of order (buffer for RWS packets) – Packets not yet received (LFA = last frame acceptable)

• Keep LFA - LFR RWS

≤RWS

LFR LFA

(44)

What if we lose a packet?

• Selective repeat/ack (SACK)

– Receiver sends ACK for each packet in window – On timeout, sender resends only the missing packet – Proposed for TCP

• Go back N with buffering out-of-order packets

(TCP)

– Receiver ACKs “got up through packet k”

• If multiple packets are received, only one ACK is needed

(45)

Traditional Go back N window size 4

(46)

Sender Algorithm

• Send full window, set timeout

• On ACK

– If it increases LAR (packets sent and ACKed)

• send remaining packets in window

• On timeout

(47)

Receiver Algorithm

• On packet arrival

– If packet is the NFE (next frame expected)

• Send ACK • Increase NFE

• Deliver packet(s) to the upper layer (could fill hole in buffer)

– Else

• Send ACK

(48)

How to determine timeouts?

• Problem:

– If timeout too small, useless retransmits

– If timeout too large, low utilization (pipe not full)

• Solution:

– On direct link, timeout 2 x PROP

– Trickier to estimate at transport layer

• RTT varies with congestion, route changes, etc.

(49)

Sequence Number Space

• Recall seq # (SeqNum) cannot grow arbitrarily

• SWS

MaxSeqNum - 1 is not sufficient

– Suppose 3-bit SeqNum field (0…7) – SWS = RWS = 7

– sender transmits packets 0..6

– arrive successfully, but ACKs lost – sender retransmits 0..6

– receiver expecting 7, 0..5, but receives the original incarnation of 0..5

• SWS (MaxSeqNum + 1)/2 is correct rule

(50)

Sliding Window Summary

• Sliding window is best known algorithm in

networking

• First role is to enable reliable delivery of packets

– Timeouts and acknowledgements

• Second role is to enable in order delivery of

packets

– Receiver doesn’t pass data up to app until it has packets in order

• Third role is to enable flow control

Referensi

Dokumen terkait