Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 2: Direct Link Networks (Part One) Dr. Rocky K. C. Chang 30 January 2004.

Similar presentations


Presentation on theme: "1 Chapter 2: Direct Link Networks (Part One) Dr. Rocky K. C. Chang 30 January 2004."— Presentation transcript:

1 1 Chapter 2: Direct Link Networks (Part One) Dr. Rocky K. C. Chang 30 January 2004

2 2 0. Summary of the last lecture Classification of computer networks Four basic requirements for designing a computer network Network architectures Network programming

3 3 1. Overview of this chapter The lowest two layers: Physical layer Datalink layer Provide a virtual (unreliable) bit pipe to above Provide a virtual link for (unreliable) packets to above

4 4 1. Overview of this lecture Direct link networks: point-to-point links or shared media Five problems: –Bit synchronization –Frame synchronization –Error detection –Reliable link service –Multiple access control problem (for shared media only)

5 5 2. Some networking hardware Network nodes –Switches and routers (highly specialized hardware) –Hosts (general-purpose computers): CPU Cache Memory I/O bus Network adaptor (To network)

6 6 2.1 Network hosts Network adaptors and device drivers –All the networking functionality described in this chapter, except ARQ schemes, is implemented in the network adaptor. –The device driver interfaces between the network adaptor and the OS. Unparalleled performance improvement of memory latency and processor speed –A network host runs at memory speeds, not processor speeds. Take a look at a posted message titled “Solving the Memory Wall Workshop” in the discussion forum.

7 7 2.2 Network links A network link is a physical medium carrying signals in the form of electromagnetic waves. Cabling: –Local links (office, lab, campus): Twisted pairs, coaxial cables, and optical fibers –Leased links from carriers: T1, T3; and OC-N, where N = 1, 3, 9, 12, 18, 24, …. –Links to residential home: POTS, ISDN, xDSL, CATV, ATM, etc. –Wireless: radio, microwave, infrared, light; small area, cellular network, satellite network.

8 8 2.2 Network links Generally, a packet may go through different types of network link. –The slowest link determines the end-to-end throughput. Bandwidth –Narrowband vs. broadband (ISDN vs. B-ISDN) –Increase bandwidth either by operating in a higher frequency band or increase the signal-to-noise ratio –Upper bound on the link’s data rate: B  log 2 (1+S/N)

9 9 2.2 Network links Bluetooth is based on a global radio-frequency (RF) standard, operating on the 2.4 GHz ISM band. 3G mobile phone: 2,500MHz-2,690MHz band

10 10 2.2 Network links Sending binary bits onto a physical link (bit- serial transmission): –Encoding the bits before transmission for the purpose of bit synchronization to be discussed later) –Modulation: a process by which a property or a parameter (frequency, amplitude, phase) of a signal is varied in proportion to a second signal. For encoding binary data onto electromagnetic signals –Signals are carried in the form of electromagnetic waves.

11 11 3. The five problems Assume modulation schemes given. Five problems: –Bit synchronization (need additional encoding data, such as from Manchester encoding, to delineate bits) –Frame synchronization (need additional protocols to delineate frames) –Error detection (need additional algorithms to detect errors, if occurred) –Reliable link service (need additional schemes to recover from errors) –Multiple access control problem (for shared media only; need additional protocols to share the medium)

12 12 3.1 An Ethernet network adaptor LAN controllerManchester codecTransceiver System bus interface 802.3 MAC TX FIFO RX FIFO TX RX Data out Data in Control in Physical signalling Medium attach- ment unit HOST BUSHOST BUS NETWORKNETWORK

13 13 4. Problem 1: Bit synchronization (BS) Problem: How does a receiver synchronize with a sender, so that bits can be decoded correctly from the signals? Signalling component Signal Bits Node Adaptor

14 14 4.1 BS: four encoding methods Assume that two discrete signals: high and low are used to encode 0s and 1s. Solutions: NRZ, NRZI, Manchester, and 4B/5B: Bits NRZ Clock Manchester NRZI 0010111101000010

15 15 4.2 BS: NRZ and NRZI Non-return to zero (NRZ) –0: a low signal; 1: a high signal –Problem: A consecutive of 0s or 1s causes baseline wander, as well as not providing enough signal transitions for bit synchronization. Non-return to zero inverted (NRZI) –1: making a transition from the current signal; 0: staying at the current signal. –Problem: The problem of having consecutive 0s remains.

16 16 4.3 BS: Manchester encoding Manchester encoding –0: low-to-high transition; 1: high-to-low transition (the result of exclusive-OR of the NRZ-encoded data with the clock) –Advantage: provide enough signal transitions for bit synchronization. –Disadvantage: double the rate of signal transitions. –Baud rate is the rate at which the signal changes. In this case, baud rate is double of data rate.

17 17 4.4 BS: 4B/5B encoding 4B/5B encoding –Insert a bit to every four bits of data, such that consecutive 0s or 1s will be broken up. –(breaking up consecutive 0s) Each code must have no more than one leading 0 and no more than two trailing 0s. E.g., 00110 and 01000 are not used. As a result, the encoded data would not contain more than 3 consecutive 0s. See Table 2.5 in the text for the encoding. –(breaking up consecutive 1s) The resulting 5-bits are transmitted using the NRZI encoding.

18 18 4.4 BS: 4B/5B encoding Data 5-bit codes 0000 11110 0001 01001 0010 10100 0011 10101 0100 01010 0101 01011 0110 01110 0111 01111 1000 10010 1001 10011 1010 10110 1011 10111 1100 11010 1101 11011 1110 11100 1111 11101

19 19 5. Problem 2: Frame synchronization (FS) Problem: Given that a receiver can synchronize bits sent by a sender, how does the receiver recognize bits belonging to the same frame? Frames Signalling component Signal Bits Node Adaptor

20 20 5.1 FS: IP over Ethernet For example, when an IP datagram is handed down to an Ethernet network adaptor, the IP datagram is sent out in an Ethernet frame. CRC Dest address Src address TypeData Type 0800 IP datagram

21 21 5.2 Several solutions Byte-oriented protocols (e.g. PPP) –Data unit in terms of bytes (ASCII, EBCDIC) –Sentinel approach vs. byte counting approach Bit-oriented protocols (e.g. HDLC, Ethernet) –Sentinel approach Clock-based framing (SONET) –It addresses both the framing and encoding problems.

22 22 5.3 Byte-oriented protocols Sentinel approach to framing –A special character 01111110 (0x7e) serves as a start-of-text character (flag field) –Character stuffing: escape this special character in the data by prepending it with an escape character 0x7d. 0x7e escaped to 0x7d, 0x5e 0x7d escaped to 0x7d, 0x5d

23 23 5.3 Byte-oriented protocols PPP’s frame structure: CRC Flag 7E Addr FF Control 03 Information IP datagram Protocol Flag 7E Protocol 0021

24 24 5.3 Byte-oriented protocols Byte-counting approach to framing, e.g. DECNET’s DDCMP –SYN character serves as a synchronization character. –The COUNT field specifies how many bytes are contained in the frame.

25 25 5.4 Bit-oriented protocols For example, High-Level Data Link Control (HDLC) protocol. –A special bit sequence 01111110 is transmitted when the link is idle. –When this sequence appears in the data, it is escaped using bit stuffing. HeaderBody 816 8 CRC Beginning sequence Ending sequence

26 26 5.4 Bit-oriented protocols: bit stuffing On sending side: –Except for transmitting the special 01111110 sequence, 0 is inserted after 5 consecutive 1s. On receiving side: –If five consecutive 1s arrive, if the next bit is 0, it must be a stuffed bit. It is therefore removed. If the next bit is 1, –If the next bit is 0, then the sequence indicates the end of the frame. –If the next bit is 1, there must be an error, and the whole frame is discarded.

27 27 5.4 Bit-oriented protocols: bit stuffing For example, –Original bit stream: 011011111111111111110010 –After bit stuffing by source: 011011111011111011111010010 –After bit de-stuffing by receiver: 011011111111111111110010 What happens if transmission errors –occurred to the stuffed bits? –occurred to the nonstuffed bits?

28 28 6. Problem 3: Error detection (ED) Transmission errors do occur, with different probabilities in different media. Two general approaches: –Error correction code (forward error correction) –Error detection code + an error correction mechanism when errors are detected. –Insert redundancy for error correction or detection. Common error detection methods: –Cyclic redundancy check (CRC) –Checksum

29 29 6.1 ED: error detection codes Error detection codes are usually inserted in more than one layer, e.g. –HTTP –TCP (16-bit checksum for the TCP header and data) –IPv4 (16-bit checksum for the IP header) –PPP/Ethernet (CRC-16, CRC-32 for the whole frame) Why don’t we just have CRCs on the datalink layer?

30 30 6.2 ED: two-dimensional parity The 2-dim parity catches all 1-, 2-, and 3-bit errors, and most 4-bit errors. 10111101 11010010 0101001 1 10111110 01101001 0001110 1 11110110 Parity bits Parity byte Data

31 31 6.3 ED: Checksum Add up all the words that are transmitted and then transmit the result of that sum. –If any transmitted data, including the checksum itself, is corrupted, then the results will not match. Internet checksum: –A sender add 16-bit words using ones complement arithmetic, and then take ones complement of the result. The result is stored in the checksum field. –A receiver performs 16-bit checksum. If no error, the checksum should give all 1s.

32 32 6.3 ED: Checksum Ones complement arithmetic: –A negative integer -x is represented as the complement of x. –A carryout from the most significant bit needs to be added to the result. For example: 4-bit word checksum –Data: 1010 1100, and its checksum: 1000. –Data sent: 1010 1100 1000 –Receiver adds all the data sent in 4-bit word in ones complement, which gives 1111.

33 33 6.3 ED: Checksum Advantages: –Use a relatively small number of bits. –Easy to implement in software. Disadvantages: –Not a strong error detection algorithm, as compared with CRC

34 34 6.4 ED: cyclic redundancy check (CRC) Think of an (n+1)-bit message, M(x), as a polynomial of degree n, e.g. –10011010 as –1  x 7 + 0  x 6 + 0  x 5 + 1  x 4 + 1  x 3 + 0  x 2 + 1  x 1 + 0  x 0. Given a divisor polynomial of order k, C(x), find a code word of k bits, such that M(x) concatenated with the code word is divisible by C(x). –P(x) is a concatenation of M(x) and the code word.

35 35 6.4 ED: cyclic redundancy check For example, C(x) = 1  x 3 + 1  x 2 + 0  x 1 + 1  x 0. –The computed code word is 101. –P(x) is given by 10011010 concatenated with 101, or 1  x 10 + 0  x 9 + 0  x 8 + 1  x 7 + 1  x 6 + 0  x 5 + 1  x 4 + 0  x 3 + 1  x 2 + 0  x 1 + 1  x 0. –One may verify that P(x) is divisible by C(x), i.e. 0 remainder. –Errors can be detected when the remainder is not zero when a receiver divides P(x) by C(x).

36 36 6.4 ED: cyclic redundancy check To obtain the code word, –Divide 1  x 10 + 0  x 9 + 0  x 8 + 1  x 7 + 1  x 6 + 0  x 5 + 1  x 4 + 0  x 3 + 0  x 2 + 0  x 1 + 0  x 0 by 1  x 3 + 1  x 2 + 0  x 1 + 1  x 0. –Subtraction is performed by an exclusive-OR operation (XOR). –The result is a 3-bit remainder, one bit less than the divisor polynomial. –It can be implemented efficiently in hardware.

37 37 6.4 ED: cyclic redundancy check Generator 1101 11111001 10011010000 Message 1101 1001 1101 1000 1101 1011 1101 1100 1101 1000 1101 101Remainder

38 38 6.4 ED: cyclic redundancy check Choice of the divisor polynomial: –Express a corrupted message received by a receiver as P(x) + E(x), where E(x) is an error polynomial. –Errors go undetected if E(x) is divisible by C(x). For example, the CRC can catch –all single-bit errors if the x k and x 0 terms in C(x) have nonzero coefficients, and –any odd number of errors if C(x) contains the factor (x+1). Refer to p.102 of the text for common C(x)s. –CRC-8/10/12/16/32


Download ppt "1 Chapter 2: Direct Link Networks (Part One) Dr. Rocky K. C. Chang 30 January 2004."

Similar presentations


Ads by Google