Midterm Exam Review - PowerPoint PPT Presentation

Midterm exam review l.jpg
Download
1 / 146

Midterm Exam Review Communication Networks A communication network provides a general solution to the problem of connecting many devices: Connect each device to a network node (router) Network nodes exchange information and carry the information from a source device to a destination device

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

Download Presentation

Midterm Exam Review

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Midterm exam review l.jpg

Midterm ExamReview

COMP361 by M. Hamdi


Communication networks l.jpg

Communication Networks

  • A communication network provides a general solution to the problem of connecting many devices:

    • Connect each device to a network node (router)

    • Network nodes exchange information and carry the information from a source device to a destination device

    • Note: Network nodes do not generate information

    • Connect devices to a single shared medium (LAN)

COMP361 by M. Hamdi


Communication networks3 l.jpg

Communication Networks

  • A generic communication network:

Other names for Device: station, host, terminal

Other names for Node: switch, router, gateway

COMP361 by M. Hamdi


Classification of communications l.jpg

Classification of Communications

  • Communication networks can be classified based on the way in which the nodes exchange information:

  • Communication Network

    • Switched Communication Network

      • Circuit-Switched Communication Network

      • Packet-Switched Communication Network

        • Datagram Network

        • Virtual Circuit Network

    • Broadcast Communication Network

COMP361 by M. Hamdi


Broadcast network examples l.jpg

Broadcast Network Examples

Packet Radio

Network

Satellite

Network

Bus Local

Network

COMP361 by M. Hamdi


Circuit switching l.jpg

Circuit Switching

  • A node in a circuit-switching network:

COMP361 by M. Hamdi


Circuit switching7 l.jpg

Circuit Switching

COMP361 by M. Hamdi


Packet switching l.jpg

Packet Switching

COMP361 by M. Hamdi


Datagram packet switching l.jpg

Datagram Packet Switching

COMP361 by M. Hamdi


Virtual circuit packet switching l.jpg

Virtual-Circuit Packet Switching

COMP361 by M. Hamdi


Network technologies l.jpg

Network Technologies

  • Telephone Networks

  • IP Networks

  • ATM Networks

COMP361 by M. Hamdi


Three network technologies l.jpg

Three Network Technologies

  • Telephone Network

    • The largest worldwide computer network, specialized for voice

    • Switching technique: Circuit-switching

  • Internet

    • A newer global and public information infrastructure

    • Switching technique: Datagram packet switching

  • ATM

    • Was intended to replace telephone networks and data networks, but lost momentum due the success of the Internet

    • Switching technique: VC packet switching

COMP361 by M. Hamdi


Telephone networks l.jpg

Telephone Networks

Starting in 1876, the public switched telephone network (PSTN) has become a global infrastructure for voice communications

COMP361 by M. Hamdi


Addressing and routing l.jpg

Addressing and Routing

  • Each subscriber has an address (telephone number)

  • Addresses are hierarchical

  • The information contained in a telephone address is exploited when establishing a route from caller to callee

Country code

Number of local exchange

Subscriber number

Area

code

852

2358

6984

My office number

COMP361 by M. Hamdi


The internet a network of networks l.jpg

The Internet - A Network of Networks

  • The Internet is a loose collection of networks

  • Networks are organized in a (loose) multi-layer hierarchy

COMP361 by M. Hamdi


What defines the internet l.jpg

What defines the Internet

  • Use of a globally unique address space (Internet Addresses)

  • Support of the Transmission Control Protocol/Internet Protocol (TCP/IP) suite for communications

  • The physical networks widely differ (cable, optical, wireless, radio, etc.) - IP on top of ANYTHING.

COMP361 by M. Hamdi


Internet addresses l.jpg

Internet Addresses

  • Each network interface on the Internet has a unique global address, called the IP address.

  • An IP address:

    • is 32 bits long

    • encodes a network number and a host number

  • IP addresses are written in a dotted decimal notation. 128.142.136.146 means:

    • 10000000 in 1 st Byte

    • 10001110 in 2 nd Byte

    • 10001000 in 3 rd Byte

    • 10010011 in 4 th Byte

COMP361 by M. Hamdi


Domain names and ip addresses l.jpg

Domain Names and IP Addresses

  • Users and applications on the Internet normally do not use IP addresses directly. No one says: http://128.142.136.29/

  • Rather users and applications use domain names: http://www.cs.ust.hk

  • A service on the Internet, called the Domain Name System (DNS) performs the translation between domain names and IP addresses

COMP361 by M. Hamdi


Traditional network infrastructure l.jpg

Traditional Network Infrastructure

COMP361 by M. Hamdi


B isdn l.jpg

B-ISDN

COMP361 by M. Hamdi


Protocol architecture l.jpg

Protocol Architecture

  • Layered Protocol Architectures

  • OSI Reference Model

  • TCP/IP Protocol Stack

COMP361 by M. Hamdi


Need for protocols l.jpg

Need for Protocols

  • The task of exchanging information between devices

    • requires a high degree of cooperation between the involved parties

    • can be quite complex

  • Protocols are a set of rules and conventions. By enforcing that communicating parties adhere to a common protocol, communication is made possible.

  • The complexity of the communication task is reduced by dividing it into subtasks:

    • Each subtask is implemented independently.

    • Each subtask provides a service to another subtask.

COMP361 by M. Hamdi


Osi reference model l.jpg

OSI Reference Model

  • In 1977 the International Standardization Organization (ISO) developed a model for a layered network architecture

  • This effort was completed in 1983 and is known as the Open Systems Interconnection (OSI) Reference Model

  • The OSI model defines seven layers:

    • Layer 7: Application Layer

    • Layer 6: Presentation Layer

    • Layer 5: Session Layer

    • Layer 4: Transport Layer

    • Layer 3: Network Layer

    • Layer 2: Data Link Layer

    • Layer 1: Physical Layer

    • (Layer 0: Interconnection Media)

COMP361 by M. Hamdi


Osi layers l.jpg

OSI Layers

COMP361 by M. Hamdi


Osi layers and encapsulation l.jpg

OSI Layers and Encapsulation

COMP361 by M. Hamdi


Osi model in a switched communication network l.jpg

OSI Model in a Switched Communication Network

COMP361 by M. Hamdi


Tcp ip protocol suite l.jpg

TCP/IP Protocol Suite

  • The TCP/IP protocol suite was first defined in 1974

  • The TCP/IP protocol suite is the protocol architecture of the Internet

  • The TCP/IP suite has four layers: Application, Transport, Internet, and Network Interface Layer

COMP361 by M. Hamdi


Encapsulation in the tcp ip suite l.jpg

Encapsulation in the TCP/IP Suite

  • As data is moving down the protocol stack, each protocol is adding layer-specific control information.

COMP361 by M. Hamdi


Comparison of osi model and tcp ip suite l.jpg

Comparison of OSI Model and TCP/IP Suite

COMP361 by M. Hamdi


Physical layer l.jpg

Physical Layer

  • Fundamentals

  • Transmissions factors

  • Transmission Media

COMP361 by M. Hamdi


Physical layer31 l.jpg

Physical Layer

  • The physical layer deals with transporting bits between two machines.

  • The goal is to understand what happens to a signal as it travels across some physical media.

COMP361 by M. Hamdi


Theoretical basis for data communication l.jpg

Theoretical Basis for Data Communication

  • Fourier AnalysisFourier showed that a periodic function g(t) can be represented mathematically as an infinite series of sines and cosines:

    • fis the function's fundamentalfrequency

    • T=1/f is the function's period

    • an  and bn are the amplitudes of the nth harmonics

COMP361 by M. Hamdi


Theoretical basis for data communication33 l.jpg

Theoretical Basis for Data Communication

  • The series representation of g(t) is called its Fourierseries expansion.

  • In communications, we can always represent a data signal using a Fourier series by imagining that the signal repeats the same pattern forever.

COMP361 by M. Hamdi


Theoretical basis for data communication34 l.jpg

Theoretical Basis for Data Communication

  • We can compute the coefficients  an and bn

  • Suppose we use voltages (on/off) to represent ``1''s and ``0''s, and we transmit the bit string ``011000010'. The signal would look as follows:

COMP361 by M. Hamdi


Theoretical basis for data communication35 l.jpg

Theoretical Basis for Data Communication

COMP361 by M. Hamdi


Theoretical basis for data communication36 l.jpg

Theoretical Basis for Data Communication

  • Points to note about the Fourier expansion

  • The more terms in the expansion, the more exact our representation becomes.

  • The expression represents the amplitude or energy of the signal (e.g., the harmonics contribution to the wave).

COMP361 by M. Hamdi


Theoretical basis for data communication37 l.jpg

Theoretical Basis for Data Communication

  • Conclusion: it's essentially impossible to receive the exact signal that was sent. The key is to receive enough of the signal so that the receiver can figure out what the original signal was.

  • Note: ``bandwidth'' is an overloaded term. Engineers tend to use bandwidth to refer to the spectrum of signals a channel carries. In contrast, the term ``bandwidth'' is often also used to refer to the data rate of the channel, in bps.

COMP361 by M. Hamdi


Nyquist theorem l.jpg

Nyquist Theorem

  • Noise-free channel

  • Limiting factor on transmission is channel BW

  • If bandwidth is B, highest signal rate is 2B

  • Multi-level signaling:

    C = 2B log2 M; where:

    C is the data rate

    B is the bandwidth

    M is the number of levels

  • For example, a noiseless 3-kHz channel cannot transmit binary signals at a rate exceeding 6000 bps.

COMP361 by M. Hamdi


Shannon s theorem l.jpg

Shannon’s Theorem

  • If random noise is present, the situation deteriorates rapidly. The amount of noise present is measured by the ratio of the signal power to the noise power, called the signal-to-noise ratio (S/N).

  • Usually, the ratio itself is not quoted; instead, the quantity 10 log10S/N is given. These units are called decibels (dB).

  • Maximum number of bits/sec=Hlog2(1+S/N)

  • For telephone line: 3000log2(1+30dB)30000bps.

COMP361 by M. Hamdi


Transmission media l.jpg

Transmission Media

  • The purpose of the physical layer is to transport a raw bit stream from one machine to another.

  • Various physical media can be used for the actual transmission.

  • Each one has its own niche in terms of bandwidth, delay, cost, and ease of installation and maintanence.

  • Media are roughly grouped into guided media, such as copper wire and fiber optics, and unguided media such as radio and lasers through air.

COMP361 by M. Hamdi


Transmission media41 l.jpg

Transmission Media

  • Twisted Pair

  • Coaxial Cable

  • Fiber Optic

COMP361 by M. Hamdi


Transmission media wireless transmission l.jpg

Transmission Media:Wireless Transmission

  • Radio : omnidirectional, AM, FM Radio, TV, ALOHA data network

  • Microwave : directional

    • Terrestrial Microwave, long-haul common carrier, government communications.

    • Satellite Microwave

      • A communication satellite is a microwave relay station.

COMP361 by M. Hamdi


Data link layer l.jpg

Data Link Layer

  • Framing

  • Error Detection

  • Flow Control

  • Error Control (via Retransmission)

COMP361 by M. Hamdi


Introduction l.jpg

Introduction

Main Task of the data link layer:

  • Provide error-free transmission over a physical link

COMP361 by M. Hamdi


Introduction45 l.jpg

Introduction

  • The PDU at the Data Link Layer (DL-PDU) is typically called a Frame. A Frame has a header, a data field, and a trailer

  • Example

COMP361 by M. Hamdi


Framing l.jpg

Framing

  • Problem: Identify the beginning and the end of a frame in a bit stream

  • Solution (bit-oriented Framing): A special bit pattern (flag) signals the beginning and the end of a frame (e.g., "01111110") – use bit stuffing

  • Problem: The sequence “01111110” must not appear in the data of the frame

COMP361 by M. Hamdi


Error control l.jpg

Error Control

  • Two basic approaches to handle bit errors:

    • Error-correcting codes

      • Too many additional bits are needed for correction (used only in simplex communication (e.g., satellite))

    • Error-detecting codes plus retransmission

      • Used if retransmission of corrupted data is feasible

      • Receiver detects error and requests retransmission of a frame.

COMP361 by M. Hamdi


Cyclic redundancy codes crc l.jpg

Cyclic-Redundancy Codes (CRC)

General Method:

  • The transmitter generates an n-bit check sequence number (known as Frame Checksum Sequence (FCS)) from a given k-bit frame such that the resulting (k+n)-bit frame is divisible by some number

  • The receiver divides the incoming frame by the same number

  • If the result of the division does not leave a remainder, the receiver assumes that there was no error

COMP361 by M. Hamdi


Step 2 crc encoding method l.jpg

Step 2: CRC Encoding Method

Define:

  • M(x): Data block is a polynomial (= Message, Frame)

  • P(x): "Generator Polynomial" which is known to both sender and receiver (degree of P(x) is n)

COMP361 by M. Hamdi


Step 2 crc encoding method50 l.jpg

Step 2: CRC Encoding Method

  • (I) Append n zeros to M(x), i.e., M(x)*x^n

  • (II) Divide M(x)*x^n by P(x) and obtain:

    • M(x)*x^n = Q(x)P(x) + R(x)

  • (III) Set T(x) = M(x)*x^n + R(x). T(x) is the encoded message

    Note: T(x) is divisible by P(x). Therefore, if the received message does not contain an error then it can be divided by P(x).

COMP361 by M. Hamdi


Flow control l.jpg

Flow Control

  • Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a transmitting station does not overflow a receiving station with data

  • We will discuss two protocols for flow control:

    • Stop-and-Wait Protocol

    • Sliding Window Protocol

COMP361 by M. Hamdi


Stop and wait flow control l.jpg

Stop-and-Wait Flow Control

  • Simplest form of flow control

  • In Stop-and-Wait flow control, the receiver indicates its readiness to receive data for each frame

  • Operations:

    • 1. Sender: Transmit a single frame

    • 2. Receiver: Transmit acknowledgment (ACK)

    • 3. goto 1.

COMP361 by M. Hamdi


Analysis of stop and wait l.jpg

Analysis of Stop-and-Wait

COMP361 by M. Hamdi


Analysis of stop and wait54 l.jpg

Analysis of Stop-and-Wait

Notation:

C = Channel capacity in bps

I = Propagation delay

H = Number of bits in a frame header

D = Number of data bits in a frame

F = Total length of a frame (F= D+H)

A = Total length of an ACK frame

F/C = Transmission delay for a frame

COMP361 by M. Hamdi


Analysis of stop and wait55 l.jpg

Analysis of Stop-and-Wait

COMP361 by M. Hamdi


Analysis of stop and wait56 l.jpg

Analysis of Stop-and-Wait

  • Transmission of a frame (in Stop-and-Wait):

COMP361 by M. Hamdi


Analysis of stop and wait57 l.jpg

Analysis of Stop-and-Wait

  • Efficiency of a protocol is the maximum fraction of time when the protocol is transmitting data

  • Efficiency of Stop-and-Wait Flow Control (1)

  • Assuming that H and A are negligible we obtain (2)

COMP361 by M. Hamdi


Sliding window flow control l.jpg

Sliding Window Flow Control

  • Major Drawback of Stop-and-Wait Flow Control:

    • Only one frame can be in transmission at a time

    • This leads to inefficiency if a>1

  • Sliding Window Flow Control

    • Allows transmission of multiple frames

    • Assigns each frame a k-bit sequence number

    • Range of sequence number is [0...2^k-1], i.e., frames are counted modulo 2^k

COMP361 by M. Hamdi


Operation of sliding window l.jpg

Operation of Sliding Window

  • Sending Window:

    • At any instant, the sender is permitted to send frames with sequence numbers in a certain range

    • The range of sequence numbers is called the sending window

COMP361 by M. Hamdi


Operation of sliding window60 l.jpg

Operation of Sliding Window

  • Receiving Window:

    • The receiver maintains a receiving window corresponding to the sequence numbers of frames that are accepted

COMP361 by M. Hamdi


Analysis of sliding windows l.jpg

Analysis of Sliding Windows

  • Define:

    • We use the same parameters for as in Stop-and-Wait

    • To simplify notation we set:

      • F/C = 1

      • I = a (Normalization)

    • W = Maximum window size (identical for sender and receiver)

COMP361 by M. Hamdi


Analysis of sliding windows62 l.jpg

Analysis of Sliding Windows

COMP361 by M. Hamdi


Analysis of sliding windows63 l.jpg

Analysis of Sliding Windows

  • If the window size is sufficiently large the sender can continuously transmit packets:

  • W >= 2a+1: Sender can transmit continuously

    • normalized efficiency = 1

  • W < 2a+1:Sender can transmit W frames every 2a+1 time units

    • normalized efficiency = W/(1+2a)

COMP361 by M. Hamdi


Arq error control l.jpg

ARQ Error Control

  • Two types of errors:

    • Lost frames

    • Damaged Frames

  • Most Error Control techniques are based on

    • (1) Error Detection Scheme (e.g., Parity checks, CRC)

    • (2) Retransmission Scheme

  • Error control schemes that involve error detection and retransmission of lost or corrupted frames are referred to as Automatic Repeat Request (ARQ) error control

COMP361 by M. Hamdi


Arq error control65 l.jpg

ARQ Error Control

  • All retransmission schemes use all or a subset of the following procedures:

    • Receiver sends an acknowledgment (ACK) if a frame is correctly received

    • Receiver sends a negative acknowledgment (NAK) if a frame is not correctly received

    • The sender retransmits a packet if an ACK is not received within a timeout interval

    • All retransmission schemes (using ACK, NAK or both) rely on the use of timers

COMP361 by M. Hamdi


Arq schemes l.jpg

ARQ Schemes

  • The most common ARQ retransmission schemes:

    • Stop-and-Wait ARQ

    • Go-Back-N ARQ

    • Selective Repeat ARQ

COMP361 by M. Hamdi


Go back n arq l.jpg

Go-Back-N ARQ

  • Go-Back-N uses the sliding window flow control protocol. If no errors occur the operations are identical to Sliding Window

  • Operations:

    • A station may send multiple frames as allowed by the window size

    • Receiver sends a NAK i if frame i is in error. After that, the receiver discards all incoming frames until the frame in error was correctly retransmitted

    • If sender receives a NAK i it will retransmit frame i and all packets i+1, i+2,... which have been sent, but not been acknowledged

COMP361 by M. Hamdi


Selective repeat arq l.jpg

Selective-Repeat ARQ

  • Similar to Go-Back-N ARQ. However, the sender only retransmits frames for which a NAK is received

  • Advantage over Go-Back-N:

    • Fewer Retransmissions.

  • Disadvantages:

    • More complexity at sender and receiver

    • Each frame must be acknowledged individually (no cumulative acknowledgements)

    • Receiver may receive frames out of sequence

COMP361 by M. Hamdi


Analysis of arq protocols l.jpg

Analysis of ARQ Protocols

  • What is the efficiency of the discussed ARQ protocols?

  • A number of assumptions:

    • ACKs and NAKs are never lost, and frames are not dropped.

    • Sizes of ACKs, NAKs, and frame headers are negligible.

COMP361 by M. Hamdi


Analysis of stop and wait arq l.jpg

Analysis of Stop-and-Wait ARQ

  • Parameters

    • U=efficiency

    • Tt=F/C (transmission delay of a frame)

    • I=propagation delay

    • a=I/Tt

    • P=probability that a frame is in error

  • Without Errors (P=0)

    • U=Tt/(Tt+2I)

COMP361 by M. Hamdi


Stop and wait arq with errors l.jpg

Stop-and-Wait ARQ: With Errors

  • Probability that k transmission attempts are needed to successfully transmit a frame

  • Expected number of attempts (=E[A])

  • Expected efficiency with errors

COMP361 by M. Hamdi


Analysis of selective reject arq l.jpg

Analysis of Selective Reject ARQ

COMP361 by M. Hamdi


Local area networks lans l.jpg

Local Area Networks (LANs)

  • Broadcast Networks

  • Multiple Access Protocols

  • Ethernet (IEEE 802.3)

  • Token Ring (IEEE 802.5, FDDI)

COMP361 by M. Hamdi


Examples of broadcast network l.jpg

Examples of Broadcast Network

  • If more than one station transmits at a time on the broadcast channel, a collision occurs

  • Multi-access problem: How to determine which station can transmit?

COMP361 by M. Hamdi


Multi access protocols l.jpg

Multi-access Protocols

  • Protocols that solve the resolution problem dynamically are called Multiple Access (Multi-access) Protocols

  • Different types of multi-access protocols

    • Contention protocols resolve a collision after it occurs. These protocols execute a collision resolution protocol after each collision

    • Collision-free protocols ensure that a collision can never occur

COMP361 by M. Hamdi


Contention protocols l.jpg

Contention Protocols

  • ALOHA Protocols:

    • (Pure) Aloha

    • Slotted Aloha

  • CSMA (Carrier Sense Multiple Access):

    • persistent CSMA

    • non-persistent CSMA

    • CSMA/CD - Carrier Sense Multiple Access with Collision Detection (= Ethernet)

  • There are many more

COMP361 by M. Hamdi


Collisions in pure aloha l.jpg

Collisions in (Pure)ALOHA

COMP361 by M. Hamdi


Slotted aloha s aloha l.jpg

Slotted ALOHA (S-ALOHA)

  • The Slotted Aloha Protocol

    • Slotted Aloha - Aloha with an additional constraint

    • Time is divided into discrete time intervals (=slot)

    • A station can transmit only at the beginning of a frame

  • As a consequence:

    • Frames either collide completely or do not collide at all

    • Vulnerable period = 1

COMP361 by M. Hamdi


Collisions in s aloha l.jpg

Collisions in S-ALOHA

COMP361 by M. Hamdi


Performance of pure aloha l.jpg

Performance of (Pure)ALOHA

  • Question: What is the maximum throughput of the ALOHA protocol?

  • Notation:

    • S Throughput: Expected number of successful transmissions per time unit. Normalization: Frame transmission time is 1, maximum throughput is 1

    • G Offered Load: Expected number of transmission and retransmission attempts (from all users) per time unit

COMP361 by M. Hamdi


Modeling assumptions l.jpg

Modeling Assumptions

  • All frames have a fixed length of one time unit (normalized)

  • Infinite user population

  • Offered load is modeled as a Poisson process with rate G, that is,

  • Prob[k packets are generated in t frame times] =

COMP361 by M. Hamdi


Throughput of aloha l.jpg

Throughput of Aloha

  • Fundamental relation between throughput and offered load:

  • S = G x Prob [frame suffers no collision]

COMP361 by M. Hamdi


Performance of pure aloha83 l.jpg

Performance of (pure)ALOHA

  • Prob [frame suffers no collision]

    = Prob [no other frame is generated during the vulnerable period for this frame]

    = Prob [no frame is generated during a 2-frame period]

    =

Throughput in ALOHA:

COMP361 by M. Hamdi


Results l.jpg

Results

  • Maximum achievable throughput:

  • Take the derivative and set

  • Maximum is attained at G = 0.5

  • We obtain:

  • That is about 18% of the capacity!!!

COMP361 by M. Hamdi


Performance of s aloha l.jpg

Performance of S-ALOHA

  • Derivation is analogous to Aloha:

  • S = G x Prob[frame suffers no collision]

  • Prob [frame suffers no collision]

    =Prob [no other frame is generated during a vulnerable period]

    =Prob [no frame is generated during 1 frame period]

COMP361 by M. Hamdi


Performance of s aloha86 l.jpg

Performance of S-ALOHA

  • Total Throughput in ALOHA:

  • Maximum achievable throughput:

COMP361 by M. Hamdi


Comparison of aloha and s aloha l.jpg

Comparison of ALOHA and S-ALOHA

COMP361 by M. Hamdi


Csma carrier sense multiple access l.jpg

CSMA - Carrier Sense Multiple Access

  • Improvement to ALOHA protocol:

    • If stations have carrier sense capability (stations can test the broadcast medium for ongoing transmission), and

    • if stations only transmit if the channel is idle,

    • then many collisions can be avoided.

  • Caveat: This improves ALOHA only if the ratio a is small.

COMP361 by M. Hamdi


Csma carrier sense multiple access89 l.jpg

CSMA - Carrier Sense Multiple Access

  • CSMA protocol:

    • A station that wishes to transmit listens to the medium for an ongoing transmission

    • Is the medium in use?

      • Yes: Station back of for a specified period

      • No: Station transmits

    • If a sender does not receive an acknowledgment after some period, it assumes that a collision has occurred

    • After a collision a station backs off for a certain (random) time and retransmits

COMP361 by M. Hamdi


Variations of csma protocols l.jpg

Variations of CSMA Protocols

  • There are a number of variations of CSMA protocols

  • Each variant specifies what to do if the medium is found busy:

    • Non-Persistent CSMA

    • 1-Persistent CSMA

    • p-Persistent CSMA

COMP361 by M. Hamdi


Comparison of aloha and csma l.jpg

Comparison of ALOHA and CSMA

Load vs. Throughput:

Assumption: propagation delay << transmission delay

COMP361 by M. Hamdi


Csma cd l.jpg

CSMA / CD

  • Improvement to CSMA protocol:

    • Carrier Sense Multiple Access with Collision Detection

    • Widely used for bus topology LANs (IEEE 802.3, Ethernet)

    • Only works if propagation delay is small relative to transmission delay (in other words, a must be small)

COMP361 by M. Hamdi


Csma cd93 l.jpg

CSMA/CD

  • CSMA has an inefficiency:

    • If a collision has occurred, the channel is unstable until colliding packets have been fully transmitted

  • CSMA/CD overcomes this as follows:

    • While transmitting, the sender is listening to medium for collisions. Sender stops if collision has occurred

  • Note:

    • CSMA: Listen Before Talking

    • CSMA/CD: Listen While Talking

COMP361 by M. Hamdi


Csma cd94 l.jpg

CSMA/CD

  • Question: How long does it take to detect a collision?

  • Answer: In the worst case, twice the maximum propagation delay of the medium

COMP361 by M. Hamdi


Collision detection in csma cd l.jpg

Collision Detection in CSMA/CD

COMP361 by M. Hamdi


Csma cd96 l.jpg

CSMA/CD

  • Restrictions of CSMA / CD:

    • Packet should be twice as long as the time to detect a collision (2 * maximum propagation delay)

    • Otherwise, CSMA/CD does not have an ad-vantage over CSMA

  • Example: Ethernet

    • Ethernet requires a minimum packet size and restricts the maximum length of the medium

COMP361 by M. Hamdi


Exponential backoff algorithm l.jpg

Exponential Backoff Algorithm

  • Ethernet uses the exponential backoff algorithms to determine when a station can retransmit after a collision

  • Algorithm:

    • Set "slot time" equal to 2a

    • After first collision wait 0 or 1 slot times

    • After i-th collision, wait a random number between 0 and 2^i -1 time slots

    • Do not increase random number range, if i=10

    • Give up after 16 collisions

COMP361 by M. Hamdi


Performance of csma cd l.jpg

Performance of CSMA/CD

  • Parameters and assumptions:

    • End-to-end propagation delay: a

    • Packet transmission time (normalized): 1

    • Number of stations: N

    • Time can be thought of as being divided in contention intervals and transmission intervals.

    • Contention intervals can be thought of as being slotted with slot length of 2a (roundtrip propagation delay).

COMP361 by M. Hamdi


Performance of csma cd99 l.jpg

Performance of CSMA/CD

  • Contention slots end in a collision

  • Contention interval is a sequence of contention slots

  • Length of a slot in contention interval is 2a

  • We assume that the probability that a station attempts to transmit in a slot is P

COMP361 by M. Hamdi


Performance of csma cd100 l.jpg

Performance of CSMA/CD

  • Let A be the probability that some station can successfully transmit in a slot. We get:

  • In the above formula, A is maximized when P=1/ N. Thus:

Derivation of maximum throughput of CSMA/CD:

COMP361 by M. Hamdi


Performance of csma cd101 l.jpg

Performance of CSMA/CD

Prob [contention interval has a length of j slots] =

Prob [1 successful attempt] x Prob [ j-1 unsuccessful attempts] =

The expected number of slots in a contention interval is then calculated as:

COMP361 by M. Hamdi


Performance of csma cd102 l.jpg

Performance of CSMA/CD

  • Now we can calculate the maximum efficiency of CSMA/CD with our usual formula:

COMP361 by M. Hamdi


Ieee 802 lan standard l.jpg

IEEE 802 LAN Standard

COMP361 by M. Hamdi


Ieee 802 lan standard104 l.jpg

IEEE 802 LAN standard

COMP361 by M. Hamdi


Ieee 802 lan architecture l.jpg

IEEE 802 LAN Architecture

  • Functions of the LLC:

    • Similar to HDLC (sliding window protocol)

    • Provides SAPs to higher layers

    • Provides different services:

      • acknowledged connectionless service

      • unacknowledged connectionless service

      • connection-oriented service

    • Framing

    • Error control

    • Addressing

COMP361 by M. Hamdi


Ieee802 3 csma cd l.jpg

IEEE802.3 (CSMA/CD)

  • Generally referred to as Ethernet

  • Based on CSMA/CD

  • Applies exponential back-off after collisions

  • Data Rate: 2 - 1,000 Mbps

  • Maximum cable length is dependent on the data rate

  • Uses Manchester encoding

  • Bus topology:

COMP361 by M. Hamdi


Ethernet l.jpg

Ethernet

  • There are many different physical layer configurations for 802.3 LANs

  • The following notation is used to denote the configuration

COMP361 by M. Hamdi


Ring local area network l.jpg

Ring Local Area Network

COMP361 by M. Hamdi


States of the ring interface l.jpg

States of the Ring Interface

Listen State: Incoming bits are copied to output with 1-bit delay

Transmit State: Write data to the ring

Bypass State: Idle station does not incur bit-delay

COMP361 by M. Hamdi


Ring lans l.jpg

Ring LANs

  • If a frame has traveled once around the ring it is removed by the sender

  • Ring LANs have a simple acknowledgment scheme:

    • Each frame has one bit for acknowledgment.

    • If the destination receives the frame it sets the bit to 1.

    • Since the sender will see the returning frame, it can tell if the frame was received correctly.

COMP361 by M. Hamdi


What is the length of a ring l.jpg

What is the "Length" of a Ring?

  • The length of a ring LAN, measured in bits, gives the total number of bits which are can be in transmission on the ring at a time

  • Note: Frame size is not limited to the length of the ring since entire frame may not appear on the ring at one time.

  • Bit length = propagation speed * length of ring * data rate + No. of stations * bit delay at repeater

COMP361 by M. Hamdi


Ring lan l.jpg

Ring LAN

  • Advantages:

    • Can achieve 100 % utilization

    • No collisions

    • Can achieve deterministic delay bounds

    • Can be made efficient at high speeds

  • Disadvantages:

    • Long delays due to bit-delays

      • Solution: Bypass state eliminates bit-delay at idle station

    • Reliability Problems

      • Solution 1: Use a wire center

      • Solution 2: Use a second ring (opposite flow)

COMP361 by M. Hamdi


Token ring lans l.jpg

Token Ring LANS

  • Token is a small packet that rotates around the ring

  • When all stations are idle, the token is free and circulates around the ring

  • Possible Problem: All stations are idle and in the Bypass state. What is the problem?

COMP361 by M. Hamdi


802 5 token ring mac protocol l.jpg

802.5(Token Ring) MAC Protocol

  • In order to transmit a station must catch a free token

  • The station changes the token from free to busy

  • The station transmits its frame immediately following the busy token

  • IF station has completed transmission of the frame AND the busy token has returned to the station THEN station inserts a new free token into the ring

COMP361 by M. Hamdi


Properties of the 802 5 token ring l.jpg

Properties of the 802.5 Token Ring

  • No collisions of frames

  • Full utilization of bandwidth is feasible

  • Transmission can be regulated by controlling access to token

  • Recovery protocols is needed if token is not handled properly, e.g., token is corrupted, station does not change to "free" etc

COMP361 by M. Hamdi


Priority of transmission in 802 5 l.jpg

Priority of Transmission in 802.5

  • Eight levels of priorities

  • Priorities handled by 3-bit priority field and 3-bit reservation field

  • Define:

    • Pm = priority of the message to be transmitted

    • Pr = token priority of received token

    • Rr = reservation priority of received token

COMP361 by M. Hamdi


Token ring priority scheme example l.jpg

Token Ring Priority Scheme Example

COMP361 by M. Hamdi


Slide118 l.jpg

COMP361 by M. Hamdi


Effect of propagation delay l.jpg

Effect of propagation delay

  • Effect of propagation delay on throughput:

    • Case 1: a < 1 (Packet longer than ring)

      • T2 = time to pass token to the next station = a/N

    • Case 2: a > 1 (Packet shorter than ring)

      • Note: Sender finishes transmission after T1 = 1, but cannot release the token until the token returns

      • T1+T2 = max(1, a) + a/N

COMP361 by M. Hamdi


Slide120 l.jpg

FDDI

  • FDDI distinguishes 4 Service Classes:

    • Asynchronous

    • Synchronous

    • Immediate (for monitor and control)

COMP361 by M. Hamdi


Station types class a station l.jpg

Station Types - Class A Station

  • Two PHY (and one or two MAC) entities

  • Connects to another Class A station or to a concentrator

COMP361 by M. Hamdi


Station types class b station l.jpg

Station Types - Class B Station

  • Class B station has one PHY (and one MAC) entity

  • Connects to a concentrator

COMP361 by M. Hamdi


Slide123 l.jpg

dual attach node

c

o

n

c

e

n

t

r

a

t

o

r

dual attach node

single attach nodes

FDDI Dual Ring Structure

COMP361 by M. Hamdi


Fddi media access control l.jpg

FDDI Media Access Control

  • FDDI uses a Token Ring Protocol, similar to 802.5

  • Differences of FDDI and 802.5:

    • To release a token, a station does not need to wait until the token comes back after a transmission. The token is released right after the end of transmission

    • In FDDI, multiple frames can be attached to the token

    • FDDI has a different priority scheme

COMP361 by M. Hamdi


Timed token protocol l.jpg

Timed Token Protocol

  • FDDI has a timed token protocol which determines how long a station can transmit

  • Each station has timers to measure the time elapsed since a token was last received

  • TTRT Target Token Rotation Time

    • Value of TTRT is negotiated during initialization (default is 8 ms)

    • Set to the maximum desired rotation time

COMP361 by M. Hamdi


Parameters of timed token protocol l.jpg

Parameters of Timed Token Protocol

  • Station Parameters:

  • TRT Token Rotation Time

    • Time of the last rotation of the token.

    • If TRT < TTRT, then token is “early”, asynchronous traffic can be transmitted

    • If TRT > TTRT then token is “late”, asynchronous traffic cannot be transmitted.

  • THT Token Holding Time

    • Controls the time that a station may transmit asynchronous traffic.

    • fi Percentage of the TTRT that is allocated for synchronous traffic at station i.

COMP361 by M. Hamdi


Timed token protocol127 l.jpg

Timed Token Protocol

  • If a station receives the token it sets

    • THT:= TRT

    • TRT:= TTRT

    • Enable TRT (i.e., start the timer)

  • If the station has synchronous frames are waiting the transmit synchronous traffic for up to time TTRT*fi (with sum(fi) <1)

  • If the station has asynchronous traffic

    • enable THT

    • while THT > 0 transmit asynchronous traffic.

COMP361 by M. Hamdi


Fddi mac operation l.jpg

FDDI MAC Operation

When a token arrives each station follows this procedure

  • THT = TTRT – TRT

  • TRT = 0

  • Send Synchronous Data

  • IF THT > 0, enable THT and start sending Asynchronous data as long as THT > 0

COMP361 by M. Hamdi


Fddi mac example l.jpg

FDDI MAC Example

COMP361 by M. Hamdi


Fddi mac example130 l.jpg

FDDI MAC Example

COMP361 by M. Hamdi


Fddi mac example131 l.jpg

FDDI MAC Example

COMP361 by M. Hamdi


Fddi mac example132 l.jpg

FDDI MAC Example

COMP361 by M. Hamdi


Fddi mac example sync ttrt 80 l.jpg

FDDI MAC Example-Sync. (TTRT = 80)

Maximum Throughput = 80 / 84 = 95.23%

COMP361 by M. Hamdi


Fddi mac example asyn ttrt 100 l.jpg

FDDI MAC Example-Asyn. (TTRT=100)

COMP361 by M. Hamdi


Fddi mac example asyn ttrt 100135 l.jpg

FDDI MAC Example(Asyn. TTRT=100)

Time = 404, station 1 gets the token

COMP361 by M. Hamdi


Analysis of fddi l.jpg

Analysis of FDDI

  • Analysis of

    • Synchronous traffic

    • Asynchronous traffic

  • Synchronous Traffic:

    • Recall that each station can transmit synchronous traffic for up to time TTRT*fi (with sum(fi)<=1)

    • If sum(fi)=1, the maximum throughput of synchronous traffic is 100%.

    • One can show that the maximum delay until a frame is completely transmitted is:

      • Maximum Access Delay <= 2*TTRT

COMP361 by M. Hamdi


Analysis of fddi137 l.jpg

Analysis of FDDI

  • Asynchronous Traffic

  • Parameters:

    • D: Ring latency

    • n: Number of active sessions (all heavily loaded)

    • T: Value of TTRT

  • Assumption:

    • No synchronous traffic

COMP361 by M. Hamdi


Analysis of fddi138 l.jpg

Analysis of FDDI

  • From the Example we see:

    • Cycle in a system has a length of: nT + D

    • Time in a cycle used for transmission: n(T - D)

  • We obtain for the maximum throughput for asynchronous traffic is:

  • ... and the maximum access delay for asynchronous traffic:

    • Max. Access Delay=T(n-1)+2D

COMP361 by M. Hamdi


Ieee 802 4 token bus l.jpg

IEEE 802.4 (Token Bus)

  • Problems with 802.3:

    • Collisions of frames can lead to unpredictable delays

    • In some real-time scenarios, collisions and unpredictable delays can be catastrophic

  • Solution via Token Bus:

    • A control packet (Token) regulates access to the bus

    • A station must have the token in order to transmit

    • A station can hold the token only for a limited time

    • The token is passed among the stations in a cyclic order

    • This structures the bus as a logical ring

COMP361 by M. Hamdi


Ieee 802 4 token bus140 l.jpg

IEEE 802.4 (Token Bus)

  • Stations form a logical ring

  • Each station knows its successor and predecessor in the ring

COMP361 by M. Hamdi


Feature of token bus l.jpg

Feature of Token Bus

  • Bandwidth is 1, 5, or 10 Mbps

  • The token bus MAC protocol is very complex

  • Typically, token bus is free of collisions

  • Defines priority transmissions and can offer bounded transmission delays

COMP361 by M. Hamdi


Ieee 802 4 token bus142 l.jpg

IEEE 802.4 (Token Bus)

  • 802.4 requires each station to implement the following management functions:

  • Ring Initialization

  • Addition to ring

  • Deletion from ring

  • Fault management

COMP361 by M. Hamdi


Adding a station to the token bus l.jpg

Adding a Station to the Token Bus

  • Each node periodically sends a solicit successor packet which invites nodes with an address between itself and the next node to join the ring

  • Sending node waits for response for one round trip

  • One of the following three cases apply

    • (1) No Response:

      • Pass token

    • (2) Response from one node:

      • Reset successor node

      • Pass token to new successor node

    • (3) Response from more than one node:

      • Collision has occurred

      • Node tries to resolve contention

COMP361 by M. Hamdi


Add a station to the token bus l.jpg

Add a station to the Token Bus

  • Assume: Response from more than one node has resulted in a collision.

  • Station sends a resolve contention packet and waits for four windows

  • (window = 1 round trip time) for a response:

    • In window 1, stations with address prefix 00 can reply

    • In window 2, stations with address prefix 01 can reply

    • In window 3, stations with address prefix 10 can reply

    • In window 4, stations with address prefix 11 can reply

  • If there is a another collision, procedure is repeated for the second pair of bits. Only the nodes which replied earlier can join the next round

  • First successful reply joins the ring

COMP361 by M. Hamdi


Ieee 802 4 token bus145 l.jpg

IEEE 802.4 (Token Bus)

  • Four priority levels:

    • Levels 6, 4, 2, 0

    • Priority 6 is the highest level

  • Token Holding Time (THT):

    • Maximum time a node can hold a token

  • Token Rotation Time for class i (TRTi):

    • Maximum time of a full token circulation at which priority i transmissions are still permitted

COMP361 by M. Hamdi


Token bus transmission rules l.jpg

Token Bus Transmission Rules

  • Each station can transmit class 6 data for a time THT

  • For i= 4, 2, 0:

    • Transmit class i traffic if all traffic from class i+2 or higher is transmitted

    • and the time of the last token circulation (including the transmission time of higher priority packets during the current holding of the token) is less than TRT i .

COMP361 by M. Hamdi


  • Login