1 / 75

ECE544: Communication Networks-II Spring 2018

ECE544: Communication Networks-II Spring 2018. D. Raychaudhuri Lecture II. Includes teaching materials from L. Peterson, J. Kurose. Today’s Lecture. Recap of network architecture & top-down design architecture paper discussion Shared media (MAC) protocols Ethernet Token ring IEEE 802.11.

hillaryd
Download Presentation

ECE544: Communication Networks-II Spring 2018

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE544: Communication Networks-II Spring 2018 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose

  2. Today’s Lecture • Recap of network architecture & top-down design • architecture paper discussion • Shared media (MAC) protocols • Ethernet • Token ring • IEEE 802.11

  3. LAN 1 LAN 2 Switch Link Link Link Router Switch Host Host Link Layer: Introduction • Some terminology: • hub/repeater (layer 1), bridge/LAN switch (layer 2), router (layer 3), host (layers 1-3 + app) • Links are communication channels that connect adjacent nodes along communication path (point-to-point, shared, wired, wireless) • Layer-2 frame: encapsulates payload/datagram/IP packet/service unit

  4. Link Layer Services • Data-link layer: transfer datagram from one node to adjacent node over a link • Framing: encapsulate datagram into frame, adding header, trailer. • Identify what set of bits constitute a frame, that is, determining the beginning and the end of a frame • channel access if shared medium • MAC addresses used in frame headers to identify source, destination • different from IP address! • Reliable delivery between adjacent nodes • Error detection • Error recovery: forward error correction code, retransmission (ARQ)

  5. Link layer protocol Recv node Sending node Datagram Datagram Frame Frame Adaptor Adaptor Host CPU Control status register NIC Cache Link interface Network Bus interface Memory I/O bus Link Layer Communication • Link layer implemented in adaptor (NIC) and driver (Ethernet card, WLAN card) • Sending side: encapsulates higher layer payload in a frame, adds error checking bits, flow control, etc. • Receiving side: error detection, flow control, extracts payload, passes to the receiving node

  6. Layer 2 vs. Layer 3 • Layer 3 routing • Based on IP address • Must get IP address (DHCP or manual assign) • Easily connect LANs that uses different link protocols • Scalable to large network by subnet routing • Broadcast limited only in a subnet • Layer 2 switching • Based on MAC address • Self configuring and plug & play • Transparent to protocols above the MAC layer • Fast and inexpensive • Does not limit the scope of broadcasts • Does not scale to extremely large networks

  7. Link Layer Techniques • Encoding (more Physical Layer stuff) • Framing & PPP Protocol • Error Detection & Correction • ARQ • Self study topics (see Ch2 & slides)

  8. Binary Encoding • Binary Encoding: turn the binary data (bits) into signals to transmit on cable or optical fiber link (physical layer stuff, but better to know) • Baseband, not modulate to high frequency • Nonreturn To Zero (NRZ): 1=high signal, 0=low signal • May stay on high or low signal too long for a long strings of consecutive 1s or 0s => baseline wander, clock recovery problems. • Nonreturn to Zero Inverted (NRZI): 1 = signal transition (low to high, or high to low), 0=no change. • Solve the problem of consecutive 1s, but not consecutive 0s

  9. Bits 0 0 1 0 1 1 1 1 0 1 0 0 NRZ Clock Manchester NRZI Manchester Encoding • Manchester Encoding: NRZ_encode data XOR clock • Clock cycle (a low/high pair) = 2 x signal interval • Baud rate (the signal change rate) = 2 x bitrate • 0 =high-to-low transition, 1 = low-to-high transition • Clock recovery • Variation: Differential Manchester • 1 = the first half of the signal equal to the last half of the previous bit’s signal • 0 = the first half of the signal opposite to the last half of the previous bit’s signal

  10. Point-to-Point Data Link Protocol • Two types of links • point-to-point link (easier than broadcast link) • one sender, one receiver on the link, NO Media Access Control • no need for explicit MAC addressing • e.g., dialup link, ISDN line • Broadcast (shared wire or medium) • popular point-to-point DLC protocols: • PPP (point-to-point protocol): byte-oriented • PPP for dial-up access • PPP over Ethernet (DSL) • HDLC (High level data link control): bit-oriented Modem PPP

  11. PPP Functions • Framing: encapsulation of network-layer datagram in data link frame • Identify what set of bits constitute a frame, that is, determining the beginning and the end of a frame • carry data of any network layer protocol (not just IP) at same time • ability to demultiplex upwards • bit transparency: must carry any bit pattern in the data field • error detection (no correction) • connection liveness: detect, signal link failure to network layer • network layer address negotiation: endpoint can learn/configure each other’s network address • PPP • no error correction/recovery • no flow control • out of order delivery OK • no need to support multipoint links (e.g., polling)

  12. PPP Data Frame • Flag: delimiter (framing) • Address: • Control: • Protocol: upper layer protocol to which frame carried (e.g. IP) • Info: upper layer data • Check: CRC Octet: 1 1 1 or 2 variable 1 2 or 4 1 00000011 CRC 01111110 11111111 protocol info 01111110 address flag control

  13. Byte Stuff • “data transparency”requirement: data field must be allowed to include flag pattern <01111110> • Q: is received <01111110> data or flag? • Sender: adds (“stuffs”) extra < 01111110> byte after each < 01111110> data byte • Receiver: • two 01111110 bytes in a row: discard first byte, continue data reception • single 01111110: flag byte

  14. PPP Link Control Protocol (LCP) • Before exchanging network-layer data, data link peers must • configure PPP link (max. frame length, authentication) • learn/configure network • layer information • for IP: carry IP Control Protocol (IPCP) msgs (protocol field: 8021) to configure/learn IP address

  15. Bits: 8 16 variable 16 8 CRC 01111110 Header body 01111110 Beginning sequence ending sequence High-Level Data Link Control (HDLC) • Bit oriented protocol: view the frame as a collection of bits, does not care byte boundaries. • Sentinel characters 01111110 transmitted as the link is idle for synchronization • Bit stuffing: to distinguish the data pattern 01111110 in the body from the special “beginning/end” sequence • after transmitting any 5 consecutive 1s in body, insert a 0 • 011111xxxx => 0111110xxx

  16. Error Detection • EDC= Error Detection and Correction bits (redundancy) • D = Data protected by error checking, may include header fields • Error detection not 100% reliable! • protocol may miss some errors, but rarely • larger EDC field yields better detection and correction

  17. Parity Checking • Two Dimensional Bit Parity: • Detect and correct single bit error • Single Bit Parity: • Detect single bit errors

  18. Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment contents, and take the ones complement of the result sender puts checksum value into UDP checksum field Receiver: compute checksum of received segment check if computed checksum equals checksum field value: NO -error detected YES -no error detected. But maybe errors (internet checksum not very strong for error detection, but simple) Internet Checksum • Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: used at transport layer)

  19. Cyclic Redundancy Check (CRC) • A (n+1)-bit message M can be represented as a polynomial of degree n. For example, • X = 10011010; • M(X) = X7 + X4 + X3 + X • Choose k+1 bit pattern (divisor), C(X), a polyn of degree k • goal: get k CRC bits, Y, such that • P=<M,Y> exactly divisible by C (modulo 2) • receiver knows C, divides <M,Y> by C. If non-zero remainder: error detected! • can detect all burst errors less than k+1 bits n bits k bits Y: CRC M: data bits to be sent M x 2k XOR R

  20. CRC Example • Goal: design P(X) such that it is exactly divisible by C(X) • T(X) = M(X) Xk(add k zero’s to the end of the message) • Subtract the remainder from T(X) to get P(X). • P(X) is now exactly divisible by C(X). • Corresponding to the complete transmitted message (Remember – all addition/subtract use modulo-2 arithmetic)

  21. Automatic Repeat reQuest(ARQ) • Stop-and-wait ARQ • Transmit a frame and wait for acknowledge • If positive acknowledge (ACK) from receiver, send next frame • If ACK does not arrive after a certain period of time (Timeout), retransmits the frame • Simple, low efficiency • Go-back-N ARQ • Transmit frames continuously, no waiting • The receiver only acks the highest-numbered frames received in sequence • ACK comes back after a round-trip delay • If timeout, the sender retransmits the frames that are not acked and N-1 succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay) • Need buffer at transmitter, does not have to buffer the frames at the receiver, • moderate efficiency and complexity. Less efficient when the round-trip delay is large and data transmission rate is high • Selective-repeat • Transmit continuously, no waiting • The receiver acks all successfully received frames • The sender only retransmits (repeats) the unacked frames when their timers expire • Most efficient, but most complex, buffer needed at both transmitter and receiver, need per frame timer

  22. Sliding Window • Reliable delivery: retransmission • Ordered delivery: preserve the order in which the frames are transmitted • Receiver does not pass along (buffer) out-of-order frames • Flow control: feedback mechanism by which the receiver is able to throttle the sender • Inform the sender of how much frames the receiver has room to receive

  23. Sliding Window (Cont) • Send window size (SWS): the upper bound on the number of unacked frames that the sender can transmit, • set according to the round-trip delay to keep the pipe full (recall: bandwidth x delay product represents the amount of data that could be in transit) • LAR: the sequence # of the last ack received • LFS: the sequence # of the last frame sent • Receiver window size (RWS): the upper bound on the number of out-of-order frames that the receiver is willing to accept • LAF: the sequence # of the largest acceptable frame • LFR: the sequence # of the last frame received • SeqNumToAck: the largest sequence # not yet acked, such that all frames with seq # <= SeqnumToAck have been received

  24. LAR LFS SWS 1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 11 12 10 Sender Ack 5 Ack 4 Ack 3 Ack 2 Ack 2 Ack 2 Ack 1 Ack 6 Ack 2 Receiver 1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 11 12 10 LFR LAF Error RWS SeqNumToAck Sliding Window • LFS-LAR<=SWS, LAF-LFR<=RWS • Finite Seq. # wraps around: • SWS < (MaxSeqNum+1)/2 when RWS=SWS to distinguish between different incarnations of the same seq. #

  25. Shared Media Networks • MAC (medium access control) • ALOHA, Slotted ALOHA • CSMA/CD, CSMA/CA • Token Ring • TDMA, Dynamic TDMA • FDMA, CDMA • LAN Technologies • IEEE 802.3 Ethernet • IEEE 802.5 Token Ring • IEEE 802.11 Wireless LAN

  26. End host Application Presentation Applications Session Transport TCP/UDP IP Network LLC Data link Subnet MAC Physical Physical Medium Access Sublayer • Medium access control (MAC) sublayer is not relevant on point-to-point links • The MAC sublayer is only used in broadcast or shared medium/channel networks • All communication entities “share” a common channel • Wired networks: Ethernet LAN • Wireless & Mobile Networks: Satellite, Cellular, Wireless LAN,

  27. Media Access Protocol • Shared broadcast channel • two or more simultaneous transmissions by nodes: interference • Collision if node receives two or more signals at the same time • MAC protocol • Determines how nodes share channel, i.e., determine when node can transmit • Ideally, if broadcast channel of rate R bps • When one node wants to transmit, it can send at rate R. • When M nodes want to transmit, each can send at average rate R/M (fairness)

  28. MAC Classification • Channel Partitioning • divide channel into smaller “pieces” (time slots, frequency, code) • allocate piece to node for exclusive use • TDMA, CDMA, FDMA • Random Access • channel not divided • When node has frame to send, transmit with the total channel bandwidth • No coordination between nodes, control is completely distributed • two or more nodes transmit simultaneously ➜“collision” • random access MAC protocol should specify: • how to detect collisions • how to recover from collisions (e.g., via delayed retransmissions) • Examples: ALOHA, Slotted ALOHA, CSMA/CD, CSMA/CA • “Taking turns” • Nodes take turns • Token ring • Hybrid • Combine two or more techniques together

  29. Pure (Unslotted) ALOHA Hub • Early packet radio network created at the U. of Hawaii in 1970 • Uplink channel (clients->hub) and downlink channel (hub->clients) uses different frequencies • Client nodes send data frames to the central hub using the shared uplink channel. • The hub immediately re-send the received frames, allowing clients to determine whether or not their data had been received properly. • Simplest form of random access, provides basis for more advance contention MAC Client

  30. Aloha Algorithm • Aloha Algorithm: • Nodes transmit immediately whenever they have a frame to send • No synchronization among nodes • If collision, retransmit after random delay • random delay prevents the same frames from colliding over and over again • collision window or “vulnerable period”: • frame sent at t0 collides with other frames sent in [t0-1,t0+1]

  31. Pure Aloha efficiency • Assume that the aggregate frame arrival is Poisson Process • P [k arrivals in a time-interval] = • G: the mean number of aggregate arrivals (all nodes in network) in the time interval • time-interval = one frame transmission time • Conditional successful probability for one frame transmission attempt is • P0 = P [0 other attempts in 2 time-intervals] =e-2G • The probability of successful transmission • S = GP0 = Ge-2G • S is optimum at G=1/2 • S=1/2e = 0.184

  32. Slotted Aloha • Operation • when node obtains fresh frame, it transmits at the beginning of next slot • no collision, node can send new frame in next slot • if collision, wait a random number of slots and try to send again • Assumptions • all frames same size • time is divided into equal size slots, time to transmit 1 frame • nodes start to transmit frames only at beginning of slots • nodes are synchronized • if 2 or more nodes transmit in slot, detect collision • Feedback channel about whether packet is received or not (half-duplex)

  33. Efficiency of Slotted ALOHA • Aggregate frame arrival is Poisson Process • P [k arrivals in a time-interval] = • G: the mean number of aggregate arrivals (for all nodes in network) in this interval • time-interval = slot (one frame transmission time) • Successful probability for each slot is : S= P [1 attempt in a slot] =Ge-G • S is optimum at G=1 • S=1/e = 0.368 (slotted aloha reduce the potential collision period from 2t to t by node synchronization)

  34. Performance of ALOHA • Throughput versus offered traffic for ALOHA systems • The main reason for poor channel utilization of ALOHA (pure or slotted) is that all stations can transmit at will, without paying attention to what the other stations are doing.

  35. Carrier Sense Multiple Access (CSMA) • CSMA: listen before transmit: • If channel sensed idle: transmit • If channel sensed busy, defer transmission • Human analogy: don’t interrupt others! • Can collisions occur in this scheme? • Two nodes might attempt to transmit a frame at the same time • Propagation delay means two nodes may not hear each other’s transmission immediately • Several variants of CSMA protocols: • Non-Persistent CSMA • 1-Persistent CSMA • P-Persistent CSMA

  36. Non-persistent CSMA • To send data, a node first listens to the channel to see if anyone else is transmitting. • If so, the node waits a random period of time (instead of keeping sensing until the end of the transmission) and repeats the algorithm. Otherwise, it transmits a frame. • If a collision occurs, the node waits a random amount of time and starts all over again.

  37. 1-persistent CSMA Algorithm: • To send data, a node first listens to the channel to see if anyone else is transmitting. • If so, the node waits (keeps sensing it) until the channel becomes idle. Otherwise, it transmits a frame. • If a collision occurs, the node waits a random amount of time and starts all over again. • It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle. (Greedy)

  38. P-persistent CSMA • Assume channels are slotted • One slot = contention period (i.e., one round trip propagation delay) Algorithm: • Sense the channel • If channel is idle, transmit a packet with probability p • if a packet was transmitted, go to step 2 • if a packet was not transmitted, wait one slot and go to step 1 • If channel is busy, wait one slot and go to step 1. • In other words, wait until idle and then transmit with probability p • Detect collisions • If a collision occurs, wait a random amount of time and go to step 1

  39. Propagation Delay • D only sense A’s transmission after a propagation delayτ • If τ is larger than packet transmission time, too much time wasted. • CSMA in satellite communication? No. • Distance & propagation delay determine collision probability A B C D The size (length) of the network must be limited!

  40. CSMA Performance Analysis • Assumptions • Constant length packets • No errors, except those caused by collisions • Collision: entire packet transmission time wasted • Each host can sense the transmissions of all other hosts • The propagation delay is small compared to the transmission time

  41. Analysis of Non-persistent CSMA Unsuccessful transmission period Successful transmission period Normalized Time • Prob. of success transmission S= U x I/(B+I) • Mean B = Y + 1 + a , mean I = 1/G • U = Ge-Ga • FY(y)=P{no packet occur in an duration of a-y } = e-G(a-y) (CDF) a a: the ratio of propagation delay to packet transmission time a 1 1 Y a Idle period Busy period Busy period • Poisson arrival, P(k arrivals in time duration t) =

  42. Comparison of the channel utilization versus load for various random access protocols

  43. CSMA with Collision Detection CSMA/CD (Carrier Sense Multiple Access with Collision Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected. Operation: • To send data, a node first listens to the channel to see if anyone else is transmitting. • If not, it transmits a frame • If channel busy, deferral as in CSMA • the node wait a random period of time and repeats the algorithm (non-persistent), or waits until the end of the transmission (1-persistent) • The node will detect the collision, if collision detected, abort its transmission (reducing channel wastage), waits a random amount of time, and starts all over again.

  44. How to Detect Collision • Prerequisite: A node can listen while talking • Easy in wired LANs: measure signal strength, compare Tx and Rx signals • Difficult in wireless LANs: receiver shut off while transmitting Tx Rx

  45. CSMA/CA • Wireless LANs • How can a node detect collision if it cannot listen while talking? • Collision Avoidance • Random Backoff (instead of 1-persistent) • Request-to-send (RTS)/clear-to-send (CTS) • CS no longer works well • Rules: • carrier ==> do not transmit • no carrier ==> OK to transmit • But the above rules do not always apply to wireless.

  46. Problems with carrier sensing Hidden terminal problem Y Z W W finds that medium is free and it transmits a packet to Z no carrier ===> OK to transmit /

  47. Problems with carrier sensing Exposed terminal problem Z W Z is transmitting to W X Y Y will not transmit to X even though it cannot interfere / Presence of carrier ===> hold off transmission

  48. CTS RTS - listen RTS - wait long enough for the requested station to respond with CTS - if (timeout) then ready to transmit - listen CTS - wait long enough for the transmitter to send its data listen RTS ==> transmitter is close listen CTS ==> receiver is close Solving Hidden Node problem with RTS/CTS Y Z X W Note: RTS/CTS does not solve exposed terminal problem. In the example above, X can send RTS, but CTS from the responder will collide with Y’s data.

  49. RTS/CTS exchange example SIFS DIFS Frame RTS Transmitter • RTS + CTS + Frame + ACK exchange invoked when frame size is large • NAV (Network Allocation Vector) • NAV maintains prediction of future traffic on the medium based on duration information that is announced in RTS/CTS frames prior to actual exchange of data ACK CTS Receiver 8192 s 352 µs 304 µs 304 µs 10 µs 10 µs 10 µs Other NAV (RTS) NAV (CTS)

  50. “Taking Turns” MAC protocols Token passing: • control token passed from one node to next sequentially. • token message • concerns: • token overhead • complexity • single point of failure (token) Polling: • master node “invites” slave nodes to transmit in turn • concerns: • polling overhead • single point of failure (master)

More Related