Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Part II: Packet Transmission Packets on a Network Packets, Frames, LAN, WAN, Hardware Addresses, Bridges, Switches, Routing and Protocols Fall 2005 Qutaibah.

Similar presentations


Presentation on theme: "1 Part II: Packet Transmission Packets on a Network Packets, Frames, LAN, WAN, Hardware Addresses, Bridges, Switches, Routing and Protocols Fall 2005 Qutaibah."— Presentation transcript:

1 1 Part II: Packet Transmission Packets on a Network Packets, Frames, LAN, WAN, Hardware Addresses, Bridges, Switches, Routing and Protocols Fall 2005 Qutaibah Malluhi Computer Science and Engineering Qatar University

2 2 Packets, Frames and Error Detection

3 3 Packet and Circuit Switching  Circuit-switched networks (connection oriented) –Form a dedicated connection (circuit) between two points –Guaranteed capacity but high-cost (cost is fixed and is independent of the traffic) –E.g. telephone system  Computer networks are often called packet switched networks (Connectionless) –Data divided into small pieces (packets) –Each packet is sent individually

4 4 Motivation for Packet Switching  Coordination - helps transmitter and receiver determine which data have been received correctly and which have not –Better more efficient control on transmission errors  fair Access - each computer can only send one packet at a time  Resource sharing - allows multiple computers to have more effective sharing of the expensive network infrastructure –Most network use shared media which interconnect all computers –However - only one source can transmit data at a time

5 5 Dedicated (non packet-switched) Access  5MB file transferred across network with 56Kbps capacity will require 12 minutes: 5x10 6 bytes * 8 bits/byte ---------------------------------------------- = 11.9 minutes 60 secs/minute * 56x10 3 bits/second  All other computers will be forced to wait 12 minutes before initiating other transfers

6 6 Packet Switched Access  If a 5 MB file is broken into packets, other computers must only wait until packet (not entire file) has been sent  From previous example, suppose file is broken into 1000 byte packets –Each packet takes less than 0.15 seconds to transmit: 1000 bytes * 8 bits/byte ----------------------------------- = 0.143 seconds 56 * 10 3 bits/second  Other computer must only wait 0.143 seconds before beginning to transmit  Note: –If both files are both 5MB long, each now takes 24 minutes to transmit –BUT if second file is only 10KB long, it will be transmitted in only 2.8 seconds, while 5MB file still takes roughly 12 minutes Packet Switching provides fair and prompt access to shared network resources

7 7 Packets Allow Time Division Multiplexing  Dividing data into small packets conceptually permits providing a form of time-division multiplexing

8 8 Packets and frames  Packet is ``generic'' term that refers to a small block of data  Each hardware technology uses different packet format  Frame or hardware frame denotes a packet of a specific format on a specific hardware technology –Need to define a standard format for data to indicate the beginning and end of the frame »Header and trailer used to ``frame'' the data »Can choose two unused data values for framing. E.g., if data is limited to printable ASCII, can use u ``start of header'' (soh) u ``end of text'' (eot)

9 9 Frame Delimiters  Incurs extra overhead –soh and eot take time to transmit, but carry no data  Accommodates transmission problems: –Missing eot indicates sending computer crashed –Missing soh indicates receiving computer missed beginning of message –Bad frame is discarded

10 10 Data Stuffing  May not afford to reserve two special characters for framing –E.g., transmitting arbitrary binary data –soh and eot can be part of data will be misinterpreted as framing data  Solution: Bit stuffing and byte stuffing –Inserting extra data to encode reserved bytes –Sender and receiver must agree to encode special characters for unambiguous transmission  Example: –Byte stuffing translates each reserved byte into two unreserved bytes –For example, can use esc as prefix, followed by x for soh, y for eot and z for esc:

11 11 Byte Stuffing  Sender scans data and translates each reserved byte into the appropriate encoding pair of bytes  Receiver interprets pairs of bytes and retrieves encoded byte Data still framed by soh and eot

12 12 Bit-Oriented Frames/ Bit Stuffing  Delineate frame with a special bit pattern: 01111110  If bit pattern occurs at the data, use bit-stuffing –sender: insert bit 0 after five consecutive 1’s –receiver: if receive five consecutive 1’s, check next bit »if it is 0, remove it »if they are 10, mark the end of the frame »if they are 11, error

13 13 Transmission Errors  Transmission errors can occur due to interference from external electromagnetic signals –Data can be changed –Data can be lost –Unwanted data can be generated

14 14 Error detection and correction  Error detection –send additional information so incorrect data can be detected and rejected –retransmission used to recover from errors –Use for low error rate in data communication  Error correction –send additional information so incorrect data can be detected, corrected and accepted –higher overhead, used only if retransmission is impractical, such as simplex transmission, long delay, high error rate  No error control –real time traffic (e.g. real time voice and video) –does not require a 100% error rate

15 15 Error Detection Techniques  Will See three techniques –Parity –Checksum –Cyclic redundancy check (CRC)  Checksum and CRC are two widely used techniques

16 16 Parity Error Detection  A parity bit is an extra bit transmitted with a data item  Parity refers to the number of bits set to 1 in the data item –Even parity - an even number of bits are 1 »data: 10011101, parity bit 1 »use XOR to compute –Odd parity - an odd number of bits are 1 »data: 10011101, parity bit 0 »use XNOR to compute  Procedure: –Transmitter and receiver agree on which parity to use –Sender computes parity bit and sends it with data –If a transmission error changes one of the bits in the data from a 1 to a 0 or from a 0 to a 1, parity of resulting bits will be wrong –Receiver detects error in data because of incorrect parity  Parity can only detect odd or practically single-bit errors (not even bit errors)

17 17 Checksum  Treat data as a sequence of integers –Can be 8-, 16- or 32-bit integers  Compute and send arithmetic sum – Easy to compute –Checksum computed over data –Checksum appended to frame –Typically use 1s-complement arithmetic – Add carry to result  Example - 16-bit checksum with 1s complement arithmetic  Handles multiple bit errors  Cannot handle all errors

18 18 Checksum May Fail to Detect Errors  Second bit reversed in each item  Checksum is the same

19 19 Cyclic Redundancy Check (CRC)  Idea: given a k-bit frame, the transmitter generates an n- bit sequence known as the Cyclic Redundancy Check (CRC), so that the resulting (k+n)-bit frame is exactly divisible (modulo-2) by some predetermined number called a generator (specified by a generator polynomial).  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 –In practice can detect 99.98% of errors –Easy to implement in hardware

20 20 Cyclic Redundancy Check (CRC)  Commonly used polynomial generators: –CRC-12: –CRC-16: –CRC-CCITT:  Assume the degree of the generator is n  n zero bits appended to the end of the frame  Modulo-2 operations used to determine the remainder CRC  Sender sends the data plus CRC (notice that data plus CRC should be divisible by the generator polynomial)  Receiver performs the modulo-2 operations on (k+n)-bit frame (original data plus CRC) using the same generator  If the remainder is zeros, assume NO error. Otherwise, discard the frame.

21 21 Insight on CRC Computation u Data bits are 10011 u Generator polynomial (x 3 + 1) has degree 3 –I.e., 3 bit CRC u Therefore, append three check bits to the data bits, producing the code word 10011000 (x7+ x4+ x3). u If we divide the data codeword by the generator polynomial, the result has a remainder of 1. –The remainder constitute the CRC u Subtracting (same as adding/XORing) to the original data codeword word produces 10011001 (x7+ x4+ x3+ 1), which, is what get sent by the sender. –Notice that this should be divisible by the generator u If the receiver divides what he receives by the generator polynomial, the result should be zero if there are no errors.

22 22 CRC Computation Example (1) Generator Polynomial Data Quotient 1001 10011 001 SenderReceiver 10011001 Transmit Remainder (CRC)

23 23 Building Blocks For CRC  Exclusive or  Shift register –a shows status before shift –b shows status after shift –output same as top bit

24 24 Example Of CRC Hardware  Computes 16-bit CRC  Registers initialized to zero  Bits of message shifted in  CRC found in registers Uses the generator polynomial

25 25 CRC Computation Example (1) Generator Polynomial Data Quotient 1001 10011 001 SenderReceiver 10011001 Transmit Remainder (CRC) 000 001 010 100 001 1001100010011000 Shift Reg. _____ Input Bit _____ + input

26 26 CRC Computation Example (2) 0000 0001 0011 0111 1110 0111 1111 0101 1011 1101 0001 0010 0100 111001010000111001010000 Shift Reg. _____ Input Bit _____ + Input 11100101000 ++

27 27 Illustration Of Frame Using CRC  Error detection typically done for each frame  CRC cover data only  Error in frame typically causes receiver to discard frame

28 28 Summary  Packet technology –Invented to provide fair access in shared network –Sender divides data into small packets that travel independently  Packets specific to a particular hardware network technology are called frames  Each frame has a specific format that identifies the beginning and end of the frame  Data (bit or byte)-stuffing are needed when special characters appear in data  Error detection and correction is used to identify and isolate transmission errors  To detect transmission errors –Sender adds information to packet –Receiver checks


Download ppt "1 Part II: Packet Transmission Packets on a Network Packets, Frames, LAN, WAN, Hardware Addresses, Bridges, Switches, Routing and Protocols Fall 2005 Qutaibah."

Similar presentations


Ads by Google