Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Link Layer 5-1 Chapter 5 Link Layer and LANs A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students,

Similar presentations


Presentation on theme: "Data Link Layer 5-1 Chapter 5 Link Layer and LANs A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students,"— Presentation transcript:

1 Data Link Layer 5-1 Chapter 5 Link Layer and LANs A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:  If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!)  If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2010 J.F Kurose and K.W. Ross, All Rights Reserved Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.

2 Data Link Layer 5-2 Chapter 5: The Data Link Layer Our goals:  understand principles behind data link layer services:  error detection, correction  sharing a broadcast channel: multiple access  link layer addressing  reliable data transfer, flow control: done!  instantiation and implementation of various link layer technologies

3 Data Link Layer 5-3 Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-layer Addressing 5.5 Ethernet 5.6 Link-layer switches 5.7 PPP 5.8 Link virtualization: MPLS 5.9 A day in the life of a web request

4 Data Link Layer 5-4 Link Layer: Introduction Terminology:  hosts and routers are nodes  communication channels that connect adjacent nodes along communication path are links  wired links  wireless links  LANs  layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to physically adjacent node over a link

5 Data Link Layer 5-5 Link layer: context  datagram transferred by different link protocols over different links:  e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link  each link protocol provides different services  e.g., may or may not provide rdt over link transportation analogy  trip from Princeton to Lausanne  limo: Princeton to JFK  plane: JFK to Geneva  train: Geneva to Lausanne  tourist = datagram  transport segment = communication link  transportation mode = link layer protocol  travel agent = routing algorithm

6 Data Link Layer 5-6 Link Layer Services  framing, link access:  encapsulate datagram into frame, adding header, trailer  channel access if shared medium  “ MAC ” addresses used in frame headers to identify source, dest different from IP address!  reliable delivery between adjacent nodes  we learned how to do this already (chapter 3)!  seldom used on low bit-error link (fiber, some twisted pair)  wireless links: high error rates Q: why both link-level and end-end reliability?

7 Data Link Layer 5-7 Link Layer Services (more)  flow control:  pacing between adjacent sending and receiving nodes  error detection:  errors caused by signal attenuation, noise.  receiver detects presence of errors: signals sender for retransmission or drops frame  error correction:  receiver identifies and corrects bit error(s) without resorting to retransmission  half-duplex and full-duplex  with half duplex, nodes at both ends of link can transmit, but not at same time

8 Data Link Layer 5-8 Where is the link layer implemented?  in each and every host  link layer implemented in “ adaptor ” (aka network interface card NIC)  Ethernet card, PCMCI card, 802.11 card  implements link, physical layer  attaches into host ’ s system buses  combination of hardware, software, firmware controller physical transmission cpu memory host bus (e.g., PCI) network adapter card host schematic application transport network link physical

9 Data Link Layer 5-9 Adaptors Communicating  sending side:  encapsulates datagram in frame  adds error checking bits, rdt, flow control, etc.  receiving side  looks for errors, rdt, flow control, etc  extracts datagram, passes to upper layer at receiving side controller sending host receiving host datagram frame

10 Data Link Layer 5-10 Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-layer Addressing 5.5 Ethernet 5.6 Link-layer switches 5.7 PPP 5.8 Link virtualization: MPLS 5.9 A day in the life of a web request

11 Data Link Layer 5-11 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 otherwise

12 Data Link Layer 5-12 Parity Checking Single Bit Parity: Detect single bit errors Two Dimensional Bit Parity: Detect and correct single bit errors 0 0

13 Data Link Layer 5-13 Internet checksum (review) Sender:  treat segment contents as sequence of 16-bit integers  checksum: addition (1 ’ s complement sum) of segment contents  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 nonetheless? Goal: detect “ errors ” (e.g., flipped bits) in transmitted packet (note: used at transport layer only)

14 Data Link Layer 5-14 Checksumming: Cyclic Redundancy Check  view data bits, D, as a binary number  choose r+1 bit pattern (generator), G  goal: choose r CRC bits, R, such that  exactly divisible by G (modulo 2)  receiver knows G, divides by G. If non-zero remainder: error detected!  can detect all burst errors less than r+1 bits  widely used in practice (Ethernet, 802.11 WiFi, ATM)

15 Data Link Layer 5-15 CRC Example Want: D. 2 r XOR R = nG equivalently: D. 2 r = nG XOR R equivalently: if we divide D. 2 r by G, want remainder R R = remainder[ ] D.2rGD.2rG

16 Data Link Layer 5-16 Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3Multiple access protocols 5.4 Link-layer Addressing 5.5 Ethernet 5.6 Link-layer switches 5.7 PPP 5.8 Link virtualization: MPLS 5.9 A day in the life of a web request

17 Data Link Layer 5-17 Multiple Access Links and Protocols Two types of “ links ” :  point-to-point  PPP for dial-up access  point-to-point link between Ethernet switch and host  broadcast (shared wire or medium)  old-fashioned Ethernet  upstream HFC  802.11 wireless LAN shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)

18 Data Link Layer 5-18 Multiple Access protocols  single shared broadcast channel  two or more simultaneous transmissions by nodes: interference  collision if node receives two or more signals at the same time multiple access protocol  distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit  communication about channel sharing must use channel itself!  no out-of-band channel for coordination

19 Data Link Layer 5-19 Ideal Multiple Access Protocol Broadcast channel of rate R bps 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized:  no special node to coordinate transmissions  no synchronization of clocks, slots 4. simple

20 Data Link Layer 5-20 MAC Protocols: a taxonomy Three broad classes:  Channel Partitioning  divide channel into smaller “ pieces ” (time slots, frequency, code)  allocate piece to node for exclusive use  Random Access  channel not divided, allow collisions  “ recover ” from collisions  “ Taking turns ”  nodes take turns, but nodes with more to send can take longer turns

21 Data Link Layer 5-21 Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access  access to channel in "rounds"  each station gets fixed length slot (length = pkt trans time) in each round  unused slots go idle  example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle 1 3 4 1 3 4 6-slot frame

22 Data Link Layer 5-22 Channel Partitioning MAC protocols: FDMA FDMA: frequency division multiple access  channel spectrum divided into frequency bands  each station assigned fixed frequency band  unused transmission time in frequency bands go idle  example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time FDM cable

23 Wireless, Mobile Networks 6-23 Code Division Multiple Access (CDMA)  used in several wireless broadcast channels (cellular, satellite, etc) standards  unique “ code ” assigned to each user; i.e., code set partitioning  all users share same frequency, but each user has own “ chipping ” sequence (i.e., code) to encode data  encoded signal = (original data) X (chipping sequence)  decoding: inner-product of encoded signal and chipping sequence  allows multiple users to “ coexist ” and transmit simultaneously with minimal interference (if codes are “ orthogonal ” )

24 Wireless, Mobile Networks 6-24 CDMA Encode/Decode slot 1 slot 0 d 1 = -1 111 1 1 - 1 - 1 -1 - Z i,m = d i. c m d 0 = 1 111 1 1 - 1 - 1 - 1 - 111 1 1 - 1 - 1 -1 - 111 1 1 - 1 - 1 -1 - slot 0 channel output slot 1 channel output channel output Z i,m sender code data bits slot 1 slot 0 d 1 = -1 d 0 = 1 111 1 1 - 1 - 1 -1 - 111 1 1 - 1 - 1 - 1 - 111 1 1 - 1 - 1 -1 - 111 1 1 - 1 - 1 -1 - slot 0 channel output slot 1 channel output receiver code received input D i =  Z i,m. c m m=1 M M

25 Wireless, Mobile Networks 6-25 CDMA: two-sender interference

26 Data Link Layer 5-26 Random Access Protocols  When node has packet to send  transmit at full channel data rate R.  no a priori coordination among nodes  two or more transmitting nodes ➜ “ collision ”,  random access MAC protocol specifies:  how to detect collisions  how to recover from collisions (e.g., via delayed retransmissions)  Examples of random access MAC protocols:  slotted ALOHA  ALOHA  CSMA, CSMA/CD, CSMA/CA

27 Data Link Layer 5-27 Slotted ALOHA Assumptions:  all frames same size  time divided into equal size slots (time to transmit 1 frame)  nodes start to transmit only slot beginning  nodes are synchronized  if 2 or more nodes transmit in slot, all nodes detect collision Operation:  when node obtains fresh frame, transmits in next slot  if no collision: node can send new frame in next slot  if collision: node retransmits frame in each subsequent slot with prob. p until success

28 Data Link Layer 5-28 Slotted ALOHA Pros  single active node can continuously transmit at full rate of channel  highly decentralized: only slots in nodes need to be in sync  simple Cons  collisions, wasting slots  idle slots  nodes may be able to detect collision in less than time to transmit packet  clock synchronization

29 Aloha - Protocol Description  Nodes transmit on a common channel  Transmit frame of fixed length  When two transmissions overlap, they collide  A central node acknowledges the correct frames it receives  When a node does not get an acknowledgment within a specific timeout, it assumes that its frame collided  When a frame collides, the transmitting node schedules a retransmission after a random delay Data Link Layer 5-29

30 Additional assumptions  Slotted system – all packets are of the same length, transmitters are synchronized  Relaxed later  Poisson arrivals and retransmissions  More on that later  Collision or perfect reception  0, 1, e immediate feedback  Retransmission of collided packets  Infinite set of nodes – a new packet arrives at a new node Data Link Layer 5-30

31 Protocol Description  S - the mean number of new packets generated by the infinite population  G - the mean number of transmission attempts (new and old combined)  S = G P 0, where P 0 is the probability that a frame does not suffer a collision Data Link Layer 5-31

32 Data Link Layer 5-32 Link Layer 5.1 Introduction and services 5.2 Error detection and correction 5.3 Multiple access protocols (detour) Poisson Process 5.4 Link-layer Addressing 5.5 Ethernet 5.6 Link-layer switches 5.7 PPP 5.8 Link virtualization: MPLS 5.9 A day in the life of a web request

33 Poisson Distribution (1)  Motivation: “How many soldiers will be killed by a horse kick each day during Napoleon’s war?”.  Key observation:  There are many soldiers, and many days!  These are rare events  Moreover, they ought to be independent Data Link Layer 5-33

34 Poisson Distribution (2)  Imagine you know the average  i.e. you expect to have casualties in a million  Binomial  A simple way is that you look at one million coin toss, each head with probability /1,000,000  The total number of heads is  Poisson distribution, for large n we have Data Link Layer 5-34

35 Poisson Distribution (3)  In practice, n does not need to be huge  Comparison for  n=10, 20, 1000  Poisson is black dot  law of rare events A huge population of very rare ind. events follows Poisson. All you need is the mean to set Data Link Layer 5-35

36 Poisson Process (1)  Many times, you need to look not only at the number but a sequence of events  Arrivals of packets to be transmitted  Failure, death from horsekick  Hence you want to describe a time process  A set of points in line  A process is a random set of points (argh…) Data Link Layer 5-36

37 Poisson Process (2)  3 representations  {t 1, t 2, t 3,…}: the event time  {E 1, E 2, E 3,...} : the inter-events time  The counting measure: N defined on all interval  A process is a random variable which takes value in one of this representation Data Link Layer 5-37

38 Poisson Process (3) Thm: These conditions are equivalent: (i)The process is stationary and “spatial independent” (i)Condition (i) + (ii)The inter-event times {E 1, E 2, E 3,...} are i.i.d. And follows exponential distribution  The process is then called the Poisson Process( ) Data Link Layer 5-38

39 Poisson Process (4)  Why on earth are E i exp. distributed?  Answer: The memoryless property  Prop.: If X is exponentially dist. we have P[X>x+y | X>x] = P[X>y]  This may also be written P[ X-x>y |X>x] = P[X>y] hence on the event X>x, the remaining waiting time X-x follows the same distribution  Hence at any time, the process does not depend on the past, “spatially independent”  Only the exponential distribution satisfies Prop. Data Link Layer 5-39

40 Poisson Process (5)  In summary, the Poisson process is both  The unique one satisfying structural conditions  A process that can be easily characterized … It is hence a fundamental mathematical object  Brownian Motion for continuous evolution  Physics, Biology, Finance (at least pre-2008)  Poisson Process for event based evolution  Engineering, but also History, Social Science Data Link Layer 5-40

41 Properties of Poisson process  Merging property  Imagine I have 3 Poisson process and I construct one that contains all their events.  Prop: It is also a Poisson process!  Splitting property  Imagine that for each event I flip a coin and create two “head” and “tail” processes  Prop.: These are 2 independent Poisson processes Data Link Layer 5-41


Download ppt "Data Link Layer 5-1 Chapter 5 Link Layer and LANs A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students,"

Similar presentations


Ads by Google