Computer Networks
Lecture 8
Ethernet Timing
Dr:- Rania Abul Seoud
[email protected] © 2003, Cisco S ystems, Inc. A ll rig hts reserved. 1
Ethernet Timing
• Ethernet CSMA/CD is half duplex it is either sending or
receiving.
• While sending it continuo sensing to detect collision so it
cannot receive.
• While receiving it will wait until the data received correctly
before doing any other operation.
• 1-Bit Time:- In half duplex the sending station transmit 64
bit of time synchronization information (preamble).
• Bit time:- The duration of one pulse (one bit).
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 2
2- Inter-frame Spacing
• The minimum spacing between two non-colliding frames.
• The minimum interval, in bit-times, that a station has to wait
before sending another frame
• This is measured from the last bit of the FCS field of the first
frame to the first bit of the preamble of the second frame.
• This interval is referred to as the spacing gap.
• The gap is intended to allow slow stations time to process
the previous frame and prepare for the next frame.
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 3
Inter-frame Spacing
• After a frame has been sent, all stations on a 10-
Mbps Ethernet are required to wait a minimum of 96
bit-times (9.6 microseconds) before any station
may legally transmit the next frame.
• On faster versions of Ethernet the spacing remains
the same.
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 4
4- Propagation Delay (tprop )
• Messages take a certain amount of time to propagate
between two stations through the physical media which is
known as the propagation delay.
• The signals transmitted by Ethernet stations encounter
delays as they travel through network.
• The longer the cable segments and the more hubs in the
network, the longer it takes for a signal to propagate from
one end of the network to the other.
Cables Delay :- d Cable delay =
t prop t = length /speed.
prop
V
d :- is the length between the sender and receiver.
V :- Propagation Speed
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 5
Propagation Speed (V)
• Speed of a medium that the data travels through.
Medium Propagation Speed
------------ ------------------------------
Thick Coax .77c (231,000 km/sec)
Thin Coax .65c (195,000 km/sec)
Twisted Pair .59c (177,000 km/sec)
Fiber .66c (198,000 km/sec)
(c :- speed of light in a vacuum, 3x1o8 m/s)
For 10Base2 network:- L = 185 m, V =195,000km/sec
dist 185
t = = = 950n sec
prop 185 m
speed 1.95 ×10 8
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 6
5- Frame Transmission Time
• It is the time required to put all frames bits over the physical
channel.
• It is dependent on the modem transmission rate.
• Example
If Transmission Rate is 1 Mbps and frame Size (Lf) is 8000
bits then
Transmission Time is:
Tt = 8000/1*106=8 ms
• It is the time required to put all frames bits over the physical
channel.
• It is dependent on the modem transmission rate.
• Example
If Transmission Rate is 1 Mbps and frame Size (Lf) is 8000
bits then
Transmission Time is:
T = 8000/1*106=8 ms
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 7
Illustrative Figure - 1
T0 = tprop + tt
Physical Channel
Machine A Machine B
tprop
Tt=8 ms
Time
© 200 3, Cisco Syste ms, Inc. All righ ts reserved.
Time 8
Illustrative Figure - 2
Machine A Machine B
Physical Channel
T0 = tprop+tproc+ tf
tt= Lf / R tprop
tt=Lf/R
tProc → Processing Time
tproc
T0 = Total Time to Transmit 1 Frame
tprop Propagation Time
tproc Processing Time
tf Frame Transmission Time
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 9
Assume that Propagation and processing times are negligible
Event Timing (Example -1) tt = 4.8 ms
Router A Router B Router C Router D
Tt 1 4.8 ms 1 4.8 ms
2 21 4.8 ms 1 9.6 ms
2 21 4.8 ms
1 14.4 ms
2 Tt(one frame) =
21 4.8 ms 1 19.2 ms
24 ms
2 21 4.8 ms 1 24 ms
2 2
4.8 ms
Tt( Whole frames ) = (4.8 ms * 5)24 ms + (number of frames -1) x
4.8 ms 10
© 200 3, Cisco Syste ms, Inc. All righ ts reserved.
Event Timing (Example -2)
Router A Router B Router C Router D
Total
Totaltime
time
to
totransfer
transfer
12 frames
frames tt tProp
1 1
between
between tProc
2 2 1 tProp
PC1
PC1andand 1
2 tProc tProp
PC2
PC2 Data 2
1 1
tProc
Transfer 2 2 tProp
1 1
tProc tProp
2 2
Tt (Router) 1 1
= Tt (PC) 2 2
Time Time Time Time Time Time
Time one frame T = 5 tt + 4 tProc + 5 tProp
Total time T0 = 6 tt + 4 tProc + 6 tProp
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 11
Event Timing (Example -2)
tt(Router) = tt (PC) = 4.8 ms
Total frame time T0 = (no of links) tt + (no of links - 1)
tProc + (no of links) tProp
• Total 2 frames time T0 = (no of links) tt + tt +
(no of links - 1) tProc + (no of links) tProp + tProp
• Total n frames time T0 = (no of links) tt + (number
of frames (n) -1) x tt + (no of links - 1) tProc + (no of
links) tProp + (number of frames (n) -1) tProp
© 2003, Cisco S ystems, Inc. A ll rig hts reserved. 12
Event Timing (Example - 3)
Router A Router B Router C Router D
• tt (Router A) = 9.375 ms
• tt (Router B) = 2.4 ms
• tt (Router C)=9.375 ms
• tt (Router D)= 4.8 ms
• tt (PC) = 4.8 ms
Assume that Propagation and processing times
are negligible
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 13
Assume that Propagation and processing times are negligible
Router A Router B Router C Router D
Tt 1 4.8 ms 1 4.8 ms
2 2
1 9.375 ms 1
14.175 ms
1 2.4 ms 1 16.575 ms
2 2
Tt(one frame) =
1 9.375 ms 1 30.75 ms
2 2 25.95 ms
1 4.8 ms 1
2 2
30.75 ms
2 4.8 ms
2 9.375
ms
Tt( Whole frames ) = 30.75 ms + (number of frames -1) x 9.375 ms
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 14
6- Round-trip
Maximum Propagation
Round-trip Propagation Time
Time
• It is the time taken by one bit of the frame to go
from one end of the cable to the other end and
back. (2 tprop ).
• Round-trip Propagation Time = twice the one way
propagation delay.
• Maximum Round-Trip Delay (tr-t ) ≥ 2 x propagation
delay (tprop )
T round _ trip
≥ 2×t prop
• An important parameter that determines the time
to detect a collision is the round-trip propagation
delay time.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 15 15
Question …
• How long does a device have to wait until it knows that its
message has not been corrupted by a collision?
• The Round-trip time < Frame Transmission Time of a frame
of the minimum frame length to ensure that a station is
always able to detect if a frame has collided with a frame
from another node or station.
Round-trip Propagation Time & Frame Transmission Time
• Restrictions: Each frame should be as long as the time
to detect a collision equal at least twice (x2) maximum
propagation delay. Time to finish transmitting a frame
• The time required to transmit a frame:-
• If it is < Tp ;a station cannot detect a collision.
• If it is = Tp ;a station cannot detect a collision.
• If it is = 2 Tp; a station may detect a collision.
• If it is > 2 Tp; a station can detect a collision.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 16
Round-trip Propagation Time & Frame
Transmission Time
• After one complete round trip propagation time (twice the
one way propagation delay), both NICs are aware of the
collision. Finally the cable becomes idle.
Why was Ethernet Successful
• Ethernet has been the most successful LAN technology
largely because of its simplicity of implementation
compared to other technologies.
• Ethernet has also been successful because it has been a
flexible technology that has evolved to meet changing
needs and media capabilities.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 17
10-Mbps and 100-Mbps Ethernet
Parameter Value
Bit Time 100ns
Slot Time 512 bit times
Interframe Spacing 96 bit times
Collision Attempt Limit 16
Collision Backoff Limit 10
Collision Jam Size 32
Max. Untagged Frame Size 1518
Minimum Frame size 512 Bits (64 octets)
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 18
Logical Link Control
(LLC)
to Network Layer
Logical Link
Data Link
Control
Layer
Medium Access
Control
to Physical Layer
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 19
Functions of the LLC
Data Link control protocols provide different services
to the network layer:
1. Flow Control :-The sender must not send frames at a rate
faster than the receiver can absorb them.
2. Error detection:-Detect that an error occurred in the
received data
1. Error Correction: Receiver identifies and corrects bit
error(s) without resorting to retransmission.
3. Error Control:- If error occurred ,the transmitter will
retransmit or not?
4. Framing & Frame synchronization: :-the beginning and
end of each frame must be recognized.
20
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 20
Layer 2 Framing
• Framing is the Layer 2 encapsulation process.
• A frame is the Layer 2 protocol data unit.
• The frame format diagram shows different groupings of
bits (fields) that perform other functions.
• Framing provides essential information that could not be
obtained from coded bit streams alone.
• This information includes the following:
• Which computers are in communication with each
other.
• When communication between individual computers
begins and when it ends.
• Which errors occurred while the computers
communicated.
21
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 21
Framing Format
• Frame format is the same, allowing interoperability
between all varieties of legacy, fast, gigabit, and 10
Gigabit, with no reframing or protocol conversions.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 22
Ethernet Frame Structures
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 23
Ethernet Frame Fields:- Preamble
• start transmission by sending an 7 byte (56 bit) preamble.
• It is an alternating pattern of ones and zeros used to time
synchronization in 10 Mbps and slower implementations of
Ethernet.
• Faster versions of Ethernet are synchronous so this timing
information is unnecessary but retained for compatibility.
7 bytes with pattern 10101010.
Used to synchronize receiver, sender clock rates.
It serves to give components in the network time to
detect the presence of a signal, and being reading the
signal before the frame data arrives.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 24
Ethernet Frame Fields:- SFD
•After synchronization is established, the
SFD is used to locate the first bit of the
frame.
•A start-of-frame delimiter (SFD)consists
of a one-octet field that marks the end of
the timing information and contains the
bit sequence 10101011.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 25
Preamble + SFD
• Each station has its own oscillating clock, the
communicating stations have to have some way to
"synch up" their clocks and thereby agree on how
long one bit time is.
• A station on an Ethernet network detects the
change that occurs when another station begins to
transmit, and uses the preamble to "lock on" to the
sending station's clock signal.
• Once locked on, the receiving station waits for the
11 that signals that the Ethernet frame follows.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 26
LAN Technologies
Ethernet Frame Structure: Addresses
6 bytes, frame is received by all adapters on a
LAN and dropped if address does not match.
• The destination Address:- can be unicast,
Multicast or broadcast.
• The source Address:- it is unicast, containing
source MAC.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 27
Ethernet Frame Structures:- Length/Type
• When a node receives a frame it must examine the
Length/Type field to determine:-
• If the two-octet value (2 bytes) is equal to or greater than
00600 hexadecimal, 1536 decimal, then the contents of the
Data Field are decoded according to the protocol indicated
- which higher-layer protocol is present - (type).
• Else the contents of the Data Field are decoded according
to the number of bytes of data that in the data field (length).
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 28
LAN Technologies
Ethernet Frame Structure : Data
Maximum 1500 bytes, minimum 46 bytes.
If data is less than 46 bytes, pad with zeros to
46 bytes
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 29
LAN Technologies
Ethernet Frame Structure : FCS
4 bytes generated code for checking errors in data field.
CRC: Performing calculations on the data.
Checked at receiver, if error is detected, the frame is
simply dropped
• A received frame that has a bad Frame Check Sequence,
also referred to as a checksum or CRC error, differs from
the original transmission by at least one bit.
• In an FCS error frame the header information is probably
correct, but the checksum calculated by the receiving
station does not match the checksum appended to the end
of the frame by the sending station.
• The frame is then discarded.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 30
Total frame size
• Frame size depends on the length of data being
transmitted.
• Min length of data = 46 byte.
• Max length of data = 1500 byte.
• Min frame size= 6+6+2+4+46=64 byte.
• Max frame size = 6+6+2+4+1500=1518 byte.
• Preamble are considered not part of the frame
when calculating the size of the overall frame.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 31
Timing Calculation
• For 10 Baser-T :
Bit time = 100ns R = 10 Mbps
1 1
t = = = 0.1μ sec
bit
R 10,000,000
L :- frame size is 512 bit
t = L × t = 512 ×100n sec = 51.2 μ sec
f b
t
t ≥ 2×t t ≤
frame
f
2prop
© 200 3, Cisco Syste ms, Inc. All righ ts reserved.
prop
32
Minimum frame size
• For 10 Mbps Ethernet minimum frame size is 64
octets as discussed before
• Main reason: sender should not finish sending a
frame before max round trip time delay.
Minimum time for a frame:
T = 64 × 8 ×100ns = 0.067 μs
min
Maximum time for a frame:
T = 1518 × 8 ×100ns = 1.2ms
max
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 33
Frame Synchronization
• Data link layer breaks the bit stream up into discrete
frames.
• A way for a sender to transmit a set of bits that are
meaningful to the receiver should be provided .
• One way to achieve this framing is to insert time gaps
between frames.
• However, networks rarely make any guarantees about
timing, so it is possible these gaps might be squeezed out
or other gaps might be inserted during transmission.
• The frame boundaries should be identified.
• There are different types of framing, each of which provides
a way for the sender to tell the receiver where the block of
data begins and ends:
• Framing Methods:-
1. Character Count.
2. Starting and Ending Flags with Bit Stuffing.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 34
1.Character Count
• Uses a Field in the header that specifies the
number of characters in the frame.
• Destination’s data link layer then knows the
number of characters, thus the end of the frame.
• Char count includes the counting character itself:
Frame 1 Frame 2 Frame 3
6 Characters 5 Characters 8 Characters
6 5 8
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 35
Problems….
• Transmission error changed 5 to 7.
• All frames now out of synch.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 36
Problems….
• Problem occurs when the count is lost or in error.
• Very difficult to resynchronize after count loss/error.
• Even if we detect error, we have no way of
recovering - of finding where next frame starts.
⚫ If there is mistake in reading the header:-
⚫ Synchronization is Lost
⚫ The receiver has no way to know where does
the frame start afterwards
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 37
2.Starting and Ending Flags with Bit Stuffing
• Each Frame begins and ends with a special bit
pattern 01111110 (Flag Byte).
• Bit Stuffing:-If Data has 5 Consecutive 1S → ADD 0
▪ Whenever the sender's data link layer encounters
five consecutive 1s in the data, it automatically stuffs
a 0 bit into the outgoing bit stream.
Flag Byte Data Flag Byte
01111110 0011011101111110101011111010 01111110
Flag Byte Data Flag Byte
01111110 001101110111110101010111110010 01111110
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 38
2.Starting and Ending Flags with Bit Stuffing
When the receiver sees five consecutive incoming 1
bits, followed by a 0 bit, it automatically destuffs (i.e.,
deletes) the 0 bit.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 39
2.Starting and Ending Flags with Bit Stuffing
• This technique allows data frames to contain an
arbitrary number of bits and allows character
codes with an arbitrary number of bits per
character.
• The boundary between two frames can be
unambiguously recognized by the flag pattern.
• If the receiver loses track of where it is, all it has to
do is scan the input for flag sequences, since they
can only occur at frame boundaries and never
within the data.
© 200 3, Cisco Syste ms, Inc. All righ ts reserved. 40