Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 52

AdvancedComputerNetworks

Lecture #5
Instructor: Dr. Niamat Ullah

DirectLinkNetworks - 1

1. PhysicalConnectingHosts
2. Hardware BuildingBlocks (NodesandLinks)
3. Encoding (NRZ, NRZI, Manchester, 4B/5B)
4. Framing

DataLinkLayer
Diferent functionsat the link level
Encoding
Framing
Error detection/correction
Reliabledelivery
Media accesscontrol

Directly-ConnectedNetworks

Point - to - point links: Each node isdirectly


connectedtoallothersviaalink

Multiple access: Allnodes share the same physical


medium
point-to-point

multiple access
4

PhysicalMedium
Signalstravelthrough the medium andrepresentbits
ShannonsCapacityTheorem

C = B log2(1+S/N)
Defnesthe upper bound on the linkcapacity C in Hz
Can be used toevaluate the error-freebandwidth of aline
5

ShannonsTheorem: Example

Voice-grade phoneline: B =3,300 -300 Hz = 3 KHz


TypicalSNR = 30 dB, where

dB = 10 xlog10(S/N)

For 30 db S/N =1,000

C = 3,000 xlog2(1+1,000) 30 Kbps

Higher bandwidth B (in Hz), higher capacity

Encoding
Mapbinarybitsintosignals
Example: Lowsignal representsa 0, high signal representsa 1
Non Return-to-Zero (NRZ)
Problem: Longperiodsof silence (zero) orhigh signalsarepossible
Baselinewander (receiverloses trackof referencesig)
Clockrecovery (receiverloses clocksynchronization)

The receiver keeps an average of the signal it has seen so


far, and then uses this average to distinguish between
low and high signals. The problem, of course, is that too
many consecutive 1s or 0s cause this average to
change, making it more difficult to detect a significant
7
change in the signal.

Encoding: MoreSchemes

NRZInverted (NRZI): Switch from current state torepresent a 1

This solves the problemof consecutive 1s, but obviously doesnothing for
consecutive 0s.

Manchester Encoding: XORthe bit stream with the clock

Because both 0sand 1s result ina transition to the signal, theclock can be
efectively recoveredat thereceiver.

TheproblemwiththeManchesterencoding
schemeisthatitdoublestherateatwhichsignal
transitionsaremade onthelink, whichmeansthat
thereceiverhashalfthetimetodetect eachpulseof
thesignal. Therateatwhichthesignalchangesis
calledthelinks baudrate.
In thecaseoftheManchesterencoding, thebit rate
ishalfthebaudrate, sotheencodingisconsidered
only 50% efcient.

4B/5BEncodingScheme

Encode 4-bit symbols into 5-bit codes


A final encoding that we consider, called 4B/5B, attempts
to address the inefficiency of the Manchester encoding
without suffering from the problem of having extended
durations of high or low signals.
Each codeword has no more than one starting zero, and
no more than two trailing zeros
No more than 3-consequtive zeros
The idea of 4B/5B is to insert extra bits into the bitstream
so as to break up long sequences of 0s or 1s.
Then use NRZI to solve the consecutive 1s problem
80% efficiency (1 bit is overhead)
10

Exampleof 4B/5BEncoding

4-bit data
symbol

5-bit code

4-bit data
symbol

5-bit code

0000

11110

1000

10010

0001

01001

1001

10011

0010

10100

1010

10110

0011

10101

1011

10111

0100

01010

1100

11010

0101

01011

1101

11011

0110

01110

1110

11100

0111

01111

1111

11101

Thus, when sent back-to-back, no pair of 5-bit codes results in more than three
consecutive 0s being transmitted. The resulting 5-bit codes are then transmitted
using the NRZI encoding, which explains why the code is only concerned about
consecutive 0sNRZI already solves the problem of consecutive 1s.
The 4B/5B encoding results in 80% efficiency.

11

Framing
The processofgroupingbitsintoframes (messagesorpackets)
Typicallyimplementedbythenetworkadaptor
Whyframes?

12

Byte-OrientedFraming

BISYNC: Binarysynchronouscommunication
Frame isa collection ofbytes
Needto indicatethebeginning andendof a frame
Sentinel charactersareused

SYN: Synchronization character


SOH: Start of header
STX, ETX: Start of text, Endof text
CRC: Cyclicredundancy check
13

Problem withByte-orientedFraming
ETX may occur in the payload
Precede it with a DLE (data-link-escape) character
Problem propagates, precede DLE with another
DLE (extra overhead)
Point-to-Point (PPP) protocol used by IP

STX: 0111110
Payload: 1,500 bytes
Checksum: 2 or 4 bytes

Overhead: 8/1508 =0.5%


14

Byte-countingFraming

Include the # of bytesin the frameasa feldinthe header


Digital DataCommunicationsProtocol (DDCMP)

Count: Specifes # of bytesin the body


CRC ensuresthatcountfeldisnotcorrupted
15

Bit-orientedFraming
High-LevelData LinkControl (HDLC)

Beginning/end of frame, fag: 01111110


Instead ofinsertingbytesdobitstufng
Senderaddsa 0 after fve consecutive 1s
Receiver removeszero afterfve 1s
16

Sender

ExampleofBit-stufng

1111110111111111110111110

Receiver
11111010111110111110101111100

17

DirectLinkNetworks 11

1. Error Detection
2. Ethernet (IEEE 802.3)

Single bit errors are the least


likely type of errors in serial data
transmission because the noise
must have a very short duration
which is very rare.
Example:
If data is sent at 1Mbps then each
bit lasts only 1/1,000,000 sec. or 1
s.
For a single-bit error to occur, the
noise must have a duration of only
1 s, which is very rare.

The term burst error means that


two or more bits in the data unit
have changed from 1 to 0 or from 0
to 1.
Burst errors does not necessarily
mean that the errors occur in
consecutive bits, the length of the
burst is measured from the first
corrupted bit to the last corrupted
bit. Some bits in between may not
have been corrupted.

Burst error is most likely to happen


in serial transmission since the
duration of noise is normally longer than
the duration of a bit.
The number of bits affected depends on
the data rate and duration of noise.
Example:
If data is sent at rate = 1Kbps then a noise of
1/100 sec can affect 10 bits.(1/100*1000)
If same data is sent at rate = 1Mbps then a noise
of 1/100 sec can affect 10,000 bits.(1/100*106)

Checksum

802.3 Ethernet
Carrier-sense multiple access with collision detection
(CSMA/CD).
CS = carrier sense
MA = multiple access
CD = collision detection
Base Ethernet standard is 10 Mbps.
100Mbps, 1Gbps, 10Gbps standards came later

Ethernet CSMA/CD
CSMA/CD (carrier sense multiple access with collision
detection) media access protocol is used.
Data is transmitted in the form of packets.
Sense channel prior to actual packet transmission.
Transmit packet only if channel is sensed idle; else,
defer the transmission until channel becomes idle.
After packet transmission is started, the node monitors
its own transmission to see if the packet has
experienced a collision.
If the packet is observed to be undergoing a collision,
the transmission is aborted and the packet is
retransmitted after a random interval of time using
Binary Exponential Backoff algorithm.

CSMA/CD (Ctnd..)
After first collision, each station waits for 0 or 1 slot before
trying again.
After second collision, they pick either 0, 1, 2, or 3 slots at
random to wait.
After 3rd. collision, number of slots to wait is between 0 and 23
-1.
In general, after I collisions, wait is between 0 and 2i 1.
After 10 collisions, randomization interval frozen at 1023
slots.
After 16 collisions, error!

Ethernet Frame Structure


Preamble:
7 bytes with pattern 10101010 followed by one byte with
pattern 10101011
Used to synchronize receiver, sender clock rates
Addresses: 6 bytes, frame is received by all adapters on a
LAN and dropped if address does not match
Length: 2 bytes, length of Data field
CRC: 4 bytes generated using CR-32, checked at receiver, if
error is detected, the frame is simply dropped
Data Payload: Maximum 1500 bytes, minimum 46 bytes
If data is less than 46 bytes, pad with zeros to 46 bytes

Length

Ethernet
Physical Media :10 Base5
10 Base2
10 BaseT
10 BaseFL

Thick Co-axial Cable with Bus Topology


Thin Co-axial Cable with Bus Topology
UTP Cat 3/5 with Tree Topology
Multimode/Singlemode Fiber with Tree
Topology

Maximum Segment Length


10 Base5

- 500 m with at most 4 repeaters (Use Bridge to extend


the network)
10 Base2 - 185 m with at most 4 repeaters (Use Bridge to extend
the network)
10 BaseT - 100 m with at most 4 hubs (Use Switch to extend the
network)

Fast Ethernet
100 Mbps bandwidth
Uses same CSMA/CD media access protocol and packet
format as in Ethernet.
100BaseTX (UTP) and 100BaseFX (Fiber) standards
Physical media :100 BaseTX - UTP Cat 5e
100 BaseFX - Multimode / Singlemode Fiber
Full Duplex/Half Duplex operations.

Fast Ethernet
Provision for Auto-Negotiation of media speed:
10 Mbps or 100Mbps (popularly available for copper
media only).
Maximum Segment Length
100 Base TX - 100 m
100 Base FX - 2 Km (Multimode Fiber)
100 Base FX - 20 km (Singlemode Fiber)

Gigabit Ethernet
1 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in Ethernet
and is backward compatible (10/100/100 modules are
available).
1000BaseT (UTP), 1000BaseSX (Multimode Fiber) and
1000BaseLX (Multimode/Singlemode Fiber) standards.
Maximum Segment Length
1000 Base T
- 100m (Cat 5e/6)
1000 Base SX - 275 m (Multimode Fiber)
1000 Base LX - 512 m (Multimode Fiber)
1000 Base LX - 20 Km (Singlemode Fiber)
1000 Base LH - 80 Km (Singlemode Fiber)

10 Gig Ethernet
10 Gbps bandwidth.
Uses same CSMA/CD media access protocol as in
Ethernet.
Propositioned for Metro-Ethernet
Maximum Segment Length
10GBase-LR
- 10 Km (Singlemode Fiber)
10GBase-ER
- 40 Km (Singlemode Fiber)

You might also like