Title: Networks and Communication Lecture 3: Datalink WAN
1Networks and CommunicationLecture 3 Datalink -
WAN
- Peter Steenkiste
- School of Computer Science
- Carnegie Mellon University
- ECOM, Summer 2000
2Todays Lecture
- Encoding and framing.
- Datalink layer functions.
- Switching.
- Flow control and error control.
3From Signals to Packets
4Why Do We Need Encoding?
- Meet certain electrical constraints.
- Receiver needs enough transitions to keep track
of the transmit clock - Avoid receiver saturation
- Create control symbols, besides regular data
symbols. - E.g. start or end of frame, escape, ...
- Error detection or error corrections.
- Some codes are illegal so receiver can detect
certain classes of errors - Minor errors can be corrected by having multiple
adjacent signals mapped to the same data symbol
5Example Ethernet Manchester Encoding
0
1
1
0
.85
V
0
-.85
.1?s
- Positive transition for 0, negative for 1
- Transition every cycle communicates clock (but
need 2 transition times per bit) - DC balance has good electrical properties
64B/5B Encoding
- NRZI line code.
- Data coded as symbols of 5 line bits gt 4 data
bits, so 100 Mbps uses 125 MHz. - Uses less frequency space than Manchester
encoding - Each valid symbol has at least two 1s get dense
transitions. - 16 data symbols, 8 control symbols
- Data symbols 4 data bits
- Control symbols idle, begin frame, etc.
- Example FDDI.
7Framing
- A link layer function, defining which bits have
which function. - Minimal functionality mark off units of
transmission. - Some techniques
- frame delimiter characters with character
stuffing - frame delimiter codes with bit stuffing
- out of band delimiters (e.g. FDDI control
symbols) - synchronous transmission (e.g. SONET)
8Example Ethernet Framing
preamble
stuff
length
more stuff
- preamble is 7 bytes of 10101010 (5 MHz square
wave) followed by one byte of 10101011 - allows receivers to recognize start of
transmission after idle channel (an out of band
signal)
9Character and Bit Stuffing
- Mark frames with control characters, e.g. 4B/5B.
- Mark frames with special character.
- use escape character when controls appear in
data - abcdef -gt abc\def
- used all the time on serial lines, in editors,
etc. - Mark frames with special bit sequence
- must ensure data containing this sequence can be
transmitted - example suppose 11111111 is a special sequence.
- transmitter inserts a 0 when this appears in the
data - 11111111 -gt 111111101
- must stuff a zero any time seven 1s appear
- 11111110 -gt 111111100
- receiver destuffs.
10SONET
- SONET is the Synchronous Optical Network
standard for digital transport over optical
fiber. - One of the design goals was to be backwards
compatible with many older telco standards. - Beside minimal framing functionality, it provides
many other functions - operation, administration and maintenance (OAM)
communications - synchronization
- multiplexing of lower rate signals
- multiplexing for higher rates
11SONET Framing
- Each STS-1 (Synchronous Transport System) frame
takes 125 ?sec and contains 9 rows of 90 bytes
each gt 51.84 Mbps. (OC-1 optical carrier.) - 1 byte corresponds to a 64 Kbs channel (PCM
voice) - can hold a synchronous payload envelope (SPE)
- Transmission is by column within row.
3 cols transport overhead
87 cols payload capacity, including 1 col path
overhead
9 rows
12The SONET Signal Hierarchy
ANSI SONET
ITU SDH
line rate
SPE rate
STS-1
51.84
50.112
STS-3
STM-1
155.52
150.336
STS-9
STM-3
466.56
451.008
STS-12
STM-4
622.08
601.344
STS-18
STM-6
933.12
902.016
STS-24
STM-8
1244.16
1202.688
STS-36
STM-12
1866.24
1804.032
STS-48
STM-16
2488.32
2405.376
STS-96
STM-32
4976.64
4810.752
STS-192
STM-64
9953.28
9621.504
OC Optical Carrier
13Using SONET in Networks
Add-drop capability allows soft configuration of
networks, self-healing rings.
mux
OC-48
mux
DS1
OC-3c
OC-12c
mux
14Error Coding
- Transmission process may introduce errors into a
message. - Single bit errors versus burst errors
- Detection
- Requires a convention that some messages are
invalid - Hence requires extra bits
- An (n,k) code has codewords of n bits with k data
bits and r (n-k) redundant check bits - Correction
- Forward error correction many related code words
map to the same data word - Detect errors and retry transmission
15Basic ConceptHamming Distance
- Hamming distance of two bit strings number of
bit positions in which they differ. - If the valid words of a code have minimum Hamming
distance D, then D-1 bit errors can be detected. - If the valid words of a code have minimum Hamming
distance D, then (D-1)/2 bit errors can be
corrected.
1
0
1
1
0
HD2
1
1
0
1
0
HD3
16Examples
- A (4,3) parity code has D2
- 0001 0010 0100 0111 1000 1011 1101 1110
- A (7,4) code with D3
- 0000000 0001101 0010111 0011010
- 0100011 0101110 0110100 0111001
- 1000110 1001011 1010001 1011100
- 1100101 1101000 1110010 1111111
- 1001111 corrects to 1001011
- Note the inherent risk in correction consider a
2-bit error resulting in 1001011 -gt 1111011. - There are formulas to calculate the number of
extra bits that are needed to for a certain D.
17Cyclic Redundancy Codes(CRC)
- Commonly used codes that have good error
detection properties. - Can catch many error combinations with a small
number or redundant bits - Based on division of polynomials.
- Errors can be viewed as adding terms to the
polynomial - Should be unlikely that the division will still
work - Can be implemented very efficiently in hardware.
- Examples
- CRC-32 Ethernet
- CRC-8, CRC-10, CRC-32 ATM
18MAC/Logical Link Control
- How do we transfer packets between two hosts
connected to the same network? - Switches connected by point-to-point links --
store-and-forward. - Used in WAN, LAN, and for home connections
- Discussed today
- Multiple access networks -- broadcast based
- Multiple hosts are sharing the same transmission
medium - Used primarily in LANs and wireless
- Need to control access to the medium
- Contention based networks, e.g. Ethernet
- Token based, e.g. FFDI
- Reservation based, e.g. DQDB
19A Switch-based Network
- Switches are connected by point-point links.
- Packets are forwarded hop-by-hop by the switches
towards the destination. - Forwarding is based on the address
- How do nodes exchange packets over a link?
- How does a switch work?
- How do adjacent switches manage the link?
Point-Point link
Switch
PCs at Work
PC at Home
20Switch Architecture
- Takes in packets in one interface and has to
forward them to an output interface based on the
address. - A big intersection
- Same idea for bridges, switches, routers address
look up differs - Control processor manages the switch and executes
higher level protocols. - E.g. routing, management, ..
- The switch fabric directs the traffic to the
right output port. - The input and output ports deal with transmission
and reception of packets.
Control Processor
Switch Fabric
Input Port
Output Port
Output Port
Input Port
Output Port
Output Port
Input Port
Input Port
21Input and Output Port Functions
- Input port identifies the outgoing port and
buffers packets if there is contention for the
switch fabric. - Output port queues packets and a scheduler
determines the order in which packets are sent
over the outgoing link. - Many buffering options exist.
- Input buffering, output buffering, internal
buffering - Typically a combination is used
- Buffer management can limit throughput, e.g. head
of line blocking
Switch Fabric
Address Lookup
Scheduler
Address Lookup
22Switch Fabric Options
- Crossbar switch.
- Requires lots of hardware but good performance
- Multistage interconnection networks an
alternative - Bus-based switches.
- Fabric consists one (or more) fast shared buses
- Each input port has a slot time slot on the bus
- Shared memory switch.
- Switch is one large memory
- Input ports write packets to memory and output
ports read packets from memory - Does not scale well need very fast memory
- Hybrid solutions.
23A Simple Bus-based Switch
Input Ports
Bus
Output Ports
24A Crossbar Architecture
Input Ports
Output Ports
25The Knockout Switch
input buses
concentrators
buffers
26How are Switches Packaged?
- Low-end switches are typically sold as a closed
system. - Commodity part - no options
- Mid-range switches typically offer some options.
- E.g. optional high speed interface, ATM or
Gigabit Ethernet - High-end switches are assembled on spec.
- Chassis has the switch fabric and empty slots
- Control card and power supply can be part of the
chassis or separate - Customer specifies the desired interface cards
- Interface cards are available for both high-speed
(single interface/card) to low-speed links (many
interfaces/card)
27Performance Features to Look For
- Throughput of the backplane in Mbit/second.
- Limits the throughput of all links combined
- Throughput in packets/second
- Limit is often on a per-interface basis
- Typically limits the throughput for small packets
- Redundant power supplies and/or control
processor. - Switch will continue to work after certain
failures - Hot swappable can change cards without bringing
down the switch. - Configuration can be changed or bad interface
cards can be replaced without affecting the other
links
28Link Flow Control and Error Control
- Naïve protocol.
- Dealing with receiver overflow flow control.
- Dealing with packet loss and corruption error
control. - Meta-comment these issues are relevant at many
layers. - Link layer sender and receiver attached to the
same wire - End-to-end transmission control protocol (TCP) -
sender and receiver are the end points of a
connection
29A Naïve Protocol
- Sender simply sends to the receiver whenever it
has packets. - Potential problem sender can outrun the
receiver. - Receiver too slow, buffer overflow, ..
- Not always a problem receiver might be fast
enough.
Receiver
Sender
30Adding Flow Control
- Stop and go flow control sender waits to send
the next packet until the previous packet has
been acknowledged by the receiver. - Receiver can pace the receiver
- Drawbacks adds overheads, slowdown for long
links.
Receiver
Sender
31Window Flow Control
- Stop and go flow control results in poor
throughput for long-delay paths packet size/
roundtrip-time. - Solution receiver provides sender sender with a
window that it can fill with packets. - The window is backed up by buffer space on
receiver - Receiver acknowledges the a packet every time a
packet is consumed and a buffer is freed
Receiver
Sender
32The Bandwidth-Delay Product of a Link
Sender
Receiver
Time
Window Size
Throughput
Roundtrip Time
33A Danger of Flow ControlBack pressure through
the Network
- Back pressure propagates upstream and creates a
cone of congestion. - Can be avoided using specific scheduling
techniques - The alternative is to drop the packets -
sometimes a good idea!
34Dealing with Errors
- Packet corruption.
- Use error detection or correction - results in
lost or correct packet - Receiver can ask for new copy or consider the
packet lost - Assume a stop and go protocol
- Lost packets add time out mechanisms.
- Positive versus negative acknowledgements
- Need sequence numbers in the case of window flow
control
Receiver
Sender
35What is Used in Practice?
- No flow or error control.
- E.g. regular Ethernet, just uses CRC for error
detection - Flow control only.
- E.g. Gigabit Ethernet
- Flow and error control.
- E.g. X.25 (older connection-based service at 64
Kbs that guarantees reliable in order delivery of
data)
36Wide-Area Connections
- X.25, T1, T3, Packets over SONET.
- Standards for transfer of packets over different
media - Trend older technologies include more error
control, while newer technologies use simpler
protocols - ATM Asynchronous Transfer Mode.
- Hot 8 years ago cooler now
- Wireless connections.