Title: Bits Bytes and Packets
1Bits Bytes and Packets
- Unit 5
- Communication Technology
2Data representation
- All digital data is represented as bits (ones and
zeros) - The bits are encoded by varying the electrical
voltage.
Time
Voltage
3Bytes
- The stream of data bits needs to be structured in
some way. - A bit stream is normally divided in groups of 7
bits, sometimes referred to as bytes. - Error checking is important because, during
transmission factors such as electrical
interference may corrupt single or multiple bits
so what is sent as a one may be interpreted at
the receiving end as a zero and vice versa.
1
0
1
1
1
0
0
byte
bits
4Terminology
- Simplex A single direction of data transmission.
- Half Duplex(HDX) Data may be transferred in both
- directions but not simultaneously.
- Full Duplex (FDX) Data may be transferred in both
- directions simultaneously Data may be
transferred in both - directions simultaneously.
5Terminology
- Data Terminal Equipment (DTE) - a terminal
- Data Communication Equipment (DCE) a modem -
Modulator Demodulator
6Terminology
- Asynchronous transmission Data transmitted at a
rate - independent on a clock signal
- Synchronous transmission Data transmitted at a
rate dependent - on a clock signal
- Start Bit A data bit used in Asynchronous
transmission to - determine the start of a data stream
- Stop Bit A data bit used in Asynchronous
transmission to - determine the end of a data stream
- Parity Bit A data bit appended to a data stream
for use for - error checking.
7Parity
- In each group of 7 bits (byte) a parity bit is
added - This is used for error checking.
- If using even parity, a one or zero is added to
the 7 data bits to make the total number of ones
even. - Odd parity is occasionally used, this involves
adding a one or a zero to make the total number
of ones odd. - The sending end adds the parity bit, the
receiving end checks it. - If the receiving end finds a odd number of bits
in a 8 bit byte (when using even parity) is knows
there has been an error.
8Parity example
There are 4 ones in the data, so with even parity
a zero is added to keep the number of ones even
0
1
1
0
1
1
0
0
7 data bits
There are 3 ones in the data, so with even parity
a 1 is added to make the number of ones even
1
1
1
0
0
1
0
0
9Parity
Using even parity, what should the parity bit be
on these bytes?
?
0
0
0
0
1
0
0
?
1
1
0
0
1
1
0
?
0
1
0
0
0
1
0
Parity is a simple method of error detection but
it only works with certain types of error. What
happens if two bits within the byte are wrongly
set?
10Asynchronous transmission
- In the simplest form of data transmission, data
is split up into bytes, and a parity bit is added
- Start and stop bits are also added to help the
receiving end identify successive bytes. Start
bits are zeros, stop bits are ones - Therefore to send 7 bits of data asynchronously
10 bits are required
0
?
1
7 data bits
Stop bit
Start bit
Parity bit
11Asynchronous transmission
- The addition of the start and stop bits reduces
the efficiency of transmission, adding a 20
overhead. - Asynchronous transmission is therefore only
suitable if the volume of data being transferred
is low. - Lack of timing information restricts asynchronous
transmission to low speed. - Timing is important because the receiving end
must know the exact amount of time the sending
end uses to send each bit.
12Synchronous transmission
- Synchronous transmission is used to overcome the
limitations of asynchronous transmission. - Rather than sending individual bytes, a block of
bytes is sent. - Timing information precedes the block of data so
the receiving end can lock on to the timing of
the sender. - With synchronous transmission data and control
(timing) bits are put together in a structure
called a frame or packet.
13Synchronous data packet
- The exact format of the packet depends upon the
protocol in use. - Typically it might looks something like this
Up to 50 data bytes
This byte marks the end of the packet
These are synchronisation bytes
Packet
14Synchronous transmission
- Typically more efficient than asynchronous
because the ratio of data to control information
is higher. - Higher speeds can be achieved because the
synchronisation information sent allows the
receiving end to lock on to the precise timing
using a known bit pattern. - Why limit the amount of data sent in each packet?
Wouldnt it be more efficient to have really
large packet sizes?