Download Computer network- Chapter 3: Data link layer

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Power over Ethernet wikipedia , lookup

AppleTalk wikipedia , lookup

IEEE 1355 wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

CAN bus wikipedia , lookup

Point-to-Point Protocol over Ethernet wikipedia , lookup

IEEE 802.11 wikipedia , lookup

Wake-on-LAN wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Transcript
Olum-fonoon Babol
Computer networks course
Chapter 4
Medium Access Control (MAC)
Fall 2005
By: H. Veisi
Overview
 In broadcast networks (Multi-access/random-access channels)
 The key issue is how to determine who gets to use the
channel when there is competition for it.
 MAC=Protocol to determine who goes next on channel
 It’s important for LANs, WANs are point-to-point.
 The Channel Allocation Problem:
 Static Channel Allocation in LANs and MANs
 FDM and TDM
 Dynamic Channel Allocation in LANs and MANs
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 2
Static channel allocation (1)
 The traditional (phone) way of allocating a single channel is
Frequency Division Multiplexing. FDM works fine for
limited and fixed number of users.
 Inefficient to divide into fixed number of chunks. May not all
be used, or may need more. Doesn't handle burstly traffics of
computer systems.
 From queuing theory (Poisson distribution for C and T):
 T = mean time delay for a channel
 C = capacity (Bits/Sec.)
 λ = arrival rate (Frames/Sec.)
 1/μ = mean length of a frame
Computer networking, Olum-Fonoon Babol
1
T = ---------mC - l
H. Veisi
Fall 2005
Page 3
Static channel allocation (2)
 Example:
 C=100Mbps, 1/μ =10000 Bits, λ =500 Fps
 T=200 Micro Sec.
 If divide this channel into N sub-channels, each with capacity
C/N. Input rate on each of the N channels is λ/N. So:
1
N
T(FDM) = ----------------- = ------------ = NT
μ(C/N) - λ/N
μC - λ
 N times worse for FDM
 In example for N=10 => T=2 Mili Sec.
 Same arguments can apply for TDM
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 4
Dynamic channel allocation (1)
 Assumptions (1):
 Station Model: Assumes that each of N "stations" (packet
generators, Terminal) independently produce frames. The
probability of producing a packet in the interval Δt is λ.Δt
where λ is the constant arrival rate. That station generates no
new frame until that previous one is transmitted.
 Single Channel Assumption: There's only one channel; all
stations are equivalent and can send and receive on that
channel.
 Collision Assumption: If two frames overlap in any way timewise, then that's a collision. Any collision is an error, and both
frames must be retransmitted. Collisions are the only possible
error.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 5
Dynamic channel allocation (2)
Assumptions (2):
 Continuous/ Slotted Time: There's no "big clock in
the sky" governing transmission. Time is not in
discrete chunks.
Frame transmission can begin at
any instant. Alternatively, in slotted, frame
transmissions always begin at the start of a time slot.
Any station can transmit in any slot (with a possible
collision.)
Carrier/No-Carrier Sense: Stations can tell a channel
is busy before they try it. NOTE - this doesn't stop
collisions. LANs have this, satellite networks don't.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 6
Multiple Access Protocols: ALOHA
ALOHA
Developed in Hawaii in the 1970s.
 PURE ALOHA:
 Every station transmits whenever it wants to.
 Colliding frames are destroyed. The sender knows
if its frame got destroyed using feedback property,
and if so waits a random time and then retransmits.
 ANY overlap is a collision.
 Best efficiency if frames are same size.
 A contention system: Multiple users share a
common channel that can lead to conflict.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 7
PURE ALOHA (2)
Pure ALOHA: frames are transmitted at completely arbitrary times.
What is the efficiency of ALOHA?
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 8
PURE ALOHA (3)
 Frame time: Time needed to transmit a standard, fixed-length
frame = Frame length divided by bit-rate
 N= Mean No. of frame per frame-time and infinite users
 if N>1: All frames suffer a collision
 if <0N<1: Expected frame rate
 G = Load= N + frames retransmitted due to previous collisions.
 P0 = Transmission succeeding = probability that a frame does
NOT suffer collision.
 Throughput, S = P0 . G
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 9
PURE ALOHA (4)
Vulnerable period for the shaded frame:
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 10
PURE ALOHA (5)
 Probability that k frames are generated during a
given frame time (Poisson distribution):
Pr[k] =
G k . e-G
-------------k!
 Probability of no traffic initiated during the
vulnerable period: P0 = e-2G so:
 Throughput per frame time is: S = G . e-2G
 Max. channel utilization: G=0.5, S=1/2e=18%
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 11
SLOTTED ALOHA
 Slotted ALOHA:
 Doubles efficiency by dividing time into discrete
intervals. Sends occur only at the start of a slot time.
Vulnerable period is 1/2 of pure Aloha case, so:
S = G . e-G
 Best throughput is at G = 1 , S = 37%
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 12
ALOHA
 Throughput versus offered traffic for ALOHA systems
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 13
CSMA Protocols (1)
 Carrier Sense Multiple Access (CSMA)
 37% utilization is low yet!
 Stations can listen for a carrier and there is no transmission
send it’s data.
 Persistent and non-persistent:
 persistent: When channel is found to be busy, keep
monitoring to find THE instant when it becomes free.
 non-persistent: When channel is found to be busy, don't keep
monitoring to find THE instant when it becomes free.
Instead, wait a random time and then sense again.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 14
CSMA Protocols (2)
 1-persistent CSMA
 Station listens. If channel idle, it transmits. If collision, wait
a random time and try again. If channel busy, wait until idle.
 If station wants to send AND channel == idle then do send.
 Propagation delay has an important effect on transmission.
 Success here depends on transmission time - how long after
the channel is sensed as idle will it stay idle (there might in
fact be someone else's request on the way.)
 Non-persistent CSMA (equivalent to 0-persistent CSMA)
 Same as above EXCEPT, when channel is found to be busy,
don't keep monitoring to find THE instant when it becomes
free. Instead, wait a random time and then sense again.
 Leads to better utilization
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 15
CSMA Protocols (3)
 p-persistent CSMA
 For slotted time channels
 If ready to send AND channel == idle then
send with probability p and with prob. q = 1 - p
defers to the next slot.
 Example:
 0.5-persistent , 0.01-persistent
 Lower probability is better for higher frame
transmission per frame-time
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 16
CSMA Protocols (4)
 Comparison of the channel utilization versus load
for various random access protocols.
Higher load
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 17
CSMA with Collision detection
 CSMA with Collision detection (CD) = CSMA/CD
 CSMA protocols are clearly improved over ALOHA
 CSMA protocols can improve if stations abort their
transmission as soon as they detect a collision.
 Used with LANs.
In CSMA/CD, when a station detects a collision, it stops
sending, even if in mid-frame. Waits a random time
and then tries again.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 18
CSMA/CD (2)
 CSMA/CD can be in one of three states:
1-Contention,
2-transmission,
3-idle.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 19
CSMA with Collision detection
 CSMA with Collision detection (CD) = CSMA/CD
 What is contention interval- how long must station
wait after it sends until it knows it got control of the
channel? It's twice the time to travel to the furthest
station.
 Collision-free protocols:
 Bit-map protocol
 Binary countdown
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 20
IEEE standards for LAN
 IEEE 802.2: Describes the upper part of the data
link layer, the LLC (Logical Link Control).
 Hide the differences between the various kinds of MAC
protocols by providing a single format to network layer
 IEEE 802.2 standard
 Descriptions of the physical and lower part of the
DLL are (MAC):
 IEEE 802.3
 IEEE 802.4
 IEEE 802.5
CSMA/CD LAN
Token Bus
Token Ring
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 21
Ethernet (1)
Ethernet
 LAN standard (IEEE 802.3)
1-persistent CSMA/CD + Binary Exponential Back-off
Architecture of the original Ethernet.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 22
Ethernet (2)
 Ethernet Cabling (1)
10Base=10 Mbps, Base-band signaling
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 23
Ethernet (3)
 Ethernet Cabling (2)
(a) 10Base5,
(b) 10Base2,
(c) 10Base-T.
Transceiver: Electronic circuits that handle carrier
detection and collision detection
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 24
Ethernet (4)
 Ethernet Cabling (3)
 In Binary coding there's no way to distinguish a 0 bit from
nothing-happening. Need to know when is middle of bit
WITHOUT a clock => Manchester Encoding
 In Manchester:
 Bit 1= High-Low
 Bit 0= Low-High
 Used in Ethernet
 Differential Manchester
 Bit 1 indicated by absence of transition at the start of
interval
 Better noise immunity
 Used in Token ring
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 25
Ethernet (5)
 Ethernet Cabling (4)
 Manchester Encoding
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 26
Ethernet (6)
 Ethernet MAC Protocol
DIX Ethernet
IEEE 802.3.
 Preamble
== 7 bytes of 10101010 for synchronization
 SOF: Start of Frame == 1 byte of 10101011 for compatibility with 802.4 and 802.5
 Dest. Add.
== 6 bytes of mac address
 multicast
 Broadcast





Source Ad.
Length/Type
Data
Pad
Checksum
== (47th bit=1) sending to a group of stations.
== (dest. = all 1's) to all stations on network
==
==
==
==
==
6 bytes of MAC address
number of bytes of data/Type of protocol
comes down from network layer
ensures 64 bytes from Dest. Add. addr thru checksum.
4 bytes of CRC.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 27
Ethernet (7)
 1500 data byte restrict Max. frame length to 1526 bytes
 Also need Min. frame length! Why?
 To distinguish valid frames from garbage (Made by collision) need
at-least 64 byte frame.
 If data in frame is less than 46 [=64-18] the Pad field is used
to filled out frame to Min. frame length.
 To prevented a station from completing the transmission of a
short frame before the first bit has reached the far-end of the
cable, where it may collide
 Transmitter need 2τ time to detect noise of collision, where τ
is propagation time of a frame to reach another end of cable.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 28
Ethernet (8)
 Collision detection can take as long as 2τ
 For a 10Mbps LAN with max. length of 2500 meters and 4 repeaters
the round-trip time= τ ≈ 50 μsec. So Min. frame length=500 bits => 64
bytes
 As the network speed goes up, the Min. frame length must go up or
Max. length of cable come down.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 29
Ethernet (9)
 Binary exponential back-off algorithm:
 Determine how randomize is done when collision occurs.
 After a collision, station waits 0 or 1 slot. If it collides again
while doing this send, it picks a time of 0,1,2,3 slots. If again
it collides the wait is 0 to 23 -1 times.
 In general after i collisions an random number between 0 and
2i-1 is chosen and that number of slots is skipped.
 Max time is 210 -1 (or equal to 10 collisions.) After 10
collisions, an error is reported.
 Slot is determined by the worst case times; 500 meters + 4
repeaters = 512 bit times = 51.2 μsec.
 Algorithm adapts to number of stations.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 30
Ethernet (10)
 Ethernet Performance (1)
 Channel efficiency depends on





F: Frame length,
B: Network Bandwidth,
L: Cable Length,
C: Speed of signal propagation,
e: optimal number of contention slots per frame.
 T= Time for transmission a frame = F/B
 τ = is propagation time of a frame thru cable = L/C
 A= Probability that a station acquires the channel in a slot with
contention, Optimum=1/e
T
1
channel efficiency = ------------------ = --------------------------T+2τ/A
1 + 2BLe/cF
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 31
Ethernet (10)
 Ethernet Performance
 Efforts focus on improving both B and L, both of which will
decrease efficiency.
 In all theatrical researches on performance evaluation of
Ethernet, it’s assumed that traffic is Poisson but in real data
they are not Poisson, but self similar.
 Efficiency of Ethernet
at 10 Mbps with 512-bit slot times:
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 32
Fast Ethernet
 IEEE 802.3u: An addendum of existing 802.3 (1995)
 Idea: keep all old frame formats, interfaces and procedural rules
but just reduce bite time from 100 nsec. to 10 nsec.
 Commonly use twisted pair cabling
 100Base-T4: Use Ternary (3-level) signaling and UTP-Cat3 cabling
 100Base-TX: Use 4B/5B (use 5 bits for transmit 4 bits) signaling
and UTP-Cat5 cabling
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 33
Gigabit Ethernet (1)
 IEEE 802.3z: Another addendum of existing 802.3 (1998)
 Goal: make 10 times faster + Compatible with existing
Ethernet standard
 Support unacknowledged datagram service in both unicast
and multicast
 Configuration is point-to-point rather than multi-drop (Use
Hub or Switch)
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 34
Gigabit Ethernet (2)
 Two different modes:
 Full-Duplex:
 Allows traffic in both directions at same time
 Is used when there is a switch connect to computer or
other switches
 All lines are buffered  Contention is impossible 
CSMA/CD is not used
 Half-Duplex
 When computers connect to Hub rather than Switches
 Don’t buffer frames, is just like classic Ethernet 
Need CSMA/CD protocol  Reduce length of cable
 Carrier Extension: Tell hardware to add its own
padding to extend frame length to 512 bytes.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 35
Gigabit Ethernet (3)
 Frame Bursting: Allow a sender to transmit a
concatenated sequence of frames in a single
transmission.
 This is efficient and perfect over carrier extention
 Cabling
 Use 8B/10B signaling for Fiber optic
 Use different encoding for 1000Base-T
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 36
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (1)
 User generate some data:




Data are passed to Transport layer and adds a header, i.e. TCP header
The resulting unit passes down to Network layer, adds headers, IP packet
Then goes to DLL which adds its own header (CRC)
Resulting frame given to Physical layer
These devices operate in different layers 
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 37
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (2)
 Physical layer:
 Repeaters:
 Analog devices that are connected two cable segments,
Amplifying incoming signal from one side and send out other.
 Don’t understand frames, packets or headers, Just
understand Volt
 In classic Ethernet, to extend max. cable length from 500
meters to 2500 meters, 4 repeaters was allowed.
 Hubs:
 Has a number of input lines that it joins electrically. Frames
arriving on any of the lines are send out on all others.
 If two frames arrive at the same time  Collision occurs
 Are like repeater and don’t understand frames, but usually
don’t amplify incoming signal
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 38
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (3)
 Data Link Layer:
 Bridges:
 Connect two or more LANs.
 Use des. Add. In frame header to
determine destination
 Switches:
 Are like Bridges and use des. Add. To find the route.
 Used to connect individual computers  need more number
of ports, each port has own collision domain.
 Store & Forward: Get entire a frame then transmit
 Cut-through-switches: start forwarding the frame as soon as
the des. Add. Field has come in.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 39
Repeaters, Hubs, Bridges, Switches, Routers and Gateways (4)
 Network layer:
 Routers:
 When a packet comes into, the frame header and trailer
are stripped off and packet located in the frame’s payload
field is passed routing software.
 Transport and Application layer:
 Transport gateway:
 Connect two computers that use different connectionoriented transport protocols.
 Ex. TCP/IP and ATM
 Application gateway:
 Understand the format and content of data and translate
message from one format to another one.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 40
Virtual LAN (1)
 Logical rather than physical configuration in hubbed
or switched Ethernet
 Reasons?
 Security, Load, Broadcast,
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 41
Virtual LAN (2)
 In VLAN:
 How many VLANs there will be?
 Which computer will be on which VLAN?
 What the VLANs will be called?
 Four physical LANs organized into two VLANs, gray and white,
by (a) two bridges. (b) by switches.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 42
Summary
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 43
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 44
ATM (1)
 ATM (Asynchronous Transfer Mode)
 Is underlying mechanism. Transmits in small fixedsize cells.
 A connection-oriented network
 Use virtual circuits and small, fixed-size packets
(Cells)
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 45
ATM (2)
 Packet (cell) switching is dramatic change for phone
companies.
ATM is connection oriented; make connecting
request first; then all cells follow the same path.
Target is 155 Mbps and 622 Mbps. Allows TV
transmission.
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 46
ATM (3)
 ATM Reference Model:
 3 layers:
1- Physical layer :
 Physical medium (voltage, bit timing, ….)
2- ATM layer :
 deal with cells and transports it + establish/release
virtual circuits + congestion control
3- ATM adaptive layer :
 Segment large cells and resemble after transmission
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 47
ATM (4)
 ATM Reference Model:
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 48
ATM (5)
 Comparisons to other models:
Computer networking, Olum-Fonoon Babol
H. Veisi
Fall 2005
Page 49