Reliable Transmission How to fix corrupted frames. Error correcting codes too expensive Should discard frames (retransmission) Recover from Corrupt s should be done in the Link Level Data Link Networks - Part II 1 Reliable Transmission Recovery is accomplished with two mechanisms Acknowledgements (ACK) Small control frame (a frame with header only but no data) sent back indicating successful frame delivery Timeouts if the sender does not receive an ACK in a predetermined time the original frame is retransmitted. Data Link Networks - Part II 2
ARQ Algorithms The general strategy of using ACKs and timeouts to implement reliable delivery is called Automatic Repeat request (ARQ) Two ARQ algorithms: Stop-and-wait Sliding Window Data Link Networks - Part II 3 4 Scenarios for Stop-and-Wait Time Timeout Sender ACK Receiver Timeout Timeout Sender ACK ACK Receiver Problem: If there is lost/delayed ACK like in (c) and (d), sender will times-out and retransmits frame. Both (a) and (b) are fine (a) (c) The receiver believes it is the next frame. Timeout Timeout Sender ACK Receiver Timeout Timeout Sender ACK ACK Receiver What to do? A 1-bit sequence number included in the header (b) (d) Data Link Networks - Part II 4
Stop-and-Wait with 1-bit Sequence Number Include a 1-bit sequence number (with values of 0 or 1) in the header Sequence numbers used for each frame alternate Thus, when the sender retransmits frame 0, the receiver knows that it is a second copy of frame 0 rather than the first copy of frame 1 Sender Receiver frame 0 ACK0 frame 1 ACK1 frame 0 ACK0 Time Data Link Networks - Part II 5 Stop-and-Wait with 1-bit Sequence Number Main shortcoming Only one frame is sent at a time may underutilize the link capacity not keeping the pipe full Example: 1.5Mbps link x 45ms RTT Delay x bandwidth = 67.5Kb (~8KB). Assuming frame size of 1KB, stop-and-wait uses about one-eighth of the link's capacity. Want the sender to be able to transmit up to 8 frames before having to wait for an ACK. ( Sliding Window can do that ) Data Link Networks - Part II 6
Sliding Window Idea: Allow sender to transmit multiple frames before receiving an ACK, thereby keeping the pipe full.there is an upper limit on the number of outstanding (un-acked) frames allowed. Allow multiple outstanding (un-acked) frames Time Sender Receiver Upper bound on un-acked frames, called window Data Link Networks - Part II 7 Sliding Window: Sender Assign sequence number to each frame (SeqNum) Maintain three state variables: send window size (SWS) last acknowledgment received (LAR) last frame sent (LFS) Maintain invariant: LFS - LAR <= SWS SWS LAR LFS Advance LAR when ACK arrives Buffer up to SWS frames Data Link Networks - Part II 8
Sliding Window : Receiver Maintain three state variables receive window size (RWS) largest acceptable frame(laf) last frame received (LFR) Maintain invariant: LAF - LFR <= RWS LFR RWS SeqNum arrives: if LFR < SeqNum < = LAF accept if SeqNum < = LFR or SeqNum > LAF discarded Send cumulative ACKs LAF Data Link Networks - Part II 9 Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient suppose 3-bit SeqNum field (0..7) SWS=RWS=7 sender transmit frames 0..6 arrive successfully, but ACKs lost sender retransmits 0..6 receiver expecting 7, 0..5, but receives second incarnation of 0..5 SWS < (MaxSeqNum + 1)/2 is correct rule Intuitively, SeqNum slides between two halves of sequence number space Data Link Networks - Part II 10
Shared Access Networks Outline Ethernet (802.3) Token Ring (802.5) Wireless (802.11) Data Link Networks - Part II 11 Ethernet (802.3) Xerox Palo Alto Research Center(PARC) created Ethernet in the mid-1970 s Uses a technology called Carrier Sense, Multiple Access with Collision Detect(CSMA/CD) Multiple Access nodes send/receive data over a shared link Carrier Sense all nodes distinguish between idle/busy link Collision Detection node monitors transmission and detects collision Data Link Networks - Part II 12
Ethernet (802.3) Beginnings in an early packet radio system called Aloha developed at the University of Hawaii DEC, Intel, and Xerox defined a 10 Mbps Ethernet standard in 1978. This formed the basis of the IEEE standard called 802.3. Wider collection of physical media Faster version 100 Mbps Fast Ethernet 1000 Mbps Gigabit Ethernet Data Link Networks - Part II 13 Ethernet Physical Properties Host Adaptor Transceiver Ethernet Cable Transceiver sends/receives data and detects when the line is idle Adaptor contains all the logic for the protocol (not the transceiver) Use Manchester encoding Data Link Networks - Part II 14
Ethernet Physical Properties: Hosts Terminators Repeater Repeater Repeaters join multiple Ethernet segments forwards signals on all outgoing segments can support up to 4 repeaters Terminators avoid bounce-back Can support up to 1024 hosts Data Link Networks - Part II 15 Ethernet Hub Hubs Multiway repeater (sometimes called hub) Data Link Networks - Part II 16
Access Protocol for Ethernet Controls access to the shared Ethernet link Called the Ethernet s Media Access Control (MAC) protocol Usually implemented in hardware on the adaptor Data Link Networks - Part II 17 Ethernet Format 64 48 48 16 32 Preamble Dest Src Type Body CRC Preamble synch bits for signal alternating O s and 1 s Type demultiplexing key (which of the higher level protocols does the frame belong?) Data Link Networks - Part II 18
Ethernet Addresses Ethernet adaptors have unique addresses Burned into ROM Series of six one-byte numbers(a pair of hexadecimal digits) 8:0:2b:e4:b1:2 00001000 00000000 00101011 11100100 10110001 00000010 Each manufacturer is assigned a 24-bit prefix Example: Advanced Micro Devices has been assigned the 24-bit prefix 8:0:20 Data Link Networks - Part II 19 Ethernet Addresses Ethernet adaptors receive all frames Ethernet adaptors accept: - frames addressed to its own address - frames addressed to the broadcast address - frames addressed to a multicast address - all frames, if placed into promiscuous mode (Note: an adaptor can be programmed to run in promiscuous mode) Data Link Networks - Part II 20
Ethernet Transmission Algorithm The sender s side is where the action is If an adaptor has a frame to send and the line is idle, the frames is transmitted immediately If an adaptor has a frame to send and the line is busy, it waits for the line to go idle then transmits immediately Collision - two adaptors find the line idle do they transmit their packets which collide 96-bit transmission if adaptor detects collision (64b preamble + 32b jamming sequence) Once a collision is detected and stopped the adaptor will wait some time and try again. This time is called exponential backoff - each time it tries to transmit but fails results in doubling the delay interval between tries Data Link Networks - Part II 21 Collisions A B A B A B A B Data Link Networks - Part II 22
Experience with Ethernet Works well for 30% or less utilization otherwise network capacity is wasted Most Ethernets have fewer than 200 hosts (1024 maximum) Easy to administer, there are no: - switches - routers Easy to add new hosts Data Link Networks - Part II 23 Network Adaptor -framing - error detection - media access protocol Network Adaptors ARQ(Automatic Repeat request) algorithm is typically handled one layer up running on the host Device Driver a collection of OS routines that effectively anchor the protocol graph to the network hardware Data Link Networks - Part II 24