Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of...

76
Hierarchical architecture & physical and datalink layers Yuzo Taenaka Laboratory for Cyber Resilience, NAIST

Transcript of Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of...

Page 1: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Hierarchical architecture &

physical and datalink layers

Yuzo Taenaka

Laboratory for Cyber Resilience, NAIST

Page 2: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Lecture schedule

Day Topic Day Topic

(1)Jun

5

Course Overview, Internet

Architecture(5)

July

3Transport Layer

(2)Jun

12

Physical Layer and Data

Link Layer(6)

July

17

Upper Layer Protocols

and Application

(3)Jun

19Network Layer (7)

July

24Network Management

(4)Jun

26Routing (8)

July

31Exam

● 2nd period 11:00 – 12:30

– Lecture plus some Hands-on by TAs

Please bring your PC and make sure you check the

instructions provided on:

https://iplab.naist.jp/class/2019/

Internet Engineering / 2019

Page 3: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Agenda

1. Overall architecture of the Internet

2. Physical layer

3. Datalink layer

4. Hands-on by TA

Internet Engineering / 2019 3

Page 4: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

The Internet

Packet switching on a best effort basis

Distributed system

– No special node to coordinate transmissions

– Autonomous

Modular system

– Replacable

• E.g., IPv4 → IPv6

Internet Engineering / 2019 4

Input A output B

Function 1

Input A output B

Function 2

Page 5: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

The Internet architecture

Hierarchical protocol architecture

– TCP/IP protocol (4 layers)

• 1970s~1980s

• Involving multiple protocols

• Designed for implementation

Another hierarchical protocol architecture

– OSI 7 layer reference model

• Just a conceptual model. But this reference model provides

common basis of the computer network.

Internet Engineering / 2019 5

Page 6: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

OSI 7 Layer Reference Model

Application

Presentation

Session

Transport

Network

Data Link

Physical

HTTP

MIME

TLS

TCP

IP

IEEE802.3

Ethernet Coax

ES (End System) ES (End System)

IS (Intermediate System)

Physical connection Physical connection

6

Page 7: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

The Internet architecture

Internet Engineering / 2019 7

Application

Presentation

Session

Transport

Network

Data Link

Physical

OSI 7 layer

Application

Transport

Network

TCP/IP model

Network

interface layerJune 12 (Today)

June 19 and 26

July 3

July 17

July 24

Page 8: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 8

OSI 7 Layer Reference Model

Layer n+1

Layer n

Layer n-1

n-SAP (Service Access Point)

Layer n

n-PDU (Protocol Data Unit)

n-PDU = Header + SDU (Service Data Unit)

Peer entity

Layer n-1

Page 9: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Encapsulation

Application

Presentation

Session

Transport

Network

Data Link

Physical

– Lower-level protocol encapsulates a packet of upper-level

protocol

– (n-1) PDU = (n-1) header + (n)PDU

– stores upper layer packet in the data area

9

Page 10: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Multiplexing / Demultiplexing

Application

Presentation

Session

Transport

Network

Data Link

Physical

FTP

TCP

IPv4

IEEE802.3 Ethernet

CAT/5 cable

UDP

DNS

IPv4

= layer N is multiplexing/demultiplexing layer N+1

protocols

10

IPv6

FTP

TCP

IPv6

UDP

DNS

Multiplexing Demultiplexing

Page 11: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Physical Layer

= Physical Layer (Layer 1)

= Transmission procedures for “bits” over

communication media

– procedure of bit transmission between nodes

– e.g.

• electrical signal level (e.g. 0: < +0.5v, 1 > 3.7v)

• procedure of bit transmission (e.g. synchronization, error

detection…)

= Defined and bound with each communication media

– Fit to their characteristics and attributes.

– Normally, treated as a set of physical and data link layers.

11

Page 12: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Data Link Layer (1)

= Data Link Layer (Layer 2)

= Transmission procedure for data chunk over the

communication media.

– Working with the physical layer.

– “frame”: bit sequence with its structure

• data transmission unit

– Contention and coordination with multiple nodes in a single

communication media.

= Standard elements

– identification in communication media

– frame format

– access procedure (MAC sub-layer)

12

Page 13: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Data Link Layer (2)

= Many standards

– Data exchange procedure by digital leads lines (HDLC)

– IEEE802.x series

• Ethernet 802.3

• Token Ring 802.5 (historic)

• WiFi 802.11

– Define as a DLL (e.g. ISDN…)

• I.100 series includes call procedure and data frame definitions

= Each data link layer is normally defined with its

specific physical layer.

– physical channel and transmission procedure are tightly

coupled.

13

Page 14: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Network Layer (1)

= Network Layer (Layer 3)

= Data exchange functions, which is independent from

some specific data links.

– define communication between ES’s (End Systems)

– address assign for nodes

– gateway function implement as an IS (Intermediate System)

– definition of packet

• Unit of data transmission in the network layer

14

Page 15: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Network Layer (2)

= Standard elements

– Format of ES and IS addresses / identification.

– Packet format

– Routing mechanism of packet switching.

– Broadcast / multicast / anycast

15

Page 16: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Transport Layer (1)

= Transport Layer (Layer 4)

= Communication between the processes in the

network

– Multiple processes exist in ES

– Process = service provider and consumer

– fundamental protocol for process

– using common transport protocol in network

• communicating ESes uses common transport protocol

16

Page 17: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Transport Layer (2)

= Functions of transport layer

– provides more usable communication service than a packet

switching done in Network layer.

– Define End-to-End communications

– Error and flow controls using retransmission of packets

– error handling is embedded.

17

Page 18: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Upper Layer Protocols

= Protocols in session, presentation and application

layers are called “Upper Layer Protocol”

– Definition for each specific application / service

– Implementation of the various requirements by network

applications

18

Page 19: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Session Layer

= Define unit of communication

– Transaction

– Session

= Define process for communication unit

– Transaction Logging & Roll-back operation

– Session Termination

19

Page 20: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Presentation Layer

= The expression of data

– Provides a basis of expression of data properly in different

platforms

– Decimal number “1” can be encoded in multiple ways.

• expression of “1”

– How many byte use?

» 1, 2, 4, less than 1 byte (6 bits), ….

– How to go about byte order?

» Little Endian / Big Endian

– How to go about bit order before transmission?

» MSB first, LSB first

20

Page 21: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019

Application Layer

= Protocols for applications

– They do not define the applications; interface is defined.

– e.g., HTTP (hyper text transport protocol) for web browsing

– e.g., SMTP (simple mail transfer protocol) for e-mail,

with many e-mail applications that interoperate.

• Server: sendmail, qmail, postfix, etc….

• Client: Mozilla Thunderbird, MS/Outlook, etc….

21

Page 22: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Roles of layers: a cheat sheet

Internet Engineering / 2019

Layer Role

Application Protocols of Applications

Presentation Machine independent but application specific expression of data.

Session Application specific of “form” of communication.

Transport Communication between the processes running on the nodes in the

network, but as a common platform. Connection is the major concept

in this layer.

Network Data exchange functions, which is independent from some specific

data links.

End-to-end communication mechanism over networks interconnected.

The “packet” is a container for data to be exchanged.

Datalink Transmission procedure for data chunk (“frame”) over a single

communication media.

Define this layer tightly with Physical layer (L1)

Physical Fundamental Transmission procedures for “bits” over communication

media.

22

Page 23: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Physical Layer

(Lower part of network interface layer)

Internet Engineering / 2019 23

Application

Presentation

Session

Transport

Network

Data Link

Physical

OSI 7 layer

Application

Transport

Network

TCP/IP model

Network

interface layer

Page 24: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Types of transmission media

Cables

– Optical fiber

– Copper

Wireless

Internet Engineering / 2019 24

Source: siemon.com

Source: blackbox.com

Page 25: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Cables and connectors

Copper

– UTP

– STP

Connectors

– RJ45

– RJ11

Internet Engineering / 2019 25

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 26: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Cable speed, distance and cost

Internet Engineering / 2019 26

Speed Media Distance Cost

10Gbit/s Optical (SMF) 10 km $$$

10Gbit/s Copper 100 m $$

1Gbit/s Optical (MMF) 550 m $$

1Gbit/s Copper 100 m $

1Mbit/s Copper 4 km $

Source: cable360.net

Page 27: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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.

Internet Engineering / 2019 27

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 28: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Role of physical layer

Transmit every “bits” by by electrical signal, radio

wave, or something that could carries 0/1 values.

– Convert a bit into an signal(s)

– Sent the signal on the analog media

Be not in charge of access control

– Do not care about when to send a bit

→ high possibility to collide → role of datalink layer

Internet Engineering / 2019 28

Physical

0 1 0 1 0 1 0 1 0 0

Physical

0 1 0 1 0 1 0 1 0 0

Host A Host B

Page 29: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Example of encoding bits

Manchester code (phase encoding)

– IEEE 802.3 (10base-T / 10Mbps)

– A transition of electric voltage indicates 0 or 1

Internet Engineering / 2019 29

low → high

= 1

high → low

= 0

Page 30: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

More detail

take the lectures

– Principles of Signal Processing (3003)

• https://syllabus.naist.jp/subjects/preview_detail/222

• Prof. Kato

– Wireless Communication Systems (4015)

• https://syllabus.naist.jp/subjects/preview_detail/264

• Prof. Okada

– Signal Detection Theory (4016)

• https://syllabus.naist.jp/subjects/preview_detail/265

• Prof. Okada

Internet Engineering / 2019 30

Page 31: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Data Link Layer

(Higher part of network interface layer)

Internet Engineering / 2019 31

Application

Presentation

Session

Transport

Network

Data Link

Physical

OSI 7 layer

Application

Transport

Network

TCP/IP model

Network

interface layer

Page 32: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Central concept of data link layer

To deliver a PDU (protocol data unit) to a destination

– Need to identify a destination

→ Framing

– Encapsulate datagram into frame, adding header, trailer

Internet Engineering / 2019 32

Data Link

Physical Physical

PDUheaderPDUheader

Data Link

This is for me

PDU PDUHost A Host B

Page 33: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Frame (Example of DIX Ethernet)

Data link layer Protocol Data Unit (PDU)

– Defining the frame borders (delimiters)

Can determine if any failures (bit errors) occurred

– 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

Internet Engineering / 2019 33

01111110 address control data 01111110checksum

header payload

Information Network 1 / 2016

Page 34: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 34

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 sequence: 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 01111110checksum

Information Network 1 / 2016

Page 35: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Ethernet frame

A frame (DIX Ethernet) captured by wireshark

(introduced in today’s hands-on)

Internet Engineering / 2019 35

Page 36: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 36

Sublayers of the Data Link Layer

Physical Layer

Data link Layer

Network Layer

Media Access

Control Sublayer

802.2 LLC

802.3

CSMA/CD

802.5

Token Ring

802.4

Token Bus

Logical Link

Control Sublayer

IEEE standard 802

Information Network 1 / 2016

802.11

Wireless LAN

CCITT X.25

(HDLC/LAPB)

CCITT Data link

Layer Definition

Page 37: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Data Link

Separation of Media Access Control

(MAC)

Internet Engineering / 2019 37

IP (network)

802.3

MAC

Ethernet WLAN

Different media have different

constraints about multiple nodes

accessing the media

A separate protocol is needed to

implement the service for each

different transmission media

Physical Layer provides binary

send/receive to data link layer

Data link layer provides packet

send/receive service to network

layer

LLC

802.11

MAC

Page 38: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Examples of MAC

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 wireless)

• Traditional Ethernet

• 802.11 wireless LAN

Internet Engineering / 2019 38Information Network 1 / 2016

Page 39: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Media Access Control (MAC) sublayer

Internet Engineering / 2019 39

Page 40: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Coverage of MAC sublayer

Internet Engineering / 2019 40

Application

Presentation

Session

Transport

Network

Data Link

Physical

ES (End System)

Physical connection

Physical

signal → bits

Area where a electrical signal reaches

Data Link

MAC

LLC

Page 41: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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

Internet Engineering / 2019 41Information Network 1 / 2016

Page 42: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

MAC Protocols (2)

Control-based MAC

– Channel Partitioning

• Divide channel into smaller “pieces” (time slots, frequency,

code)

• Allocate piece to node for exclusive use

– Taking turns

• Nodes take turns

• Nodes with more to send can take longer turns

– Synchronization & coordination required

Contention-based MAC

– Random Access

• Channel not divided, allow collisions

• “Recover” from collisions

– Fully distributed

Internet Engineering / 2019 42Information Network 1 / 2016

Page 43: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Control-based MAC (1) :

Channel Partitioning

TDMA (Time division multiple access)

– Each node occupy channel at a specific time slot

Internet Engineering / 2019 43

Time

Node A Node B Node C

Page 44: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Control-based MAC (2) :

Channel Partitioning

FDMA (Frequency division multiple access)

– Allocate frequency to a node

Internet Engineering / 2019 44

Time

Frequency

Node A

Node B

Node C

Page 45: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Contention-based MAC (1): ALOHA

Pure ALOHA (1970s) at Hawaii Univ.– Wireless communication

How to communicate– Outlying station transmits a packet on the inbound frequency

– The central transmitter repeats the transmission on the outbound frequency (which all stations can receive)

– If a copy of its packet arrives, the sending station moves to the next packet; if no copy arrives, the sending station waits a random period and tries again.

Internet Engineering / 2019 45

Computer Networks & Internets: Douglas E. Comer

Page 46: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Contention-based MAC (2): CSMA

Carrier Sense Multiple Access– Sensing carriers to determine whether the media is busy (or

free) before sending a frame

Variants– Non-persistent CSMA

• Send immediately if free. Otherwise, exponential backoff (wait for randomly determined period)

– 1-persistent CSMA

• Send immediately if free. Otherwise, send immediately after channel becomes free

• Used in old Ethernet

– p-persistent CSMA

• Send in probability p if free. Otherwise, send in same probability after channel becomes free

Internet Engineering / 2019 46

Page 47: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Contention-based MAC (3):

Collision Detection/Avoidance

CSMA/CD

– For Ethernet (but going to be not used)

– terminate transmission as soon as a collision is detected

even while transmitting

CSMA/CA

– For Wireless LAN (still important mechanism)

– Deferring transmission for a random interval if the channel is

busy

CSMA/CA with RTS/CTS

– Channel reservation mechanism by interaction of request-to-

send frame and clear-to-send (approved) frame

Internet Engineering / 2019 47

Page 48: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

CSMA/CD (simplified)

Internet Engineering / 2019 48

Host ACarrier sense

Host A

Host A Other signal

transmit

Collision

detection Nothing happens

= success

Wait for a

random period

Page 49: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

CSMA/CA (simplified)

Internet Engineering / 2019 49

Host ACarrier sense

Host A

Host A Other signal

transmit

Collision avoidance

With ACK

= success

Wait for a

random periodwithout ACK

= failed

Wait for a

random period

Page 50: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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.

Internet Engineering / 2019 50Information Network 1 / 2016

Page 51: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Logical Link Control (LLC) sublayer

Internet Engineering / 2019 51

Page 52: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Coverage of LLC sublayer

Internet Engineering / 2019 52

Application

Presentation

Session

Transport

Network

Data Link

Physical

ES (End System)

Physical connection

Physical

Area where a frame is demultiplexed

Data Link

MAC

Physical

MAC

LLC

Network

Data Link

Physical

Extract PDU

from a frame

Page 53: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Data Link Layer (LLC) Services overview

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

Transmission mode (Half-duplex and full-duplex)

– With half duplex, nodes at both ends of link can transmit, but

not at same time

Internet Engineering / 2019 53

Page 54: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Error detection & correlation

Internet Engineering / 2019 54

Page 55: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Errors in Physical Layer

Internet Engineering / 2019 55

Noise

Attenuation

Distortion

Information Network 1 / 2016

Page 56: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 56

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 Detection Code – Parity, CRC (Cyclic redundancy check)

• Error Correction Code – FEC

– Protocol techniques for error correction

• Timer

• Retransmission

Information Network 1 / 2016

Page 57: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Basic idea of CRC

Given:

– Polynomial expression of m bit frame M(x) (degree m-1)

– Generator polynomial G(x), of degree r (r < m)

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)

Successful transmission: F(x) / G(x) = 0

– Nonzero otherwise. i.e., error detection.

– Consecutive errors less than r bits can be detected

Internet Engineering / 2019 57

Page 58: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 58

Standardized CRC polynomials

Commonly known standards

– CRC-12

• x12+x11+x3+x2+x+1

– CRC-16

• x16+x15+x2+1

– CRC-32

• x32

+x26

+x23

+x22

+x16

+x12

+ x11

+x10

+x8+x

7+ x

5+x

4+x

2+x+1

– CRC-CCITT

• x16+x12+x5+1

There are many other error detection codes.

Information Network 1 / 2016

Page 59: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Flow control

Internet Engineering / 2019 59

Page 60: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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

Internet Engineering / 2019 60Information Network 1 / 2016

Page 61: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

In a case without flow control

Sender sends frames at an arbitrary timing

Frames may be dropped on an intermediate media

Receiver takes time to process a frame

Internet Engineering / 2019 61

sender receiver

3 frames arrives while

processing 1 frame

→ buffer overflow

sender receiver

X

X

Page 62: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 62

Stop-and-wait ARQ (1)

t1 t2 t3

t4

t5t1Sender

Receiver

t1: Round Trip Time

t2: Frame Transmission Time

t3: Frame Processing Time

t4: ACK Transmission Time

t5: ACK Processing Time

Information Network 1 / 2016

Page 63: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 63

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 / 2016

Page 64: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 64

Go-back-N ARQ

1 653 45432

1 653 4542

Time out for Frame3

!!

Information Network 1 / 2016

Page 65: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 65

Selective-Repeat ARQ

1 873 65432

1 873 6542

Time out for Frame3

!!

Information Network 1 / 2016

Page 66: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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

– Efficient but complicated scheme that requires buffer, timer,

and ACK managements.

– Buffers are required in both ends.

– Window Flow Control is needed for buffer management.

Internet Engineering / 2019 66Information Network 1 / 2016

Page 67: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Internet Engineering / 2019 67

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 / 2016

Page 68: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Evolution of data link technologies

Internet Engineering / 2019 68

Page 69: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Conventional Ethernet (10base5/2)

Electrical signal will be

attenuated as going far

Repeater amplifies

electrical signal

Internet Engineering / 2019 69

Physical

Repeater

Share a same media (same datalink)

Bus

https://www.sqa.org.uk/e-learning/NetTechDC01CCD/page_12.htm

Page 70: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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

Internet Engineering / 2019 70

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

not share a media but same datalink

Page 71: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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).

Internet Engineering / 2019 71

Page 72: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Switched media / full-duplex

Fully occupy a media

– No competition

Full-duplex

Internet Engineering / 2019 72

Non-blocking switch

Occupied media but same datalink

Send (100Mbit/s)

Receive (100Mbit/s)

unused

http://www.aim-ele.co.jp/tech/metal-tech6/

→ modern ”network switch”

Page 73: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

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

Internet Engineering / 2019 73

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

Page 74: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Summary

Hierarchical protocol architecture of the Internet

Basic ideas of Physical and Data Link Layer

Important concepts

– Hierarchical protocols

– Framing

– Functions of datalink sublayers

• Media access control

• Logical link control

Internet Engineering / 2019 74Information Network 1 / 2016

Page 75: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Assignment 2

Capture the traffic in two scenarios on the topology you make in hands-on and answer the questions– Scenario 1: ping from host A to B

– Scenario 2: ping from host A to C

– Questions

• (1) Describe each field of frame header in several frames you captured in scenario 1

• (2) Describe what happens in each scenario by showing frames you captured

• (3) Describe the difference between scenario 1 and 2, and guess the reason of the difference

(4) Why CSMA/CD is not used any more? What changed by discarding CSMA/CD?

(5) Why CSMA/CA is still used?

Deadline: June 18 (Tue) 17:00, 2019

Submission: via e-mail with PDF formatInternet Engineering / 2019 75

Page 76: Hierarchical architecture & physical and datalink layers...– Normally, treated as a set of physical and data link layers. 11 Internet Engineering / 2019 Data Link Layer (1) =Data

Hands-on

Building Docker-based testbed

Conduct some network experiments

Internet Engineering / 2019 76