+ All Categories
Home > Documents > Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame...

Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame...

Date post: 22-Jan-2021
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
25
Physical and Data Link layers Youki Kadobayashi Graduate School of Information Science Nara Institute of Science and Technology Physical Layer Copyright(C)2015 Youki Kadobayashi. All rights reserved. 2 15/05/01
Transcript
Page 1: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Physical and Data Link layers

Youki Kadobayashi Graduate School of Information Science�

Nara Institute of Science and Technology

Physical Layer�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 2 15/05/01

Page 2: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Types of transmission medium�! Cables�

–  Optical fiber�

–  Copper�

! Wireless�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 3�

Source: siemon.com�

Source: blackbox.com�

Cables and connectors�! Copper�

–  UTP –  STP

! Connectors�–  RJ45 –  RJ11

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 4�

! Optical fibers�–  Single mode fiber�–  Multimode fiber

! Connectors�–  LC, SC, FC, MT-RJ…

RJ45 connector. Source: flukenetworks.com�

Source: aisan.co.jp�

Source: aisan�

Source: aisan�

Page 3: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Cable speed, distance and cost�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 5�

Speed� Medium� Distance� Cost�10Gbit/s� Optical (SMF)� 10 km� $$$�10Gbit/s� Copper� 10 m� $$�1Gbit/s� Optical (MMF)� 550 m� $$�1Gbit/s� Copper� 100 m� $�1Mbit/s� Copper� 4 km� $�

Source: cable360.net�

Physical characteristics: a crude comparison�

! 54Mbit/s in wireless cannot be delivered as advertised, whereas 1Gbit/s in optical fiber can be delivered as advertised.�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 6�

Copper� Fiber� Wireless�

Attenuation� XX� XXXX�

Attenuation distortion� X� X� XX�

Noise� XX� X� XXXX�

Bend� XX�

Chromatic dispersion� X� XXXX�

Crosstalk� XX� XXXX�

EM interference� XX� XXXX�

Echo� XX� XXXX�

Page 4: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Basics of protocol�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 7 15/05/01

Computer and network�! Computer�! Network interface�! Protocol�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 7�

ihihhiiihhi

ihihhiiihhi hiiiiiih end bit pattern start bit pattern hiiiiiih

Page 5: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Fundamental aspect of network: Protocol�! 3 major elements of protocol�

–  Finite State Machine�–  Message�–  Timer�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 8�

a� b�

c� d�

α�

β�

γ�

δ�ε�

Basic constructs of protocol�! Main goalj0Transmission, recovery from errors�

! Message�–  Header, trailer�–  Error detection�–  Sequence number�–  Acknowledgement�

! State machine�–  Negotiation�–  Retransmission�–  Error recovery�

! Timer�–  Timeout�

15/05/01� Copyright(C)2015 Youki Kadobayashi. All rights reserved.� 21�

Header�

Data�

Trailer�

Error detection�Sequence number�

Acknowledgement�

Page 6: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Data Link Layer�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 11 15/05/01

Data Link Layer Services overview�! 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 ! Flow Control:

–  Pacing between adjacent sending and receiving nodes ! Error Detection:

–  Errors caused by signal attenuation and noise –  Receiver detects presence of errors

! 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�

15/05/01 Copyright(C)2015 Youki Kadobayashi. All rights reserved. 12

Page 7: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Frame ! Data link layer Protocol Data Unit (PDU)

–  Defining the frame borders (delimiters)

! Can determine if any failures (bit errors) occured –  Adding error-detection / error-correction code to bit

sequences in order to delimit the appropriate frame length

! Frame header –  error detection and flow control –  control information�

15/05/01 Copyright(C)2015 Youki Kadobayashi. All rights reserved. 13

01111110 address control data 01111110 checksum

header payload

Information Network 1 / 2013

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 14

Frame Synchronization ! Bit-sequence-based frame synchronization

–  A special bit sequence is inserted to the data header and footer.

•  synchronization –  Insertion of a bit sequence composed of the “same” bit

•  bit stuffing –  special bit sequence only appears at the frame header and footer

–  e.g. •  special bit sequencej 01111110 •  if sender detects “11111” in data, it “stuffs” a “0” right after. •  if receiver detects “11111” in data, it deletes the following

stuffed “0”. 01111110 address control data 01111110 checksum

Information Network 1 / 2013 15/05/01

Page 8: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Errors in Physical Layer�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 15

Noise�

Attenuation�

Distortion�

Information Network 1 / 2013 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 16

Error Control�! Goal

–  Detecting and correcting transmission error in channel •  Was the frame correctly sent? •  Was the frame sequence order correct?

! Techniques –  Introducing the concept of frame (failure localization) –  Coding techniques

•  Error Correction Code •  Error Detection Code – Parity, CRC (Cyclic redundancy check)

–  Protocol techniques •  Timer •  Retransmission

Information Network 1 / 2013 15/05/01

Page 9: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Basic idea of CRC�! Given:

–  Generator polynomial G(x), of degree r (r < m)‏ –  Polynomial expression of m bit frame M(x) (degree m-1)

! Compute: –  prepare xrM(x): frame with r zeros –  Compute modulo of xrM(x) divided by G(x): R(x) –  Frame for transmission: F(x)

•  F(x) = xrM(x) + R(x)

! Successul transmission: F(x) / G(x) = 0 –  Nonzero otherwise. i.e., error detection. –  Consecutive errors less than r bits can be detected�

15/05/01 Copyright(C)2015 Youki Kadobayashi. All rights reserved. 17

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 18

Standardized CRC polynomials ! Commonly known standards

–  CRC-12 •  x12+x11+x3+x2+x+1

–  CRC-16 •  x16+x15+x2+1

–  CRC-32 •  x32��26��23��22��16��12���11��10��8��7���5��4��2����

–  CRC-CCITT •  x16+x12+x5+1

! There are many other error detection codes.�

Information Network 1 / 2013 15/05/01

Page 10: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 19

Questions?�

Information Network 1 / 2013 15/05/01

Flow Control�! Flow Control Protocols deal with how to send

sequences of frames ! They have two goals:

–  Recover from lost frames –  Prevent buffer overflows

! Network Layer may want to receive same set of frames in the same order they were sent

! Automatic Repeat Request (ARQ) –  Stop-and-wait –  Go-back-N –  Selective-repeat

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 20 Information Network 1 / 2013 15/05/01

Page 11: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 21

Stop-and-wait ARQ (1)

t1 t2 t3

t4

t5 t1 Sender

Receiver

t1: Round Trip Time t2: Frame Transmission Time t3: Frame Processing Time t4: ACK Transmission Time t5: ACK Processing Time�

Information Network 1 / 2013 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 22

Stop-and-wait ARQ (2) ! Procedure

–  Waiting to receive ACK on each frame transmission

–  Setting a sender timer greater than 2t1+t2+t3+t4

–  Retransmission when sender timer times out.

! Characteristics –  Simple –  The buffer never contains more than

one frame for the receiver and the sender

–  Very low utilization of channel capacity

Information Network 1 / 2013 15/05/01

Page 12: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 23

Go-back-N ARQ

1 6 5 3 4 5 4 3 2

1 6 5 3 4 5 4 2

Time out for Frame3�

!!

Information Network 1 / 2013 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 24

Selective-Repeat ARQ

1 8 7 3 6 5 4 3 2

1 8 7 3 6 5 4 2

Time out for Frame3�

!!

Information Network 1 / 2013 15/05/01

Page 13: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

ARQ: simplicity vs efficiency, adaptability�! Stop-and-Wait

–  Simple –  No large buffer required in both ends

! Go-back-N –  Still simple, but buffer management has to be done at

SENDER. –  N means the buffer size –  There is no large buffer required at RECEIVER side.

! Selected Repeat –  Complicated scheme that requires buffer, timer, and ACK

managements. –  Buffers are required in both ends. –  Window Flow Control is needed for buffer management.

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 25 Information Network 1 / 2013 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 26

Window Flow Control for selective-repeat ARQ

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 …

sent frame� sendable framedmaximum size W)

already received ACK�

last sent frame� if sent move to right

If ACK is received move to right�

keep frame until ACK is received�

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 …

received frame� receivable framedmaximum size W)

already transmitted ACK�

last received frame�if received move to right�

if ACK is sent move to right

Sender

Receiver

15/05/01

Page 14: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 27

Burden sharing among layers�! Assignment of function depends on communication

system designs ! Various solutions exist�

Data Link

Network

Transport sequence assurance flow control retransmission interconnection of network error detection and correction frame boundary�

Information Network 1 / 2013 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 28

Questions?�

Information Network 1 / 2013 15/05/01

Page 15: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 29

Sublayers of the Data Link Layer�

Physical Layer

Data link Layer

Network Layer

CCITT X.25 (HDLC/LAPB)

Media Access Control Sublayer

8802/2 LLC

8802/3 CSMA/CD

8802/5 Token Ring

8802/4 Token Bus

Logical Link Control Sublayer

ISO/OSI Local Area Network Definitions (8802)

CCITT Data link Layer Definition

Information Network 1 / 2013 15/05/01

Media Access Control (MAC) (1)�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 30

Data link layer provides packet send/receive service to network layer

Physical Layer provides binary send/receive to data link layer

Different media have different constraints about multiple nodes

accessing the medium

15/05/01

Page 16: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Media Access Control (MAC) (2)�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 31

MAC layer provides medium access service to the data link layer

A separate protocol is needed to implement the service for each different transmission medium

Subsequent slides: learn about channel allocation (multiplexing)�

15/05/01

Access Channel�! 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) •  Traditional Ethernet •  802.11 wireless LAN

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 32 Information Network 1 / 2013 15/05/01

Page 17: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

MAC Protocols (1)�! Single shared broadcast channel

–  Two or more simultaneous transmissions can interfere with each other

–  Collision will be observed whenever node receives two or more signals at the same time

! Ideal Media Access Protocol –  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 –  Fully decentralized:

•  No special node to coordinate transmissions •  No synchronization of clocks, slots

–  Simple

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 33 Information Network 1 / 2013 15/05/01

MAC Protocols (2)�Three techniques: ! 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 –  Nodes with more to send can take longer turns

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 34 Information Network 1 / 2013 15/05/01

Page 18: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Controlled or Contention?�! Controlled assignment of partitioned channel is for

higher efficient channel occupying (high throughput) –  TDMA (time), FDMA (frequency), WDM (wave length) –  Code Divided Multiple Access (CDMA)

! Contention type (random access) has its long history, but CSMA/CD with binary back-off is the final answer. –  Pure ALOHA, Slotted ALOHA

•  classic & primitive form of random access –  CSMA, CSMA/CD, CSMA/CD with binary back-off (Ethernet)

•  More complicated form for avoiding unnecessary collisions. •  Carrier Sense is pre-action, Collision Detection is post-action.

–  CSMA/CA (Collision Avoidance) •  More aggressive way to manage channels, WiFi.

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 35 Information Network 1 / 2013 15/05/01

MAC Throughput Performance�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 36 Information Network 1 / 2013 15/05/01

Page 19: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 37

Questions?�

15/05/01

Evolution of data link technologies�! Wide bandwidth

!  Large scale

!  Virtualization

! Coverage expansion�

!  Switched media

!  Bridges

!  VLAN

!  Broadband wireless, residential access, etc.

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 38 15/05/01

Page 20: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

LAN performance secrets: shared media → switched media ! High-bandwidth and commodity LAN ! Effectively a channel partitioning scheme

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 39

medium

access

Non-blocking crossbar switch

15/05/01

Wireless LAN performance secrets�! Wireless LAN performance will lag behind forever ! Wireless LAN remains to be shared media

–  Significantly slower, error prone –  “crowded cocktail party” -- Don’t expect same performance�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 40

Switched media Ethernet

1996 1998 2000 2002 2004 2006

Voice Video (MPEG2)

Video (D1)

Video (MotionJPEG)

Video (HD D1)

Voice Video (MPEG2)

Video (MotionJPEG)

Shared media Wireless LAN

15/05/01

Page 21: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Large scalej Bridges ! Compatibility between physical limitations and LAN

convenience –  Coverage, capacity

15/05/01 Copyright(C)2015 Youki Kadobayashi. All rights reserved. 41

Wiring between buildingsjoptical fiber d�5kme�

Wiring in floorjcoax d�100me�

Bridge basics: Transparent bridge ! Host is not aware of the bridge ! Transparent bridge

–  No modification of MAC frame –  Promiscuous: capture all flowing packets –  Administrator builds the bridge forwarding table�

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 42

A

B

C

D

E

F

G

H

Transparent bridge

1 2

Fwd to 1 A, B, C, D Fwd to 2 E, F, G, H

15/05/01

Page 22: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Learning Bridge�! Dynamic adaptation for topology changes & traffic

loop avoidance. –  “Frame forwarding tables” in bridges are maintained for

optimizing the flow: •  Any frame to unknown MAC addresses is forwarded, and the

table is updated for “unknown” MAC. •  Any frame to known MAC addresses is forwarded if necessary. •  Spanning Tree Protocol (STP) is now very common for 802.3

families to avoid traffic loop. –  Exchanging data between bridges to form a singe spanning tree

as their forwarding route. –  Today: improved protocol called RSTP (Rapid STP).

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 43 15/05/01

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 44

Questions?�

Information Network 1 / 2013 15/05/01

Page 23: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

Summary�! Basic ideas of Data Link Layer

! Many simple but effective scheme to obtain good performance –  Error control, flow control –  Media access control (MAC) –  Switched media & learning bridge –  Ethernet families

Copyright(C)2015 Youki Kadobayashi. All rights reserved. 45 Information Network 1 / 2013 15/05/01

Assignment III

Page 24: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

1.  Given: a.  Message: ‘Aloha’ (without the apostrophe)

(www.asciitable.com)

b.  Generator polynomial : 1+X+X3+X4+X8

Show how CRC-8 works on sender and receiver side

1.  Do you think the CRC method is foolproof? Please elaborate.

2.  On selecting the best generator polynomial, what is your recommendation?

Guidelines for submitting the assignments

bDeadline: 5/8 (Fri) 23:59 bFile Naming: Name_StudentID bPreferred File Format: PDF bLength: at most 2 pages bLanguage: English/Japanese bSend to: [email protected]

Page 25: Physical and Data Link layers - NAISTData link layer Protocol Data Unit (PDU) – Defining the frame borders (delimiters) ! Can determine if any failures (bit errors) occured – Adding

&/I 1.  `[ZcY: ’Aloha’(‘U,?��LO)

(www.asciitable.com) ���-�: 1+X+X3+X4+X89HAD� CRC-8=(��f���GILR;K��BT< Cg

2.  CRCM��G�.G>TH�;<g$'AJ@: 3.  ���-�U*�BTHAFf)�JQLMJK<'NJ@:g

&/��KE:F

b!P�S: 5/8 (+) 23:59 b��]VWa : _��ID b��]VWa]Xc_[\: PDF b^cY�: ��2^cY b#%: "%/��% b���: [email protected]


Recommended