Presentation is loading. Please wait.

Presentation is loading. Please wait.

Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols.

Similar presentations


Presentation on theme: "Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols."— Presentation transcript:

1 Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols

2 Packets, frames and error detection Packets and frames Control data and byte stuffing Error detection - parity bits, checksums and cyclic redundancy checks

3 Packets Most networks transmit data in small blocks called packets –helps to detect transmission errors –gives fair access for a shared connection between many computers These are packet networks or packet switching networks

4 An example of fair access A wants to send a 5 megabyte file to C B wants to send a 10 kilobyte file to D network speed is 56,000 bits per second

5 Packets and time division multiplexing Packet networks use a form of TDM

6 Packets and hardware frames Each type of hardware defines its own format/wrapping for a packet called a frame

7 Simple example of framing A frame may include “unused” control data values to mark both its beginning and end Advantage is error detection: –transmitter crashes => eot will not arrive –receiver crashes => soh marks next valid frame Disadvantages: –requires two extra characters per frame –cannot carry arbitrary values (e.g, soh and eot)

8 Byte stuffing So control characters can be included in data Reserve a special character to mark the occurrence of control characters Transmitter scans data block and replaces all occurrences of control characters. Receiver performs the reverse mapping. Character in dataCharacters sent soh esc x eot esc y esc esc z

9 An example of byte stuffing Frame before byte stuffing Frame after byte stuffing

10 Transmission Errors Much of the complexity of networks arises from susceptibility to interference that can cause: –transmitted data to be lost or changed –random data to appear Single-bit errors versus burst errors

11 Error Detection and Correction First we need to detect errors –Sender includes some extra (redundant) information that summarises the original data –Receiver checks this –Various schemes, differing in complexity, data overhead and robustness Then we need to decide what to do –Error correction –Retransmission

12 Parity bits and parity checking Count number of 1 bits in the data and add an extra parity bit to make this odd or even –even parity - parity bit is set so that total number of 1s is even - 1011001 => parity bit 0 –odd parity - total 1s should be odd - 1011001 => parity bit 1 Transmitter calculates and adds, receiver calculates and checks Introduces additional costs Only detects limited types of errors

13 Other error detection methods Other methods include checksums and cyclic redundancy checks These can be compared according to: –amount of extra data to be transmitted –amount of extra computation involved –types of errors that are detected Note the difference between detecting that an error occurred and knowing how to fix it

14 Checksums –Interpret the data as if it were a sequence of integers and add them together to get an integer result called a checksum –Add in any carry bits too –Append the checksum to the frame –16 and 32 bit checksums are common and are usually computed for a whole packet

15 Example checksum

16 Evaluation of checksums Data overhead - 16 or 32 bits Computational overhead - simple additions Undetected errors - some periodic reversal of bits (e.g., reversing one bit in each of four data items)

17 Example failure of checksums data item (binary) 0001 0010 0011 0001 totals checksum value 1 2 3 1 7 data item (binary) 0011 0000 0001 0011 totals checksum value 3 0 1 3 7

18 Cyclic redundancy checks (CRCs) Detects more errors than checksums and only requires simple hardware Based on binary division rather than addition

19 Overview of CRC Uses binary division instead of addition Sender wants to send D, a piece of data d bits long Sender and receiver agree a generator, G, a bit pattern that is r + 1 bits long Sender appends R (an additional sequence of r bits) to D so that the resulting sequence is exactly divisible by G using binary (modulo 2) arithmetic Receiver divides the received bit pattern by G and checks whether the remainder is 0

20 Can detect burst errors of less than r +1 bits and odd number of bit errors Can detect burst errors of length greater than r + 1 with probability 1 – 0.5 r D: Data bitsR: CRC bits d bitsr bits

21 CRC - hardware components Exclusive or (xor) unit

22 CRC - hardware components Shift register

23 CRC - combining components Combine 3 shift registers and 3 xor units Initialise registers and then feed in the bits of the message one at a time Final state gives the CRC - calculated by both the transmitter and receiver

24 Evaluation of CRCs Data overhead - 16 or 32 bits Computational overhead - low - combines simple hardware devices Types of errors - good for burst errors - changes to several bits in one location that may be caused by a sudden interference (e.g. by lightening)

25 Why do CRCs work? Mathematical analysis is beyond our scope Intuition –each single bit of the message dramatically affects the whole CRC (feeds into three places) –the effect of each bit loops through the process several times (the registers are connected into a cycle)

26 Revised frame format Frames now contain a data block, framing information and error detection information Transmitter does: data -> byte stuffing -> framing -> error detection and receiver does the reverse

27 Summary Packets and frames Control data and byte stuffing Error detection - parity bits, checksums and cyclic redundancy checks


Download ppt "Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols."

Similar presentations


Ads by Google