Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 ITGN 235: Principles of Networking ITGN 225: Networking Fall 2007/2008.

Similar presentations


Presentation on theme: "1 ITGN 235: Principles of Networking ITGN 225: Networking Fall 2007/2008."— Presentation transcript:

1 1 ITGN 235: Principles of Networking ITGN 225: Networking Fall 2007/2008

2 2 Chapter 7 Packets Frames and Error Detection

3 3 Topics Covered 7.1 Introduction 7.2 The Concept Of Packets 7.3 Packets And Time-Division Multiplexing 7.4 Packets And Hardware Frames 7.5 Byte Stuffing 7.6 Transmission Errors 7.7 Parity Bits And Parity Checking 7.8 Probability, Mathematics, And Error Detection 7.9 Detecting Errors With Checksums 7.10 Detecting Errors With Cyclic Redundancy Checks 7.11 Combining Building Blocks 7.12 Burst Errors 7.13 Frame Format And Error Detection Mechanisms

4 4 7.1 Introduction This unit describes a fundamental idea in NW discusses the concept of packets explains how a sender and receiver coordinate to transfer a packet shows how packets can be implemented in a character- oriented NW using a simple frame format explains transmission errors discusses mechanisms that NW use to detect errors Later units expand the packet concept and describe how particular NW technologies handle packets

5 5 7.2 The Concept Of Packets (1) Most NWs do not send data as continuous streams of bits –NWs divides data into small blocks called packets Computer NWs are often called packet NW or packet- switching NW because they use packet technology Two facts motivate the use of packets: –First, a sender and receiver need to coordinate transmission to ensure that data arrives correctly: Dividing the data into small blocks helps a sender and receiver determine which blocks arrive intact and which do not –Second, communication circuits and the associated modem hardware are expensive multiple computers can share connections and HW to reduce costs

6 6 7.2 The Concept Of Packets (1) Packet switching network

7 7 7.2 The Concept Of Packets (2) Using small packets helps ensure fairness: To avoid having one computer hold a NW for an arbitrary time, modern NW enforce the use of packets –NW permits one computer to send a packet, then blocks that computer from sending again –Meanwhile the NW permits another computer to send a packet –A single computer can hold a shared resource only long enough to send a single packet –And must wait until other computers have a turn before sending a second packet If no data is available at the sender at some point during a communication, then no packet is transmitted over the network and no resources are wasted

8 8 7.2 The Concept Of Packets (3) Packet switching is a communications paradigm in which packets (discrete blocks of data) are routed between nodes over data links shared with other traffic.paradigmpacketsroutednodes In each network node, packets are queued or buffered, resulting in variable delay. This contrasts with the other principal paradigm, circuit switching, which sets up limited number of constant bit rate and constant delay connections between the nodes for their exclusive use for the duration of the communication.circuit switching Packet switching is used to optimize the use of the channel capacitychannel capacity available in a network, to minimize the transmission latencylatency (i.e. the time it takes for data to pass across the network), and to increase robustness of communication.robustness

9 9 7.2 The Concept Of Packets (4) Circuit switchingCircuit switching is the transmission technology that has been used since the first communication networks in the nineteenth century. In circuit switching, a caller must first establish a connection to a receiver before any communication is possible. During the connection establishment, resources are allocated between the sender and the receiver In circuit switching, resources remain allocated during the full length of a communication, after a circuit is established and until the circuit is terminated and the allocated resources are freed. Resources remain allocated even if no data is flowing on a circuit, hereby wasting link capacity when a circuit does not carry as much traffic as the allocation permits

10 10 7.2 The Concept Of Packets (4) CIRCUIT SWITCHING

11 11 7.2 The Concept Of Packets (5) PACKET SWITCHING

12 12 7.3 Packets And Time-Division Multiplexing Conceptually, a NW that permits many sources to take turns accessing a shared resource –providing a form of time-division multiplexing (TDM) –Figure 7.2 illustrates the idea Dividing data into small packets ensures that all sources receive prompt service –because it prohibits one source from gaining exclusive access for an arbitrarily long time Allowing sources to take turns sending packets guarantees –that a source with a small amount of data will finish promptly

13 13

14 14 7.4 Packets And Hardware Frames No universal agreement on the exact format of a packet Instead, each HW technology defines the details of packets and specifies how individual bits of the packet are transmitted –“frame” is a packet used with a NW the sender and receiver must agree on –how they will specify the beginning and end of each frame ASCII includes codes for unprintable characters: –We can use two of the unprintable ASCII characters to delimit a frame Figure 7.3 illustrates a frame The example framing scheme has disadvantages and advantages: –The chief disadvantage is overhead –The chief advantage is handling system failures and reboots

15 15

16 16 7.6 Transmission Errors Lightning, power surges, and other EM interference –can introduce unwanted electrical currents A small change in the electrical signal can –cause the receiver to misinterpret one or more bits of the data Interference can –cause permanent damage to NW equipment (lightening) –changes the signal –completely destroy a signal Error detectionError detection is the ability to detect the presence of errors caused by noise or other impairments during transmission from the transmitter to the receiver. Error correctionError correction is the additional ability to reconstruct of the original, error-free data. Not covered in this unit

17 17 Types of Errors an error occurs when a bit is altered between transmission and reception single bit errorssingle bit errors –only one bit altered –caused by white noise burst errorsburst errors –contiguous sequence of B bits in which first last and any number of intermediate bits in error –caused by impulse noise or by fading in wireless –effect greater at higher data rates Various error detection methods are used: –Parity checking –Checksum –Cyclic Redundancy Checks (CRC)

18 18 7.7 Parity Bits And Parity Checking (1) Fortunately, new communication systems do not experience frequent interference –local communication circuits often operate for years without serious problems –on a long-distance communication circuit may be so small that modems can handle all problems automatically Despite the low probability of error –we should provide HW and SW mechanisms to detect and correct such problems

19 19 7.7 Parity Bits And Parity Checking (2) Parity checking requires the sender –to compute an additional bit –called a parity bit –and to attach it to each character before sending The receiver –removes the parity bit –performs the same computation as the sender –and verifies that the result agrees with the value of the parity bit The parity computation is chosen such that –if one of the bits in the character is damaged in transit, the receiver's computation will not agree with the parity bit –the receiver will report that an error occurred. There are two forms of parity –even or odd –both the sender and receiver must agree

20 20 7.7 Parity Bits And Parity Checking (3) Parity refers to the number of bits set to 1 in the data item –Even parity - an even number of bits are 1 –Odd parity - an odd number of bits are 1 A parity bit is an extra bit transmitted with a data item, chose to give the resulting bits even or odd parity –Even parity - data: 10010001, parity bit 1 –Odd parity - data: 10010111, parity bit 0 If noise or other interference introduces an error, one of the bits in the data will be changed from a 1 to a 0 or from a 0 to a 1 Parity of resulting bits will be wrong –Original data and parity: 10010001+1 (even parity) 1 –Incorrect data: 10110001+1 (odd parity) Transmitter and receiver agree on which parity to use. Receiver detects error in data with incorrect parity

21 21 7.7 Parity Bits And Parity Checking (3) Limitation of parity bit checking: A parity bit is only guaranteed to detect an odd number of bit errors (one, three, five, and so on). If an even number of bits (two, four, six and so on) are flipped, the parity bit appears to be correct, even though the data are corrupt. Example: Even parity Data sent: 10010001, parity bit 1 => send 100100011 11 Data received (2 bit-errors): 111100011, (even parity: seems no errors occurred!) Noisy channels ---2 bit errors

22 22 7.8 Probability, Mathematics, And Error Detection Parity mechanism discussed above –works well to detect a single bit error, –but it cannot detect all possible errors There are several alternatives –In each mechanism, the sender transmits additional information along with the data –and the receiver uses the information to verify Differences among the mechanisms arise in three ways: –the size of the additional information –the computational complexity of the algorithm –and the number of bit errors that can be detected

23 23 7.9 Detecting Errors With Checksums (1) Many NW systems send a checksum along with each packet to help the receiver detect errors To compute a checksum –the sender treats the data as a sequence of binary integers and computes their sum –The data is not restricted to integer values it can contain characters, floating point numbers, or an image –The network system merely treats the data as a sequence of integers for purposes of computing a checksum Figure 7.6 illustrates a 16 -bit checksum computation The sender –treats each pair of characters as a 16 -bit integer –it computes the sum If the sum grows larger than 16 bits, the carry bits are added into the final sum

24 24

25 25 7.9 Detecting Errors With Checksums (2) The chief advantages arise from the size and ease of computation. –Most NW that employ a 16-bit or 32-bit checksum –compute a single checksum for an entire packet The small size of the checksum means –the cost of transmitting the checksum is usually much smaller than the cost of transmitting the data –the computation required to create or verify a checksum is small Checksums have the disadvantage of not detecting all common errors Figure 7.7 shows that a checksum is not sufficient to detect a transmission error that reverses a bit in each of four data items –Despite the changes, a receiver will declare that the packet has a valid checksum –Reversing the value of the second bit in each data item produces the same checksum

26 26

27 27 7.10 Detecting Errors With Cyclic Redundancy Checks (CRC) How can a NW detect more errors without increasing the amount of additional information in each packet? –The answer lies in Cyclic Redundancy Check (CRC) techniques CRC techniques are also used to verify that data has been recorded correctly on storage devices –such as magnetic disks Consider data in message as coefficients of a polynomial Divide that coefficient set by a known polynomial Transmit remainder as CRC –Good error detection properties –Easy to implement in hardware

28 28 7.10 Detecting Errors With Cyclic Redundancy Checks (CRC) A cyclic redundancy check (CRC) is a type of function that takes as input a data stream of any length and produces as output a value of a certain fixed size. A CRC can be used in the same way as a checksum to detect accidental alteration of data during transmission or storage.checksum CRCs are popular because they are simple to implement in binary hardware, are easy to analyze mathematically, and are particularly good at detecting common errors caused by noise in transmission channels.hardware There are many different CRC's - they are all computed in the same fashion but vary in length. The most common are 12, 16, and 32 bits.

29 29 7.10 Detecting Errors With Cyclic Redundancy Checks (CRC) CRC-16Example: CRC-16: –Polynomial used: x 16 +x 12 +x 5 +1 (x=bit being processed). Generates a 16-bit output value that can: 1.Detect all single bit and double bit errors 2.Detect all errors in cases where an odd number of bits is incorrect 3.Detect two pairs of adjacent errors (---xxxx---) 4.Detect all burst errors of 16 bits and fewer 5.Detect over 99.998% of all burst errors > 16 bits.

30 30 7.13 Frame Format And Error Detection Mechanisms NW usually associate error detection information with each frame –The sender calculates information such as a checksum or CRC –The receiver calculates the same value and compares it to the additional information that arrives in the frame Figure 7.11 illustrates a simple frame format


Download ppt "1 ITGN 235: Principles of Networking ITGN 225: Networking Fall 2007/2008."

Similar presentations


Ads by Google