Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.

Similar presentations


Presentation on theme: "1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links."— Presentation transcript:

1 1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links

2 2 Encoding Signals propagate over a physical medium –modulate electromagnetic waves –e.g., vary voltage Encode binary data onto signals –e.g., 0 as low signal and 1 as high signal –known as Non-Return to zero (NRZ) Bits NRZ 0010111101000010

3 3 Problem: Consecutive 1s or 0s Low signal (0) may be interpreted as no signal High signal (1) leads to baseline wander Unable to recover clock

4 4 Alternative Encodings Non-return to Zero Inverted (NRZI) –make a transition from current signal to encode a one; stay at current signal to encode a zero –solves the problem of consecutive ones Manchester –transmit XOR of the NRZ encoded data and the clock –only 50% efficient (bit rate = 1/2 baud rate)

5 5 Encodings (cont) Bits NRZ Clock Manchester NRZI 0010111101000010

6 6 Encodings (cont) 4B/5B –every 4 bits of data encoded in a 5-bit code –5-bit codes selected to have no more than one leading 0 and no more than two trailing 0s –thus, never get more than three consecutive 0s –resulting 5-bit codes are transmitted using NRZI –achieves 80% efficiency

7 7 Framing Break sequence of bits into a frame Typically implemented by network adaptor Frames Bits Adaptor Node BNode A

8 8 Approaches Sentinel-based –delineate frame with special pattern: 01111110 –e.g., HDLC, SDLC, PPP –problem: special pattern appears in the payload –solution: bit stuffing sender: insert 0 after five consecutive 1s receiver: delete 0 that follows five consecutive 1s HeaderBody 816 8 CRC Beginning sequence Ending sequence

9 9 Approaches (cont) Counter-based –include payload length in header –e.g., DDCMP –problem: count field corrupted –solution: catch when CRC fails

10 10 Approaches (cont) Clock-based –each frame is 125us long –e.g., SONET: Synchronous Optical Network –STS-n (STS-1 = 51.84 Mbps)

11 11 Cyclic Redundancy Check Add k bits of redundant data to an n-bit message –want k << n –e.g., k = 32 and n = 12,000 (1500 bytes) Represent n-bit message as n-1 degree polynomial –e.g., MSG=10011010 as M(x) = x 7 + x 4 + x 3 + x 1 Let k be the degree of some divisor polynomial –e.g., C(x) = x 3 + x 2 + 1

12 12 CRC (cont) Transmit polynomial P(x) that is evenly divisible by C(x) –shift left k bits, i.e., M(x)x k –subtract remainder of M(x)x k / C(x) from M(x)x k Receiver polynomial P(x) + E(x) –E(x) = 0 implies no errors Divide (P(x) + E(x)) by C(x); remainder zero if: –E(x) was zero (no error), or –E(x) is exactly divisible by C(x)

13 13 Selecting C(x) All single-bit errors, as long as the x k and x 0 terms have non-zero coefficients. All double-bit errors, as long as C(x) contains a factor with at least three terms Any odd number of errors, as long as C(x) contains the factor (x + 1) Any ‘burst’ error (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. Most burst errors of larger than k bits can also be detected See Table 2.6 on page 102 for common C(x)

14 14 Internet Checksum Algorithm View message as a sequence of 16-bit integers; sum using 16-bit ones-complement arithmetic; take ones-complement of the result. u_short cksum(u_short *buf, int count) { register u_long sum = 0; while (count--) { sum += *buf++; if (sum & 0xFFFF0000) { /* carry occurred, so wrap around */ sum &= 0xFFFF; sum++; } return ~(sum & 0xFFFF); }

15 15 Acknowledgements & Timeouts

16 16 Stop-and-Wait Problem: keeping the pipe full Example –1.5Mbps link x 45ms RTT = 67.5Kb (8KB) –1KB frames implies 1/8th link utilization SenderReceiver

17 17 Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window SenderReceiver T ime … …

18 18 SW: 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 Advance LAR when ACK arrives Buffer up to SWS frames  SWS LARLFS ……

19 19 SW: Receiver Maintain three state variables –receive window size ( RWS ) –largest frame acceptable ( LFA ) –last frame received ( NFE ) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: –if LFR < SeqNum < = LFA accept –if SeqNum LFA discarded Send cumulative ACKs  RWS NFELFA ……

20 20 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

21 21 Concurrent Logical Channels Multiplex 8 logical channels over a single link Run stop-and-wait on each logical channel Maintain three state bits per channel –channel busy –current sequence number out –next sequence number in Header: 3-bit channel num, 1-bit sequence num –4-bits total –same as sliding window protocol Separates reliability from order

22 22 Shared Access Networks Outline Bus (Ethernet) Token ring (FDDI) Wireless (802.11)

23 23 Gedankenexperiment How does communication work in real life? If there are lots of speakers/speaking? If there is little speaking? If there are “important” people? Can we map this to computer networks?

24 24 Ethernet Overview History –developed by Xerox PARC in mid-1970s –roots in Aloha packet-radio network –standardized by Xerox, DEC, and Intel in 1978 –similar to IEEE 802.3 standard CSMA/CD –carrier sense –multiple access –collision detection Frame Format Dest addr 644832 CRCPreamble Src addr TypeBody 1648

25 25 Ethernet (cont) Addresses –unique, 48-bit unicast address assigned to each adapter –example: 8:0:e4:b1:2 –broadcast: all 1 s –multicast: first bit is 1 Bandwidth: 10Mbps, 100Mbps, 1Gbps Length: 2500m (500m segments with 4 repeaters) Problem: Distributed algorithm that provides fair access

26 26 Transmit Algorithm If line is idle… –send immediately –upper bound message size of 1500 bytes –must wait 9.6us between back-to-back frames If line is busy… –wait until idle and transmit immediately –called 1-persistent (special case of p-persistent)

27 27 Algorithm (cont) If collision… –jam for 32 bits, then stop transmitting frame –minimum frame is 64 bytes (header + 46 bytes of data) –delay and try again 1st time: 0 or 51.2us 2nd time: 0, 51.2, 102.4, or 153.6us nth time: k x 51.2us, for randomly selected k=0..2 n - 1 give up after several tries (usually 16) exponential backoff

28 28 Collisions AB AB AB AB

29 29 Token Ring Overview Examples –16Mbps IEEE 802.5 (based on earlier IBM ring) –100Mbps Fiber Distributed Data Interface (FDDI)

30 30 Token Ring (cont) Idea –Frames flow in one direction: upstream to downstream –special bit pattern (token) rotates around ring –must capture token before transmitting –release token after done transmitting immediate release delayed release –remove your frame when it comes back around –stations get round-robin service Frame Format Control 888 24 CRC Start of frame End of frame Dest addr Body 48 Src addr Status 32

31 31 Timed Token Algorithm Token Holding Time (THT) –upper limit on how long a station can hold the token Token Rotation Time (TRT) –how long it takes the token to traverse the ring –TRT <= ActiveNodes x THT + RingLatency Target Token Rotation Time (TTRT) –agreed-upon upper bound on TRT

32 32 Algorithm (cont) Each node measures TRT between successive tokens –if measured-TRT > TTRT: token is late so don’t send –if measured-TRT < TTRT: token is early so OK to send Two classes of traffic –synchronous: can always send –asynchronous: can send only if token is early Worse case: 2 x TTRT between seeing token Back-to-back 2 x TTRT rotations not possible

33 33 Token Maintenance Lost Token –no token when initializing ring –bit error corrupts token pattern –node holding token crashes Generating a Token (and agreeing on TTRT) –execute when join ring or suspect a failure –send a claim frame that includes the node’s TTRT bid –when receive claim frame, update the bid and forward –if your claim frame makes it all the way around the ring: your bid was the lowest everyone knows TTRT you insert new token

34 34 Maintenance (cont) Monitoring for a Valid Token –should periodically see valid transmission (frame or token) –maximum gap = ring latency + max frame < = 2.5ms –set timer at 2.5ms and send claim frame if it fires

35 35 Wireless Technologies Most commonly used wireless technologies: Wi-Fi (802.11) Bluetooth (802.15.1) WiMAX (802.16) 3G Cellular

36 36 BluetoothWi-FiWiMAX3G Typical Length Approx. 30 ftApprox. 320 ftApprox. 3200 ft Approx. 3200 and higher Bandwidth 2.1 Mbps Total ( each host must share so bandwidth is dynamic) 54 Mbps Total (each host must share so bandwidth is dynamic) 70 Mbps Total (each host must share so bandwidth is dynamic) 384 Kbps for each host Typical Use Connecting devices to PC Connecting laptop to internet Connecting an entire building to the internet Cell phone internet and data services Wired CounterpartUSBEthernetCoaxial CableDSL/FIOS Wireless Technologies

37 37 Wireless Technologies Physical Considerations of wireless protocols: Bandwidth Capabilities Transmission Distance Limitations (Range) Frequency/Power/License

38 38 Wireless Technologies Well suited for multiple clients as one base station can transmit and receive with multiple clients. Common to all of these technologies is the fixed point.

39 39 Bluetooth 802.15.1 One Master device 7 Active slave devices 255 Parked Devices License Exempt band of 2.45 GHz Low Power Consumption Protocol implemented beyond link level -Where it defines application protocols via use of profiles -Profiles are application level protocols for different types of device connections. -Hands Free Devices -Hardware and peripherals -PDA Synchronization

40 40 Wi-Fi 802.11 802.11a -> 5 GHz band OFDM (Orthogonal Frequency division Multiplexing) Direct sequence easily absorbed by environment, limited to line of sight 802.11b -> Variant of direct sequence 802.11g -> OFDM (Orthogonal Frequency division Multiplexing) Backward compatible with 802.11b

41 41 Wi-Fi 802.11 Functional Aspects of Wi-Fi Each host has an assigned access point. Access point is fixed. Collision avoidance- (not detection) Problem: If each host has its own link, how do we determine if the link is busy? (It is the receiver that must be determined to be free or busy.) Examples: Hidden nodes and Exposed nodes Solution: MACA (multiple access with collision avoidance ).

42 42 Wi-Fi 802.11 Functional Aspects of Wi-Fi MACA- Control Frames- Exchange of RTS and CTS frames RTS –Comes from source, requesting access CTS – Comes from recipient, granted access Note: RTS–contains a field that indicates the amount of time the sender is requesting. Exchange of the CTS frame informs surrounding nodes that are in range that they cannot transmit during the period of time that it takes to transmit that one frame and to send and ACK. Question: What if we have to hosts that send and RTS message that results in a collision at the host? Answer: When the timeout period expires each host will make the determination that a collision has occurred at the host ( the host does not have any collision detection in 802.11). Thus each will resend according to an exponential back off algorithm.

43 43 Wi-Fi 802.11 Distribution System: Active Scanning: Host sends out a probe frame, analyzes responses from AP’s Passive Scanning: AP sends out Beacon frame that advertises capabilities. Host evaluates current situation and stays or sends out an association request to be associated with the new AP.

44 44 Wi-Fi 802.11 Frame Formats: Control Field: Contains 3 Sub fields 1.TYPE Field: Indicates whether frame carries data or identifies itself as a RTS or CTS frame. 2.ToDS one bit field 3.FromDS one bit field

45 45 Wi-Fi 802.11 Addr1 in the most simple cases, is the destination address. Addr2 in the most simple cases, is the source address. In the Event that the DS bits are not 0, this indicates that the frame has been forwarded by more than one node, thus the sender’s address is not necessarily the origination address. Thus we have 4 fields for addresses.

46 46 Wi-MAX 802.16 Worldwide interoperability for Microwave Access -Intended as a “Last Mile” Technology. Offers 70Mbps connections when connected to subscriber stations. Requires Line of Sight for connection. Not a mobile technology, both access point and host are stationary. 10-66 GHz Range(licensed and unlicensed) Base station transmits to all hosts, hosts pick what belongs to them and ignore the rest. This simplifies the outbound transmissions (only the transmitter takes up outbound slots). Incoming slots are shared among all hosts, this includes other WiMAX stations. QOS can be implemented to garuntee quality for voice communications. Under this concept slots are dynamically allocated to some requesters.

47 47 Wi-MAX 802.16 Two ways of dividing the bandwidth between upstream and down stream: TDD: STDM of the up and down streams. FDD: FDM of the up and down streams.

48 48 3G CDMA (most commonly used in the US)is a 2G technology that uses chipping codes instead of FDM or TDM on the physical link layer. Speed is limited as time slots and compression algorithms are geared towards compressing human speech. Thus they are not optimized for data. GSM (Europe) also a 2 G technology used GPRS for data had better data rates as more time slots could be allocated if available for data. 3G: technolgy is still emerging and has yet to be truly standardized, but one promising standard is UMTS. UMTS-Based on W-CDMAs, 1.9 Mpbs


Download ppt "1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links."

Similar presentations


Ads by Google