5 –Data Link Layer RC –Prof. Paulo Lobato Correia 9 Hop-to-hop Delivery RC –Prof. Paulo Lobato...

download 5 –Data Link Layer RC –Prof. Paulo Lobato Correia 9 Hop-to-hop Delivery RC –Prof. Paulo Lobato Correia 10 Where is the Link Layer Implemented? In each and every host; Link layer

If you can't read please download the document

  • date post

    20-May-2018
  • Category

    Documents

  • view

    213
  • download

    0

Embed Size (px)

Transcript of 5 –Data Link Layer RC –Prof. Paulo Lobato Correia 9 Hop-to-hop Delivery RC –Prof. Paulo Lobato...

  • 1

    Redes de Computadores

    LEIC-A, MEIC-A

    5 Data Link Layer

    Prof. Paulo Lobato CorreiaIST, DEEC rea Cientfica de Telecomunicaes

    RC Prof. Paulo Lobato Correia 2

    Objectives

    Understand principles behind data link layer services:

    Link layer addressing

    Error detection and correction

    Sharing a broadcast channel: multiple access

    Reliable data transfer, flow control (done)

    Instantiation and implementation of

    various link layer technologies

  • 2

    RC Prof. Paulo Lobato Correia 3

    Outline

    Introduction and services

    Link-layer addressing

    Error detection and correction

    Multiple access protocols

    Ethernet

    Link-layer switches

    IEEE 802.11 Wireless LANs

    Framing

    RC Prof. Paulo Lobato Correia 4

    Link Layer: Introduction

    Some 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.It encapsulates a datagram.

    Data link layer has the responsibility of transferring datagrams

    from one node to the adjacent node over a link

  • 3

    RC Prof. Paulo Lobato Correia 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 reliable data transfer over link.

    Transportation analogy Trip from Oeiras to Rennes:

    bus: Oeiras to Lisboa plane: Lisboa to Paris train: Paris to Rennes.

    Tourist = datagram

    Transport segment = communication link

    Transportation mode = link layer protocol

    Travel agent = routing algorithm

    RC Prof. Paulo Lobato Correia 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, destination:

    Different from IP address!

    Reliable delivery between adjacent nodes:

    Similar solutions to those adopted in transport layer;

    Seldom used on low bit-error links (fiber, some twisted pair);

    Wireless links: high error rates.

    Q: Why both link-level and end-end reliability?

  • 4

    RC Prof. Paulo Lobato Correia 7

    Link Layer Services

    Flow control:

    Pacing between adjacent sending and receiving nodes;

    Error detection:

    Errors caused by signal attenuation and 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.

    RC Prof. Paulo Lobato Correia 8

    Link Layer

    The link layer deals with data transfer between a host and a router, or between two routers, belonging to the same network.

    Data link layer tasks:

  • 5

    RC Prof. Paulo Lobato Correia 9

    Hop-to-hop Delivery

    RC Prof. Paulo Lobato Correia 10

    Where is the Link Layer Implemented?

    In each and every host;

    Link layer implemented in the adaptor (aka network interface card - NIC):

    Ethernet card, PCMCI card, 802.11 card;

    Implements link, physical layer.

    Attaches into hosts system buses;

    Combination of hardware, software, firmware.

    controller

    physicaltransmission

    cpu memory

    host

    bus

    (e.g., PCI)

    network adapter

    card

    host schematic

    applicationtransportnetwork

    link

    linkphysical

  • 6

    RC Prof. Paulo Lobato Correia 11

    Adaptors Communicating

    Sending side:

    Encapsulates datagram in frame;

    Adds error checking bits, flow control, etc.

    Receiving side:

    Looks for errors, flow control, etc;

    Extracts datagram and passes it to the upper layer at the receiving side.

    controller controller

    sending host receiving host

    datagram datagram

    datagram

    frame

    RC Prof. Paulo Lobato Correia 12

    Outline

    Introduction and services

    Link-layer Addressing

    Error detection and correction

    Multiple access protocols

    Ethernet

    IEEE 802.11 Wireless LANs

    Link-layer switches

    Framing

  • 7

    RC Prof. Paulo Lobato Correia 13

    Link-Layer Addressing

    IP address Network Layer:

    Used to get datagram to the destination IP subnet;

    32-bit IP address;

    Hierarchical;

    Not portable.

    MAC (or LAN or physical) address Data Link Layer: Function: get frame from one interface to another physically-

    connected interface (in the same network);

    48 bit MAC address (for most LANs):

    Burned in NIC ROM; Sometimes adjustable by software;

    Portable;

    RC Prof. Paulo Lobato Correia 17

    MAC Addresses

    Each adapter on a LAN has a unique MAC address

    Broadcast address =FF-FF-FF-FF-FF-FF

    = adapter

    1A-2F-BB-76-09-AD

    58-23-D7-FA-20-B0

    0C-C4-11-6F-E3-98

    71-65-F7-2B-08-53

    LAN(wired orwireless)

  • 8

    RC Prof. Paulo Lobato Correia 19

    To deliver frames the physical (MAC) address of the host needs to be known.

    ARP allows to get the MAC address from the IP address.

    Address Resolution Protocol (ARP)

    RC Prof. Paulo Lobato Correia 25

    Outline

    Introduction and services

    Link-layer Addressing

    Error detection and correction

    Multiple access protocols

    Ethernet

    Link-layer switches

    IEEE 802.11 Wireless LANs

    Framing

  • 9

    RC Prof. Paulo Lobato Correia 26

    Origin Cause PreventionLine break Storms, accidents

    White noise Electron motion Raise signal level

    Impulsive noise Lightening, voltage changes, car ignition, ...

    Isolate or move wires

    Cross-talk Guard bands too small,Wires too close

    Increase guard band or isolate wires

    Eco Bad quality connections Fix or adjust equipment

    Loss/attenuation Signal intensity decreases with distance

    Use repeaters or regenerators

    Intermodulation noise

    Combination of signals with different origins

    Isolate or move wires

    Jitter Phase changes in the signals Adjust the equipments

    Harmonic distortion

    Non-linear amplification in frequency Adjust the equipments

    Why are there Transmission Errors?

    RC Prof. Paulo Lobato Correia 27

    Error Examples

  • 10

    RC Prof. Paulo Lobato Correia 28

    Error Types

    Error types:

    Isolated:

    Burst:

    RC Prof. Paulo Lobato Correia 29

    Error Detection

    Error detection:

    Uses redundancy bits are added to allow error detection in the receptor;

  • 11

    RC Prof. Paulo Lobato Correia 30

    Error Detection

    Methods:

    Vertical redundancy check (VRC) one parity bit is added to each data unit, to ensure that the total number of 1s is even (or odd);

    Longitudinal redundancy check (LRC) or Two Dimensional Bit Parity a block of bits is divided into lines and a redundant line is added to the complete block;

    Cyclic redundancy check (CRC) a set of additional bits, computed from the division by a generator polynomial known by the sender and the receiver.

    RC Prof. Paulo Lobato Correia 31

    Error Detection: VRC

    Does not detect an even number of bits in error;

    A substantial overhead is introduced; example: 1/8 = 12.5%.

  • 12

    RC Prof. Paulo Lobato Correia 32

    Error Detection: LRC Two Dimensional Bit Parity

    RC Prof. Paulo Lobato Correia 33

    Detect and correct single bit errors:

    0 0

    Error Detection: LRC Two Dimensional Bit Parity

  • 13

    RC Prof. Paulo Lobato Correia 34

    Error Detection

    EDC Error Detection and Correction bits (redundancy)

    D Data protected by error checking, may include header fields

    Error detection is not 100% reliable!

    Protocol may miss some errors, but rarely;

    Larger EDC field yields better detection and correction.

    RC Prof. Paulo Lobato Correia 36

    Cyclic Redundancy Check (CRC)

    Widely used in practice (Ethernet, 802.11 WiFi, ATM).

  • 14

    RC Prof. Paulo Lobato Correia 37

    Error Detection: CRC

    Uses a generator polynomial G(x), of degree n;

    A message with m bits is viewed as a polynomial M(x) of degree lower than m;

    CRC computation:

    Dividend is xn.M(x);

    Divisor is G(x);

    Modulo 2 division (exclusive or) produces a remainder R(x), of degree lower than n;

    The transmitted message is T(x) = xn.M(x) + R(x); Note that T(x) is divisible by G(x);

    Error detection:

    If the received message is divisible by G(x) then no error are detected.

    RC Prof. Paulo Lobato Correia 46

    CRC: Example

    M(x) = x7 + x4 + x3 + x1

    (mensagem)

    G(x) = x3 + x2 + 1(polinmio gerador)

    x3 . M(x) = x10 + x7 + x6 + x4

    (dividendo)

    R(x) = x2 + 1(resto)

    T(x) = x3 . M(x) + R(x) = x10 + x7 + x6 + x4 + x2 + 1(mensagem transmitida incluindo CRC)

    1101 (n = 3)

    1001 1010 (m=8)

    100 1101 0000

    101

    10011010101

    10011010000 1101110