45
1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

Embed Size (px)

DESCRIPTION

3 1. Automatic repeat request (ARQ) Both approach require a timeout mechanism. –Negative-ack approach: A timer starts when a negative acknowledgment is sent out. –Positive-ack approach: A timer starts when a message is sent out. Retransmissions take place when timeouts occur: –Negative-ack approach: The receiver retransmits a negative acknowledgment. –Positive-ack approach: The sender retransmits a frame.

Citation preview

Page 1: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

1

Chapter 2: Direct Link Networks

(Part Two)

Dr. Rocky K. C. Chang30 January 2004

Page 2: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

2

1. Automatic repeat request (ARQ)• Approach to achieving link reliability:

– Ask for retransmission when a corrupted frame is detected.

• Mechanisms for asking a sender to retransmit:– Receiver to send negative acknowledgments for

corrupted frames, or– Receiver to send positive acknowledgments for

good frames.– Which one is better?

Page 3: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

3

1. Automatic repeat request (ARQ)• Both approach require a timeout mechanism.

– Negative-ack approach: A timer starts when a negative acknowledgment is sent out.

– Positive-ack approach: A timer starts when a message is sent out.

• Retransmissions take place when timeouts occur:– Negative-ack approach: The receiver retransmits a

negative acknowledgment.– Positive-ack approach: The sender retransmits a

frame.

Page 4: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

4

1. Automatic repeat request (ARQ)• The ARQ implements a positive acknowledg-

ment approach.– Only after an acknowledgment is received will a

frame be removed from a send buffer.– An acknowledgment can be piggybacked on a

message sent to the other direction.– An acknowledgment sometimes indicates the

sequence number of the next expected frame.– Positive acknowledgment is usually accumulative,

e.g., receiving an acknowledgment for frame 4 implies that frames 1-3 are all received correctly.

Page 5: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

5

1.1 Stop-and-wait ARQ• The maximum number of unacknowledged

frames is one.– A sender cannot send a second frame before receiving

an acknowledgment for the first frame.• The minimum number of sequence numbers

needed to identify the frames is two (0, 1), i.e., the first two in the send buffer.– 0: for the frame sent and waiting for its

acknowledgment.– 1: for the frame to be sent after receiving an

acknowledgment for the 0th frame.

Page 6: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

6

Sender Receiver

Frame

ACK

Tim

eout

Tim

e

Sender Receiver

Frame

ACK

Tim

eout

Frame

ACKTim

eout

Sender Receiver

Frame

ACKTim

eout

Frame

ACKTim

eout

Sender Receiver

Frame

Tim

eout

Frame

ACKTim

eout

(a) (c)

(b) (d)

Page 7: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

7

1.1 Stop-and-wait ARQ• Advantages:

– Very simple to implement, both on the sender and receiver sides.

• Disadvantages:– Achieve a very low throughput, especially in a

high-speed link (does not keep the pipe full).– In the best case, only one frame can be sent in a

round-trip time.– In other cases, an additional number of round-trip

times is required when errors occur.

Page 8: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

8

1.2 Sliding-window (or go-back-n) ARQ• The maximum number of unacknowledged

frames may be more than one.– A sender may continue to transmit frames even

when acknowledgments for frames previously sent are not received.

– A sliding window is used to keep track of the sender’s state and receiver’s state.

– The window size determines the maximum number of unacknowledged frames allowed on the sender side.

Page 9: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

9

1.2 Sliding-window (or go-back-n) ARQ• On the sender side:

– Frames are labeled by a sequence number of integer values, starting from 1.

– A static parameter: send window size (SWS)– Two variable parameters:

• The maximum sequence number being acknowledged by the receiver (LAR)

• The maximum sequence number sent by the sender (LFS)– Note that LFS LAR

• LFS = LAR: All frames sent have been acknowledged.• LFS > LAR: LFSLAR frames are yet to be acknowledged.

Page 10: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

10

1.2 Sliding-window (or go-back-n) ARQ– Also note that LFS SWS + LAR.

• When LFS = SWS + LAR, the window is said to be full, and no more new frames can be sent before (LAR+1)th frame is acknowledged.

– How do the values of LFS and LAR change?• LFS is initialized to 0, and it is incremented after each

new frame is sent.• LAR is initialized to 0, and it is shifted to the right

according to the new sequence number(s) acknowledged by the receiver.

Page 11: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

11

1.2 Sliding-window (or go-back-n) ARQ• Sender side:

• Receiver side:

= SWS

LARLFS

… …

RWS

NFE

… …

Page 12: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

12

1.2 Sliding-window (or go-back-n) ARQ• On the receiver side:

– A static parameter: receive window size (RWS)• RWS is the maximum number of out-of-order frames that

the receiver is willing to accept.– A variable parameter:

• Sequence number of the next frame expected (NFE)– If a frame, whose sequence number is larger than

NFE+RWS, is received, the frame will be discarded; otherwise, it will be buffered in a receive buffer.

– When a frame is received correctly, NFE is either updated or unchanged.

Page 13: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

13

1.3 Three uses of ARQs• Provide reliable service• Provide in-order service

– The original order of the frames is preserved even when out-of-order frames are received.

• Provide flow control– Prevent the sender from flooding the receiver.– The sender needs to vary the value of SWS by

taking into account of the state of the receive buffer.

Page 14: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

14

2. Local area networks (LANs)• Early 1980s

– IBM’s token ring vs. DIX (Digital, Intel, and Xerox) Ethernet

– IEEE 802.2 (logical link control), 802.3 (Ethernet), 802.4 (Token Bus), 802.5 (Token Ring)

• Late 1980s– Fiber Distributed Data Interface (FDDI)– Distributed Queue Dual Bus (DQDB)

• Early 1990s– ATM LANs vs Fast Ethernet (switched Ethernet)

Page 15: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

15

2. Local area networks (LANs)• Mid-1990s

– IEEE 802.11 (wireless LAN)• Now and future (who knows?)

– Gigabit Ethernet vs ATM LANs– Optical Ethernet, wireless Ethernet

• Development trends:– From shared medium to switched LANs– From router-based backbone to switched backbone– From wired to wireless– From single-medium to multi-media

Page 16: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

16

3.1 Ethernet LAN: physical connectivity• Components:

– Cable (passive)– Transceivers (transmitter + receiver)– Adaptor (active). Each adaptor card is uniquely

identified by a 48-bit (physical or MAC) address, e.g., 00:40:26:5A:67:88.

• Design principles:– Cost-effective resource sharing– Reliability– Inexpensive

Page 17: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

17

3.1 Ethernet LAN: physical connectivity

Adaptor

Transceiver

Host

Ethernet cable

Page 18: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

18

3.1 Ethernet LAN: physical connectivity• Both DIX and IEEE 802.3 Ethernets do not

require switching elements.– Hosts are connected to a cable (10base2/5/T)

through network adaptors.– Several segments may be connected (horizontally)

to another segment (vertically) through hubs, which serve as repeaters.

Page 19: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

19

3.1 Ethernet LAN: physical connectivity

Repeater Host

Page 20: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

20

3.1 Ethernet LAN: physical connectivity

Hub Hub

from the datalink layer and up

Page 21: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

21

3.2 Ethernet LAN: Datalink sublayers• A new multiple access control (MAC) problem:

– How do multiple hosts share a single transmission medium efficiently?

– This problem occurs in token ring, FDDI, and wireless LAN.

– An additional MAC sublayer was created for this purpose.

• A logical link control (LCC) sublayer:– Provide similar services as a datalink layer except

that error detection is provided at the MAC sublayer.

Page 22: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

22

3.2 Ethernet LAN: Datalink sublayers– Provide three types of services:

• Unacknowledged connectionless (datagram) service: Basically no additional service.

• Acknowledged connectionless service: Reliability through a stop-and-wait-ARQ-like mechanism.

• Connection-mode service: A connection is set up between two hosts with flow control and reliability services.

Page 23: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

23

3.2 Ethernet LAN: Datalink sublayers• The datalink layer consists of

– LLC sublayer and MAC sublayer

IEEE 802.2 Logical Link Control (LLC) Sublayer

IEEE 802.3 IEEE 802.4 IEEE 802.5 ANSI FDDIIEEE 802.11 IEEE 802.12

Page 24: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

24

3.2 Ethernet LAN: frames• DIX Ethernet frame structure:

– The 7-byte preamble is sent before the frame to allow the receiver to synchronize with the signal.

• IEEE 802.3 Ethernet frame structure:

4-byteCRC

dest address

src address len DataDSAP

AASSAP AA

cntl 03

org code 00

type

802.3 MAC 802.2 LLC 802.2 SNAP

4-byteCRC

6-byte dest address

6-byte src address Data

type 0800 IP datagram

2-byte type

7-byte preamble

1-byte start frame

delimiter

Preamble

Page 25: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

25

3.3 Ethernet LAN: MAC protocol• Types of MAC addresses:

– Unicast address: hardwired into ROM– Broadcast address: all 1 bits– Multicast address: First bit set to 1 and configurable.– Promiscuous mode

• CSMA/CD (carrier sense multiple access with collision detection)– Each adaptor is able to distinguish a busy link from an

idle link.– Each adaptor is able to detect “frame collisions,” if

occurred, as it transmits.

Page 26: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

26

3.3 Ethernet LAN: MAC protocol• To send a frame,

– transmits it immediately when the link is detected idle.– The maximum length of the payload is 1500 bytes for a

10-Mbps DIX Ethernet.• To receive a frame,

– Every adaptor attached to the link will receive a copy of a frame transmitted on the link.

– The frame will be discarded if the destination address does not match

• its unicast address, broadcast address, and any configured multicast addresses.

Page 27: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

27

3.3 Ethernet LAN: MAC protocol• Carrier sense is not sufficient for avoiding frame

collisions.• A frame must be long enough to detect collisions:

– A sufficient condition: A frame occupies the entire pipe back and forth.

– For example, for a 10-Mbps Ethernet segment of 2500m long (a round-trip propagation delay of 51.2 s):

• Minimum frame length = 51.2s 10Mbps = 512 bits (64 bytes), or a 14-byte header + a 46-byte payload + a 4-byte CRC.

Page 28: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

28

3.3 Ethernet LAN: MAC protocolA B

(a)

A B

(b)

A B

(c)

A B

(d)

Page 29: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

29

3.3 Ethernet LAN: MAC protocol• When more than one adaptor transmits frames

“almost at the same time,”– The frames are “collided” and can be detected by

the adaptors involved.– The adaptors involved then send a 32-bit jamming

sequence, and stop transmission. – The adaptors use exponential backoff for

retransmission (up to a limited number of attempts).• After first collision: either 0 or 51.2 s.• After second collision: 0, 51.2, 102.4, 153.6 s.• After nth collision: k51.2 s for k = 0..2n1.

Page 30: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

30

3.4 Ethernet’s performance• Throughput decreases with a and the number of

hosts, where – a = propagation delay/transmission delay.

• Implications:– Limit on the number of stations and the maximum

length of the Ethernet segment– Effect of increasing link’s data rate– Support for delay-sensitive data

• Methods of improving its performance– Each collision domain consists of only one host.

Page 31: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

31

4.1 Token ring LAN: physical connectivity• Hosts are connected “centrally” to a multi-

station access unit (MSAU).• Relays are installed to bypass node failure.• IEEE 802.5 uses differential Manchester

encoding, a variant of Manchester encoding.

Page 32: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

32

4.1 Token ring LAN: physical connectivity

Host

Host

Host Host

From previousMSAU

T o nextMSAU

MSAU

Page 33: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

33

4.2 Token ring LAN: MAC protocol• Multiple access is regulated by a special 24-bit

frame, called token.• To send a frame,

– Wait for a free token: indicated by a bit in the second byte of the token.

– Seize the token and send frames, up to a token holding time (THT=10 ms by default).

– The sender is responsible for removing the frames after circulating back to the sender.

Page 34: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

34

4.2 Token ring LAN: MAC protocol• Token:

• Data frame:

Body CRCSrcaddr

Variable48Destaddr

48 32End

delimiter

8Framestatus

8Framecontrol

8Accesscontrol

8Start

delimiter

8

Enddelimiter

8Accesscontrol

8Start

delimiter

8

Page 35: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

35

4.2 Token ring LAN: MAC protocol• To receive a frame,

– When a frame is passing a host, it will check the destination address in the frame.

– If destination address is a broadcast, or multicast or unicast destined for the host, it will make a copy.

– Reliable delivery service via A and C bits in the frame status field:

• When a host sees a frame destined for it, the host sets the A bit from 0 to 1.

• After copying the frame successfully, it sets the C bit from 0 to 1.

Page 36: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

36

4.2 Token ring LAN: MAC protocol• Different from the Ethernet, token ring supports

8 different priorities.– A token’s priority is indicated by a 3-bit field in the

access control.– A host may seize a free token of priority m for

transmitting priority n frames only if n m.– A host X may make a “reservation” via a 3-bit

reservation field when a data frame is passing it.– When the sender of the frame releases the token, the

token priority will be made the same as the value in the reservation field.

Page 37: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

37

4.2 Token ring LAN: MAC protocol• (a) Early token release vs. (b) delayed token

release:

Token

Frame

Token Frame

(a) (b)

Page 38: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

38

4.3 Token ring LAN: ring maintenance• Possible problems:

– Token loss– Forever circulating corrupted frames– Forever circulating orphan frames– Detection of dead hosts

• Elect a monitor station to handle most of the ring problems.

Page 39: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

39

5. Fiber Distributed Data Interface (FDDI) • Physical connectivity:

– A dual-ring architecture at 100 Mbps– Use 4B/5B encoding– Optical fiber (FDDI) or copper (CDDI)

• MAC (timed token rotation protocol)– Nine classes of priority (1 synchronous and 8

asynchronous)– Use early token release– Synchronous transmission limited by a token

holding timer (THT)

Page 40: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

40

5. Fiber Distributed Data Interface – Asynchronous transmission depends on

• whether the token is late or early, and• how early the token is, as compared with a pre-negotiated

target token rotation time (TTRT).

(a) (b)

Page 41: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

41

5. Fiber Distributed Data Interface• For example, hosts A and B transmit

synchronous frames, and host C transmits asynchronous frames.– THTA = THTB = 5 ms, and TTRT = 12 ms (2 ms for

the total propagation delay in the ring)– After the token leaves C, both A and B use up all

their quotas, C’s quota when the token arrives next time is 0 ms.

– After the token leaves C again, this time only A uses up his quota and B does not use any. Therefore, C’s quota next time is 12 2 5 ms.

Page 42: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

42

6. Wireless LAN (IEEE 802.11)• Physical connectivity

– Based on spread spectrum radio and diffused infrared– Run at either 1 or 2 Mbps.– Wireless nodes are connected to access points which

are connected to one another through a fixed network.

BH

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

Page 43: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

43

6. Wireless LAN (IEEE 802.11)• MAC problem:

– Hidden node (terminal) problem: Frame collision occurs but the senders involved are unaware of it.

• AB and CB (A and C are not connected)– Exposed node problem: A node is unnecessarily

prevented from transmitting frames.• BA and CD (A and D are not connected)

– Both problems are due to the fact that, unlike Ethernet, the nodes are not always connected together.

Page 44: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

44

6. Wireless LAN (IEEE 802.11)

• Multiple Access with Collision Avoidance (MACA)– To send a frame,

• the sender first sends a Request to Send (RTS) frame to the receiver.

A B C D

Page 45: 1 Chapter 2: Direct Link Networks (Part Two) Dr. Rocky K. C. Chang 30 January 2004

45

6. Wireless LAN (IEEE 802.11)• The receiver then replies with a Clear to Send (CTS)

frame back to the sender.– Any node that sees the CTS frame will refrain from

sending any frames (for the hidden node problem).– Any node that sees the RTS frame but not the CTS

frame is free to transmit (for the exposed node problem).

– When two or more nodes transmit an RTS frame at the same time, their RTS frames collide.

• Retransmission of RTS frames takes place after the nodes involved do not receive the CTS frames, i.e. no direct collision detection supported.