Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15.

Similar presentations


Presentation on theme: "ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15."— Presentation transcript:

1 ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15

2 ICOM 6115©Manuel Rodriguez-Martinez Lecture Objectives Understand the services provided by the Data Link Layer (Layer 2) –Flow Control Stop-and-Wait Sliding Window Introduction to the Medium Access Control (MAC) Sublayer

3 ICOM 6115©Manuel Rodriguez-Martinez Flow Control Problem –How can the sender reliably send frames to receiver without overrunning it? Key Issues –Reliably Make sure the frame gets there –Detect error –Possibly retransmit –Overrunning Make sure receiver has time to handle frames –Otherwise, frames will be lost causing retransmission

4 ICOM 6115©Manuel Rodriguez-Martinez Design Issues Need a way to mark frames –Sequence numbers –Allows receiver to keep track of has arrived and what is missing Need a way to acknowledge the receipt of a frame –ACK Must also be numbered Need a protocol to govern transmission and retransmission

5 ICOM 6115©Manuel Rodriguez-Martinez Frame Header TYPE – frame type (ACK or REGULAR) SEQNO – sequence number for the frame ACKNO – ACK number FLAGS – other control flags SNDR – address of sender RECV – address of receiver TYPESEQ NO ACK NO FLAGSSNDRRECV

6 ICOM 6115©Manuel Rodriguez-Martinez ARQ Algorithms Automatic Repeat Request (ARQ) Algorithms –Used to control flow of frames Based on these ideas –ACK Indicate receipt of packet –Timeout Indicate that an ACK for a packet X has not arrived –Forces retransmission

7 ICOM 6115©Manuel Rodriguez-Martinez Stop and Wait Sender can send 1 frame at a time Waits for ACK from receiver Two modes –Simplex –Simplex with timeout

8 ICOM 6115©Manuel Rodriguez-Martinez Sender Side Algorithm While there is data to send 1.Read next packet P 2.Get a new frame F F.data = P F.seqnum = next_seqno++ % 1; 3.Send frame F 4.Set timer for F 5.Wait for event t If t is timeout // no ACK got here Goto 3 else if t is ACK for F // ACK for this frame Stop timer Goto 1 else // old ACK Goto 5

9 ICOM 6115©Manuel Rodriguez-Martinez Some issues … Here each packet is acknowledge –At least two frames must be exchanged Client and server must take turns as senders as receivers (dual behavior) –Client request Client is the sender Server is the receiver –Server response Server is the sender Client is the receive

10 ICOM 6115©Manuel Rodriguez-Martinez Major Limitations is Channel Usage Consider a 1.5Mbps link, with 45msec RTT \where frames can be up to 1KB What is the rate at which packets are sent? –Well, when a packet is sent, we must wait 1 RTT to send the next one Must Wait for ACK –Data rate is then (1024 * 8) /45msec = 182Kpbs

11 ICOM 6115©Manuel Rodriguez-Martinez Receiver Side Algorithm 1.While there is data to receive 2.Get new data frame F 3.Read F 4.If F.seq_no == next_seqno Pass F.data to network layer Get new ACK frame A A.seqnum = next_seqno; next_seqno= 1 – next_seqno; Send A

12 ICOM 6115©Manuel Rodriguez-Martinez Lesson here Stop-And-Wait wastes channel bandwidth In previous example –Link bandwidth = 1.5Mbps –Throughput with Stop-and-Wait = 180Kbps –Effective utilization is 12% 88% of bandwidth is wasted We need to keep pipe full –Send delay x bandwidth worth of frames –If we need to wait for ack, we might as well throw many frames in

13 ICOM 6115©Manuel Rodriguez-Martinez Sliding Window Protocol Idea is to send a group of frames over the link –Called outstanding frames –Delay x bandwidth worth of them –Must be buffered until they get ACK As acknowledgments start to arrive, outstanding frames are liberated Once the window is extended, more frames can be sent

14 ICOM 6115©Manuel Rodriguez-Martinez Sliding Window Algorithm 1234567 1234567 1234567 1234567

15 ICOM 6115©Manuel Rodriguez-Martinez Sliding Window Sender Basics Each frame can be assigned a sequence number Sender must keep the following state –SWS – sender window size Number of frames I can have outstanding –LAR – Last Acknowledge Frame Last one receive told me she got! –LFS – Last frame sent Invariant: LFS – LAR <= SWS

16 ICOM 6115©Manuel Rodriguez-Martinez Sender Side of Sliding Windows Outstanding frames must be kept buffered –In case they must be retransmitted Sender can only move window to the right when it receive ACK for frame LAR + 1. –In which case LFS = LFS + 1 OutstandingFrames

17 ICOM 6115©Manuel Rodriguez-Martinez Sender Behavior Loop –emitting frames up to SWS –Start timers for outstanding frames –When ACK arrives If duplicate ACK do nothing If not, then mark packet as ACK and stop timer –Move window to the right by a value X X is the largest of number contiguous frames that have been ACK –LFS = LFS + X, LAR = LAR + X

18 ICOM 6115©Manuel Rodriguez-Martinez Sliding Window Receiver Basics Receiver must keep the following state –RWS – receiver window size Frames that must be buffered before passing to network layer –Server to put frames in order! LAF – largest acceptable frame –Frames with highest sequence number to be accepted LFR – last frame received –Last frame to got here and I have ACK Invariant: LAF – LFR <= RWS

19 ICOM 6115©Manuel Rodriguez-Martinez Receiver side of Sliding Window Outstanding frames must be buffered –To give them in order to network layer –Receiver can move window only when frame with seq number NFE = LFR + 1 arrives In which case, LFA = LFA + 1 LFR OutstandingFrames

20 ICOM 6115©Manuel Rodriguez-Martinez Receiver Behavior Loop –Read frames –When Frames arrives If duplicate frame do nothing If not, then store frame and send ACK –Move window to the right by a value X X is the largest of number contiguous frames that have been RECEIVED –LFA = LFA + X, LFR = LFR + X

21 ICOM 6115©Manuel Rodriguez-Martinez Some issues Lost frames cause gaps on window Slow down data transfers since windows can only move when contiguous frames have been ACK

22 ICOM 6115©Manuel Rodriguez-Martinez Medium Access Control (MAC) Sublayer Lower part of the Data Link Layer for multi- access networks –e.g. Bus networks like Ethernet MAC has the protocols to control which host get access to the network Logical Link Control (LLC) –Actual Data Link Services Connectionless No ACKs Connectionless with ACKs Connection-oriented with ACKs

23 ICOM 6115©Manuel Rodriguez-Martinez A View of the Data Link Layer

24 ICOM 6115©Manuel Rodriguez-Martinez Why have a LLC? Split Data Link Layer –MAC is specific to the physical network Various Flavors of Ethernet Various Flavors of WiFI (802.11a or 802.11b) –LLC is common to all Build just one version of this Permits backward compatibility or interoperability 802.11a y 802.11b share LLC –MAC is specific to interface with physical layer

25 ICOM 6115©Manuel Rodriguez-Martinez Example MAC sublayers IEEE 802.3 – Ethernet IEEE 802.5 – IBM Token Ring IEEE 802.11 – Wireless LAN IEEE 802.15 – Personal LAN (Bluetooth) IEEE 802.16 – Broadband Wireless –Wireless Local Loop All these share a common LLC –IEEE 802.2

26 ICOM 6115©Manuel Rodriguez-Martinez Services provided by MAC sublayer Addressing –MAC Address Given to the network interface card Frame generation Checksum computation Error detection Arbitration for channel access –Conflict detection and resolution


Download ppt "ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15."

Similar presentations


Ads by Google