Lecture 4 Project 1 posted, due September 15 (Thursday). Reminder: Wireshark Project 1 is due today, Homework 1 due on Thursday. Questions? Tuesday, September 6 CS 475 Networks - Lecture 4 1 Outline Chapter 1 - Getting Connected 2.1 Perspectives on Connecting 2.2 Encoding 2.3 Framing 2.4 Error Detection 2.5 Reliable Transmission 2.6 Ethernet 2.8 Wireless 2.9 Summary Tuesday, September 6 CS 475 Networks - Lecture 4 2 Introduction After connecting two hosts there are other issues to resolve before the two hosts can communicate: 1) How are bits encoded onto the medium? 2) How do we separate bits into frames? 3) How are errors detected? 4) How do we ensure reliability? 5) How is access controlled on a shared link? Tuesday, September 6 CS 475 Networks - Lecture 4 3 Perspectives on Connecting Recall that networks are constructed from nodes and links. Network needs to connect all types of links together to provide reliable and useful service to the higher layers of the protocol stack. Tuesday, September 6 Figure 2.1 End-user's view of the Internet CS 475 Networks - Lecture 4 4 Classes of Links 1) Speed of Propagation and frequency depends on medium (e.g. copper, optic fiber, air) WaveLength = SpeedOfPropagation/Frequency 2) Different encoding methods can be used to translate bits to “high” and “low” signals. 3) Different modulation methods can be used to translate the “high” and “low” signals to electronic waveforms. Tuesday, September 6 CS 475 Networks - Lecture 4 5 Classes of Links 4) How the links are used "Last mile" links to users. Long-distance backbone links, mostly optical fiber Building-wide LAN links, mostly Ethernet but also wireless Tuesday, September 6 Service Dial-up Bandwidth (typical) 28 – 56 kbps ISDN DSL CATV FTTH 64 – 128 kbps 128 kbps – 100 Mbps 1 – 40 Mbps 50 Mbps - 1 Gbps Table 2.1 Common services for home connections CS 475 Networks - Lecture 4 6 Encoding Most encoding/decoding functions are performed by a network adapter. Figure 2.3 Signals/bits flow between nodes Tuesday, September 6 CS 475 Networks - Lecture 4 7 NRZ Encoding There are several methods used to map (encode) bits to “high” and “low” signals. Nonreturn to zero (NRZ) is the simplest. Figure 2.4 NRZ encoding of a bitstream. Tuesday, September 6 CS 475 Networks - Lecture 4 8 NRZ Encoding There are two problems with NRZ: The receiver averages the signal to determine a detection threshold. A long stream of lows or highs can cause the threshold to drift from the desired value. Frequent transitions are needed for the receiver clock to maintain synchronization with the transmitter clock. A long stream of lows or highs may again cause problems. Tuesday, September 6 CS 475 Networks - Lecture 4 9 NRZI Encoding Nonreturn to Zero Inverted (NRZI) encoding uses a transition to represent a 1. No transition represents a 0. Figure 2.5 Different encodings Tuesday, September 6 CS 475 Networks - Lecture 4 10 Manchester Encoding NRZI fixes problems due to a stream of 1s, but does nothing to address the problems due to a stream of 0s. In Manchester encoding the NRZ signal is exclusive-or'ed with the clock signal. This results in a transition each clock period. With Manchester encoding the bit transmit rate is one-half the signal change rate (the baud rate). The encoding is considered to be 50% efficient. Tuesday, September 6 CS 475 Networks - Lecture 4 11 4B/5B Encoding In 4B/5B encoding, four bits are encoded as five bits in such a way that there are never more than three consecutive 0s. The bits are then further encoded using NRZI so consecutive 1s do not present a problem. 4B/5B coding is 80% efficient. Only 16 of the 32 five bit codes are needed for encoding, some of the remaining 16 codes are used for signaling (11111 – line idle) and control. Tuesday, September 6 CS 475 Networks - Lecture 4 12 In-class Exercise, Part 1 Problem 2.2 (page 153) The 4B/5B encoding table is on page 82. Tuesday, September 6 CS 475 Networks - Lecture 4 13 Framing In packet-switched networks packets (called frames at this level) are exchanged between hosts, not continuous bit streams. The central challenge is determining what set of bits make up a frame. Tuesday, September 6 CS 475 Networks - Lecture 4 14 Byte-Oriented Protocols In byte oriented framing protocols a frame is viewed as a collection of bytes. Two approaches (sentinel and byte-count) are used to indicate the message size. Tuesday, September 6 CS 475 Networks - Lecture 4 15 BISYNC - Binary Synchronous Communication The BISYNC format uses sentinel characters to mark the start of the frame (SYN) and the start and end of the message (STX & ETX). An ETX character in the body is “escaped” (preceded by) a DLE character. A DLE character is escaped by another DLE. This technique is known as character stuffing. Fig. 2.7 BISYNC Frame Format Tuesday, September 6 CS 475 Networks - Lecture 4 16 PPP - Point-to-Point Protocol PPP is often used over modem links to carry IP packets. It is also used on some fiber optic links. The protocol field is used to demultiplex high-level protocols (IP/IPX/LPC). PPP uses the Link Control Protocol (LPC) to negotiate the frame format, datagram size and escaped characters. Fig. 2.8 PPP Frame Tuesday, September 6 CS 475 Networks - Lecture 4 17 DDCMP - Digital Data Comm. Message Protocol Instead of using a sentinel character, DDCMP includes a Count field in the frame header that indicates the number of bytes in the body. Fig. 2.9 DDCMP Frame Tuesday, September 6 CS 475 Networks - Lecture 4 18 HDLC - High Level Data Link Control HDLC is a bit-oriented protocol that uses the bit sequence 01111110 to mark the start and end of the frame. Bit stuffing is used if this sequence appears anywhere else in the frame. After five 1s the transmitter inserts a 0. The receiver discards any 0 that appears after five 1s. Fig. 2.10 HDLC Frame Tuesday, September 6 CS 475 Networks - Lecture 4 19 Clock-Based Framing SONET - Synch. Optical Network A SONET STS-1 frame consists of 9 rows of 90 bytes. The first two bytes in the frame contain a special pattern to indicate the start of the frame. Fig. 2.11 A SONET STS-1 Frame Tuesday, September 6 CS 475 Networks - Lecture 4 20 SONET - Synch. Optical Network Each row contains three overhead bytes. The overhead bytes are encoded using NRZ. The payload bytes are scrambled by XORing them with a well-known bit pattern. The pattern is chosen to ensure enough transitions in the payload to maintain clock synchronization. Refer to the text for a more complete discussion of SONET. Tuesday, September 6 CS 475 Networks - Lecture 4 21 In-class Exercise, Part 2 Problem 2.7 (page 154) Problem 2.8 (page 154) Turn in the in-class exercises before you leave. Tuesday, September 6 CS 475 Networks - Lecture 4 22