You are on page 1of 46

Computer Networks

Lecture 8

Ethernet Timing

Dr:- Rania Abul Seoud


R-abulseoud@k-space.org
© 2003, Cisco Systems, Inc. All rights reserved. 1
Ethernet Timing
• Ethernet CSMA/CD is half duplex.
• it is either sending or receiving.
• While sending it continues sensing to detect collision so it
cannot receive.
• While receiving it will wait until the data received correctly
before doing any other operation.

© 2003, Cisco Systems, Inc. All rights reserved. 2


1-Bit Time
• 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 Systems, Inc. All rights reserved. 3


2- Interframe 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.
gap
• The gap is intended to allow slow stations time to process
the previous frame and prepare for the next frame.

© 2003, Cisco Systems, Inc. All rights reserved. 4


2- Interframe Spacing

© 2003, Cisco Systems, Inc. All rights reserved. 5


2- Interframe Spacing
• After a frame has been sent, all stations on a 10Mbps
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 interframe spacing
remains the same.

© 2003, Cisco Systems, Inc. All rights reserved. 6


• Delay for the first bit to go from a source to a destination.
• 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 the 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 end.

d
t =
prop
V
d: the length of physical link between sender and receiver.
V: Propagation Speed
© 2003, Cisco Systems, Inc. All rights reserved. 7
Propagation Speed (V)
Propagation speed is the 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 optic .66c (198,000 km/sec)
(c: the 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

© 2003, Cisco Systems, Inc. All rights reserved. 8


© 2003, Cisco Systems, Inc. All rights reserved. 9
• An important parameter that determines the time
to detect a collision is the round-trip propagation
delay time.
© 2003, Cisco Systems, Inc. All rights reserved. 10
Maximum Round-trip Propagation Delay Time

© 2003, Cisco Systems, Inc. All rights reserved. 11


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 propagation delay 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.

• Restrictions: each frame should be as long as the time to


detect a collision equal at least twice the one way
propagation delay.

© 2003, Cisco Systems, Inc. All rights reserved. 12


© 2003, Cisco Systems, Inc. All rights reserved. 13
Round-trip Propagation Delay Time & Frame
Transmission Time
• After one complete round trip propagation delay 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 been the most successful LAN technology
largely because it has been a flexible technology that has
evolved to meet changing needs and media capabilities.
© 2003, Cisco Systems, Inc. All rights reserved. 14
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)
© 2003, Cisco Systems, Inc. All rights reserved. 15
Illustrative Figure - 1

Physical Channel

Machine A Machine B

tprop

Time
Time

© 2003, Cisco Systems, Inc. All rights reserved. 16


Illustrative Figure - 1

© 2003, Cisco Systems, Inc. All rights reserved. 17


Illustrative Figure - 2
Machine A Machine B

Physical Channel

tprop

Time Time
© 2003, Cisco Systems, Inc. All rights reserved. 18
Illustrative Figure - 2

© 2003, Cisco Systems, Inc. All rights reserved. 19


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 (n) -1) x 4.8 ms
© 2003, Cisco Systems, Inc. All rights reserved. 20
Event Timing (Example -2)
Router A Router B Router C Router D
T0 = Total
time to
tProp
transmit tt 1 1
tProc
2 frames 2 2 1 tProp
1
between tProc
2 2 tProp
PC1 and Data
1 1
tProc
PC2 Transfer 2 2
1
tProp
1
tProc tProp
2 2
Tt (Router) 1 1
= Tt (PC) 2 2
Time Time Time Time Time Time
T0 = 6 tt + 4 tProc + 6 tProp
© 2003, Cisco Systems, Inc. All rights reserved. 21
Event Timing (Example -2)
tt (Router) = tt (PC) = 4.8 ms
• T0 ( Total time to transmit 1 frame) = (no of links) tt +
(no of links - 1) tProc + (no of links) tProp

• T0 ( Total time to transmit 2 frames) = (no of


links) tt + tt + (no of links - 1) tProc + (no of links)
tProp + tProp

• T0 ( Total time to transmit n frame) = (no of links) tt


+ (number of frames (n) -1) tt + (no of links - 1) tProc +
(no of links) tProp + (number of frames (n) -1) tProp
© 2003, Cisco Systems, Inc. All rights reserved. 22
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
© 2003, Cisco Systems, Inc. All rights reserved. 23
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 1
2 2
4.8 ms 30.75 ms

2 4.8 ms
2 9.375
ms

Tt( Whole frames ) = 30.75ms + (number of frames (n) -1) x 9.75 ms


© 2003, Cisco Systems, Inc. All rights reserved. 24
Logical Link Control
(LLC)

to Network Layer

Logical Link
Control
D ata Link
Layer

Medium Access
Control

to Physical Layer
© 2003, Cisco Systems, Inc. All rights reserved. 25
Functions of the LLC sublayer
Data Link layer control protocols provide different
services to the network layer:
 Flow Control : The sender must not send frames at a rate
faster than the receiver can absorb them.
 Error Control: If error occurred ,the transmitter will
retransmit or not?
 Error detection: Detect that an error occurred in the
received data
 Error Correction: Receiver identifies and corrects bit
errors without resorting to retransmission.
 Framing & Frame synchronization: the beginning and end
of each frame must be recognized.
© 2003, Cisco Systems, Inc. All rights reserved. 26
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 essential 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.
© 2003, Cisco Systems, Inc. All rights reserved. 27
Frame Format
• Frame format is the same, allowing interoperability
between all varieties of legacy, fast, Gigabit, and 10
Gigabit, with no reframing or protocol conversions.

© 2003, Cisco Systems, Inc. All rights reserved. 28


Ethernet Frame Structures

© 2003, Cisco Systems, Inc. All rights reserved. 29


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 10Mbps Ethernet and slower
implementations of Ethernet.
• Faster versions of Ethernet are synchronous so that this
timing information is unnecessary but retained for
compatibility.
• 7 bytes with pattern 10101010.
• It is 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.

© 2003, Cisco Systems, Inc. All rights reserved. 30


Ethernet Frame Fields: SFD
• After synchronization is established, the SFD is used to
locate the first bit of the frame.
• The start-of-frame delimiter (SFD) consists of one-octet
(1 byte) field that marks the end of the timing information
and contains the bit sequence 10101011.

© 2003, Cisco Systems, Inc. All rights reserved. 31


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.

© 2003, Cisco Systems, Inc. All rights reserved. 32


LAN Technologies

Ethernet Frame Fields: Addresses


• 6 bytes, frame is received by all adapters on a LAN and
dropped if address does not match.
• The destination Address: it can be unicast, multicast or
broadcast, containing destination MAC.
• The source Address: it is unicast, containing source MAC.

© 2003, Cisco Systems, Inc. All rights reserved. 33


Ethernet Frame Fields: Length/Type
• When a node receives a frame it must examine the
Length/Type field to determine:-
• If the two-octet (2 bytes) value 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).

© 2003, Cisco Systems, Inc. All rights reserved. 34


LAN Technologies

Ethernet Frame Fields: Data


• Maximum 1500 bytes, minimum 46 bytes.
• If data is less than 46 bytes, pad with zeros to 46 bytes.

© 2003, Cisco Systems, Inc. All rights reserved. 35


LAN Technologies

Ethernet Frame Fields: FCS


• 4 bytes generated code for checking errors in the data field.
• CRC: Performing calculations on the data.
• Checked at receiver, if an error is detected, the frame is
simply dropped.
• A received frame that has a bad Frame Check Sequence
(FCS), 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.

© 2003, Cisco Systems, Inc. All rights reserved. 36


Total frame size (L)
• Frame size depends on the length of data being transmitted.
• Minimum length of data = 46 byte.
• Maximum length of data = 1500 byte.
• Minimum frame size= 6+6+2+4+46=64 byte.
• Maximum frame size = 6+6+2+4+1500=1518 byte.
• The preamble is considered not part of the frame when
calculating the size of the overall frame.

© 2003, Cisco Systems, Inc. All rights reserved. 37


Timing Calculation
• For 10 Base-T :

L = frame size = 512 bits

© 2003, Cisco Systems, Inc. All rights reserved. 38


Minimum frame time - Maximum frame time

• For 10 Mbps Ethernet the minimum frame size is 64 bytes (512


bits) and the maximum frame size is 1518 bytes (12144 bits) as
discussed before.
• Main reason: sender should not finish sending a frame before
maximum round trip propagation time delay.

Minimum frame time:

Maximum frame time:

© 2003, Cisco Systems, Inc. All rights reserved. 39


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.
© 2003, Cisco Systems, Inc. All rights reserved. 40
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.
• Character count includes the counting character itself.

Frame 1 Frame 2 Frame 3


6 Characters 5 Characters 8 Characters

6 5 8

© 2003, Cisco Systems, Inc. All rights reserved. 41


Problems….
• Transmission error changed 5 to 7.
• All frames now are out of synchronization.

© 2003, Cisco Systems, Inc. All rights reserved. 42


Problems….
• Problems occur when the count is lost or in error.
• Very difficult to resynchronize after the count is lost or in
error.
• Even if we detect error, we have no way of recovering, we
have no way of finding where the next frame starts.
 If there is a mistake in reading the header:
Synchronization is Lost.
The receiver has no way to know where does the frame
start afterwards.

© 2003, Cisco Systems, Inc. All rights reserved. 43


2.Starting and Ending Flags with Bit Stuffing
• Each Frame begins and ends with a special bit pattern
01111110 (Flag Byte).
• Bit Stuffing: If the data has five Consecutive 1'sADD 0 bit.
• Whenever the sender's data link layer encounters five
consecutive 1's 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


© 2003, Cisco Systems, Inc. All rights reserved. 44
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.

© 2003, Cisco Systems, Inc. All rights reserved. 45


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 the 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.

© 2003, Cisco Systems, Inc. All rights reserved. 46

You might also like