Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 3, 1Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Link Networks Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie,

Similar presentations


Presentation on theme: "Lecture 3, 1Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Link Networks Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie,"— Presentation transcript:

1 Lecture 3, 1Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Link Networks Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie, Morgan Kaufmann Chapter 2.

2 Lecture 3, 2Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Links: Outline Physical Layer –Link technologies –Encoding Link Layer –Framing –Error Detection –Reliable Transmission (ARQ protocols) –Medium Access Control: Existing protocols: Ethernet, Token Rings, Wireless

3 Lecture 3, 3Spring 2003, COM1337/3501CCN: Direct Link Networks Link Technologies Cables: –Cat 5 twisted pair, Mbps, 100m –Thin-net coax, Mbps, 200m –Thick-net coax, Mbps, 500m –Fiber, 100Mbps-2.4Gbps, 2-40km Leased Lines: –Copper based: T1 (1.544Mbps), T3 (44.736Mbps) –Optical fiber: STS-1 (51.84Mbps), STS-N (N*51.84Mbps) Last-Mile Links: –POTS (56Kbps), ISDN (2*64Kbps) –xDSL: ADSL (16-640Kbps, Mbps), VDSL (12.96Mbps- 55.2Mbps) –CATV: 40Mbps downstream, 20Mbps upstream Wireless Links: Cellular, Satellite, Wireless Local Loop

4 Lecture 3, 4Spring 2003, COM1337/3501CCN: Direct Link Networks 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

5 Lecture 3, 5Spring 2003, COM1337/3501CCN: Direct Link Networks Problem: Consecutive 1s or 0s Low signal (0) may be interpreted as no signal High signal (1) leads to baseline wander –Receiver compares rx_signal to avg_signal Clock drift: Unable to recover clock

6 Lecture 3, 6Spring 2003, COM1337/3501CCN: Direct Link Networks 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.

7 Lecture 3, 7Spring 2003, COM1337/3501CCN: Direct Link Networks Encodings (cont) Bits NRZ Clock Manchester NRZI

8 Lecture 3, 8Spring 2003, COM1337/3501CCN: Direct Link Networks 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 4b data5b code4b data5b code

9 Lecture 3, 9Spring 2003, COM1337/3501CCN: Direct Link Networks Framing The physical layer provides a mean to transmit a sequence of bits How can one determine the beginning/end of a frame? Solutions: –Character-based framing (use special control characters) –Bit-oriented framing with flags –Length counts –Clock based

10 Lecture 3, 10Spring 2003, COM1337/3501CCN: Direct Link Networks Character Based Framing BISYNC: BInary SYNchronous Communication –SYN: Synchronous idle, SOH: Start of Header, STX: Start of text, ETX: End of text Problem 1: if control characters appear within the header, or CRC. –These are known locations, one can skip control characters in these fields Problem 2: if CTRL characters appear in the packet. –Use a Data Link Escape (DLE) character before ETX when it appears within the packet –If DLE appears within the packet replace it with DLE DLE. SYN SOHHeaderBodyETXCRCSYNSTX

11 Lecture 3, 11Spring 2003, COM1337/3501CCN: Direct Link Networks Bit Based Framing Sentinel-based (Bit oriented) –delineate frame with special pattern: –e.g., HDLC, SDLC –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 Disadvantage: potentially increases the length by 20% HeaderBody CRC Beginning sequence Ending sequence

12 Lecture 3, 12Spring 2003, COM1337/3501CCN: Direct Link Networks Counter Based Framing –include payload length in header –e.g., DDCMP –problem: count field corrupted –solution: catch when CRC fails

13 Lecture 3, 13Spring 2003, COM1337/3501CCN: Direct Link Networks Clock Based Framing SONET: Synchronous Optical Network Each frame is 125 micro-seconds long: 810 bytes for STS-1 STS-n (STS-1 = Mbps)

14 Lecture 3, 14Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Links: Outline Physical Layer –Link technologies –Encoding Link Layer –Framing –Error Detection –Reliable Transmission (ARQ protocols) –Medium Access Control (MAC): Existing protocols: Ethernet, Token Rings, Wireless

15 Lecture 3, 15Spring 2003, COM1337/3501CCN: Direct Link Networks Error Detection Bits can get corrupted on transmissions How to detect, and if possible, correct them Error detection techniques: –Parity bit –Internet checksum –Cyclic redundancy check (CRC)

16 Lecture 3, 16Spring 2003, COM1337/3501CCN: Direct Link Networks Parity Bit Simplest of all techniques Single parity bit –Add a bit that takes the XOR of all the data bits –What kind of errors can it detect? Two dimensional parity: –Arrange the data in a 2D matrix –Take the parity along each row and row column –Send the data with the parity bits –What kind of errors can it detect?

17 Lecture 3, 17Spring 2003, COM1337/3501CCN: Direct Link Networks 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); }

18 Lecture 3, 18Spring 2003, COM1337/3501CCN: Direct Link Networks 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= 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

19 Lecture 3, 19Spring 2003, COM1337/3501CCN: Direct Link Networks 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)

20 Lecture 3, 20Spring 2003, COM1337/3501CCN: Direct Link Networks Selecting C(x) All single-bit errors, as long as the x k and x 0 terms have non-zero coefficients. 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)

21 Lecture 3, 21Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Links: Outline Physical Layer –Link technologies –Encoding Link Layer –Framing –Error Detection –Reliable Transmission (ARQ protocols) –Medium Access Control (MAC): Existing protocols: Ethernet, Token Rings, Wireless

22 Lecture 3, 22Spring 2003, COM1337/3501CCN: Direct Link Networks Reliable Transmission: ARQ Automatic Repeat reQuest (ARQ) Underlying physical channel: –Each transmitted frame may be delayed by an arbitrary and variable time –Some frames might be lost and may never arrive –Assume that error detection works correctly –Frames that arrive are assumed to do so in order, with or without errors (this assumption is not always necessary, true for direct links) Correctness of ARQ protocol: each packet is released to the network layer once and only once, without error Efficiency: Use of link bandwidth (effective throughput)

23 Lecture 3, 23Spring 2003, COM1337/3501CCN: Direct Link Networks Acknowledgements & Timeouts

24 Lecture 3, 24Spring 2003, COM1337/3501CCN: Direct Link Networks Stop-and-Wait Sender ensures that each frame is received correctly before sending the next frame. How to distinguish between successive packets? –Use sequence numbers But sequence numbers may grow out of bound? –A 1-bit sequence number suffices for Stop-and-Wait! SenderReceiver

25 Lecture 3, 25Spring 2003, COM1337/3501CCN: Direct Link Networks Problems with Stop-and-Wait Keeping the pipe full Example –1.5Mbps link x 45ms RTT = 67.5Kb (8KB) –1KB frames implies 1/8th link utilization How to keep the pipe full? –Send more frames without waiting for acks

26 Lecture 3, 26Spring 2003, COM1337/3501CCN: Direct Link Networks Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window SenderReceiver T ime … …

27 Lecture 3, 27Spring 2003, COM1337/3501CCN: Direct Link Networks 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 Advance LAR when ACK arrives Buffer up to SWS frames  SWS LARLFS ……

28 Lecture 3, 28Spring 2003, COM1337/3501CCN: Direct Link Networks Sliding Window: Receiver Maintain three state variables –receive window size ( RWS ) –largest frame acceptable ( LFA ) –last frame received in order ( LFR ) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: –if LFR < SeqNum < = LFA accept; update LFR, if necessary –if SeqNum LFA discarded Send cumulative ACKs Buffer up to RWS packets LFRLFA  RWS

29 Lecture 3, 29Spring 2003, COM1337/3501CCN: Direct Link Networks Buffer Sizes SWS set to bandwidth-delay product estimate For RWS, two common settings –RWS = 1: receiver will not buffer any frames that arrive out of order –RWS = SWS Does not make sense to set RWS > SWS

30 Lecture 3, 30Spring 2003, COM1337/3501CCN: Direct Link Networks Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames If RWS = SWS, 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

31 Lecture 3, 31Spring 2003, COM1337/3501CCN: Direct Link Networks 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 Separates reliability from order Data link layer protocol used in ARPANET

32 Lecture 3, 32Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Links: Outline Physical Layer –Link technologies –Encoding Link Layer –Framing –Error Detection –Reliable Transmission (ARQ protocols) –Medium Access Control (MAC): Existing protocols: Ethernet, Token Rings, Wireless

33 Lecture 3, 33Spring 2003, COM1337/3501CCN: Direct Link Networks Medium Access Control Protocols Multiple Access Protocols Contention DynamicResolutionStaticResolution Conflict-free DynamicAllocationStaticAllocation TokenPassing ReservationIDProbabilisticProbabilistic Time of arrival

34 Lecture 3, 34Spring 2003, COM1337/3501CCN: Direct Link Networks MAC Protocols: Evaluation Throughput Delay Buffering Stability We also generally assume that: –channel is errorless –feedback is available

35 Lecture 3, 35Spring 2003, COM1337/3501CCN: Direct Link Networks Carrier Sense Protocols Use the fact that in some networks you can sense the medium to check whether it is currently free –1-persistent CSMA –non-persistent CSMA –p-persistent protocol –CSMA with collision Detection (CSMA/CD) 1-persistent CSMA –when a station has a packet: it waits until the medium is free to transmit the packet if a collision occurs, the station waits a random amount of time –first transmission results in a collision if several stations are waiting for the channel

36 Lecture 3, 36Spring 2003, COM1337/3501CCN: Direct Link Networks Carrier Sense Protocols (Cont’d) non-persistent CSMA –when a station has a packet: if the medium is free, transmit the packet otherwise wait for a random period of time and repeat the algorithm –higher delays, but better performance than pure ALOHA p-persistent protocol –when a station has a packet wait until the medium is free: transmit the packet with probability p wait for next slot with probability 1-p –better throughput than other schemes but higher delay CSMA with Collision Detection (CSMA/CD) –stations abort their transmission when they detect a collision –e.g., Ethernet, IEEE802.3

37 Lecture 3, 37Spring 2003, COM1337/3501CCN: Direct Link Networks Ethernet History: evolution from Aloha, CSMA, CSMA/CD (by Xerox PARC) => Ethernet, => IEEE802.3 (Digital, Intel, Xerox) –There are slight differences between Ethernet and (e.g., length field is used for packet type in Ethernet, various transmission speeds for from 1 to 10Mbps) Physical layer (10Mbps Ethernet): –Manchester encoding (bit synchronous, no-dc component) –Cabling: maximum 500 meters with up to 4 repeaters (max 2500m) 10Base5Thick coax500 m100 nodesGood for backbones 10Base2Thin coax200 m30Cheapest system 10Base-TTwisted pair100 m1024Easy maintenance 10Base-FFiber optics2000 m1024Between buildings

38 Lecture 3, 38Spring 2003, COM1337/3501CCN: Direct Link Networks Frame Format (IEEE802.3) Preamble : 7x … ( allows the receiver’s clock to synchronize) SF: Mbps has only 6 bytes addresses: –Unicast: unique per adaptor (ranges are allocated to manufacturers) –Broadcast: FF:FF:FF:FF:FF:FF –Multicast: first address bit = 1 –Internet Multicast: 01:00:5e:00:00:00 -to- 01:00:5e:7f:ff:ff Pad: minimum frame length of 64 bytes

39 Lecture 3, 39Spring 2003, COM1337/3501CCN: Direct Link Networks Ethernet Algorithm Receiver: accepts frames with a correct CRC Sender: CSMA/CD 1-persistent algorithm –If the adaptor has a frame and the line is idle: transmit, otherwise wait until idle line then transmit –If a collision occurs: When detected a 32-bit jamming sequence is sent Binary exponential backoff: select a random number  [0, 2 i -1] and waits for that many slots before transmitting After ten collisions the randomization interval is frozen to max 1023 After 16 collisions the controller throws away the frame What is the reason for having a minimal frame length? (Hint RTT: 51.2  s)

40 Lecture 3, 40Spring 2003, COM1337/3501CCN: Direct Link Networks Ethernet Performance Assume that retransmissions occur with probability p, k stations ready to transmit: –Probability that a station acquires the channel: A=kp(1-p) k-1 –Maximum: when p=1/k, k->  A->1/e –Probability that a contention interval has exactly j slots is: A(1-A) j-1 –Mean number of slots per contention is: 1/A -> e = 2.718… –Slot duration: 2  = 51.2  s –Channel efficiency: P/(P+2  e), where P is transmission time for a packet

41 Lecture 3, 41Spring 2003, COM1337/3501CCN: Direct Link Networks Ethernet Performance

42 Lecture 3, 42Spring 2003, COM1337/3501CCN: Direct Link Networks Ethernet Capture Effect A and B have a large queue of packets There exists a situation where B will keep increasing its backoff interval (and finally dropping its packet) while A is transmitting its packets One of the reasons why frame is dropped after 16 collisions

43 Lecture 3, 43Spring 2003, COM1337/3501CCN: Direct Link Networks Token Passing MAC Token Bus (IEEE802.4): –broadcast bus –logical ring –token: special control frame –only the token holder station can transmit frames –0, 2, 4, 6: traffic priority classes Token Ring (initiated by IBM => IEEE802.5 => FDDI): –token regenerated/modified at each node –stations have two modes: listen (forwards bits with delay 1) transmit (seizes the first token by transforming into the start of frame)

44 Lecture 3, 44Spring 2003, COM1337/3501CCN: Direct Link Networks Token Ring

45 Lecture 3, 45Spring 2003, COM1337/3501CCN: Direct Link Networks 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 CRC Start of frame End of frame Dest addr Body 48 Src addr Status 32

46 Lecture 3, 46Spring 2003, COM1337/3501CCN: Direct Link Networks Fiber Distributed Data Interface Evolution of IEEE802.5 Designed for fiber (100Mbps) but also supports coax and twisted pair Architecture: dual ring –Tolerates one broken link or one station failure Stations buffer at least 9 bits and at most 80 bits Uses 4B/5B encoding Specific Timed-Token Algorithm

47 Lecture 3, 47Spring 2003, COM1337/3501CCN: Direct Link Networks Token Times 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

48 Lecture 3, 48Spring 2003, COM1337/3501CCN: Direct Link Networks 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

49 Lecture 3, 49Spring 2003, COM1337/3501CCN: Direct Link Networks 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

50 Lecture 3, 50Spring 2003, COM1337/3501CCN: Direct Link Networks Ad Hoc Wireless Networks Physical transmission: spread-spectrum radio and diffused infrared Key issue: collision avoidance, as for the Ethernet –More complex than the Ethernet because the nodes are not directly connected with one another –Multi-hop network Potential problems: –Hidden terminal problem –Exposed terminal problem

51 Lecture 3, 51Spring 2003, COM1337/3501CCN: Direct Link Networks : Multiple Access with Collision Avoidance (MACA 1990) MACA is designed for ad-hoc wireless networks When a station S 1 has a packet to transmit to station S 2 –S 1 senses the channel. If the channel is busy defers the transmission until idle –if channel is idle S 1 sends a special packet called Request-To-Send (RTS) to S 2 –(if the RTS is correctly received by S 2 ) S 2 sends a Clear-To-Send (CTS), CTS includes the frame length –(if the CTS is correctly received by S 1 ) S 1 starts the data transmission Stations which sense: –RTS: defer transmission until after CTS –CTS: defer transmission until the transmission of data completes If a station does not receive CTS in response to its RTS, it invokes an exponential backoff


Download ppt "Lecture 3, 1Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Link Networks Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie,"

Similar presentations


Ads by Google